From c9731a8ba92450ea2f5098799344544b7aa541c9 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 25 Jul 2021 21:26:28 +0100 Subject: [PATCH 001/681] Start v0.3.4.1+1 --- distribution/changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 2ce75c15bd..28132ea81c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,3 +1,6 @@ +0.3.4.1+ (in development) +------------------------------------------------------------------------ + 0.3.4.1 (2021-07-25) ------------------------------------------------------------------------ - Fix: [#15028] Crash when placing large scenery. From dab33b3347cd239f7ffeb52fbd9f7af6c6f39d4f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 26 Jul 2021 00:39:39 +0300 Subject: [PATCH 002/681] Add version to the crash dump info --- src/openrct2/platform/Crash.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 0f311fee91..c3fe60b9ff 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -69,6 +69,7 @@ static bool UploadMinidump(const std::map& files, in L"post?format=minidump&token=" BACKTRACE_TOKEN); std::map parameters; parameters[L"product_name"] = L"openrct2"; + parameters[L"version"] = String::ToWideChar(gVersionInfoFull); // In case of releases this can be empty if (wcslen(_wszCommitSha1Short) > 0) { @@ -336,7 +337,7 @@ CExceptionHandler crash_init() auto exHandler = new google_breakpad::ExceptionHandler( GetDumpDirectory(), 0, OnCrash, 0, google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpWithDataSegs, PipeName, 0); return reinterpret_cast(exHandler); -#else // USE_BREAKPAD +#else // USE_BREAKPAD return nullptr; #endif // USE_BREAKPAD } From 4f80ef50eff75d674a884784f14464477182ea57 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 26 Jul 2021 21:17:17 +0200 Subject: [PATCH 003/681] Fix #15086: Crash in vehicle_create_trains() --- src/openrct2/ride/Ride.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index f2f9e31f12..06b77e8b7f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -4330,6 +4330,9 @@ static void vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPo remainingDistance = 0; } train_ref train = vehicle_create_train(rideIndex, trainsPos, vehicleIndex, &remainingDistance, trackElement); + if (train.head == nullptr || train.tail == nullptr) + continue; + if (vehicleIndex == 0) { firstTrain = train; From d880fbda56e92d2c1059979111535e5eb2890c87 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 26 Jul 2021 21:17:33 +0200 Subject: [PATCH 004/681] Use constant for RCT1 max map size --- src/openrct2/rct1/S4Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index d5e96e1f2f..c60234fa38 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -462,7 +462,7 @@ private: void AddAvailableEntriesFromMap() { - size_t maxTiles = 128 * 128; + size_t maxTiles = RCT1_MAX_MAP_SIZE * RCT1_MAX_MAP_SIZE; size_t tileIndex = 0; RCT12TileElement* tileElement = _s4.tile_elements; From ba6407f649d926b88654186719df12e620d89ca9 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 26 Jul 2021 21:23:41 +0200 Subject: [PATCH 005/681] Fix #5465: improper types in Objective::CheckGuestsBy() --- src/openrct2/scenario/Scenario.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f8ebac8c36..657db21cdd 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -711,8 +711,8 @@ void scenario_remove_trackless_rides(rct_s6_data* s6) ObjectiveStatus Objective::CheckGuestsBy() const { - int16_t parkRating = gParkRating; - int32_t currentMonthYear = gDateMonthsElapsed; + auto parkRating = gParkRating; + auto currentMonthYear = gDateMonthsElapsed; if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion()) { From 6405d0246c844b37a2fb8d30324e54df82e44bba Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 26 Jul 2021 22:23:03 +0200 Subject: [PATCH 006/681] Fix #14612: Crash in research_insert_ride_entry() --- src/openrct2/management/Research.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 8aaf119e70..5c0041927c 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -507,6 +507,9 @@ bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, R void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched) { rct_ride_entry* rideEntry = get_ride_entry(entryIndex); + if (rideEntry == nullptr) + return; + for (auto rideType : rideEntry->ride_type) { if (rideType != RIDE_TYPE_NULL) From 399bd15d5e01c1ce77e43f36d0b4c6cb4d981724 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 27 Jul 2021 04:07:29 +0000 Subject: [PATCH 007/681] Merge Localisation/master into OpenRCT2/develop --- data/language/zh-TW.txt | 139 ++++++++++++++++++++++++++++++++++------ 1 file changed, 118 insertions(+), 21 deletions(-) diff --git a/data/language/zh-TW.txt b/data/language/zh-TW.txt index 0d8ec78805..48b2e1fd34 100644 --- a/data/language/zh-TW.txt +++ b/data/language/zh-TW.txt @@ -94,6 +94,8 @@ STR_0089 :迷你雲霄飛車 STR_0090 :礦遊式雲霄飛車 STR_0091 :Unknown Ride (59) STR_0092 :直線電動機發車雲霄飛車 +STR_0093 :混合式雲霄飛車 +STR_0094 :單軌式雲霄飛車 STR_0512 :一款帶有螺旋式鏈條坡道, 以及順滑又彎曲的下坡的雲霄飛車 STR_0513 :一款乘客需要以站立乘坐的迴環式雲霄飛車 STR_0514 :列車懸吊在雲霄飛車的軌道下, 並會在拐彎的時候搖擺乘客到旁邊 @@ -173,6 +175,8 @@ STR_0598 :反轉式雲霄飛車加速離開車站, 穿過到垂直軌道的 STR_0599 :一款擁有獨立車輛及順滑又彎曲的下坡的緊湊式雲霄飛車 STR_0600 :有動車的採礦列車遊走在順滑但又曲折的軌道配置中 STR_0602 :雲霄飛車列車由直線發動機加速離開車站, 穿過盤繞的倒轉軌道後回到車站 +STR_0603 :一款木製的列車配上鋼鐵軌道的雲霄飛車, 使它能擁有陡下坡及倒轉軌道. +STR_0604 :遊客乘坐在單人形式的車輛中於狹窄的單軌上穿梭於緊密的倒轉軌道及方向轉變. STR_0767 :遊客{INT32} STR_0768 :清潔工人{INT32} STR_0769 :維修人員{INT32} @@ -1574,7 +1578,7 @@ STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F STR_2218 :{RED}{STRINGID}, {STRINGID}的一部份, 尚未返回到{STRINGID}!{NEWLINE}檢查是否被卡住或被停止了 -STR_2219 :{RED}{COMMA16}人已喪生於{STRINGID}的意外中 +STR_2219 :{RED}{COMMA16}人已於{STRINGID}的意外中喪生 STR_2220 :{WINDOW_COLOUR_2}樂園評價: {BLACK}{COMMA16} STR_2221 :樂園評價: {COMMA16} STR_2222 :{BLACK}{STRINGID} @@ -1959,14 +1963,14 @@ STR_2749 :我的新劇情 STR_2750 :移到所有物件至最頂部 STR_2751 :移到所有物件至最底部 STR_2752 :無雜草的草地 -STR_2753 :除好草的草地 +STR_2753 :為草地除草 STR_2754 :灌溉花圃 STR_2755 :修復被毀壞的物件 STR_2756 :移除垃圾 STR_2763 :??? STR_2765 :添加超多遊客到訪 STR_2766 :贏得此劇情 -STR_2767 :靜止天氣 +STR_2767 :禁止天氣變化 STR_2769 :開放樂園 STR_2770 :關閉樂園 STR_2773 :視窗化 @@ -2422,8 +2426,8 @@ STR_3329 :尚未建造樂園入口 STR_3330 :樂園必需有一些己擁有的土地 STR_3331 :由地圖邊緣到樂園入口的道路尚未連接好, 或者太複雜 - 這些道路必需是一格寬度, 並以越少交界及彎位越好 STR_3332 :樂園入口倒轉了, 或沒有道路連接至地圖邊緣 -STR_3333 :在存檔中導出附加物件 -STR_3334 :選擇是否儲存附加物件(額外加入的附加物件)到存檔, 以便沒有那些附加物件的人載入存檔 +STR_3333 :在存檔中導出自訂物件 +STR_3334 :選擇是否儲存自訂物件(額外加入的附加物件)到存檔, 以便沒有那些自訂物件的玩家載入存檔 STR_3335 :軌道設計工具 - 選擇要設計的雲霄飛車的類型及車輛種類 STR_3336 :軌道設計管理工具 - 選擇要管理的遊樂設施的類型 STR_3338 :{BLACK}自訂設計 @@ -2874,7 +2878,7 @@ STR_5554 :啟用山丘工具 STR_5555 :顯示來自其他類型軌道的車輛種類 STR_5556 :踢除玩家 STR_5557 :多人遊戲不同步時依然保持連線 -STR_5558 :此設定會於重啟遊戲後生效 +STR_5558 :此設定只會於重啟OpenRCT2後生效 STR_5559 :檢查時距為10分鐘 STR_5560 :將所有遊樂設施的檢查時距設定為'每10分鐘' STR_5561 :載入語言失敗 @@ -3007,7 +3011,7 @@ STR_5721 :陰天 STR_5722 :有雨 STR_5723 :大雨 STR_5724 :雷暴 -STR_5725 :{BLACK}強制設定天氣為: +STR_5725 :{BLACK}設定天氣為: STR_5726 :設定樂園目前的天氣 STR_5727 :縮放品質: STR_5731 :線性 @@ -3146,7 +3150,7 @@ STR_5867 :{WINDOW_COLOUR_2}提供者名稱: {BLACK}{STRING} STR_5868 :{WINDOW_COLOUR_2}提供者電郵: {BLACK}{STRING} STR_5869 :{WINDOW_COLOUR_2}提供者網站: {BLACK}{STRING} STR_5870 :顯示伺服器資訊 -STR_5871 :植物不會老死 +STR_5871 :禁止植物枯萎 STR_5872 :禁止植物的老化, 令他們不會枯萎. STR_5873 :容許在所有軌道配置中使用鏈條 STR_5874 :容許將任何軌道變成有鏈條裝置的軌道 @@ -3292,18 +3296,18 @@ STR_6014 :遊客只會付費乘搭遊樂設施及物品.{NEWLINE}他們不會 STR_6015 :斜道 STR_6016 :更改方格 STR_6017 :請減慢操作速度 -STR_6018 :建造遊樂設施 - 轉左 -STR_6019 :建造遊樂設施 - 轉右 -STR_6020 :建造遊樂設施 - 使用預設軌道 -STR_6021 :建造遊樂設施 - 下坡 -STR_6022 :建造遊樂設施 - 上坡 -STR_6023 :建造遊樂設施 - 使用/禁用鏈條坡道 -STR_6024 :建造遊樂設施 - 向左傾斜 -STR_6025 :建造遊樂設施 - 向右傾斜 -STR_6026 :建造遊樂設施 - 上一軌道 -STR_6027 :建造遊樂設施 - 下一軌道 -STR_6028 :建造遊樂設施 - 建造當前選定的軌道 -STR_6029 :建造遊樂設施 - 移除當前選定的軌道 +STR_6018 :建造 - 轉左 +STR_6019 :建造 - 轉右 +STR_6020 :建造 - 使用預設軌道 +STR_6021 :建造 - 下坡 +STR_6022 :建造 - 上坡 +STR_6023 :建造 - 使用/禁用鏈條坡道 +STR_6024 :建造 - 向左傾斜 +STR_6025 :建造 - 向右傾斜 +STR_6026 :建造 - 上一軌道 +STR_6027 :建造 - 下一軌道 +STR_6028 :建造 - 建造當前選定的軌道 +STR_6029 :建造 - 移除當前選定的軌道 STR_6030 :景物選取器. 點撃選取地圖上的景物來建造相同的景物. STR_6031 :伺服器描述: STR_6032 :伺服器歡迎訊息: @@ -3311,7 +3315,7 @@ STR_6033 :夢幻遊樂園(RCT1)安裝路徑: STR_6034 :{BLACK}{STRING} STR_6035 :請選擇已安裝夢幻遊樂園(RCT1)的文件夾 STR_6036 :清除 -STR_6037 :請選擇一個正確的夢幻遊樂園(RCT1)文件夾 +STR_6037 :已選擇的文件夾並沒有夢幻遊樂園(RCT1)的安裝資料. STR_6038 :如果你已安裝夢幻遊樂園(RCT1), 請於此選項設置它的安裝路徑, 以便載入劇情, 音樂等物件. STR_6039 :快速拆除遊樂設施 STR_6040 :編輯劇情選項 @@ -3610,6 +3614,92 @@ STR_6360 :{BLACK}{COMMA32} STR_6361 :啟用遊樂設施的燈光效果 (實驗性質) STR_6362 :當啟用此選項時, 所有在擁有軌道的遊樂設施中的車輛將會於晚中被照亮. STR_6363 :複製文字到剪貼簿 +STR_6364 :{RED}{COMMA16}人已於{STRINGID}的意外中喪生 +STR_6365 :於遊樂設施中發生的傷亡 +STR_6366 :卡住或被停止了的車輛 +STR_6367 :{WINDOW_COLOUR_2}動畫影格: +STR_6368 :因為兼容性原因, 不建議以Wine上運行OpenRCT2. OpenRCT2能原生支援macOS, Linux, FreeBSD及OpenBSD. +STR_6369 :允許在不合理的高度上建造軌道 +STR_6370 :{SMALLFONT}{BLACK}允許在任何高度上放置軌道選項 +STR_6371 :已選擇的路徑含有夢幻遊樂園(RCT1)的安裝資料, 不過當中找不到“csg1i.dat”. 請在夢幻遊樂園 (RCT1)的安裝光碟中複製該文件到硬碟上的文件夾. +STR_6372 :已選擇的路徑含有夢幻遊樂園(RCT1)的安裝資料, 不過此版本不能於OpenRCT2中使用. OpenRCT2需要夢幻遊樂園: 資料片2(Loopy Landscapes)或模擬樂園2002(RCT Deluxe)的安裝資料以使用夢幻遊樂園(RCT1)的資料. +STR_6373 :開關阻礙檢查 +STR_6374 :阻礙檢查已關閉 +STR_6375 :未知遊樂設施 +STR_6376 :{WINDOW_COLOUR_2}遊樂設施車輛:{NEWLINE}{BLACK}{STRINGID}於{STRINGID}內 +STR_6377 :{WINDOW_COLOUR_2}種類: {BLACK}{STRINGID}於{STRINGID}內 +STR_6378 :正在接收物件列表: {INT32} / {INT32} +STR_6379 :已接收不正確的資料 +STR_6384 :雪 +STR_6385 :大雪 +STR_6386 :暴風雪 +STR_6387 :不能在此降低元素… +STR_6388 :不能在此升高元素… +STR_6389 :不正確的阻礙 +STR_6390 :OpenRCT2需要原模擬樂園2 (RCT2)的文件才可以運行. 請選擇已安裝模擬樂園2 (RCT2)的文件夾. +STR_6391 :請選擇已安裝模擬樂園2 (RCT2)的文件夾. +STR_6392 :無法於此路徑中找到{STRING}. +STR_6393 :目標選擇 +STR_6394 :目標 +STR_6395 :維修 +STR_6396 :禁止螢幕保護程式及監測省電選項 +STR_6397 :{SMALLFONT}{BLACK}勾選後, 螢幕保護程式及其他螢幕省電功能將會於OpenRCT2運行時被抑制. +STR_6398 :文件中含有不支持的遊樂設施類別. 請更新你的OpenRCT2. +STR_6399 :OpenRCT2需要原模擬樂園2 (RCT2)的文件才可以運行. 請在config.ini中設置“game_path”變數為模擬樂園2 (RCT2)的文件夾後, 再重新啟動OpenRCT2. +STR_6400 :我已下載模擬樂園2 (RCT2)的GOG離線安裝程式, 但尚未安裝 +STR_6401 :我已安裝模擬樂園2 (RCT2) +STR_6402 :OpenRCT2資料安裝 +STR_6403 :請選擇最合適的選項 +STR_6404 :請選擇模擬樂園2 (RCT2)的GOG離線安裝程式. +STR_6405 :選擇GOG離線安裝程式 +STR_6406 :模擬樂園2 (RCT2)的GOG離線安裝程式 +STR_6407 :請稍候片刻. +STR_6408 :請安裝“innoextract”以解壓GOG離線安裝程式, 然後再重新啟動OpenRCT2. +STR_6409 :已選擇的文件並不是模擬樂園2 (RCT2)的GOG離線安裝程式. 你可能下載了GOG Galaxy的安裝程式或選擇了不正確的文件. +STR_6410 :放大/縮小 +STR_6411 :於工具列上顯示放大及縮小的按鈕 +STR_6412 :NumPad Enter +STR_6413 :Shift +STR_6414 :左Shift +STR_6415 :右Shift +STR_6416 :Ctrl +STR_6417 :左Ctrl +STR_6418 :右Ctrl +STR_6419 :Alt +STR_6420 :左Alt +STR_6421 :右Alt +STR_6422 :Cmd +STR_6423 :左Cmd +STR_6424 :右Cmd +STR_6425 :手把左 +STR_6426 :手把右 +STR_6427 :手把上 +STR_6428 :手把下 +STR_6429 :手把 {INT32} +STR_6430 :左鍵 +STR_6431 :右鍵 +STR_6432 :滑鼠 {INT32} +STR_6433 :移除 +STR_6434 :移除此快捷鍵的所有鍵位. +STR_6435 :{WINDOW_COLOUR_2}已阻止的毀壞: {BLACK}{COMMA16} +STR_6436 :開關隱形狀況 +STR_6437 :隱形 +STR_6438 :隱形 +STR_6439 :地圖網格檢查工具: 開關隱形狀況 +STR_6440 :透明水域 +STR_6441 :請選擇至少一個非輪候區道路路面物件. +STR_6442 :請選擇至少一個輪候區道路路面物件. +STR_6443 :請選擇至少一個道路扶手物件. +STR_6444 :道路路面 +STR_6445 :道路扶手 +STR_6446 :{WINDOW_COLOUR_2}路面名稱: {BLACK}{STRINGID} +STR_6447 :{WINDOW_COLOUR_2}扶手名稱: {BLACK}{STRINGID} +STR_6448 :不支持的物件格式 +STR_6449 :{WINDOW_COLOUR_2}曲目: +STR_6450 :{BLACK}“{STRING}” +STR_6451 :{BLACK}“{STRING}” - {STRING} +STR_6452 :{WINDOW_COLOUR_2}已售出: {BLACK}{STRING} +STR_6453 :複製版本資訊 ############# # Scenarios # @@ -4348,3 +4438,10 @@ STR_SCNR :搖滾-搖滾 STR_PARK :搖滾復興 STR_DTLS :這個過時的主題樂園曾經有過輝煌的日子。請協助所有者將讓這個主題樂園再次搖滾起來,讓這個地方成為成功的企業。 +############################################################################### +## Official Custom Content Scenarios +############################################################################### + +STR_SCNR :Panda World +STR_PARK :Panda World +STR_DTLS :在這以熊貓為主題的樂園中增加更多遊樂設施以吸引更多遊客到訪 From e9eb1b8304fdc461b6f7386e7b2fa9137012070d Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 27 Jul 2021 10:25:58 +0100 Subject: [PATCH 008/681] Banner Refactor from NSF (#14788) * Banner refactor * Fix mistake in fix_duplicated_banners * Reduce limit back * Fix export * Free banner on delete * Increment network version * Fix potential banner pointer crashes Co-authored-by: Ted John --- .../interface/ViewportInteraction.cpp | 20 +- src/openrct2-ui/windows/Banner.cpp | 48 +++-- src/openrct2-ui/windows/Sign.cpp | 27 ++- src/openrct2-ui/windows/TileInspector.cpp | 6 +- src/openrct2-ui/windows/TopToolbar.cpp | 20 +- src/openrct2/Editor.cpp | 11 +- src/openrct2/actions/BannerPlaceAction.cpp | 57 +++--- src/openrct2/actions/BannerPlaceAction.h | 16 +- src/openrct2/actions/BannerRemoveAction.cpp | 14 +- .../actions/BannerSetColourAction.cpp | 6 +- src/openrct2/actions/BannerSetNameAction.cpp | 11 +- src/openrct2/actions/BannerSetStyleAction.cpp | 15 +- .../actions/LargeSceneryPlaceAction.cpp | 99 ++++------ .../actions/LargeSceneryPlaceAction.h | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 10 +- src/openrct2/actions/SignSetNameAction.cpp | 8 +- src/openrct2/actions/SignSetStyleAction.cpp | 10 +- src/openrct2/actions/WallPlaceAction.cpp | 50 ++--- src/openrct2/actions/WallPlaceAction.h | 3 +- src/openrct2/interface/InteractiveConsole.cpp | 10 +- src/openrct2/network/NetworkBase.cpp | 2 +- .../paint/tile_element/Paint.Wall.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 22 ++- src/openrct2/rct2/S6Exporter.cpp | 9 +- src/openrct2/rct2/S6Importer.cpp | 39 +++- src/openrct2/world/Banner.cpp | 177 +++++++++++++----- src/openrct2/world/Banner.h | 10 +- src/openrct2/world/TileElement.cpp | 2 +- src/openrct2/world/TileInspector.cpp | 14 +- 29 files changed, 415 insertions(+), 305 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 5bd98c98fc..eb1628903d 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -423,15 +423,19 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor case ViewportInteractionItem::Banner: { auto banner = tileElement->AsBanner()->GetBanner(); - auto* bannerEntry = get_banner_entry(banner->type); + if (banner != nullptr) + { + auto* bannerEntry = get_banner_entry(banner->type); - auto ft = Formatter(); - ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); - banner->FormatTextTo(ft, /*addColour*/ true); - ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); - ft.Add(bannerEntry->name); - SetMapTooltip(ft); - return info; + auto ft = Formatter(); + ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); + banner->FormatTextTo(ft, /*addColour*/ true); + ft.Add(STR_MAP_TOOLTIP_STRINGID_CLICK_TO_MODIFY); + ft.Add(bannerEntry->name); + SetMapTooltip(ft); + return info; + } + break; } default: break; diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 8a7f372593..eae4fac74f 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -74,7 +74,6 @@ static rct_widget window_banner_widgets[] = { class BannerWindow final : public Window { private: - Banner* _banner; CoordsXYZ _bannerViewPos; void CreateViewport() @@ -91,12 +90,13 @@ private: BannerElement* GetBannerElement() { - if (_banner == nullptr) + auto* banner = GetBanner(number); + if (banner == nullptr) { return nullptr; } - TileElement* tileElement = map_get_first_element_at(_banner->position.ToCoordsXY().ToTileCentre()); + TileElement* tileElement = map_get_first_element_at(banner->position.ToCoordsXY().ToTileCentre()); if (tileElement == nullptr) { return nullptr; @@ -131,24 +131,29 @@ public: void Initialise(rct_windownumber _number) { number = _number; - _banner = GetBanner(number); + auto* banner = GetBanner(number); auto* bannerElement = GetBannerElement(); if (bannerElement == nullptr) return; - _bannerViewPos = CoordsXYZ{ _banner->position.ToCoordsXY().ToTileCentre(), bannerElement->GetBaseZ() }; + _bannerViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), bannerElement->GetBaseZ() }; CreateViewport(); } void OnMouseDown(rct_widgetindex widgetIndex) override { rct_widget* widget = &widgets[widgetIndex]; - + auto* banner = GetBanner(number); + if (banner == nullptr) + { + Close(); + return; + } switch (widgetIndex) { case WIDX_MAIN_COLOUR: - WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), _banner->colour); + WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), banner->colour); break; case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON: @@ -165,13 +170,19 @@ public: { 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); + Dropdown::SetChecked(banner->text_colour - 1, true); break; } } void OnMouseUp(rct_widgetindex widgetIndex) override { + auto* banner = GetBanner(number); + if (banner == nullptr) + { + Close(); + return; + } switch (widgetIndex) { case WIDX_CLOSE: @@ -180,23 +191,23 @@ public: case WIDX_BANNER_DEMOLISH: { auto* bannerElement = GetBannerElement(); - if (_banner == nullptr || bannerElement == nullptr) + if (bannerElement == nullptr) break; auto bannerRemoveAction = BannerRemoveAction( - { _banner->position.ToCoordsXY(), bannerElement->GetBaseZ(), bannerElement->GetPosition() }); + { banner->position.ToCoordsXY(), bannerElement->GetBaseZ(), bannerElement->GetPosition() }); GameActions::Execute(&bannerRemoveAction); break; } case WIDX_BANNER_TEXT: window_text_input_raw_open( - this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, _banner->GetText().c_str(), 32); + this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, banner->GetText().c_str(), 32); break; case WIDX_BANNER_NO_ENTRY: { textinput_cancel(); auto bannerSetStyle = BannerSetStyleAction( - BannerSetStyleType::NoEntry, number, _banner->flags ^ BANNER_FLAG_NO_ENTRY); + BannerSetStyleType::NoEntry, number, banner->flags ^ BANNER_FLAG_NO_ENTRY); GameActions::Execute(&bannerSetStyle); break; } @@ -254,10 +265,15 @@ public: void OnPrepareDraw() override { + auto* banner = GetBanner(number); + if (banner == nullptr) + { + return; + } rct_widget* colourBtn = &window_banner_widgets[WIDX_MAIN_COLOUR]; colourBtn->type = WindowWidgetType::Empty; - auto* bannerEntry = get_banner_entry(_banner->type); + auto* bannerEntry = get_banner_entry(banner->type); if (bannerEntry != nullptr && (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)) { colourBtn->type = WindowWidgetType::ColourBtn; @@ -265,15 +281,15 @@ public: 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) + 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 = SPRITE_ID_PALETTE_COLOUR_1(_banner->colour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; + colourBtn->image = SPRITE_ID_PALETTE_COLOUR_1(banner->colour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; rct_widget* dropDownWidget = &window_banner_widgets[WIDX_TEXT_COLOUR_DROPDOWN]; - dropDownWidget->text = BannerColouredTextFormats[_banner->text_colour]; + dropDownWidget->text = BannerColouredTextFormats[banner->text_colour]; } }; diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index fd4f8176eb..28836b9741 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -58,13 +58,13 @@ class SignWindow final : public Window { private: bool _isSmall = false; - Banner* _banner = nullptr; void ShowTextInput() { - if (_banner != nullptr) + auto* banner = GetBanner(number); + if (banner != nullptr) { - auto bannerText = _banner->GetText(); + auto bannerText = banner->GetText(); window_text_input_raw_open(this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, bannerText.c_str(), 32); } } @@ -87,12 +87,13 @@ public: { number = windowNumber; _isSmall = isSmall; - - _banner = GetBanner(number); - if (_banner == nullptr) + auto* banner = GetBanner(number); + if (banner == nullptr) + { return false; + } - auto signViewPosition = _banner->position.ToCoordsXY().ToTileCentre(); + auto signViewPosition = banner->position.ToCoordsXY().ToTileCentre(); auto* tileElement = banner_get_tile_element(number); if (tileElement == nullptr) return false; @@ -138,6 +139,12 @@ public: void OnMouseUp(rct_widgetindex widgetIndex) override { + auto* banner = GetBanner(number); + if (banner == nullptr) + { + Close(); + return; + } switch (widgetIndex) { case WIDX_CLOSE: @@ -150,7 +157,7 @@ public: { Close(); } - auto bannerCoords = _banner->position.ToCoordsXY(); + auto bannerCoords = banner->position.ToCoordsXY(); if (_isSmall) { @@ -282,6 +289,10 @@ public: RemoveViewport(); auto banner = GetBanner(number); + if (banner == nullptr) + { + return; + } auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), frame_no }; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index e0ad6f530e..c0c16e4ab7 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -2095,7 +2095,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Banner info auto banner = tileElement->AsWall()->GetBanner(); - if (banner != nullptr && !banner->IsNull()) + if (banner != nullptr) { Formatter ft; banner->FormatTextTo(ft); @@ -2160,7 +2160,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) if (largeSceneryEntry != nullptr && largeSceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) { auto banner = sceneryElement->GetBanner(); - if (banner != nullptr && !banner->IsNull()) + if (banner != nullptr) { Formatter ft; banner->FormatTextTo(ft); @@ -2193,7 +2193,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Banner info auto banner = tileElement->AsBanner()->GetBanner(); - if (banner != nullptr && !banner->IsNull()) + if (banner != nullptr) { Formatter ft; banner->FormatTextTo(ft); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 5c0d53c84b..b540eece80 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1974,18 +1974,12 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos CoordsXYZD loc{ gridPos, z, direction }; auto primaryColour = gWindowSceneryPrimaryColour; - auto bannerIndex = create_new_banner(0); - if (bannerIndex == BANNER_INDEX_NULL) - { - context_show_error(STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME, {}); - break; - } - auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, bannerIndex, primaryColour); - bannerPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, primaryColour); + bannerPlaceAction.SetCallback([=](const GameAction* ga, const BannerPlaceActionResult* result) { if (result->Error == GameActions::Status::Ok) { OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - context_open_detail_window(WD_BANNER, bannerIndex); + context_open_detail_window(WD_BANNER, result->bannerId); } }); GameActions::Execute(&bannerPlaceAction); @@ -2571,13 +2565,7 @@ static money32 try_place_ghost_banner(CoordsXYZD loc, ObjectEntryIndex entryInde // 6e2612 auto primaryColour = gWindowSceneryPrimaryColour; - auto bannerIndex = create_new_banner(0); - if (bannerIndex == BANNER_INDEX_NULL) - { - // Silently fail as this is just for the ghost - return 0; - } - auto bannerPlaceAction = BannerPlaceAction(loc, entryIndex, bannerIndex, primaryColour); + 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) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index fb778c1453..18e3262bbf 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -297,16 +297,7 @@ namespace Editor static void ClearMapForEditing(bool fromSave) { map_remove_all_rides(); - - // - for (BannerIndex i = 0; i < MAX_BANNERS; i++) - { - auto banner = GetBanner(i); - if (banner->IsNull()) - { - banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE; - } - } + UnlinkAllRideBanners(); ride_init_all(); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index c235d5891d..28a029cc40 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -18,10 +18,29 @@ using namespace OpenRCT2; -BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, BannerIndex bannerIndex, uint8_t primaryColour) +BannerPlaceActionResult::BannerPlaceActionResult() + : GameActions::Result(GameActions::Status::Ok, STR_CANT_POSITION_THIS_HERE) +{ +} + +BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err) + : GameActions::Result(err, STR_CANT_POSITION_THIS_HERE) +{ +} + +BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err, rct_string_id msg) + : GameActions::Result(err, STR_CANT_POSITION_THIS_HERE, msg) +{ +} + +BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err, rct_string_id title, rct_string_id message) + : GameActions::Result(err, title, message) +{ +} + +BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, uint8_t primaryColour) : _loc(loc) , _bannerType(bannerType) - , _bannerIndex(bannerIndex) , _primaryColour(primaryColour) { } @@ -31,7 +50,6 @@ void BannerPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) visitor.Visit(_loc); visitor.Visit("object", _bannerType); visitor.Visit("primaryColour", _primaryColour); - _bannerIndex = create_new_banner(0); } uint16_t BannerPlaceAction::GetActionFlags() const @@ -43,7 +61,7 @@ void BannerPlaceAction::Serialise(DataSerialiser& stream) { GameAction::Serialise(stream); - stream << DS_TAG(_loc) << DS_TAG(_bannerType) << DS_TAG(_bannerIndex) << DS_TAG(_primaryColour); + stream << DS_TAG(_loc) << DS_TAG(_bannerType) << DS_TAG(_primaryColour); } GameActions::Result::Ptr BannerPlaceAction::Query() const @@ -86,17 +104,10 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const return MakeResult(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_BANNER_SIGN_IN_THE_WAY); } - if (_bannerIndex == BANNER_INDEX_NULL || _bannerIndex >= MAX_BANNERS) + if (HasReachedBannerLimit()) { - log_error("Invalid banner index, bannerIndex = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); - } - - auto banner = GetBanner(_bannerIndex); - if (!banner->IsNull()) - { - log_error("Banner index in use, bannerIndex = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + log_error("No free banners available"); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); } auto* bannerEntry = get_banner_entry(_bannerType); @@ -124,12 +135,6 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE); } - if (_bannerIndex == BANNER_INDEX_NULL || _bannerIndex >= MAX_BANNERS) - { - log_error("Invalid banner index, bannerIndex = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); - } - auto* bannerEntry = get_banner_entry(_bannerType); if (bannerEntry == nullptr) { @@ -137,11 +142,11 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); } - auto banner = GetBanner(_bannerIndex); - if (!banner->IsNull()) + auto banner = CreateBanner(); + if (banner == nullptr) { - log_error("Banner index in use, bannerIndex = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + log_error("No free banners available"); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); } banner->flags = 0; banner->text = {}; @@ -150,13 +155,15 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const banner->colour = _primaryColour; banner->position = TileCoordsXY(_loc); + res->bannerId = banner->id; + auto* bannerElement = TileElementInsert({ _loc, _loc.z + (2 * COORDS_Z_STEP) }, 0b0000); Guard::Assert(bannerElement != nullptr); bannerElement->SetClearanceZ(_loc.z + PATH_CLEARANCE); bannerElement->SetPosition(_loc.direction); bannerElement->ResetAllowedEdges(); - bannerElement->SetIndex(_bannerIndex); + bannerElement->SetIndex(banner->id); bannerElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); map_invalidate_tile_full(_loc); diff --git a/src/openrct2/actions/BannerPlaceAction.h b/src/openrct2/actions/BannerPlaceAction.h index d937f44b5f..94d9e7feb3 100644 --- a/src/openrct2/actions/BannerPlaceAction.h +++ b/src/openrct2/actions/BannerPlaceAction.h @@ -11,17 +11,27 @@ #include "GameAction.h" -DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, GameActions::Result) +class BannerPlaceActionResult final : public GameActions::Result +{ +public: + BannerPlaceActionResult(); + BannerPlaceActionResult(GameActions::Status err); + BannerPlaceActionResult(GameActions::Status err, rct_string_id msg); + BannerPlaceActionResult(GameActions::Status err, rct_string_id title, rct_string_id message); + + BannerIndex bannerId = BANNER_INDEX_NULL; +}; + +DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, BannerPlaceActionResult) { private: CoordsXYZD _loc; ObjectEntryIndex _bannerType{ BANNER_NULL }; - BannerIndex _bannerIndex{ BANNER_INDEX_NULL }; uint8_t _primaryColour{}; public: BannerPlaceAction() = default; - BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, BannerIndex bannerIndex, uint8_t primaryColour); + BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, uint8_t primaryColour); void AcceptParameters(GameActionParameterVisitor & visitor) override; diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index 184e6dd362..10be36f15a 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -61,16 +61,17 @@ GameActions::Result::Ptr BannerRemoveAction::Query() const return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } - if (bannerElement->GetIndex() >= MAX_BANNERS || bannerElement->GetIndex() == BANNER_INDEX_NULL) + auto bannerIndex = bannerElement->GetIndex(); + if (bannerIndex == BANNER_INDEX_NULL) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); + log_error("Invalid banner index. index = ", bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); + log_error("Invalid banner index. index = ", bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } @@ -99,16 +100,17 @@ GameActions::Result::Ptr BannerRemoveAction::Execute() const return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } - if (bannerElement->GetIndex() >= MAX_BANNERS || bannerElement->GetIndex() == BANNER_INDEX_NULL) + auto bannerIndex = bannerElement->GetIndex(); + if (bannerIndex == BANNER_INDEX_NULL) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); + log_error("Invalid banner index. index = ", bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - log_error("Invalid banner index. index = ", bannerElement->GetIndex()); + log_error("Invalid banner index. index = ", bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); } diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 108f584224..0243cf5fd6 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -84,10 +84,11 @@ GameActions::Result::Ptr BannerSetColourAction::QueryExecute(bool isExecuting) c } auto index = bannerElement->GetIndex(); - if (index >= MAX_BANNERS || index == BANNER_INDEX_NULL) + auto banner = GetBanner(index); + if (banner == nullptr) { log_error("Invalid banner index: index = %u", index); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } if (isExecuting) @@ -96,7 +97,6 @@ GameActions::Result::Ptr BannerSetColourAction::QueryExecute(bool isExecuting) c intent.putExtra(INTENT_EXTRA_BANNER_INDEX, index); context_broadcast_intent(&intent); - auto banner = GetBanner(index); banner->colour = _primaryColour; map_invalidate_tile_zoom1({ _loc, _loc.z, _loc.z + 32 }); } diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index 8d4c088267..765acecb42 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -44,9 +44,10 @@ void BannerSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr BannerSetNameAction::Query() const { - if (_bannerIndex >= MAX_BANNERS) + auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) { - log_warning("Invalid game command for setting banner name, banner id = %d", _bannerIndex); + log_warning("Invalid banner id, banner id = %d", _bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } return MakeResult(); @@ -55,6 +56,12 @@ GameActions::Result::Ptr BannerSetNameAction::Query() const GameActions::Result::Ptr BannerSetNameAction::Execute() const { auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) + { + log_warning("Invalid banner id, banner id = %d", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } + banner->text = _name; auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index a231bd64bd..035b2bb3e7 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -46,12 +46,12 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const { auto res = MakeResult(); - if (_bannerIndex >= MAX_BANNERS || _bannerIndex == BANNER_INDEX_NULL) - { - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_SELECTION_OF_OBJECTS); - } - auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) + { + log_error("Invalid banner index: index = %u", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } res->Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); @@ -101,6 +101,11 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const auto res = MakeResult(); auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) + { + log_error("Invalid banner index: index = %u", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } res->Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 84d7fb8de2..ac7eabb46e 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -44,14 +44,6 @@ LargeSceneryPlaceAction::LargeSceneryPlaceAction( , _primaryColour(primaryColour) , _secondaryColour(secondaryColour) { - auto* sceneryEntry = get_large_scenery_entry(_sceneryType); - if (sceneryEntry != nullptr) - { - if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - _bannerId = create_new_banner(0); - } - } } void LargeSceneryPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) @@ -60,14 +52,6 @@ void LargeSceneryPlaceAction::AcceptParameters(GameActionParameterVisitor& visit visitor.Visit("object", _sceneryType); visitor.Visit("primaryColour", _primaryColour); visitor.Visit("secondaryColour", _secondaryColour); - auto* sceneryEntry = get_large_scenery_entry(_sceneryType); - if (sceneryEntry != nullptr) - { - if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - _bannerId = create_new_banner(0); - } - } } uint16_t LargeSceneryPlaceAction::GetActionFlags() const @@ -79,7 +63,7 @@ void LargeSceneryPlaceAction::Serialise(DataSerialiser& stream) { GameAction::Serialise(stream); - stream << DS_TAG(_loc) << DS_TAG(_sceneryType) << DS_TAG(_primaryColour) << DS_TAG(_secondaryColour) << DS_TAG(_bannerId); + stream << DS_TAG(_loc) << DS_TAG(_sceneryType) << DS_TAG(_primaryColour) << DS_TAG(_secondaryColour); } GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const @@ -128,17 +112,10 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) { - if (_bannerId == BANNER_INDEX_NULL) - { - log_error("Banner Index not specified."); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); - } - - auto banner = GetBanner(_bannerId); - if (!banner->IsNull()) + if (HasReachedBannerLimit()) { log_error("No free banners available"); - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -243,6 +220,34 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const res->Position.z = maxHeight; + // Allocate banner + Banner* banner = nullptr; + if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) + { + banner = CreateBanner(); + if (banner == nullptr) + { + log_error("No free banners available"); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + } + + banner->text = {}; + banner->colour = 2; + banner->text_colour = 2; + banner->flags = BANNER_FLAG_IS_LARGE_SCENERY; + banner->type = 0; + banner->position = TileCoordsXY(_loc); + + ride_id_t rideIndex = banner_get_closest_ride_index({ _loc, maxHeight }); + if (rideIndex != RIDE_ID_NULL) + { + banner->ride_index = rideIndex; + banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; + } + + res->bannerId = banner->id; + } + uint8_t tileNum = 0; for (rct_large_scenery_tile* tile = sceneryEntry->tiles; tile->x_offset != -1; tile++, tileNum++) { @@ -261,6 +266,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const isTree); if (canBuild->Error != GameActions::Status::Ok) { + DeleteBanner(banner->id); canBuild->ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; } @@ -283,6 +289,11 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const newSceneryElement->SetClearanceZ(zHigh); SetNewLargeSceneryElement(*newSceneryElement, tileNum); + if (banner != nullptr) + { + newSceneryElement->SetBannerIndex(banner->id); + } + map_animation_create(MAP_ANIMATION_TYPE_LARGE_SCENERY, { curTile, zLow }); map_invalidate_tile_full(curTile); @@ -292,37 +303,6 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const } } - // Allocate banner after all tiles to ensure banner id doesn't need to be freed. - if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - if (_bannerId == BANNER_INDEX_NULL) - { - log_error("No free banners available"); - return MakeResult(GameActions::Status::NoFreeElements, STR_TOO_MANY_BANNERS_IN_GAME); - } - - auto banner = GetBanner(_bannerId); - if (!banner->IsNull()) - { - log_error("No free banners available"); - return std::make_unique(GameActions::Status::NoFreeElements); - } - - banner->text = {}; - banner->colour = 2; - banner->text_colour = 2; - banner->flags = BANNER_FLAG_IS_LARGE_SCENERY; - banner->type = 0; - banner->position = TileCoordsXY(_loc); - - ride_id_t rideIndex = banner_get_closest_ride_index({ _loc, maxHeight }); - if (rideIndex != RIDE_ID_NULL) - { - banner->ride_index = rideIndex; - banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; - } - } - // Force ride construction to recheck area _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; @@ -403,11 +383,6 @@ void LargeSceneryPlaceAction::SetNewLargeSceneryElement(LargeSceneryElement& sce sceneryElement.SetPrimaryColour(_primaryColour); sceneryElement.SetSecondaryColour(_secondaryColour); - if (_bannerId != BANNER_INDEX_NULL) - { - sceneryElement.SetBannerIndex(_bannerId); - } - if (GetFlags() & GAME_COMMAND_FLAG_GHOST) { sceneryElement.SetGhost(true); diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.h b/src/openrct2/actions/LargeSceneryPlaceAction.h index 85b95cf197..dfba4eb416 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.h +++ b/src/openrct2/actions/LargeSceneryPlaceAction.h @@ -23,6 +23,7 @@ public: uint8_t GroundFlags{ 0 }; int32_t firstTileHeight{ 0 }; + BannerIndex bannerId = BANNER_INDEX_NULL; }; DEFINE_GAME_ACTION(LargeSceneryPlaceAction, GameCommand::PlaceLargeScenery, LargeSceneryPlaceActionResult) @@ -32,7 +33,6 @@ private: ObjectEntryIndex _sceneryType{ OBJECT_ENTRY_INDEX_NULL }; uint8_t _primaryColour{}; uint8_t _secondaryColour{}; - BannerIndex _bannerId{ BANNER_INDEX_NULL }; public: LargeSceneryPlaceAction() = default; diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index a63dbc7ab2..7e5e0b89ab 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -132,15 +132,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const ride_clear_leftover_entrances(ride); News::DisableNewsItems(News::ItemType::Ride, _rideIndex); - for (BannerIndex i = 0; i < MAX_BANNERS; i++) - { - auto banner = GetBanner(i); - if (!banner->IsNull() && banner->flags & BANNER_FLAG_LINKED_TO_RIDE && banner->ride_index == _rideIndex) - { - banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE; - banner->text = {}; - } - } + UnlinkAllBannersForRide(_rideIndex); for (auto peep : EntityList()) { diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index e58b2ffc52..d13941edd7 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -45,7 +45,8 @@ void SignSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr SignSetNameAction::Query() const { - if (_bannerIndex >= MAX_BANNERS) + auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) { log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); @@ -56,6 +57,11 @@ GameActions::Result::Ptr SignSetNameAction::Query() const GameActions::Result::Ptr SignSetNameAction::Execute() const { auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) + { + log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } if (!_name.empty()) { diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index eb2e0525c7..de79708f6b 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -39,9 +39,10 @@ void SignSetStyleAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr SignSetStyleAction::Query() const { - if (_bannerIndex >= MAX_BANNERS) + auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) { - log_warning("Invalid game command for setting sign style, banner id '%d' out of range", _bannerIndex); + log_error("Invalid banner id. id = ", _bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } @@ -76,6 +77,11 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const GameActions::Result::Ptr SignSetStyleAction::Execute() const { auto banner = GetBanner(_bannerIndex); + if (banner == nullptr) + { + log_error("Invalid banner id. id = ", _bannerIndex); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } CoordsXY coords = banner->position.ToCoordsXY(); diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 583db43616..a02479b4ed 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -50,14 +50,6 @@ WallPlaceAction::WallPlaceAction( , _secondaryColour(secondaryColour) , _tertiaryColour(tertiaryColour) { - auto* sceneryEntry = get_wall_entry(_wallType); - if (sceneryEntry != nullptr) - { - if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - _bannerId = create_new_banner(0); - } - } } void WallPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) @@ -68,14 +60,6 @@ void WallPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) visitor.Visit("primaryColour", _primaryColour); visitor.Visit("secondaryColour", _secondaryColour); visitor.Visit("tertiaryColour", _tertiaryColour); - auto* sceneryEntry = get_wall_entry(_wallType); - if (sceneryEntry != nullptr) - { - if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - _bannerId = create_new_banner(0); - } - } } uint16_t WallPlaceAction::GetActionFlags() const @@ -88,7 +72,7 @@ void WallPlaceAction::Serialise(DataSerialiser& stream) GameAction::Serialise(stream); stream << DS_TAG(_wallType) << DS_TAG(_loc) << DS_TAG(_edge) << DS_TAG(_primaryColour) << DS_TAG(_secondaryColour) - << DS_TAG(_tertiaryColour) << DS_TAG(_bannerId); + << DS_TAG(_tertiaryColour); } GameActions::Result::Ptr WallPlaceAction::Query() const @@ -253,18 +237,10 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (wallEntry->scrolling_mode != SCROLLING_MODE_NONE) { - if (_bannerId == BANNER_INDEX_NULL) - { - log_error("Banner Index not specified."); - return std::make_unique( - GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); - } - - auto banner = GetBanner(_bannerId); - if (!banner->IsNull()) + if (HasReachedBannerLimit()) { log_error("No free banners available"); - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -361,20 +337,14 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const } } + Banner* banner = nullptr; if (wallEntry->scrolling_mode != SCROLLING_MODE_NONE) { - if (_bannerId == BANNER_INDEX_NULL) - { - log_error("Banner Index not specified."); - return std::make_unique( - GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); - } - - auto banner = GetBanner(_bannerId); - if (!banner->IsNull()) + banner = CreateBanner(); + if (banner == nullptr) { log_error("No free banners available"); - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -390,6 +360,8 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const banner->ride_index = rideIndex; banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; } + + res->bannerId = banner->id; } auto* wallElement = TileElementInsert(targetLoc, 0b0000); @@ -404,9 +376,9 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const wallElement->SetAcrossTrack(wallAcrossTrack); wallElement->SetEntryIndex(_wallType); - if (_bannerId != BANNER_INDEX_NULL) + if (banner != nullptr) { - wallElement->SetBannerIndex(_bannerId); + wallElement->SetBannerIndex(banner->id); } if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) diff --git a/src/openrct2/actions/WallPlaceAction.h b/src/openrct2/actions/WallPlaceAction.h index 8a1776395a..7608a0ce7d 100644 --- a/src/openrct2/actions/WallPlaceAction.h +++ b/src/openrct2/actions/WallPlaceAction.h @@ -11,6 +11,7 @@ #include "../ride/RideData.h" #include "../ride/TrackData.h" +#include "../world/Banner.h" #include "../world/Scenery.h" #include "GameAction.h" @@ -23,6 +24,7 @@ public: WallPlaceActionResult(GameActions::Status error, rct_string_id msg, uint8_t* args); TileElement* tileElement = nullptr; + BannerIndex bannerId = BANNER_INDEX_NULL; }; DEFINE_GAME_ACTION(WallPlaceAction, GameCommand::PlaceWall, WallPlaceActionResult) @@ -34,7 +36,6 @@ private: int32_t _primaryColour{ COLOUR_BLACK }; int32_t _secondaryColour{ COLOUR_BLACK }; int32_t _tertiaryColour{ COLOUR_BLACK }; - BannerIndex _bannerId{ BANNER_INDEX_NULL }; public: WallPlaceAction() = default; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index cc5741263f..7545d42a93 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1259,15 +1259,7 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons int32_t staffCount = GetEntityListCount(EntityType::Staff); - int32_t bannerCount = 0; - for (BannerIndex i = 0; i < MAX_BANNERS; ++i) - { - auto banner = GetBanner(i); - if (!banner->IsNull()) - { - bannerCount++; - } - } + auto bannerCount = GetNumBanners(); console.WriteFormatLine("Sprites: %d/%d", spriteCount, MAX_ENTITIES); console.WriteFormatLine("Map Elements: %zu/%d", tileElementCount, MAX_TILE_ELEMENTS); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 05782288d9..053339fafc 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // 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 static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index fc66fae338..ffe208e5df 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -432,7 +432,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons } auto banner = tile_element->AsWall()->GetBanner(); - if (banner != nullptr && !banner->IsNull()) + if (banner != nullptr) { auto ft = Formatter(); banner->FormatTextTo(ft); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c60234fa38..6522fea81d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1806,19 +1806,27 @@ private: auto dst2 = dst->AsBanner(); auto src2 = src->AsBanner(); - auto index = src2->GetIndex(); - if (index != RCT12_BANNER_INDEX_NULL) - dst2->SetIndex(index); - else - dst2->SetIndex(BANNER_INDEX_NULL); dst2->SetPosition(src2->GetPosition()); dst2->SetAllowedEdges(src2->GetAllowedEdges()); + auto index = src2->GetIndex(); if (index < std::size(_s4.banners)) { auto srcBanner = &_s4.banners[index]; - auto dstBanner = GetBanner(index); - ImportBanner(dstBanner, srcBanner); + auto dstBanner = GetOrCreateBanner(index); + if (dstBanner == nullptr) + { + dst2->SetIndex(BANNER_INDEX_NULL); + } + else + { + ImportBanner(dstBanner, srcBanner); + dst2->SetIndex(index); + } + } + else + { + dst2->SetIndex(BANNER_INDEX_NULL); } return 1; } diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index a612e6af35..9388d6e41b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1518,7 +1518,14 @@ void S6Exporter::ExportBanners() { auto src = GetBanner(i); auto dst = &_s6.banners[i]; - ExportBanner(*dst, *src); + if (src != nullptr) + { + ExportBanner(*dst, *src); + } + else + { + ExportBanner(*dst, {}); + } } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d4120c213b..f4763855b4 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1246,9 +1246,16 @@ public: if (bannerIndex < std::size(_s6.banners)) { auto srcBanner = &_s6.banners[bannerIndex]; - auto dstBanner = GetBanner(bannerIndex); - ImportBanner(dstBanner, srcBanner); - dst2->SetBannerIndex(src2->GetBannerIndex()); + auto dstBanner = GetOrCreateBanner(bannerIndex); + if (dstBanner == nullptr) + { + dst2->SetBannerIndex(BANNER_INDEX_NULL); + } + else + { + ImportBanner(dstBanner, srcBanner); + dst2->SetBannerIndex(src2->GetBannerIndex()); + } } } break; @@ -1272,9 +1279,16 @@ public: if (bannerIndex < std::size(_s6.banners)) { auto srcBanner = &_s6.banners[bannerIndex]; - auto dstBanner = GetBanner(bannerIndex); - ImportBanner(dstBanner, srcBanner); - dst2->SetBannerIndex(src2->GetBannerIndex()); + auto dstBanner = GetOrCreateBanner(bannerIndex); + if (dstBanner == nullptr) + { + dst2->SetBannerIndex(BANNER_INDEX_NULL); + } + else + { + ImportBanner(dstBanner, srcBanner); + dst2->SetBannerIndex(src2->GetBannerIndex()); + } } } break; @@ -1284,7 +1298,6 @@ public: auto dst2 = dst->AsBanner(); auto src2 = src->AsBanner(); - dst2->SetIndex(src2->GetIndex()); dst2->SetPosition(src2->GetPosition()); dst2->SetAllowedEdges(src2->GetAllowedEdges()); @@ -1292,8 +1305,16 @@ public: if (bannerIndex < std::size(_s6.banners)) { auto srcBanner = &_s6.banners[bannerIndex]; - auto dstBanner = GetBanner(bannerIndex); - ImportBanner(dstBanner, srcBanner); + auto dstBanner = GetOrCreateBanner(bannerIndex); + if (dstBanner == nullptr) + { + dst2->SetIndex(BANNER_INDEX_NULL); + } + else + { + ImportBanner(dstBanner, srcBanner); + dst2->SetIndex(bannerIndex); + } } else { diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index de001a8541..28a6bac8b4 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -31,7 +31,7 @@ #include #include -static Banner _banners[MAX_BANNERS]; +static std::vector _banners; std::string Banner::GetText() const { @@ -114,9 +114,17 @@ static BannerIndex BannerGetNewIndex() { for (BannerIndex bannerIndex = 0; bannerIndex < MAX_BANNERS; bannerIndex++) { - if (_banners[bannerIndex].IsNull()) + if (bannerIndex < _banners.size()) { - return bannerIndex; + if (_banners[bannerIndex].IsNull()) + { + return bannerIndex; + } + } + else + { + _banners.emplace_back(); + return static_cast(_banners.size() - 1); } } return BANNER_INDEX_NULL; @@ -128,41 +136,7 @@ static BannerIndex BannerGetNewIndex() */ void banner_init() { - for (auto& banner : _banners) - { - banner = {}; - } -} - -/** - * Creates a new banner and returns the index of the banner - * If the flag GAME_COMMAND_FLAG_APPLY is NOT set then returns - * the first unused index but does NOT mark the banner as created. - * returns 0xFF on failure. - * - * rct2: 0x006BA278 - */ -BannerIndex create_new_banner(uint8_t flags) -{ - BannerIndex bannerIndex = BannerGetNewIndex(); - - if (bannerIndex == BANNER_INDEX_NULL) - { - gGameCommandErrorText = STR_TOO_MANY_BANNERS_IN_GAME; - return bannerIndex; - } - - if (flags & GAME_COMMAND_FLAG_APPLY) - { - auto banner = &_banners[bannerIndex]; - - banner->flags = 0; - banner->type = 0; - banner->text = {}; - banner->colour = 2; - banner->text_colour = 2; - } - return bannerIndex; + _banners.clear(); } TileElement* banner_get_tile_element(BannerIndex bannerIndex) @@ -261,12 +235,16 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) void banner_reset_broken_index() { - for (BannerIndex bannerIndex = 0; bannerIndex < MAX_BANNERS; bannerIndex++) + for (BannerIndex bannerIndex = 0; bannerIndex < _banners.size(); bannerIndex++) { auto tileElement = banner_get_tile_element(bannerIndex); if (tileElement == nullptr) { - _banners[bannerIndex].type = BANNER_NULL; + auto banner = GetBanner(bannerIndex); + if (banner != nullptr) + { + banner->type = BANNER_NULL; + } } } } @@ -274,7 +252,7 @@ void banner_reset_broken_index() void fix_duplicated_banners() { // For each banner in the map, check if the banner index is in use already, and if so, create a new entry for it - bool activeBanners[std::size(_banners)]{}; + std::vector activeBanners; for (int y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { for (int x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) @@ -292,6 +270,10 @@ void fix_duplicated_banners() if (bannerIndex == BANNER_INDEX_NULL) continue; + if (activeBanners.size() <= bannerIndex) + { + activeBanners.resize(bannerIndex + 1); + } if (activeBanners[bannerIndex]) { log_info( @@ -299,24 +281,23 @@ void fix_duplicated_banners() tileElement->base_height); // Banner index is already in use by another banner, so duplicate it - auto newBannerIndex = create_new_banner(GAME_COMMAND_FLAG_APPLY); - if (newBannerIndex == BANNER_INDEX_NULL) + auto newBanner = CreateBanner(); + if (newBanner == nullptr) { log_error("Failed to create new banner."); continue; } - Guard::Assert(!activeBanners[newBannerIndex]); + Guard::Assert(!activeBanners[newBanner->id]); // Copy over the original banner, but update the location - auto newBanner = GetBanner(newBannerIndex); auto oldBanner = GetBanner(bannerIndex); - if (oldBanner != nullptr && newBanner != nullptr) + if (oldBanner != nullptr) { *newBanner = *oldBanner; newBanner->position = { x, y }; } - tileElement->AsBanner()->SetIndex(newBannerIndex); + tileElement->AsBanner()->SetIndex(newBanner->id); } // Mark banner index as in-use @@ -379,11 +360,111 @@ void BannerElement::ResetAllowedEdges() AllowedEdges |= 0b00001111; } +void UnlinkAllRideBanners() +{ + for (auto& banner : _banners) + { + if (!banner.IsNull()) + { + banner.flags &= ~BANNER_FLAG_LINKED_TO_RIDE; + banner.ride_index = RIDE_ID_NULL; + } + } +} + +void UnlinkAllBannersForRide(ride_id_t rideId) +{ + for (auto& banner : _banners) + { + if (!banner.IsNull() && (banner.flags & BANNER_FLAG_LINKED_TO_RIDE) && banner.ride_index == rideId) + { + banner.flags &= ~BANNER_FLAG_LINKED_TO_RIDE; + banner.ride_index = RIDE_ID_NULL; + banner.text = {}; + } + } +} + Banner* GetBanner(BannerIndex id) { - if (id < std::size(_banners)) + if (id < _banners.size()) { + auto banner = &_banners[id]; + if (banner != nullptr && !banner->IsNull()) + { + return banner; + } + } + return nullptr; +} + +Banner* GetOrCreateBanner(BannerIndex id) +{ + if (id < MAX_BANNERS) + { + if (id >= _banners.size()) + { + _banners.resize(id + 1); + } return &_banners[id]; } return nullptr; } + +Banner* CreateBanner() +{ + auto bannerIndex = BannerGetNewIndex(); + auto banner = GetOrCreateBanner(bannerIndex); + if (banner != nullptr) + { + banner->id = bannerIndex; + banner->flags = 0; + banner->type = 0; + banner->text = {}; + banner->colour = 2; + banner->text_colour = 2; + } + return banner; +} + +void DeleteBanner(BannerIndex id) +{ + auto* const banner = GetBanner(id); + if (banner != nullptr) + { + *banner = {}; + } +} + +void TrimBanners() +{ + if (_banners.size() > 0) + { + auto lastBannerId = _banners.size() - 1; + while (lastBannerId != std::numeric_limits::max() && _banners[lastBannerId].IsNull()) + { + lastBannerId--; + } + _banners.resize(lastBannerId + 1); + _banners.shrink_to_fit(); + } +} + +size_t GetNumBanners() +{ + size_t count = 0; + for (const auto& banner : _banners) + { + if (!banner.IsNull()) + { + count++; + } + } + return count; +} + +bool HasReachedBannerLimit() +{ + auto numBanners = GetNumBanners(); + return numBanners >= MAX_BANNERS; +} diff --git a/src/openrct2/world/Banner.h b/src/openrct2/world/Banner.h index e586b0a3d5..1ec15ec3c2 100644 --- a/src/openrct2/world/Banner.h +++ b/src/openrct2/world/Banner.h @@ -29,6 +29,7 @@ constexpr uint8_t SCROLLING_MODE_NONE = 255; struct Banner { + BannerIndex id = BANNER_INDEX_NULL; ObjectEntryIndex type = BANNER_NULL; uint8_t flags{}; std::string text; @@ -56,10 +57,17 @@ enum BANNER_FLAGS }; void banner_init(); -BannerIndex create_new_banner(uint8_t flags); TileElement* banner_get_tile_element(BannerIndex bannerIndex); WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex); ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos); void banner_reset_broken_index(); void fix_duplicated_banners(); +void UnlinkAllRideBanners(); +void UnlinkAllBannersForRide(ride_id_t rideId); Banner* GetBanner(BannerIndex id); +Banner* GetOrCreateBanner(BannerIndex id); +Banner* CreateBanner(); +void DeleteBanner(BannerIndex id); +void TrimBanners(); +size_t GetNumBanners(); +bool HasReachedBannerLimit(); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 0dbc860b71..68eac33494 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -82,7 +82,7 @@ void TileElement::RemoveBannerEntry() if (banner != nullptr) { window_close_by_number(WC_BANNER, bannerIndex); - *banner = {}; + DeleteBanner(banner->id); } } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 7dbb1dec4f..ac95bbfe60 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -373,17 +373,17 @@ namespace OpenRCT2::TileInspector if (bannerIndex != BANNER_INDEX_NULL) { // The element to be pasted refers to a banner index - make a copy of it - auto newBannerIndex = create_new_banner(GAME_COMMAND_FLAG_APPLY); - if (newBannerIndex == BANNER_INDEX_NULL) + auto newBanner = CreateBanner(); + if (newBanner == nullptr) { - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + log_error("No free banners available"); + return std::make_unique(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME); } - auto& newBanner = *GetBanner(newBannerIndex); - newBanner = *GetBanner(bannerIndex); - newBanner.position = tileLoc; + + newBanner->position = tileLoc; // Use the new banner index - element.SetBannerIndex(newBannerIndex); + element.SetBannerIndex(newBanner->id); } // The occupiedQuadrants will be automatically set when the element is copied over, so it's not necessary to set From 13aee659f00a823fa99891971d97ed51a688180e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:02:34 +0300 Subject: [PATCH 009/681] Fix #15096: Crash placing entrance near corner in scenario editor --- distribution/changelog.txt | 1 + src/openrct2/world/Footpath.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 28132ea81c..7e1e107bf7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ +- Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. 0.3.4.1 (2021-07-25) ------------------------------------------------------------------------ diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c165741480..df129f43f4 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1412,7 +1412,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i edges = tileElement->AsPath()->GetEdges(); currentTile.direction = direction_reverse(currentTile.direction); - if (!(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY)) + if (!tileElement->IsLastForTile() && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY)) { int elementIndex = 1; // Loop over all elements and cull appropriate edges @@ -1422,12 +1422,10 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i break; if (tileElement[elementIndex].GetType() != TILE_ELEMENT_TYPE_BANNER) { - ++elementIndex; continue; } edges &= tileElement[elementIndex].AsBanner()->GetAllowedEdges(); - ++elementIndex; - } while (!tileElement[elementIndex].IsLastForTile()); + } while (!tileElement[elementIndex++].IsLastForTile()); } // Exclude the direction we came from From 9c2fb84a530565cb1affddfbb347cefb313cad11 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 27 Jul 2021 12:16:36 +0200 Subject: [PATCH 010/681] Invalidate screen when toggling transparent water flag Pointed out here: https://github.com/OpenRCT2/OpenRCT2/issues/14753#issuecomment-849024680 --- src/openrct2-ui/input/Shortcuts.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 6e604ec79b..df9b193e9d 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -711,6 +711,7 @@ static void ShortcutToggleTransparentWater() gConfigGeneral.transparent_water ^= 1; config_save_default(); + gfx_invalidate_screen(); } #pragma endregion From afc4cd7cba03584cf866734b9a66802eed724c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 27 Jul 2021 18:21:03 +0300 Subject: [PATCH 011/681] Refactor ride construction code into a new unit --- OpenRCT2.xcodeproj/project.pbxproj | 4 + src/openrct2/libopenrct2.vcxproj | 1 + src/openrct2/ride/Ride.cpp | 1671 ----------------------- src/openrct2/ride/RideConstruction.cpp | 1714 ++++++++++++++++++++++++ 4 files changed, 1719 insertions(+), 1671 deletions(-) create mode 100644 src/openrct2/ride/RideConstruction.cpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index b6e6699cb4..1e0229fd2d 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -767,6 +767,7 @@ E73A781EBC3C440A99D59821 /* EntityTweener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0EB0D1DF6CC74E4190301D84 /* EntityTweener.cpp */; }; F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */ = {isa = PBXBuildFile; fileRef = 091352A950004312BAB18717 /* EntityTweener.h */; }; 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9D3DD6CD73F5421880280D9D /* Litter.cpp */; }; + B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1836,6 +1837,7 @@ 0EB0D1DF6CC74E4190301D84 /* EntityTweener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EntityTweener.cpp; path = src/openrct2/world/EntityTweener.cpp; sourceTree = SOURCE_ROOT; }; 091352A950004312BAB18717 /* EntityTweener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntityTweener.h; path = src/openrct2/world/EntityTweener.h; sourceTree = SOURCE_ROOT; }; 9D3DD6CD73F5421880280D9D /* Litter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Litter.cpp; path = src/openrct2/world/Litter.cpp; sourceTree = SOURCE_ROOT; }; + 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideConstruction.cpp; path = src/openrct2/ride/RideConstruction.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2889,6 +2891,7 @@ 4C7B540A20060D7900A52E21 /* VehiclePaint.h */, 4CB2716824195B45000CF9EE /* VehicleSubpositionData.cpp */, 4CB2716924195B45000CF9EE /* VehicleSubpositionData.h */, + 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */, ); path = ride; sourceTree = ""; @@ -4273,6 +4276,7 @@ C688791820289B9B0084B384 /* MonorailCycles.cpp in Sources */, E73A781EBC3C440A99D59821 /* EntityTweener.cpp in Sources */, 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */, + B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 375d579fa3..2af6898f4a 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -804,6 +804,7 @@ + diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 06b77e8b7f..1210e4ce54 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -15,11 +15,9 @@ #include "../Game.h" #include "../Input.h" #include "../OpenRCT2.h" -#include "../actions/RideEntranceExitRemoveAction.h" #include "../actions/RideSetSettingAction.h" #include "../actions/RideSetStatusAction.h" #include "../actions/RideSetVehicleAction.h" -#include "../actions/TrackRemoveAction.h" #include "../audio/AudioMixer.h" #include "../audio/audio.h" #include "../common.h" @@ -87,49 +85,6 @@ static constexpr const int32_t RideInspectionInterval[] = { static std::vector _rides; -bool gGotoStartPlacementMode = false; - -money16 gTotalRideValueForMoney; - -money32 _currentTrackPrice; - -uint16_t _numCurrentPossibleRideConfigurations; -uint16_t _numCurrentPossibleSpecialTrackPieces; - -uint32_t _currentTrackCurve; -uint8_t _rideConstructionState; -ride_id_t _currentRideIndex; - -CoordsXYZ _currentTrackBegin; - -uint8_t _currentTrackPieceDirection; -track_type_t _currentTrackPieceType; -uint8_t _currentTrackSelectionFlags; -uint32_t _rideConstructionNextArrowPulse = 0; -uint8_t _currentTrackSlopeEnd; -uint8_t _currentTrackBankEnd; -uint8_t _currentTrackLiftHill; -uint8_t _currentTrackAlternative; -track_type_t _selectedTrackType; - -uint8_t _previousTrackBankEnd; -uint8_t _previousTrackSlopeEnd; - -CoordsXYZ _previousTrackPiece; - -uint8_t _currentBrakeSpeed2; -uint8_t _currentSeatRotationAngle; - -CoordsXYZD _unkF440C5; - -uint8_t gRideEntranceExitPlaceType; -ride_id_t gRideEntranceExitPlaceRideIndex; -StationIndex gRideEntranceExitPlaceStationIndex; -uint8_t gRideEntranceExitPlacePreviousRideConstructionState; -Direction gRideEntranceExitPlaceDirection; - -uint8_t gLastEntranceStyle; - // Static function declarations Staff* find_closest_mechanic(const CoordsXY& entrancePosition, int32_t forInspection); static void ride_breakdown_status_update(Ride* ride); @@ -944,1025 +899,6 @@ void reset_all_ride_build_dates() #pragma region Construction -static int32_t ride_check_if_construction_allowed(Ride* ride) -{ - Formatter ft; - rct_ride_entry* rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - { - context_show_error(STR_INVALID_RIDE_TYPE, STR_CANT_EDIT_INVALID_RIDE_TYPE, ft); - return 0; - } - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) - { - ft.Increment(6); - ride->FormatNameTo(ft); - context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING, ft); - return 0; - } - - if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) - { - ft.Increment(6); - ride->FormatNameTo(ft); - context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST, ft); - return 0; - } - - return 1; -} - -static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) -{ - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); - auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); - intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex); - windowManager->BroadcastIntent(intent); - return window_find_by_class(WC_RIDE_CONSTRUCTION); -} - -/** - * - * rct2: 0x006B4857 - */ -void ride_construct(Ride* ride) -{ - CoordsXYE trackElement; - if (ride_try_get_origin_element(ride, &trackElement)) - { - ride_find_track_gap(ride, &trackElement, &trackElement); - - rct_window* w = window_get_main(); - if (w != nullptr && ride_modify(&trackElement)) - window_scroll_to_location(w, { trackElement, trackElement.element->GetBaseZ() }); - } - else - { - ride_initialise_construction_window(ride); - } -} - -/** - * - * rct2: 0x006DD4D5 - */ -static void ride_remove_cable_lift(Ride* ride) -{ - if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) - { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CABLE_LIFT; - uint16_t spriteIndex = ride->cable_lift; - do - { - Vehicle* vehicle = GetEntity(spriteIndex); - if (vehicle == nullptr) - { - return; - } - vehicle->Invalidate(); - spriteIndex = vehicle->next_vehicle_on_train; - sprite_remove(vehicle); - } while (spriteIndex != SPRITE_INDEX_NULL); - } -} - -/** - * - * rct2: 0x006DD506 - */ -static void ride_remove_vehicles(Ride* ride) -{ - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) - { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK; - ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); - - for (size_t i = 0; i <= MAX_VEHICLES_PER_RIDE; i++) - { - uint16_t spriteIndex = ride->vehicles[i]; - while (spriteIndex != SPRITE_INDEX_NULL) - { - Vehicle* vehicle = GetEntity(spriteIndex); - if (vehicle == nullptr) - { - break; - } - vehicle->Invalidate(); - spriteIndex = vehicle->next_vehicle_on_train; - sprite_remove(vehicle); - } - - ride->vehicles[i] = SPRITE_INDEX_NULL; - } - - for (size_t i = 0; i < MAX_STATIONS; i++) - ride->stations[i].TrainAtStation = RideStation::NO_TRAIN; - } -} - -/** - * - * rct2: 0x006DD4AC - */ -void ride_clear_for_construction(Ride* ride) -{ - ride->measurement = {}; - - ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - - // Open circuit rides will go directly into building mode (creating ghosts) where it would normally clear the stats, - // however this causes desyncs since it's directly run from the window and other clients would not get it. - // To prevent these problems, unconditionally invalidate the test results on all clients in multiplayer games. - if (network_get_mode() != NETWORK_MODE_NONE) - { - invalidate_test_results(ride); - } - - ride_remove_cable_lift(ride); - ride_remove_vehicles(ride); - ride_clear_blocked_tiles(ride); - - auto w = window_find_by_number(WC_RIDE, ride->id); - if (w != nullptr) - window_event_resize_call(w); -} - -/** - * - * rct2: 0x006664DF - */ -void ride_remove_peeps(Ride* ride) -{ - // Find first station - auto stationIndex = ride_get_first_valid_station_start(ride); - - // Get exit position and direction - auto exitPosition = CoordsXYZD{ 0, 0, 0, INVALID_DIRECTION }; - if (stationIndex != STATION_INDEX_NULL) - { - auto location = ride_get_exit_location(ride, stationIndex).ToCoordsXYZD(); - if (!location.isNull()) - { - auto direction = direction_reverse(location.direction); - exitPosition = location; - exitPosition.x += (DirectionOffsets[direction].x * 20) + COORDS_XY_HALF_TILE; - exitPosition.y += (DirectionOffsets[direction].y * 20) + COORDS_XY_HALF_TILE; - exitPosition.z += 2; - - // Reverse direction - exitPosition.direction = direction_reverse(exitPosition.direction); - - exitPosition.direction *= 8; - } - } - - // Place all the guests at exit - for (auto peep : EntityList()) - { - if (peep->State == PeepState::QueuingFront || peep->State == PeepState::EnteringRide - || peep->State == PeepState::LeavingRide || peep->State == PeepState::OnRide) - { - if (peep->CurrentRide != ride->id) - continue; - - peep_decrement_num_riders(peep); - if (peep->State == PeepState::QueuingFront && peep->RideSubState == PeepRideSubState::AtEntrance) - peep->RemoveFromQueue(); - - if (exitPosition.direction == INVALID_DIRECTION) - { - CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z }; - if (peep->GetNextIsSloped()) - newLoc.z += COORDS_Z_STEP; - newLoc.z++; - peep->MoveTo(newLoc); - } - else - { - peep->MoveTo(exitPosition); - peep->sprite_direction = exitPosition.direction; - } - - peep->State = PeepState::Falling; - peep->SwitchToSpecialSprite(0); - - peep->Happiness = std::min(peep->Happiness, peep->HappinessTarget) / 2; - peep->HappinessTarget = peep->Happiness; - peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; - } - } - // Place all the staff at exit - for (auto peep : EntityList()) - { - if (peep->State == PeepState::Fixing || peep->State == PeepState::Inspecting) - { - if (peep->CurrentRide != ride->id) - continue; - - if (exitPosition.direction == INVALID_DIRECTION) - { - CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z }; - if (peep->GetNextIsSloped()) - newLoc.z += COORDS_Z_STEP; - newLoc.z++; - peep->MoveTo(newLoc); - } - else - { - peep->MoveTo(exitPosition); - peep->sprite_direction = exitPosition.direction; - } - - peep->State = PeepState::Falling; - peep->SwitchToSpecialSprite(0); - - peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; - } - } - ride->num_riders = 0; - ride->slide_in_use = 0; - ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN; -} - -void ride_clear_blocked_tiles(Ride* ride) -{ - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) - { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) - { - auto element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - if (element != nullptr) - { - do - { - if (element->GetType() == TILE_ELEMENT_TYPE_TRACK && element->AsTrack()->GetRideIndex() == ride->id) - { - // Unblock footpath element that is at same position - auto footpathElement = map_get_footpath_element( - TileCoordsXYZ{ x, y, element->base_height }.ToCoordsXYZ()); - if (footpathElement != nullptr) - { - footpathElement->AsPath()->SetIsBlockedByVehicle(false); - } - } - } while (!(element++)->IsLastForTile()); - } - } - } -} - -/** - * Gets the origin track element (sequence 0). Seems to do more than that though and even invalidates track. - * rct2: 0x006C683D - * ax : x - * bx : direction << 8, type - * cx : y - * dx : z - * si : extra_params - * di : output_element - * bp : flags - */ -std::optional sub_6C683D( - const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags) -{ - // Find the relevant track piece, prefer sequence 0 (this ensures correct behaviour for diagonal track pieces) - auto trackElement = map_get_track_element_at_of_type_seq(location, type, 0); - if (trackElement == nullptr) - { - trackElement = map_get_track_element_at_of_type(location, type); - if (trackElement == nullptr) - { - return std::nullopt; - } - } - - // Possibly z should be & 0xF8 - auto trackBlock = TrackBlocks[type]; - if (trackBlock == nullptr) - return std::nullopt; - - // Now find all the elements that belong to this track piece - int32_t sequence = trackElement->GetSequenceIndex(); - uint8_t mapDirection = trackElement->GetDirection(); - - CoordsXY offsets = { trackBlock[sequence].x, trackBlock[sequence].y }; - CoordsXY newCoords = location; - newCoords += offsets.Rotate(direction_reverse(mapDirection)); - - auto retCoordsXYZ = CoordsXYZ{ newCoords.x, newCoords.y, location.z - trackBlock[sequence].z }; - - int32_t start_z = retCoordsXYZ.z; - retCoordsXYZ.z += trackBlock[0].z; - for (int32_t i = 0; trackBlock[i].index != 0xFF; ++i) - { - CoordsXY cur = { retCoordsXYZ }; - offsets = { trackBlock[i].x, trackBlock[i].y }; - cur += offsets.Rotate(mapDirection); - int32_t cur_z = start_z + trackBlock[i].z; - - map_invalidate_tile_full(cur); - - trackElement = map_get_track_element_at_of_type_seq( - { cur, cur_z, static_cast(location.direction) }, type, trackBlock[i].index); - if (trackElement == nullptr) - { - return std::nullopt; - } - if (i == 0 && output_element != nullptr) - { - *output_element = reinterpret_cast(trackElement); - } - if (flags & TRACK_ELEMENT_SET_HIGHLIGHT_FALSE) - { - trackElement->SetHighlight(false); - } - if (flags & TRACK_ELEMENT_SET_HIGHLIGHT_TRUE) - { - trackElement->SetHighlight(true); - } - if (flags & TRACK_ELEMENT_SET_COLOUR_SCHEME) - { - trackElement->SetColourScheme(static_cast(extra_params & 0xFF)); - } - if (flags & TRACK_ELEMENT_SET_SEAT_ROTATION) - { - trackElement->SetSeatRotation(static_cast(extra_params & 0xFF)); - } - if (flags & TRACK_ELEMENT_SET_HAS_CABLE_LIFT_TRUE) - { - trackElement->SetHasCableLift(true); - } - if (flags & TRACK_ELEMENT_SET_HAS_CABLE_LIFT_FALSE) - { - trackElement->SetHasCableLift(false); - } - } - return retCoordsXYZ; -} - -void ride_restore_provisional_track_piece() -{ - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) - { - ride_id_t rideIndex; - int32_t direction, type, liftHillAndAlternativeState; - CoordsXYZ trackPos; - if (window_ride_construction_update_state( - &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) - { - ride_construction_remove_ghosts(); - } - else - { - _currentTrackPrice = place_provisional_track_piece( - rideIndex, type, direction, liftHillAndAlternativeState, trackPos); - window_ride_construction_update_active_elements(); - } - } -} - -void ride_remove_provisional_track_piece() -{ - auto rideIndex = _currentRideIndex; - auto ride = get_ride(rideIndex); - if (ride == nullptr || !(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) - { - return; - } - - int32_t x = _unkF440C5.x; - int32_t y = _unkF440C5.y; - int32_t z = _unkF440C5.z; - if (ride->type == RIDE_TYPE_MAZE) - { - int32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND - | GAME_COMMAND_FLAG_GHOST; - maze_set_track(x, y, z, flags, false, 0, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x, y + 16, z, flags, false, 1, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x + 16, y + 16, z, flags, false, 2, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x + 16, y, z, flags, false, 3, rideIndex, GC_SET_MAZE_TRACK_FILL); - } - else - { - int32_t direction = _unkF440C5.direction; - if (!(direction & 4)) - { - x -= CoordsDirectionDelta[direction].x; - y -= CoordsDirectionDelta[direction].y; - } - CoordsXYE next_track; - if (track_block_get_next_from_zero({ x, y, z }, ride, direction, &next_track, &z, &direction, true)) - { - auto trackType = next_track.element->AsTrack()->GetTrackType(); - int32_t trackSequence = next_track.element->AsTrack()->GetSequenceIndex(); - auto trackRemoveAction = TrackRemoveAction{ trackType, - trackSequence, - { next_track.x, next_track.y, z, static_cast(direction) } }; - trackRemoveAction.SetFlags( - GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); - GameActions::Execute(&trackRemoveAction); - } - } -} - -/** - * - * rct2: 0x006C96C0 - */ -void ride_construction_remove_ghosts() -{ - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) - { - ride_entrance_exit_remove_ghost(); - _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT; - } - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) - { - ride_remove_provisional_track_piece(); - _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_TRACK; - } -} - -/* - * rct2: 0x006C9627 - */ -void ride_construction_invalidate_current_track() -{ - switch (_rideConstructionState) - { - case RIDE_CONSTRUCTION_STATE_SELECTED: - sub_6C683D( - { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, - nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); - break; - case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: - case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: - case RIDE_CONSTRUCTION_STATE_MAZE_FILL: - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) - { - map_invalidate_tile_full(_currentTrackBegin.ToTileStart()); - } - ride_construction_remove_ghosts(); - break; - case RIDE_CONSTRUCTION_STATE_PLACE: - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: - default: - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) - { - _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ARROW; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_tile_full(_currentTrackBegin); - } - ride_construction_remove_ghosts(); - break; - } -} - -/** - * - * rct2: 0x006C9B19 - */ -static void ride_construction_reset_current_piece() -{ - auto ride = get_ride(_currentRideIndex); - if (ride == nullptr) - return; - - const auto& rtd = ride->GetRideTypeDescriptor(); - - if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK) || ride->num_stations == 0) - { - _currentTrackCurve = rtd.StartTrackPiece | RideConstructionSpecialPieceSelected; - _currentTrackSlopeEnd = 0; - _currentTrackBankEnd = 0; - _currentTrackLiftHill = 0; - _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; - if (rtd.HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) - { - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - } - _previousTrackSlopeEnd = 0; - _previousTrackBankEnd = 0; - } - else - { - _currentTrackCurve = TrackElemType::None; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; - } -} - -/** - * - * rct2: 0x006C9800 - */ -void ride_construction_set_default_next_piece() -{ - auto rideIndex = _currentRideIndex; - auto ride = get_ride(rideIndex); - if (ride == nullptr) - return; - - const auto& rtd = ride->GetRideTypeDescriptor(); - - int32_t z, direction, trackType, curve, bank, slope; - track_begin_end trackBeginEnd; - CoordsXYE xyElement; - TileElement* tileElement; - _currentTrackPrice = MONEY32_UNDEFINED; - switch (_rideConstructionState) - { - case RIDE_CONSTRUCTION_STATE_FRONT: - direction = _currentTrackPieceDirection; - if (!track_block_get_previous_from_zero(_currentTrackBegin, ride, direction, &trackBeginEnd)) - { - ride_construction_reset_current_piece(); - return; - } - tileElement = trackBeginEnd.begin_element; - trackType = tileElement->AsTrack()->GetTrackType(); - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) - { - ride_construction_reset_current_piece(); - return; - } - - // Set whether track is covered - _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) - { - if (tileElement->AsTrack()->IsInverted()) - { - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - } - } - - curve = gTrackCurveChain[trackType].next; - bank = TrackDefinitions[trackType].bank_end; - slope = TrackDefinitions[trackType].vangle_end; - - // Set track curve - _currentTrackCurve = curve; - - // Set track banking - if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) - { - if (bank == TRACK_BANK_UPSIDE_DOWN) - { - bank = TRACK_BANK_NONE; - _currentTrackAlternative ^= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - } - } - _currentTrackBankEnd = bank; - _previousTrackBankEnd = bank; - - // Set track slope and lift hill - _currentTrackSlopeEnd = slope; - _previousTrackSlopeEnd = slope; - _currentTrackLiftHill = tileElement->AsTrack()->HasChain() && slope != TRACK_SLOPE_DOWN_25 - && slope != TRACK_SLOPE_DOWN_60; - break; - case RIDE_CONSTRUCTION_STATE_BACK: - direction = direction_reverse(_currentTrackPieceDirection); - if (!track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &xyElement, &z, &direction, false)) - { - ride_construction_reset_current_piece(); - return; - } - tileElement = xyElement.element; - trackType = tileElement->AsTrack()->GetTrackType(); - - // Set whether track is covered - _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) - { - if (tileElement->AsTrack()->IsInverted()) - { - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - } - } - - curve = gTrackCurveChain[trackType].previous; - bank = TrackDefinitions[trackType].bank_start; - slope = TrackDefinitions[trackType].vangle_start; - - // Set track curve - _currentTrackCurve = curve; - - // Set track banking - if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) - { - if (bank == TRACK_BANK_UPSIDE_DOWN) - { - bank = TRACK_BANK_NONE; - _currentTrackAlternative ^= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - } - } - _currentTrackBankEnd = bank; - _previousTrackBankEnd = bank; - - // Set track slope and lift hill - _currentTrackSlopeEnd = slope; - _previousTrackSlopeEnd = slope; - if (!gCheatsEnableChainLiftOnAllTrack) - { - _currentTrackLiftHill = tileElement->AsTrack()->HasChain(); - } - break; - } -} - -/** - * - * rct2: 0x006C9296 - */ -void ride_select_next_section() -{ - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) - { - ride_construction_invalidate_current_track(); - int32_t direction = _currentTrackPieceDirection; - int32_t type = _currentTrackPieceType; - TileElement* tileElement; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; - window_ride_construction_update_active_elements(); - return; - } - - // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); - - CoordsXYE inputElement, outputElement; - inputElement.x = newCoords->x; - inputElement.y = newCoords->y; - inputElement.element = tileElement; - if (track_block_get_next(&inputElement, &outputElement, &newCoords->z, &direction)) - { - newCoords->x = outputElement.x; - newCoords->y = outputElement.y; - tileElement = outputElement.element; - if (!scenery_tool_is_active()) - { - // Set next element's height. - virtual_floor_set_height(tileElement->GetBaseZ()); - } - - _currentTrackBegin = *newCoords; - _currentTrackPieceDirection = tileElement->GetDirection(); - _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - window_ride_construction_update_active_elements(); - } - else - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; - _currentTrackBegin = { outputElement, newCoords->z }; - _currentTrackPieceDirection = direction; - _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - ride_construction_set_default_next_piece(); - window_ride_construction_update_active_elements(); - } - } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - if (ride_select_forwards_from_back()) - { - window_ride_construction_update_active_elements(); - } - } -} - -/** - * - * rct2: 0x006C93B8 - */ -void ride_select_previous_section() -{ - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) - { - ride_construction_invalidate_current_track(); - int32_t direction = _currentTrackPieceDirection; - int32_t type = _currentTrackPieceType; - TileElement* tileElement; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; - window_ride_construction_update_active_elements(); - return; - } - - // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); - - track_begin_end trackBeginEnd; - if (track_block_get_previous({ *newCoords, tileElement }, &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; - if (!scenery_tool_is_active()) - { - // Set previous element's height. - virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseZ()); - } - window_ride_construction_update_active_elements(); - } - else - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_BACK; - _currentTrackBegin.x = trackBeginEnd.end_x; - _currentTrackBegin.y = trackBeginEnd.end_y; - _currentTrackBegin.z = trackBeginEnd.begin_z; - _currentTrackPieceDirection = trackBeginEnd.end_direction; - _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - ride_construction_set_default_next_piece(); - window_ride_construction_update_active_elements(); - } - } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - if (ride_select_backwards_from_front()) - { - window_ride_construction_update_active_elements(); - } - } -} - -/** - * - * rct2: 0x006CC2CA - */ -static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) -{ - if (tileElement.element == nullptr) - return false; - - auto entranceElement = tileElement.element->AsEntrance(); - if (entranceElement == nullptr) - return false; - - auto rideIndex = entranceElement->GetRideIndex(); - auto ride = get_ride(rideIndex); - if (ride == nullptr) - return false; - - auto entranceType = entranceElement->GetEntranceType(); - if (entranceType != ENTRANCE_TYPE_RIDE_ENTRANCE && entranceType != ENTRANCE_TYPE_RIDE_EXIT) - return false; - - auto stationIndex = entranceElement->GetStationIndex(); - - // Get or create construction window for ride - auto constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (constructionWindow == nullptr) - { - if (!ride_initialise_construction_window(ride)) - return false; - - constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (constructionWindow == nullptr) - return false; - } - - ride_construction_invalidate_current_track(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) - || gCurrentToolWidget.window_classification != WC_RIDE_CONSTRUCTION) - { - // Replace entrance / exit - tool_set( - constructionWindow, - entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE : WC_RIDE_CONSTRUCTION__WIDX_EXIT, - Tool::Crosshair); - gRideEntranceExitPlaceType = entranceType; - gRideEntranceExitPlaceRideIndex = rideIndex; - gRideEntranceExitPlaceStationIndex = stationIndex; - input_set_flag(INPUT_FLAG_6, true); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) - { - gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; - } - - window_ride_construction_update_active_elements(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - } - else - { - // Remove entrance / exit - auto rideEntranceExitRemove = RideEntranceExitRemoveAction( - { tileElement.x, tileElement.y }, rideIndex, stationIndex, entranceType == ENTRANCE_TYPE_RIDE_EXIT); - - rideEntranceExitRemove.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - gCurrentToolWidget.widget_index = entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE - : WC_RIDE_CONSTRUCTION__WIDX_EXIT; - gRideEntranceExitPlaceType = entranceType; - window_invalidate_by_class(WC_RIDE_CONSTRUCTION); - }); - - GameActions::Execute(&rideEntranceExitRemove); - } - - window_invalidate_by_class(WC_RIDE_CONSTRUCTION); - return true; -} - -/** - * - * rct2: 0x006CC287 - */ -static bool ride_modify_maze(const CoordsXYE& tileElement) -{ - if (tileElement.element != nullptr) - { - auto trackElement = tileElement.element->AsTrack(); - if (trackElement != nullptr) - { - _currentRideIndex = trackElement->GetRideIndex(); - _rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD; - _currentTrackBegin.x = tileElement.x; - _currentTrackBegin.y = tileElement.y; - _currentTrackBegin.z = trackElement->GetBaseZ(); - _currentTrackSelectionFlags = 0; - _rideConstructionNextArrowPulse = 0; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - context_broadcast_intent(&intent); - return true; - } - } - return false; -} - -/** - * - * rct2: 0x006CC056 - */ -bool ride_modify(CoordsXYE* input) -{ - auto tileElement = *input; - if (tileElement.element == nullptr) - return false; - - auto rideIndex = tileElement.element->GetRideIndex(); - auto ride = get_ride(rideIndex); - if (ride == nullptr) - { - return false; - } - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr || !ride_check_if_construction_allowed(ride)) - return false; - - if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) - { - Formatter ft; - ft.Increment(6); - ride->FormatNameTo(ft); - context_show_error( - STR_CANT_START_CONSTRUCTION_ON, STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE, ft); - return false; - } - - // Stop the ride again to clear all vehicles and peeps (compatible with network games) - if (ride->status != RideStatus::Simulating) - { - ride_set_status(ride, RideStatus::Closed); - } - - // Check if element is a station entrance or exit - if (tileElement.element->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) - return ride_modify_entrance_or_exit(tileElement); - - ride_create_or_find_construction_window(rideIndex); - - if (ride->type == RIDE_TYPE_MAZE) - { - return ride_modify_maze(tileElement); - } - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS)) - { - CoordsXYE endOfTrackElement{}; - if (ride_find_track_gap(ride, &tileElement, &endOfTrackElement)) - tileElement = endOfTrackElement; - } - - if (tileElement.element == nullptr || tileElement.element->GetType() != TILE_ELEMENT_TYPE_TRACK) - return false; - - auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() }; - auto direction = tileElement.element->GetDirection(); - auto type = tileElement.element->AsTrack()->GetTrackType(); - auto newCoords = sub_6C683D({ tileCoords, direction }, type, 0, nullptr, 0); - if (newCoords == std::nullopt) - return false; - - _currentRideIndex = rideIndex; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; - _currentTrackBegin = *newCoords; - _currentTrackPieceDirection = direction; - _currentTrackPieceType = type; - _currentTrackSelectionFlags = 0; - _rideConstructionNextArrowPulse = 0; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) - { - window_ride_construction_update_active_elements(); - return true; - } - - ride_select_next_section(); - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) - { - window_ride_construction_update_active_elements(); - return true; - } - - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; - _currentTrackBegin = *newCoords; - _currentTrackPieceDirection = direction; - _currentTrackPieceType = type; - _currentTrackSelectionFlags = 0; - - ride_select_previous_section(); - - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_BACK) - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; - _currentTrackBegin = *newCoords; - _currentTrackPieceDirection = direction; - _currentTrackPieceType = type; - _currentTrackSelectionFlags = 0; - } - - window_ride_construction_update_active_elements(); - return true; -} - -/** - * - * rct2: 0x006CC3FB - */ -int32_t ride_initialise_construction_window(Ride* ride) -{ - rct_window* w; - - tool_cancel(); - - if (!ride_check_if_construction_allowed(ride)) - return 0; - - ride_clear_for_construction(ride); - ride_remove_peeps(ride); - - w = ride_create_or_find_construction_window(ride->id); - - tool_set(w, WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT, Tool::Crosshair); - input_set_flag(INPUT_FLAG_6, true); - - ride = get_ride(_currentRideIndex); - if (ride == nullptr) - return 0; - - _currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected; - _currentTrackSlopeEnd = 0; - _currentTrackBankEnd = 0; - _currentTrackLiftHill = 0; - _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - - _previousTrackBankEnd = 0; - _previousTrackSlopeEnd = 0; - - _currentTrackPieceDirection = 0; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; - _currentTrackSelectionFlags = 0; - - window_ride_construction_update_active_elements(); - return 1; -} - #pragma endregion #pragma region Update functions @@ -3478,22 +2414,6 @@ void ride_set_map_tooltip(TileElement* tileElement) #pragma endregion -money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value) -{ - auto rideSetSetting = RideSetSettingAction(rideId, setting, value); - auto res = GameActions::Execute(&rideSetSetting); - return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; -} - -money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags) -{ - auto rideSetSetting = RideSetSettingAction(rideId, setting, value); - rideSetSetting.SetFlags(flags); - auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&rideSetSetting) - : GameActions::QueryNested(&rideSetSetting); - return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; -} - /** * * rct2: 0x006B4CC1 @@ -5140,64 +4060,6 @@ void ride_get_start_of_track(CoordsXYE* output) *output = trackElement; } -/** - * - * rct2: 0x006CB7FB - */ -int32_t ride_get_refund_price(const Ride* ride) -{ - CoordsXYE trackElement; - money32 cost = 0; - - if (!ride_try_get_origin_element(ride, &trackElement)) - { - return 0; // Ride has no track to refund - } - - // Find the start in case it is not a complete circuit - ride_get_start_of_track(&trackElement); - - uint8_t direction = trackElement.element->GetDirection(); - - // Used in the following loop to know when we have - // completed all of the elements and are back at the - // start. - TileElement* initial_map = trackElement.element; - CoordsXYE slowIt = trackElement; - bool moveSlowIt = true; - - do - { - auto trackRemoveAction = TrackRemoveAction( - trackElement.element->AsTrack()->GetTrackType(), trackElement.element->AsTrack()->GetSequenceIndex(), - { trackElement.x, trackElement.y, trackElement.element->GetBaseZ(), direction }); - trackRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - - auto res = GameActions::Query(&trackRemoveAction); - - cost += res->Cost; - - if (!track_block_get_next(&trackElement, &trackElement, nullptr, nullptr)) - { - break; - } - - moveSlowIt = !moveSlowIt; - if (moveSlowIt) - { - if (!track_block_get_next(&slowIt, &slowIt, nullptr, nullptr) || slowIt.element == trackElement.element) - { - break; - } - } - - direction = trackElement.element->GetDirection(); - - } while (trackElement.element != initial_map); - - return cost; -} - /** * * rct2: 0x00696707 @@ -5720,315 +4582,6 @@ void set_vehicle_type_image_max_sizes(rct_ride_entry_vehicle* vehicle_type, int3 vehicle_type->sprite_height_positive = bh; } -static int32_t loc_6CD18E( - int16_t mapX, int16_t mapY, int16_t entranceMinX, int16_t entranceMinY, int16_t entranceMaxX, int16_t entranceMaxY) -{ - int32_t direction = 0; - if (mapX == entranceMinX) - { - if (mapY > entranceMinY && mapY < entranceMaxY) - { - return direction; - } - } - direction = 1; - if (mapY == entranceMaxY) - { - if (mapX > entranceMinX && mapX < entranceMaxX) - { - return direction; - } - } - direction = 2; - if (mapX == entranceMaxX) - { - if (mapY > entranceMinY && mapY < entranceMaxY) - { - return direction; - } - } - direction = 3; - if (mapY == entranceMinY) - { - if (mapX > entranceMinX && mapX < entranceMaxX) - { - return direction; - } - } - return -1; -} - -/** - * - * rct2: 0x006CCF70 - */ -CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords) -{ - CoordsXYZD entranceExitCoords{}; - - gRideEntranceExitPlaceDirection = INVALID_DIRECTION; - auto info = get_map_coordinates_from_pos(screenCoords, EnumsToFlags(ViewportInteractionItem::Ride)); - if (info.SpriteType != ViewportInteractionItem::None) - { - if (info.Element->GetType() == TILE_ELEMENT_TYPE_TRACK) - { - if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) - { - if (TrackSequenceProperties[info.Element->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN) - { - if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) - { - gRideEntranceExitPlaceStationIndex = 0; - } - else - { - gRideEntranceExitPlaceStationIndex = info.Element->AsTrack()->GetStationIndex(); - } - } - } - } - } - - auto ride = get_ride(gRideEntranceExitPlaceRideIndex); - if (ride == nullptr) - { - entranceExitCoords.setNull(); - return entranceExitCoords; - } - - auto stationBaseZ = ride->stations[gRideEntranceExitPlaceStationIndex].GetBaseZ(); - - auto coords = screen_get_map_xy_with_z(screenCoords, stationBaseZ); - if (!coords) - { - entranceExitCoords.setNull(); - return entranceExitCoords; - } - - auto word_F4418C = coords->x; - auto word_F4418E = coords->y; - - entranceExitCoords = { coords->ToTileStart(), stationBaseZ, INVALID_DIRECTION }; - - if (ride->type == RIDE_TYPE_NULL) - { - entranceExitCoords.setNull(); - return entranceExitCoords; - } - - auto stationStart = ride->stations[gRideEntranceExitPlaceStationIndex].Start; - if (stationStart.isNull()) - { - entranceExitCoords.setNull(); - return entranceExitCoords; - } - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) - { - auto mapX = (word_F4418C & 0x1F) - 16; - auto mapY = (word_F4418E & 0x1F) - 16; - if (std::abs(mapX) < std::abs(mapY)) - { - entranceExitCoords.direction = mapY < 0 ? 3 : 1; - } - else - { - entranceExitCoords.direction = mapX < 0 ? 0 : 2; - } - - for (int32_t i = 0; i < MAX_STATIONS; i++) - { - mapX = entranceExitCoords.x + CoordsDirectionDelta[entranceExitCoords.direction].x; - mapY = entranceExitCoords.y + CoordsDirectionDelta[entranceExitCoords.direction].y; - if (map_is_location_valid({ mapX, mapY })) - { - auto tileElement = map_get_first_element_at({ mapX, mapY }); - if (tileElement == nullptr) - continue; - do - { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (tileElement->GetBaseZ() != stationBaseZ) - continue; - if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) - continue; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Maze) - { - entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; - } - if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) - continue; - - int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) - & TILE_ELEMENT_DIRECTION_MASK; - if (TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()] - [tileElement->AsTrack()->GetSequenceIndex()] - & (1 << eax)) - { - entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; - } - } while (!(tileElement++)->IsLastForTile()); - } - entranceExitCoords.direction = (entranceExitCoords.direction + 1) & 3; - } - gRideEntranceExitPlaceDirection = INVALID_DIRECTION; - } - else - { - auto mapX = stationStart.x; - auto mapY = stationStart.y; - auto entranceMinX = mapX; - auto entranceMinY = mapY; - auto entranceMaxX = mapX; - auto entranceMaxY = mapY; - - auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); - if (tileElement == nullptr) - { - entranceExitCoords.setNull(); - return entranceExitCoords; - } - entranceExitCoords.direction = tileElement->GetDirection(); - auto stationDirection = entranceExitCoords.direction; - - while (true) - { - entranceMaxX = mapX; - entranceMaxY = mapY; - mapX -= CoordsDirectionDelta[entranceExitCoords.direction].x; - mapY -= CoordsDirectionDelta[entranceExitCoords.direction].y; - tileElement = map_get_first_element_at({ mapX, mapY }); - if (tileElement == nullptr) - break; - bool goToNextTile = false; - - do - { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) - continue; - if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) - continue; - - if (tileElement->AsTrack()->IsStation()) - { - goToNextTile = true; - } - } while (!goToNextTile && !(tileElement++)->IsLastForTile()); - - if (!goToNextTile) - break; - } - - mapX = entranceMinX; - if (mapX > entranceMaxX) - { - entranceMinX = entranceMaxX; - entranceMaxX = mapX; - } - - mapY = entranceMinY; - if (mapY > entranceMaxY) - { - entranceMinY = entranceMaxY; - entranceMaxY = mapY; - } - - auto direction = loc_6CD18E( - entranceExitCoords.x, entranceExitCoords.y, entranceMinX - 32, entranceMinY - 32, entranceMaxX + 32, - entranceMaxY + 32); - if (direction != -1 && direction != stationDirection && direction != direction_reverse(stationDirection)) - { - entranceExitCoords.direction = direction; - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; - } - } - return entranceExitCoords; -} - -bool ride_select_backwards_from_front() -{ - auto ride = get_ride(_currentRideIndex); - if (ride != nullptr) - { - ride_construction_invalidate_current_track(); - track_begin_end trackBeginEnd; - if (track_block_get_previous_from_zero(_currentTrackBegin, ride, _currentTrackPieceDirection, &trackBeginEnd)) - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; - _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; - return true; - } - } - return false; -} - -bool ride_select_forwards_from_back() -{ - auto ride = get_ride(_currentRideIndex); - if (ride != nullptr) - { - ride_construction_invalidate_current_track(); - - int32_t z = _currentTrackBegin.z; - int32_t direction = direction_reverse(_currentTrackPieceDirection); - CoordsXYE next_track; - if (track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &next_track, &z, &direction, false)) - { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; - _currentTrackBegin.x = next_track.x; - _currentTrackBegin.y = next_track.y; - _currentTrackBegin.z = z; - _currentTrackPieceDirection = next_track.element->GetDirection(); - _currentTrackPieceType = next_track.element->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - return true; - } - } - return false; -} - -/** - * - * rct2: 0x006B58EF - */ -bool ride_are_all_possible_entrances_and_exits_built(Ride* ride) -{ - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) - return true; - - for (int32_t i = 0; i < MAX_STATIONS; i++) - { - if (ride->stations[i].Start.isNull()) - { - continue; - } - if (ride_get_entrance_location(ride, i).isNull()) - { - gGameCommandErrorText = STR_ENTRANCE_NOT_YET_BUILT; - return false; - } - if (ride_get_exit_location(ride, i).isNull()) - { - gGameCommandErrorText = STR_EXIT_NOT_YET_BUILT; - return false; - } - } - return true; -} - /** * * rct2: 0x006B59C6 @@ -6527,230 +5080,6 @@ void Ride::SetNumCarsPerVehicle(int32_t numCarsPerVehicle) GameActions::Execute(&rideSetVehicleAction); } -/** - * - * rct2: 0x006CB945 - */ -void sub_6CB945(Ride* ride) -{ - if (ride->type != RIDE_TYPE_MAZE) - { - for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) - { - if (ride->stations[stationId].Start.isNull()) - continue; - - CoordsXYZ location = ride->stations[stationId].GetStart(); - uint8_t direction = INVALID_DIRECTION; - - bool specialTrack = false; - TileElement* tileElement = nullptr; - - while (true) - { - if (direction != INVALID_DIRECTION) - { - location.x -= CoordsDirectionDelta[direction].x; - location.y -= CoordsDirectionDelta[direction].y; - } - tileElement = map_get_first_element_at(location); - if (tileElement == nullptr) - break; - - bool trackFound = false; - do - { - if (tileElement->GetBaseZ() != location.z) - continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (tileElement->AsTrack()->GetRideIndex() != ride->id) - continue; - if (tileElement->AsTrack()->GetSequenceIndex() != 0) - continue; - if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) - continue; - - trackFound = true; - break; - } while (!(tileElement++)->IsLastForTile()); - - if (!trackFound) - { - break; - } - - tileElement->AsTrack()->SetStationIndex(stationId); - direction = tileElement->GetDirection(); - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) - { - specialTrack = true; - break; - } - } - - if (!specialTrack) - { - continue; - } - - const rct_preview_track* trackBlock = TrackBlocks[tileElement->AsTrack()->GetTrackType()]; - while ((++trackBlock)->index != 0xFF) - { - CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; - - bool trackFound = false; - tileElement = map_get_first_element_at(blockLocation); - if (tileElement == nullptr) - break; - do - { - if (blockLocation.z != tileElement->GetBaseZ()) - continue; - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) - continue; - - trackFound = true; - break; - } while (!(tileElement++)->IsLastForTile()); - - if (!trackFound) - { - break; - } - - tileElement->AsTrack()->SetStationIndex(stationId); - } - } - } - - FixedVector locations; - for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) - { - auto entrance = ride_get_entrance_location(ride, stationId); - if (!entrance.isNull()) - { - locations.push_back(entrance); - ride_clear_entrance_location(ride, stationId); - } - - auto exit = ride_get_exit_location(ride, stationId); - if (!exit.isNull()) - { - locations.push_back(exit); - ride_clear_exit_location(ride, stationId); - } - } - - auto locationListIter = locations.cbegin(); - for (const TileCoordsXYZD& locationCoords : locations) - { - auto locationList = ++locationListIter; - - bool duplicateLocation = false; - while (locationList != locations.cend()) - { - const TileCoordsXYZD& locationCoords2 = *locationList++; - if (locationCoords.x == locationCoords2.x && locationCoords.y == locationCoords2.y - && locationCoords.z == locationCoords2.z) - { - duplicateLocation = true; - break; - } - } - - if (duplicateLocation) - { - continue; - } - - CoordsXY location = locationCoords.ToCoordsXY(); - - TileElement* tileElement = map_get_first_element_at(location); - if (tileElement == nullptr) - continue; - do - { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) - continue; - if (tileElement->base_height != locationCoords.z) - continue; - if (tileElement->AsEntrance()->GetRideIndex() != ride->id) - continue; - if (tileElement->AsEntrance()->GetEntranceType() > ENTRANCE_TYPE_RIDE_EXIT) - continue; - - CoordsXY nextLocation = location; - nextLocation.x += CoordsDirectionDelta[tileElement->GetDirection()].x; - nextLocation.y += CoordsDirectionDelta[tileElement->GetDirection()].y; - - bool shouldRemove = true; - TileElement* trackElement = map_get_first_element_at(nextLocation); - if (trackElement == nullptr) - continue; - do - { - if (trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (trackElement->AsTrack()->GetRideIndex() != ride->id) - continue; - if (trackElement->base_height != tileElement->base_height) - continue; - - auto trackType = trackElement->AsTrack()->GetTrackType(); - uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); - - Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - - if (!(TrackSequenceProperties[trackType][trackSequence] & (1 << direction))) - { - continue; - } - - StationIndex stationId = 0; - if (trackType != TrackElemType::Maze) - { - stationId = trackElement->AsTrack()->GetStationIndex(); - } - - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) - { - if (!ride_get_exit_location(ride, stationId).isNull()) - break; - - CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; - ride_set_exit_location(ride, stationId, TileCoordsXYZD{ loc }); - } - else - { - if (!ride_get_entrance_location(ride, stationId).isNull()) - break; - - CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; - ride_set_entrance_location(ride, stationId, TileCoordsXYZD{ loc }); - } - - tileElement->AsEntrance()->SetStationIndex(stationId); - shouldRemove = false; - } while (!(trackElement++)->IsLastForTile()); - - if (shouldRemove) - { - footpath_queue_chain_reset(); - maze_entrance_hedge_replacement({ location, tileElement }); - footpath_remove_edges_at(location, tileElement); - footpath_update_queue_chains(); - map_invalidate_tile_full(location); - tile_element_remove(tileElement); - tileElement--; - } - } while (!(tileElement++)->IsLastForTile()); - } -} - void Ride::SetToDefaultInspectionInterval() { uint8_t defaultInspectionInterval = gConfigGeneral.default_inspection_interval; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp new file mode 100644 index 0000000000..e2fa615baa --- /dev/null +++ b/src/openrct2/ride/RideConstruction.cpp @@ -0,0 +1,1714 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../Context.h" +#include "../Input.h" +#include "../actions/RideEntranceExitRemoveAction.h" +#include "../actions/RideSetSettingAction.h" +#include "../actions/RideSetStatusAction.h" +#include "../actions/RideSetVehicleAction.h" +#include "../actions/TrackRemoveAction.h" +#include "../common.h" +#include "../interface/Window.h" +#include "../localisation/Date.h" +#include "../localisation/Localisation.h" +#include "../network/network.h" +#include "../paint/VirtualFloor.h" +#include "../ui/UiContext.h" +#include "../ui/WindowManager.h" +#include "../util/Util.h" +#include "../windows/Intent.h" +#include "../world/Banner.h" +#include "../world/Climate.h" +#include "../world/Entity.h" +#include "../world/EntityList.h" +#include "../world/Entrance.h" +#include "../world/Footpath.h" +#include "../world/Location.hpp" +#include "../world/Map.h" +#include "../world/MapAnimation.h" +#include "../world/Park.h" +#include "../world/Scenery.h" +#include "../world/Sprite.h" +#include "Ride.h" +#include "RideData.h" +#include "Track.h" +#include "TrackData.h" +#include "Vehicle.h" + +bool gGotoStartPlacementMode = false; + +money16 gTotalRideValueForMoney; + +money32 _currentTrackPrice; + +uint16_t _numCurrentPossibleRideConfigurations; +uint16_t _numCurrentPossibleSpecialTrackPieces; + +uint32_t _currentTrackCurve; +uint8_t _rideConstructionState; +ride_id_t _currentRideIndex; + +CoordsXYZ _currentTrackBegin; + +uint8_t _currentTrackPieceDirection; +track_type_t _currentTrackPieceType; +uint8_t _currentTrackSelectionFlags; +uint32_t _rideConstructionNextArrowPulse = 0; +uint8_t _currentTrackSlopeEnd; +uint8_t _currentTrackBankEnd; +uint8_t _currentTrackLiftHill; +uint8_t _currentTrackAlternative; +track_type_t _selectedTrackType; + +uint8_t _previousTrackBankEnd; +uint8_t _previousTrackSlopeEnd; + +CoordsXYZ _previousTrackPiece; + +uint8_t _currentBrakeSpeed2; +uint8_t _currentSeatRotationAngle; + +CoordsXYZD _unkF440C5; + +uint8_t gLastEntranceStyle; + +uint8_t gRideEntranceExitPlaceType; +ride_id_t gRideEntranceExitPlaceRideIndex; +StationIndex gRideEntranceExitPlaceStationIndex; +uint8_t gRideEntranceExitPlacePreviousRideConstructionState; +Direction gRideEntranceExitPlaceDirection; + +using namespace OpenRCT2; + +static int32_t ride_check_if_construction_allowed(Ride* ride) +{ + Formatter ft; + rct_ride_entry* rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + { + context_show_error(STR_INVALID_RIDE_TYPE, STR_CANT_EDIT_INVALID_RIDE_TYPE, ft); + return 0; + } + if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + { + ft.Increment(6); + ride->FormatNameTo(ft); + context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING, ft); + return 0; + } + + if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) + { + ft.Increment(6); + ride->FormatNameTo(ft); + context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST, ft); + return 0; + } + + return 1; +} + +static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) +{ + auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); + intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex); + windowManager->BroadcastIntent(intent); + return window_find_by_class(WC_RIDE_CONSTRUCTION); +} + +/** + * + * rct2: 0x006B4857 + */ +void ride_construct(Ride* ride) +{ + CoordsXYE trackElement; + if (ride_try_get_origin_element(ride, &trackElement)) + { + ride_find_track_gap(ride, &trackElement, &trackElement); + + rct_window* w = window_get_main(); + if (w != nullptr && ride_modify(&trackElement)) + window_scroll_to_location(w, { trackElement, trackElement.element->GetBaseZ() }); + } + else + { + ride_initialise_construction_window(ride); + } +} + +/** + * + * rct2: 0x006DD4D5 + */ +static void ride_remove_cable_lift(Ride* ride) +{ + if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT) + { + ride->lifecycle_flags &= ~RIDE_LIFECYCLE_CABLE_LIFT; + uint16_t spriteIndex = ride->cable_lift; + do + { + Vehicle* vehicle = GetEntity(spriteIndex); + if (vehicle == nullptr) + { + return; + } + vehicle->Invalidate(); + spriteIndex = vehicle->next_vehicle_on_train; + sprite_remove(vehicle); + } while (spriteIndex != SPRITE_INDEX_NULL); + } +} + +/** + * + * rct2: 0x006DD506 + */ +static void ride_remove_vehicles(Ride* ride) +{ + if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + { + ride->lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK; + ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); + + for (size_t i = 0; i <= MAX_VEHICLES_PER_RIDE; i++) + { + uint16_t spriteIndex = ride->vehicles[i]; + while (spriteIndex != SPRITE_INDEX_NULL) + { + Vehicle* vehicle = GetEntity(spriteIndex); + if (vehicle == nullptr) + { + break; + } + vehicle->Invalidate(); + spriteIndex = vehicle->next_vehicle_on_train; + sprite_remove(vehicle); + } + + ride->vehicles[i] = SPRITE_INDEX_NULL; + } + + for (size_t i = 0; i < MAX_STATIONS; i++) + ride->stations[i].TrainAtStation = RideStation::NO_TRAIN; + } +} + +/** + * + * rct2: 0x006DD4AC + */ +void ride_clear_for_construction(Ride* ride) +{ + ride->measurement = {}; + + ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); + ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; + + // Open circuit rides will go directly into building mode (creating ghosts) where it would normally clear the stats, + // however this causes desyncs since it's directly run from the window and other clients would not get it. + // To prevent these problems, unconditionally invalidate the test results on all clients in multiplayer games. + if (network_get_mode() != NETWORK_MODE_NONE) + { + invalidate_test_results(ride); + } + + ride_remove_cable_lift(ride); + ride_remove_vehicles(ride); + ride_clear_blocked_tiles(ride); + + auto w = window_find_by_number(WC_RIDE, ride->id); + if (w != nullptr) + window_event_resize_call(w); +} + +/** + * + * rct2: 0x006664DF + */ +void ride_remove_peeps(Ride* ride) +{ + // Find first station + auto stationIndex = ride_get_first_valid_station_start(ride); + + // Get exit position and direction + auto exitPosition = CoordsXYZD{ 0, 0, 0, INVALID_DIRECTION }; + if (stationIndex != STATION_INDEX_NULL) + { + auto location = ride_get_exit_location(ride, stationIndex).ToCoordsXYZD(); + if (!location.isNull()) + { + auto direction = direction_reverse(location.direction); + exitPosition = location; + exitPosition.x += (DirectionOffsets[direction].x * 20) + COORDS_XY_HALF_TILE; + exitPosition.y += (DirectionOffsets[direction].y * 20) + COORDS_XY_HALF_TILE; + exitPosition.z += 2; + + // Reverse direction + exitPosition.direction = direction_reverse(exitPosition.direction); + + exitPosition.direction *= 8; + } + } + + // Place all the guests at exit + for (auto peep : EntityList()) + { + if (peep->State == PeepState::QueuingFront || peep->State == PeepState::EnteringRide + || peep->State == PeepState::LeavingRide || peep->State == PeepState::OnRide) + { + if (peep->CurrentRide != ride->id) + continue; + + peep_decrement_num_riders(peep); + if (peep->State == PeepState::QueuingFront && peep->RideSubState == PeepRideSubState::AtEntrance) + peep->RemoveFromQueue(); + + if (exitPosition.direction == INVALID_DIRECTION) + { + CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z }; + if (peep->GetNextIsSloped()) + newLoc.z += COORDS_Z_STEP; + newLoc.z++; + peep->MoveTo(newLoc); + } + else + { + peep->MoveTo(exitPosition); + peep->sprite_direction = exitPosition.direction; + } + + peep->State = PeepState::Falling; + peep->SwitchToSpecialSprite(0); + + peep->Happiness = std::min(peep->Happiness, peep->HappinessTarget) / 2; + peep->HappinessTarget = peep->Happiness; + peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; + } + } + // Place all the staff at exit + for (auto peep : EntityList()) + { + if (peep->State == PeepState::Fixing || peep->State == PeepState::Inspecting) + { + if (peep->CurrentRide != ride->id) + continue; + + if (exitPosition.direction == INVALID_DIRECTION) + { + CoordsXYZ newLoc = { peep->NextLoc.ToTileCentre(), peep->NextLoc.z }; + if (peep->GetNextIsSloped()) + newLoc.z += COORDS_Z_STEP; + newLoc.z++; + peep->MoveTo(newLoc); + } + else + { + peep->MoveTo(exitPosition); + peep->sprite_direction = exitPosition.direction; + } + + peep->State = PeepState::Falling; + peep->SwitchToSpecialSprite(0); + + peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_STATS; + } + } + ride->num_riders = 0; + ride->slide_in_use = 0; + ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN; +} + +void ride_clear_blocked_tiles(Ride* ride) +{ + for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + { + for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + { + auto element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + if (element != nullptr) + { + do + { + if (element->GetType() == TILE_ELEMENT_TYPE_TRACK && element->AsTrack()->GetRideIndex() == ride->id) + { + // Unblock footpath element that is at same position + auto footpathElement = map_get_footpath_element( + TileCoordsXYZ{ x, y, element->base_height }.ToCoordsXYZ()); + if (footpathElement != nullptr) + { + footpathElement->AsPath()->SetIsBlockedByVehicle(false); + } + } + } while (!(element++)->IsLastForTile()); + } + } + } +} + +/** + * Gets the origin track element (sequence 0). Seems to do more than that though and even invalidates track. + * rct2: 0x006C683D + * ax : x + * bx : direction << 8, type + * cx : y + * dx : z + * si : extra_params + * di : output_element + * bp : flags + */ +std::optional sub_6C683D( + const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags) +{ + // Find the relevant track piece, prefer sequence 0 (this ensures correct behaviour for diagonal track pieces) + auto trackElement = map_get_track_element_at_of_type_seq(location, type, 0); + if (trackElement == nullptr) + { + trackElement = map_get_track_element_at_of_type(location, type); + if (trackElement == nullptr) + { + return std::nullopt; + } + } + + // Possibly z should be & 0xF8 + auto trackBlock = TrackBlocks[type]; + if (trackBlock == nullptr) + return std::nullopt; + + // Now find all the elements that belong to this track piece + int32_t sequence = trackElement->GetSequenceIndex(); + uint8_t mapDirection = trackElement->GetDirection(); + + CoordsXY offsets = { trackBlock[sequence].x, trackBlock[sequence].y }; + CoordsXY newCoords = location; + newCoords += offsets.Rotate(direction_reverse(mapDirection)); + + auto retCoordsXYZ = CoordsXYZ{ newCoords.x, newCoords.y, location.z - trackBlock[sequence].z }; + + int32_t start_z = retCoordsXYZ.z; + retCoordsXYZ.z += trackBlock[0].z; + for (int32_t i = 0; trackBlock[i].index != 0xFF; ++i) + { + CoordsXY cur = { retCoordsXYZ }; + offsets = { trackBlock[i].x, trackBlock[i].y }; + cur += offsets.Rotate(mapDirection); + int32_t cur_z = start_z + trackBlock[i].z; + + map_invalidate_tile_full(cur); + + trackElement = map_get_track_element_at_of_type_seq( + { cur, cur_z, static_cast(location.direction) }, type, trackBlock[i].index); + if (trackElement == nullptr) + { + return std::nullopt; + } + if (i == 0 && output_element != nullptr) + { + *output_element = reinterpret_cast(trackElement); + } + if (flags & TRACK_ELEMENT_SET_HIGHLIGHT_FALSE) + { + trackElement->SetHighlight(false); + } + if (flags & TRACK_ELEMENT_SET_HIGHLIGHT_TRUE) + { + trackElement->SetHighlight(true); + } + if (flags & TRACK_ELEMENT_SET_COLOUR_SCHEME) + { + trackElement->SetColourScheme(static_cast(extra_params & 0xFF)); + } + if (flags & TRACK_ELEMENT_SET_SEAT_ROTATION) + { + trackElement->SetSeatRotation(static_cast(extra_params & 0xFF)); + } + if (flags & TRACK_ELEMENT_SET_HAS_CABLE_LIFT_TRUE) + { + trackElement->SetHasCableLift(true); + } + if (flags & TRACK_ELEMENT_SET_HAS_CABLE_LIFT_FALSE) + { + trackElement->SetHasCableLift(false); + } + } + return retCoordsXYZ; +} + +void ride_restore_provisional_track_piece() +{ + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) + { + ride_id_t rideIndex; + int32_t direction, type, liftHillAndAlternativeState; + CoordsXYZ trackPos; + if (window_ride_construction_update_state( + &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) + { + ride_construction_remove_ghosts(); + } + else + { + _currentTrackPrice = place_provisional_track_piece( + rideIndex, type, direction, liftHillAndAlternativeState, trackPos); + window_ride_construction_update_active_elements(); + } + } +} + +void ride_remove_provisional_track_piece() +{ + auto rideIndex = _currentRideIndex; + auto ride = get_ride(rideIndex); + if (ride == nullptr || !(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) + { + return; + } + + int32_t x = _unkF440C5.x; + int32_t y = _unkF440C5.y; + int32_t z = _unkF440C5.z; + if (ride->type == RIDE_TYPE_MAZE) + { + int32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND + | GAME_COMMAND_FLAG_GHOST; + maze_set_track(x, y, z, flags, false, 0, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(x, y + 16, z, flags, false, 1, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(x + 16, y + 16, z, flags, false, 2, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(x + 16, y, z, flags, false, 3, rideIndex, GC_SET_MAZE_TRACK_FILL); + } + else + { + int32_t direction = _unkF440C5.direction; + if (!(direction & 4)) + { + x -= CoordsDirectionDelta[direction].x; + y -= CoordsDirectionDelta[direction].y; + } + CoordsXYE next_track; + if (track_block_get_next_from_zero({ x, y, z }, ride, direction, &next_track, &z, &direction, true)) + { + auto trackType = next_track.element->AsTrack()->GetTrackType(); + int32_t trackSequence = next_track.element->AsTrack()->GetSequenceIndex(); + auto trackRemoveAction = TrackRemoveAction{ trackType, + trackSequence, + { next_track.x, next_track.y, z, static_cast(direction) } }; + trackRemoveAction.SetFlags( + GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + GameActions::Execute(&trackRemoveAction); + } + } +} + +/** + * + * rct2: 0x006C96C0 + */ +void ride_construction_remove_ghosts() +{ + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) + { + ride_entrance_exit_remove_ghost(); + _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT; + } + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) + { + ride_remove_provisional_track_piece(); + _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_TRACK; + } +} + +/* + * rct2: 0x006C9627 + */ +void ride_construction_invalidate_current_track() +{ + switch (_rideConstructionState) + { + case RIDE_CONSTRUCTION_STATE_SELECTED: + sub_6C683D( + { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, + nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); + break; + case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: + case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: + case RIDE_CONSTRUCTION_STATE_MAZE_FILL: + case RIDE_CONSTRUCTION_STATE_FRONT: + case RIDE_CONSTRUCTION_STATE_BACK: + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) + { + map_invalidate_tile_full(_currentTrackBegin.ToTileStart()); + } + ride_construction_remove_ghosts(); + break; + case RIDE_CONSTRUCTION_STATE_PLACE: + case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + default: + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) + { + _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ARROW; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + map_invalidate_tile_full(_currentTrackBegin); + } + ride_construction_remove_ghosts(); + break; + } +} + +/** + * + * rct2: 0x006C9B19 + */ +static void ride_construction_reset_current_piece() +{ + auto ride = get_ride(_currentRideIndex); + if (ride == nullptr) + return; + + const auto& rtd = ride->GetRideTypeDescriptor(); + + if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK) || ride->num_stations == 0) + { + _currentTrackCurve = rtd.StartTrackPiece | RideConstructionSpecialPieceSelected; + _currentTrackSlopeEnd = 0; + _currentTrackBankEnd = 0; + _currentTrackLiftHill = 0; + _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; + if (rtd.HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) + { + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + } + _previousTrackSlopeEnd = 0; + _previousTrackBankEnd = 0; + } + else + { + _currentTrackCurve = TrackElemType::None; + _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + } +} + +/** + * + * rct2: 0x006C9800 + */ +void ride_construction_set_default_next_piece() +{ + auto rideIndex = _currentRideIndex; + auto ride = get_ride(rideIndex); + if (ride == nullptr) + return; + + const auto& rtd = ride->GetRideTypeDescriptor(); + + int32_t z, direction, trackType, curve, bank, slope; + track_begin_end trackBeginEnd; + CoordsXYE xyElement; + TileElement* tileElement; + _currentTrackPrice = MONEY32_UNDEFINED; + switch (_rideConstructionState) + { + case RIDE_CONSTRUCTION_STATE_FRONT: + direction = _currentTrackPieceDirection; + if (!track_block_get_previous_from_zero(_currentTrackBegin, ride, direction, &trackBeginEnd)) + { + ride_construction_reset_current_piece(); + return; + } + tileElement = trackBeginEnd.begin_element; + trackType = tileElement->AsTrack()->GetTrackType(); + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) + { + ride_construction_reset_current_piece(); + return; + } + + // Set whether track is covered + _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) + { + if (tileElement->AsTrack()->IsInverted()) + { + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + } + } + + curve = gTrackCurveChain[trackType].next; + bank = TrackDefinitions[trackType].bank_end; + slope = TrackDefinitions[trackType].vangle_end; + + // Set track curve + _currentTrackCurve = curve; + + // Set track banking + if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) + { + if (bank == TRACK_BANK_UPSIDE_DOWN) + { + bank = TRACK_BANK_NONE; + _currentTrackAlternative ^= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + } + } + _currentTrackBankEnd = bank; + _previousTrackBankEnd = bank; + + // Set track slope and lift hill + _currentTrackSlopeEnd = slope; + _previousTrackSlopeEnd = slope; + _currentTrackLiftHill = tileElement->AsTrack()->HasChain() && slope != TRACK_SLOPE_DOWN_25 + && slope != TRACK_SLOPE_DOWN_60; + break; + case RIDE_CONSTRUCTION_STATE_BACK: + direction = direction_reverse(_currentTrackPieceDirection); + if (!track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &xyElement, &z, &direction, false)) + { + ride_construction_reset_current_piece(); + return; + } + tileElement = xyElement.element; + trackType = tileElement->AsTrack()->GetTrackType(); + + // Set whether track is covered + _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) + { + if (tileElement->AsTrack()->IsInverted()) + { + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + } + } + + curve = gTrackCurveChain[trackType].previous; + bank = TrackDefinitions[trackType].bank_start; + slope = TrackDefinitions[trackType].vangle_start; + + // Set track curve + _currentTrackCurve = curve; + + // Set track banking + if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)) + { + if (bank == TRACK_BANK_UPSIDE_DOWN) + { + bank = TRACK_BANK_NONE; + _currentTrackAlternative ^= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + } + } + _currentTrackBankEnd = bank; + _previousTrackBankEnd = bank; + + // Set track slope and lift hill + _currentTrackSlopeEnd = slope; + _previousTrackSlopeEnd = slope; + if (!gCheatsEnableChainLiftOnAllTrack) + { + _currentTrackLiftHill = tileElement->AsTrack()->HasChain(); + } + break; + } +} + +/** + * + * rct2: 0x006C9296 + */ +void ride_select_next_section() +{ + if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + { + ride_construction_invalidate_current_track(); + int32_t direction = _currentTrackPieceDirection; + int32_t type = _currentTrackPieceType; + TileElement* tileElement; + auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + if (newCoords == std::nullopt) + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + window_ride_construction_update_active_elements(); + return; + } + + // Invalidate previous track piece (we may not be changing height!) + virtual_floor_invalidate(); + + CoordsXYE inputElement, outputElement; + inputElement.x = newCoords->x; + inputElement.y = newCoords->y; + inputElement.element = tileElement; + if (track_block_get_next(&inputElement, &outputElement, &newCoords->z, &direction)) + { + newCoords->x = outputElement.x; + newCoords->y = outputElement.y; + tileElement = outputElement.element; + if (!scenery_tool_is_active()) + { + // Set next element's height. + virtual_floor_set_height(tileElement->GetBaseZ()); + } + + _currentTrackBegin = *newCoords; + _currentTrackPieceDirection = tileElement->GetDirection(); + _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + window_ride_construction_update_active_elements(); + } + else + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; + _currentTrackBegin = { outputElement, newCoords->z }; + _currentTrackPieceDirection = direction; + _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + ride_construction_set_default_next_piece(); + window_ride_construction_update_active_elements(); + } + } + else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + if (ride_select_forwards_from_back()) + { + window_ride_construction_update_active_elements(); + } + } +} + +/** + * + * rct2: 0x006C93B8 + */ +void ride_select_previous_section() +{ + if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + { + ride_construction_invalidate_current_track(); + int32_t direction = _currentTrackPieceDirection; + int32_t type = _currentTrackPieceType; + TileElement* tileElement; + auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + if (newCoords == std::nullopt) + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + window_ride_construction_update_active_elements(); + return; + } + + // Invalidate previous track piece (we may not be changing height!) + virtual_floor_invalidate(); + + track_begin_end trackBeginEnd; + if (track_block_get_previous({ *newCoords, tileElement }, &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; + if (!scenery_tool_is_active()) + { + // Set previous element's height. + virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseZ()); + } + window_ride_construction_update_active_elements(); + } + else + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_BACK; + _currentTrackBegin.x = trackBeginEnd.end_x; + _currentTrackBegin.y = trackBeginEnd.end_y; + _currentTrackBegin.z = trackBeginEnd.begin_z; + _currentTrackPieceDirection = trackBeginEnd.end_direction; + _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + ride_construction_set_default_next_piece(); + window_ride_construction_update_active_elements(); + } + } + else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + if (ride_select_backwards_from_front()) + { + window_ride_construction_update_active_elements(); + } + } +} + +/** + * + * rct2: 0x006CC2CA + */ +static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) +{ + if (tileElement.element == nullptr) + return false; + + auto entranceElement = tileElement.element->AsEntrance(); + if (entranceElement == nullptr) + return false; + + auto rideIndex = entranceElement->GetRideIndex(); + auto ride = get_ride(rideIndex); + if (ride == nullptr) + return false; + + auto entranceType = entranceElement->GetEntranceType(); + if (entranceType != ENTRANCE_TYPE_RIDE_ENTRANCE && entranceType != ENTRANCE_TYPE_RIDE_EXIT) + return false; + + auto stationIndex = entranceElement->GetStationIndex(); + + // Get or create construction window for ride + auto constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); + if (constructionWindow == nullptr) + { + if (!ride_initialise_construction_window(ride)) + return false; + + constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); + if (constructionWindow == nullptr) + return false; + } + + ride_construction_invalidate_current_track(); + if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) + || gCurrentToolWidget.window_classification != WC_RIDE_CONSTRUCTION) + { + // Replace entrance / exit + tool_set( + constructionWindow, + entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE : WC_RIDE_CONSTRUCTION__WIDX_EXIT, + Tool::Crosshair); + gRideEntranceExitPlaceType = entranceType; + gRideEntranceExitPlaceRideIndex = rideIndex; + gRideEntranceExitPlaceStationIndex = stationIndex; + input_set_flag(INPUT_FLAG_6, true); + if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + { + gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; + _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; + } + + window_ride_construction_update_active_elements(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + } + else + { + // Remove entrance / exit + auto rideEntranceExitRemove = RideEntranceExitRemoveAction( + { tileElement.x, tileElement.y }, rideIndex, stationIndex, entranceType == ENTRANCE_TYPE_RIDE_EXIT); + + rideEntranceExitRemove.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + gCurrentToolWidget.widget_index = entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE + : WC_RIDE_CONSTRUCTION__WIDX_EXIT; + gRideEntranceExitPlaceType = entranceType; + window_invalidate_by_class(WC_RIDE_CONSTRUCTION); + }); + + GameActions::Execute(&rideEntranceExitRemove); + } + + window_invalidate_by_class(WC_RIDE_CONSTRUCTION); + return true; +} + +/** + * + * rct2: 0x006CC287 + */ +static bool ride_modify_maze(const CoordsXYE& tileElement) +{ + if (tileElement.element != nullptr) + { + auto trackElement = tileElement.element->AsTrack(); + if (trackElement != nullptr) + { + _currentRideIndex = trackElement->GetRideIndex(); + _rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD; + _currentTrackBegin.x = tileElement.x; + _currentTrackBegin.y = tileElement.y; + _currentTrackBegin.z = trackElement->GetBaseZ(); + _currentTrackSelectionFlags = 0; + _rideConstructionNextArrowPulse = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); + context_broadcast_intent(&intent); + return true; + } + } + return false; +} + +/** + * + * rct2: 0x006CC056 + */ +bool ride_modify(CoordsXYE* input) +{ + auto tileElement = *input; + if (tileElement.element == nullptr) + return false; + + auto rideIndex = tileElement.element->GetRideIndex(); + auto ride = get_ride(rideIndex); + if (ride == nullptr) + { + return false; + } + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr || !ride_check_if_construction_allowed(ride)) + return false; + + if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) + { + Formatter ft; + ft.Increment(6); + ride->FormatNameTo(ft); + context_show_error( + STR_CANT_START_CONSTRUCTION_ON, STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE, ft); + return false; + } + + // Stop the ride again to clear all vehicles and peeps (compatible with network games) + if (ride->status != RideStatus::Simulating) + { + ride_set_status(ride, RideStatus::Closed); + } + + // Check if element is a station entrance or exit + if (tileElement.element->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) + return ride_modify_entrance_or_exit(tileElement); + + ride_create_or_find_construction_window(rideIndex); + + if (ride->type == RIDE_TYPE_MAZE) + { + return ride_modify_maze(tileElement); + } + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS)) + { + CoordsXYE endOfTrackElement{}; + if (ride_find_track_gap(ride, &tileElement, &endOfTrackElement)) + tileElement = endOfTrackElement; + } + + if (tileElement.element == nullptr || tileElement.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + return false; + + auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() }; + auto direction = tileElement.element->GetDirection(); + auto type = tileElement.element->AsTrack()->GetTrackType(); + auto newCoords = sub_6C683D({ tileCoords, direction }, type, 0, nullptr, 0); + if (newCoords == std::nullopt) + return false; + + _currentRideIndex = rideIndex; + _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _currentTrackBegin = *newCoords; + _currentTrackPieceDirection = direction; + _currentTrackPieceType = type; + _currentTrackSelectionFlags = 0; + _rideConstructionNextArrowPulse = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) + { + window_ride_construction_update_active_elements(); + return true; + } + + ride_select_next_section(); + if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + { + window_ride_construction_update_active_elements(); + return true; + } + + _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _currentTrackBegin = *newCoords; + _currentTrackPieceDirection = direction; + _currentTrackPieceType = type; + _currentTrackSelectionFlags = 0; + + ride_select_previous_section(); + + if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_BACK) + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _currentTrackBegin = *newCoords; + _currentTrackPieceDirection = direction; + _currentTrackPieceType = type; + _currentTrackSelectionFlags = 0; + } + + window_ride_construction_update_active_elements(); + return true; +} + +/** + * + * rct2: 0x006CC3FB + */ +int32_t ride_initialise_construction_window(Ride* ride) +{ + rct_window* w; + + tool_cancel(); + + if (!ride_check_if_construction_allowed(ride)) + return 0; + + ride_clear_for_construction(ride); + ride_remove_peeps(ride); + + w = ride_create_or_find_construction_window(ride->id); + + tool_set(w, WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT, Tool::Crosshair); + input_set_flag(INPUT_FLAG_6, true); + + ride = get_ride(_currentRideIndex); + if (ride == nullptr) + return 0; + + _currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected; + _currentTrackSlopeEnd = 0; + _currentTrackBankEnd = 0; + _currentTrackLiftHill = 0; + _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + + _previousTrackBankEnd = 0; + _previousTrackSlopeEnd = 0; + + _currentTrackPieceDirection = 0; + _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; + _currentTrackSelectionFlags = 0; + + window_ride_construction_update_active_elements(); + return 1; +} + +/** + * + * rct2: 0x006CB7FB + */ +int32_t ride_get_refund_price(const Ride* ride) +{ + CoordsXYE trackElement; + money32 cost = 0; + + if (!ride_try_get_origin_element(ride, &trackElement)) + { + return 0; // Ride has no track to refund + } + + // Find the start in case it is not a complete circuit + ride_get_start_of_track(&trackElement); + + uint8_t direction = trackElement.element->GetDirection(); + + // Used in the following loop to know when we have + // completed all of the elements and are back at the + // start. + TileElement* initial_map = trackElement.element; + CoordsXYE slowIt = trackElement; + bool moveSlowIt = true; + + do + { + auto trackRemoveAction = TrackRemoveAction( + trackElement.element->AsTrack()->GetTrackType(), trackElement.element->AsTrack()->GetSequenceIndex(), + { trackElement.x, trackElement.y, trackElement.element->GetBaseZ(), direction }); + trackRemoveAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + + auto res = GameActions::Query(&trackRemoveAction); + + cost += res->Cost; + + if (!track_block_get_next(&trackElement, &trackElement, nullptr, nullptr)) + { + break; + } + + moveSlowIt = !moveSlowIt; + if (moveSlowIt) + { + if (!track_block_get_next(&slowIt, &slowIt, nullptr, nullptr) || slowIt.element == trackElement.element) + { + break; + } + } + + direction = trackElement.element->GetDirection(); + + } while (trackElement.element != initial_map); + + return cost; +} + +money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value) +{ + auto rideSetSetting = RideSetSettingAction(rideId, setting, value); + auto res = GameActions::Execute(&rideSetSetting); + return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; +} + +money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags) +{ + auto rideSetSetting = RideSetSettingAction(rideId, setting, value); + rideSetSetting.SetFlags(flags); + auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&rideSetSetting) + : GameActions::QueryNested(&rideSetSetting); + return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; +} + +static int32_t loc_6CD18E( + int16_t mapX, int16_t mapY, int16_t entranceMinX, int16_t entranceMinY, int16_t entranceMaxX, int16_t entranceMaxY) +{ + int32_t direction = 0; + if (mapX == entranceMinX) + { + if (mapY > entranceMinY && mapY < entranceMaxY) + { + return direction; + } + } + direction = 1; + if (mapY == entranceMaxY) + { + if (mapX > entranceMinX && mapX < entranceMaxX) + { + return direction; + } + } + direction = 2; + if (mapX == entranceMaxX) + { + if (mapY > entranceMinY && mapY < entranceMaxY) + { + return direction; + } + } + direction = 3; + if (mapY == entranceMinY) + { + if (mapX > entranceMinX && mapX < entranceMaxX) + { + return direction; + } + } + return -1; +} + +/** + * + * rct2: 0x006CCF70 + */ +CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords) +{ + CoordsXYZD entranceExitCoords{}; + + gRideEntranceExitPlaceDirection = INVALID_DIRECTION; + auto info = get_map_coordinates_from_pos(screenCoords, EnumsToFlags(ViewportInteractionItem::Ride)); + if (info.SpriteType != ViewportInteractionItem::None) + { + if (info.Element->GetType() == TILE_ELEMENT_TYPE_TRACK) + { + if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) + { + if (TrackSequenceProperties[info.Element->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN) + { + if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) + { + gRideEntranceExitPlaceStationIndex = 0; + } + else + { + gRideEntranceExitPlaceStationIndex = info.Element->AsTrack()->GetStationIndex(); + } + } + } + } + } + + auto ride = get_ride(gRideEntranceExitPlaceRideIndex); + if (ride == nullptr) + { + entranceExitCoords.setNull(); + return entranceExitCoords; + } + + auto stationBaseZ = ride->stations[gRideEntranceExitPlaceStationIndex].GetBaseZ(); + + auto coords = screen_get_map_xy_with_z(screenCoords, stationBaseZ); + if (!coords) + { + entranceExitCoords.setNull(); + return entranceExitCoords; + } + + auto word_F4418C = coords->x; + auto word_F4418E = coords->y; + + entranceExitCoords = { coords->ToTileStart(), stationBaseZ, INVALID_DIRECTION }; + + if (ride->type == RIDE_TYPE_NULL) + { + entranceExitCoords.setNull(); + return entranceExitCoords; + } + + auto stationStart = ride->stations[gRideEntranceExitPlaceStationIndex].Start; + if (stationStart.isNull()) + { + entranceExitCoords.setNull(); + return entranceExitCoords; + } + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) + { + auto mapX = (word_F4418C & 0x1F) - 16; + auto mapY = (word_F4418E & 0x1F) - 16; + if (std::abs(mapX) < std::abs(mapY)) + { + entranceExitCoords.direction = mapY < 0 ? 3 : 1; + } + else + { + entranceExitCoords.direction = mapX < 0 ? 0 : 2; + } + + for (int32_t i = 0; i < MAX_STATIONS; i++) + { + mapX = entranceExitCoords.x + CoordsDirectionDelta[entranceExitCoords.direction].x; + mapY = entranceExitCoords.y + CoordsDirectionDelta[entranceExitCoords.direction].y; + if (map_is_location_valid({ mapX, mapY })) + { + auto tileElement = map_get_first_element_at({ mapX, mapY }); + if (tileElement == nullptr) + continue; + do + { + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (tileElement->GetBaseZ() != stationBaseZ) + continue; + if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) + continue; + if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Maze) + { + entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); + gRideEntranceExitPlaceDirection = entranceExitCoords.direction; + return entranceExitCoords; + } + if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) + continue; + + int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) + & TILE_ELEMENT_DIRECTION_MASK; + if (TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()] + [tileElement->AsTrack()->GetSequenceIndex()] + & (1 << eax)) + { + entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); + gRideEntranceExitPlaceDirection = entranceExitCoords.direction; + return entranceExitCoords; + } + } while (!(tileElement++)->IsLastForTile()); + } + entranceExitCoords.direction = (entranceExitCoords.direction + 1) & 3; + } + gRideEntranceExitPlaceDirection = INVALID_DIRECTION; + } + else + { + auto mapX = stationStart.x; + auto mapY = stationStart.y; + auto entranceMinX = mapX; + auto entranceMinY = mapY; + auto entranceMaxX = mapX; + auto entranceMaxY = mapY; + + auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); + if (tileElement == nullptr) + { + entranceExitCoords.setNull(); + return entranceExitCoords; + } + entranceExitCoords.direction = tileElement->GetDirection(); + auto stationDirection = entranceExitCoords.direction; + + while (true) + { + entranceMaxX = mapX; + entranceMaxY = mapY; + mapX -= CoordsDirectionDelta[entranceExitCoords.direction].x; + mapY -= CoordsDirectionDelta[entranceExitCoords.direction].y; + tileElement = map_get_first_element_at({ mapX, mapY }); + if (tileElement == nullptr) + break; + bool goToNextTile = false; + + do + { + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) + continue; + if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) + continue; + + if (tileElement->AsTrack()->IsStation()) + { + goToNextTile = true; + } + } while (!goToNextTile && !(tileElement++)->IsLastForTile()); + + if (!goToNextTile) + break; + } + + mapX = entranceMinX; + if (mapX > entranceMaxX) + { + entranceMinX = entranceMaxX; + entranceMaxX = mapX; + } + + mapY = entranceMinY; + if (mapY > entranceMaxY) + { + entranceMinY = entranceMaxY; + entranceMaxY = mapY; + } + + auto direction = loc_6CD18E( + entranceExitCoords.x, entranceExitCoords.y, entranceMinX - 32, entranceMinY - 32, entranceMaxX + 32, + entranceMaxY + 32); + if (direction != -1 && direction != stationDirection && direction != direction_reverse(stationDirection)) + { + entranceExitCoords.direction = direction; + gRideEntranceExitPlaceDirection = entranceExitCoords.direction; + return entranceExitCoords; + } + } + return entranceExitCoords; +} + +/** + * + * rct2: 0x006CB945 + */ +void sub_6CB945(Ride* ride) +{ + if (ride->type != RIDE_TYPE_MAZE) + { + for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) + { + if (ride->stations[stationId].Start.isNull()) + continue; + + CoordsXYZ location = ride->stations[stationId].GetStart(); + uint8_t direction = INVALID_DIRECTION; + + bool specialTrack = false; + TileElement* tileElement = nullptr; + + while (true) + { + if (direction != INVALID_DIRECTION) + { + location.x -= CoordsDirectionDelta[direction].x; + location.y -= CoordsDirectionDelta[direction].y; + } + tileElement = map_get_first_element_at(location); + if (tileElement == nullptr) + break; + + bool trackFound = false; + do + { + if (tileElement->GetBaseZ() != location.z) + continue; + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (tileElement->AsTrack()->GetRideIndex() != ride->id) + continue; + if (tileElement->AsTrack()->GetSequenceIndex() != 0) + continue; + if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + continue; + + trackFound = true; + break; + } while (!(tileElement++)->IsLastForTile()); + + if (!trackFound) + { + break; + } + + tileElement->AsTrack()->SetStationIndex(stationId); + direction = tileElement->GetDirection(); + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) + { + specialTrack = true; + break; + } + } + + if (!specialTrack) + { + continue; + } + + const rct_preview_track* trackBlock = TrackBlocks[tileElement->AsTrack()->GetTrackType()]; + while ((++trackBlock)->index != 0xFF) + { + CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; + + bool trackFound = false; + tileElement = map_get_first_element_at(blockLocation); + if (tileElement == nullptr) + break; + do + { + if (blockLocation.z != tileElement->GetBaseZ()) + continue; + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + continue; + + trackFound = true; + break; + } while (!(tileElement++)->IsLastForTile()); + + if (!trackFound) + { + break; + } + + tileElement->AsTrack()->SetStationIndex(stationId); + } + } + } + + FixedVector locations; + for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) + { + auto entrance = ride_get_entrance_location(ride, stationId); + if (!entrance.isNull()) + { + locations.push_back(entrance); + ride_clear_entrance_location(ride, stationId); + } + + auto exit = ride_get_exit_location(ride, stationId); + if (!exit.isNull()) + { + locations.push_back(exit); + ride_clear_exit_location(ride, stationId); + } + } + + auto locationListIter = locations.cbegin(); + for (const TileCoordsXYZD& locationCoords : locations) + { + auto locationList = ++locationListIter; + + bool duplicateLocation = false; + while (locationList != locations.cend()) + { + const TileCoordsXYZD& locationCoords2 = *locationList++; + if (locationCoords.x == locationCoords2.x && locationCoords.y == locationCoords2.y + && locationCoords.z == locationCoords2.z) + { + duplicateLocation = true; + break; + } + } + + if (duplicateLocation) + { + continue; + } + + CoordsXY location = locationCoords.ToCoordsXY(); + + TileElement* tileElement = map_get_first_element_at(location); + if (tileElement == nullptr) + continue; + do + { + if (tileElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) + continue; + if (tileElement->base_height != locationCoords.z) + continue; + if (tileElement->AsEntrance()->GetRideIndex() != ride->id) + continue; + if (tileElement->AsEntrance()->GetEntranceType() > ENTRANCE_TYPE_RIDE_EXIT) + continue; + + CoordsXY nextLocation = location; + nextLocation.x += CoordsDirectionDelta[tileElement->GetDirection()].x; + nextLocation.y += CoordsDirectionDelta[tileElement->GetDirection()].y; + + bool shouldRemove = true; + TileElement* trackElement = map_get_first_element_at(nextLocation); + if (trackElement == nullptr) + continue; + do + { + if (trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (trackElement->AsTrack()->GetRideIndex() != ride->id) + continue; + if (trackElement->base_height != tileElement->base_height) + continue; + + auto trackType = trackElement->AsTrack()->GetTrackType(); + uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); + + Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; + + if (!(TrackSequenceProperties[trackType][trackSequence] & (1 << direction))) + { + continue; + } + + StationIndex stationId = 0; + if (trackType != TrackElemType::Maze) + { + stationId = trackElement->AsTrack()->GetStationIndex(); + } + + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) + { + if (!ride_get_exit_location(ride, stationId).isNull()) + break; + + CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_exit_location(ride, stationId, TileCoordsXYZD{ loc }); + } + else + { + if (!ride_get_entrance_location(ride, stationId).isNull()) + break; + + CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_entrance_location(ride, stationId, TileCoordsXYZD{ loc }); + } + + tileElement->AsEntrance()->SetStationIndex(stationId); + shouldRemove = false; + } while (!(trackElement++)->IsLastForTile()); + + if (shouldRemove) + { + footpath_queue_chain_reset(); + maze_entrance_hedge_replacement({ location, tileElement }); + footpath_remove_edges_at(location, tileElement); + footpath_update_queue_chains(); + map_invalidate_tile_full(location); + tile_element_remove(tileElement); + tileElement--; + } + } while (!(tileElement++)->IsLastForTile()); + } +} + +bool ride_select_backwards_from_front() +{ + auto ride = get_ride(_currentRideIndex); + if (ride != nullptr) + { + ride_construction_invalidate_current_track(); + track_begin_end trackBeginEnd; + if (track_block_get_previous_from_zero(_currentTrackBegin, ride, _currentTrackPieceDirection, &trackBeginEnd)) + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _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; + return true; + } + } + return false; +} + +bool ride_select_forwards_from_back() +{ + auto ride = get_ride(_currentRideIndex); + if (ride != nullptr) + { + ride_construction_invalidate_current_track(); + + int32_t z = _currentTrackBegin.z; + int32_t direction = direction_reverse(_currentTrackPieceDirection); + CoordsXYE next_track; + if (track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &next_track, &z, &direction, false)) + { + _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _currentTrackBegin.x = next_track.x; + _currentTrackBegin.y = next_track.y; + _currentTrackBegin.z = z; + _currentTrackPieceDirection = next_track.element->GetDirection(); + _currentTrackPieceType = next_track.element->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + return true; + } + } + return false; +} + +/** + * + * rct2: 0x006B58EF + */ +bool ride_are_all_possible_entrances_and_exits_built(Ride* ride) +{ + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) + return true; + + for (int32_t i = 0; i < MAX_STATIONS; i++) + { + if (ride->stations[i].Start.isNull()) + { + continue; + } + if (ride_get_entrance_location(ride, i).isNull()) + { + gGameCommandErrorText = STR_ENTRANCE_NOT_YET_BUILT; + return false; + } + if (ride_get_exit_location(ride, i).isNull()) + { + gGameCommandErrorText = STR_EXIT_NOT_YET_BUILT; + return false; + } + } + return true; +} From 47287e7fb18da872e04b1f316620dc7abb48e7ed Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 26 Jul 2021 00:40:19 +0300 Subject: [PATCH 012/681] Save crash dumps into a separate directory --- src/openrct2/Context.cpp | 1 + src/openrct2/PlatformEnvironment.cpp | 1 + src/openrct2/PlatformEnvironment.h | 1 + src/openrct2/platform/Crash.cpp | 13 +++++++++---- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 6ac59f67a2..d0f739970e 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -1128,6 +1128,7 @@ namespace OpenRCT2 DIRID::SEQUENCE, DIRID::REPLAY, DIRID::LOG_DESYNCS, + DIRID::CRASH, }); } diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 59480787a7..ba48098177 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -228,6 +228,7 @@ const char * PlatformEnvironment::DirectoryNamesOpenRCT2[] = "heightmap", // HEIGHTMAP "replay", // REPLAY "desyncs", // DESYNCS + "crash", // CRASH }; const char * PlatformEnvironment::FileNames[] = diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index ad8dd64428..91f3a47779 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -49,6 +49,7 @@ namespace OpenRCT2 HEIGHTMAP, // Contains heightmap data. REPLAY, // Contains recorded replays. LOG_DESYNCS, // Contains desync reports. + CRASH, // Contains crash dumps. }; enum class PATHID diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index c3fe60b9ff..c1768fece5 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -27,10 +27,12 @@ # include "../Context.h" # include "../Game.h" # include "../OpenRCT2.h" +# include "../PlatformEnvironment.h" # include "../Version.h" # include "../config/Config.h" # include "../core/Console.hpp" # include "../core/Guard.hpp" +# include "../core/Path.hpp" # include "../core/String.hpp" # include "../interface/Screenshot.h" # include "../localisation/Language.h" @@ -54,6 +56,8 @@ const wchar_t* _wszArchitecture = WSZ(OPENRCT2_ARCHITECTURE); # define BACKTRACE_TOKEN L"742b8d9d70c52df663e4f2449f90039cf9406f89e57ecb90b0f086ba16e33d20" +using namespace OpenRCT2; + // Note: uploading gzipped crash dumps manually requires specifying // 'Content-Encoding: gzip' header in HTTP request, but we cannot do that, // so just hope the file name with '.gz' suffix is enough. @@ -319,9 +323,10 @@ static bool OnCrash( static std::wstring GetDumpDirectory() { - char userDirectory[MAX_PATH]; - platform_get_user_directory(userDirectory, nullptr, sizeof(userDirectory)); - auto result = String::ToWideChar(userDirectory); + auto env = GetContext()->GetPlatformEnvironment(); + auto crashPath = env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::CRASH); + + auto result = String::ToWideChar(crashPath.c_str()); return result; } @@ -337,7 +342,7 @@ CExceptionHandler crash_init() auto exHandler = new google_breakpad::ExceptionHandler( GetDumpDirectory(), 0, OnCrash, 0, google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpWithDataSegs, PipeName, 0); return reinterpret_cast(exHandler); -#else // USE_BREAKPAD +#else // USE_BREAKPAD return nullptr; #endif // USE_BREAKPAD } From ada94dce37d604e88da11c1e768c385fe79da14f Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 27 Jul 2021 18:03:33 +0200 Subject: [PATCH 013/681] Add #3417 to changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7e1e107bf7..1c1281b442 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. +- Improved: [#3417] Crash dumps are now placed in their own folder. 0.3.4.1 (2021-07-25) ------------------------------------------------------------------------ From b9ec5d079ebf975d39c12f12a5c19dab8d069e56 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 19:57:45 +0300 Subject: [PATCH 014/681] Add construction of TileCoordsXYZD with TileCoordsXYZ --- src/openrct2/world/Location.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 7fd725fffa..517ed6d1d3 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -615,6 +615,12 @@ struct TileCoordsXYZD : public TileCoordsXYZ { } + TileCoordsXYZD(const TileCoordsXYZ& t_, Direction d_) + : TileCoordsXYZ(t_) + , direction(d_) + { + } + TileCoordsXYZD(const TileCoordsXY& t_, int32_t z_, Direction d_) : TileCoordsXYZ(t_, z_) , direction(d_) From 0e7d05a5ad4e5e1418fe334b1a32626d12cddd18 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 20:15:10 +0300 Subject: [PATCH 015/681] Add TileCoordsXYZD serialiser traits --- src/openrct2/core/DataSerialiserTraits.h | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index f4c9266fc5..4fdcbaf464 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -867,3 +867,32 @@ template<> struct DataSerializerTraits_t stream->Write(msg, strlen(msg)); } }; + +template<> struct DataSerializerTraits_t +{ + static void encode(OpenRCT2::IStream* stream, const TileCoordsXYZD& coord) + { + stream->WriteValue(ByteSwapBE(coord.x)); + stream->WriteValue(ByteSwapBE(coord.y)); + stream->WriteValue(ByteSwapBE(coord.z)); + stream->WriteValue(ByteSwapBE(coord.direction)); + } + + static void decode(OpenRCT2::IStream* stream, TileCoordsXYZD& coord) + { + auto x = ByteSwapBE(stream->ReadValue()); + auto y = ByteSwapBE(stream->ReadValue()); + auto z = ByteSwapBE(stream->ReadValue()); + auto d = ByteSwapBE(stream->ReadValue()); + coord = TileCoordsXYZD{ x, y, z, d }; + } + + static void log(OpenRCT2::IStream* stream, const TileCoordsXYZD& coord) + { + char msg[128] = {}; + snprintf( + msg, sizeof(msg), "TileCoordsXYZD(x = %d, y = %d, z = %d, direction = %d)", coord.x, coord.y, coord.z, + coord.direction); + stream->Write(msg, strlen(msg)); + } +}; From bb6b931a7d07b1c9a284aa67ead1d01f4106f2be Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 20:28:07 +0300 Subject: [PATCH 016/681] Use TileCoordsXYZ in path finding for bigger map support --- src/openrct2/peep/GuestPathfinding.cpp | 57 +++++++++++--------------- src/openrct2/peep/Peep.h | 4 +- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 9bf83c9a7f..8a2f474810 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -700,8 +700,7 @@ static void peep_pathfind_heuristic_search( /* If this is where the search started this is a search loop and the * current search path ends here. * Return without updating the parameters (best result so far). */ - if ((_peepPathFindHistory[0].location.x == static_cast(loc.x)) - && (_peepPathFindHistory[0].location.y == static_cast(loc.y)) && (_peepPathFindHistory[0].location.z == loc.z)) + if (_peepPathFindHistory[0].location == loc) { #if defined(DEBUG_LEVEL_2) && DEBUG_LEVEL_2 if (gPathFindDebug) @@ -1076,7 +1075,7 @@ static void peep_pathfind_heuristic_search( * already been visited by the peep while heading for this goal. */ for (auto& pathfindHistory : peep->PathfindHistory) { - if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z) + if (pathfindHistory == loc) { if (pathfindHistory.direction == 0) { @@ -1103,9 +1102,7 @@ static void peep_pathfind_heuristic_search( for (int32_t junctionNum = _peepPathFindNumJunctions + 1; junctionNum <= _peepPathFindMaxJunctions; junctionNum++) { - if ((_peepPathFindHistory[junctionNum].location.x == static_cast(loc.x)) - && (_peepPathFindHistory[junctionNum].location.y == static_cast(loc.y)) - && (_peepPathFindHistory[junctionNum].location.z == loc.z)) + if (_peepPathFindHistory[junctionNum].location == loc) { pathLoop = true; break; @@ -1144,9 +1141,7 @@ static void peep_pathfind_heuristic_search( for (uint8_t junctInd = 0; junctInd < *endJunctions; junctInd++) { uint8_t histIdx = _peepPathFindMaxJunctions - junctInd; - junctionList[junctInd].x = _peepPathFindHistory[histIdx].location.x; - junctionList[junctInd].y = _peepPathFindHistory[histIdx].location.y; - junctionList[junctInd].z = _peepPathFindHistory[histIdx].location.z; + junctionList[junctInd] = _peepPathFindHistory[histIdx].location; directionList[junctInd] = _peepPathFindHistory[histIdx].direction; } } @@ -1163,9 +1158,7 @@ static void peep_pathfind_heuristic_search( /* This junction was NOT previously visited in the current * search path, so add the junction to the history. */ - _peepPathFindHistory[_peepPathFindNumJunctions].location.x = static_cast(loc.x); - _peepPathFindHistory[_peepPathFindNumJunctions].location.y = static_cast(loc.y); - _peepPathFindHistory[_peepPathFindNumJunctions].location.z = loc.z; + _peepPathFindHistory[_peepPathFindNumJunctions].location = loc; // .direction take is added below. _peepPathFindNumJunctions--; @@ -1334,7 +1327,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) permitted_edges &= 0xF; uint8_t edges = permitted_edges; - if (isThin && peep->PathfindGoal.x == goal.x && peep->PathfindGoal.y == goal.y && peep->PathfindGoal.z == goal.z) + if (isThin && peep->PathfindGoal == goal) { /* Use of peep->PathfindHistory[]: * When walking to a goal, the peep PathfindHistory stores @@ -1353,7 +1346,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) * directions it has not yet tried. */ for (auto& pathfindHistory : peep->PathfindHistory) { - if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z) + if (pathfindHistory == loc) { /* Fix broken PathfindHistory[i].direction * which have untried directions that are not @@ -1401,16 +1394,15 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) /* If this is a new goal for the peep. Store it and reset the peep's * PathfindHistory. */ - if (!direction_valid(peep->PathfindGoal.direction) || peep->PathfindGoal.x != goal.x || peep->PathfindGoal.y != goal.y - || peep->PathfindGoal.z != goal.z) + if (!direction_valid(peep->PathfindGoal.direction) || peep->PathfindGoal != goal) { - peep->PathfindGoal.x = goal.x; - peep->PathfindGoal.y = goal.y; - peep->PathfindGoal.z = goal.z; - peep->PathfindGoal.direction = 0; + peep->PathfindGoal = { goal, 0 }; // Clear pathfinding history - std::fill(std::begin(peep->PathfindHistory), std::end(peep->PathfindHistory), rct12_xyzd8{ 0xFF, 0xFF, 0xFF, 0xFF }); + TileCoordsXYZD nullPos; + nullPos.setNull(); + + std::fill(std::begin(peep->PathfindHistory), std::end(peep->PathfindHistory), nullPos); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (_pathFindDebug) { @@ -1466,14 +1458,17 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) _peepPathFindNumJunctions = _peepPathFindMaxJunctions; // Initialise _peepPathFindHistory. - std::memset(static_cast(_peepPathFindHistory), 0xFF, sizeof(_peepPathFindHistory)); + + for (auto& entry : _peepPathFindHistory) + { + entry.location.setNull(); + entry.direction = INVALID_DIRECTION; + } /* The pathfinding will only use elements * 1.._peepPathFindMaxJunctions, so the starting point * is placed in element 0 */ - _peepPathFindHistory[0].location.x = static_cast(loc.x); - _peepPathFindHistory[0].location.y = static_cast(loc.y); - _peepPathFindHistory[0].location.z = loc.z; + _peepPathFindHistory[0].location = loc; _peepPathFindHistory[0].direction = 0xF; uint16_t score = 0xFFFF; @@ -1586,8 +1581,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) { for (int32_t i = 0; i < 4; ++i) { - if (peep->PathfindHistory[i].x == loc.x && peep->PathfindHistory[i].y == loc.y - && peep->PathfindHistory[i].z == loc.z) + if (peep->PathfindHistory[i] == loc) { /* Peep remembers this junction, so remove the * chosen_edge from those left to try. */ @@ -1611,10 +1605,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) * and remember this junction. */ int32_t i = peep->PathfindGoal.direction++; peep->PathfindGoal.direction &= 3; - peep->PathfindHistory[i].x = static_cast(loc.x); - peep->PathfindHistory[i].y = static_cast(loc.y); - peep->PathfindHistory[i].z = loc.z; - peep->PathfindHistory[i].direction = permitted_edges; + peep->PathfindHistory[i] = { loc, permitted_edges }; /* Remove the chosen_edge from those left to try. */ peep->PathfindHistory[i].direction &= ~(1 << chosen_edge); /* Also remove the edge through which the peep @@ -2312,9 +2303,7 @@ void Peep::ResetPathfindGoal() } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 - PathfindGoal.x = 0xFF; - PathfindGoal.y = 0xFF; - PathfindGoal.z = 0xFF; + PathfindGoal.setNull(); PathfindGoal.direction = INVALID_DIRECTION; } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index a43542e449..7b0d176ebe 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -612,8 +612,8 @@ struct Peep : SpriteBase ride_id_t InteractionRideIndex; uint32_t Id; uint8_t PathCheckOptimisation; // see peep.checkForPath - rct12_xyzd8 PathfindGoal; - std::array PathfindHistory; + TileCoordsXYZD PathfindGoal; + std::array PathfindHistory; uint8_t WalkingFrameNum; uint32_t PeepFlags; From ac080494721576bce440ef96810f459281080625 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 20:40:19 +0300 Subject: [PATCH 017/681] Adapt SV6 import and export for peep path-finding data --- src/openrct2/rct2/S6Exporter.cpp | 21 +++++++++++++++++++-- src/openrct2/rct2/S6Importer.cpp | 26 ++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 9388d6e41b..984a8d8bd6 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1343,10 +1343,27 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src) dst->id = src->Id; dst->path_check_optimisation = src->PathCheckOptimisation; dst->peep_flags = src->PeepFlags; - dst->pathfind_goal = src->PathfindGoal; + if (src->PathfindGoal.isNull()) + { + dst->pathfind_goal = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION }; + } + else + { + dst->pathfind_goal = { static_cast(src->PathfindGoal.x), static_cast(src->PathfindGoal.y), + static_cast(src->PathfindGoal.z), src->PathfindGoal.direction }; + } for (size_t i = 0; i < std::size(src->PathfindHistory); i++) { - dst->pathfind_history[i] = src->PathfindHistory[i]; + if (src->PathfindHistory[i].isNull()) + { + dst->pathfind_history[i] = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION }; + } + else + { + dst->pathfind_history[i] = { static_cast(src->PathfindHistory[i].x), + static_cast(src->PathfindHistory[i].y), + static_cast(src->PathfindHistory[i].z), src->PathfindHistory[i].direction }; + } } dst->no_action_frame_num = src->WalkingFrameNum; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index f4763855b4..ee7525c4a5 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1365,6 +1365,10 @@ public: void ImportEntityPeep(Peep* dst, const RCT2SpritePeep* src) { + const auto isNullLocation = [](const rct12_xyzd8& pos) { + return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == INVALID_DIRECTION; + }; + ImportEntityCommonProperties(static_cast(dst), src); if (is_user_string_id(src->name_string_idx)) { @@ -1401,10 +1405,28 @@ public: dst->Id = src->id; dst->PathCheckOptimisation = src->path_check_optimisation; dst->PeepFlags = src->peep_flags; - dst->PathfindGoal = src->pathfind_goal; + if (isNullLocation(src->pathfind_goal)) + { + dst->PathfindGoal.setNull(); + dst->PathfindGoal.direction = INVALID_DIRECTION; + } + else + { + dst->PathfindGoal = { src->pathfind_goal.x, src->pathfind_goal.y, src->pathfind_goal.z, + src->pathfind_goal.direction }; + } for (size_t i = 0; i < std::size(src->pathfind_history); i++) { - dst->PathfindHistory[i] = src->pathfind_history[i]; + if (isNullLocation(src->pathfind_history[i])) + { + dst->PathfindHistory[i].setNull(); + dst->PathfindHistory[i].direction = INVALID_DIRECTION; + } + else + { + dst->PathfindHistory[i] = { src->pathfind_history[i].x, src->pathfind_history[i].y, src->pathfind_history[i].z, + src->pathfind_history[i].direction }; + } } dst->WalkingFrameNum = src->no_action_frame_num; } From d76611e0f2af8e57bb769e3267a4622cb40a560c Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 27 Jul 2021 18:58:09 +0100 Subject: [PATCH 018/681] Actually allocate a banner when using GetOrCreateBanner When importing a file this function is used to create a banner at a certain index. Previously this was not assigning the id to the banner id. Luckily as banner id is a new field this did not cause any issues except in the nsf which does use the banner id more extensively --- src/openrct2/world/Banner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 28a6bac8b4..049540f4f0 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -406,7 +406,10 @@ Banner* GetOrCreateBanner(BannerIndex id) { _banners.resize(id + 1); } - return &_banners[id]; + // Create the banner + auto& banner = _banners[id]; + banner.id = id; + return &banner; } return nullptr; } From 163fe3756d73083aa8efd6abbd249dd349a1d5fa Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 21:10:06 +0300 Subject: [PATCH 019/681] Fix GameStateSnapshots buffer overrun --- src/openrct2/GameStateSnapshots.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 8ba15a0de6..3a95370b77 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -253,10 +253,16 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, InteractionRideIndex); COMPARE_FIELD(Peep, Id); COMPARE_FIELD(Peep, PathCheckOptimisation); - COMPARE_FIELD(Peep, PathfindGoal); + COMPARE_FIELD(Peep, PathfindGoal.x); + COMPARE_FIELD(Peep, PathfindGoal.y); + COMPARE_FIELD(Peep, PathfindGoal.z); + COMPARE_FIELD(Peep, PathfindGoal.direction); for (int i = 0; i < 4; i++) { - COMPARE_FIELD(Peep, PathfindHistory[i]); + COMPARE_FIELD(Peep, PathfindHistory[i].x); + COMPARE_FIELD(Peep, PathfindHistory[i].y); + COMPARE_FIELD(Peep, PathfindHistory[i].z); + COMPARE_FIELD(Peep, PathfindHistory[i].direction); } COMPARE_FIELD(Peep, WalkingFrameNum); } From b7b3418b75f28466328fe8de32e1e6816fd3c740 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 21:34:53 +0300 Subject: [PATCH 020/681] Fix setNull on inherited classes leaving uninitialized variables --- src/openrct2/world/Location.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 517ed6d1d3..19e5ff9952 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -268,6 +268,12 @@ struct CoordsXYZ : public CoordsXY { return ToTileStart() + CoordsXYZ{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0 }; } + + void setNull() + { + CoordsXY::setNull(); + z = 0; + } }; struct CoordsXYRangedZ : public CoordsXY @@ -459,6 +465,12 @@ struct TileCoordsXYZ : public TileCoordsXY } return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP }; } + + void setNull() + { + TileCoordsXY::setNull(); + z = 0; + } }; /** @@ -655,6 +667,12 @@ struct TileCoordsXYZD : public TileCoordsXYZ } return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction }; } + + void setNull() + { + TileCoordsXYZ::setNull(); + direction = INVALID_DIRECTION; + } }; /** From e596a379c061f08c582610b2f83a11f3fd0dd514 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 27 Jul 2021 22:38:48 +0300 Subject: [PATCH 021/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c49933f6d..bac5da4cf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.43") +set(REPLAYS_VERSION "0.0.44") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "269E4FC432A73AE9A5D601EC2A1C882F3D9BDF3C") +set(REPLAYS_SHA1 "586F3930DE8D2C3880AAFD30ABC4D81ABC0B64A4") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 999ffe9873..369b497d2e 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.43/replays.zip - 269E4FC432A73AE9A5D601EC2A1C882F3D9BDF3C + https://github.com/OpenRCT2/replays/releases/download/v0.0.44/replays.zip + 586F3930DE8D2C3880AAFD30ABC4D81ABC0B64A4 From 0b6e80c7d45041c9111f6baef553119e74808a67 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 27 Jul 2021 23:50:16 +0200 Subject: [PATCH 022/681] Add error message body to failed Place Park Entrance action --- src/openrct2/actions/PlaceParkEntranceAction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 248353afee..288d921007 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -59,7 +59,8 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Query() const if (!CheckMapCapacity(3)) { - return std::make_unique(GameActions::Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return std::make_unique( + GameActions::Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_ERR_LANDSCAPE_DATA_AREA_FULL); } if (gParkEntrances.size() >= MAX_PARK_ENTRANCES) From 6bbc2fb4fea8d99f06fd3751ad2ec7fba78d6677 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Wed, 28 Jul 2021 04:07:35 +0000 Subject: [PATCH 023/681] Merge Localisation/master into OpenRCT2/develop --- data/language/fi-FI.txt | 14 ++++++++++++++ data/language/ko-KR.txt | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index fb3ca39e84..3f077759f1 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -3689,6 +3689,20 @@ STR_6436 :Näkymättömyys päälle/pois STR_6437 :Näkymätön STR_6438 :N STR_6439 :Ruututyökalu: Näkymättömyys päälle/pois +STR_6440 :Läpinäkyvä vesi +STR_6441 :Ainakin yhden polunpinnan tulee olla valittu. +STR_6442 :Ainakin yhden jonotusaluepinnan tulee olla valittu. +STR_6443 :Ainakin yhden polunkaiteen tulee olla valittu. +STR_6444 :Polun pinnat +STR_6445 :Polun kaiteet +STR_6446 :{WINDOW_COLOUR_2}Pinnan nimi: {BLACK}{STRINGID} +STR_6447 :{WINDOW_COLOUR_2}Kaiteen nimi: {BLACK}{STRINGID} +STR_6448 :Esineen muotoa ei tueta +STR_6449 :{WINDOW_COLOUR_2}Raidat: +STR_6450 :{BLACK}”{STRING}” +STR_6451 :{BLACK}”{STRING}” - {STRING} +STR_6452 :{WINDOW_COLOUR_2}Myy: {BLACK}{STRING} +STR_6453 :Kopioi versiotiedot ############# # Scenarios # diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 32dd21608e..b4c2b7b49a 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -2408,7 +2408,7 @@ STR_3308 :{WINDOW_COLOUR_2}흥미도: STR_3309 :{WINDOW_COLOUR_2}{COMMA16} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} -STR_3312 :{WINDOW_COLOUR_2}파괴할 수 없는 놀이기구/시설: +STR_3312 :{WINDOW_COLOUR_2}수정·파괴할 수 없는 놀이기구/시설: STR_3313 :시나리오 이름 STR_3314 :시나리오 이름을 입력하세요: STR_3315 :공원/시나리오 상세 설명 From ab186128825a2ca0ffad22a1f7c7a2a922d3b96c Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 28 Jul 2021 10:26:35 +0200 Subject: [PATCH 024/681] Remove Music Acknowledgements window (#15116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was of limited use to us anyway since we didn’t license the music ourselves, but now the actual track names and composers are shown in the Object Selection, the window lost its last bit of usefulness. --- OpenRCT2.xcodeproj/project.pbxproj | 4 - data/language/en-GB.txt | 45 ------ src/openrct2-ui/WindowManager.cpp | 2 - src/openrct2-ui/libopenrct2ui.vcxproj | 1 - src/openrct2-ui/windows/About.cpp | 9 +- src/openrct2-ui/windows/MusicCredits.cpp | 186 ----------------------- src/openrct2-ui/windows/Window.h | 1 - src/openrct2/interface/Window.h | 4 +- src/openrct2/localisation/StringIds.h | 46 ------ 9 files changed, 3 insertions(+), 295 deletions(-) delete mode 100644 src/openrct2-ui/windows/MusicCredits.cpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 1e0229fd2d..b6527ce470 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -431,7 +431,6 @@ C666EE701F37ACB10061AA04 /* LandRights.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5A1F37ACB10061AA04 /* LandRights.cpp */; }; C666EE711F37ACB10061AA04 /* MapGen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5B1F37ACB10061AA04 /* MapGen.cpp */; }; C666EE721F37ACB10061AA04 /* Multiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */; }; - C666EE731F37ACB10061AA04 /* MusicCredits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5D1F37ACB10061AA04 /* MusicCredits.cpp */; }; C666EE741F37ACB10061AA04 /* News.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5E1F37ACB10061AA04 /* News.cpp */; }; C666EE751F37ACB10061AA04 /* NewsOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5F1F37ACB10061AA04 /* NewsOptions.cpp */; }; C666EE761F37ACB10061AA04 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE601F37ACB10061AA04 /* Options.cpp */; }; @@ -1552,7 +1551,6 @@ C666EE5A1F37ACB10061AA04 /* LandRights.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandRights.cpp; sourceTree = ""; }; C666EE5B1F37ACB10061AA04 /* MapGen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapGen.cpp; sourceTree = ""; }; C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Multiplayer.cpp; sourceTree = ""; }; - C666EE5D1F37ACB10061AA04 /* MusicCredits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicCredits.cpp; sourceTree = ""; }; C666EE5E1F37ACB10061AA04 /* News.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = News.cpp; sourceTree = ""; }; C666EE5F1F37ACB10061AA04 /* NewsOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewsOptions.cpp; sourceTree = ""; }; C666EE601F37ACB10061AA04 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = ""; }; @@ -3271,7 +3269,6 @@ C6D2BEE41F9BAACD008B557C /* MapTooltip.cpp */, C6D2BEE51F9BAACD008B557C /* MazeConstruction.cpp */, C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */, - C666EE5D1F37ACB10061AA04 /* MusicCredits.cpp */, C6D2BEE91F9BB83B008B557C /* NetworkStatus.cpp */, C654DF231F69C0430040F43D /* NewCampaign.cpp */, C685E5141F8907840090598F /* NewRide.cpp */, @@ -3848,7 +3845,6 @@ 4CB991CD25CEE54500C692B4 /* ShortcutInput.cpp in Sources */, C68878C820289B710084B384 /* SwapFramebuffer.cpp in Sources */, C67CCD661FBBCFDB004FAE4C /* EditorBottomToolbar.cpp in Sources */, - C666EE731F37ACB10061AA04 /* MusicCredits.cpp in Sources */, C654DF351F69C0430040F43D /* Park.cpp in Sources */, 4C8BB68525533DB9005C8830 /* ZoomLevel.cpp in Sources */, C654DF3A1F69C0430040F43D /* TitleEditor.cpp in Sources */, diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 3813f7521e..7997547cdc 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -2055,51 +2055,6 @@ STR_2854 :{RED}Guests can’t get to the entrance of {STRINGID}!{NEWLINE}Cons STR_2855 :{RED}{STRINGID} has no path leading from its exit!{NEWLINE}Construct a path from the ride exit STR_2858 :Can’t start marketing campaign… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :Music acknowledgements… -STR_2863 :Music acknowledgements -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Franz von Suppé) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Main colour scheme STR_2972 :Alternative colour scheme 1 STR_2973 :Alternative colour scheme 2 diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 7e483bb5e7..850a2122ef 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -79,8 +79,6 @@ public: return window_mapgen_open(); case WC_MULTIPLAYER: return window_multiplayer_open(); - case WC_MUSIC_CREDITS: - return window_music_credits_open(); case WC_CONSTRUCT_RIDE: return window_new_ride_open(); case WC_PARK_INFORMATION: diff --git a/src/openrct2-ui/libopenrct2ui.vcxproj b/src/openrct2-ui/libopenrct2ui.vcxproj index ed4b381cce..99e49440b7 100644 --- a/src/openrct2-ui/libopenrct2ui.vcxproj +++ b/src/openrct2-ui/libopenrct2ui.vcxproj @@ -147,7 +147,6 @@ - diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index f7f776689b..b164360a30 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -51,9 +51,6 @@ enum WINDOW_ABOUT_WIDGET_IDX { WIDX_JOIN_DISCORD, WIDX_CONTRIBUTORS, WIDX_COPYRIGHT, - - // About RCT2 - WIDX_MUSIC_CREDITS = WIDX_PAGE_START, }; #define WIDGETS_MAIN \ @@ -78,7 +75,6 @@ static rct_widget window_about_openrct2_widgets[] = { static rct_widget window_about_rct2_widgets[] = { WIDGETS_MAIN, - MakeWidget({100, WH - TABHEIGHT}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MUSIC_ACKNOWLEDGEMENTS_ELLIPSIS), // music credits button { WIDGETS_END }, }; @@ -92,7 +88,7 @@ static rct_widget *window_about_page_widgets[] = { static uint64_t window_about_page_enabled_widgets[] = { DEFAULT_ENABLED_WIDGETS | (1ULL << WIDX_COPY_BUILD_INFO) | (1ULL << WIDX_CHANGELOG) | (1ULL << WIDX_JOIN_DISCORD), - DEFAULT_ENABLED_WIDGETS | (1ULL << WIDX_MUSIC_CREDITS), + DEFAULT_ENABLED_WIDGETS, }; static void window_about_openrct2_mouseup(rct_window *w, rct_widgetindex widgetIndex); @@ -253,9 +249,6 @@ static void window_about_rct2_mouseup(rct_window* w, rct_widgetindex widgetIndex case WIDX_TAB_ABOUT_RCT2: window_about_set_page(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2); break; - case WIDX_MUSIC_CREDITS: - context_open_window(WC_MUSIC_CREDITS); - break; } } diff --git a/src/openrct2-ui/windows/MusicCredits.cpp b/src/openrct2-ui/windows/MusicCredits.cpp deleted file mode 100644 index 6dfe501b5b..0000000000 --- a/src/openrct2-ui/windows/MusicCredits.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2020 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 -#include -#include -#include -#include -#include - -static constexpr const rct_string_id WINDOW_TITLE = STR_MUSIC_ACKNOWLEDGEMENTS; -static constexpr const int32_t WH = 314; -static constexpr const int32_t WW = 510; - -// clang-format off -enum WINDOW_MUSIC_CREDITS_WIDGET_IDX { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE -}; - -static rct_widget window_music_credits_widgets[] = { - WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget({4, 18}, {502, 292}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_VERTICAL), // scroll - { WIDGETS_END }, -}; - -static constexpr const rct_string_id music_credits[] = { - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MARCH_CHILDREN_OF_THE_REGIMENT, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_HEYKENS_SERENADE, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_IN_CONTINENTAL_MOOD, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WEDDING_JOURNEY, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TALES_FROM_THE_VIENNA_WOODS, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SLAVONIC_DANCE, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DAS_ALPENHORN, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_THE_BLOND_SAILOR, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_OVERTURE_POET_AND_PEASANT, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WALTZ_MEDLEY, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BELLA_BELLA_BIMBA, -}; - -static constexpr const rct_string_id music_credits_rct2[] = { - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_RCT2_TITLE_MUSIC, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DODGEMS_BEAT, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MIS_SUMMERS_HEAT, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_PHARAOS_TOMB, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_CAESARS_MARCH, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DRIFTING_TO_HEAVEN, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_INVADERS, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_ETERNAL_TOYBOX, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_JUNGLE_JUICE, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_NINJAS_NOODLES, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_VOYAGE_TO_ANDROMEDA, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BRIMBLES_BEAT, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_ATLANTIS, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WILD_WEST_KID, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_VAMPIRES_LAIR, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BLOCKUBSTER, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_AIRTIME_ROCK, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SEARCHLIGHT_RAG, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_FLIGHT_OF_FANTASY, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BIG_ROCK, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_HYPOTHERMIA, - STR_MUSIC_ACKNOWLEDGEMENTS_SAMPLES_COURTESY, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_LAST_SLEIGH_RIDE, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_PIPES_OF_GLENCAIRN, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TRAFFIC_JAM, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TOCCATA, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SPACE_ROCK, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MANIC_MECHANIC, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TECHNO_TORTURE, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SWEET_DREAMS, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR, -}; - -static void window_music_credits_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_music_credits_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_music_credits_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); - -static rct_window_event_list window_music_credits_events([](auto& events) -{ - events.mouse_up = &window_music_credits_mouseup; - events.get_scroll_size = &window_music_credits_scrollgetsize; - events.paint = &window_music_credits_paint; - events.scroll_paint = &window_music_credits_scrollpaint; -}); -// clang-format on - -/** - * - * rct2: 0x0066D55B - */ -rct_window* window_music_credits_open() -{ - rct_window* window; - - // Check if window is already open - window = window_bring_to_front_by_class(WC_MUSIC_CREDITS); - if (window != nullptr) - return window; - - window = WindowCreateCentred(510, 314, &window_music_credits_events, WC_MUSIC_CREDITS, 0); - - window->widgets = window_music_credits_widgets; - window->enabled_widgets = 1ULL << WIDX_CLOSE; - - WindowInitScrollWidgets(window); - window->colours[0] = COLOUR_LIGHT_BLUE; - window->colours[1] = COLOUR_LIGHT_BLUE; - window->colours[2] = COLOUR_LIGHT_BLUE; - - return window; -} - -/** - * - * rct2: 0x0066DB2C - */ -static void window_music_credits_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - } -} - -/** - * - * rct2: 0x0066DB37 - */ -static void window_music_credits_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) -{ - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); - *height = static_cast(std::size(music_credits) + std::size(music_credits_rct2)) * lineHeight + 12; -} - -/** - * - * rct2: 0x0066D7B9 - */ -static void window_music_credits_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); -} - -/** - * - * rct2: 0x0066D7BF - */ -static void window_music_credits_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) -{ - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); - - auto screenCoords = ScreenCoordsXY{ 245, 2 }; - - for (size_t i = 0; i < std::size(music_credits); i++) - { - DrawTextBasic(dpi, screenCoords, music_credits[i], nullptr, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - } - - // Add 4 more space before "Original recordings ...". - screenCoords.y += 4; - DrawTextBasic(dpi, screenCoords, STR_MUSIC_ACKNOWLEDGEMENTS_ORIGINAL_RECORDINGS, nullptr, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - - // Draw the separator - screenCoords.y += 5; - gfx_fill_rect_inset(dpi, { 4, screenCoords.y, 484, screenCoords.y + 1 }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET); - screenCoords.y += lineHeight + 1; - - for (size_t i = 0; i < std::size(music_credits_rct2); i++) - { - DrawTextBasic(dpi, screenCoords, music_credits_rct2[i], nullptr, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - } -} diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 7d6d074207..3e2f6dfca3 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -54,7 +54,6 @@ rct_window* window_land_rights_open(); rct_window* window_main_open(); rct_window* window_mapgen_open(); rct_window* window_multiplayer_open(); -rct_window* window_music_credits_open(); rct_window* window_news_open(); rct_window* window_news_options_open(); rct_window* window_options_open(); diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index bbfb9bac2e..bbb9727606 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -418,8 +418,8 @@ enum WC_TOOLTIP = 5, WC_DROPDOWN = 6, WC_ABOUT = 8, - WC_PUBLISHER_CREDITS = 9, - WC_MUSIC_CREDITS = 10, + // WC_PUBLISHER_CREDITS = 9, + // WC_MUSIC_CREDITS = 10, WC_ERROR = 11, WC_RIDE = 12, WC_RIDE_CONSTRUCTION = 13, diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index c3a474e0da..0671d62036 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -2171,52 +2171,6 @@ enum STR_CANT_START_MARKETING_CAMPAIGN = 2858, // STR_2859 :Another instance of OpenRCT2 is already running STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC = 2861, - STR_MUSIC_ACKNOWLEDGEMENTS_ELLIPSIS = 2862, - STR_MUSIC_ACKNOWLEDGEMENTS = 2863, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MARCH_CHILDREN_OF_THE_REGIMENT = 2864, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_HEYKENS_SERENADE = 2865, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_IN_CONTINENTAL_MOOD = 2866, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WEDDING_JOURNEY = 2867, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TALES_FROM_THE_VIENNA_WOODS = 2868, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SLAVONIC_DANCE = 2869, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DAS_ALPENHORN = 2870, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_THE_BLOND_SAILOR = 2871, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_OVERTURE_POET_AND_PEASANT = 2872, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WALTZ_MEDLEY = 2873, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BELLA_BELLA_BIMBA = 2874, - STR_MUSIC_ACKNOWLEDGEMENTS_ORIGINAL_RECORDINGS = 2875, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_RCT2_TITLE_MUSIC = 2876, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DODGEMS_BEAT = 2877, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MIS_SUMMERS_HEAT = 2878, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_PHARAOS_TOMB = 2879, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_CAESARS_MARCH = 2880, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_DRIFTING_TO_HEAVEN = 2881, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_INVADERS = 2882, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_ETERNAL_TOYBOX = 2883, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_JUNGLE_JUICE = 2884, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_NINJAS_NOODLES = 2885, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_VOYAGE_TO_ANDROMEDA = 2886, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BRIMBLES_BEAT = 2887, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_ATLANTIS = 2888, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WILD_WEST_KID = 2889, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_VAMPIRES_LAIR = 2890, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BLOCKUBSTER = 2891, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_AIRTIME_ROCK = 2892, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SEARCHLIGHT_RAG = 2893, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_FLIGHT_OF_FANTASY = 2894, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_BIG_ROCK = 2895, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_HYPOTHERMIA = 2896, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_LAST_SLEIGH_RIDE = 2897, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_PIPES_OF_GLENCAIRN = 2898, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TRAFFIC_JAM = 2899, - - STR_MUSIC_ACKNOWLEDGEMENTS_SAMPLES_COURTESY = 2901, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TOCCATA = 2902, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SPACE_ROCK = 2903, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_MANIC_MECHANIC = 2904, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_TECHNO_TORTURE = 2905, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_SWEET_DREAMS = 2906, - STR_MUSIC_ACKNOWLEDGEMENTS_TRACK_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR = 2907, STR_MAIN_COLOUR_SCHEME = 2971, STR_ALTERNATIVE_COLOUR_SCHEME_1 = 2972, From bb682ca09d37d95d7025ec976c7c72a4180a5502 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 27 Jul 2021 16:33:03 +0200 Subject: [PATCH 025/681] Hide brown base on flat rides if "no platform" station style is selected --- src/openrct2/object/StationObject.cpp | 1 + src/openrct2/object/StationObject.h | 1 + src/openrct2/ride/TrackPaint.cpp | 10 +++++++++- src/openrct2/ride/TrackPaint.h | 3 ++- src/openrct2/ride/gentle/Circus.cpp | 8 ++++++-- src/openrct2/ride/gentle/CrookedHouse.cpp | 8 ++++++-- src/openrct2/ride/gentle/FerrisWheel.cpp | 8 ++++++-- src/openrct2/ride/gentle/HauntedHouse.cpp | 8 ++++++-- src/openrct2/ride/gentle/MerryGoRound.cpp | 8 ++++++-- src/openrct2/ride/gentle/SpaceRings.cpp | 3 ++- src/openrct2/ride/thrill/3dCinema.cpp | 8 ++++++-- src/openrct2/ride/thrill/Enterprise.cpp | 3 ++- src/openrct2/ride/thrill/MotionSimulator.cpp | 7 ++++++- src/openrct2/ride/thrill/TopSpin.cpp | 8 ++++++-- src/openrct2/ride/thrill/Twist.cpp | 3 ++- 15 files changed, 67 insertions(+), 20 deletions(-) diff --git a/src/openrct2/object/StationObject.cpp b/src/openrct2/object/StationObject.cpp index 38a7a55969..4b88153142 100644 --- a/src/openrct2/object/StationObject.cpp +++ b/src/openrct2/object/StationObject.cpp @@ -94,6 +94,7 @@ void StationObject::ReadJson(IReadObjectContext* context, json_t& root) { "hasPrimaryColour", STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR }, { "hasSecondaryColour", STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR }, { "isTransparent", STATION_OBJECT_FLAGS::IS_TRANSPARENT }, + { "noPlatforms", STATION_OBJECT_FLAGS::NO_PLATFORMS }, }); } diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index 0912661414..8f45a92405 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -16,6 +16,7 @@ namespace STATION_OBJECT_FLAGS const uint32_t HAS_PRIMARY_COLOUR = 1 << 0; const uint32_t HAS_SECONDARY_COLOUR = 1 << 1; const uint32_t IS_TRANSPARENT = 1 << 2; + const uint32_t NO_PLATFORMS = 1 << 3; } // namespace STATION_OBJECT_FLAGS class StationObject final : public Object diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 0fa437a2ba..ea7245cf5f 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -204,6 +204,10 @@ enum bool track_paint_util_has_fence( enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation) { + const auto* stationObject = ride_get_station_object(ride); + if (stationObject != nullptr && stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return false; + TileCoordsXY offset; switch (edge) { @@ -231,8 +235,12 @@ bool track_paint_util_has_fence( } void track_paint_util_paint_floor( - paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4]) + paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4], + const StationObject* stationStyle) { + if (stationStyle != nullptr && stationStyle->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + uint32_t imageId; if (edges & EDGE_SW && edges & EDGE_SE) diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 07cac144dd..4866947198 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -280,7 +280,8 @@ extern const size_t mini_golf_peep_animation_lengths[]; bool track_paint_util_has_fence( enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation); void track_paint_util_paint_floor( - paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4]); + paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4], + const StationObject* stationStyle); void track_paint_util_paint_fences( paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index ecdf7b25c4..4d174b03a5 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -62,9 +62,13 @@ static void paint_circus( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 162d6d3ca2..b21b8b6579 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -72,9 +72,13 @@ static void paint_crooked_house( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index da58c30b44..4ed9d0e38c 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -151,12 +151,16 @@ static void paint_ferris_wheel( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); uint32_t imageId; uint8_t rotation = session->CurrentRotation; uint32_t colourFlags = session->TrackColours[SCHEME_MISC]; - auto ride = get_ride(rideIndex); if (ride != nullptr) { if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, rotation)) diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 33ffc26c6c..5caeffb7f2 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -104,9 +104,13 @@ static void paint_haunted_house( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 90778ee6d2..1ce354af1b 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -113,9 +113,13 @@ static void paint_merry_go_round( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 2a27d69183..46a04546df 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -102,7 +102,8 @@ static void paint_space_rings( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + StationObject* stationObject = ride_get_station_object(ride); + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); switch (trackSequence) { diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index bd85544280..7378e59d23 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -62,9 +62,13 @@ static void paint_3d_cinema( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 68b6d7a5fe..2020ef0424 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -92,7 +92,8 @@ static void paint_enterprise( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); + StationObject* stationObject = ride_get_station_object(ride); + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); track_paint_util_paint_fences( session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope, diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index ac687f3e22..942ed2720d 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -140,9 +140,14 @@ static void paint_motionsimulator( int32_t edges = edges_2x2[trackSequence]; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 3487207786..0a9cd224ee 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -257,9 +257,13 @@ static void paint_top_spin( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork); - auto ride = get_ride(rideIndex); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); + if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 1c0d26192c..ef05e114e2 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -94,7 +94,8 @@ static void paint_twist( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork); + StationObject* stationObject = ride_get_station_object(ride); + track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject); switch (trackSequence) { From 5486dd3fa4c1e58ebf0b4abef0895c1f93b433d3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 27 Jul 2021 16:45:06 +0200 Subject: [PATCH 026/681] =?UTF-8?q?Hide=20wooden=20platforms=20when=20the?= =?UTF-8?q?=20=E2=80=9Cno=20platforms=E2=80=9D=20station=20style=20is=20se?= =?UTF-8?q?lected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openrct2/ride/TrackPaint.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index ea7245cf5f..ca8cdcd4cf 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -339,6 +339,9 @@ static void track_paint_util_draw_station_impl( auto stationObj = ride_get_station_object(ride); const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight(); + if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + bool hasFence; uint32_t imageId; From 6f9468a31601515271c5c152f4413cc82cd8b95c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 27 Jul 2021 17:01:22 +0200 Subject: [PATCH 027/681] Implement invisible platforms on some tracked rides --- src/openrct2/ride/TrackPaint.cpp | 11 ++++++++- src/openrct2/ride/TrackPaint.h | 2 +- .../coaster/AirPoweredVerticalCoaster.cpp | 2 +- .../ride/coaster/BolligerMabillardTrack.cpp | 2 +- src/openrct2/ride/coaster/HybridCoaster.cpp | 2 +- .../ride/coaster/ReverseFreefallCoaster.cpp | 2 +- src/openrct2/ride/transport/Monorail.cpp | 24 ++++++++++++------- src/openrct2/ride/water/RiverRapids.cpp | 2 +- src/openrct2/ride/water/SplashBoats.cpp | 2 +- 9 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index ca8cdcd4cf..f662d129fa 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -550,6 +550,9 @@ void track_paint_util_draw_station_inverted( auto stationObj = ride_get_station_object(ride); const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight(); + if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + bool hasFence; uint32_t imageId; @@ -849,11 +852,14 @@ bool track_paint_util_draw_station_covers_2( return true; } -void track_paint_util_draw_station_platform( +void track_paint_util_draw_narrow_station_platform( paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement) { CoordsXY position = session->MapPosition; auto stationObj = ride_get_station_object(ride); + if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + if (direction & 1) { bool hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation); @@ -898,6 +904,9 @@ void track_paint_util_draw_pier( paint_session* session, Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, int32_t height, const TileElement* tileElement, uint8_t rotation) { + if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) + return; + bool hasFence; uint32_t imageId; diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 4866947198..1cd6608667 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -290,7 +290,7 @@ bool track_paint_util_draw_station_covers( bool track_paint_util_draw_station_covers_2( paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height, uint8_t stationVariant); -void track_paint_util_draw_station_platform( +void track_paint_util_draw_narrow_station_platform( paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement); void track_paint_util_draw_station( paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement); diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 920876083d..4826338faa 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -220,7 +220,7 @@ static void air_powered_vertical_rc_track_station( auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 5, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp index 55bdd29ef7..fae8f5ce31 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp @@ -98,7 +98,7 @@ void bolliger_mabillard_track_station( auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 9, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 9, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 5b332640ff..92021bbd9a 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -85,7 +85,7 @@ namespace HybridRC auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 10, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index fb860fb3c0..c374e6770f 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -254,7 +254,7 @@ static void paint_reverse_freefall_rc_station( auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 5, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index eccd89fa0f..956c423ad7 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -9,6 +9,7 @@ #include "../../common.h" #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Map.h" @@ -458,16 +459,23 @@ static void paint_monorail_station( const TileElement* tileElement) { uint32_t imageId; + const StationObject* stationObject = nullptr; + const auto* ride = get_ride(rideIndex); + if (ride != nullptr) + stationObject = ride_get_station_object(ride); - if (direction == 0 || direction == 2) + if (stationObject == nullptr || !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); - } - else if (direction == 1 || direction == 3) - { - imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + if (direction == 0 || direction == 2) + { + imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; + PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); + } + else if (direction == 1 || direction == 3) + { + imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; + PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + } } imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index b2b215d6f3..d3f58ab408 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -325,7 +325,7 @@ static void paint_river_rapids_station( paint_river_rapids_track_flat(session, rideIndex, trackSequence, direction, height, tileElement); auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 12, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, tileElement); paint_util_set_general_support_height(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 8d693895d4..9589d5dab9 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -811,7 +811,7 @@ static void paint_splash_boats_station( auto ride = get_ride(rideIndex); if (ride != nullptr) - track_paint_util_draw_station_platform(session, ride, direction, height, 7, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); From 87007ba2a3c310963f3935eb0527888ce00f0464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 28 Jul 2021 19:21:59 +0300 Subject: [PATCH 028/681] Change track paint signature to pass ride instead of ride index --- src/openrct2/ride/TrackPaint.cpp | 31 +- src/openrct2/ride/TrackPaint.h | 19 +- .../coaster/AirPoweredVerticalCoaster.cpp | 62 +- .../ride/coaster/BobsleighCoaster.cpp | 124 ++- .../ride/coaster/BolligerMabillardTrack.cpp | 489 ++++++------ .../ride/coaster/BolligerMabillardTrack.h | 358 ++++----- .../ride/coaster/CompactInvertedCoaster.cpp | 294 ++++--- .../ride/coaster/CorkscrewRollerCoaster.cpp | 302 ++++---- .../ride/coaster/FlyingRollerCoaster.cpp | 396 +++++----- src/openrct2/ride/coaster/GigaCoaster.cpp | 384 +++++---- .../ride/coaster/HeartlineTwisterCoaster.cpp | 52 +- src/openrct2/ride/coaster/HybridCoaster.cpp | 433 ++++++----- .../ride/coaster/InvertedHairpinCoaster.cpp | 84 +- .../ride/coaster/InvertedImpulseCoaster.cpp | 73 +- .../ride/coaster/InvertedRollerCoaster.cpp | 396 +++++----- .../ride/coaster/JuniorRollerCoaster.cpp | 385 +++++---- .../ride/coaster/JuniorRollerCoaster.h | 60 +- .../ride/coaster/LayDownRollerCoaster.cpp | 298 ++++--- .../ride/coaster/LimLaunchedRollerCoaster.cpp | 67 +- .../ride/coaster/LoopingRollerCoaster.cpp | 379 +++++---- src/openrct2/ride/coaster/MineRide.cpp | 186 +++-- .../ride/coaster/MineTrainCoaster.cpp | 246 +++--- .../ride/coaster/MiniRollerCoaster.cpp | 374 +++++---- .../ride/coaster/MiniSuspendedCoaster.cpp | 66 +- .../coaster/MultiDimensionRollerCoaster.cpp | 258 +++---- .../ride/coaster/ReverseFreefallCoaster.cpp | 11 +- .../ride/coaster/ReverserRollerCoaster.cpp | 46 +- .../coaster/SideFrictionRollerCoaster.cpp | 104 +-- .../ride/coaster/SingleRailRollerCoaster.cpp | 480 ++++++------ .../ride/coaster/StandUpRollerCoaster.cpp | 270 ++++--- src/openrct2/ride/coaster/Steeplechase.cpp | 70 +- .../ride/coaster/SuspendedSwingingCoaster.cpp | 138 ++-- .../ride/coaster/TwisterRollerCoaster.cpp | 731 +++++++++--------- .../coaster/VerticalDropRollerCoaster.cpp | 731 +++++++++--------- src/openrct2/ride/coaster/VirginiaReel.cpp | 38 +- src/openrct2/ride/coaster/WildMouse.cpp | 86 +-- .../ride/coaster/WoodenRollerCoaster.cpp | 388 +++++----- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 66 +- src/openrct2/ride/gentle/CarRide.cpp | 59 +- src/openrct2/ride/gentle/Circus.cpp | 18 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 3 +- src/openrct2/ride/gentle/Dodgems.cpp | 3 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 14 +- src/openrct2/ride/gentle/FlyingSaucers.cpp | 3 +- src/openrct2/ride/gentle/GhostTrain.cpp | 47 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 13 +- src/openrct2/ride/gentle/Maze.cpp | 4 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 18 +- src/openrct2/ride/gentle/MiniGolf.cpp | 39 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 36 +- src/openrct2/ride/gentle/MonorailCycles.cpp | 22 +- src/openrct2/ride/gentle/ObservationTower.cpp | 5 +- src/openrct2/ride/gentle/SpaceRings.cpp | 6 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 16 +- src/openrct2/ride/shops/Facility.cpp | 3 +- src/openrct2/ride/shops/Shop.cpp | 3 +- src/openrct2/ride/thrill/3dCinema.cpp | 18 +- src/openrct2/ride/thrill/Enterprise.cpp | 5 +- src/openrct2/ride/thrill/GoKarts.cpp | 29 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 5 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 15 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 13 +- src/openrct2/ride/thrill/RotoDrop.cpp | 5 +- .../ride/thrill/SwingingInverterShip.cpp | 5 +- src/openrct2/ride/thrill/SwingingShip.cpp | 5 +- src/openrct2/ride/thrill/TopSpin.cpp | 18 +- src/openrct2/ride/thrill/Twist.cpp | 5 +- src/openrct2/ride/transport/Chairlift.cpp | 58 +- src/openrct2/ride/transport/Lift.cpp | 5 +- .../ride/transport/MiniatureRailway.cpp | 70 +- src/openrct2/ride/transport/Monorail.cpp | 70 +- .../ride/transport/SuspendedMonorail.cpp | 66 +- src/openrct2/ride/water/BoatHire.cpp | 11 +- src/openrct2/ride/water/DingySlide.cpp | 116 ++- src/openrct2/ride/water/LogFlume.cpp | 30 +- src/openrct2/ride/water/RiverRapids.cpp | 33 +- src/openrct2/ride/water/SplashBoats.cpp | 49 +- src/openrct2/ride/water/SubmarineRide.cpp | 18 +- src/openrct2/ride/water/WaterCoaster.cpp | 142 ++-- 79 files changed, 4919 insertions(+), 5159 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index f662d129fa..0da5fbfdbd 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -202,7 +202,7 @@ enum // clang-format on bool track_paint_util_has_fence( - enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation) + enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint8_t rotation) { const auto* stationObject = ride_get_station_object(ride); if (stationObject != nullptr && stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -264,7 +264,7 @@ void track_paint_util_paint_floor( } void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride, + paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) { uint32_t imageId; @@ -304,34 +304,33 @@ bool track_paint_util_should_paint_supports(const CoordsXY& position) } static void track_paint_util_draw_station_impl( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, uint16_t coverHeight, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB); void track_paint_util_draw_station( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement) + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement) { - track_paint_util_draw_station_impl(session, rideIndex, direction, height, height, tileElement, 5, 7); + track_paint_util_draw_station_impl(session, ride, direction, height, height, tileElement, 5, 7); } void track_paint_util_draw_station_2( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { - track_paint_util_draw_station_impl(session, rideIndex, direction, height, height, tileElement, fenceOffsetA, fenceOffsetB); + track_paint_util_draw_station_impl(session, ride, direction, height, height, tileElement, fenceOffsetA, fenceOffsetB); } void track_paint_util_draw_station_3( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, uint16_t coverHeight, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, const TileElement* tileElement) { - track_paint_util_draw_station_impl(session, rideIndex, direction, height, coverHeight, tileElement, 5, 7); + track_paint_util_draw_station_impl(session, ride, direction, height, coverHeight, tileElement, 5, 7); } static void track_paint_util_draw_station_impl( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, uint16_t coverHeight, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -539,10 +538,9 @@ static void track_paint_util_draw_station_impl( } void track_paint_util_draw_station_inverted( - paint_session* session, ride_id_t rideIndex, Direction direction, int32_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, int32_t height, const TileElement* tileElement, uint8_t stationVariant) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -853,7 +851,8 @@ bool track_paint_util_draw_station_covers_2( } void track_paint_util_draw_narrow_station_platform( - paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement) + paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, + const TileElement* tileElement) { CoordsXY position = session->MapPosition; auto stationObj = ride_get_station_object(ride); @@ -901,7 +900,7 @@ void track_paint_util_draw_narrow_station_platform( } void track_paint_util_draw_pier( - paint_session* session, Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, + paint_session* session, const Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, int32_t height, const TileElement* tileElement, uint8_t rotation) { if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -2263,7 +2262,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType); if (paintFunction != nullptr) { - paintFunction(session, rideIndex, trackSequence, direction, height, tileElement); + paintFunction(session, ride, trackSequence, direction, height, tileElement); } } } diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 1cd6608667..f6867d0123 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -278,12 +278,12 @@ extern const uint8_t mapLeftEighthTurnToOrthogonal[5]; extern const size_t mini_golf_peep_animation_lengths[]; bool track_paint_util_has_fence( - enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, Ride* ride, uint8_t rotation); + enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint8_t rotation); void track_paint_util_paint_floor( paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4], const StationObject* stationStyle); void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, Ride* ride, + paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); bool track_paint_util_draw_station_covers( paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height); @@ -291,21 +291,22 @@ bool track_paint_util_draw_station_covers_2( paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height, uint8_t stationVariant); void track_paint_util_draw_narrow_station_platform( - paint_session* session, Ride* ride, Direction direction, int32_t height, int32_t zOffset, const TileElement* tileElement); + paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, + const TileElement* tileElement); void track_paint_util_draw_station( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement); + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement); void track_paint_util_draw_station_2( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB); void track_paint_util_draw_station_3( - paint_session* session, ride_id_t rideIndex, Direction direction, uint16_t height, uint16_t coverHeight, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, const TileElement* tileElement); void track_paint_util_draw_station_inverted( - paint_session* session, ride_id_t rideIndex, Direction direction, int32_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, int32_t height, const TileElement* tileElement, uint8_t stationVariant); bool track_paint_util_should_paint_supports(const CoordsXY& position); void track_paint_util_draw_pier( - paint_session* session, Ride* ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, + paint_session* session, const Ride* ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, int32_t height, const TileElement* tileElement, uint8_t rotation); void track_paint_util_draw_station_metal_supports( paint_session* session, Direction direction, uint16_t height, uint32_t colour); @@ -394,7 +395,7 @@ void track_paint_util_right_vertical_loop_segments(paint_session* session, Direc void track_paint_util_left_corkscrew_up_supports(paint_session* session, Direction direction, uint16_t height); using TRACK_PAINT_FUNCTION = void (*)( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, Direction direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, Direction direction, int32_t height, const TileElement* tileElement); using TRACK_PAINT_FUNCTION_GETTER = TRACK_PAINT_FUNCTION (*)(int32_t trackType); diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 4826338faa..652dbef785 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -177,7 +177,7 @@ static uint32_t air_powered_vertical_rc_get_support_colour(paint_session* sessio /** rct2: 0x008AFAD4 */ static void air_powered_vertical_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -199,7 +199,7 @@ static void air_powered_vertical_rc_track_flat( } static void air_powered_vertical_rc_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -218,7 +218,6 @@ static void air_powered_vertical_rc_track_station( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - auto ride = get_ride(rideIndex); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); @@ -229,7 +228,7 @@ static void air_powered_vertical_rc_track_station( } static void air_powered_vertical_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][5] = { @@ -312,17 +311,16 @@ static void air_powered_vertical_rc_track_right_quarter_turn_5( } static void air_powered_vertical_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - air_powered_vertical_rc_track_right_quarter_turn_5( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + air_powered_vertical_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AFB74 */ static void air_powered_vertical_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -351,7 +349,7 @@ static void air_powered_vertical_rc_track_flat_to_left_bank( /** rct2: 0x008AFB84 */ static void air_powered_vertical_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -379,24 +377,22 @@ static void air_powered_vertical_rc_track_flat_to_right_bank( } static void air_powered_vertical_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - air_powered_vertical_rc_track_flat_to_right_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AFBA4 */ static void air_powered_vertical_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - air_powered_vertical_rc_track_flat_to_left_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][5] = { @@ -493,17 +489,17 @@ static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( } static void air_powered_vertical_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; air_powered_vertical_rc_track_banked_right_quarter_turn_5( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AFBD4 */ static void air_powered_vertical_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -532,14 +528,14 @@ static void air_powered_vertical_rc_track_left_bank( } static void air_powered_vertical_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - air_powered_vertical_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void air_powered_vertical_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -561,7 +557,7 @@ static void air_powered_vertical_rc_track_brakes( } static void air_powered_vertical_rc_track_vertical_slope_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t trackImageIds[7][4] = { @@ -761,7 +757,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( } static void air_powered_vertical_rc_track_vertical_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -798,13 +794,12 @@ static void air_powered_vertical_rc_track_vertical_up( } static void air_powered_vertical_rc_track_vertical_top( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) { - air_powered_vertical_rc_track_vertical_top( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_top(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); return; } @@ -881,22 +876,21 @@ static void air_powered_vertical_rc_track_vertical_top( } static void air_powered_vertical_rc_track_vertical_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - air_powered_vertical_rc_track_vertical_up(session, rideIndex, trackSequence ^ 1, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_up(session, ride, trackSequence ^ 1, (direction + 2) & 3, height, tileElement); } static void air_powered_vertical_rc_track_vertical_slope_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - air_powered_vertical_rc_track_vertical_slope_up( - session, rideIndex, 6 - trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_slope_up(session, ride, 6 - trackSequence, (direction + 2) & 3, height, tileElement); } static void air_powered_vertical_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { // The booster piece is borrowed from the Reverse Freefall Colour. @@ -929,7 +923,7 @@ static void air_powered_vertical_rc_track_booster( } static void air_powered_vertical_rc_track_onride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index 07f7d83ba4..5c3c599596 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _BobsleighBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x006FE5B4 */ static void bobsleigh_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -90,7 +90,7 @@ static void bobsleigh_rc_track_flat( } static void bobsleigh_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -106,7 +106,7 @@ static void bobsleigh_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -114,7 +114,7 @@ static void bobsleigh_rc_track_station( /** rct2: 0x006FE5C4 */ static void bobsleigh_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -200,7 +200,7 @@ static void bobsleigh_rc_track_25_deg_up( /** rct2: 0x006FE5D4 */ static void bobsleigh_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -286,7 +286,7 @@ static void bobsleigh_rc_track_flat_to_25_deg_up( /** rct2: 0x006FE5E4 */ static void bobsleigh_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -372,31 +372,31 @@ static void bobsleigh_rc_track_25_deg_up_to_flat( /** rct2: 0x006FE5F4 */ static void bobsleigh_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE604 */ static void bobsleigh_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE614 */ static void bobsleigh_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE624 */ static void bobsleigh_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -620,16 +620,16 @@ static void bobsleigh_rc_track_left_quarter_turn_5( /** rct2: 0x006FE634 */ static void bobsleigh_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE644 */ static void bobsleigh_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -671,7 +671,7 @@ static void bobsleigh_rc_track_flat_to_left_bank( /** rct2: 0x006FE654 */ static void bobsleigh_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -713,7 +713,7 @@ static void bobsleigh_rc_track_flat_to_right_bank( /** rct2: 0x006FE664 */ static void bobsleigh_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -755,7 +755,7 @@ static void bobsleigh_rc_track_left_bank_to_flat( /** rct2: 0x006FE674 */ static void bobsleigh_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -797,7 +797,7 @@ static void bobsleigh_rc_track_right_bank_to_flat( /** rct2: 0x006FE684 */ static void bobsleigh_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1021,16 +1021,16 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( /** rct2: 0x006FE694 */ static void bobsleigh_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE6A4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1079,7 +1079,7 @@ static void bobsleigh_rc_track_left_bank_to_25_deg_up( /** rct2: 0x006FE6B4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1128,7 +1128,7 @@ static void bobsleigh_rc_track_right_bank_to_25_deg_up( /** rct2: 0x006FE6C4 */ static void bobsleigh_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1177,7 +1177,7 @@ static void bobsleigh_rc_track_25_deg_up_to_left_bank( /** rct2: 0x006FE6D4 */ static void bobsleigh_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1226,39 +1226,39 @@ static void bobsleigh_rc_track_25_deg_up_to_right_bank( /** rct2: 0x006FE6E4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE6F4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE704 */ static void bobsleigh_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE714 */ static void bobsleigh_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE724 */ static void bobsleigh_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1300,15 +1300,15 @@ static void bobsleigh_rc_track_left_bank( /** rct2: 0x006FE734 */ static void bobsleigh_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bobsleigh_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x006FE744 */ static void bobsleigh_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1491,7 +1491,7 @@ static void bobsleigh_rc_track_s_bend_left( /** rct2: 0x006FE754 */ static void bobsleigh_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1674,7 +1674,7 @@ static void bobsleigh_rc_track_s_bend_right( /** rct2: 0x006FE794 */ static void bobsleigh_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1813,16 +1813,16 @@ static void bobsleigh_rc_track_left_quarter_turn_3( /** rct2: 0x006FE7A4 */ static void bobsleigh_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE7B4 */ static void bobsleigh_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1961,16 +1961,16 @@ static void bobsleigh_rc_track_left_quarter_turn_3_bank( /** rct2: 0x006FE7C4 */ static void bobsleigh_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE7D4 */ static void bobsleigh_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2242,7 +2242,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( /** rct2: 0x006FE7E4 */ static void bobsleigh_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2514,7 +2514,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( /** rct2: 0x006FE7F4 */ static void bobsleigh_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2523,13 +2523,12 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + bobsleigh_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x006FE804 */ static void bobsleigh_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2538,13 +2537,12 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE814 */ static void bobsleigh_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2986,7 +2984,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( /** rct2: 0x006FE824 */ static void bobsleigh_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3428,7 +3426,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( /** rct2: 0x006FE834 */ static void bobsleigh_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3437,13 +3435,12 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + bobsleigh_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x006FE844 */ static void bobsleigh_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3452,13 +3449,12 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x006FE854 */ static void bobsleigh_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3490,7 +3486,7 @@ static void bobsleigh_rc_track_brakes( /** rct2: 0x006FE864 */ static void bobsleigh_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -3524,7 +3520,7 @@ static void bobsleigh_rc_track_block_brakes( } static void bobsleigh_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp index fae8f5ce31..cbfeae0648 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp @@ -33,7 +33,7 @@ static constexpr const uint32_t _BolligerMabillardBlockBrakeImages[NumOrthogonal }; void bolliger_mabillard_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -68,7 +68,7 @@ void bolliger_mabillard_track_flat( } void bolliger_mabillard_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { static constexpr const uint32_t imageIds[4][2] = { @@ -96,7 +96,6 @@ void bolliger_mabillard_track_station( track_paint_util_draw_station_metal_supports_2( session, direction, height, session->TrackColours[SCHEME_SUPPORTS], supportType); - auto ride = get_ride(rideIndex); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 9, tileElement); @@ -106,7 +105,7 @@ void bolliger_mabillard_track_station( } void bolliger_mabillard_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -175,7 +174,7 @@ void bolliger_mabillard_track_25_deg_up( } void bolliger_mabillard_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -244,7 +243,7 @@ void bolliger_mabillard_track_60_deg_up( } void bolliger_mabillard_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -313,7 +312,7 @@ void bolliger_mabillard_track_flat_to_25_deg_up( } void bolliger_mabillard_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -390,7 +389,7 @@ void bolliger_mabillard_track_25_deg_up_to_60_deg_up( } void bolliger_mabillard_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -467,7 +466,7 @@ void bolliger_mabillard_track_60_deg_up_to_25_deg_up( } void bolliger_mabillard_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -536,55 +535,53 @@ void bolliger_mabillard_track_25_deg_up_to_flat( } void bolliger_mabillard_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { - bolliger_mabillard_track_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { - bolliger_mabillard_track_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -747,16 +744,16 @@ void bolliger_mabillard_track_left_quarter_turn_5( } void bolliger_mabillard_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -793,7 +790,7 @@ void bolliger_mabillard_track_flat_to_left_bank( } void bolliger_mabillard_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -830,7 +827,7 @@ void bolliger_mabillard_track_flat_to_right_bank( } void bolliger_mabillard_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -867,7 +864,7 @@ void bolliger_mabillard_track_left_bank_to_flat( } void bolliger_mabillard_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -904,7 +901,7 @@ void bolliger_mabillard_track_right_bank_to_flat( } void bolliger_mabillard_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -1080,16 +1077,16 @@ void bolliger_mabillard_track_banked_left_quarter_turn_5( } void bolliger_mabillard_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -1133,7 +1130,7 @@ void bolliger_mabillard_track_left_bank_to_25_deg_up( } void bolliger_mabillard_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -1177,7 +1174,7 @@ void bolliger_mabillard_track_right_bank_to_25_deg_up( } void bolliger_mabillard_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -1221,7 +1218,7 @@ void bolliger_mabillard_track_25_deg_up_to_left_bank( } void bolliger_mabillard_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -1265,39 +1262,39 @@ void bolliger_mabillard_track_25_deg_up_to_right_bank( } void bolliger_mabillard_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -1330,15 +1327,14 @@ void bolliger_mabillard_track_left_bank( } void bolliger_mabillard_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { - bolliger_mabillard_track_left_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -1501,7 +1497,7 @@ void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( } void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -1664,25 +1660,25 @@ void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( } void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -1812,7 +1808,7 @@ void bolliger_mabillard_track_s_bend_left( } void bolliger_mabillard_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -1942,7 +1938,7 @@ void bolliger_mabillard_track_s_bend_right( } void bolliger_mabillard_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2204,7 +2200,7 @@ void bolliger_mabillard_track_left_vertical_loop( } void bolliger_mabillard_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2428,7 +2424,7 @@ void bolliger_mabillard_track_right_vertical_loop( } void bolliger_mabillard_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2530,16 +2526,16 @@ void bolliger_mabillard_track_left_quarter_turn_3( } void bolliger_mabillard_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2650,16 +2646,16 @@ void bolliger_mabillard_track_left_quarter_turn_3_bank( } void bolliger_mabillard_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3_bank( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2737,7 +2733,7 @@ void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -2818,25 +2814,25 @@ void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -3053,7 +3049,7 @@ void bolliger_mabillard_track_left_half_banked_helix_up_small( } void bolliger_mabillard_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -3270,7 +3266,7 @@ void bolliger_mabillard_track_right_half_banked_helix_up_small( } void bolliger_mabillard_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (trackSequence >= 4) @@ -3280,11 +3276,11 @@ void bolliger_mabillard_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (trackSequence >= 4) @@ -3294,11 +3290,11 @@ void bolliger_mabillard_track_right_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -3639,7 +3635,7 @@ void bolliger_mabillard_track_left_half_banked_helix_up_large( } void bolliger_mabillard_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -3986,7 +3982,7 @@ void bolliger_mabillard_track_right_half_banked_helix_up_large( } void bolliger_mabillard_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (trackSequence >= 7) @@ -3996,11 +3992,11 @@ void bolliger_mabillard_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (trackSequence >= 7) @@ -4010,11 +4006,11 @@ void bolliger_mabillard_track_right_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4050,7 +4046,7 @@ void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( } void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4086,23 +4082,23 @@ void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( } void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4129,7 +4125,7 @@ void bolliger_mabillard_track_brakes( } void bolliger_mabillard_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4169,7 +4165,7 @@ void bolliger_mabillard_track_25_deg_up_left_banked( } void bolliger_mabillard_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4209,7 +4205,7 @@ void bolliger_mabillard_track_25_deg_up_right_banked( } void bolliger_mabillard_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4250,23 +4246,23 @@ void bolliger_mabillard_track_on_ride_photo( } void bolliger_mabillard_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_right_banked( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_left_banked( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4306,15 +4302,14 @@ void bolliger_mabillard_track_90_deg_up( } void bolliger_mabillard_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { - bolliger_mabillard_track_90_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4356,15 +4351,15 @@ void bolliger_mabillard_track_60_deg_up_to_90_deg_up( } void bolliger_mabillard_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -4401,7 +4396,7 @@ void bolliger_mabillard_track_90_deg_up_to_60_deg_up( } void bolliger_mabillard_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4444,7 +4439,7 @@ void bolliger_mabillard_track_60_deg_down_to_90_deg_down( } void bolliger_mabillard_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4578,7 +4573,7 @@ void bolliger_mabillard_track_left_eighth_to_diag( } void bolliger_mabillard_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4711,25 +4706,25 @@ void bolliger_mabillard_track_right_eighth_to_diag( } void bolliger_mabillard_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_right_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_left_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 3) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -4866,7 +4861,7 @@ void bolliger_mabillard_track_left_eighth_bank_to_diag( } void bolliger_mabillard_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5003,25 +4998,25 @@ void bolliger_mabillard_track_right_eighth_bank_to_diag( } void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_left_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 3) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5166,7 +5161,7 @@ void bolliger_mabillard_track_diag_flat( } void bolliger_mabillard_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5311,7 +5306,7 @@ void bolliger_mabillard_track_diag_25_deg_up( } void bolliger_mabillard_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5456,7 +5451,7 @@ void bolliger_mabillard_track_diag_60_deg_up( } void bolliger_mabillard_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5601,7 +5596,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_up( } void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5746,7 +5741,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( } void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -5891,7 +5886,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( } void bolliger_mabillard_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6036,7 +6031,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_flat( } void bolliger_mabillard_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6181,7 +6176,7 @@ void bolliger_mabillard_track_diag_25_deg_down( } void bolliger_mabillard_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6326,7 +6321,7 @@ void bolliger_mabillard_track_diag_60_deg_down( } void bolliger_mabillard_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6469,7 +6464,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_down( } void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6614,7 +6609,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( } void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6759,7 +6754,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( } void bolliger_mabillard_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -6904,7 +6899,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_flat( } void bolliger_mabillard_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7049,7 +7044,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_up( } void bolliger_mabillard_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7194,7 +7189,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_flat( } void bolliger_mabillard_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7339,7 +7334,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_down( } void bolliger_mabillard_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7484,7 +7479,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_flat( } void bolliger_mabillard_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7558,7 +7553,7 @@ void bolliger_mabillard_track_diag_flat_to_left_bank( } void bolliger_mabillard_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7632,7 +7627,7 @@ void bolliger_mabillard_track_diag_flat_to_right_bank( } void bolliger_mabillard_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7706,7 +7701,7 @@ void bolliger_mabillard_track_diag_left_bank_to_flat( } void bolliger_mabillard_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7780,7 +7775,7 @@ void bolliger_mabillard_track_diag_right_bank_to_flat( } void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7854,7 +7849,7 @@ void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( } void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -7928,7 +7923,7 @@ void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( } void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8002,7 +7997,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( } void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8076,7 +8071,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( } void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8148,7 +8143,7 @@ void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( } void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8220,7 +8215,7 @@ void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( } void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8294,7 +8289,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( } void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8368,7 +8363,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( } void bolliger_mabillard_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8439,7 +8434,7 @@ void bolliger_mabillard_track_diag_left_bank( } void bolliger_mabillard_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8510,7 +8505,7 @@ void bolliger_mabillard_track_diag_right_bank( } void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8591,7 +8586,7 @@ void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8675,7 +8670,7 @@ void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8759,7 +8754,7 @@ void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( } void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8840,7 +8835,7 @@ void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( } void bolliger_mabillard_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -8872,7 +8867,7 @@ void bolliger_mabillard_track_block_brakes( } void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -8953,7 +8948,7 @@ void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -9037,25 +9032,25 @@ void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( } void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -9224,7 +9219,7 @@ void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( } void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -9393,25 +9388,25 @@ void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( } void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9453,7 +9448,7 @@ void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( } void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9495,7 +9490,7 @@ void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( } void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9537,7 +9532,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( } void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9579,39 +9574,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( } void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9651,7 +9646,7 @@ void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( } void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9691,7 +9686,7 @@ void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( } void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9731,7 +9726,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( } void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9771,39 +9766,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( } void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9845,7 +9840,7 @@ void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( } void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9887,7 +9882,7 @@ void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( } void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9929,7 +9924,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( } void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -9971,39 +9966,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( } void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10049,7 +10044,7 @@ void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( } void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10095,24 +10090,24 @@ void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( } void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); } /* The following track elements used to be specific to the Vertical Roller Coaster */ void bolliger_mabillard_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -10187,7 +10182,7 @@ void bolliger_mabillard_track_flat_to_60_deg_up( } void bolliger_mabillard_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { if (tileElement->AsTrack()->HasChain()) @@ -10262,23 +10257,23 @@ void bolliger_mabillard_track_60_deg_up_to_flat( } void bolliger_mabillard_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_flat_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_brake_for_drop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -10320,7 +10315,7 @@ void bolliger_mabillard_track_brake_for_drop( /* The following track elements used to be specific to the Steel Twister */ void bolliger_mabillard_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10444,14 +10439,14 @@ void bolliger_mabillard_track_half_loop_up( } void bolliger_mabillard_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { - bolliger_mabillard_track_half_loop_up(session, rideIndex, 3 - trackSequence, direction, height, tileElement, supportType); + bolliger_mabillard_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement, supportType); } void bolliger_mabillard_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10561,7 +10556,7 @@ void bolliger_mabillard_track_left_corkscrew_up( } void bolliger_mabillard_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10672,23 +10667,23 @@ void bolliger_mabillard_track_right_corkscrew_up( } void bolliger_mabillard_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_corkscrew_up( - session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_corkscrew_up( - session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10825,7 +10820,7 @@ void bolliger_mabillard_track_flat_to_60_deg_up_long_base( /** rct2: 0x008AC104 */ void bolliger_mabillard_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -10961,23 +10956,23 @@ void bolliger_mabillard_track_60_deg_up_to_flat_long_base( } void bolliger_mabillard_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_left_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -11116,7 +11111,7 @@ void bolliger_mabillard_track_left_barrel_roll_up_to_down( } void bolliger_mabillard_track_right_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -11255,23 +11250,23 @@ void bolliger_mabillard_track_right_barrel_roll_up_to_down( } void bolliger_mabillard_track_left_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_right_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); } void bolliger_mabillard_track_powered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (direction) @@ -11308,7 +11303,7 @@ void bolliger_mabillard_track_powered_lift( } void bolliger_mabillard_track_left_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -11528,7 +11523,7 @@ void bolliger_mabillard_track_left_large_half_loop_up( } void bolliger_mabillard_track_right_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -11748,23 +11743,23 @@ void bolliger_mabillard_track_right_large_half_loop_up( } void bolliger_mabillard_track_right_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_right_large_half_loop_up( - session, rideIndex, 6 - trackSequence, direction, height, tileElement, supportType); + session, ride, 6 - trackSequence, direction, height, tileElement, supportType); } void bolliger_mabillard_track_left_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_left_large_half_loop_up( - session, rideIndex, 6 - trackSequence, direction, height, tileElement, supportType); + session, ride, 6 - trackSequence, direction, height, tileElement, supportType); } void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { switch (trackSequence) @@ -11861,15 +11856,15 @@ void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( } void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, rideIndex, 2 - trackSequence, direction, height, tileElement, supportType); + session, ride, 2 - trackSequence, direction, height, tileElement, supportType); } void bolliger_mabillard_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType) { // These offsets could be moved to the g2.dat file when that supports offsets. diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.h b/src/openrct2/ride/coaster/BolligerMabillardTrack.h index 21fb3961b2..e156c522fc 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.h +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.h @@ -16,544 +16,544 @@ struct paint_session; struct TileElement; void bolliger_mabillard_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); /* Previously specific to the Vertical RC */ void bolliger_mabillard_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_brake_for_drop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); /* Previously specific to the Steel Twister */ void bolliger_mabillard_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_powered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_right_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_left_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); void bolliger_mabillard_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement, int32_t supportType); diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index 96c6c68aad..cfe826b7b5 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008AE6E0 */ static void compact_inverted_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -74,7 +74,7 @@ static void compact_inverted_rc_track_flat( /** rct2: 0x008AE950, 0x008AE960, 0x008AE970 */ static void compact_inverted_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -93,7 +93,7 @@ static void compact_inverted_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -101,7 +101,7 @@ static void compact_inverted_rc_track_station( /** rct2: 0x008AE6F0 */ static void compact_inverted_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -195,7 +195,7 @@ static void compact_inverted_rc_track_25_deg_up( /** rct2: 0x008AE700 */ static void compact_inverted_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -265,7 +265,7 @@ static void compact_inverted_rc_track_60_deg_up( /** rct2: 0x008AE710 */ static void compact_inverted_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -359,7 +359,7 @@ static void compact_inverted_rc_track_flat_to_25_deg_up( /** rct2: 0x008AE720 */ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -441,7 +441,7 @@ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AE730 */ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -547,7 +547,7 @@ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AE740 */ static void compact_inverted_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -641,57 +641,55 @@ static void compact_inverted_rc_track_25_deg_up_to_flat( /** rct2: 0x008AE750 */ static void compact_inverted_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE760 */ static void compact_inverted_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE770 */ static void compact_inverted_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE780 */ static void compact_inverted_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE790 */ static void compact_inverted_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE7A0 */ static void compact_inverted_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE7B0 */ static void compact_inverted_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -871,16 +869,16 @@ static void compact_inverted_rc_track_left_quarter_turn_5( /** rct2: 0x008AE7C0 */ static void compact_inverted_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AE7D0 */ static void compact_inverted_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -923,7 +921,7 @@ static void compact_inverted_rc_track_flat_to_left_bank( /** rct2: 0x008AE7E0 */ static void compact_inverted_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -966,7 +964,7 @@ static void compact_inverted_rc_track_flat_to_right_bank( /** rct2: 0x008AE7F0 */ static void compact_inverted_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1009,7 +1007,7 @@ static void compact_inverted_rc_track_left_bank_to_flat( /** rct2: 0x008AE800 */ static void compact_inverted_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1052,7 +1050,7 @@ static void compact_inverted_rc_track_right_bank_to_flat( /** rct2: 0x008AE810 */ static void compact_inverted_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1232,17 +1230,17 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AE820 */ static void compact_inverted_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AE830 */ static void compact_inverted_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1309,7 +1307,7 @@ static void compact_inverted_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AE840 */ static void compact_inverted_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1376,7 +1374,7 @@ static void compact_inverted_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AE850 */ static void compact_inverted_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1443,7 +1441,7 @@ static void compact_inverted_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AE860 */ static void compact_inverted_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1510,43 +1508,39 @@ static void compact_inverted_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AE870 */ static void compact_inverted_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE880 */ static void compact_inverted_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE890 */ static void compact_inverted_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE8A0 */ static void compact_inverted_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE8B0 */ static void compact_inverted_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1589,15 +1583,15 @@ static void compact_inverted_rc_track_left_bank( /** rct2: 0x008AE8C0 */ static void compact_inverted_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AE8D0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1762,7 +1756,7 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AE8E0 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1927,27 +1921,27 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AE8F0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AE900 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AE910 */ static void compact_inverted_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2118,7 +2112,7 @@ static void compact_inverted_rc_track_s_bend_left( /** rct2: 0x008AE920 */ static void compact_inverted_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2289,7 +2283,7 @@ static void compact_inverted_rc_track_s_bend_right( /** rct2: 0x008AE930 */ static void compact_inverted_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2596,7 +2590,7 @@ static void compact_inverted_rc_track_left_vertical_loop( /** rct2: 0x008AE940 */ static void compact_inverted_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2903,7 +2897,7 @@ static void compact_inverted_rc_track_right_vertical_loop( /** rct2: 0x008AE980 */ static void compact_inverted_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3022,16 +3016,16 @@ static void compact_inverted_rc_track_left_quarter_turn_3( /** rct2: 0x008AE990 */ static void compact_inverted_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AE9A0 */ static void compact_inverted_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3151,17 +3145,16 @@ static void compact_inverted_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AE9B0 */ static void compact_inverted_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_3_bank( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AE9C0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3248,7 +3241,7 @@ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AE9D0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3335,27 +3328,27 @@ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AE9E0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AE9F0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AEA00 */ static void compact_inverted_rc_track_left_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3465,7 +3458,7 @@ static void compact_inverted_rc_track_left_twist_down_to_up( /** rct2: 0x008AEA10 */ static void compact_inverted_rc_track_right_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3575,7 +3568,7 @@ static void compact_inverted_rc_track_right_twist_down_to_up( /** rct2: 0x008AEA20 */ static void compact_inverted_rc_track_left_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3685,7 +3678,7 @@ static void compact_inverted_rc_track_left_twist_up_to_down( /** rct2: 0x008AEA30 */ static void compact_inverted_rc_track_right_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3795,7 +3788,7 @@ static void compact_inverted_rc_track_right_twist_up_to_down( /** rct2: 0x008AEA40 */ static void compact_inverted_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3948,15 +3941,15 @@ static void compact_inverted_rc_track_half_loop_up( /** rct2: 0x008AEA50 */ static void compact_inverted_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_half_loop_up(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + compact_inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); } /** rct2: 0x008AEA60 */ static void compact_inverted_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4074,7 +4067,7 @@ static void compact_inverted_rc_track_left_corkscrew_up( /** rct2: 0x008AEA70 */ static void compact_inverted_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4192,25 +4185,23 @@ static void compact_inverted_rc_track_right_corkscrew_up( /** rct2: 0x008AEA80 */ static void compact_inverted_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_right_corkscrew_up( - session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + compact_inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AEA90 */ static void compact_inverted_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_left_corkscrew_up( - session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AEAD0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4251,7 +4242,7 @@ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008AEAB0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4293,25 +4284,25 @@ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008AEAC0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AEAE0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4344,7 +4335,7 @@ static void compact_inverted_rc_track_brakes( /** rct2: 0x008AEAF0 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4529,7 +4520,7 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x008AEB00 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4714,7 +4705,7 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x008AEB10 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4899,7 +4890,7 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x008AEB20 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5084,7 +5075,7 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x008AEB30 */ static void compact_inverted_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5138,7 +5129,7 @@ static void compact_inverted_rc_track_on_ride_photo( /** rct2: 0x008AEDB0 */ static void compact_inverted_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5208,15 +5199,15 @@ static void compact_inverted_rc_track_90_deg_up( /** rct2: 0x008AEDC0 */ static void compact_inverted_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_90_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AED70 */ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5290,16 +5281,15 @@ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008AED80 */ static void compact_inverted_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - compact_inverted_rc_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AED90 */ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -5370,7 +5360,7 @@ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008AEDA0 */ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5443,7 +5433,7 @@ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008AEB40 */ static void compact_inverted_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5606,7 +5596,7 @@ static void compact_inverted_rc_track_left_eighth_to_diag( /** rct2: 0x008AEB50 */ static void compact_inverted_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5769,25 +5759,25 @@ static void compact_inverted_rc_track_right_eighth_to_diag( /** rct2: 0x008AEB60 */ static void compact_inverted_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AEB70 */ static void compact_inverted_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + compact_inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008AED30 */ static void compact_inverted_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5950,7 +5940,7 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008AED40 */ static void compact_inverted_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6113,27 +6103,25 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008AED50 */ static void compact_inverted_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AED60 */ static void compact_inverted_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_left_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + compact_inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008AEB80 */ static void compact_inverted_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6272,7 +6260,7 @@ static void compact_inverted_rc_track_diag_flat( /** rct2: 0x008AEBB0 */ static void compact_inverted_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6411,7 +6399,7 @@ static void compact_inverted_rc_track_diag_25_deg_up( /** rct2: 0x008AEC10 */ static void compact_inverted_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6494,7 +6482,7 @@ static void compact_inverted_rc_track_diag_60_deg_up( /** rct2: 0x008AEB90 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6633,7 +6621,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AEBF0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6716,7 +6704,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008AEC00 */ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6799,7 +6787,7 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008AEBA0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6938,7 +6926,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008AEBE0 */ static void compact_inverted_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7077,7 +7065,7 @@ static void compact_inverted_rc_track_diag_25_deg_down( /** rct2: 0x008AEC40 */ static void compact_inverted_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7160,7 +7148,7 @@ static void compact_inverted_rc_track_diag_60_deg_down( /** rct2: 0x008AEBC0 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7296,7 +7284,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008AEC20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7379,7 +7367,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008AEC30 */ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7462,7 +7450,7 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008AEBD0 */ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7601,7 +7589,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008AEC70 */ static void compact_inverted_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7685,7 +7673,7 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( /** rct2: 0x008AEC80 */ static void compact_inverted_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7769,7 +7757,7 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( /** rct2: 0x008AEC90 */ static void compact_inverted_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7853,7 +7841,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( /** rct2: 0x008AECA0 */ static void compact_inverted_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7937,7 +7925,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( /** rct2: 0x008AECD0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8020,7 +8008,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008AECE0 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8103,7 +8091,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008AECB0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8186,7 +8174,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008AECC0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8269,7 +8257,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008AECF0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8349,7 +8337,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008AED00 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8429,7 +8417,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008AED10 */ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8512,7 +8500,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008AED20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8595,7 +8583,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008AEC50 */ static void compact_inverted_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8679,7 +8667,7 @@ static void compact_inverted_rc_track_diag_left_bank( /** rct2: 0x008AEC60 */ static void compact_inverted_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8763,7 +8751,7 @@ static void compact_inverted_rc_track_diag_right_bank( /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index f3bd5c62e2..050bb39fc0 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _CorkscrewRCBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A7AF8 */ static void corkscrew_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -89,7 +89,7 @@ static void corkscrew_rc_track_flat( /** rct2: 0x008A7D68, 0x008A7D78, 0x008A7D88 */ static void corkscrew_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -115,7 +115,7 @@ static void corkscrew_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -123,7 +123,7 @@ static void corkscrew_rc_track_station( /** rct2: 0x008A7B08 */ static void corkscrew_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -193,7 +193,7 @@ static void corkscrew_rc_track_25_deg_up( /** rct2: 0x008A7B18 */ static void corkscrew_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -263,7 +263,7 @@ static void corkscrew_rc_track_60_deg_up( /** rct2: 0x008A7B28 */ static void corkscrew_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -333,7 +333,7 @@ static void corkscrew_rc_track_flat_to_25_deg_up( /** rct2: 0x008A7B38 */ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -411,7 +411,7 @@ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A7B48 */ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -489,7 +489,7 @@ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A7B58 */ static void corkscrew_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -559,55 +559,55 @@ static void corkscrew_rc_track_25_deg_up_to_flat( /** rct2: 0x008A7B68 */ static void corkscrew_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7B78 */ static void corkscrew_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7B88 */ static void corkscrew_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7B98 */ static void corkscrew_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7BA8 */ static void corkscrew_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7BB8 */ static void corkscrew_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7BC8 */ static void corkscrew_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -771,16 +771,16 @@ static void corkscrew_rc_track_left_quarter_turn_5( /** rct2: 0x008A7BD8 */ static void corkscrew_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7BE8 */ static void corkscrew_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -818,7 +818,7 @@ static void corkscrew_rc_track_flat_to_left_bank( /** rct2: 0x008A7BF8 */ static void corkscrew_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -856,7 +856,7 @@ static void corkscrew_rc_track_flat_to_right_bank( /** rct2: 0x008A7C08 */ static void corkscrew_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -894,7 +894,7 @@ static void corkscrew_rc_track_left_bank_to_flat( /** rct2: 0x008A7C18 */ static void corkscrew_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -932,7 +932,7 @@ static void corkscrew_rc_track_right_bank_to_flat( /** rct2: 0x008A7C28 */ static void corkscrew_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1106,16 +1106,16 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A7C38 */ static void corkscrew_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7C48 */ static void corkscrew_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1160,7 +1160,7 @@ static void corkscrew_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A7C58 */ static void corkscrew_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1205,7 +1205,7 @@ static void corkscrew_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A7C68 */ static void corkscrew_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1250,7 +1250,7 @@ static void corkscrew_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A7C78 */ static void corkscrew_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1295,39 +1295,39 @@ static void corkscrew_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A7C88 */ static void corkscrew_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7C98 */ static void corkscrew_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7CA8 */ static void corkscrew_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7CB8 */ static void corkscrew_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7CC8 */ static void corkscrew_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1361,15 +1361,15 @@ static void corkscrew_rc_track_left_bank( /** rct2: 0x008A7CD8 */ static void corkscrew_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7CE8 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1533,7 +1533,7 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A7CF8 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1697,27 +1697,25 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A7D08 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7D18 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7D28 */ static void corkscrew_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1852,7 +1850,7 @@ static void corkscrew_rc_track_s_bend_left( /** rct2: 0x008A7D38 */ static void corkscrew_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1987,7 +1985,7 @@ static void corkscrew_rc_track_s_bend_right( /** rct2: 0x008A7D48 */ static void corkscrew_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2266,7 +2264,7 @@ static void corkscrew_rc_track_left_vertical_loop( /** rct2: 0x008A7D58 */ static void corkscrew_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2499,7 +2497,7 @@ static void corkscrew_rc_track_right_vertical_loop( /** rct2: 0x008A7D98 */ static void corkscrew_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2602,16 +2600,16 @@ static void corkscrew_rc_track_left_quarter_turn_3( /** rct2: 0x008A7DA8 */ static void corkscrew_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7DB8 */ static void corkscrew_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2723,16 +2721,16 @@ static void corkscrew_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A7DC8 */ static void corkscrew_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7DD8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2811,7 +2809,7 @@ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A7DE8 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2897,27 +2895,25 @@ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A7DF8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7E08 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7E18 */ static void corkscrew_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3046,15 +3042,15 @@ static void corkscrew_rc_track_half_loop_up( /** rct2: 0x008A7E28 */ static void corkscrew_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_half_loop_up(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + corkscrew_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A7E38 */ static void corkscrew_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3166,7 +3162,7 @@ static void corkscrew_rc_track_left_corkscrew_up( /** rct2: 0x008A7E48 */ static void corkscrew_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3279,23 +3275,23 @@ static void corkscrew_rc_track_right_corkscrew_up( /** rct2: 0x008A7E58 */ static void corkscrew_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_right_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7E68 */ static void corkscrew_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_left_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7E78 */ static void corkscrew_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3513,7 +3509,7 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A7E88 */ static void corkscrew_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3731,7 +3727,7 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A7E98 */ static void corkscrew_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3740,13 +3736,12 @@ static void corkscrew_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7EA8 */ static void corkscrew_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3755,13 +3750,12 @@ static void corkscrew_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7EB8 */ static void corkscrew_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4103,7 +4097,7 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A7EC8 */ static void corkscrew_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4445,7 +4439,7 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A7ED8 */ static void corkscrew_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4454,13 +4448,12 @@ static void corkscrew_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7EE8 */ static void corkscrew_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4469,13 +4462,12 @@ static void corkscrew_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7F18 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4512,7 +4504,7 @@ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A7EF8 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4549,25 +4541,23 @@ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A7F08 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7F28 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7F38 */ static void corkscrew_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4595,7 +4585,7 @@ static void corkscrew_rc_track_brakes( /** rct2: 0x008A7F48 */ static void corkscrew_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4637,7 +4627,7 @@ static void corkscrew_rc_track_on_ride_photo( /** rct2: 0x008A8198 */ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4778,7 +4768,7 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( /** rct2: 0x008A81A8 */ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4919,25 +4909,23 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( /** rct2: 0x008A81B8 */ static void corkscrew_rc_track_60_deg_down_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_flat_to_60_deg_up_long_base( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A81C8 */ static void corkscrew_rc_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - corkscrew_rc_track_60_deg_up_to_flat_long_base( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7F68 */ static void corkscrew_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5076,7 +5064,7 @@ static void corkscrew_rc_track_left_eighth_to_diag( /** rct2: 0x008A7F78 */ static void corkscrew_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5214,25 +5202,25 @@ static void corkscrew_rc_track_right_eighth_to_diag( /** rct2: 0x008A7F88 */ static void corkscrew_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7F98 */ static void corkscrew_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + corkscrew_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A7FA8 */ static void corkscrew_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5374,7 +5362,7 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A7FB8 */ static void corkscrew_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5515,25 +5503,25 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A7FC8 */ static void corkscrew_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7FD8 */ static void corkscrew_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + corkscrew_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A7F58 */ static void corkscrew_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5679,7 +5667,7 @@ static void corkscrew_rc_track_diag_flat( /** rct2: 0x008A8008 */ static void corkscrew_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5825,7 +5813,7 @@ static void corkscrew_rc_track_diag_25_deg_up( /** rct2: 0x008A8068 */ static void corkscrew_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5971,7 +5959,7 @@ static void corkscrew_rc_track_diag_60_deg_up( /** rct2: 0x008A7FE8 */ static void corkscrew_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6117,7 +6105,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A8048 */ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6263,7 +6251,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A8058 */ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6409,7 +6397,7 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A7FF8 */ static void corkscrew_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6555,7 +6543,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A8038 */ static void corkscrew_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6701,7 +6689,7 @@ static void corkscrew_rc_track_diag_25_deg_down( /** rct2: 0x008A8098 */ static void corkscrew_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6847,7 +6835,7 @@ static void corkscrew_rc_track_diag_60_deg_down( /** rct2: 0x008A8018 */ static void corkscrew_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6991,7 +6979,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A8078 */ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7137,7 +7125,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A8088 */ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7283,7 +7271,7 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A8028 */ static void corkscrew_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7429,7 +7417,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A80C8 */ static void corkscrew_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7508,7 +7496,7 @@ static void corkscrew_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A80D8 */ static void corkscrew_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7587,7 +7575,7 @@ static void corkscrew_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A80E8 */ static void corkscrew_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7666,7 +7654,7 @@ static void corkscrew_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A80F8 */ static void corkscrew_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7745,7 +7733,7 @@ static void corkscrew_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A8128 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7824,7 +7812,7 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A8138 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7903,7 +7891,7 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A8108 */ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7982,7 +7970,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A8118 */ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8061,7 +8049,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A8148 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8138,7 +8126,7 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A8158 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8215,7 +8203,7 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A8168 */ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8294,7 +8282,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A8178 */ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8373,7 +8361,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A80A8 */ static void corkscrew_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8449,7 +8437,7 @@ static void corkscrew_rc_track_diag_left_bank( /** rct2: 0x008A80B8 */ static void corkscrew_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8525,7 +8513,7 @@ static void corkscrew_rc_track_diag_right_bank( /** rct2: 0x008A8188 */ static void corkscrew_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -8540,12 +8528,12 @@ static void corkscrew_rc_track_block_brakes( } static void corkscrew_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!is_csg_loaded()) { - corkscrew_rc_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement); + corkscrew_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); return; } diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index df2a5b8c97..b54458356d 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -21,7 +21,7 @@ /** rct2: 0x007C6FF4 */ static void flying_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -133,7 +133,7 @@ static void flying_rc_track_flat( /** rct2: 0x007C7244, 0x007C7254, 0x007C7264 */ static void flying_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->IsInverted()) @@ -154,7 +154,7 @@ static void flying_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); } else { @@ -180,7 +180,7 @@ static void flying_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -190,7 +190,7 @@ static void flying_rc_track_station( /** rct2: 0x007C7004 */ static void flying_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -350,7 +350,7 @@ static void flying_rc_track_25_deg_up( /** rct2: 0x007C7014 */ static void flying_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -432,7 +432,7 @@ static void flying_rc_track_60_deg_up( /** rct2: 0x007C7024 */ static void flying_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -592,7 +592,7 @@ static void flying_rc_track_flat_to_25_deg_up( /** rct2: 0x007C7034 */ static void flying_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -684,7 +684,7 @@ static void flying_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x007C7044 */ static void flying_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -800,7 +800,7 @@ static void flying_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x007C7054 */ static void flying_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -960,55 +960,55 @@ static void flying_rc_track_25_deg_up_to_flat( /** rct2: 0x007C7064 */ static void flying_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7074 */ static void flying_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7084 */ static void flying_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7094 */ static void flying_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C70A4 */ static void flying_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C70B4 */ static void flying_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C70C4 */ static void flying_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1377,16 +1377,16 @@ static void flying_rc_track_left_quarter_turn_5( /** rct2: 0x007C70D4 */ static void flying_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C70E4 */ static void flying_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1467,7 +1467,7 @@ static void flying_rc_track_flat_to_left_bank( /** rct2: 0x007C70F4 */ static void flying_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1548,7 +1548,7 @@ static void flying_rc_track_flat_to_right_bank( /** rct2: 0x007C7104 */ static void flying_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1629,7 +1629,7 @@ static void flying_rc_track_left_bank_to_flat( /** rct2: 0x007C7114 */ static void flying_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1710,7 +1710,7 @@ static void flying_rc_track_right_bank_to_flat( /** rct2: 0x007C7124 */ static void flying_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2080,16 +2080,16 @@ static void flying_rc_track_banked_left_quarter_turn_5( /** rct2: 0x007C7134 */ static void flying_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7144 */ static void flying_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2201,7 +2201,7 @@ static void flying_rc_track_left_bank_to_25_deg_up( /** rct2: 0x007C7154 */ static void flying_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2313,7 +2313,7 @@ static void flying_rc_track_right_bank_to_25_deg_up( /** rct2: 0x007C7164 */ static void flying_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2425,7 +2425,7 @@ static void flying_rc_track_25_deg_up_to_left_bank( /** rct2: 0x007C7174 */ static void flying_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2537,39 +2537,39 @@ static void flying_rc_track_25_deg_up_to_right_bank( /** rct2: 0x007C7184 */ static void flying_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7194 */ static void flying_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C71A4 */ static void flying_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C71B4 */ static void flying_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C71C4 */ static void flying_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2646,15 +2646,15 @@ static void flying_rc_track_left_bank( /** rct2: 0x007C71D4 */ static void flying_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C71E4 */ static void flying_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2998,7 +2998,7 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x007C71F4 */ static void flying_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3342,25 +3342,25 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x007C7204 */ static void flying_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_right_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C7214 */ static void flying_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7224 */ static void flying_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3687,7 +3687,7 @@ static void flying_rc_track_s_bend_left( /** rct2: 0x007C7234 */ static void flying_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4014,7 +4014,7 @@ static void flying_rc_track_s_bend_right( /** rct2: 0x007C7274 */ static void flying_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4253,16 +4253,16 @@ static void flying_rc_track_left_quarter_turn_3( /** rct2: 0x007C7284 */ static void flying_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7294 */ static void flying_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4507,16 +4507,16 @@ static void flying_rc_track_left_quarter_turn_3_bank( /** rct2: 0x007C72A4 */ static void flying_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C72B4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4687,7 +4687,7 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x007C72C4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4864,25 +4864,25 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x007C72D4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_right_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C72E4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7314 */ static void flying_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5104,7 +5104,7 @@ static void flying_rc_track_left_half_banked_helix_up_small( /** rct2: 0x007C7324 */ static void flying_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5326,7 +5326,7 @@ static void flying_rc_track_right_half_banked_helix_up_small( /** rct2: 0x007C7334 */ static void flying_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -5335,13 +5335,12 @@ static void flying_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C7344 */ static void flying_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -5350,13 +5349,12 @@ static void flying_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7354 */ static void flying_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5702,7 +5700,7 @@ static void flying_rc_track_left_half_banked_helix_up_large( /** rct2: 0x007C7364 */ static void flying_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6048,7 +6046,7 @@ static void flying_rc_track_right_half_banked_helix_up_large( /** rct2: 0x007C7374 */ static void flying_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -6057,13 +6055,12 @@ static void flying_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C7384 */ static void flying_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -6072,13 +6069,12 @@ static void flying_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C73B4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6161,7 +6157,7 @@ static void flying_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x007C7394 */ static void flying_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6243,23 +6239,23 @@ static void flying_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x007C73A4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_right_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C73C4 */ static void flying_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_left_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C73D4 */ static void flying_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6319,24 +6315,24 @@ static void flying_rc_track_brakes( } static void flying_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) { bolliger_mabillard_track_booster( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES_INVERTED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES_INVERTED); } else { // Should not occur, except when converting from other coaster types. - flying_rc_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement); + flying_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); } } /** rct2: 0x007C7674 */ static void flying_rc_track_left_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6521,7 +6517,7 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x007C7684 */ static void flying_rc_track_right_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6706,7 +6702,7 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x007C7694 */ static void flying_rc_track_left_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6891,7 +6887,7 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x007C76A4 */ static void flying_rc_track_right_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7076,7 +7072,7 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x007C78B4 */ static void flying_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7182,7 +7178,7 @@ static void flying_rc_track_25_deg_up_left_banked( /** rct2: 0x007C78C4 */ static void flying_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7288,7 +7284,7 @@ static void flying_rc_track_25_deg_up_right_banked( /** rct2: 0x007C73E4 */ static void flying_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7399,23 +7395,23 @@ static void flying_rc_track_on_ride_photo( /** rct2: 0x007C78D4 */ static void flying_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C78E4 */ static void flying_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7404 */ static void flying_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7729,7 +7725,7 @@ static void flying_rc_track_left_eighth_to_diag( /** rct2: 0x007C7414 */ static void flying_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8043,25 +8039,25 @@ static void flying_rc_track_right_eighth_to_diag( /** rct2: 0x007C7424 */ static void flying_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7434 */ static void flying_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + flying_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x007C7444 */ static void flying_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8376,7 +8372,7 @@ static void flying_rc_track_left_eighth_bank_to_diag( /** rct2: 0x007C7454 */ static void flying_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8691,25 +8687,25 @@ static void flying_rc_track_right_eighth_bank_to_diag( /** rct2: 0x007C7464 */ static void flying_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7474 */ static void flying_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + flying_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x007C73F4 */ static void flying_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9001,7 +8997,7 @@ static void flying_rc_track_diag_flat( /** rct2: 0x007C74A4 */ static void flying_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9293,7 +9289,7 @@ static void flying_rc_track_diag_25_deg_up( /** rct2: 0x007C7504 */ static void flying_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9529,7 +9525,7 @@ static void flying_rc_track_diag_60_deg_up( /** rct2: 0x007C7484 */ static void flying_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9821,7 +9817,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x007C74E4 */ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10057,7 +10053,7 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007C74F4 */ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10293,7 +10289,7 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x007C7494 */ static void flying_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10585,7 +10581,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x007C74D4 */ static void flying_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10821,7 +10817,7 @@ static void flying_rc_track_diag_25_deg_down( /** rct2: 0x007C7534 */ static void flying_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11057,7 +11053,7 @@ static void flying_rc_track_diag_60_deg_down( /** rct2: 0x007C74B4 */ static void flying_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11286,7 +11282,7 @@ static void flying_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x007C7514 */ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11522,7 +11518,7 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007C7524 */ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11758,7 +11754,7 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x007C74C4 */ static void flying_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11994,7 +11990,7 @@ static void flying_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x007C7564 */ static void flying_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12164,7 +12160,7 @@ static void flying_rc_track_diag_flat_to_left_bank( /** rct2: 0x007C7574 */ static void flying_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12334,7 +12330,7 @@ static void flying_rc_track_diag_flat_to_right_bank( /** rct2: 0x007C7584 */ static void flying_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12504,7 +12500,7 @@ static void flying_rc_track_diag_left_bank_to_flat( /** rct2: 0x007C7594 */ static void flying_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12674,7 +12670,7 @@ static void flying_rc_track_diag_right_bank_to_flat( /** rct2: 0x007C75C4 */ static void flying_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12843,7 +12839,7 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x007C75D4 */ static void flying_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13012,7 +13008,7 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x007C75A4 */ static void flying_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13181,7 +13177,7 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x007C75B4 */ static void flying_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13350,7 +13346,7 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x007C75E4 */ static void flying_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13512,7 +13508,7 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x007C75F4 */ static void flying_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13674,7 +13670,7 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x007C7604 */ static void flying_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13843,7 +13839,7 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007C7614 */ static void flying_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -14012,7 +14008,7 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007C7544 */ static void flying_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -14179,7 +14175,7 @@ static void flying_rc_track_diag_left_bank( /** rct2: 0x007C7554 */ static void flying_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -14346,7 +14342,7 @@ static void flying_rc_track_diag_right_bank( /** rct2: 0x007C7624 */ static void flying_rc_track_left_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14458,7 +14454,7 @@ static void flying_rc_track_left_flyer_twist_up( /** rct2: 0x007C7634 */ static void flying_rc_track_right_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14568,7 +14564,7 @@ static void flying_rc_track_right_flyer_twist_up( /** rct2: 0x007C7644 */ static void flying_rc_track_left_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14680,7 +14676,7 @@ static void flying_rc_track_left_flyer_twist_down( /** rct2: 0x007C7654 */ static void flying_rc_track_right_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14790,7 +14786,7 @@ static void flying_rc_track_right_flyer_twist_down( /** rct2: 0x007C72F4 */ static void flying_rc_track_flyer_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14920,7 +14916,7 @@ static void flying_rc_track_flyer_half_loop_up( /** rct2: 0x007C7304 */ static void flying_rc_track_flyer_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -15050,7 +15046,7 @@ static void flying_rc_track_flyer_half_loop_down( /** rct2: 0x007C7664 */ static void flying_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -15108,7 +15104,7 @@ static void flying_rc_track_block_brakes( /** rct2: 0x007C76B4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -15282,7 +15278,7 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76C4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -15462,27 +15458,27 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76D4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; flying_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C76E4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; flying_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C76F4 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -15829,7 +15825,7 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7704 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16176,27 +16172,27 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7714 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; flying_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x007C7724 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; flying_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007C7734 */ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16304,7 +16300,7 @@ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x007C7744 */ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16412,7 +16408,7 @@ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x007C7754 */ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16520,7 +16516,7 @@ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x007C7764 */ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16628,43 +16624,39 @@ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x007C7774 */ static void flying_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7784 */ static void flying_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7794 */ static void flying_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C77A4 */ static void flying_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C77B4 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16770,7 +16762,7 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x007C77C4 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16876,7 +16868,7 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x007C77F4 */ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -16982,7 +16974,7 @@ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x007C7804 */ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -17088,43 +17080,43 @@ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x007C7814 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7824 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C77D4 */ static void flying_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C77E4 */ static void flying_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7834 */ static void flying_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -17232,7 +17224,7 @@ static void flying_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x007C7844 */ static void flying_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -17340,7 +17332,7 @@ static void flying_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x007C7854 */ static void flying_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -17448,7 +17440,7 @@ static void flying_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x007C7864 */ static void flying_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -17556,34 +17548,34 @@ static void flying_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x007C7874 */ static void flying_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_right_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7884 */ static void flying_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_left_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C7894 */ static void flying_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_flat_to_right_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007C78A4 */ static void flying_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - flying_rc_track_flat_to_left_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index 45a1ca2843..38a2db9a58 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -41,7 +41,7 @@ static constexpr const uint32_t _GigaCoasterBrakeImages[NumOrthogonalDirections] /** rct2: 0x008AD674 */ static void giga_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -117,7 +117,7 @@ static void giga_rc_track_flat( } static void giga_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -143,7 +143,7 @@ static void giga_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -151,7 +151,7 @@ static void giga_rc_track_station( /** rct2: 0x008AD684 */ static void giga_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -247,7 +247,7 @@ static void giga_rc_track_25_deg_up( /** rct2: 0x008AD694 */ static void giga_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -317,7 +317,7 @@ static void giga_rc_track_60_deg_up( /** rct2: 0x008AD6A4 */ static void giga_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -413,7 +413,7 @@ static void giga_rc_track_flat_to_25_deg_up( /** rct2: 0x008AD6B4 */ static void giga_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -491,7 +491,7 @@ static void giga_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AD6C4 */ static void giga_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -569,7 +569,7 @@ static void giga_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AD6D4 */ static void giga_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasCableLift()) @@ -665,55 +665,55 @@ static void giga_rc_track_25_deg_up_to_flat( /** rct2: 0x008AD6E4 */ static void giga_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD6F4 */ static void giga_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD704 */ static void giga_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD714 */ static void giga_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD724 */ static void giga_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD734 */ static void giga_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD744 */ static void giga_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -877,16 +877,16 @@ static void giga_rc_track_left_quarter_turn_5( /** rct2: 0x008AD754 */ static void giga_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD764 */ static void giga_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -924,7 +924,7 @@ static void giga_rc_track_flat_to_left_bank( /** rct2: 0x008AD774 */ static void giga_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -962,7 +962,7 @@ static void giga_rc_track_flat_to_right_bank( /** rct2: 0x008AD784 */ static void giga_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1000,7 +1000,7 @@ static void giga_rc_track_left_bank_to_flat( /** rct2: 0x008AD794 */ static void giga_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1038,7 +1038,7 @@ static void giga_rc_track_right_bank_to_flat( /** rct2: 0x008AD7A4 */ static void giga_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1212,16 +1212,16 @@ static void giga_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AD7B4 */ static void giga_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD7C4 */ static void giga_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1266,7 +1266,7 @@ static void giga_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AD7D4 */ static void giga_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1311,7 +1311,7 @@ static void giga_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AD7E4 */ static void giga_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1356,7 +1356,7 @@ static void giga_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AD7F4 */ static void giga_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1401,39 +1401,39 @@ static void giga_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AD804 */ static void giga_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD814 */ static void giga_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD824 */ static void giga_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD834 */ static void giga_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD844 */ static void giga_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1467,15 +1467,15 @@ static void giga_rc_track_left_bank( /** rct2: 0x008AD854 */ static void giga_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AD864 */ static void giga_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1639,7 +1639,7 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AD874 */ static void giga_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1803,25 +1803,25 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AD884 */ static void giga_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AD894 */ static void giga_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD8A4 */ static void giga_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1956,7 +1956,7 @@ static void giga_rc_track_s_bend_left( /** rct2: 0x008AD8B4 */ static void giga_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2091,7 +2091,7 @@ static void giga_rc_track_s_bend_right( /** rct2: 0x008AD8F4 */ static void giga_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2194,16 +2194,16 @@ static void giga_rc_track_left_quarter_turn_3( /** rct2: 0x008AD904 */ static void giga_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD914 */ static void giga_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2315,16 +2315,16 @@ static void giga_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AD924 */ static void giga_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD934 */ static void giga_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2403,7 +2403,7 @@ static void giga_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AD944 */ static void giga_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2489,25 +2489,25 @@ static void giga_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AD954 */ static void giga_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AD964 */ static void giga_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD974 */ static void giga_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2725,7 +2725,7 @@ static void giga_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008AD984 */ static void giga_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2943,7 +2943,7 @@ static void giga_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008AD994 */ static void giga_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2952,12 +2952,12 @@ static void giga_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_half_banked_helix_up_small(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AD9A4 */ static void giga_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2966,12 +2966,12 @@ static void giga_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_half_banked_helix_up_small(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AD9B4 */ static void giga_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3313,7 +3313,7 @@ static void giga_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008AD9C4 */ static void giga_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3669,7 +3669,7 @@ static void giga_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008AD9D4 */ static void giga_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3678,12 +3678,12 @@ static void giga_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_half_banked_helix_up_large(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AD9E4 */ static void giga_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3692,12 +3692,12 @@ static void giga_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_half_banked_helix_up_large(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ADA14 */ static void giga_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3734,7 +3734,7 @@ static void giga_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008AD9F4 */ static void giga_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3771,23 +3771,23 @@ static void giga_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008ADA04 */ static void giga_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_right_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ADA24 */ static void giga_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_left_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ADA34 */ static void giga_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3823,7 +3823,7 @@ static void giga_rc_track_brakes( /** rct2: 0x008ADC84 */ static void giga_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3864,7 +3864,7 @@ static void giga_rc_track_25_deg_up_left_banked( /** rct2: 0x008ADC94 */ static void giga_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3905,7 +3905,7 @@ static void giga_rc_track_25_deg_up_right_banked( /** rct2: 0x008ADA44 */ static void giga_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3947,23 +3947,23 @@ static void giga_rc_track_on_ride_photo( /** rct2: 0x008ADCA4 */ static void giga_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADCB4 */ static void giga_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADED4 */ static void giga_rc_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4254,7 +4254,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( /** rct2: 0x008ADEE4 */ static void giga_rc_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4395,23 +4395,23 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( /** rct2: 0x008ADEF4 */ static void giga_rc_track_60_deg_down_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_flat_to_60_deg_up_long_base(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADF04 */ static void giga_rc_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_60_deg_up_to_flat_long_base(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADF14 */ static void giga_rc_track_cable_lift_hill( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4577,7 +4577,7 @@ static void giga_rc_track_cable_lift_hill( /** rct2: 0x008ADA64 */ static void giga_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4716,7 +4716,7 @@ static void giga_rc_track_left_eighth_to_diag( /** rct2: 0x008ADA74 */ static void giga_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4854,25 +4854,25 @@ static void giga_rc_track_right_eighth_to_diag( /** rct2: 0x008ADA84 */ static void giga_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADA94 */ static void giga_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + giga_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008ADAA4 */ static void giga_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5014,7 +5014,7 @@ static void giga_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008ADAB4 */ static void giga_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5156,25 +5156,25 @@ static void giga_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008ADAC4 */ static void giga_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADAD4 */ static void giga_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + giga_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008ADA54 */ static void giga_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5320,7 +5320,7 @@ static void giga_rc_track_diag_flat( /** rct2: 0x008ADB04 */ static void giga_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5466,7 +5466,7 @@ static void giga_rc_track_diag_25_deg_up( /** rct2: 0x008ADB64 */ static void giga_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5542,7 +5542,7 @@ static void giga_rc_track_diag_60_deg_up( /** rct2: 0x008ADAE4 */ static void giga_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5688,7 +5688,7 @@ static void giga_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008ADB44 */ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5764,7 +5764,7 @@ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008ADB54 */ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5840,7 +5840,7 @@ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008ADAF4 */ static void giga_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5986,7 +5986,7 @@ static void giga_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008ADB34 */ static void giga_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6132,7 +6132,7 @@ static void giga_rc_track_diag_25_deg_down( /** rct2: 0x008ADB94 */ static void giga_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6208,7 +6208,7 @@ static void giga_rc_track_diag_60_deg_down( /** rct2: 0x008ADB14 */ static void giga_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6352,7 +6352,7 @@ static void giga_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008ADB74 */ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6428,7 +6428,7 @@ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008ADB84 */ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6504,7 +6504,7 @@ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008ADB24 */ static void giga_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6650,7 +6650,7 @@ static void giga_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008ADBC4 */ static void giga_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6729,7 +6729,7 @@ static void giga_rc_track_diag_flat_to_left_bank( /** rct2: 0x008ADBD4 */ static void giga_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6808,7 +6808,7 @@ static void giga_rc_track_diag_flat_to_right_bank( /** rct2: 0x008ADBE4 */ static void giga_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6887,7 +6887,7 @@ static void giga_rc_track_diag_left_bank_to_flat( /** rct2: 0x008ADBF4 */ static void giga_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6966,7 +6966,7 @@ static void giga_rc_track_diag_right_bank_to_flat( /** rct2: 0x008ADC24 */ static void giga_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7045,7 +7045,7 @@ static void giga_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008ADC34 */ static void giga_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7124,7 +7124,7 @@ static void giga_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008ADC04 */ static void giga_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7203,7 +7203,7 @@ static void giga_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008ADC14 */ static void giga_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7282,7 +7282,7 @@ static void giga_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008ADC44 */ static void giga_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7359,7 +7359,7 @@ static void giga_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008ADC54 */ static void giga_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7436,7 +7436,7 @@ static void giga_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008ADC64 */ static void giga_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7515,7 +7515,7 @@ static void giga_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008ADC74 */ static void giga_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7594,7 +7594,7 @@ static void giga_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008ADBA4 */ static void giga_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7670,7 +7670,7 @@ static void giga_rc_track_diag_left_bank( /** rct2: 0x008ADBB4 */ static void giga_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7746,7 +7746,7 @@ static void giga_rc_track_diag_right_bank( /** rct2: 0x008ADEC4 */ static void giga_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -7769,7 +7769,7 @@ static void giga_rc_track_block_brakes( /** rct2: 0x008ADCC4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7851,7 +7851,7 @@ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ADCD4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7940,27 +7940,25 @@ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ADCE4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ADCF4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ADD04 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8130,7 +8128,7 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ADD14 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8300,27 +8298,25 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ADD24 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ADD34 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ADD44 */ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8363,7 +8359,7 @@ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008ADD54 */ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8406,7 +8402,7 @@ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008ADD64 */ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8449,7 +8445,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ADD74 */ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8492,43 +8488,39 @@ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ADD84 */ static void giga_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADD94 */ static void giga_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADDA4 */ static void giga_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADDB4 */ static void giga_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADDC4 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8569,7 +8561,7 @@ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008ADDD4 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8610,7 +8602,7 @@ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008ADE04 */ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8651,7 +8643,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008ADE14 */ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8692,43 +8684,43 @@ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008ADE24 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADE34 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADDE4 */ static void giga_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADDF4 */ static void giga_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADE44 */ static void giga_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8771,7 +8763,7 @@ static void giga_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008ADE54 */ static void giga_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8814,7 +8806,7 @@ static void giga_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008ADE64 */ static void giga_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8857,7 +8849,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008ADE74 */ static void giga_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8900,38 +8892,38 @@ static void giga_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008ADE84 */ static void giga_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_right_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADE94 */ static void giga_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_left_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADEA4 */ static void giga_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_flat_to_right_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ADEB4 */ static void giga_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - giga_rc_track_flat_to_left_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void giga_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { // These offsets could be moved to the g2.dat file when that supports offsets. diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index 2164a1ace9..9aae679082 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x0087694C */ static void heartline_twister_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -85,7 +85,7 @@ static void heartline_twister_rc_track_flat( } static void heartline_twister_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -101,7 +101,7 @@ static void heartline_twister_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -109,7 +109,7 @@ static void heartline_twister_rc_track_station( /** rct2: 0x0087695C */ static void heartline_twister_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -194,7 +194,7 @@ static void heartline_twister_rc_track_25_deg_up( /** rct2: 0x008769FC */ static void heartline_twister_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -279,7 +279,7 @@ static void heartline_twister_rc_track_60_deg_up( /** rct2: 0x0087696C */ static void heartline_twister_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -364,7 +364,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( /** rct2: 0x008769BC */ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -449,7 +449,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008769CC */ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -534,7 +534,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0087697C */ static void heartline_twister_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -619,57 +619,55 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( /** rct2: 0x0087698C */ static void heartline_twister_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00876A0C */ static void heartline_twister_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0087699C */ static void heartline_twister_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008769DC */ static void heartline_twister_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008769EC */ static void heartline_twister_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008769AC */ static void heartline_twister_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - heartline_twister_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00876A6C */ static void heartline_twister_rc_track_heartline_transfer_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -879,7 +877,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( /** rct2: 0x00876A7C */ static void heartline_twister_rc_track_heartline_transfer_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1089,7 +1087,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( /** rct2: 0x00876A4C */ static void heartline_twister_rc_track_left_heartline_roll( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1335,7 +1333,7 @@ static void heartline_twister_rc_track_left_heartline_roll( /** rct2: 0x00876A5C */ static void heartline_twister_rc_track_right_heartline_roll( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 92021bbd9a..ec54a8bb5b 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -36,7 +36,7 @@ namespace HybridRC } static void TrackFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -58,7 +58,7 @@ namespace HybridRC } static void TrackStation( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -83,7 +83,6 @@ namespace HybridRC wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - auto ride = get_ride(rideIndex); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, tileElement); @@ -93,7 +92,7 @@ namespace HybridRC } static void Track25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -123,7 +122,7 @@ namespace HybridRC } static void Track60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -178,7 +177,7 @@ namespace HybridRC } static void TrackFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -208,7 +207,7 @@ namespace HybridRC } static void Track25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -290,7 +289,7 @@ namespace HybridRC } static void Track60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -373,7 +372,7 @@ namespace HybridRC } static void Track25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -403,49 +402,49 @@ namespace HybridRC } static void Track25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -483,14 +482,14 @@ namespace HybridRC } static void Track90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegUpTo90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -535,14 +534,14 @@ namespace HybridRC } static void Track90DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpTo90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track90DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -582,7 +581,7 @@ namespace HybridRC } static void Track60DegDownTo90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -624,7 +623,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -744,15 +743,15 @@ namespace HybridRC } static void TrackRightQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -952,15 +951,15 @@ namespace HybridRC } static void TrackRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1112,7 +1111,7 @@ namespace HybridRC } static void TrackRightEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1264,23 +1263,23 @@ namespace HybridRC } static void TrackLeftEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } static void TrackDiagFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1427,7 +1426,7 @@ namespace HybridRC } static void TrackDiag25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1578,7 +1577,7 @@ namespace HybridRC } static void TrackDiag25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1729,7 +1728,7 @@ namespace HybridRC } static void TrackDiagFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1872,7 +1871,7 @@ namespace HybridRC } static void TrackDiag25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2023,7 +2022,7 @@ namespace HybridRC } static void TrackDiagFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2172,7 +2171,7 @@ namespace HybridRC } static void TrackDiag25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2315,7 +2314,7 @@ namespace HybridRC } static void TrackDiag60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2466,7 +2465,7 @@ namespace HybridRC } static void TrackDiag25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2617,7 +2616,7 @@ namespace HybridRC } static void TrackDiag60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2768,7 +2767,7 @@ namespace HybridRC } static void TrackDiag60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2919,7 +2918,7 @@ namespace HybridRC } static void TrackDiag25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3070,7 +3069,7 @@ namespace HybridRC } static void TrackDiag60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3221,7 +3220,7 @@ namespace HybridRC } static void TrackFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3260,7 +3259,7 @@ namespace HybridRC } static void TrackFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3299,21 +3298,21 @@ namespace HybridRC } static void TrackLeftBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3360,7 +3359,7 @@ namespace HybridRC } static void TrackRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3407,7 +3406,7 @@ namespace HybridRC } static void Track25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3454,7 +3453,7 @@ namespace HybridRC } static void Track25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3501,35 +3500,35 @@ namespace HybridRC } static void TrackLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftbank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3568,14 +3567,14 @@ namespace HybridRC } static void TrackRightbank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftbank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftbank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackDiagFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3665,7 +3664,7 @@ namespace HybridRC } static void TrackDiagFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3755,7 +3754,7 @@ namespace HybridRC } static void TrackDiagLeftBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3845,7 +3844,7 @@ namespace HybridRC } static void TrackDiagRightBankToflat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3935,7 +3934,7 @@ namespace HybridRC } static void TrackDiagLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4025,7 +4024,7 @@ namespace HybridRC } static void TrackDiagRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4115,7 +4114,7 @@ namespace HybridRC } static void TrackDiag25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4213,7 +4212,7 @@ namespace HybridRC } static void TrackDiag25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4311,7 +4310,7 @@ namespace HybridRC } static void TrackDiagLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4407,7 +4406,7 @@ namespace HybridRC } static void TrackDiagRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4503,7 +4502,7 @@ namespace HybridRC } static void TrackDiag25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4593,7 +4592,7 @@ namespace HybridRC } static void TrackDiag25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4683,7 +4682,7 @@ namespace HybridRC } static void TrackDiagLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4773,7 +4772,7 @@ namespace HybridRC } static void TrackDiagRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4863,7 +4862,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4995,15 +4994,15 @@ namespace HybridRC } static void TrackRightQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackBankedLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5218,15 +5217,15 @@ namespace HybridRC } static void TrackBankedRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5390,7 +5389,7 @@ namespace HybridRC } static void TrackRightEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5555,23 +5554,23 @@ namespace HybridRC } static void TrackLeftEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5679,7 +5678,7 @@ namespace HybridRC } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5787,23 +5786,23 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6003,7 +6002,7 @@ namespace HybridRC } static void TrackRightQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6203,23 +6202,23 @@ namespace HybridRC } static void TrackLeftQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn1Tile60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6267,7 +6266,7 @@ namespace HybridRC } static void TrackRightQuarterTurn1Tile60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6316,21 +6315,21 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightQuarterTurn1Tile60DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn1Tile60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftQuarterTurn1Tile60DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn1Tile90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6375,7 +6374,7 @@ namespace HybridRC } static void TrackRightQuarterTurn1Tile90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6420,21 +6419,21 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightQuarterTurn1Tile90DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn1Tile90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftQuarterTurn1Tile90DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6478,7 +6477,7 @@ namespace HybridRC } static void Track25DegUpToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6522,7 +6521,7 @@ namespace HybridRC } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6566,7 +6565,7 @@ namespace HybridRC } static void TrackRightBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6610,35 +6609,35 @@ namespace HybridRC } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6685,7 +6684,7 @@ namespace HybridRC } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6732,7 +6731,7 @@ namespace HybridRC } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6779,7 +6778,7 @@ namespace HybridRC } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6826,35 +6825,35 @@ namespace HybridRC } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegUpLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6895,7 +6894,7 @@ namespace HybridRC } static void Track25DegUpRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6936,21 +6935,21 @@ namespace HybridRC } static void Track25DegDownLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpRightBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpLeftBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6994,7 +6993,7 @@ namespace HybridRC } static void TrackFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7038,7 +7037,7 @@ namespace HybridRC } static void TrackLeftBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7082,7 +7081,7 @@ namespace HybridRC } static void TrackRightBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7126,35 +7125,35 @@ namespace HybridRC } static void TrackFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7271,7 +7270,7 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7388,23 +7387,23 @@ namespace HybridRC } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftBankedQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7622,7 +7621,7 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn5Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7840,23 +7839,23 @@ namespace HybridRC } static void TrackLeftBankedQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightBankedQuarterTurn5Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn5Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackSBendLeft( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8010,7 +8009,7 @@ namespace HybridRC } static void TrackSBendRight( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8164,7 +8163,7 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8449,7 +8448,7 @@ namespace HybridRC } static void TrackRightHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8734,7 +8733,7 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -8743,11 +8742,11 @@ namespace HybridRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightHalfBankedHelixUpSmall(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -8756,11 +8755,11 @@ namespace HybridRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpSmall(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9181,7 +9180,7 @@ namespace HybridRC } static void TrackRightHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9602,7 +9601,7 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -9611,11 +9610,11 @@ namespace HybridRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightHalfBankedHelixUpLarge(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -9624,11 +9623,11 @@ namespace HybridRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpLarge(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9773,7 +9772,7 @@ namespace HybridRC } static void TrackRightBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9918,21 +9917,21 @@ namespace HybridRC } static void TrackLeftBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10066,14 +10065,14 @@ namespace HybridRC } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, rideIndex, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, tileElement); } static void Trackbrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { PaintAddImageAsParentRotated( @@ -10086,7 +10085,7 @@ namespace HybridRC } static void TrackOnRidePhoto( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { PaintAddImageAsParentRotated(session, direction, IMAGE_TYPE_REMAP | SPR_STATION_BASE_D, 0, 0, 32, 32, 1, height); @@ -10101,7 +10100,7 @@ namespace HybridRC } static void TrackFlatTo60DegUpLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10239,7 +10238,7 @@ namespace HybridRC } static void Track60DegUpToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10377,21 +10376,21 @@ namespace HybridRC } static void TrackFlatTo60DegDownLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpToFlatLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDownToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatTo60DegUpLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackBlockBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { PaintAddImageAsParentRotated( @@ -10404,7 +10403,7 @@ namespace HybridRC } static void Trackbooster( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { PaintAddImageAsParentRotated( @@ -10417,7 +10416,7 @@ namespace HybridRC } static void Trackpowered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { PaintAddImageAsParentRotated( @@ -10438,7 +10437,7 @@ namespace HybridRC } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10549,7 +10548,7 @@ namespace HybridRC } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10660,7 +10659,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10771,7 +10770,7 @@ namespace HybridRC } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 3890fb9aa5..2343800381 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x00890CB4 */ static void inverted_hairpin_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -82,7 +82,7 @@ static void inverted_hairpin_rc_track_flat( /** rct2: 0x00890D84, 0x00890D94, 0x00890DA4 */ static void inverted_hairpin_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -101,7 +101,7 @@ static void inverted_hairpin_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -109,7 +109,7 @@ static void inverted_hairpin_rc_track_station( /** rct2: 0x00890CC4 */ static void inverted_hairpin_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -203,7 +203,7 @@ static void inverted_hairpin_rc_track_25_deg_up( /** rct2: 0x00890CD4 */ static void inverted_hairpin_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -273,7 +273,7 @@ static void inverted_hairpin_rc_track_60_deg_up( /** rct2: 0x00890CE4 */ static void inverted_hairpin_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -367,7 +367,7 @@ static void inverted_hairpin_rc_track_flat_to_25_deg_up( /** rct2: 0x00890CF4 */ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -449,7 +449,7 @@ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x00890D04 */ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -555,7 +555,7 @@ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x00890D14 */ static void inverted_hairpin_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -649,57 +649,55 @@ static void inverted_hairpin_rc_track_25_deg_up_to_flat( /** rct2: 0x00890D24 */ static void inverted_hairpin_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890D34 */ static void inverted_hairpin_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890D44 */ static void inverted_hairpin_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890D54 */ static void inverted_hairpin_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890D64 */ static void inverted_hairpin_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890D74 */ static void inverted_hairpin_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890DB4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -819,16 +817,16 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3( /** rct2: 0x00890DC4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_hairpin_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_hairpin_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00890DD4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -915,7 +913,7 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x00890DE4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1002,27 +1000,27 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x00890DF4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00890E04 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00890E64 */ static void inverted_hairpin_rc_track_left_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1072,15 +1070,15 @@ static void inverted_hairpin_rc_track_left_quarter_turn_1( /** rct2: 0x00890E74 */ static void inverted_hairpin_rc_track_right_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_left_quarter_turn_1(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_hairpin_rc_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00890E24 */ static void inverted_hairpin_rc_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -1162,7 +1160,7 @@ static void inverted_hairpin_rc_track_flat_to_60_deg_up( /** rct2: 0x00890E34 */ static void inverted_hairpin_rc_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -1265,23 +1263,23 @@ static void inverted_hairpin_rc_track_60_deg_up_to_flat( /** rct2: 0x00890E44 */ static void inverted_hairpin_rc_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_60_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890E54 */ static void inverted_hairpin_rc_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_hairpin_rc_track_flat_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00890E14 */ static void inverted_hairpin_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1314,7 +1312,7 @@ static void inverted_hairpin_rc_track_brakes( /** rct2: 0x00890E84 */ static void inverted_hairpin_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index 0b92ceea7c..accdbcfc97 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008B0460 */ static void inverted_impulse_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -53,7 +53,7 @@ static void inverted_impulse_rc_track_flat( /** rct2: 0x008B0470, 0x008B0480, 0x008B0490 */ static void inverted_impulse_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -72,7 +72,7 @@ static void inverted_impulse_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -80,7 +80,7 @@ static void inverted_impulse_rc_track_station( /** rct2: 0x008B04A0 */ static void inverted_impulse_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -145,7 +145,7 @@ static void inverted_impulse_rc_track_25_deg_up( /** rct2: 0x008B04B0 */ static void inverted_impulse_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -186,7 +186,7 @@ static void inverted_impulse_rc_track_60_deg_up( /** rct2: 0x008B04C0 */ static void inverted_impulse_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -248,7 +248,7 @@ static void inverted_impulse_rc_track_flat_to_25_deg_up( /** rct2: 0x008B04D0 */ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -295,7 +295,7 @@ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008B04E0 */ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -342,7 +342,7 @@ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008B04F0 */ static void inverted_impulse_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -404,57 +404,55 @@ static void inverted_impulse_rc_track_25_deg_up_to_flat( /** rct2: 0x008B0500 */ static void inverted_impulse_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0510 */ static void inverted_impulse_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0520 */ static void inverted_impulse_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0530 */ static void inverted_impulse_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0540 */ static void inverted_impulse_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0550 */ static void inverted_impulse_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B05A0 */ static void inverted_impulse_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -495,15 +493,15 @@ static void inverted_impulse_rc_track_90_deg_up( /** rct2: 0x008B05B0 */ static void inverted_impulse_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_90_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0560 */ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -548,16 +546,15 @@ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008B0570 */ static void inverted_impulse_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_impulse_rc_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0580 */ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -599,7 +596,7 @@ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008B0590 */ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -643,7 +640,7 @@ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008B05C0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -693,7 +690,7 @@ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008B05D0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -743,20 +740,20 @@ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008B05E0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008B05F0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index e1fc2654d1..ba50a35c7c 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A92E8 */ static void inverted_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -73,7 +73,7 @@ static void inverted_rc_track_flat( /** rct2: 0x008A9558, 0x008A9568, 0x008A9578 */ static void inverted_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -92,7 +92,7 @@ static void inverted_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -100,7 +100,7 @@ static void inverted_rc_track_station( /** rct2: 0x008A92F8 */ static void inverted_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -194,7 +194,7 @@ static void inverted_rc_track_25_deg_up( /** rct2: 0x008A9308 */ static void inverted_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -235,7 +235,7 @@ static void inverted_rc_track_60_deg_up( /** rct2: 0x008A9318 */ static void inverted_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -329,7 +329,7 @@ static void inverted_rc_track_flat_to_25_deg_up( /** rct2: 0x008A9328 */ static void inverted_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -376,7 +376,7 @@ static void inverted_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A9338 */ static void inverted_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -447,7 +447,7 @@ static void inverted_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A9348 */ static void inverted_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -541,55 +541,55 @@ static void inverted_rc_track_25_deg_up_to_flat( /** rct2: 0x008A9358 */ static void inverted_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9368 */ static void inverted_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9378 */ static void inverted_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9388 */ static void inverted_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9398 */ static void inverted_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A93A8 */ static void inverted_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A93B8 */ static void inverted_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -769,16 +769,16 @@ static void inverted_rc_track_left_quarter_turn_5( /** rct2: 0x008A93C8 */ static void inverted_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A93D8 */ static void inverted_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -820,7 +820,7 @@ static void inverted_rc_track_flat_to_left_bank( /** rct2: 0x008A93E8 */ static void inverted_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -862,7 +862,7 @@ static void inverted_rc_track_flat_to_right_bank( /** rct2: 0x008A93F8 */ static void inverted_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -904,7 +904,7 @@ static void inverted_rc_track_left_bank_to_flat( /** rct2: 0x008A9408 */ static void inverted_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -946,7 +946,7 @@ static void inverted_rc_track_right_bank_to_flat( /** rct2: 0x008A9418 */ static void inverted_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1126,16 +1126,16 @@ static void inverted_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A9428 */ static void inverted_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A9438 */ static void inverted_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1202,7 +1202,7 @@ static void inverted_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A9448 */ static void inverted_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1269,7 +1269,7 @@ static void inverted_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A9458 */ static void inverted_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1336,7 +1336,7 @@ static void inverted_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A9468 */ static void inverted_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1403,39 +1403,39 @@ static void inverted_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A9478 */ static void inverted_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9488 */ static void inverted_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9498 */ static void inverted_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A94A8 */ static void inverted_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A94B8 */ static void inverted_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1477,15 +1477,15 @@ static void inverted_rc_track_left_bank( /** rct2: 0x008A94C8 */ static void inverted_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A94D8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1650,7 +1650,7 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A94E8 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1815,27 +1815,25 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A94F8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A9508 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A9518 */ static void inverted_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2006,7 +2004,7 @@ static void inverted_rc_track_s_bend_left( /** rct2: 0x008A9528 */ static void inverted_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2177,7 +2175,7 @@ static void inverted_rc_track_s_bend_right( /** rct2: 0x008A9538 */ static void inverted_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2484,7 +2482,7 @@ static void inverted_rc_track_left_vertical_loop( /** rct2: 0x008A9548 */ static void inverted_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2791,7 +2789,7 @@ static void inverted_rc_track_right_vertical_loop( /** rct2: 0x008A9588 */ static void inverted_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2910,16 +2908,16 @@ static void inverted_rc_track_left_quarter_turn_3( /** rct2: 0x008A9598 */ static void inverted_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A95A8 */ static void inverted_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3039,16 +3037,16 @@ static void inverted_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A95B8 */ static void inverted_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A95C8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3135,7 +3133,7 @@ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A95D8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3222,27 +3220,25 @@ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A95E8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A95F8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A9608 */ static void inverted_rc_track_left_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3351,7 +3347,7 @@ static void inverted_rc_track_left_twist_down_to_up( /** rct2: 0x008A9618 */ static void inverted_rc_track_right_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3460,7 +3456,7 @@ static void inverted_rc_track_right_twist_down_to_up( /** rct2: 0x008A9628 */ static void inverted_rc_track_left_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3569,7 +3565,7 @@ static void inverted_rc_track_left_twist_up_to_down( /** rct2: 0x008A9638 */ static void inverted_rc_track_right_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3678,7 +3674,7 @@ static void inverted_rc_track_right_twist_up_to_down( /** rct2: 0x008A9648 */ static void inverted_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3831,15 +3827,15 @@ static void inverted_rc_track_half_loop_up( /** rct2: 0x008A9658 */ static void inverted_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_half_loop_up(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A9668 */ static void inverted_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3957,7 +3953,7 @@ static void inverted_rc_track_left_corkscrew_up( /** rct2: 0x008A9678 */ static void inverted_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4075,23 +4071,23 @@ static void inverted_rc_track_right_corkscrew_up( /** rct2: 0x008A9688 */ static void inverted_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_right_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A9698 */ static void inverted_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A96D8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4128,7 +4124,7 @@ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A96B8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4166,25 +4162,23 @@ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A96C8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A96E8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A96A8 */ static void inverted_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4216,7 +4210,7 @@ static void inverted_rc_track_brakes( /** rct2: 0x008A96F8 */ static void inverted_rc_track_left_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4401,7 +4395,7 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x008A9708 */ static void inverted_rc_track_right_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4586,7 +4580,7 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x008A9718 */ static void inverted_rc_track_left_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4771,7 +4765,7 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x008A9728 */ static void inverted_rc_track_right_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4956,7 +4950,7 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x008A9A38 */ static void inverted_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5021,7 +5015,7 @@ static void inverted_rc_track_25_deg_up_left_banked( /** rct2: 0x008A9A48 */ static void inverted_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5086,7 +5080,7 @@ static void inverted_rc_track_25_deg_up_right_banked( /** rct2: 0x008A9738 */ static void inverted_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5132,23 +5126,23 @@ static void inverted_rc_track_on_ride_photo( /** rct2: 0x008A9A58 */ static void inverted_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9A68 */ static void inverted_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9748 */ static void inverted_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5311,7 +5305,7 @@ static void inverted_rc_track_left_eighth_to_diag( /** rct2: 0x008A9758 */ static void inverted_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5474,25 +5468,25 @@ static void inverted_rc_track_right_eighth_to_diag( /** rct2: 0x008A9768 */ static void inverted_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9778 */ static void inverted_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A9938 */ static void inverted_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5655,7 +5649,7 @@ static void inverted_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A9948 */ static void inverted_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5818,25 +5812,25 @@ static void inverted_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A9958 */ static void inverted_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9968 */ static void inverted_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A9788 */ static void inverted_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5975,7 +5969,7 @@ static void inverted_rc_track_diag_flat( /** rct2: 0x008A97B8 */ static void inverted_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6114,7 +6108,7 @@ static void inverted_rc_track_diag_25_deg_up( /** rct2: 0x008A9818 */ static void inverted_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6197,7 +6191,7 @@ static void inverted_rc_track_diag_60_deg_up( /** rct2: 0x008A9798 */ static void inverted_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6336,7 +6330,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A97F8 */ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6419,7 +6413,7 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A9808 */ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6502,7 +6496,7 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A97A8 */ static void inverted_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6641,7 +6635,7 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A97E8 */ static void inverted_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6780,7 +6774,7 @@ static void inverted_rc_track_diag_25_deg_down( /** rct2: 0x008A9848 */ static void inverted_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6863,7 +6857,7 @@ static void inverted_rc_track_diag_60_deg_down( /** rct2: 0x008A97C8 */ static void inverted_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6999,7 +6993,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A9828 */ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7082,7 +7076,7 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A9838 */ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7165,7 +7159,7 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A97D8 */ static void inverted_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7304,7 +7298,7 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A9878 */ static void inverted_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7388,7 +7382,7 @@ static void inverted_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A9888 */ static void inverted_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7472,7 +7466,7 @@ static void inverted_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A9898 */ static void inverted_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7556,7 +7550,7 @@ static void inverted_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A98A8 */ static void inverted_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7640,7 +7634,7 @@ static void inverted_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A98D8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7723,7 +7717,7 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A98E8 */ static void inverted_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7806,7 +7800,7 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A98B8 */ static void inverted_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7889,7 +7883,7 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A98C8 */ static void inverted_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7972,7 +7966,7 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A98F8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8052,7 +8046,7 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A9908 */ static void inverted_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8132,7 +8126,7 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A9918 */ static void inverted_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8215,7 +8209,7 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A9928 */ static void inverted_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8298,7 +8292,7 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A9858 */ static void inverted_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8382,7 +8376,7 @@ static void inverted_rc_track_diag_left_bank( /** rct2: 0x008A9868 */ static void inverted_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8466,7 +8460,7 @@ static void inverted_rc_track_diag_right_bank( /** rct2: 0x008A9978 */ static void inverted_rc_track_left_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8695,7 +8689,7 @@ static void inverted_rc_track_left_large_half_loop_up( /** rct2: 0x008A9988 */ static void inverted_rc_track_right_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8924,23 +8918,23 @@ static void inverted_rc_track_right_large_half_loop_up( /** rct2: 0x008A9998 */ static void inverted_rc_track_right_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_right_large_half_loop_up(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + inverted_rc_track_right_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A99A8 */ static void inverted_rc_track_left_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_large_half_loop_up(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + inverted_rc_track_left_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A96A8 */ static void inverted_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8972,7 +8966,7 @@ static void inverted_rc_track_block_brakes( /** rct2: 0x008A9A78 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9059,7 +9053,7 @@ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A9A88 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9146,27 +9140,27 @@ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A9A98 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A9AA8 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A9BB8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9331,7 +9325,7 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A9BC8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9496,27 +9490,27 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A9BD8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A9BE8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A9AB8 */ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9581,7 +9575,7 @@ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A9AC8 */ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9646,7 +9640,7 @@ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A9AD8 */ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9711,7 +9705,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A9AE8 */ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9776,43 +9770,43 @@ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A9AF8 */ static void inverted_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B08 */ static void inverted_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B18 */ static void inverted_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B28 */ static void inverted_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B38 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9877,7 +9871,7 @@ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A9B48 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9942,7 +9936,7 @@ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A9B58 */ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10007,7 +10001,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A9B68 */ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10072,43 +10066,43 @@ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A9B78 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B88 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9B98 */ static void inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9BA8 */ static void inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A99B8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10173,7 +10167,7 @@ static void inverted_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A99C8 */ static void inverted_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10238,7 +10232,7 @@ static void inverted_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A99D8 */ static void inverted_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10303,7 +10297,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A99E8 */ static void inverted_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10368,38 +10362,34 @@ static void inverted_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A99F8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_right_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9A08 */ static void inverted_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_left_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9A18 */ static void inverted_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A9A28 */ static void inverted_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - inverted_rc_track_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index c78eed4ea0..2b1076ad99 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -1620,7 +1620,7 @@ static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down_to_25_de // clang-format on void junior_rc_paint_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_flat[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1640,7 +1640,7 @@ void junior_rc_paint_track_flat( } void junior_rc_paint_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, uint8_t rideType) { uint32_t imageId; @@ -1691,14 +1691,14 @@ void junior_rc_paint_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } void junior_rc_paint_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1720,7 +1720,7 @@ void junior_rc_paint_track_25_deg_up( } void junior_rc_paint_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_flat_to_25_deg_up[EnumValue(chainType)][direction] @@ -1749,7 +1749,7 @@ void junior_rc_paint_track_flat_to_25_deg_up( } void junior_rc_paint_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_25_deg_up_to_flat[EnumValue(chainType)][direction] @@ -1797,7 +1797,7 @@ static constexpr const int8_t junior_rc_track_right_quarter_turn_5_tiles_support }; static void junior_rc_right_quarter_turn_5_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_5_tiles_paint( @@ -1877,19 +1877,18 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn /* rct2: 0x0051917A */ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; - junior_rc_right_quarter_turn_5_tiles_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + junior_rc_right_quarter_turn_5_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** * rct2: 0x008AAFC0, 0x00521593, 0x005216A1, 0x005217AF, 0x00521884 */ static void junior_rc_flat_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -1937,7 +1936,7 @@ static void junior_rc_flat_to_left_bank_paint_setup( * rct2: 0x008AAFD0, 0x00521959, 0x00521A2E, 0x00521B03, 0x00521C11 */ static void junior_rc_flat_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -1982,17 +1981,17 @@ static void junior_rc_flat_to_right_bank_paint_setup( } static void junior_rc_left_bank_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_flat_to_right_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_flat_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void junior_rc_right_bank_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_flat_to_left_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_flat_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static constexpr const CoordsXY junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { @@ -2059,7 +2058,7 @@ static constexpr const CoordsXYZ junior_rc_banked_right_quarter_turn_5_tiles_bou /* rct2: 0x008AB010, 0x0052304C */ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t thickness = 1; @@ -2153,19 +2152,19 @@ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( /* rct2: 0x008AB000 */ static void junior_rc_banked_left_quarter_turn_5_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** * rct2: 0x008AB020, 0x00522073, 0x00522182, 0x00522291, 0x00522367 */ static void junior_rc_left_bank_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -2225,7 +2224,7 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup( * rct2: 0x008AB030, 0x0052243D, 0x00522513, 0x005225E9, 0x005226F8 */ static void junior_rc_right_bank_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -2285,7 +2284,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup( * rct2: 0x008AB040, 0x00522807, 0x0052291A, 0x00522A2D, 0x00522B07 */ static void junior_rc_25_deg_up_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -2346,7 +2345,7 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup( * rct2: 0x008AB050, 0x00522BE1, 0x00522CBB, 0x00522D95, 0x00522EA8 */ static void junior_rc_25_deg_up_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -2407,40 +2406,40 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup( * rct2: 0x008AB060 */ static void junior_rc_left_bank_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_25_deg_up_to_right_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** * rct2: 0x008AB070 */ static void junior_rc_right_bank_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_25_deg_up_to_left_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** * rct2: 0x008AB080 */ static void junior_rc_25_deg_down_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_right_bank_to_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** * rct2: 0x008AB090 */ static void junior_rc_25_deg_down_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_left_bank_to_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_left_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static constexpr const CoordsXYZ junior_rc_left_bank_bound_lengths[4] = { @@ -2461,7 +2460,7 @@ static constexpr const CoordsXY junior_rc_left_bank_bound_offsets[4] = { * rct2: 0x008AB0A0, 0x00521D1F, 0x00521DF4, 0x00521EC9, 0x00521F9E */ static void junior_rc_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -2496,14 +2495,14 @@ static void junior_rc_left_bank_paint_setup( * rct2: 0x008AB0B0 */ static void junior_rc_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_left_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( @@ -2583,7 +2582,7 @@ void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( } void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( @@ -2664,49 +2663,49 @@ void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( /* rct2: 0x008AAE10, 0x00519D88, 0x00519DAC, 0x00519DD0, 0x00519DF4 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x008AAE20, 0x00519E18, 0x0051A148, 0x0051A452, 0x0051A738 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x008AAE30, 0x0051AA42, 0x0051AA68, 0x0051AA8C, 0x0051AAB0 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( - session, rideIndex, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) & 3, height, + session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) & 3, height, tileElement); } /* rct2: 0x008AAE40, 0x0051AAD4, 0x0051AE04, 0x0051B10E, 0x0051B3F4 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( - session, rideIndex, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction - 1) & 3, height, + session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction - 1) & 3, height, tileElement); } /* rct2: 0x008AAE50, 0x0051B6FE, 0x0051B946, 0x0051BB8E, 0x0051BBA8 */ static void junior_rc_s_bend_left_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -2812,7 +2811,7 @@ static void junior_rc_s_bend_left_paint_setup( /* rct2: 0x008AAE60, 0x0051BBC0, 0x0051BE06, 0x0051C04E, 0x0051C068 */ static void junior_rc_s_bend_right_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -2918,7 +2917,7 @@ static void junior_rc_s_bend_right_paint_setup( /** rct2: 0x008AAEB0, 0x0051C0E0, 0x0051C2C1, 0x0051C47F, 0x0051C61D */ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_3_tiles_paint( @@ -2957,12 +2956,11 @@ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( /** rct2: 0x008AAEA0 */ static void junior_rc_left_quarter_turn_3_tiles_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - junior_rc_right_quarter_turn_3_tiles_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + junior_rc_right_quarter_turn_3_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static constexpr const CoordsXY junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { @@ -3013,7 +3011,7 @@ static constexpr const CoordsXYZ junior_rc_right_quarter_turn_3_tiles_bank_offse /** rct2: 0x008AA0D0, 0x00523EA0, 0x005240CC, 0x0052430F, 0x00524500*/ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t thickness[4][4] = { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 26, 1, 1, 26 }, { 1, 1, 1, 1 } }; @@ -3064,7 +3062,7 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( } void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = 0; @@ -3143,7 +3141,7 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( } void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t imageId = 0; @@ -3223,33 +3221,33 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( /** rct2: 0x008AA0C0 */ static void junior_rc_left_quarter_turn_3_tiles_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AAED0, 0x0051C83C, 0x0051C9EC, 0x0051CB76, 0x0051CCDC*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAEF0, 0x0051CEC8, 0x0051D078, 0x0051D202, 0x0051D368*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } @@ -3257,27 +3255,27 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_3_tiles_to_right_turn /** rct2: 0x008AAEC0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AAEE0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AB0F0, 0x0052B3A4, 0x0052B5F8, 0x0052B863, 0x0052BA78 */ static void junior_rc_right_half_banked_helix_up_small_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3345,7 +3343,7 @@ static void junior_rc_right_half_banked_helix_up_small_paint_setup( /** rct2: 0x008AB110, 0x0052BD80, 0x0052BFD4, 0x0052C23B, 0x0052C450 */ static void junior_rc_right_half_banked_helix_down_small_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3413,7 +3411,7 @@ static void junior_rc_right_half_banked_helix_down_small_paint_setup( /** rct2: 0x008AB0E0 */ static void junior_rc_left_half_banked_helix_up_small_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence > 3) @@ -3424,12 +3422,12 @@ static void junior_rc_left_half_banked_helix_up_small_paint_setup( } trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_down_small_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AB100 */ static void junior_rc_left_half_banked_helix_down_small_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence > 3) @@ -3440,12 +3438,12 @@ static void junior_rc_left_half_banked_helix_down_small_paint_setup( } trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_up_small_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AB130, 0x0052C7BC, 0x0052CB6B, 0x0052CF32, 0x0052D2B3 */ static void junior_rc_right_half_banked_helix_up_large_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3531,7 +3529,7 @@ static void junior_rc_right_half_banked_helix_up_large_paint_setup( /** rct2: 0x008AB150, 0x0052D778, 0x0052DB27, 0x0052DEEA, 0x0052E26B */ static void junior_rc_right_half_banked_helix_down_large_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3617,7 +3615,7 @@ static void junior_rc_right_half_banked_helix_down_large_paint_setup( /** rct2: 0x008AB120 */ static void junior_rc_left_half_banked_helix_up_large_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence > 6) @@ -3628,12 +3626,12 @@ static void junior_rc_left_half_banked_helix_up_large_paint_setup( } trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_down_large_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x008AB140 */ static void junior_rc_left_half_banked_helix_down_large_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence > 6) @@ -3644,14 +3642,14 @@ static void junior_rc_left_half_banked_helix_down_large_paint_setup( } trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_up_large_paint_setup( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** * rct2: 0x008AAF00, 0x0051851C, 0x005185D8 */ static void junior_rc_brake_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -3685,7 +3683,7 @@ static void junior_rc_brake_paint_setup( * rct2: 0x008AB280, 0x00518694, 0x00518759 */ static void junior_rc_block_brake_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id; @@ -3719,7 +3717,7 @@ static void junior_rc_block_brake_paint_setup( /** rct2: 0x008AAF80 */ static void junior_rc_left_eighth_to_diag_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -3785,7 +3783,7 @@ static void junior_rc_left_eighth_to_diag_paint_setup( /** rct2: 0x008AAF90 */ static void junior_rc_right_eighth_to_diag_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -3851,22 +3849,22 @@ static void junior_rc_right_eighth_to_diag_paint_setup( /** rct2: 0x008AAFA0 */ static void junior_rc_left_eighth_to_orthogonal_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_right_eighth_to_diag_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AAFB0 */ static void junior_rc_right_eighth_to_orthogonal_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_left_eighth_to_diag_paint_setup(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + junior_rc_left_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static constexpr const CoordsXY junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { @@ -3952,7 +3950,7 @@ static constexpr const int8_t junior_rc_left_eighth_to_diag_bank_thickness[4][4] /** rct2: 0x008AB160 */ static void junior_rc_left_eighth_to_diag_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -4099,7 +4097,7 @@ static constexpr const int8_t junior_rc_right_eighth_to_diag_bank_thickness[4][4 /** rct2: 0x008AB170 */ static void junior_rc_right_eighth_to_diag_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -4165,23 +4163,22 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup( /** rct2: 0x008AB180 */ static void junior_rc_left_eighth_to_orthogonal_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_right_eighth_to_diag_bank_paint_setup( - session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AB190 */ static void junior_rc_right_eighth_to_orthogonal_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_left_eighth_to_diag_bank_paint_setup(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + junior_rc_left_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static constexpr const int32_t junior_rc_diag_blocked_segments[] = { SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, @@ -4192,7 +4189,7 @@ static constexpr const int32_t junior_rc_diag_blocked_segments[] = { SEGMENT_C4 static constexpr const uint8_t junior_rc_diag_support_segment[] = { 1, 0, 2, 3 }; void junior_rc_paint_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4212,7 +4209,7 @@ void junior_rc_paint_track_diag_flat( } void junior_rc_paint_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4232,7 +4229,7 @@ void junior_rc_paint_track_diag_25_deg_up( } void junior_rc_paint_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4253,7 +4250,7 @@ void junior_rc_paint_track_diag_flat_to_25_deg_up( } void junior_rc_paint_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead @@ -4277,7 +4274,7 @@ void junior_rc_paint_track_diag_flat_to_60_deg_up( } void junior_rc_paint_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4298,7 +4295,7 @@ void junior_rc_paint_track_diag_25_deg_up_to_flat( } void junior_rc_paint_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead @@ -4322,7 +4319,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_flat( } void junior_rc_paint_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4343,7 +4340,7 @@ void junior_rc_paint_track_diag_25_deg_down( } void junior_rc_paint_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4364,7 +4361,7 @@ void junior_rc_paint_track_diag_flat_to_25_deg_down( } void junior_rc_paint_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead @@ -4388,7 +4385,7 @@ void junior_rc_paint_track_diag_flat_to_60_deg_down( } void junior_rc_paint_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4409,7 +4406,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_flat( } void junior_rc_paint_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead @@ -4434,124 +4431,124 @@ void junior_rc_paint_track_diag_60_deg_down_to_flat( /** rct2: 0x008AAF10 */ static void junior_rc_diag_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF40 */ static void junior_rc_diag_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF20 */ static void junior_rc_diag_flat_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_flat_to_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF30 */ static void junior_rc_diag_25_deg_up_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_up_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF70 */ static void junior_rc_diag_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF50 */ static void junior_rc_diag_flat_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_flat_to_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF60 */ static void junior_rc_diag_25_deg_down_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AB1C0 */ static void junior_rc_diag_flat_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4578,7 +4575,7 @@ static void junior_rc_diag_flat_to_left_bank_paint_setup( /** rct2: 0x008AB1D0 */ static void junior_rc_diag_flat_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4605,7 +4602,7 @@ static void junior_rc_diag_flat_to_right_bank_paint_setup( /** rct2: 0x008AB1E0 */ static void junior_rc_diag_left_bank_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4632,7 +4629,7 @@ static void junior_rc_diag_left_bank_to_flat_paint_setup( /** rct2: 0x008AB1F0 */ static void junior_rc_diag_right_bank_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4659,7 +4656,7 @@ static void junior_rc_diag_right_bank_to_flat_paint_setup( /** rct2: 0x008AB220 */ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4686,7 +4683,7 @@ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( /** rct2: 0x008AB230 */ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4713,7 +4710,7 @@ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( /** rct2: 0x008AB200 */ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4740,7 +4737,7 @@ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( /** rct2: 0x008AB210 */ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4767,7 +4764,7 @@ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( /** rct2: 0x008AB200 */ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4794,7 +4791,7 @@ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( /** rct2: 0x008AB210 */ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4821,7 +4818,7 @@ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( /** rct2: 0x008AB220 */ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4848,7 +4845,7 @@ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( /** rct2: 0x008AB230 */ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_diag_tiles_paint( @@ -4889,7 +4886,7 @@ static constexpr const CoordsXYZ junior_rc_diag_right_bank_bound_offsets[4] = { /** rct2: 0x008AB1A0 */ static void junior_rc_diag_left_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t thickness = direction == 0 ? 0 : 1; @@ -4912,7 +4909,7 @@ static void junior_rc_diag_left_bank_paint_setup( /** rct2: 0x008AB1B0 */ static void junior_rc_diag_right_bank_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t thickness = direction == 2 ? 0 : 1; @@ -4957,7 +4954,7 @@ static constexpr const CoordsXY junior_rc_60_deg_up_bound_lengths[4] = { }; void junior_rc_paint_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5000,20 +4997,20 @@ void junior_rc_paint_track_60_deg_up( } static void junior_rc_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_60_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { @@ -5033,7 +5030,7 @@ static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4 }; void junior_rc_paint_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5095,24 +5092,24 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( } static void junior_rc_25_deg_up_to_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_60_deg_down_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_25_deg_up_to_60_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } void junior_rc_paint_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5173,24 +5170,24 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( } static void junior_rc_60_deg_up_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_25_deg_down_to_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_60_deg_up_to_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_60_deg_up_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } void junior_rc_paint_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5210,7 +5207,7 @@ void junior_rc_paint_track_diag_60_deg_up( } void junior_rc_paint_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5231,7 +5228,7 @@ void junior_rc_paint_track_diag_60_deg_down( } void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5252,7 +5249,7 @@ void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( } void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { if (direction == 1 && trackSequence == 3) @@ -5284,7 +5281,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( } void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { if (direction == 3 && trackSequence == 0) @@ -5316,7 +5313,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( } void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5337,62 +5334,62 @@ void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( } static void junior_rc_diag_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_25_deg_up_to_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_up_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_25_deg_down_to_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } @@ -5427,7 +5424,7 @@ static constexpr const CoordsXY junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = }; static void junior_rc_flat_to_60_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5489,14 +5486,14 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( } static void junior_rc_60_deg_down_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_flat_to_60_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_flat_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void junior_rc_60_deg_up_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5557,90 +5554,90 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( } static void junior_rc_flat_to_60_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_60_deg_up_to_flat_paint_setup(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_60_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /* rct2: 0x00518394 */ static void junior_rc_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00515629, 0x00514D22, 0x005151B9 */ static void paint_junior_rc_station_track( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_paint_station(session, rideIndex, trackSequence, direction, height, tileElement, RIDE_TYPE_JUNIOR_ROLLER_COASTER); + junior_rc_paint_station(session, ride, trackSequence, direction, height, tileElement, RIDE_TYPE_JUNIOR_ROLLER_COASTER); } /* rct2: 0x0051881E */ static void junior_rc_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00518B42 */ static void junior_rc_flat_to_25_deg_up_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00518E56 */ static void junior_rc_25_deg_up_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x005189B0 */ static void junior_rc_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /* rct2: 0x00518FE8 */ static void junior_rc_flat_to_25_deg_down_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_25_deg_up_to_flat_paint_setup(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_25_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /* rct2: 0x00518CCC */ static void junior_rc_25_deg_down_to_flat_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_flat_to_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_flat_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void junior_rc_booster_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction & 1) @@ -5670,7 +5667,7 @@ static void junior_rc_booster_paint_setup( } static void junior_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = junior_rc_track_pieces_flat[0][direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/JuniorRollerCoaster.h index 76536e5a88..8da0ddbddf 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.h @@ -20,96 +20,98 @@ enum class JuniorRcChainType : uint8_t ChainLift, }; +struct Ride; + void junior_rc_paint_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, uint8_t rideType); void junior_rc_paint_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, uint16_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TileElement* tileElement, JuniorRcChainType chainType); #endif // _JUNIOR_ROLLER_COASTER_H diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index 2c44019139..49bb2fc4ef 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x0082491C */ static void lay_down_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -132,7 +132,7 @@ static void lay_down_rc_track_flat( /** rct2: 0x00824B8C, 0x00824B9C, 0x00824BAC */ static void lay_down_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->IsInverted()) @@ -154,7 +154,7 @@ static void lay_down_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } else @@ -181,7 +181,7 @@ static void lay_down_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -190,7 +190,7 @@ static void lay_down_rc_track_station( /** rct2: 0x0082492C */ static void lay_down_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -355,7 +355,7 @@ static void lay_down_rc_track_25_deg_up( /** rct2: 0x0082493C */ static void lay_down_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -471,7 +471,7 @@ static void lay_down_rc_track_60_deg_up( /** rct2: 0x0082494C */ static void lay_down_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -636,7 +636,7 @@ static void lay_down_rc_track_flat_to_25_deg_up( /** rct2: 0x0082495C */ static void lay_down_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -766,7 +766,7 @@ static void lay_down_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x0082496C */ static void lay_down_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -920,7 +920,7 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0082497C */ static void lay_down_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1085,55 +1085,55 @@ static void lay_down_rc_track_25_deg_up_to_flat( /** rct2: 0x0082498C */ static void lay_down_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0082499C */ static void lay_down_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008249AC */ static void lay_down_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008249BC */ static void lay_down_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008249CC */ static void lay_down_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008249DC */ static void lay_down_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008249EC */ static void lay_down_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1502,16 +1502,16 @@ static void lay_down_rc_track_left_quarter_turn_5( /** rct2: 0x008249FC */ static void lay_down_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824A0C */ static void lay_down_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1592,7 +1592,7 @@ static void lay_down_rc_track_flat_to_left_bank( /** rct2: 0x00824A1C */ static void lay_down_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1673,7 +1673,7 @@ static void lay_down_rc_track_flat_to_right_bank( /** rct2: 0x00824A2C */ static void lay_down_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1754,7 +1754,7 @@ static void lay_down_rc_track_left_bank_to_flat( /** rct2: 0x00824A3C */ static void lay_down_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1835,7 +1835,7 @@ static void lay_down_rc_track_right_bank_to_flat( /** rct2: 0x00824A4C */ static void lay_down_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2205,16 +2205,16 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00824A5C */ static void lay_down_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824A6C */ static void lay_down_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2326,7 +2326,7 @@ static void lay_down_rc_track_left_bank_to_25_deg_up( /** rct2: 0x00824A7C */ static void lay_down_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2438,7 +2438,7 @@ static void lay_down_rc_track_right_bank_to_25_deg_up( /** rct2: 0x00824A8C */ static void lay_down_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2550,7 +2550,7 @@ static void lay_down_rc_track_25_deg_up_to_left_bank( /** rct2: 0x00824A9C */ static void lay_down_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2662,39 +2662,39 @@ static void lay_down_rc_track_25_deg_up_to_right_bank( /** rct2: 0x00824AAC */ static void lay_down_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824ABC */ static void lay_down_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824ACC */ static void lay_down_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824ADC */ static void lay_down_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824AEC */ static void lay_down_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2771,15 +2771,15 @@ static void lay_down_rc_track_left_bank( /** rct2: 0x00824AFC */ static void lay_down_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824B0C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3123,7 +3123,7 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x00824B1C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3467,27 +3467,25 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x00824B2C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00824B3C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824B4C */ static void lay_down_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3814,7 +3812,7 @@ static void lay_down_rc_track_s_bend_left( /** rct2: 0x00824B5C */ static void lay_down_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4141,7 +4139,7 @@ static void lay_down_rc_track_s_bend_right( /** rct2: 0x00824B6C */ static void lay_down_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4420,7 +4418,7 @@ static void lay_down_rc_track_left_vertical_loop( /** rct2: 0x00824B7C */ static void lay_down_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4655,7 +4653,7 @@ static void lay_down_rc_track_right_vertical_loop( /** rct2: 0x00824BBC */ static void lay_down_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4894,16 +4892,16 @@ static void lay_down_rc_track_left_quarter_turn_3( /** rct2: 0x00824BCC */ static void lay_down_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824BDC */ static void lay_down_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5148,16 +5146,16 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00824BEC */ static void lay_down_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824BFC */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5328,7 +5326,7 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x00824C0C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5505,27 +5503,25 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x00824C1C */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00824C2C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824C9C */ static void lay_down_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5747,7 +5743,7 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( /** rct2: 0x00824CAC */ static void lay_down_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5969,7 +5965,7 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( /** rct2: 0x00824CBC */ static void lay_down_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -5978,13 +5974,12 @@ static void lay_down_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00824CCC */ static void lay_down_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -5993,13 +5988,12 @@ static void lay_down_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824CDC */ static void lay_down_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6345,7 +6339,7 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( /** rct2: 0x00824CEC */ static void lay_down_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6691,7 +6685,7 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( /** rct2: 0x00824CFC */ static void lay_down_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -6700,13 +6694,12 @@ static void lay_down_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00824D0C */ static void lay_down_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -6715,13 +6708,12 @@ static void lay_down_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824D3C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6799,7 +6791,7 @@ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x00824D1C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6878,25 +6870,23 @@ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x00824D2C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00824D4C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00824D5C */ static void lay_down_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6957,7 +6947,7 @@ static void lay_down_rc_track_brakes( /** rct2: 0x00824D6C */ static void lay_down_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7068,7 +7058,7 @@ static void lay_down_rc_track_on_ride_photo( /** rct2: 0x00824D8C */ static void lay_down_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7382,7 +7372,7 @@ static void lay_down_rc_track_left_eighth_to_diag( /** rct2: 0x00824D9C */ static void lay_down_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7696,25 +7686,25 @@ static void lay_down_rc_track_right_eighth_to_diag( /** rct2: 0x00824DAC */ static void lay_down_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824DBC */ static void lay_down_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + lay_down_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x00824DCC */ static void lay_down_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8029,7 +8019,7 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00824DDC */ static void lay_down_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8344,25 +8334,25 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00824DEC */ static void lay_down_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00824DFC */ static void lay_down_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + lay_down_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x00824D7C */ static void lay_down_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8654,7 +8644,7 @@ static void lay_down_rc_track_diag_flat( /** rct2: 0x00824E2C */ static void lay_down_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8946,7 +8936,7 @@ static void lay_down_rc_track_diag_25_deg_up( /** rct2: 0x00824E8C */ static void lay_down_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9182,7 +9172,7 @@ static void lay_down_rc_track_diag_60_deg_up( /** rct2: 0x00824E0C */ static void lay_down_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9474,7 +9464,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00824E6C */ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9710,7 +9700,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x00824E7C */ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9946,7 +9936,7 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00824E1C */ static void lay_down_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10238,7 +10228,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00824E5C */ static void lay_down_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10474,7 +10464,7 @@ static void lay_down_rc_track_diag_25_deg_down( /** rct2: 0x00824EBC */ static void lay_down_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10710,7 +10700,7 @@ static void lay_down_rc_track_diag_60_deg_down( /** rct2: 0x00824E3C */ static void lay_down_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10939,7 +10929,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x00824E9C */ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11175,7 +11165,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x00824EAC */ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11411,7 +11401,7 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00824E4C */ static void lay_down_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11647,7 +11637,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00824EEC */ static void lay_down_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11817,7 +11807,7 @@ static void lay_down_rc_track_diag_flat_to_left_bank( /** rct2: 0x00824EFC */ static void lay_down_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11987,7 +11977,7 @@ static void lay_down_rc_track_diag_flat_to_right_bank( /** rct2: 0x00824F0C */ static void lay_down_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12157,7 +12147,7 @@ static void lay_down_rc_track_diag_left_bank_to_flat( /** rct2: 0x00824F1C */ static void lay_down_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12327,7 +12317,7 @@ static void lay_down_rc_track_diag_right_bank_to_flat( /** rct2: 0x00824F4C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12496,7 +12486,7 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00824F5C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12665,7 +12655,7 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00824F2C */ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12834,7 +12824,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00824F3C */ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13003,7 +12993,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00824F6C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13165,7 +13155,7 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x00824F7C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13327,7 +13317,7 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x00824F8C */ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13496,7 +13486,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x00824F9C */ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13665,7 +13655,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x00824ECC */ static void lay_down_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13832,7 +13822,7 @@ static void lay_down_rc_track_diag_left_bank( /** rct2: 0x00824EDC */ static void lay_down_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -13999,7 +13989,7 @@ static void lay_down_rc_track_diag_right_bank( /** rct2: 0x00824FAC */ static void lay_down_rc_track_left_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14111,7 +14101,7 @@ static void lay_down_rc_track_left_flyer_twist_up( /** rct2: 0x00824FBC */ static void lay_down_rc_track_right_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14221,7 +14211,7 @@ static void lay_down_rc_track_right_flyer_twist_up( /** rct2: 0x00824FCC */ static void lay_down_rc_track_left_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14333,7 +14323,7 @@ static void lay_down_rc_track_left_flyer_twist_down( /** rct2: 0x00824FDC */ static void lay_down_rc_track_right_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14443,7 +14433,7 @@ static void lay_down_rc_track_right_flyer_twist_down( /** rct2: 0x00824C3C */ static void lay_down_rc_track_flyer_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14573,7 +14563,7 @@ static void lay_down_rc_track_flyer_half_loop_up( /** rct2: 0x00824C4C */ static void lay_down_rc_track_flyer_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14703,7 +14693,7 @@ static void lay_down_rc_track_flyer_half_loop_down( /** rct2: 0x00824C5C */ static void lay_down_rc_track_left_flyer_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14830,7 +14820,7 @@ static void lay_down_rc_track_left_flyer_corkscrew_up( /** rct2: 0x00824C6C */ static void lay_down_rc_track_right_flyer_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -14944,7 +14934,7 @@ static void lay_down_rc_track_right_flyer_corkscrew_up( /** rct2: 0x00824C7C */ static void lay_down_rc_track_left_flyer_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -15058,15 +15048,15 @@ static void lay_down_rc_track_left_flyer_corkscrew_down( /** rct2: 0x00824C8C */ static void lay_down_rc_track_right_flyer_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lay_down_rc_track_left_flyer_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction + 3) % 4, height, tileElement); + lay_down_rc_track_left_flyer_corkscrew_up(session, ride, 2 - trackSequence, (direction + 3) % 4, height, tileElement); } /** rct2: 0x00824FEC */ static void lay_down_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -15123,7 +15113,7 @@ static void lay_down_rc_track_block_brakes( } static void lay_down_rc_track_left_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -15307,7 +15297,7 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( } static void lay_down_rc_track_right_quarter_banked_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -15491,7 +15481,7 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( } static void lay_down_rc_track_left_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -15675,7 +15665,7 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( } static void lay_down_rc_track_right_quarter_banked_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index 9eaf612ef5..9ce8f01ec5 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _LimLauncherBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A6D50, 0x008A6D60, 0x008A6D70 */ static void lim_launched_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -58,7 +58,7 @@ static void lim_launched_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -66,7 +66,7 @@ static void lim_launched_rc_track_station( /** rct2: 0x008A65E0 */ static void lim_launched_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -329,7 +329,7 @@ static void lim_launched_rc_track_left_vertical_loop( /** rct2: 0x008A65F0 */ static void lim_launched_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -546,7 +546,7 @@ static void lim_launched_rc_track_right_vertical_loop( /** rct2: 0x008A6D10 */ static void lim_launched_rc_track_left_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -683,7 +683,7 @@ static void lim_launched_rc_track_left_twist_down_to_up( /** rct2: 0x008A6D20 */ static void lim_launched_rc_track_right_twist_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -820,7 +820,7 @@ static void lim_launched_rc_track_right_twist_down_to_up( /** rct2: 0x008A6D30 */ static void lim_launched_rc_track_left_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -957,7 +957,7 @@ static void lim_launched_rc_track_left_twist_up_to_down( /** rct2: 0x008A6D40 */ static void lim_launched_rc_track_right_twist_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1094,7 +1094,7 @@ static void lim_launched_rc_track_right_twist_up_to_down( /** rct2: 0x008A6CD0 */ static void lim_launched_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1206,7 +1206,7 @@ static void lim_launched_rc_track_left_corkscrew_up( /** rct2: 0x008A6CE0 */ static void lim_launched_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1319,23 +1319,23 @@ static void lim_launched_rc_track_right_corkscrew_up( /** rct2: 0x008A6CF0 */ static void lim_launched_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lim_launched_rc_track_right_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + lim_launched_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6D00 */ static void lim_launched_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lim_launched_rc_track_left_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + lim_launched_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6D80 */ static void lim_launched_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1363,7 +1363,7 @@ static void lim_launched_rc_track_brakes( /** rct2: 0x008A6C10 */ static void lim_launched_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1404,15 +1404,15 @@ static void lim_launched_rc_track_90_deg_up( /** rct2: 0x008A6C20 */ static void lim_launched_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lim_launched_rc_track_90_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lim_launched_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6C30 */ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1455,15 +1455,15 @@ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008A6C40 */ static void lim_launched_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lim_launched_rc_track_60_deg_up_to_90_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + lim_launched_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6C50 */ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1501,7 +1501,7 @@ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008A6C60 */ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1545,7 +1545,7 @@ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008A6C70 */ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1643,16 +1643,16 @@ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( /** rct2: 0x008A6C80 */ static void lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - session, rideIndex, 2 - trackSequence, direction, height, tileElement); + session, ride, 2 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A6D90 */ static void lim_launched_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -1671,7 +1671,7 @@ static void lim_launched_rc_track_block_brakes( } static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1718,7 +1718,7 @@ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CA0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1765,20 +1765,19 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CB0 */ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { lim_launched_rc_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6CC0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - lim_launched_rc_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + lim_launched_rc_track_left_quarter_turn_1_90_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index dfebe07764..eaa0da5603 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -23,7 +23,7 @@ /** rct2: 0x008A6370 */ static void looping_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -79,7 +79,7 @@ static void looping_rc_track_flat( } static void looping_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint32_t stationTrackNESW = is_csg_loaded() ? LOOPING_RC_BOOSTER_NE_SW : 15016; @@ -98,7 +98,7 @@ static void looping_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -106,7 +106,7 @@ static void looping_rc_track_station( /** rct2: 0x008A6380 */ static void looping_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -176,7 +176,7 @@ static void looping_rc_track_25_deg_up( /** rct2: 0x008A6390 */ static void looping_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -246,7 +246,7 @@ static void looping_rc_track_60_deg_up( /** rct2: 0x008A63A0 */ static void looping_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -316,7 +316,7 @@ static void looping_rc_track_flat_to_25_deg_up( /** rct2: 0x008A63B0 */ static void looping_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -394,7 +394,7 @@ static void looping_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A63C0 */ static void looping_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -472,7 +472,7 @@ static void looping_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A63D0 */ static void looping_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -542,55 +542,55 @@ static void looping_rc_track_25_deg_up_to_flat( /** rct2: 0x008A63E0 */ static void looping_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A63F0 */ static void looping_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6400 */ static void looping_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6410 */ static void looping_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6420 */ static void looping_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6430 */ static void looping_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6440 */ static void looping_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -754,16 +754,16 @@ static void looping_rc_track_left_quarter_turn_5( /** rct2: 0x008A6450 */ static void looping_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6460 */ static void looping_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -801,7 +801,7 @@ static void looping_rc_track_flat_to_left_bank( /** rct2: 0x008A6470 */ static void looping_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -839,7 +839,7 @@ static void looping_rc_track_flat_to_right_bank( /** rct2: 0x008A6480 */ static void looping_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -877,7 +877,7 @@ static void looping_rc_track_left_bank_to_flat( /** rct2: 0x008A6490 */ static void looping_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -915,7 +915,7 @@ static void looping_rc_track_right_bank_to_flat( /** rct2: 0x008A64A0 */ static void looping_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1089,16 +1089,16 @@ static void looping_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A64B0 */ static void looping_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A64C0 */ static void looping_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1143,7 +1143,7 @@ static void looping_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A64D0 */ static void looping_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1188,7 +1188,7 @@ static void looping_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A64E0 */ static void looping_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1233,7 +1233,7 @@ static void looping_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A64F0 */ static void looping_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1278,39 +1278,39 @@ static void looping_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A6500 */ static void looping_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6510 */ static void looping_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6520 */ static void looping_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6530 */ static void looping_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6540 */ static void looping_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1344,15 +1344,15 @@ static void looping_rc_track_left_bank( /** rct2: 0x008A6550 */ static void looping_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6560 */ static void looping_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1516,7 +1516,7 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A6570 */ static void looping_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1680,26 +1680,25 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A6580 */ static void looping_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6590 */ static void looping_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A65A0 */ static void looping_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1834,7 +1833,7 @@ static void looping_rc_track_s_bend_left( /** rct2: 0x008A65B0 */ static void looping_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1969,7 +1968,7 @@ static void looping_rc_track_s_bend_right( /** rct2: 0x008A65C0 */ static void looping_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2256,7 +2255,7 @@ static void looping_rc_track_left_vertical_loop( /** rct2: 0x008A65D0 */ static void looping_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2511,7 +2510,7 @@ static void looping_rc_track_right_vertical_loop( /** rct2: 0x008A6630 */ static void looping_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2614,16 +2613,16 @@ static void looping_rc_track_left_quarter_turn_3( /** rct2: 0x008A6640 */ static void looping_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6650 */ static void looping_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2735,16 +2734,16 @@ static void looping_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A6660 */ static void looping_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6670 */ static void looping_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2823,7 +2822,7 @@ static void looping_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A6680 */ static void looping_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2909,26 +2908,25 @@ static void looping_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A6690 */ static void looping_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A66A0 */ static void looping_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A66B0 */ static void looping_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3146,7 +3144,7 @@ static void looping_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A66C0 */ static void looping_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3364,7 +3362,7 @@ static void looping_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A66D0 */ static void looping_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3373,13 +3371,12 @@ static void looping_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A66E0 */ static void looping_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3388,13 +3385,12 @@ static void looping_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A66F0 */ static void looping_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3736,7 +3732,7 @@ static void looping_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A6700 */ static void looping_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4078,7 +4074,7 @@ static void looping_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A6710 */ static void looping_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4087,13 +4083,12 @@ static void looping_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6720 */ static void looping_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4102,13 +4097,12 @@ static void looping_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6750 */ static void looping_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4145,7 +4139,7 @@ static void looping_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A6730 */ static void looping_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4182,24 +4176,23 @@ static void looping_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A6740 */ static void looping_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6760 */ static void looping_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_left_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6770 */ static void looping_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4231,7 +4224,7 @@ static void looping_rc_track_brakes( /** rct2: 0x008A6A40 */ static void looping_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4272,7 +4265,7 @@ static void looping_rc_track_25_deg_up_left_banked( /** rct2: 0x008A6A50 */ static void looping_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4313,7 +4306,7 @@ static void looping_rc_track_25_deg_up_right_banked( /** rct2: 0x008A6780 */ static void looping_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4359,23 +4352,23 @@ static void looping_rc_track_on_ride_photo( /** rct2: 0x008A6A60 */ static void looping_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6A70 */ static void looping_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6860 */ static void looping_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4514,7 +4507,7 @@ static void looping_rc_track_left_eighth_to_diag( /** rct2: 0x008A6870 */ static void looping_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4652,25 +4645,25 @@ static void looping_rc_track_right_eighth_to_diag( /** rct2: 0x008A6880 */ static void looping_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6890 */ static void looping_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + looping_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A68A0 */ static void looping_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4812,7 +4805,7 @@ static void looping_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A68B0 */ static void looping_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4954,25 +4947,25 @@ static void looping_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A68C0 */ static void looping_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A68D0 */ static void looping_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + looping_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A6790 */ static void looping_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5118,7 +5111,7 @@ static void looping_rc_track_diag_flat( /** rct2: 0x008A67C0 */ static void looping_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5264,7 +5257,7 @@ static void looping_rc_track_diag_25_deg_up( /** rct2: 0x008A67F0 */ static void looping_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5410,7 +5403,7 @@ static void looping_rc_track_diag_60_deg_up( /** rct2: 0x008A67A0 */ static void looping_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5556,7 +5549,7 @@ static void looping_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A67D0 */ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5702,7 +5695,7 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A67E0 */ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5848,7 +5841,7 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A67B0 */ static void looping_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5994,7 +5987,7 @@ static void looping_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A6820 */ static void looping_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6140,7 +6133,7 @@ static void looping_rc_track_diag_25_deg_down( /** rct2: 0x008A6850 */ static void looping_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6286,7 +6279,7 @@ static void looping_rc_track_diag_60_deg_down( /** rct2: 0x008A6800 */ static void looping_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6430,7 +6423,7 @@ static void looping_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A6830 */ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6576,7 +6569,7 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A6840 */ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6722,7 +6715,7 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A6810 */ static void looping_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6868,7 +6861,7 @@ static void looping_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A6900 */ static void looping_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6947,7 +6940,7 @@ static void looping_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A6910 */ static void looping_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7026,7 +7019,7 @@ static void looping_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A6920 */ static void looping_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7105,7 +7098,7 @@ static void looping_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A6930 */ static void looping_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7184,7 +7177,7 @@ static void looping_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A6960 */ static void looping_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7263,7 +7256,7 @@ static void looping_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A6970 */ static void looping_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7342,7 +7335,7 @@ static void looping_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A6940 */ static void looping_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7421,7 +7414,7 @@ static void looping_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A6950 */ static void looping_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7500,7 +7493,7 @@ static void looping_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A6980 */ static void looping_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7577,7 +7570,7 @@ static void looping_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A6990 */ static void looping_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7654,7 +7647,7 @@ static void looping_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A69A0 */ static void looping_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7733,7 +7726,7 @@ static void looping_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A69B0 */ static void looping_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7812,7 +7805,7 @@ static void looping_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A68E0 */ static void looping_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7888,7 +7881,7 @@ static void looping_rc_track_diag_left_bank( /** rct2: 0x008A68F0 */ static void looping_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7964,7 +7957,7 @@ static void looping_rc_track_diag_right_bank( /** rct2: 0x008A6C00 */ static void looping_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7996,7 +7989,7 @@ static void looping_rc_track_block_brakes( /** rct2: 0x008A6BC0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8078,7 +8071,7 @@ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A6BD0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8167,27 +8160,27 @@ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A6BE0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; looping_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6BF0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; looping_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6B80 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8357,7 +8350,7 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A6B90 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8527,27 +8520,27 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A6BA0 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; looping_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A6BB0 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; looping_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A6A80 */ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8590,7 +8583,7 @@ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A6A90 */ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8633,7 +8626,7 @@ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A6AA0 */ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8676,7 +8669,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A6AB0 */ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8719,43 +8712,41 @@ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A6AC0 */ static void looping_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6AD0 */ static void looping_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6AE0 */ static void looping_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6AF0 */ static void looping_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6B00 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8796,7 +8787,7 @@ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A6B10 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8837,7 +8828,7 @@ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A6B40 */ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8878,7 +8869,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A6B50 */ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8919,43 +8910,43 @@ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A6B60 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6B70 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6B20 */ static void looping_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6B30 */ static void looping_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A69C0 */ static void looping_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8998,7 +8989,7 @@ static void looping_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A69D0 */ static void looping_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9041,7 +9032,7 @@ static void looping_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A69E0 */ static void looping_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9084,7 +9075,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A69F0 */ static void looping_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -9127,45 +9118,43 @@ static void looping_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A6A00 */ static void looping_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_right_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6A10 */ static void looping_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_left_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6A20 */ static void looping_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A6A30 */ static void looping_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - looping_rc_track_flat_to_left_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void looping_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!is_csg_loaded()) { - looping_rc_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement); + looping_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); return; } diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index a86f9c5226..013135ab15 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008B08D0 */ static void mine_ride_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -53,7 +53,7 @@ static void mine_ride_track_flat( } static void mine_ride_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -69,7 +69,7 @@ static void mine_ride_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -77,7 +77,7 @@ static void mine_ride_track_station( /** rct2: 0x008B08E0 */ static void mine_ride_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -134,7 +134,7 @@ static void mine_ride_track_25_deg_up( /** rct2: 0x008B08F0 */ static void mine_ride_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -191,7 +191,7 @@ static void mine_ride_track_flat_to_25_deg_up( /** rct2: 0x008B0900 */ static void mine_ride_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -248,31 +248,31 @@ static void mine_ride_track_25_deg_up_to_flat( /** rct2: 0x008B0910 */ static void mine_ride_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0920 */ static void mine_ride_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0930 */ static void mine_ride_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0940 */ static void mine_ride_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -450,16 +450,16 @@ static void mine_ride_track_left_quarter_turn_5( /** rct2: 0x008B0950 */ static void mine_ride_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B0960 */ static void mine_ride_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -513,7 +513,7 @@ static void mine_ride_track_flat_to_left_bank( /** rct2: 0x008B0970 */ static void mine_ride_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -567,7 +567,7 @@ static void mine_ride_track_flat_to_right_bank( /** rct2: 0x008B0980 */ static void mine_ride_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -621,7 +621,7 @@ static void mine_ride_track_left_bank_to_flat( /** rct2: 0x008B0990 */ static void mine_ride_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -675,7 +675,7 @@ static void mine_ride_track_right_bank_to_flat( /** rct2: 0x008B09A0 */ static void mine_ride_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -863,16 +863,16 @@ static void mine_ride_track_banked_left_quarter_turn_5( /** rct2: 0x008B09B0 */ static void mine_ride_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B09C0 */ static void mine_ride_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -933,7 +933,7 @@ static void mine_ride_track_left_bank_to_25_deg_up( /** rct2: 0x008B09D0 */ static void mine_ride_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -994,7 +994,7 @@ static void mine_ride_track_right_bank_to_25_deg_up( /** rct2: 0x008B09E0 */ static void mine_ride_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1055,7 +1055,7 @@ static void mine_ride_track_25_deg_up_to_left_bank( /** rct2: 0x008B09F0 */ static void mine_ride_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1116,39 +1116,39 @@ static void mine_ride_track_25_deg_up_to_right_bank( /** rct2: 0x008B0A00 */ static void mine_ride_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0A10 */ static void mine_ride_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0A20 */ static void mine_ride_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0A30 */ static void mine_ride_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0A40 */ static void mine_ride_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1198,15 +1198,15 @@ static void mine_ride_track_left_bank( /** rct2: 0x008B0A50 */ static void mine_ride_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_ride_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0A60 */ static void mine_ride_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1355,7 +1355,7 @@ static void mine_ride_track_s_bend_left( /** rct2: 0x008B0A70 */ static void mine_ride_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1504,7 +1504,7 @@ static void mine_ride_track_s_bend_right( /** rct2: 0x008B0AB0 */ static void mine_ride_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1621,16 +1621,16 @@ static void mine_ride_track_left_quarter_turn_3( /** rct2: 0x008B0AC0 */ static void mine_ride_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B0AD0 */ static void mine_ride_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1756,16 +1756,16 @@ static void mine_ride_track_left_quarter_turn_3_bank( /** rct2: 0x008B0AE0 */ static void mine_ride_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B0AF0 */ static void mine_ride_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2011,7 +2011,7 @@ static void mine_ride_track_left_half_banked_helix_up_small( /** rct2: 0x008B0B00 */ static void mine_ride_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2257,7 +2257,7 @@ static void mine_ride_track_right_half_banked_helix_up_small( /** rct2: 0x008B0B10 */ static void mine_ride_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2266,13 +2266,12 @@ static void mine_ride_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mine_ride_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008B0B20 */ static void mine_ride_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -2281,13 +2280,12 @@ static void mine_ride_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B0B30 */ static void mine_ride_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2657,7 +2655,7 @@ static void mine_ride_track_left_half_banked_helix_up_large( /** rct2: 0x008B0B40 */ static void mine_ride_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3027,7 +3025,7 @@ static void mine_ride_track_right_half_banked_helix_up_large( /** rct2: 0x008B0B50 */ static void mine_ride_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3036,13 +3034,12 @@ static void mine_ride_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mine_ride_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008B0B60 */ static void mine_ride_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3051,13 +3048,12 @@ static void mine_ride_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008B0B70 */ static void mine_ride_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3103,7 +3099,7 @@ static void mine_ride_track_on_ride_photo( /** rct2: 0x008B0B90 */ static void mine_ride_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3249,7 +3245,7 @@ static void mine_ride_track_left_eighth_to_diag( /** rct2: 0x008B0BA0 */ static void mine_ride_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3394,25 +3390,25 @@ static void mine_ride_track_right_eighth_to_diag( /** rct2: 0x008B0BB0 */ static void mine_ride_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0BC0 */ static void mine_ride_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mine_ride_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008B0BD0 */ static void mine_ride_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3561,7 +3557,7 @@ static void mine_ride_track_left_eighth_bank_to_diag( /** rct2: 0x008B0BE0 */ static void mine_ride_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3710,25 +3706,25 @@ static void mine_ride_track_right_eighth_bank_to_diag( /** rct2: 0x008B0BF0 */ static void mine_ride_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008B0C00 */ static void mine_ride_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mine_ride_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008B0B80 */ static void mine_ride_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3804,7 +3800,7 @@ static void mine_ride_track_diag_flat( /** rct2: 0x008B0C30 */ static void mine_ride_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3880,7 +3876,7 @@ static void mine_ride_track_diag_25_deg_up( /** rct2: 0x008B0C10 */ static void mine_ride_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3956,7 +3952,7 @@ static void mine_ride_track_diag_flat_to_25_deg_up( /** rct2: 0x008B0C20 */ static void mine_ride_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4032,7 +4028,7 @@ static void mine_ride_track_diag_25_deg_up_to_flat( /** rct2: 0x008B0C60 */ static void mine_ride_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4108,7 +4104,7 @@ static void mine_ride_track_diag_25_deg_down( /** rct2: 0x008B0C40 */ static void mine_ride_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4182,7 +4178,7 @@ static void mine_ride_track_diag_flat_to_25_deg_down( /** rct2: 0x008B0C50 */ static void mine_ride_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4258,7 +4254,7 @@ static void mine_ride_track_diag_25_deg_down_to_flat( /** rct2: 0x008B0C90 */ static void mine_ride_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4337,7 +4333,7 @@ static void mine_ride_track_diag_flat_to_left_bank( /** rct2: 0x008B0CA0 */ static void mine_ride_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4416,7 +4412,7 @@ static void mine_ride_track_diag_flat_to_right_bank( /** rct2: 0x008B0CB0 */ static void mine_ride_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4495,7 +4491,7 @@ static void mine_ride_track_diag_left_bank_to_flat( /** rct2: 0x008B0CC0 */ static void mine_ride_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4574,7 +4570,7 @@ static void mine_ride_track_diag_right_bank_to_flat( /** rct2: 0x008B0CF0 */ static void mine_ride_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4653,7 +4649,7 @@ static void mine_ride_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008B0D00 */ static void mine_ride_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4732,7 +4728,7 @@ static void mine_ride_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008B0CD0 */ static void mine_ride_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4811,7 +4807,7 @@ static void mine_ride_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008B0CE0 */ static void mine_ride_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4890,7 +4886,7 @@ static void mine_ride_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008B0D10 */ static void mine_ride_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4967,7 +4963,7 @@ static void mine_ride_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008B0D20 */ static void mine_ride_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5044,7 +5040,7 @@ static void mine_ride_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008B0D30 */ static void mine_ride_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5123,7 +5119,7 @@ static void mine_ride_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008B0D40 */ static void mine_ride_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5202,7 +5198,7 @@ static void mine_ride_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008B0C70 */ static void mine_ride_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5278,7 +5274,7 @@ static void mine_ride_track_diag_left_bank( /** rct2: 0x008B0C80 */ static void mine_ride_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index 698824fda3..00d9d4be91 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _MineTrainBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x0071BFA4 */ static void mine_train_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -86,7 +86,7 @@ static void mine_train_rc_track_flat( /** rct2: 0x0071C154, 0x0071C164, 0x0071C174 */ static void mine_train_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -113,7 +113,7 @@ static void mine_train_rc_track_station( height); } track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -121,7 +121,7 @@ static void mine_train_rc_track_station( /** rct2: 0x0071BFB4 */ static void mine_train_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -190,7 +190,7 @@ static void mine_train_rc_track_25_deg_up( /** rct2: 0x0071BFC4 */ static void mine_train_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -230,7 +230,7 @@ static void mine_train_rc_track_60_deg_up( /** rct2: 0x0071BFD4 */ static void mine_train_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -299,7 +299,7 @@ static void mine_train_rc_track_flat_to_25_deg_up( /** rct2: 0x0071BFE4 */ static void mine_train_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -343,7 +343,7 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x0071BFF4 */ static void mine_train_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -387,7 +387,7 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0071C004 */ static void mine_train_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -456,55 +456,55 @@ static void mine_train_rc_track_25_deg_up_to_flat( /** rct2: 0x0071C014 */ static void mine_train_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C024 */ static void mine_train_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C034 */ static void mine_train_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C044 */ static void mine_train_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C054 */ static void mine_train_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C064 */ static void mine_train_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C0B4 */ static void mine_train_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -692,16 +692,16 @@ static void mine_train_rc_track_left_quarter_turn_5( /** rct2: 0x0071C0C4 */ static void mine_train_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C074 */ static void mine_train_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -738,7 +738,7 @@ static void mine_train_rc_track_flat_to_left_bank( /** rct2: 0x0071C084 */ static void mine_train_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -775,7 +775,7 @@ static void mine_train_rc_track_flat_to_right_bank( /** rct2: 0x0071C094 */ static void mine_train_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -812,7 +812,7 @@ static void mine_train_rc_track_left_bank_to_flat( /** rct2: 0x0071C0A4 */ static void mine_train_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -849,7 +849,7 @@ static void mine_train_rc_track_right_bank_to_flat( /** rct2: 0x0071C0D4 */ static void mine_train_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1047,16 +1047,16 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( /** rct2: 0x0071C0E4 */ static void mine_train_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C204 */ static void mine_train_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1100,7 +1100,7 @@ static void mine_train_rc_track_left_bank_to_25_deg_up( /** rct2: 0x0071C214 */ static void mine_train_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1144,7 +1144,7 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( /** rct2: 0x0071C224 */ static void mine_train_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1188,7 +1188,7 @@ static void mine_train_rc_track_25_deg_up_to_left_bank( /** rct2: 0x0071C234 */ static void mine_train_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1232,39 +1232,39 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( /** rct2: 0x0071C244 */ static void mine_train_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C254 */ static void mine_train_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C264 */ static void mine_train_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C274 */ static void mine_train_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C304 */ static void mine_train_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1297,15 +1297,15 @@ static void mine_train_rc_track_left_bank( /** rct2: 0x0071C314 */ static void mine_train_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mine_train_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C0F4 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1493,7 +1493,7 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x0071C104 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1681,27 +1681,25 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x0071C114 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mine_train_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x0071C124 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C134 */ static void mine_train_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1840,7 +1838,7 @@ static void mine_train_rc_track_s_bend_left( /** rct2: 0x0071C144 */ static void mine_train_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1979,7 +1977,7 @@ static void mine_train_rc_track_s_bend_right( /** rct2: 0x0071C184 */ static void mine_train_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2101,16 +2099,16 @@ static void mine_train_rc_track_left_quarter_turn_3( /** rct2: 0x0071C194 */ static void mine_train_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C1A4 */ static void mine_train_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2241,16 +2239,16 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( /** rct2: 0x0071C1B4 */ static void mine_train_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C1C4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2350,7 +2348,7 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x0071C1D4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2450,27 +2448,25 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x0071C1E4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mine_train_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x0071C1F4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C284 */ static void mine_train_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2738,7 +2734,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( /** rct2: 0x0071C294 */ static void mine_train_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3006,7 +3002,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( /** rct2: 0x0071C2A4 */ static void mine_train_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3016,12 +3012,12 @@ static void mine_train_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; mine_train_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x0071C2B4 */ static void mine_train_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3030,13 +3026,12 @@ static void mine_train_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C2C4 */ static void mine_train_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3446,7 +3441,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( /** rct2: 0x0071C2D4 */ static void mine_train_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3844,7 +3839,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( /** rct2: 0x0071C2E4 */ static void mine_train_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3854,12 +3849,12 @@ static void mine_train_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; mine_train_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x0071C2F4 */ static void mine_train_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -3868,13 +3863,12 @@ static void mine_train_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0071C324 */ static void mine_train_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3899,7 +3893,7 @@ static void mine_train_rc_track_brakes( /** rct2: 0x0071C334 */ static void mine_train_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3933,7 +3927,7 @@ static void mine_train_rc_track_on_ride_photo( /** rct2: 0x0071C354 */ static void mine_train_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4078,7 +4072,7 @@ static void mine_train_rc_track_left_eighth_to_diag( /** rct2: 0x0071C364 */ static void mine_train_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4222,25 +4216,25 @@ static void mine_train_rc_track_right_eighth_to_diag( /** rct2: 0x0071C374 */ static void mine_train_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C384 */ static void mine_train_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mine_train_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x0071C394 */ static void mine_train_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4388,7 +4382,7 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( /** rct2: 0x0071C3A4 */ static void mine_train_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4536,25 +4530,25 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( /** rct2: 0x0071C3B4 */ static void mine_train_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0071C3C4 */ static void mine_train_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mine_train_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x0071C344 */ static void mine_train_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4708,7 +4702,7 @@ static void mine_train_rc_track_diag_flat( /** rct2: 0x0071C414 */ static void mine_train_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4878,7 +4872,7 @@ static void mine_train_rc_track_diag_25_deg_up( /** rct2: 0x0071C474 */ static void mine_train_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4956,7 +4950,7 @@ static void mine_train_rc_track_diag_60_deg_up( /** rct2: 0x0071C3F4 */ static void mine_train_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5110,7 +5104,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x0071C454 */ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5188,7 +5182,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x0071C464 */ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5266,7 +5260,7 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x0071C404 */ static void mine_train_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5436,7 +5430,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x0071C444 */ static void mine_train_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5606,7 +5600,7 @@ static void mine_train_rc_track_diag_25_deg_down( /** rct2: 0x0071C4A4 */ static void mine_train_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5684,7 +5678,7 @@ static void mine_train_rc_track_diag_60_deg_down( /** rct2: 0x0071C424 */ static void mine_train_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5852,7 +5846,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x0071C484 */ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5930,7 +5924,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x0071C494 */ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6008,7 +6002,7 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x0071C434 */ static void mine_train_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6162,7 +6156,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x0071C4D4 */ static void mine_train_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6243,7 +6237,7 @@ static void mine_train_rc_track_diag_flat_to_left_bank( /** rct2: 0x0071C4B4 */ static void mine_train_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6324,7 +6318,7 @@ static void mine_train_rc_track_diag_flat_to_right_bank( /** rct2: 0x0071C4C4 */ static void mine_train_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6405,7 +6399,7 @@ static void mine_train_rc_track_diag_left_bank_to_flat( /** rct2: 0x0071C4E4 */ static void mine_train_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6486,7 +6480,7 @@ static void mine_train_rc_track_diag_right_bank_to_flat( /** rct2: 0x0071C514 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6567,7 +6561,7 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x0071C524 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6648,7 +6642,7 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x0071C4F4 */ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6729,7 +6723,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x0071C504 */ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6810,7 +6804,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x0071C534 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6886,7 +6880,7 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x0071C544 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6962,7 +6956,7 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x0071C554 */ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7043,7 +7037,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x0071C564 */ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7124,7 +7118,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x0071C3D4 */ static void mine_train_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7206,7 +7200,7 @@ static void mine_train_rc_track_diag_left_bank( /** rct2: 0x0071C3E4 */ static void mine_train_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7288,7 +7282,7 @@ static void mine_train_rc_track_diag_right_bank( /** rct2: 0x0071C574 */ static void mine_train_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 9a4f4d1648..1db2f6c04e 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _MiniRCBlockBrakeImages[NumOrthogonalDirections] /** rct2: 0x008A4ABC */ static void mini_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -110,7 +110,7 @@ static void mini_rc_track_flat( } static void mini_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -136,7 +136,7 @@ static void mini_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -144,7 +144,7 @@ static void mini_rc_track_station( /** rct2: 0x008A4ACC */ static void mini_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -246,7 +246,7 @@ static void mini_rc_track_25_deg_up( /** rct2: 0x008A4ADC */ static void mini_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -303,7 +303,7 @@ static void mini_rc_track_60_deg_up( /** rct2: 0x008A4AEC */ static void mini_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -405,7 +405,7 @@ static void mini_rc_track_flat_to_25_deg_up( /** rct2: 0x008A4AFC */ static void mini_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -466,7 +466,7 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A4B0C */ static void mini_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -527,7 +527,7 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A4B1C */ static void mini_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -629,55 +629,55 @@ static void mini_rc_track_25_deg_up_to_flat( /** rct2: 0x008A4B2C */ static void mini_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B3C */ static void mini_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B4C */ static void mini_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B5C */ static void mini_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B6C */ static void mini_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B7C */ static void mini_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4B8C */ static void mini_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -855,16 +855,16 @@ static void mini_rc_track_left_quarter_turn_5( /** rct2: 0x008A4B9C */ static void mini_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4BAC */ static void mini_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -918,7 +918,7 @@ static void mini_rc_track_flat_to_left_bank( /** rct2: 0x008A4BBC */ static void mini_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -972,7 +972,7 @@ static void mini_rc_track_flat_to_right_bank( /** rct2: 0x008A4BCC */ static void mini_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1026,7 +1026,7 @@ static void mini_rc_track_left_bank_to_flat( /** rct2: 0x008A4BDC */ static void mini_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1080,7 +1080,7 @@ static void mini_rc_track_right_bank_to_flat( /** rct2: 0x008A4BEC */ static void mini_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1268,16 +1268,16 @@ static void mini_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A4BFC */ static void mini_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4C0C */ static void mini_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1338,7 +1338,7 @@ static void mini_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A4C1C */ static void mini_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1399,7 +1399,7 @@ static void mini_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A4C2C */ static void mini_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1460,7 +1460,7 @@ static void mini_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A4C3C */ static void mini_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1521,39 +1521,39 @@ static void mini_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A4C4C */ static void mini_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4C5C */ static void mini_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4C6C */ static void mini_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4C7C */ static void mini_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4C8C */ static void mini_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1603,15 +1603,15 @@ static void mini_rc_track_left_bank( /** rct2: 0x008A4C9C */ static void mini_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4CAC */ static void mini_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1789,7 +1789,7 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A4CBC */ static void mini_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1967,25 +1967,25 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A4CCC */ static void mini_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A4CDC */ static void mini_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4CEC */ static void mini_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2134,7 +2134,7 @@ static void mini_rc_track_s_bend_left( /** rct2: 0x008A4CFC */ static void mini_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2283,7 +2283,7 @@ static void mini_rc_track_s_bend_right( /** rct2: 0x008A4D3C */ static void mini_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2400,16 +2400,16 @@ static void mini_rc_track_left_quarter_turn_3( /** rct2: 0x008A4D4C */ static void mini_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4D5C */ static void mini_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2535,16 +2535,16 @@ static void mini_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A4D6C */ static void mini_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4D7C */ static void mini_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2637,7 +2637,7 @@ static void mini_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A4D8C */ static void mini_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2730,25 +2730,25 @@ static void mini_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A4D9C */ static void mini_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A4DAC */ static void mini_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4DBC */ static void mini_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2994,7 +2994,7 @@ static void mini_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A4DCC */ static void mini_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3240,7 +3240,7 @@ static void mini_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A4DDC */ static void mini_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3249,12 +3249,12 @@ static void mini_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_half_banked_helix_up_small(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A4DEC */ static void mini_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -3263,12 +3263,12 @@ static void mini_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_half_banked_helix_up_small(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4DFC */ static void mini_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3638,7 +3638,7 @@ static void mini_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A4E0C */ static void mini_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4008,7 +4008,7 @@ static void mini_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A4E1C */ static void mini_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4017,12 +4017,12 @@ static void mini_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_half_banked_helix_up_large(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A4E2C */ static void mini_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4031,12 +4031,12 @@ static void mini_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_half_banked_helix_up_large(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4E5C */ static void mini_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4073,7 +4073,7 @@ static void mini_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A4E3C */ static void mini_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4110,23 +4110,23 @@ static void mini_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A4E4C */ static void mini_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_right_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A4E6C */ static void mini_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_left_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A4E7C */ static void mini_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4160,7 +4160,7 @@ static void mini_rc_track_brakes( /** rct2: 0x008A50CC */ static void mini_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4217,7 +4217,7 @@ static void mini_rc_track_25_deg_up_left_banked( /** rct2: 0x008A50DC */ static void mini_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4274,7 +4274,7 @@ static void mini_rc_track_25_deg_up_right_banked( /** rct2: 0x008A4E8C */ static void mini_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4320,23 +4320,23 @@ static void mini_rc_track_on_ride_photo( /** rct2: 0x008A50EC */ static void mini_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A50FC */ static void mini_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4EAC */ static void mini_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4482,7 +4482,7 @@ static void mini_rc_track_left_eighth_to_diag( /** rct2: 0x008A4EBC */ static void mini_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4627,25 +4627,25 @@ static void mini_rc_track_right_eighth_to_diag( /** rct2: 0x008A4ECC */ static void mini_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4EDC */ static void mini_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mini_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A4EEC */ static void mini_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4794,7 +4794,7 @@ static void mini_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A4EFC */ static void mini_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4943,25 +4943,25 @@ static void mini_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A4F0C */ static void mini_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A4F1C */ static void mini_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mini_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A4E9C */ static void mini_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5107,7 +5107,7 @@ static void mini_rc_track_diag_flat( /** rct2: 0x008A4F4C */ static void mini_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5253,7 +5253,7 @@ static void mini_rc_track_diag_25_deg_up( /** rct2: 0x008A4FAC */ static void mini_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5329,7 +5329,7 @@ static void mini_rc_track_diag_60_deg_up( /** rct2: 0x008A4F2C */ static void mini_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5475,7 +5475,7 @@ static void mini_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A4F8C */ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5551,7 +5551,7 @@ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A4F9C */ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5627,7 +5627,7 @@ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A4F3C */ static void mini_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5773,7 +5773,7 @@ static void mini_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A4F7C */ static void mini_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5919,7 +5919,7 @@ static void mini_rc_track_diag_25_deg_down( /** rct2: 0x008A4FDC */ static void mini_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5995,7 +5995,7 @@ static void mini_rc_track_diag_60_deg_down( /** rct2: 0x008A4F5C */ static void mini_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6139,7 +6139,7 @@ static void mini_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A4FBC */ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6215,7 +6215,7 @@ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A4FCC */ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6291,7 +6291,7 @@ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A4F6C */ static void mini_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6437,7 +6437,7 @@ static void mini_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A500C */ static void mini_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6516,7 +6516,7 @@ static void mini_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A501C */ static void mini_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6595,7 +6595,7 @@ static void mini_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A502C */ static void mini_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6674,7 +6674,7 @@ static void mini_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A503C */ static void mini_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6753,7 +6753,7 @@ static void mini_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A506C */ static void mini_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6832,7 +6832,7 @@ static void mini_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A507C */ static void mini_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6911,7 +6911,7 @@ static void mini_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A504C */ static void mini_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6990,7 +6990,7 @@ static void mini_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A505C */ static void mini_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7069,7 +7069,7 @@ static void mini_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A508C */ static void mini_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7146,7 +7146,7 @@ static void mini_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A509C */ static void mini_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7223,7 +7223,7 @@ static void mini_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A50AC */ static void mini_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7302,7 +7302,7 @@ static void mini_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A50BC */ static void mini_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7381,7 +7381,7 @@ static void mini_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A4FEC */ static void mini_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7457,7 +7457,7 @@ static void mini_rc_track_diag_left_bank( /** rct2: 0x008A4FFC */ static void mini_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7533,7 +7533,7 @@ static void mini_rc_track_diag_right_bank( /** rct2: 0x008A530C */ static void mini_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -7567,7 +7567,7 @@ static void mini_rc_track_block_brakes( /** rct2: 0x008A510C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7663,7 +7663,7 @@ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A511C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7759,27 +7759,25 @@ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A512C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A513C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A514C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7963,7 +7961,7 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A515C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8147,27 +8145,25 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A516C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A517C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A518C */ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8226,7 +8222,7 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A519C */ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8285,7 +8281,7 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A51AC */ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8344,7 +8340,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A51BC */ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8403,43 +8399,39 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A51CC */ static void mini_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A51DC */ static void mini_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A51EC */ static void mini_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A51FC */ static void mini_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A520C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8496,7 +8488,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A521C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8553,7 +8545,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A524C */ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8610,7 +8602,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A525C */ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8667,43 +8659,43 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A526C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A527C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A522C */ static void mini_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A523C */ static void mini_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A528C */ static void mini_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8762,7 +8754,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A529C */ static void mini_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8821,7 +8813,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A52AC */ static void mini_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8880,7 +8872,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A52BC */ static void mini_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -8939,38 +8931,38 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A52CC */ static void mini_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_right_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A52DC */ static void mini_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_left_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A52EC */ static void mini_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_flat_to_right_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A52FC */ static void mini_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_rc_track_flat_to_left_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void mini_rc_track_left_curved_lift_hill( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9062,7 +9054,7 @@ static void mini_rc_track_left_curved_lift_hill( } static void mini_rc_track_right_curved_lift_hill( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9154,7 +9146,7 @@ static void mini_rc_track_right_curved_lift_hill( } static void mini_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { // These offsets could be moved to the g2.dat file when that supports offsets. diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index 70050350c3..d860e8cd37 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008AFE9C */ static void mini_suspended_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -81,7 +81,7 @@ static void mini_suspended_rc_track_flat( /** rct2: 0x008AFF4C, 0x008AFF5C, 0x008AFF6C */ static void mini_suspended_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -99,7 +99,7 @@ static void mini_suspended_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 2, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -107,7 +107,7 @@ static void mini_suspended_rc_track_station( /** rct2: 0x008AFEAC */ static void mini_suspended_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -201,7 +201,7 @@ static void mini_suspended_rc_track_25_deg_up( /** rct2: 0x008AFEBC */ static void mini_suspended_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -295,7 +295,7 @@ static void mini_suspended_rc_track_flat_to_25_deg_up( /** rct2: 0x008AFECC */ static void mini_suspended_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -389,31 +389,31 @@ static void mini_suspended_rc_track_25_deg_up_to_flat( /** rct2: 0x008AFEDC */ static void mini_suspended_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_suspended_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AFEEC */ static void mini_suspended_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_suspended_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AFEFC */ static void mini_suspended_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - mini_suspended_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AFF0C */ static void mini_suspended_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -600,16 +600,16 @@ static void mini_suspended_rc_track_left_quarter_turn_5( /** rct2: 0x008AFF1C */ static void mini_suspended_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_suspended_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_suspended_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AFF2C */ static void mini_suspended_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -790,7 +790,7 @@ static void mini_suspended_rc_track_s_bend_left( /** rct2: 0x008AFF3C */ static void mini_suspended_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -971,7 +971,7 @@ static void mini_suspended_rc_track_s_bend_right( /** rct2: 0x008AFF7C */ static void mini_suspended_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1101,16 +1101,16 @@ static void mini_suspended_rc_track_left_quarter_turn_3( /** rct2: 0x008AFF8C */ static void mini_suspended_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_suspended_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + mini_suspended_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AFFAC */ static void mini_suspended_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1284,7 +1284,7 @@ static void mini_suspended_rc_track_left_eighth_to_diag( /** rct2: 0x008AFFBC */ static void mini_suspended_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1458,25 +1458,25 @@ static void mini_suspended_rc_track_right_eighth_to_diag( /** rct2: 0x008AFFCC */ static void mini_suspended_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_suspended_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AFFDC */ static void mini_suspended_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_suspended_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + mini_suspended_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008AFF9C */ static void mini_suspended_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1615,7 +1615,7 @@ static void mini_suspended_rc_track_diag_flat( /** rct2: 0x008B000C */ static void mini_suspended_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1754,7 +1754,7 @@ static void mini_suspended_rc_track_diag_25_deg_up( /** rct2: 0x008AFFEC */ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1893,7 +1893,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AFFFC */ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2032,7 +2032,7 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008B003C */ static void mini_suspended_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2171,7 +2171,7 @@ static void mini_suspended_rc_track_diag_25_deg_down( /** rct2: 0x008B001C */ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2307,7 +2307,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008B002C */ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index 30b5c07847..b0e71241ae 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -35,7 +35,7 @@ static constexpr const uint32_t MULTI_DIM_INVERTED_BLOCK_BRAKE_NW_SE_CLOSED = 26 /** rct2: 0x00792D88 */ static void multi_dimension_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -119,7 +119,7 @@ static void multi_dimension_rc_track_flat( /** rct2: 0x00792F98, 0x00792FA8, 0x00792FB8 */ static void multi_dimension_rc_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[NumOrthogonalDirections][3] = { @@ -145,7 +145,6 @@ static void multi_dimension_rc_track_station( } track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - auto ride = get_ride(rideIndex); if (ride != nullptr) { auto stationObj = ride_get_station_object(ride); @@ -180,7 +179,7 @@ static void multi_dimension_rc_track_station( /** rct2: 0x00792D98 */ static void multi_dimension_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -315,7 +314,7 @@ static void multi_dimension_rc_track_25_deg_up( /** rct2: 0x00792DA8 */ static void multi_dimension_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -396,7 +395,7 @@ static void multi_dimension_rc_track_60_deg_up( /** rct2: 0x00792DB8 */ static void multi_dimension_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -531,7 +530,7 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( /** rct2: 0x00792DC8 */ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -622,7 +621,7 @@ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x00792DD8 */ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -737,7 +736,7 @@ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x00792DE8 */ static void multi_dimension_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -872,57 +871,55 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( /** rct2: 0x00792DF8 */ static void multi_dimension_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E08 */ static void multi_dimension_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E18 */ static void multi_dimension_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E28 */ static void multi_dimension_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E38 */ static void multi_dimension_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E48 */ static void multi_dimension_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792E58 */ static void multi_dimension_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1289,16 +1286,16 @@ static void multi_dimension_rc_track_left_quarter_turn_5( /** rct2: 0x00792E68 */ static void multi_dimension_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00792E78 */ static void multi_dimension_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1378,7 +1375,7 @@ static void multi_dimension_rc_track_flat_to_left_bank( /** rct2: 0x00792E88 */ static void multi_dimension_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1458,7 +1455,7 @@ static void multi_dimension_rc_track_flat_to_right_bank( /** rct2: 0x00792E98 */ static void multi_dimension_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1538,7 +1535,7 @@ static void multi_dimension_rc_track_left_bank_to_flat( /** rct2: 0x00792EA8 */ static void multi_dimension_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1618,7 +1615,7 @@ static void multi_dimension_rc_track_right_bank_to_flat( /** rct2: 0x00792EB8 */ static void multi_dimension_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -1986,17 +1983,16 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00792EC8 */ static void multi_dimension_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - multi_dimension_rc_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00792ED8 */ static void multi_dimension_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2107,7 +2103,7 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_up( /** rct2: 0x00792EE8 */ static void multi_dimension_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2218,7 +2214,7 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_up( /** rct2: 0x00792EF8 */ static void multi_dimension_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2329,7 +2325,7 @@ static void multi_dimension_rc_track_25_deg_up_to_left_bank( /** rct2: 0x00792F08 */ static void multi_dimension_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2440,43 +2436,39 @@ static void multi_dimension_rc_track_25_deg_up_to_right_bank( /** rct2: 0x00792F18 */ static void multi_dimension_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792F28 */ static void multi_dimension_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792F38 */ static void multi_dimension_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792F48 */ static void multi_dimension_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792F58 */ static void multi_dimension_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2552,15 +2544,15 @@ static void multi_dimension_rc_track_left_bank( /** rct2: 0x00792F68 */ static void multi_dimension_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00792F78 */ static void multi_dimension_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -2875,7 +2867,7 @@ static void multi_dimension_rc_track_s_bend_left( /** rct2: 0x00792F88 */ static void multi_dimension_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3190,7 +3182,7 @@ static void multi_dimension_rc_track_s_bend_right( /** rct2: 0x00792FC8 */ static void multi_dimension_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3427,16 +3419,16 @@ static void multi_dimension_rc_track_left_quarter_turn_3( /** rct2: 0x00792FD8 */ static void multi_dimension_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00792FE8 */ static void multi_dimension_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -3679,17 +3671,16 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00792FF8 */ static void multi_dimension_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_3_bank( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00793008 */ static void multi_dimension_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3905,7 +3896,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( /** rct2: 0x00793018 */ static void multi_dimension_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4121,7 +4112,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( /** rct2: 0x00793028 */ static void multi_dimension_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4131,12 +4122,12 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; multi_dimension_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00793038 */ static void multi_dimension_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4146,12 +4137,12 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; multi_dimension_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00793048 */ static void multi_dimension_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4491,7 +4482,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( /** rct2: 0x00793058 */ static void multi_dimension_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4831,7 +4822,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( /** rct2: 0x00793068 */ static void multi_dimension_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4841,12 +4832,12 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; multi_dimension_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x00793078 */ static void multi_dimension_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4856,12 +4847,12 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; multi_dimension_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00793088 */ static void multi_dimension_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -4921,7 +4912,7 @@ static void multi_dimension_rc_track_brakes( /** rct2: 0x00793098 */ static void multi_dimension_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5032,7 +5023,7 @@ static void multi_dimension_rc_track_on_ride_photo( /** rct2: 0x00793328 */ static void multi_dimension_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5113,15 +5104,15 @@ static void multi_dimension_rc_track_90_deg_up( /** rct2: 0x00793338 */ static void multi_dimension_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_90_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00793348 */ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5210,16 +5201,15 @@ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x00793358 */ static void multi_dimension_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - multi_dimension_rc_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00793368 */ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5300,7 +5290,7 @@ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x00793378 */ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5387,7 +5377,7 @@ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x007930B8 */ static void multi_dimension_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5692,7 +5682,7 @@ static void multi_dimension_rc_track_left_eighth_to_diag( /** rct2: 0x007930C8 */ static void multi_dimension_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -5997,25 +5987,25 @@ static void multi_dimension_rc_track_right_eighth_to_diag( /** rct2: 0x007930D8 */ static void multi_dimension_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x007930E8 */ static void multi_dimension_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + multi_dimension_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x007930F8 */ static void multi_dimension_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6321,7 +6311,7 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00793108 */ static void multi_dimension_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6627,27 +6617,25 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00793118 */ static void multi_dimension_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00793128 */ static void multi_dimension_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_left_eighth_bank_to_diag( - session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + multi_dimension_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x007930A8 */ static void multi_dimension_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -6939,7 +6927,7 @@ static void multi_dimension_rc_track_diag_flat( /** rct2: 0x00793158 */ static void multi_dimension_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7231,7 +7219,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( /** rct2: 0x007931B8 */ static void multi_dimension_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7397,7 +7385,7 @@ static void multi_dimension_rc_track_diag_60_deg_up( /** rct2: 0x00793138 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7689,7 +7677,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00793198 */ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -7855,7 +7843,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007931A8 */ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8021,7 +8009,7 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00793148 */ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8313,7 +8301,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00793188 */ static void multi_dimension_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8549,7 +8537,7 @@ static void multi_dimension_rc_track_diag_25_deg_down( /** rct2: 0x007931E8 */ static void multi_dimension_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8715,7 +8703,7 @@ static void multi_dimension_rc_track_diag_60_deg_down( /** rct2: 0x00793168 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -8947,7 +8935,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x007931C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9113,7 +9101,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007931D8 */ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9279,7 +9267,7 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00793178 */ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9515,7 +9503,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00793218 */ static void multi_dimension_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9685,7 +9673,7 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( /** rct2: 0x00793228 */ static void multi_dimension_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -9855,7 +9843,7 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( /** rct2: 0x00793238 */ static void multi_dimension_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10025,7 +10013,7 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( /** rct2: 0x00793248 */ static void multi_dimension_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10195,7 +10183,7 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( /** rct2: 0x00793278 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10364,7 +10352,7 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00793288 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10533,7 +10521,7 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00793258 */ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10702,7 +10690,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00793268 */ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -10871,7 +10859,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00793298 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11033,7 +11021,7 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x007932A8 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11195,7 +11183,7 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x007932B8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11364,7 +11352,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007932C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11533,7 +11521,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007931F8 */ static void multi_dimension_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11700,7 +11688,7 @@ static void multi_dimension_rc_track_diag_left_bank( /** rct2: 0x00793208 */ static void multi_dimension_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -11867,7 +11855,7 @@ static void multi_dimension_rc_track_diag_right_bank( /** rct2: 0x007932D8 */ static void multi_dimension_rc_track_left_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11979,7 +11967,7 @@ static void multi_dimension_rc_track_left_flyer_twist_up( /** rct2: 0x007932E8 */ static void multi_dimension_rc_track_right_flyer_twist_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12089,7 +12077,7 @@ static void multi_dimension_rc_track_right_flyer_twist_up( /** rct2: 0x007932F8 */ static void multi_dimension_rc_track_left_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12201,7 +12189,7 @@ static void multi_dimension_rc_track_left_flyer_twist_down( /** rct2: 0x00793308 */ static void multi_dimension_rc_track_right_flyer_twist_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12311,7 +12299,7 @@ static void multi_dimension_rc_track_right_flyer_twist_down( /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12510,7 +12498,7 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo /** rct2: 0x00793318 */ static void multi_dimension_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); @@ -12561,7 +12549,7 @@ static void multi_dimension_rc_track_block_brakes( /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12756,7 +12744,7 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) @@ -12955,7 +12943,7 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (!tileElement->AsTrack()->IsInverted()) diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index c374e6770f..1ee452a3b5 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -196,7 +196,7 @@ static constexpr const uint32_t reverse_freefall_rc_track_pieces_vertical_suppor }; static void paint_reverse_freefall_rc_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction & 1) @@ -218,7 +218,7 @@ static void paint_reverse_freefall_rc_flat( } static void paint_reverse_freefall_rc_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -252,7 +252,6 @@ static void paint_reverse_freefall_rc_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - auto ride = get_ride(rideIndex); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); @@ -261,7 +260,7 @@ static void paint_reverse_freefall_rc_station( } static void paint_reverse_freefall_rc_slope( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { TESTPAINT_IGNORE_ALL(); @@ -357,7 +356,7 @@ static void paint_reverse_freefall_rc_slope( } static void paint_reverse_freefall_rc_vertical( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t supportsImageId, trackImageId; @@ -388,7 +387,7 @@ static void paint_reverse_freefall_rc_vertical( } static void paint_reverse_freefall_rc_onride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index bb9b68d4be..5981fe93a0 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -47,7 +47,7 @@ void vehicle_visual_reverser( /** rct2: 0x0086E65C */ static void reverser_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -92,7 +92,7 @@ static void reverser_rc_track_flat( } static void reverser_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -108,7 +108,7 @@ static void reverser_rc_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -116,7 +116,7 @@ static void reverser_rc_track_station( /** rct2: 0x0086E66C */ static void reverser_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -185,7 +185,7 @@ static void reverser_rc_track_25_deg_up( /** rct2: 0x0086E67C */ static void reverser_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -254,7 +254,7 @@ static void reverser_rc_track_flat_to_25_deg_up( /** rct2: 0x0086E68C */ static void reverser_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -323,31 +323,31 @@ static void reverser_rc_track_25_deg_up_to_flat( /** rct2: 0x0086E69C */ static void reverser_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - reverser_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0086E6AC */ static void reverser_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - reverser_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0086E6BC */ static void reverser_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - reverser_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0086E6CC */ static void reverser_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -528,16 +528,16 @@ static void reverser_rc_track_left_quarter_turn_5( /** rct2: 0x0086E6DC */ static void reverser_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - reverser_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + reverser_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0086E6EC */ static void reverser_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -676,7 +676,7 @@ static void reverser_rc_track_s_bend_left( /** rct2: 0x0086E6FC */ static void reverser_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -815,7 +815,7 @@ static void reverser_rc_track_s_bend_right( /** rct2: 0x0086E73C */ static void reverser_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -922,16 +922,16 @@ static void reverser_rc_track_left_quarter_turn_3( /** rct2: 0x0086E74C */ static void reverser_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - reverser_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + reverser_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0086E75C */ static void reverser_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -956,7 +956,7 @@ static void reverser_rc_track_brakes( /** rct2: 0x0086E76C */ static void reverser_rc_track_left_reverser( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1141,7 +1141,7 @@ static void reverser_rc_track_left_reverser( /** rct2: 0x0086E77C */ static void reverser_rc_track_right_reverser( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index b01962c004..c9cc7362ab 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -67,7 +67,7 @@ constexpr int32_t SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_3_A = 21879; /** rct2: 0x0077839C */ static void side_friction_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -139,7 +139,7 @@ static void side_friction_rc_track_flat( /** rct2: 0x007784AC, 0x007784BC, 0x007784CC */ static void side_friction_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -152,7 +152,7 @@ static void side_friction_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -160,7 +160,7 @@ static void side_friction_rc_track_station( /** rct2: 0x007783AC */ static void side_friction_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -245,7 +245,7 @@ static void side_friction_rc_track_25_deg_up( /** rct2: 0x007783CC */ static void side_friction_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -330,7 +330,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( /** rct2: 0x007783FC */ static void side_friction_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -415,31 +415,31 @@ static void side_friction_rc_track_25_deg_up_to_flat( /** rct2: 0x0077840C */ static void side_friction_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0077842C */ static void side_friction_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0077845C */ static void side_friction_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0077846C */ static void side_friction_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -680,16 +680,16 @@ static void side_friction_rc_track_left_quarter_turn_5( /** rct2: 0x0077847C */ static void side_friction_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - side_friction_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + side_friction_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0077848C */ static void side_friction_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -876,7 +876,7 @@ static void side_friction_rc_track_s_bend_left( /** rct2: 0x0077849C */ static void side_friction_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1063,7 +1063,7 @@ static void side_friction_rc_track_s_bend_right( /** rct2: 0x007784DC */ static void side_friction_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1206,16 +1206,16 @@ static void side_friction_rc_track_left_quarter_turn_3( /** rct2: 0x007784EC */ static void side_friction_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - side_friction_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + side_friction_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x007784FC */ static void side_friction_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1244,7 +1244,7 @@ static void side_friction_rc_track_brakes( /** rct2: 0x007785DC */ static void side_friction_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1437,7 +1437,7 @@ static void side_friction_rc_track_left_eighth_to_diag( /** rct2: 0x007785EC */ static void side_friction_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1629,25 +1629,25 @@ static void side_friction_rc_track_right_eighth_to_diag( /** rct2: 0x007785FC */ static void side_friction_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - side_friction_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0077860C */ static void side_friction_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - side_friction_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + side_friction_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x0077850C */ static void side_friction_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1813,7 +1813,7 @@ static void side_friction_rc_track_diag_flat( /** rct2: 0x0077853C */ static void side_friction_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1995,7 +1995,7 @@ static void side_friction_rc_track_diag_25_deg_up( /** rct2: 0x0077851C */ static void side_friction_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2161,7 +2161,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x0077852C */ static void side_friction_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2343,7 +2343,7 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x0077859C */ static void side_friction_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2525,7 +2525,7 @@ static void side_friction_rc_track_diag_25_deg_down( /** rct2: 0x0077857C */ static void side_friction_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2702,7 +2702,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x0077858C */ static void side_friction_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2867,7 +2867,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( } static void side_friction_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -2926,14 +2926,14 @@ static void side_friction_rc_track_60_deg_up( } static void side_friction_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void side_friction_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -2989,14 +2989,14 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( } static void side_friction_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void side_friction_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3052,14 +3052,14 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( } static void side_friction_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void side_friction_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3144,14 +3144,14 @@ static void side_friction_rc_track_diag_60_deg_up( } static void side_friction_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - side_friction_rc_track_diag_60_deg_up(session, rideIndex, 3 - trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_diag_60_deg_up(session, ride, 3 - trackSequence, (direction + 2) % 4, height, tileElement); } static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3240,15 +3240,15 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( } static void side_friction_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { side_friction_rc_track_diag_60_deg_up_to_25_deg_up( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); }; static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3335,11 +3335,11 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( } static void side_friction_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { side_friction_rc_track_diag_25_deg_up_to_60_deg_up( - session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); }; TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 363c90fa93..8efc32d929 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -27,7 +27,7 @@ namespace SingleRailRC { static void TrackFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -91,7 +91,7 @@ namespace SingleRailRC } static void TrackStation( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -117,14 +117,14 @@ namespace SingleRailRC session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 2, height - 2, 0, 2, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 4, 7); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 4, 7); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } static void Track25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -203,7 +203,7 @@ namespace SingleRailRC } static void Track60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -282,7 +282,7 @@ namespace SingleRailRC } static void TrackFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -361,7 +361,7 @@ namespace SingleRailRC } static void Track25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -452,7 +452,7 @@ namespace SingleRailRC } static void Track60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -543,7 +543,7 @@ namespace SingleRailRC } static void Track25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -622,49 +622,49 @@ namespace SingleRailRC } static void Track25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -704,14 +704,14 @@ namespace SingleRailRC } static void Track90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegUpTo90DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -760,14 +760,14 @@ namespace SingleRailRC } static void Track90DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpTo90DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track90DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -808,7 +808,7 @@ namespace SingleRailRC } static void Track60DegDownTo90DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -851,7 +851,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -979,15 +979,15 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1188,15 +1188,15 @@ namespace SingleRailRC } static void TrackRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1361,7 +1361,7 @@ namespace SingleRailRC } static void TrackRightEighthToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1526,23 +1526,23 @@ namespace SingleRailRC } static void TrackLeftEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightEighthToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } static void TrackDiagFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1699,7 +1699,7 @@ namespace SingleRailRC } static void TrackDiag25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1856,7 +1856,7 @@ namespace SingleRailRC } static void TrackDiag25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2013,7 +2013,7 @@ namespace SingleRailRC } static void TrackDiagFlatTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2170,7 +2170,7 @@ namespace SingleRailRC } static void TrackDiag25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2327,7 +2327,7 @@ namespace SingleRailRC } static void TrackDiagFlatTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2482,7 +2482,7 @@ namespace SingleRailRC } static void TrackDiag25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2639,7 +2639,7 @@ namespace SingleRailRC } static void TrackDiag60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2796,7 +2796,7 @@ namespace SingleRailRC } static void TrackDiag25DegUpTo60DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2953,7 +2953,7 @@ namespace SingleRailRC } static void TrackDiag60DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3110,7 +3110,7 @@ namespace SingleRailRC } static void TrackDiag60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3267,7 +3267,7 @@ namespace SingleRailRC } static void TrackDiag25DegDownTo60DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3424,7 +3424,7 @@ namespace SingleRailRC } static void TrackDiag60DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3581,7 +3581,7 @@ namespace SingleRailRC } static void TrackFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3624,7 +3624,7 @@ namespace SingleRailRC } static void TrackFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3667,21 +3667,21 @@ namespace SingleRailRC } static void TrackLeftBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3731,7 +3731,7 @@ namespace SingleRailRC } static void TrackRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3781,7 +3781,7 @@ namespace SingleRailRC } static void Track25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3831,7 +3831,7 @@ namespace SingleRailRC } static void Track25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3881,35 +3881,35 @@ namespace SingleRailRC } static void TrackLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToRightBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBankTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -3946,14 +3946,14 @@ namespace SingleRailRC } static void TrackRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackDiagFlatToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4040,7 +4040,7 @@ namespace SingleRailRC } static void TrackDiagFlatToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4127,7 +4127,7 @@ namespace SingleRailRC } static void TrackDiagLeftBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4214,7 +4214,7 @@ namespace SingleRailRC } static void TrackDiagRightBankToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4301,7 +4301,7 @@ namespace SingleRailRC } static void TrackDiagLeftBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4388,7 +4388,7 @@ namespace SingleRailRC } static void TrackDiagRightBankTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4475,7 +4475,7 @@ namespace SingleRailRC } static void TrackDiag25DegUpToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4562,7 +4562,7 @@ namespace SingleRailRC } static void TrackDiag25DegUpToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4649,7 +4649,7 @@ namespace SingleRailRC } static void TrackDiagLeftBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4734,7 +4734,7 @@ namespace SingleRailRC } static void TrackDiagRightBankTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4819,7 +4819,7 @@ namespace SingleRailRC } static void TrackDiag25DegDownToLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4906,7 +4906,7 @@ namespace SingleRailRC } static void TrackDiag25DegDownToRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4993,7 +4993,7 @@ namespace SingleRailRC } static void TrackDiagLeftBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5076,7 +5076,7 @@ namespace SingleRailRC } static void TrackDiagRightBank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5159,7 +5159,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5295,15 +5295,15 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Bank( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackBankedLeftQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5512,15 +5512,15 @@ namespace SingleRailRC } static void TrackBankedRightQuarterTurn5( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5685,7 +5685,7 @@ namespace SingleRailRC } static void TrackRightEighthBankToDiag( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5850,23 +5850,23 @@ namespace SingleRailRC } static void TrackLeftEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightEighthBankToOrthogonal( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5964,7 +5964,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6068,23 +6068,23 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6285,7 +6285,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6486,23 +6486,23 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn160DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6546,7 +6546,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn160DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6590,21 +6590,21 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn160DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightQuarterTurn160DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn160DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn160DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftQuarterTurn160DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn160DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftQuarterTurn190DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6656,7 +6656,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn190DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6708,21 +6708,21 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn190DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightQuarterTurn190DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn190DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightQuarterTurn190DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftQuarterTurn190DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn190DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6774,7 +6774,7 @@ namespace SingleRailRC } static void Track25DegUpToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6826,7 +6826,7 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6878,7 +6878,7 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpTo25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6930,35 +6930,35 @@ namespace SingleRailRC } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpTo25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7006,7 +7006,7 @@ namespace SingleRailRC } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7054,7 +7054,7 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7102,7 +7102,7 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7150,35 +7150,35 @@ namespace SingleRailRC } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegUpLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7226,7 +7226,7 @@ namespace SingleRailRC } static void Track25DegUpRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7274,21 +7274,21 @@ namespace SingleRailRC } static void Track25DegDownLeftBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpRightBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track25DegDownRightBanked( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track25DegUpLeftBanked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7340,7 +7340,7 @@ namespace SingleRailRC } static void TrackFlatToRightBanked25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7392,7 +7392,7 @@ namespace SingleRailRC } static void TrackLeftBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7444,7 +7444,7 @@ namespace SingleRailRC } static void TrackRightBanked25DegUpToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -7496,35 +7496,35 @@ namespace SingleRailRC } static void TrackFlatToLeftBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackFlatToRightBanked25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBanked25DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToRightBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBanked25DegDownToFlat( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatToLeftBanked25DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7622,7 +7622,7 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7726,23 +7726,23 @@ namespace SingleRailRC } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftBankedQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7943,7 +7943,7 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn525DegUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8144,23 +8144,23 @@ namespace SingleRailRC } static void TrackLeftBankedQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightBankedQuarterTurn525DegDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn525DegUp(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackSBendLeft( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8314,7 +8314,7 @@ namespace SingleRailRC } static void TrackSBendRight( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8468,7 +8468,7 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8735,7 +8735,7 @@ namespace SingleRailRC } static void TrackRightHalfBankedHelixUpSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9002,7 +9002,7 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -9011,11 +9011,11 @@ namespace SingleRailRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightHalfBankedHelixUpSmall(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightHalfBankedHelixDownSmall( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -9024,11 +9024,11 @@ namespace SingleRailRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpSmall(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9440,7 +9440,7 @@ namespace SingleRailRC } } static void TrackRightHalfBankedHelixUpLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9865,7 +9865,7 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -9874,11 +9874,11 @@ namespace SingleRailRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightHalfBankedHelixUpLarge(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightHalfBankedHelixDownLarge( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -9887,11 +9887,11 @@ namespace SingleRailRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpLarge(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } static void TrackLeftBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10072,7 +10072,7 @@ namespace SingleRailRC } static void TrackRightBarrelRollUpToDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10253,21 +10253,21 @@ namespace SingleRailRC } static void TrackLeftBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackRightBarrelRollDownToUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightBarrelRollUpToDown(session, rideIndex, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackHalfLoopUp( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10408,14 +10408,14 @@ namespace SingleRailRC } static void TrackHalfLoopDown( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackHalfLoopUp(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + TrackHalfLoopUp(session, ride, 3 - trackSequence, direction, height, tileElement); } static void TrackBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10444,7 +10444,7 @@ namespace SingleRailRC } static void TrackOnRidePhoto( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10501,7 +10501,7 @@ namespace SingleRailRC } static void TrackFlatTo60DegUpLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10670,7 +10670,7 @@ namespace SingleRailRC } } static void Track60DegUpToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10840,21 +10840,21 @@ namespace SingleRailRC } static void TrackFlatTo60DegDownLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpToFlatLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDownToFlatLongBase( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatTo60DegUpLongBase(session, rideIndex, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackBlockBrakes( - paint_session* session, uint16_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -10883,7 +10883,7 @@ namespace SingleRailRC } static void TrackLeftCorkscrewUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11000,7 +11000,7 @@ namespace SingleRailRC } static void TrackRightCorkscrewUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11115,21 +11115,21 @@ namespace SingleRailRC } static void TrackLeftCorkscrewDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightCorkscrewUp(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightCorkscrewUp(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } static void TrackRightCorkscrewDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftCorkscrewUp(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftCorkscrewUp(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11238,14 +11238,14 @@ namespace SingleRailRC } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, rideIndex, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, tileElement); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11347,7 +11347,7 @@ namespace SingleRailRC } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11449,7 +11449,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11551,7 +11551,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11653,7 +11653,7 @@ namespace SingleRailRC } static void TrackLeftLargeHalfLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11925,7 +11925,7 @@ namespace SingleRailRC } static void TrackRightLargeHalfLoopUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12197,21 +12197,21 @@ namespace SingleRailRC } static void TrackRightLargeHalfLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackRightLargeHalfLoopUp(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + TrackRightLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, tileElement); } static void TrackLeftLargeHalfLoopDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackLeftLargeHalfLoopUp(session, rideIndex, 6 - trackSequence, direction, height, tileElement); + TrackLeftLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, tileElement); } static void TrackFlatTo60DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -12320,7 +12320,7 @@ namespace SingleRailRC } static void Track60DegUpToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -12415,21 +12415,21 @@ namespace SingleRailRC } static void TrackFlatTo60DegDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - Track60DegUpToFlat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void Track60DegDownToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - TrackFlatTo60DegUp(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void TrackDiagFlatTo60DegUp( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12586,7 +12586,7 @@ namespace SingleRailRC } static void TrackDiag60DegUpToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12743,7 +12743,7 @@ namespace SingleRailRC } static void TrackDiagFlatTo60DegDown( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12900,7 +12900,7 @@ namespace SingleRailRC } static void TrackDiag60DegDownToFlat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index e4a419055d..46b5e5d675 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _StandUpBlockBrakeImages[NumOrthogonalDirections /** rct2: 0x008A7114 */ static void stand_up_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -89,7 +89,7 @@ static void stand_up_rc_track_flat( /** rct2: 0x008A7384, 0x008A7394, 0x008A73A4 */ static void stand_up_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -115,7 +115,7 @@ static void stand_up_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -123,7 +123,7 @@ static void stand_up_rc_track_station( /** rct2: 0x008A7124 */ static void stand_up_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -193,7 +193,7 @@ static void stand_up_rc_track_25_deg_up( /** rct2: 0x008A7134 */ static void stand_up_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -263,7 +263,7 @@ static void stand_up_rc_track_60_deg_up( /** rct2: 0x008A7144 */ static void stand_up_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -333,7 +333,7 @@ static void stand_up_rc_track_flat_to_25_deg_up( /** rct2: 0x008A7154 */ static void stand_up_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -411,7 +411,7 @@ static void stand_up_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A7164 */ static void stand_up_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -489,7 +489,7 @@ static void stand_up_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A7174 */ static void stand_up_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -559,55 +559,55 @@ static void stand_up_rc_track_25_deg_up_to_flat( /** rct2: 0x008A7184 */ static void stand_up_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7194 */ static void stand_up_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A71A4 */ static void stand_up_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A71B4 */ static void stand_up_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A71C4 */ static void stand_up_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A71D4 */ static void stand_up_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A71E4 */ static void stand_up_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -764,16 +764,16 @@ static void stand_up_rc_track_left_quarter_turn_5( /** rct2: 0x008A71F4 */ static void stand_up_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7204 */ static void stand_up_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -807,7 +807,7 @@ static void stand_up_rc_track_flat_to_left_bank( /** rct2: 0x008A7214 */ static void stand_up_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -841,7 +841,7 @@ static void stand_up_rc_track_flat_to_right_bank( /** rct2: 0x008A7224 */ static void stand_up_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -875,7 +875,7 @@ static void stand_up_rc_track_left_bank_to_flat( /** rct2: 0x008A7234 */ static void stand_up_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -909,7 +909,7 @@ static void stand_up_rc_track_right_bank_to_flat( /** rct2: 0x008A7244 */ static void stand_up_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1083,16 +1083,16 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A7254 */ static void stand_up_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_banked_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7264 */ static void stand_up_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1133,7 +1133,7 @@ static void stand_up_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A7274 */ static void stand_up_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1174,7 +1174,7 @@ static void stand_up_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A7284 */ static void stand_up_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1215,7 +1215,7 @@ static void stand_up_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A7294 */ static void stand_up_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1256,39 +1256,39 @@ static void stand_up_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A72A4 */ static void stand_up_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A72B4 */ static void stand_up_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A72C4 */ static void stand_up_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A72D4 */ static void stand_up_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A72E4 */ static void stand_up_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1322,15 +1322,15 @@ static void stand_up_rc_track_left_bank( /** rct2: 0x008A72F4 */ static void stand_up_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A7304 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1618,7 +1618,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A7314 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1906,27 +1906,25 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A7324 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7334 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7344 */ static void stand_up_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2061,7 +2059,7 @@ static void stand_up_rc_track_s_bend_left( /** rct2: 0x008A7354 */ static void stand_up_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2196,7 +2194,7 @@ static void stand_up_rc_track_s_bend_right( /** rct2: 0x008A7364 */ static void stand_up_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2453,7 +2451,7 @@ static void stand_up_rc_track_left_vertical_loop( /** rct2: 0x008A7374 */ static void stand_up_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2678,7 +2676,7 @@ static void stand_up_rc_track_right_vertical_loop( /** rct2: 0x008A73B4 */ static void stand_up_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2778,16 +2776,16 @@ static void stand_up_rc_track_left_quarter_turn_3( /** rct2: 0x008A73C4 */ static void stand_up_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A73D4 */ static void stand_up_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2899,16 +2897,16 @@ static void stand_up_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A73E4 */ static void stand_up_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A73F4 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3043,7 +3041,7 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A7404 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3190,27 +3188,25 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A7414 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7424 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7434 */ static void stand_up_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3336,15 +3332,15 @@ static void stand_up_rc_track_half_loop_up( /** rct2: 0x008A7444 */ static void stand_up_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_half_loop_up(session, rideIndex, 3 - trackSequence, direction, height, tileElement); + stand_up_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); } /** rct2: 0x008A7454 */ static void stand_up_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3456,7 +3452,7 @@ static void stand_up_rc_track_left_corkscrew_up( /** rct2: 0x008A7464 */ static void stand_up_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3569,23 +3565,23 @@ static void stand_up_rc_track_right_corkscrew_up( /** rct2: 0x008A7474 */ static void stand_up_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_right_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7484 */ static void stand_up_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - stand_up_rc_track_left_corkscrew_up(session, rideIndex, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7734 */ static void stand_up_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3803,7 +3799,7 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A7744 */ static void stand_up_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4021,7 +4017,7 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A7754 */ static void stand_up_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4030,13 +4026,12 @@ static void stand_up_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7764 */ static void stand_up_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4045,13 +4040,12 @@ static void stand_up_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A76F4 */ static void stand_up_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4393,7 +4387,7 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A7704 */ static void stand_up_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4735,7 +4729,7 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A7714 */ static void stand_up_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4744,13 +4738,12 @@ static void stand_up_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A7724 */ static void stand_up_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -4759,13 +4752,12 @@ static void stand_up_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A7494 */ static void stand_up_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4793,7 +4785,7 @@ static void stand_up_rc_track_brakes( /** rct2: 0x008A74A4 */ static void stand_up_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -4835,7 +4827,7 @@ static void stand_up_rc_track_on_ride_photo( /** rct2: 0x008A74B4 */ static void stand_up_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4974,7 +4966,7 @@ static void stand_up_rc_track_left_eighth_to_diag( /** rct2: 0x008A74C4 */ static void stand_up_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5112,25 +5104,25 @@ static void stand_up_rc_track_right_eighth_to_diag( /** rct2: 0x008A74D4 */ static void stand_up_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A74E4 */ static void stand_up_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + stand_up_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A76A4 */ static void stand_up_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5272,7 +5264,7 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A76B4 */ static void stand_up_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5413,25 +5405,25 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A76C4 */ static void stand_up_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A76D4 */ static void stand_up_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + stand_up_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A74F4 */ static void stand_up_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5577,7 +5569,7 @@ static void stand_up_rc_track_diag_flat( /** rct2: 0x008A7524 */ static void stand_up_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5723,7 +5715,7 @@ static void stand_up_rc_track_diag_25_deg_up( /** rct2: 0x008A7584 */ static void stand_up_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5869,7 +5861,7 @@ static void stand_up_rc_track_diag_60_deg_up( /** rct2: 0x008A7504 */ static void stand_up_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6015,7 +6007,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A7564 */ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6161,7 +6153,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A7574 */ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6307,7 +6299,7 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A7514 */ static void stand_up_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6453,7 +6445,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A7554 */ static void stand_up_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6599,7 +6591,7 @@ static void stand_up_rc_track_diag_25_deg_down( /** rct2: 0x008A75B4 */ static void stand_up_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6745,7 +6737,7 @@ static void stand_up_rc_track_diag_60_deg_down( /** rct2: 0x008A7534 */ static void stand_up_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6889,7 +6881,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A7594 */ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7035,7 +7027,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A75A4 */ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7181,7 +7173,7 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A7544 */ static void stand_up_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7327,7 +7319,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A75E4 */ static void stand_up_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7406,7 +7398,7 @@ static void stand_up_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A75F4 */ static void stand_up_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7485,7 +7477,7 @@ static void stand_up_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A7604 */ static void stand_up_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7564,7 +7556,7 @@ static void stand_up_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A7614 */ static void stand_up_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7643,7 +7635,7 @@ static void stand_up_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A7644 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7722,7 +7714,7 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A7654 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7801,7 +7793,7 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A7624 */ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7880,7 +7872,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A7634 */ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7959,7 +7951,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A7664 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8036,7 +8028,7 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A7674 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8113,7 +8105,7 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A7684 */ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8192,7 +8184,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A7694 */ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8271,7 +8263,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A75C4 */ static void stand_up_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8347,7 +8339,7 @@ static void stand_up_rc_track_diag_left_bank( /** rct2: 0x008A75D4 */ static void stand_up_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8423,7 +8415,7 @@ static void stand_up_rc_track_diag_right_bank( /** rct2: 0x008A76E4 */ static void stand_up_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index bf05e574f2..03d3549b5d 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A59A8 */ static void steeplechase_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -70,7 +70,7 @@ static void steeplechase_track_flat( } static void steeplechase_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -87,7 +87,7 @@ static void steeplechase_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 3, height, 0, 0, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -95,7 +95,7 @@ static void steeplechase_track_station( /** rct2: 0x008A59B8 */ static void steeplechase_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -173,7 +173,7 @@ static void steeplechase_track_25_deg_up( /** rct2: 0x008A59C8 */ static void steeplechase_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -251,7 +251,7 @@ static void steeplechase_track_flat_to_25_deg_up( /** rct2: 0x008A59D8 */ static void steeplechase_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -329,31 +329,31 @@ static void steeplechase_track_25_deg_up_to_flat( /** rct2: 0x008A59E8 */ static void steeplechase_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - steeplechase_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A59F8 */ static void steeplechase_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - steeplechase_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5A08 */ static void steeplechase_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - steeplechase_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5A18 */ static void steeplechase_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -524,16 +524,16 @@ static void steeplechase_track_left_quarter_turn_5( /** rct2: 0x008A5A28 */ static void steeplechase_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - steeplechase_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + steeplechase_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A5A38 */ static void steeplechase_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -682,7 +682,7 @@ static void steeplechase_track_s_bend_left( /** rct2: 0x008A5A48 */ static void steeplechase_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -831,7 +831,7 @@ static void steeplechase_track_s_bend_right( /** rct2: 0x008A5A88 */ static void steeplechase_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -945,16 +945,16 @@ static void steeplechase_track_left_quarter_turn_3( /** rct2: 0x008A5A98 */ static void steeplechase_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - steeplechase_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + steeplechase_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A5AA8 */ static void steeplechase_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -981,7 +981,7 @@ static void steeplechase_track_brakes( /** rct2: 0x008A5AD8 */ static void steeplechase_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1127,7 +1127,7 @@ static void steeplechase_track_left_eighth_to_diag( /** rct2: 0x008A5AE8 */ static void steeplechase_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1272,25 +1272,25 @@ static void steeplechase_track_right_eighth_to_diag( /** rct2: 0x008A5AF8 */ static void steeplechase_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - steeplechase_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5B08 */ static void steeplechase_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - steeplechase_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + steeplechase_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A5AC8 */ static void steeplechase_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1436,7 +1436,7 @@ static void steeplechase_track_diag_flat( /** rct2: 0x008A5B38 */ static void steeplechase_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1582,7 +1582,7 @@ static void steeplechase_track_diag_25_deg_up( /** rct2: 0x008A5B18 */ static void steeplechase_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1728,7 +1728,7 @@ static void steeplechase_track_diag_flat_to_25_deg_up( /** rct2: 0x008A5B28 */ static void steeplechase_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1874,7 +1874,7 @@ static void steeplechase_track_diag_25_deg_up_to_flat( /** rct2: 0x008A5B68 */ static void steeplechase_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2020,7 +2020,7 @@ static void steeplechase_track_diag_25_deg_down( /** rct2: 0x008A5B48 */ static void steeplechase_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2164,7 +2164,7 @@ static void steeplechase_track_diag_flat_to_25_deg_down( /** rct2: 0x008A5B58 */ static void steeplechase_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2310,7 +2310,7 @@ static void steeplechase_track_diag_25_deg_down_to_flat( /** rct2: 0x008A5AB8 */ static void steeplechase_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index e304d1a82b..d4ca4bcdcb 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A8958 */ static void suspended_swinging_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -73,7 +73,7 @@ static void suspended_swinging_rc_track_flat( /** rct2: 0x008A8AA8, 0x008A8AB8, 0x008A8AC8 */ static void suspended_swinging_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -92,7 +92,7 @@ static void suspended_swinging_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -100,7 +100,7 @@ static void suspended_swinging_rc_track_station( /** rct2: 0x008A8968 */ static void suspended_swinging_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -194,7 +194,7 @@ static void suspended_swinging_rc_track_25_deg_up( /** rct2: 0x008A8978 */ static void suspended_swinging_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -235,7 +235,7 @@ static void suspended_swinging_rc_track_60_deg_up( /** rct2: 0x008A8988 */ static void suspended_swinging_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -329,7 +329,7 @@ static void suspended_swinging_rc_track_flat_to_25_deg_up( /** rct2: 0x008A8998 */ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -376,7 +376,7 @@ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A89A8 */ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -482,7 +482,7 @@ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A89B8 */ static void suspended_swinging_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (tileElement->AsTrack()->HasChain()) @@ -576,57 +576,55 @@ static void suspended_swinging_rc_track_25_deg_up_to_flat( /** rct2: 0x008A89C8 */ static void suspended_swinging_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A89D8 */ static void suspended_swinging_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A89E8 */ static void suspended_swinging_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A89F8 */ static void suspended_swinging_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A8A08 */ static void suspended_swinging_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A8A18 */ static void suspended_swinging_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_swinging_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A8A28 */ static void suspended_swinging_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -806,17 +804,16 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( /** rct2: 0x008A8A38 */ static void suspended_swinging_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - suspended_swinging_rc_track_left_quarter_turn_5( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_swinging_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A8A48 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -982,7 +979,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A8A58 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1148,27 +1145,27 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A8A68 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A8A78 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A8A88 */ static void suspended_swinging_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1327,7 +1324,7 @@ static void suspended_swinging_rc_track_s_bend_left( /** rct2: 0x008A8A98 */ static void suspended_swinging_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1486,7 +1483,7 @@ static void suspended_swinging_rc_track_s_bend_right( /** rct2: 0x008A8AD8 */ static void suspended_swinging_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1605,17 +1602,16 @@ static void suspended_swinging_rc_track_left_quarter_turn_3( /** rct2: 0x008A8AE8 */ static void suspended_swinging_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - suspended_swinging_rc_track_left_quarter_turn_3( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_swinging_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A8AF8 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1702,7 +1698,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A8B08 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1789,27 +1785,27 @@ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A8B18 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008A8B28 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1841,7 +1837,7 @@ static void suspended_swinging_rc_track_brakes( /** rct2: 0x008A8B48 */ static void suspended_swinging_rc_track_left_quarter_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2026,7 +2022,7 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( /** rct2: 0x008A8B58 */ static void suspended_swinging_rc_track_right_quarter_helix_large_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2211,7 +2207,7 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( /** rct2: 0x008A8B68 */ static void suspended_swinging_rc_track_left_quarter_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2396,7 +2392,7 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( /** rct2: 0x008A8B78 */ static void suspended_swinging_rc_track_right_quarter_helix_large_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2581,7 +2577,7 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( /** rct2: 0x008A8B88 */ static void suspended_swinging_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2744,7 +2740,7 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( /** rct2: 0x008A8B98 */ static void suspended_swinging_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2907,27 +2903,25 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( /** rct2: 0x008A8BA8 */ static void suspended_swinging_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_swinging_rc_track_right_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A8BB8 */ static void suspended_swinging_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_swinging_rc_track_left_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + suspended_swinging_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008A8BC8 */ static void suspended_swinging_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3066,7 +3060,7 @@ static void suspended_swinging_rc_track_diag_flat( /** rct2: 0x008A8BF8 */ static void suspended_swinging_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3205,7 +3199,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up( /** rct2: 0x008A8C58 */ static void suspended_swinging_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3288,7 +3282,7 @@ static void suspended_swinging_rc_track_diag_60_deg_up( /** rct2: 0x008A8BD8 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3427,7 +3421,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A8C38 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3510,7 +3504,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A8C48 */ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3593,7 +3587,7 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A8BE8 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3732,7 +3726,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A8C28 */ static void suspended_swinging_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3871,7 +3865,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down( /** rct2: 0x008A8C88 */ static void suspended_swinging_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3933,7 +3927,7 @@ static void suspended_swinging_rc_track_diag_60_deg_down( /** rct2: 0x008A8C08 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4069,7 +4063,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A8C68 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4152,7 +4146,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A8C78 */ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4235,7 +4229,7 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A8C18 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4374,7 +4368,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) diff --git a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp index a9453b8903..5d95d7eb23 100644 --- a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp @@ -21,1596 +21,1581 @@ /** rct2: 0x008AB6A4 */ static void twister_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_flat(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8F4, 0x008AB904, 0x008AB914 */ static void twister_rc_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_station(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6B4 */ static void twister_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_25_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6C4 */ static void twister_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_60_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6D4 */ static void twister_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6E4 */ static void twister_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6F4 */ static void twister_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB704 */ static void twister_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB714 */ static void twister_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB724 */ static void twister_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB734 */ static void twister_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB744 */ static void twister_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB754 */ static void twister_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB764 */ static void twister_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB774 */ static void twister_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB784 */ static void twister_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB794 */ static void twister_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7A4 */ static void twister_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7B4 */ static void twister_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7C4 */ static void twister_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7D4 */ static void twister_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7E4 */ static void twister_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7F4 */ static void twister_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB804 */ static void twister_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB814 */ static void twister_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB824 */ static void twister_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB834 */ static void twister_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB844 */ static void twister_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB854 */ static void twister_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB864 */ static void twister_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB874 */ static void twister_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_left_bank(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB884 */ static void twister_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB894 */ static void twister_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8A4 */ static void twister_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8B4 */ static void twister_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8C4 */ static void twister_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8D4 */ static void twister_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_s_bend_left( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8E4 */ static void twister_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_s_bend_right( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA84 */ static void twister_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_vertical_loop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA94 */ static void twister_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_vertical_loop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB924 */ static void twister_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB934 */ static void twister_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB944 */ static void twister_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB954 */ static void twister_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB964 */ static void twister_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB974 */ static void twister_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB984 */ static void twister_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB994 */ static void twister_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9A4 */ static void twister_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9B4 */ static void twister_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9C4 */ static void twister_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9D4 */ static void twister_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9E4 */ static void twister_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9F4 */ static void twister_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA04 */ static void twister_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA14 */ static void twister_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA44 */ static void twister_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA24 */ static void twister_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA34 */ static void twister_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA54 */ static void twister_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA64 */ static void twister_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE04 */ static void twister_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE14 */ static void twister_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA74 */ static void twister_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_on_ride_photo( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE24 */ static void twister_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE34 */ static void twister_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE44 */ static void twister_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_90_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE54 */ static void twister_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE64 */ static void twister_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE74 */ static void twister_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE84 */ static void twister_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE94 */ static void twister_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAB4 */ static void twister_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAC4 */ static void twister_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAD4 */ static void twister_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAE4 */ static void twister_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAF4 */ static void twister_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB04 */ static void twister_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB14 */ static void twister_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB24 */ static void twister_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAA4 */ static void twister_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_flat(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB54 */ static void twister_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBB4 */ static void twister_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB34 */ static void twister_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB94 */ static void twister_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBA4 */ static void twister_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB44 */ static void twister_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB84 */ static void twister_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBE4 */ static void twister_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB64 */ static void twister_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBC4 */ static void twister_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBD4 */ static void twister_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB74 */ static void twister_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC14 */ static void twister_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC24 */ static void twister_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC34 */ static void twister_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC44 */ static void twister_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC74 */ static void twister_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC84 */ static void twister_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC54 */ static void twister_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC64 */ static void twister_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC94 */ static void twister_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCA4 */ static void twister_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCB4 */ static void twister_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCC4 */ static void twister_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBF4 */ static void twister_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC04 */ static void twister_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD74 */ static void twister_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD84 */ static void twister_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD94 */ static void twister_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDA4 */ static void twister_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0E4 */ static void twister_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_block_brakes( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEA4 */ static void twister_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEB4 */ static void twister_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEC4 */ static void twister_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABED4 */ static void twister_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEE4 */ static void twister_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEF4 */ static void twister_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF04 */ static void twister_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF14 */ static void twister_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF24 */ static void twister_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF34 */ static void twister_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF44 */ static void twister_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF54 */ static void twister_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF64 */ static void twister_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF74 */ static void twister_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF84 */ static void twister_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF94 */ static void twister_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFA4 */ static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFB4 */ static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFE4 */ static void twister_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFF4 */ static void twister_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC004 */ static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC014 */ static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFC4 */ static void twister_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFD4 */ static void twister_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC024 */ static void twister_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC034 */ static void twister_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC044 */ static void twister_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC054 */ static void twister_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC064 */ static void twister_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC074 */ static void twister_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC084 */ static void twister_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC094 */ static void twister_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0A4 */ static void twister_rc_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0B4 */ static void twister_rc_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0C4 */ static void twister_rc_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0D4 */ static void twister_rc_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /* The following track elements used to be specific to the Vertical Roller Coaster */ static void twister_rc_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_brake_for_drop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_brake_for_drop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_brake_for_drop(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /* The following track elements used to be specific to the Steel Twister */ /** rct2: 0x008ABCD4 */ static void twister_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCE4 */ static void twister_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_half_loop_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD34 */ static void twister_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_corkscrew_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD44 */ static void twister_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_corkscrew_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD54 */ static void twister_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_corkscrew_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD64 */ static void twister_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_corkscrew_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0F4 */ static void twister_rc_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC104 */ static void twister_rc_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC114 */ static void twister_rc_track_60_deg_down_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC124 */ static void twister_rc_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCF4 */ static void twister_rc_track_left_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD04 */ static void twister_rc_track_right_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD14 */ static void twister_rc_track_left_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD24 */ static void twister_rc_track_right_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDB4 */ static void twister_rc_track_powered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_powered_lift( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDC4 */ static void twister_rc_track_left_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDD4 */ static void twister_rc_track_right_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDE4 */ static void twister_rc_track_right_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDF4 */ static void twister_rc_track_left_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC134 */ static void twister_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC144 */ static void twister_rc_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_booster(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); } TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp b/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp index 2a15f7b474..6b8f4a7c91 100644 --- a/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp @@ -14,1583 +14,1568 @@ /** rct2: 0x008AA00C */ static void vertical_drop_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_flat(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_station(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA01C */ static void vertical_drop_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_25_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA02C */ static void vertical_drop_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_60_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA03C */ static void vertical_drop_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA04C */ static void vertical_drop_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA05C */ static void vertical_drop_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA06C */ static void vertical_drop_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA07C */ static void vertical_drop_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA08C */ static void vertical_drop_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA09C */ static void vertical_drop_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0AC */ static void vertical_drop_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0BC */ static void vertical_drop_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0CC */ static void vertical_drop_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0DC */ static void vertical_drop_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0EC */ static void vertical_drop_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0FC */ static void vertical_drop_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA10C */ static void vertical_drop_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA11C */ static void vertical_drop_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA12C */ static void vertical_drop_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA13C */ static void vertical_drop_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA14C */ static void vertical_drop_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA15C */ static void vertical_drop_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA16C */ static void vertical_drop_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA17C */ static void vertical_drop_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA18C */ static void vertical_drop_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA19C */ static void vertical_drop_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1AC */ static void vertical_drop_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1BC */ static void vertical_drop_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1CC */ static void vertical_drop_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1DC */ static void vertical_drop_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_left_bank(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1EC */ static void vertical_drop_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1FC */ static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA20C */ static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA21C */ static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA22C */ static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA23C */ static void vertical_drop_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_s_bend_left( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA24C */ static void vertical_drop_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_s_bend_right( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA49C */ static void vertical_drop_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_vertical_loop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4AC */ static void vertical_drop_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_vertical_loop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA28C */ static void vertical_drop_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA29C */ static void vertical_drop_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2AC */ static void vertical_drop_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2BC */ static void vertical_drop_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2CC */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2DC */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2EC */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2FC */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA30C */ static void vertical_drop_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA31C */ static void vertical_drop_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA32C */ static void vertical_drop_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA33C */ static void vertical_drop_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA34C */ static void vertical_drop_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA35C */ static void vertical_drop_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA36C */ static void vertical_drop_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA37C */ static void vertical_drop_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3AC */ static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA38C */ static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA39C */ static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3BC */ static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA40C */ static void vertical_drop_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_brakes(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7EC */ static void vertical_drop_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7FC */ static void vertical_drop_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA41C */ static void vertical_drop_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_on_ride_photo( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA80C */ static void vertical_drop_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA81C */ static void vertical_drop_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA42C */ static void vertical_drop_rc_track_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_90_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA43C */ static void vertical_drop_rc_track_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA44C */ static void vertical_drop_rc_track_60_deg_up_to_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA45C */ static void vertical_drop_rc_track_90_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA46C */ static void vertical_drop_rc_track_90_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA47C */ static void vertical_drop_rc_track_60_deg_down_to_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4CC */ static void vertical_drop_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4DC */ static void vertical_drop_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4EC */ static void vertical_drop_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4FC */ static void vertical_drop_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA50C */ static void vertical_drop_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA51C */ static void vertical_drop_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA52C */ static void vertical_drop_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA53C */ static void vertical_drop_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4BC */ static void vertical_drop_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_flat(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA56C */ static void vertical_drop_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5CC */ static void vertical_drop_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA54C */ static void vertical_drop_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5AC */ static void vertical_drop_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5BC */ static void vertical_drop_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA55C */ static void vertical_drop_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA59C */ static void vertical_drop_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5FC */ static void vertical_drop_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA57C */ static void vertical_drop_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5DC */ static void vertical_drop_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5EC */ static void vertical_drop_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA58C */ static void vertical_drop_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA62C */ static void vertical_drop_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA63C */ static void vertical_drop_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA64C */ static void vertical_drop_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA65C */ static void vertical_drop_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA68C */ static void vertical_drop_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA69C */ static void vertical_drop_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA66C */ static void vertical_drop_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA67C */ static void vertical_drop_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6AC */ static void vertical_drop_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6BC */ static void vertical_drop_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6CC */ static void vertical_drop_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6DC */ static void vertical_drop_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA60C */ static void vertical_drop_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_diag_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA61C */ static void vertical_drop_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA72C */ static void vertical_drop_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA73C */ static void vertical_drop_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA74C */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA75C */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9EC */ static void vertical_drop_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_block_brakes( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA96C */ static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA97C */ static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA98C */ static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA99C */ static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8AC */ static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8BC */ static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8CC */ static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8DC */ static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA82C */ static void vertical_drop_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA83C */ static void vertical_drop_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA84C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA85C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA86C */ static void vertical_drop_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA87C */ static void vertical_drop_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA88C */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA89C */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8EC */ static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8FC */ static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA92C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA93C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA94C */ static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA95C */ static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA90C */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA91C */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA76C */ static void vertical_drop_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA77C */ static void vertical_drop_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA78C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA79C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7AC */ static void vertical_drop_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7BC */ static void vertical_drop_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7CC */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7DC */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9AC */ static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9BC */ static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9CC */ static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9DC */ static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /* The following elements used to be specific to the vertical_drop RC */ /** rct2: 0x008AA3CC */ static void vertical_drop_rc_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3DC */ static void vertical_drop_rc_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3EC */ static void vertical_drop_rc_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3FC */ static void vertical_drop_rc_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA48C */ static void vertical_drop_rc_track_brake_for_drop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_brake_for_drop( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_brake_for_drop(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6EC */ static void vertical_drop_rc_track_diag_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6FC */ static void vertical_drop_rc_track_diag_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA70C */ static void vertical_drop_rc_track_diag_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA71C */ static void vertical_drop_rc_track_diag_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } /* The following elements used to be specific to the steel twister RC */ static void vertical_drop_rc_track_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_half_loop_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_corkscrew_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_corkscrew_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_corkscrew_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_corkscrew_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_corkscrew_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_corkscrew_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_flat_to_60_deg_up_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_60_deg_up_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_60_deg_down_to_flat_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_flat_to_60_deg_down_long_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_barrel_roll_up_to_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_barrel_roll_down_to_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_powered_lift( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_powered_lift( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_large_half_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_large_half_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - bolliger_mabillard_track_booster(session, rideIndex, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); } TRACK_PAINT_FUNCTION get_track_paint_function_vertical_drop_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index 64515f12ba..d819d7ce8e 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -209,7 +209,7 @@ void vehicle_visual_virginia_reel( /** rct2: 0x00811264 */ static void paint_virginia_reel_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint32_t* sprites = virginia_reel_track_pieces_flat; @@ -238,7 +238,7 @@ static void paint_virginia_reel_track_flat( /** rct2: 0x00811274 */ static void paint_virginia_reel_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint32_t* sprites = virginia_reel_track_pieces_25_deg_up; @@ -290,7 +290,7 @@ static void paint_virginia_reel_track_25_deg_up( /** rct2: 0x00811294 */ static void paint_virginia_reel_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint32_t* sprites = virginia_reel_track_pieces_flat_to_25_deg_up; @@ -337,7 +337,7 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( /** rct2: 0x00811294 */ static void paint_virginia_reel_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint32_t* sprites = virginia_reel_track_pieces_25_deg_up_to_flat; @@ -389,31 +389,31 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( /** rct2: 0x008112A4 */ static void paint_virginia_reel_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_virginia_reel_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008112B4 */ static void paint_virginia_reel_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_virginia_reel_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008112C4 */ static void paint_virginia_reel_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_virginia_reel_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008112D4, 0x008112E4, 0x008112F4 */ static void paint_virginia_reel_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -440,7 +440,7 @@ static void paint_virginia_reel_station( } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -450,7 +450,7 @@ static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { 5, /** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_3_tiles_paint( @@ -480,17 +480,16 @@ static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_ /** rct2: 0x00811314 */ static void paint_virginia_reel_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = virginia_reel_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; - paint_virginia_reel_track_left_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_virginia_reel_track_left_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** rct2: 0x00811324 */ static void paint_virginia_reel_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_1_tile_paint( @@ -523,11 +522,10 @@ static void paint_virginia_reel_track_left_quarter_turn_1_tile( /** rct2: 0x00811334 */ static void paint_virginia_reel_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_virginia_reel_track_left_quarter_turn_1_tile( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_virginia_reel_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 406a3b7ca8..1f4a704fc6 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -165,7 +165,7 @@ static constexpr const uint32_t _wild_mouse_block_brakes_image_ids[NumOrthogonal /** rct2: 0x0078B1E4 */ static void wild_mouse_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -189,7 +189,7 @@ static void wild_mouse_track_flat( } static void wild_mouse_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t baseImageIds[4] = { @@ -217,7 +217,7 @@ static void wild_mouse_track_station( height, 0, 0, height); } track_paint_util_draw_station_metal_supports(session, direction, height, session->TrackColours[SCHEME_SUPPORTS]); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -225,7 +225,7 @@ static void wild_mouse_track_station( /** rct2: 0x0078B1F4 */ static void wild_mouse_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -257,7 +257,7 @@ static void wild_mouse_track_25_deg_up( /** rct2: 0x0078B204 */ static void wild_mouse_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -303,7 +303,7 @@ static void wild_mouse_track_60_deg_up( /** rct2: 0x0078B214 */ static void wild_mouse_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -335,7 +335,7 @@ static void wild_mouse_track_flat_to_25_deg_up( /** rct2: 0x0078B224 */ static void wild_mouse_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -382,7 +382,7 @@ static void wild_mouse_track_25_deg_up_to_60_deg_up( /** rct2: 0x0078B234 */ static void wild_mouse_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -429,7 +429,7 @@ static void wild_mouse_track_60_deg_up_to_25_deg_up( /** rct2: 0x0078B244 */ static void wild_mouse_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -461,54 +461,54 @@ static void wild_mouse_track_25_deg_up_to_flat( /** rct2: 0x0078B254 */ static void wild_mouse_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B264 */ static void wild_mouse_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B274 */ static void wild_mouse_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B284 */ static void wild_mouse_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B294 */ static void wild_mouse_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B2A4 */ static void wild_mouse_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void wild_mouse_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][3] = { @@ -564,7 +564,7 @@ static void wild_mouse_track_right_quarter_turn_3( } static void wild_mouse_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][2] = { @@ -623,17 +623,16 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( } static void wild_mouse_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3_25_deg_down( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3_25_deg_down(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x0078B314 */ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][2] = { @@ -703,25 +702,24 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x0078B324 */ static void wild_mouse_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void wild_mouse_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3(session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x0078B394 */ static void wild_mouse_track_left_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -756,15 +754,15 @@ static void wild_mouse_track_left_quarter_turn_1( /** rct2: 0x0078B3A4 */ static void wild_mouse_track_right_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_left_quarter_turn_1(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x0078B354 */ static void wild_mouse_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -811,7 +809,7 @@ static void wild_mouse_track_flat_to_60_deg_up( /** rct2: 0x0078B364 */ static void wild_mouse_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -865,23 +863,23 @@ static void wild_mouse_track_60_deg_up_to_flat( /** rct2: 0x0078B374 */ static void wild_mouse_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_60_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B384 */ static void wild_mouse_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wild_mouse_track_flat_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x0078B344 */ static void wild_mouse_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = _wild_mouse_brakes_image_ids[direction] | session->TrackColours[SCHEME_TRACK]; @@ -898,7 +896,7 @@ static void wild_mouse_track_brakes( /** rct2: 0x0078B3C4 */ static void wild_mouse_track_rotation_control_toggle( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -922,7 +920,7 @@ static void wild_mouse_track_rotation_control_toggle( /** rct2: 0x0078B3B4 */ static void wild_mouse_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 1e41d69211..d5cefbf621 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -438,7 +438,7 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* /** rct2: 0x008AC568 */ static void wooden_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -465,7 +465,7 @@ static void wooden_rc_track_flat( } static void wooden_rc_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t stationImageIds[4][2] = { @@ -491,7 +491,7 @@ static void wooden_rc_track_station( height); } wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, rideIndex, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -499,7 +499,7 @@ static void wooden_rc_track_station( /** rct2: 0x008AC578 */ static void wooden_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][4] = { @@ -549,7 +549,7 @@ static void wooden_rc_track_25_deg_up( /** rct2: 0x008AC588 */ static void wooden_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -587,7 +587,7 @@ static void wooden_rc_track_60_deg_up( /** rct2: 0x008AC598 */ static void wooden_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][4] = { @@ -637,7 +637,7 @@ static void wooden_rc_track_flat_to_25_deg_up( /** rct2: 0x008AC5A8 */ static void wooden_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -679,7 +679,7 @@ static void wooden_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AC5B8 */ static void wooden_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -721,7 +721,7 @@ static void wooden_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AC5C8 */ static void wooden_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][4] = { @@ -771,54 +771,54 @@ static void wooden_rc_track_25_deg_up_to_flat( /** rct2: 0x008AC5D8 */ static void wooden_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC5E8 */ static void wooden_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC5F8 */ static void wooden_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC608 */ static void wooden_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC618 */ static void wooden_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC628 */ static void wooden_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void wooden_rc_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { @@ -1064,16 +1064,16 @@ static void wooden_rc_track_right_quarter_turn_5( } static void wooden_rc_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_5(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AC658 */ static void wooden_rc_track_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1100,7 +1100,7 @@ static void wooden_rc_track_flat_to_left_bank( /** rct2: 0x008AC668 */ static void wooden_rc_track_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1127,22 +1127,22 @@ static void wooden_rc_track_flat_to_right_bank( /** rct2: 0x008AC678 */ static void wooden_rc_track_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_flat_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC688 */ static void wooden_rc_track_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_flat_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void wooden_rc_track_banked_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { @@ -1388,16 +1388,16 @@ static void wooden_rc_track_banked_right_quarter_turn_5( } static void wooden_rc_track_banked_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_banked_right_quarter_turn_5(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_banked_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AC6B8 */ static void wooden_rc_track_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1432,7 +1432,7 @@ static void wooden_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AC6C8 */ static void wooden_rc_track_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1467,7 +1467,7 @@ static void wooden_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AC6D8 */ static void wooden_rc_track_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1502,7 +1502,7 @@ static void wooden_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AC6E8 */ static void wooden_rc_track_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1537,39 +1537,39 @@ static void wooden_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AC6F8 */ static void wooden_rc_track_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_right_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC708 */ static void wooden_rc_track_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC718 */ static void wooden_rc_track_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_right_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC728 */ static void wooden_rc_track_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_left_bank_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC738 */ static void wooden_rc_track_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1589,15 +1589,15 @@ static void wooden_rc_track_left_bank( /** rct2: 0x008AC748 */ static void wooden_rc_track_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_left_bank(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC758 */ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1898,7 +1898,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AC768 */ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2199,25 +2199,25 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AC778 */ static void wooden_rc_track_left_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AC788 */ static void wooden_rc_track_right_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_5_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AC798 */ static void wooden_rc_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2436,7 +2436,7 @@ static void wooden_rc_track_s_bend_left( /** rct2: 0x008AC7A8 */ static void wooden_rc_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2655,7 +2655,7 @@ static void wooden_rc_track_s_bend_right( /** rct2: 0x008ACE18 */ static void wooden_rc_track_left_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -2912,7 +2912,7 @@ static void wooden_rc_track_left_vertical_loop( /** rct2: 0x008ACE28 */ static void wooden_rc_track_right_vertical_loop( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3137,7 +3137,7 @@ static void wooden_rc_track_right_vertical_loop( /** rct2: 0x008AC7E8 */ static void wooden_rc_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3307,16 +3307,16 @@ static void wooden_rc_track_left_quarter_turn_3( /** rct2: 0x008AC7F8 */ static void wooden_rc_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AC808 */ static void wooden_rc_track_left_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3486,16 +3486,16 @@ static void wooden_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AC818 */ static void wooden_rc_track_right_quarter_turn_3_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3_bank(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AC828 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3626,7 +3626,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AC838 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -3757,25 +3757,25 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AC848 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008AC858 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3_25_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ACAB8 */ static void wooden_rc_track_left_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4151,7 +4151,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008ACAC8 */ static void wooden_rc_track_right_half_banked_helix_up_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -4527,7 +4527,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008ACAD8 */ static void wooden_rc_track_left_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4536,13 +4536,12 @@ static void wooden_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_right_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ACAE8 */ static void wooden_rc_track_right_half_banked_helix_down_small( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 4) @@ -4551,13 +4550,12 @@ static void wooden_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_half_banked_helix_up_small( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ACAF8 */ static void wooden_rc_track_left_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5149,7 +5147,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008ACB08 */ static void wooden_rc_track_right_half_banked_helix_up_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -5741,7 +5739,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008ACB18 */ static void wooden_rc_track_left_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -5750,13 +5748,12 @@ static void wooden_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ACB28 */ static void wooden_rc_track_right_half_banked_helix_down_large( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence >= 7) @@ -5765,13 +5762,12 @@ static void wooden_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_left_half_banked_helix_up_large( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ACB98 */ static void wooden_rc_track_left_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5824,7 +5820,7 @@ static void wooden_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008ACB78 */ static void wooden_rc_track_right_quarter_turn_1_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5877,23 +5873,23 @@ static void wooden_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008ACB88 */ static void wooden_rc_track_left_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_right_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ACBA8 */ static void wooden_rc_track_right_quarter_turn_1_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_left_quarter_turn_1_60_deg_up(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008AC868 */ static void wooden_rc_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -5913,7 +5909,7 @@ static void wooden_rc_track_brakes( /** rct2: 0x008ACC78 */ static void wooden_rc_track_25_deg_up_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -5969,7 +5965,7 @@ static void wooden_rc_track_25_deg_up_left_banked( /** rct2: 0x008ACC88 */ static void wooden_rc_track_25_deg_up_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6025,7 +6021,7 @@ static void wooden_rc_track_25_deg_up_right_banked( /** rct2: 0x008AC878 */ static void wooden_rc_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -6064,23 +6060,23 @@ static void wooden_rc_track_on_ride_photo( /** rct2: 0x008ACC98 */ static void wooden_rc_track_25_deg_down_left_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_right_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACCA8 */ static void wooden_rc_track_25_deg_down_right_banked( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_left_banked(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACE08 */ static void wooden_rc_track_water_splash( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const bool transparent = gConfigGeneral.transparent_water || (session->ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); @@ -6497,7 +6493,7 @@ static void wooden_rc_track_water_splash( /** rct2: 0x008AC958 */ static void wooden_rc_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6730,7 +6726,7 @@ static void wooden_rc_track_left_eighth_to_diag( /** rct2: 0x008AC968 */ static void wooden_rc_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -6961,25 +6957,25 @@ static void wooden_rc_track_right_eighth_to_diag( /** rct2: 0x008AC978 */ static void wooden_rc_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC988 */ static void wooden_rc_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + wooden_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008AC998 */ static void wooden_rc_track_left_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7212,7 +7208,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008AC9A8 */ static void wooden_rc_track_right_eighth_bank_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7443,25 +7439,25 @@ static void wooden_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008AC9B8 */ static void wooden_rc_track_left_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_right_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008AC9C8 */ static void wooden_rc_track_right_eighth_bank_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_left_eighth_bank_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + wooden_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008AC888 */ static void wooden_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7663,7 +7659,7 @@ static void wooden_rc_track_diag_flat( /** rct2: 0x008AC8B8 */ static void wooden_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7881,7 +7877,7 @@ static void wooden_rc_track_diag_25_deg_up( /** rct2: 0x008AC8E8 */ static void wooden_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -7983,7 +7979,7 @@ static void wooden_rc_track_diag_60_deg_up( /** rct2: 0x008AC898 */ static void wooden_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8185,7 +8181,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AC8C8 */ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8287,7 +8283,7 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008AC8D8 */ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8389,7 +8385,7 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008AC8A8 */ static void wooden_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8607,7 +8603,7 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008AC918 */ static void wooden_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8825,7 +8821,7 @@ static void wooden_rc_track_diag_25_deg_down( /** rct2: 0x008AC948 */ static void wooden_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -8927,7 +8923,7 @@ static void wooden_rc_track_diag_60_deg_down( /** rct2: 0x008AC8F8 */ static void wooden_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9140,7 +9136,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008AC928 */ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9242,7 +9238,7 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008AC938 */ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9344,7 +9340,7 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008AC908 */ static void wooden_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9546,7 +9542,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008ACA18 */ static void wooden_rc_track_diag_flat_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9648,7 +9644,7 @@ static void wooden_rc_track_diag_flat_to_left_bank( /** rct2: 0x008AC9F8 */ static void wooden_rc_track_diag_flat_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9750,7 +9746,7 @@ static void wooden_rc_track_diag_flat_to_right_bank( /** rct2: 0x008ACA08 */ static void wooden_rc_track_diag_left_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9852,7 +9848,7 @@ static void wooden_rc_track_diag_left_bank_to_flat( /** rct2: 0x008ACA28 */ static void wooden_rc_track_diag_right_bank_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -9954,7 +9950,7 @@ static void wooden_rc_track_diag_right_bank_to_flat( /** rct2: 0x008ACA58 */ static void wooden_rc_track_diag_left_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10056,7 +10052,7 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008ACA68 */ static void wooden_rc_track_diag_right_bank_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10158,7 +10154,7 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008ACA38 */ static void wooden_rc_track_diag_25_deg_up_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10260,7 +10256,7 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008ACA48 */ static void wooden_rc_track_diag_25_deg_up_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10362,7 +10358,7 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008ACA78 */ static void wooden_rc_track_diag_left_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10459,7 +10455,7 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008ACA88 */ static void wooden_rc_track_diag_right_bank_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10556,7 +10552,7 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008ACA98 */ static void wooden_rc_track_diag_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10658,7 +10654,7 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008ACAA8 */ static void wooden_rc_track_diag_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10760,7 +10756,7 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008AC9D8 */ static void wooden_rc_track_diag_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10862,7 +10858,7 @@ static void wooden_rc_track_diag_left_bank( /** rct2: 0x008AC9E8 */ static void wooden_rc_track_diag_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -10964,7 +10960,7 @@ static void wooden_rc_track_diag_right_bank( /** rct2: 0x008ACB38 */ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11095,7 +11091,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB48 */ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11226,7 +11222,7 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB58 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11357,7 +11353,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( /** rct2: 0x008ACB68 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11488,7 +11484,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( /** rct2: 0x008ACDF8 */ static void wooden_rc_track_block_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const auto brakeImg = tileElement->AsTrack()->BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1] @@ -11503,7 +11499,7 @@ static void wooden_rc_track_block_brakes( /** rct2: 0x008ACCB8 */ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11634,7 +11630,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCC8 */ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -11765,27 +11761,27 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCD8 */ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ACCE8 */ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ACC38 */ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12086,7 +12082,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC48 */ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -12387,27 +12383,27 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC58 */ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, tileElement); } /** rct2: 0x008ACC68 */ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008ACCF8 */ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12455,7 +12451,7 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008ACD08 */ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12503,7 +12499,7 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008ACD18 */ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12551,7 +12547,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ACD28 */ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12599,43 +12595,39 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ACD38 */ static void wooden_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACD48 */ static void wooden_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACD58 */ static void wooden_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACD68 */ static void wooden_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACD78 */ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12691,7 +12683,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008ACD88 */ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12747,7 +12739,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008ACD98 */ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12803,7 +12795,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008ACDA8 */ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12859,43 +12851,43 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008ACDB8 */ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACDC8 */ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACDD8 */ static void wooden_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACDE8 */ static void wooden_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACBB8 */ static void wooden_rc_track_flat_to_left_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -12951,7 +12943,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008ACBC8 */ static void wooden_rc_track_flat_to_right_banked_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -13007,7 +12999,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008ACBD8 */ static void wooden_rc_track_left_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -13063,7 +13055,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008ACBE8 */ static void wooden_rc_track_right_banked_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -13119,38 +13111,38 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008ACBF8 */ static void wooden_rc_track_flat_to_left_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_right_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACC08 */ static void wooden_rc_track_flat_to_right_banked_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_left_banked_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACC18 */ static void wooden_rc_track_left_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_flat_to_right_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008ACC28 */ static void wooden_rc_track_right_banked_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_rc_track_flat_to_left_banked_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void wooden_rc_track_booster( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index def3934974..3dbe7e5007 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -122,7 +122,7 @@ enum /** rct2: 0x008A5464 */ static void wooden_wild_mouse_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -146,7 +146,7 @@ static void wooden_wild_mouse_track_flat( } static void wooden_wild_mouse_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -163,7 +163,7 @@ static void wooden_wild_mouse_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 0, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -171,7 +171,7 @@ static void wooden_wild_mouse_track_station( /** rct2: 0x008A5474 */ static void wooden_wild_mouse_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -211,7 +211,7 @@ static void wooden_wild_mouse_track_25_deg_up( /** rct2: 0x008A5484 */ static void wooden_wild_mouse_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -259,7 +259,7 @@ static void wooden_wild_mouse_track_60_deg_up( /** rct2: 0x008A5494 */ static void wooden_wild_mouse_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -299,7 +299,7 @@ static void wooden_wild_mouse_track_flat_to_25_deg_up( /** rct2: 0x008A54A4 */ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -350,7 +350,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( } static void wooden_wild_mouse_track_60_deg_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -402,7 +402,7 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up( /** rct2: 0x008A54C4 */ static void wooden_wild_mouse_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -442,54 +442,54 @@ static void wooden_wild_mouse_track_25_deg_up_to_flat( /** rct2: 0x008A54D4 */ static void wooden_wild_mouse_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A54E4 */ static void wooden_wild_mouse_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A54F4 */ static void wooden_wild_mouse_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5504 */ static void wooden_wild_mouse_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_60_deg_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5514 */ static void wooden_wild_mouse_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5524 */ static void wooden_wild_mouse_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void wooden_wild_mouse_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][3] = { @@ -547,15 +547,15 @@ static void wooden_wild_mouse_track_right_quarter_turn_3( } static void wooden_wild_mouse_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_wild_mouse_track_right_quarter_turn_3(session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + wooden_wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void wooden_wild_mouse_track_left_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4] = { @@ -590,15 +590,15 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( /** rct2: 0x008A55D4 */ static void wooden_wild_mouse_track_right_quarter_turn_1( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_left_quarter_turn_1(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x008A55E4 */ static void wooden_wild_mouse_track_flat_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -649,7 +649,7 @@ static void wooden_wild_mouse_track_flat_to_60_deg_up( /** rct2: 0x008A55F4 */ static void wooden_wild_mouse_track_60_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -700,18 +700,18 @@ static void wooden_wild_mouse_track_60_deg_up_to_flat( /** rct2: 0x008A5604 */ static void wooden_wild_mouse_track_flat_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_60_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x008A5614 */ static void wooden_wild_mouse_track_60_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - wooden_wild_mouse_track_flat_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int32_t trackType) diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 1113493bf4..7dee3d261c 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -145,7 +145,7 @@ static constexpr const uint32_t car_ride_track_pieces_quarter_turn_3_tiles[4][3] /** rct2: 0x006F72C8 */ static void paint_car_ride_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -176,7 +176,7 @@ static void paint_car_ride_track_flat( /** rct2: 0x006F72D8 */ static void paint_car_ride_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -214,7 +214,7 @@ static void paint_car_ride_track_25_deg_up( /** rct2: 0x006F72E8 */ static void paint_car_ride_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -252,7 +252,7 @@ static void paint_car_ride_track_flat_to_25_deg_up( /** rct2: 0x006F72F8 */ static void paint_car_ride_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -290,31 +290,31 @@ static void paint_car_ride_track_25_deg_up_to_flat( /** rct2: 0x006F7308 */ static void paint_car_ride_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F7318 */ static void paint_car_ride_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F7328 */ static void paint_car_ride_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F7338, 0x006F7348, 0x006F7358 */ static void paint_car_ride_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -360,7 +360,7 @@ static void paint_car_ride_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -368,7 +368,7 @@ static void paint_car_ride_station( /** rct2: 0x006F7378 */ static void paint_car_ride_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_3_tiles_paint( @@ -405,17 +405,16 @@ static void paint_car_ride_track_right_quarter_turn_3_tiles( /** rct2: 0x006F7368 */ static void paint_car_ride_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_car_ride_track_right_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + paint_car_ride_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x006F7388 */ static void paint_car_ride_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_left_quarter_turn_1_tile[direction] | session->TrackColours[SCHEME_TRACK]; @@ -446,15 +445,15 @@ static void paint_car_ride_track_left_quarter_turn_1_tile( /** rct2: 0x006F7398 */ static void paint_car_ride_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_left_quarter_turn_1_tile(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_car_ride_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** rct2: 0x006F73A8 */ static void paint_car_ride_track_spinning_tunnel( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -487,7 +486,7 @@ static void paint_car_ride_track_spinning_tunnel( /** rct2: 0x006F73B8 */ static void paint_car_ride_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -536,7 +535,7 @@ static void paint_car_ride_track_60_deg_up( /** rct2: 0x006F73C8 */ static void paint_car_ride_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_60_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -592,7 +591,7 @@ static void paint_car_ride_track_25_deg_up_to_60_deg_up( /** rct2: 0x006F73D8 */ static void paint_car_ride_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -648,31 +647,31 @@ static void paint_car_ride_track_60_deg_up_to_25_deg_up( /** rct2: 0x006F73E8 */ static void paint_car_ride_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F73F8 */ static void paint_car_ride_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F7408 */ static void paint_car_ride_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_car_ride_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x006F7418 */ static void paint_car_ride_track_log_bumps( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = car_ride_track_pieces_log_bumps[direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 4d174b03a5..1523208457 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -18,11 +18,10 @@ * rct2: 0x0077084A */ static void paint_circus_tent( - paint_session* session, ride_id_t rideIndex, uint8_t direction, int8_t al, int8_t cl, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t al, int8_t cl, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -53,7 +52,7 @@ static void paint_circus_tent( * rct2: 0x0076FAD4 */ static void paint_circus( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -62,7 +61,6 @@ static void paint_circus( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -79,22 +77,22 @@ static void paint_circus( switch (trackSequence) { case 1: - paint_circus_tent(session, rideIndex, direction, 32, 32, height); + paint_circus_tent(session, ride, direction, 32, 32, height); break; case 3: - paint_circus_tent(session, rideIndex, direction, 32, -32, height); + paint_circus_tent(session, ride, direction, 32, -32, height); break; case 5: - paint_circus_tent(session, rideIndex, direction, 0, -32, height); + paint_circus_tent(session, ride, direction, 0, -32, height); break; case 6: - paint_circus_tent(session, rideIndex, direction, -32, 32, height); + paint_circus_tent(session, ride, direction, -32, 32, height); break; case 7: - paint_circus_tent(session, rideIndex, direction, -32, -32, height); + paint_circus_tent(session, ride, direction, -32, -32, height); break; case 8: - paint_circus_tent(session, rideIndex, direction, -32, 0, height); + paint_circus_tent(session, ride, direction, -32, 0, height); break; } diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index b21b8b6579..8da8aac0ef 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -63,7 +63,7 @@ static void paint_crooked_house_structure( } static void paint_crooked_house( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -72,7 +72,6 @@ static void paint_crooked_house( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index da07e5e732..fcd88ade23 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -38,7 +38,7 @@ static void paint_dodgems_roof(paint_session* session, int32_t height, int32_t o } static void paint_dodgems( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; @@ -50,7 +50,6 @@ static void paint_dodgems( uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 30, 30, 1, height, 1, 1, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 4ed9d0e38c..fcbe3e7136 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -50,13 +50,12 @@ static ferris_wheel_bound_box ferris_wheel_data[] = { * rct2: 0x004C3874 */ static void paint_ferris_wheel_structure( - paint_session* session, ride_id_t rideIndex, uint8_t direction, int8_t axisOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) { uint32_t imageId, baseImageId; const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -134,7 +133,7 @@ static void paint_ferris_wheel_structure( * rct2: 0x008A8EC4 */ static void paint_ferris_wheel( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -151,7 +150,6 @@ static void paint_ferris_wheel( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -189,16 +187,16 @@ static void paint_ferris_wheel( switch (relativeTrackSequence) { case 1: - paint_ferris_wheel_structure(session, rideIndex, direction, 48, height); + paint_ferris_wheel_structure(session, ride, direction, 48, height); break; case 2: - paint_ferris_wheel_structure(session, rideIndex, direction, 16, height); + paint_ferris_wheel_structure(session, ride, direction, 16, height); break; case 0: - paint_ferris_wheel_structure(session, rideIndex, direction, -16, height); + paint_ferris_wheel_structure(session, ride, direction, -16, height); break; case 3: - paint_ferris_wheel_structure(session, rideIndex, direction, -48, height); + paint_ferris_wheel_structure(session, ride, direction, -48, height); break; } diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index 44aaa9b951..7cf8dea96f 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -33,7 +33,7 @@ static constexpr const uint32_t flying_saucers_fence_sprites[] = { * rct2: 0x008873D8 */ static void paint_flying_saucers( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; @@ -45,7 +45,6 @@ static void paint_flying_saucers( uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 6dea62282e..e9f258d69f 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -165,7 +165,7 @@ static uint8_t get_tunnel_doors_image_straight_flat(const TrackElement* trackEle /** rct2: 0x00770BEC */ static void paint_ghost_train_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = ghost_train_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -187,7 +187,7 @@ static void paint_ghost_train_track_flat( /** rct2: 0x00770BFC */ static void paint_ghost_train_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = ghost_train_track_pieces_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -224,7 +224,7 @@ static void paint_ghost_train_track_25_deg_up( /** rct2: 0x00770C0C */ static void paint_ghost_train_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isBackwards = tileElement->AsTrack()->GetTrackType() == TrackElemType::Down25ToFlat; @@ -271,7 +271,7 @@ static void paint_ghost_train_track_flat_to_25_deg_up( } static void paint_ghost_train_track_25_deg_up_to_flat_shared( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -292,10 +292,10 @@ static void paint_ghost_train_track_25_deg_up_to_flat_shared( /** rct2: 0x00770C1C */ static void paint_ghost_train_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_ghost_train_track_25_deg_up_to_flat_shared(session, rideIndex, trackSequence, direction, height, tileElement); + paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, direction, height, tileElement); switch (direction) { @@ -318,19 +318,18 @@ static void paint_ghost_train_track_25_deg_up_to_flat( /** rct2: 0x00770C2C */ static void paint_ghost_train_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_ghost_train_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x00770C3C */ static void paint_ghost_train_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_ghost_train_track_25_deg_up_to_flat_shared( - session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); switch ((direction + 2) % 4) { @@ -353,15 +352,15 @@ static void paint_ghost_train_track_flat_to_25_deg_down( /** rct2: 0x00770C4C */ static void paint_ghost_train_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_ghost_train_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x00770C5C, 0x00770C6C, 0x00770C7C */ static void paint_ghost_train_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -392,7 +391,7 @@ static void paint_ghost_train_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -400,7 +399,7 @@ static void paint_ghost_train_station( /** rct2: 0x00770C9C */ static void paint_ghost_train_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_3_tiles_paint( @@ -442,17 +441,16 @@ static void paint_ghost_train_track_right_quarter_turn_3_tiles( /** rct2: 0x00770CAC */ static void paint_ghost_train_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_ghost_train_track_right_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + paint_ghost_train_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x00770CAC */ static void paint_ghost_train_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isBackwards = tileElement->AsTrack()->GetTrackType() == TrackElemType::RightQuarterTurn1Tile; @@ -479,16 +477,15 @@ static void paint_ghost_train_track_left_quarter_turn_1_tile( /** rct2: 0x00770CBC */ static void paint_ghost_train_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_ghost_train_track_left_quarter_turn_1_tile( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_ghost_train_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** rct2: 0x00770CCC */ static void paint_ghost_train_track_spinning_tunnel( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = ghost_train_track_pieces_spinning_tunnel_track[direction] | session->TrackColours[SCHEME_TRACK]; @@ -508,7 +505,7 @@ static void paint_ghost_train_track_spinning_tunnel( /** rct2: 0x00770CDC */ static void paint_ghost_train_track_brakes( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = ghost_train_track_pieces_brakes[direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 5caeffb7f2..c1021b9aca 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -32,14 +32,12 @@ static haunted_house_bound_box haunted_house_data[] = { * rct2: 0x0076F72C */ static void paint_haunted_house_structure( - paint_session* session, ride_id_t rideIndex, uint8_t direction, int8_t xOffset, int8_t yOffset, uint8_t part, - uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint8_t part, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); uint8_t frameNum = 0; - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -95,7 +93,7 @@ static void paint_haunted_house_structure( * rct2: 0x0076E9B0 */ static void paint_haunted_house( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -104,7 +102,6 @@ static void paint_haunted_house( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -121,13 +118,13 @@ static void paint_haunted_house( switch (trackSequence) { case 3: - paint_haunted_house_structure(session, rideIndex, direction, 32, -32, 0, height + 3); + paint_haunted_house_structure(session, ride, direction, 32, -32, 0, height + 3); break; case 6: - paint_haunted_house_structure(session, rideIndex, direction, -32, 32, 4, height + 3); + paint_haunted_house_structure(session, ride, direction, -32, 32, 4, height + 3); break; case 7: - paint_haunted_house_structure(session, rideIndex, direction, -32, -32, 2, height + 3); + paint_haunted_house_structure(session, ride, direction, -32, -32, 2, height + 3); break; } diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index c3a8f15fb0..d2c79986cf 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -45,7 +45,7 @@ enum * rct: 0x004ACF4A */ static void maze_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint16_t maze_entry = tileElement->AsTrack()->GetMazeEntry(); @@ -61,7 +61,7 @@ static void maze_paint_setup( paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); int32_t base_image_id = 0; - switch (get_ride(rideIndex)->track_colour[0].supports) + switch (ride->track_colour[0].supports) { case 0: base_image_id = SPR_MAZE_BASE_BRICK; diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 1ce354af1b..e124836e99 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -25,12 +25,11 @@ static constexpr const uint16_t merry_go_round_breakdown_vibration[] = { 0, 1, 2 * rct2: 0x0076287D */ static void paint_merry_go_round_structure( - paint_session* session, ride_id_t rideIndex, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); height += 7; - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -104,7 +103,7 @@ static void paint_merry_go_round_structure( * rct2: 0x00761B0C */ static void paint_merry_go_round( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -113,7 +112,6 @@ static void paint_merry_go_round( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -130,22 +128,22 @@ static void paint_merry_go_round( switch (trackSequence) { case 1: - paint_merry_go_round_structure(session, rideIndex, direction, 32, 32, height); + paint_merry_go_round_structure(session, ride, direction, 32, 32, height); break; case 3: - paint_merry_go_round_structure(session, rideIndex, direction, 32, -32, height); + paint_merry_go_round_structure(session, ride, direction, 32, -32, height); break; case 5: - paint_merry_go_round_structure(session, rideIndex, direction, 0, -32, height); + paint_merry_go_round_structure(session, ride, direction, 0, -32, height); break; case 6: - paint_merry_go_round_structure(session, rideIndex, direction, -32, 32, height); + paint_merry_go_round_structure(session, ride, direction, -32, 32, height); break; case 7: - paint_merry_go_round_structure(session, rideIndex, direction, -32, -32, height); + paint_merry_go_round_structure(session, ride, direction, -32, -32, height); break; case 8: - paint_merry_go_round_structure(session, rideIndex, direction, -32, 0, height); + paint_merry_go_round_structure(session, ride, direction, -32, 0, height); break; } diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index f59eac2b46..6dbff88f6b 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -484,7 +484,7 @@ static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const /** rct2: 0x0087F10C */ static void paint_mini_golf_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -531,7 +531,7 @@ static void paint_mini_golf_track_flat( /** rct2: 0x0087F11C */ static void paint_mini_golf_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -570,7 +570,7 @@ static void paint_mini_golf_track_25_deg_up( /** rct2: 0x0087F12C */ static void paint_mini_golf_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -609,7 +609,7 @@ static void paint_mini_golf_track_flat_to_25_deg_up( /** rct2: 0x0087F13C */ static void paint_mini_golf_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -648,34 +648,33 @@ static void paint_mini_golf_track_25_deg_up_to_flat( /** rct2: 0x0087F14C */ static void paint_mini_golf_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_golf_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0087F15C */ static void paint_mini_golf_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_golf_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0087F16C */ static void paint_mini_golf_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_golf_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0087F17C, 0x0087F18C, 0x0087F19C */ static void paint_mini_golf_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -740,7 +739,7 @@ static void paint_mini_golf_station( /** rct2: 0x0087F1AC */ static void paint_mini_golf_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -820,10 +819,10 @@ static void paint_mini_golf_track_left_quarter_turn_1_tile( /** rct2: 0x0087F1BC */ static void paint_mini_golf_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_golf_track_left_quarter_turn_1_tile(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_mini_golf_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static void paint_mini_golf_hole_ab( @@ -882,7 +881,7 @@ static void paint_mini_golf_hole_ab( /** rct2: 0x0087F1CC */ static void paint_mini_golf_hole_a( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_hole_a); @@ -890,7 +889,7 @@ static void paint_mini_golf_hole_a( /** rct2: 0x0087F1DC */ static void paint_mini_golf_hole_b( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_hole_b); @@ -898,7 +897,7 @@ static void paint_mini_golf_hole_b( /** rct2: 0x0087F1EC */ static void paint_mini_golf_hole_c( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -968,7 +967,7 @@ static void paint_mini_golf_hole_c( /** rct2: 0x0087F1FC */ static void paint_mini_golf_hole_d( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -1061,7 +1060,7 @@ static void paint_mini_golf_hole_d( /** rct2: 0x0087F1FC */ static void paint_mini_golf_hole_e( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 8d36ba5e08..3805a0de45 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -18,7 +18,7 @@ /** rct2: 0x */ static void paint_mini_helicopters_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -48,7 +48,7 @@ static void paint_mini_helicopters_track_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -56,7 +56,7 @@ static void paint_mini_helicopters_track_station( /** rct2: 0x0081F348 */ static void paint_mini_helicopters_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -88,7 +88,7 @@ static void paint_mini_helicopters_track_flat( /** rct2: 0x0081F368 */ static void paint_mini_helicopters_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -129,7 +129,7 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up( /** rct2: 0x0081F358 */ static void paint_mini_helicopters_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -170,7 +170,7 @@ static void paint_mini_helicopters_track_25_deg_up( /** rct2: 0x0081F378 */ static void paint_mini_helicopters_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -211,31 +211,31 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat( /** rct2: 0x */ static void paint_mini_helicopters_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_helicopters_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0081F388 */ static void paint_mini_helicopters_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_helicopters_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0081F3A8 */ static void paint_mini_helicopters_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_mini_helicopters_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0081F3E8 */ static void paint_mini_helicopters_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_3_tiles_paint( @@ -268,17 +268,17 @@ static constexpr const uint8_t mini_helicopters_right_quarter_turn_3_tiles_to_le /** rct2: 0x0081F3F8 */ static void paint_mini_helicopters_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mini_helicopters_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; paint_mini_helicopters_track_left_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** rct2: 0x0081F408 */ static void paint_mini_helicopters_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_1_tile_paint( @@ -293,11 +293,11 @@ static void paint_mini_helicopters_track_left_quarter_turn_1_tile( /** rct2: 0x0081F418 */ static void paint_mini_helicopters_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_mini_helicopters_track_left_quarter_turn_1_tile( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 677fb5ca80..e5ad7350d3 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -164,7 +164,7 @@ static paint_struct* paint_monorail_cycles_util_7c( /** rct2: 0x0088AD48 */ static void paint_monorail_cycles_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = monorail_cycles_track_pieces_flat[(direction & 1)] | session->TrackColours[SCHEME_TRACK]; @@ -191,7 +191,7 @@ static void paint_monorail_cycles_track_flat( /** rct2: 0x0088ADD8 */ static void paint_monorail_cycles_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -221,7 +221,7 @@ static void paint_monorail_cycles_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -229,7 +229,7 @@ static void paint_monorail_cycles_station( /** rct2: 0x0088AD88 */ static void paint_monorail_cycles_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_3_tiles_paint( @@ -262,12 +262,12 @@ static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_lef /** rct2: 0x0088AD98 */ static void paint_monorail_cycles_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = monorail_cycles_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; paint_monorail_cycles_track_left_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static constexpr const int8_t monorail_cycles_track_right_quarter_turn_5_tiles_support_height_offset[][7] = { @@ -286,7 +286,7 @@ static constexpr const int8_t monorail_cycles_track_right_quarter_turn_5_tiles_s /** rct2: 0x0088ADB8 */ static void paint_monorail_cycles_track_right_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_5_tiles_paint( @@ -402,17 +402,17 @@ static void paint_monorail_cycles_track_right_quarter_turn_5_tiles( /** rct2: 0x0088ADA8 */ static void paint_monorail_cycles_track_left_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; paint_monorail_cycles_track_right_quarter_turn_5_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x0088ADC8 */ static void paint_monorail_cycles_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -521,7 +521,7 @@ static void paint_monorail_cycles_track_s_bend_left( /** rct2: 0x*/ static void paint_monorail_cycles_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index e04c4fc1f7..6b324e4ae9 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -84,7 +84,7 @@ void vehicle_visual_observation_tower( /** rct2: 0x0070DD6C */ static void paint_observation_tower_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -97,7 +97,6 @@ static void paint_observation_tower_base( uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( @@ -162,7 +161,7 @@ static void paint_observation_tower_base( /** rct2: 0x0070DD7C */ static void paint_observation_tower_section( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence == 1) diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 46a04546df..88c9ff44ee 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -32,7 +32,8 @@ static constexpr const uint32_t space_rings_fence_sprites[] = { }; /** rct2: 0x00768A3B */ -static void paint_space_rings_structure(paint_session* session, Ride* ride, uint8_t direction, uint32_t segment, int32_t height) +static void paint_space_rings_structure( + paint_session* session, const Ride* ride, uint8_t direction, uint32_t segment, int32_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); @@ -86,10 +87,9 @@ static void paint_space_rings_structure(paint_session* session, Ride* ride, uint /** rct2: 0x00767C40 */ static void paint_space_rings( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 676aebf2cb..dea3ae8d92 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -46,7 +46,7 @@ enum }; static void spiral_slide_paint_tile_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id = 0; @@ -64,7 +64,7 @@ static void spiral_slide_paint_tile_right( } static void spiral_slide_paint_tile_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id = 0; @@ -82,12 +82,11 @@ static void spiral_slide_paint_tile_left( } static void spiral_slide_paint_tile_front( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t image_id = 0; - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -192,7 +191,7 @@ static constexpr const uint32_t spiral_slide_fence_sprites[] = { * rct: 0x007485C8 */ static void paint_spiral_slide( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_2x2[direction][trackSequence]; @@ -205,7 +204,6 @@ static void paint_spiral_slide( uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( @@ -216,13 +214,13 @@ static void paint_spiral_slide( switch (trackSequence) { case 1: - spiral_slide_paint_tile_right(session, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_right(session, ride, trackSequence, direction, height, tileElement); break; case 2: - spiral_slide_paint_tile_left(session, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_left(session, ride, trackSequence, direction, height, tileElement); break; case 3: - spiral_slide_paint_tile_front(session, rideIndex, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_front(session, ride, trackSequence, direction, height, tileElement); break; } diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index b04e644fe3..97dcbbcc6a 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -23,13 +23,12 @@ * rct2: 0x007630DE */ static void facility_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool hasSupports = wooden_a_supports_paint_setup( session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index c5227d9ed8..900487bd93 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -23,13 +23,12 @@ * rct2: 0x007617A5 */ static void shop_paint_setup( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool hasSupports = wooden_a_supports_paint_setup( session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 7378e59d23..4c4bae4283 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -18,11 +18,10 @@ * rct2: 0x007664C2 */ static void paint_3d_cinema_structure( - paint_session* session, ride_id_t rideIndex, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -53,7 +52,7 @@ static void paint_3d_cinema_structure( * rct2: 0x0076574C */ static void paint_3d_cinema( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -62,7 +61,6 @@ static void paint_3d_cinema( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -79,22 +77,22 @@ static void paint_3d_cinema( switch (trackSequence) { case 1: - paint_3d_cinema_structure(session, rideIndex, direction, 32, 32, height); + paint_3d_cinema_structure(session, ride, direction, 32, 32, height); break; case 3: - paint_3d_cinema_structure(session, rideIndex, direction, 32, -32, height); + paint_3d_cinema_structure(session, ride, direction, 32, -32, height); break; case 5: - paint_3d_cinema_structure(session, rideIndex, direction, 0, -32, height); + paint_3d_cinema_structure(session, ride, direction, 0, -32, height); break; case 6: - paint_3d_cinema_structure(session, rideIndex, direction, -32, 32, height); + paint_3d_cinema_structure(session, ride, direction, -32, 32, height); break; case 7: - paint_3d_cinema_structure(session, rideIndex, direction, -32, -32, height); + paint_3d_cinema_structure(session, ride, direction, -32, -32, height); break; case 8: - paint_3d_cinema_structure(session, rideIndex, direction, -32, 0, height); + paint_3d_cinema_structure(session, ride, direction, -32, 0, height); break; } diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 2020ef0424..4e8267c945 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -18,7 +18,7 @@ /** rct2: 0x008A2ABC */ static void paint_enterprise_structure( - paint_session* session, Ride* ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TileElement* tileElement) + paint_session* session, const Ride* ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TileElement* tileElement) { height += 7; @@ -79,10 +79,9 @@ static void paint_enterprise_structure( /** rct2: 0x008A1584 */ static void paint_enterprise( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 6fbbc33c99..48a498d988 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -125,7 +125,7 @@ static constexpr const uint32_t go_karts_track_pieces_25_deg_up_to_flat[4][2] = /** rct2: 0x0074A748 */ static void paint_go_karts_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -158,7 +158,7 @@ static void paint_go_karts_track_flat( /** rct2: 0x0074A758 */ static void paint_go_karts_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -212,7 +212,7 @@ static void paint_go_karts_track_25_deg_up( /** rct2: 0x0074A768 */ static void paint_go_karts_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -266,7 +266,7 @@ static void paint_go_karts_track_flat_to_25_deg_up( /** rct2: 0x */ static void paint_go_karts_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -320,34 +320,33 @@ static void paint_go_karts_track_25_deg_up_to_flat( /** rct2: 0x0074A788 */ static void paint_go_karts_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_go_karts_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0074A798 */ static void paint_go_karts_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_go_karts_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x0074A7A8 */ static void paint_go_karts_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_go_karts_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x */ static void paint_go_karts_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -457,7 +456,7 @@ static void paint_go_karts_station( /** rct2: 0x0074A7E8 */ static void paint_go_karts_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -527,10 +526,10 @@ static void paint_go_karts_track_left_quarter_turn_1_tile( /** rct2: 0x0074A7F8 */ static void paint_go_karts_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_go_karts_track_left_quarter_turn_1_tile(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_go_karts_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 0b0ca3deac..a6b5cfa8c8 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -87,7 +87,7 @@ void vehicle_visual_launched_freefall( /** rct2: 0x006FD1F8 */ static void paint_launched_freefall_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -99,7 +99,6 @@ static void paint_launched_freefall_base( uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( @@ -163,7 +162,7 @@ static void paint_launched_freefall_base( /** rct2: 0x006FD208 */ static void paint_launched_freefall_tower_section( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence == 1) diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 4300046f08..36c92409e8 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -55,7 +55,7 @@ static constexpr const bound_box MagicCarpetBounds[] = { { 0, 8, 32, 16 }, { 8, 0, 16, 32 }, { 0, 8, 32, 16 }, { 8, 0, 16, 32 } }; -static Vehicle* get_first_vehicle(Ride* ride) +static const Vehicle* get_first_vehicle(const Ride* ride) { if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { @@ -120,8 +120,8 @@ static void paint_magic_carpet_pendulum( } static void paint_magic_carpet_vehicle( - paint_session* session, Ride* ride, uint8_t direction, uint32_t swingImageId, CoordsXYZ offset, const CoordsXYZ& bbOffset, - const CoordsXYZ& bbSize) + paint_session* session, const Ride* ride, uint8_t direction, uint32_t swingImageId, CoordsXYZ offset, + const CoordsXYZ& bbOffset, const CoordsXYZ& bbSize) { rct_ride_entry* rideEntry = ride->GetRideEntry(); uint32_t vehicleImageId = rideEntry->vehicles[0].base_image_id + direction; @@ -159,7 +159,7 @@ static void paint_magic_carpet_vehicle( rct_drawpixelinfo* dpi = &session->DPI; if (dpi->zoom_level <= 1 && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { - Vehicle* vehicle = get_first_vehicle(ride); + auto* vehicle = get_first_vehicle(ride); if (vehicle != nullptr) { uint32_t baseImageId = IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | (vehicleImageId + 4); @@ -178,10 +178,10 @@ static void paint_magic_carpet_vehicle( /** rct2: 0x00899104 */ static void paint_magic_carpet_structure( - paint_session* session, Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); - Vehicle* vehicle = get_first_vehicle(ride); + auto* vehicle = get_first_vehicle(ride); uint32_t swingImageId = 0; if (vehicle != nullptr) @@ -215,7 +215,7 @@ static void paint_magic_carpet_structure( /** rct2: 0x00898514 */ static void paint_magic_carpet( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -245,7 +245,6 @@ static void paint_magic_carpet( break; } - auto ride = get_ride(rideIndex); if (ride != nullptr) { switch (relativeTrackSequence) diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 942ed2720d..8bfbd40911 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -32,9 +32,9 @@ enum * rct2: 0x0076522A */ static void paint_motionsimulator_vehicle( - paint_session* session, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, const TileElement* tileElement) + paint_session* session, const Ride* ride, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, + const TileElement* tileElement) { - auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); if (ride == nullptr) return; @@ -132,7 +132,7 @@ static void paint_motionsimulator_vehicle( /** rct2: 0x008A85C4 */ static void paint_motionsimulator( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_2x2[direction][trackSequence]; @@ -141,7 +141,6 @@ static void paint_motionsimulator( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -158,13 +157,13 @@ static void paint_motionsimulator( switch (trackSequence) { case 1: - paint_motionsimulator_vehicle(session, 16, -16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, 16, -16, direction, height, tileElement); break; case 2: - paint_motionsimulator_vehicle(session, -16, 16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, -16, 16, direction, height, tileElement); break; case 3: - paint_motionsimulator_vehicle(session, -16, -16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, -16, -16, direction, height, tileElement); break; } diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index e2fc9ada3e..f8ba7f635f 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -97,7 +97,7 @@ void vehicle_visual_roto_drop( /** rct2: 0x00886194 */ static void paint_roto_drop_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -109,7 +109,6 @@ static void paint_roto_drop_base( uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( @@ -178,7 +177,7 @@ static void paint_roto_drop_base( /** rct2: 0x008861A4 */ static void paint_roto_drop_tower_section( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence == 1) diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index b684c0b212..19517b7e09 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -48,7 +48,7 @@ static constexpr const uint32_t swinging_inverter_ship_frame_sprites[] = { SPR_S SPR_SWINGING_INVERTER_SHIP_FRAME_3 }; static void paint_swinging_inverter_ship_structure( - paint_session* session, Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); @@ -123,7 +123,7 @@ static void paint_swinging_inverter_ship_structure( /** rct2: 0x00760260 */ static void paint_swinging_inverter_ship( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -166,7 +166,6 @@ static void paint_swinging_inverter_ship( } } - auto ride = get_ride(rideIndex); if (ride != nullptr) { switch (relativeTrackSequence) diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 675f4e446c..3efb6fffbf 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -57,7 +57,7 @@ static constexpr const uint32_t swinging_ship_frame_sprites[][2] = { /** rct2: 0x4AF254 */ static void paint_swinging_ship_structure( - paint_session* session, Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) { uint32_t imageId, baseImageId; @@ -173,10 +173,9 @@ static void paint_swinging_ship_structure( /** rct2: 0x008A85C4 */ static void paint_swinging_ship( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 0a9cd224ee..6a27e58152 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -43,10 +43,9 @@ static int8_t TopSpinSeatPositionOffset[] = { * rct2: 0x0076750D */ static void top_spin_paint_vehicle( - paint_session* session, int8_t al, int8_t cl, ride_id_t rideIndex, uint8_t direction, int32_t height, + paint_session* session, int8_t al, int8_t cl, const Ride* ride, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -248,7 +247,7 @@ static void top_spin_paint_vehicle( * rct2: 0x0076679C */ static void paint_top_spin( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -257,7 +256,6 @@ static void paint_top_spin( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); - auto ride = get_ride(rideIndex); StationObject* stationObject = nullptr; if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -274,22 +272,22 @@ static void paint_top_spin( switch (trackSequence) { case 1: - top_spin_paint_vehicle(session, 32, 32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, 32, ride, direction, height, tileElement); break; case 3: - top_spin_paint_vehicle(session, 32, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, -32, ride, direction, height, tileElement); break; case 5: - top_spin_paint_vehicle(session, 0, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, 0, -32, ride, direction, height, tileElement); break; case 6: - top_spin_paint_vehicle(session, -32, 32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, 32, ride, direction, height, tileElement); break; case 7: - top_spin_paint_vehicle(session, -32, -32, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, -32, ride, direction, height, tileElement); break; case 8: - top_spin_paint_vehicle(session, -32, 0, rideIndex, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, 0, ride, direction, height, tileElement); break; } diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index ef05e114e2..d914c97e12 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -18,7 +18,7 @@ /** rct2: 0x0076E5C9 */ static void paint_twist_structure( - paint_session* session, Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); @@ -79,10 +79,9 @@ static void paint_twist_structure( /** rct2: 0x0076D858 */ static void paint_twist( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index ce5e9f9083..cb16628da2 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -108,7 +108,7 @@ static void chairlift_paint_util_draw_supports(paint_session* session, int32_t s } static const TileElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( - int32_t x, int32_t y, int32_t z, ride_id_t rideIndex) + int32_t x, int32_t y, int32_t z, const Ride* ride) { const TileElement* tileElement = map_get_first_element_at({ x, y }); if (tileElement == nullptr) @@ -120,7 +120,7 @@ static const TileElement* chairlift_paint_util_map_get_track_element_at_from_rid { if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (tileElement->AsTrack()->GetRideIndex() != rideIndex) + if (tileElement->AsTrack()->GetRideIndex() != ride->id) continue; if (tileElement->base_height != z && tileElement->base_height != z - 1) continue; @@ -132,7 +132,7 @@ static const TileElement* chairlift_paint_util_map_get_track_element_at_from_rid }; static bool chairlift_paint_util_is_first_track( - ride_id_t rideIndex, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) + const Ride* ride, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) { if (tileElement->AsTrack()->GetTrackType() != TrackElemType::BeginStation) { @@ -146,13 +146,13 @@ static bool chairlift_paint_util_is_first_track( }; const TileElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( - newPos.x, newPos.y, tileElement->base_height, rideIndex); + newPos.x, newPos.y, tileElement->base_height, ride); return nextTrack == nullptr; } static bool chairlift_paint_util_is_last_track( - ride_id_t rideIndex, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) + const Ride* ride, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) { if (tileElement->AsTrack()->GetTrackType() != TrackElemType::EndStation) { @@ -166,16 +166,15 @@ static bool chairlift_paint_util_is_last_track( }; const TileElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( - newPos.x, newPos.y, tileElement->base_height, rideIndex); + newPos.x, newPos.y, tileElement->base_height, ride); return nextTrack == nullptr; } static void chairlift_paint_station_ne_sw( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -183,8 +182,8 @@ static void chairlift_paint_station_ne_sw( auto trackType = tileElement->AsTrack()->GetTrackType(); uint32_t imageId; - bool isStart = chairlift_paint_util_is_first_track(rideIndex, tileElement, pos, trackType); - bool isEnd = chairlift_paint_util_is_last_track(rideIndex, tileElement, pos, trackType); + bool isStart = chairlift_paint_util_is_first_track(ride, tileElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, tileElement, pos, trackType); auto stationObj = ride_get_station_object(ride); @@ -266,10 +265,9 @@ static void chairlift_paint_station_ne_sw( } static void chairlift_paint_station_se_nw( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -277,8 +275,8 @@ static void chairlift_paint_station_se_nw( auto trackType = tileElement->AsTrack()->GetTrackType(); uint32_t imageId; - bool isStart = chairlift_paint_util_is_first_track(rideIndex, tileElement, pos, trackType); - bool isEnd = chairlift_paint_util_is_last_track(rideIndex, tileElement, pos, trackType); + bool isStart = chairlift_paint_util_is_first_track(ride, tileElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, tileElement, pos, trackType); auto stationObj = ride_get_station_object(ride); @@ -362,21 +360,21 @@ static void chairlift_paint_station_se_nw( /** rct2: 0x00744068 */ static void chairlift_paint_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction % 2) { - chairlift_paint_station_se_nw(session, rideIndex, trackSequence, direction, height, tileElement); + chairlift_paint_station_se_nw(session, ride, trackSequence, direction, height, tileElement); } else { - chairlift_paint_station_ne_sw(session, rideIndex, trackSequence, direction, height, tileElement); + chairlift_paint_station_ne_sw(session, ride, trackSequence, direction, height, tileElement); } } static void chairlift_paint_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -399,7 +397,7 @@ static void chairlift_paint_flat( /** rct2: 0x00743FD8 */ static void chairlift_paint_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -437,7 +435,7 @@ static void chairlift_paint_25_deg_up( /** rct2: 0x00743FD8 */ static void chairlift_paint_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -492,7 +490,7 @@ static void chairlift_paint_flat_to_25_deg_up( /** rct2: 0x00743FF8 */ static void chairlift_paint_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -547,31 +545,31 @@ static void chairlift_paint_25_deg_up_to_flat( /** rct2: 0x00744008 */ static void chairlift_paint_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - chairlift_paint_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x00744018 */ static void chairlift_paint_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - chairlift_paint_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x00744028 */ static void chairlift_paint_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - chairlift_paint_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x00744038 */ static void chairlift_paint_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -638,10 +636,10 @@ static void chairlift_paint_left_quarter_turn_1_tile( /** rct2: 0x00744048 */ static void chairlift_paint_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - chairlift_paint_left_quarter_turn_1_tile(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + chairlift_paint_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /* 0x008AAA0C */ diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index d4c335600e..79143297cc 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -47,7 +47,7 @@ static void paint_lift_cage(paint_session* session, int8_t index, uint32_t colou /** rct2: 0x0076C6CC */ static void paint_lift_base( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -77,7 +77,6 @@ static void paint_lift_base( uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); - auto ride = get_ride(rideIndex); if (ride != nullptr) { track_paint_util_paint_fences( @@ -120,7 +119,7 @@ static void paint_lift_base( /** rct2: 0x0076C6DC */ static void paint_lift_tower_section( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (trackSequence == 1) diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 9d42a0a9fc..b4b2147a95 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -588,7 +588,7 @@ static uint32_t miniature_railway_track_to_grooved_indent( /** rct2: 0x008AD0C0 */ static void paint_miniature_railway_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool paintAsGravel = false; @@ -668,7 +668,7 @@ static void paint_miniature_railway_track_flat( /** rct2: 0x008AD170, 0x008AD180, 0x008AD190 */ static void paint_miniature_railway_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -683,7 +683,7 @@ static void paint_miniature_railway_station( paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - track_paint_util_draw_station_3(session, rideIndex, direction, height + 2, height, tileElement); + track_paint_util_draw_station_3(session, ride, direction, height + 2, height, tileElement); // covers shouldn't be offset by +2 paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -692,7 +692,7 @@ static void paint_miniature_railway_station( /** rct2: 0x008AD0D0 */ static void paint_miniature_railway_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -724,7 +724,7 @@ static void paint_miniature_railway_track_25_deg_up( /** rct2: 0x008AD0E0 */ static void paint_miniature_railway_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = miniature_railway_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -756,7 +756,7 @@ static void paint_miniature_railway_track_flat_to_25_deg_up( /** rct2: 0x008AD0F0 */ static void paint_miniature_railway_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -788,28 +788,26 @@ static void paint_miniature_railway_track_25_deg_up_to_flat( /** rct2: 0x008AD100 */ static void paint_miniature_railway_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_miniature_railway_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AD110 */ static void paint_miniature_railway_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_miniature_railway_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AD120 */ static void paint_miniature_railway_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_miniature_railway_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } // clang-format off @@ -920,7 +918,7 @@ static constexpr const int8_t miniature_railway_right_quarter_turn_5_tiles_sprit /** rct2: 0x008AD140 */ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (right_quarter_turn_5_supports_type[direction][trackSequence] != -1) @@ -1009,12 +1007,12 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( /** rct2: 0x008AD130 */ static void paint_miniature_railway_track_left_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; paint_miniature_railway_track_right_quarter_turn_5_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static constexpr const int8_t s_bend_left_supports_type[4][4] = { @@ -1033,7 +1031,7 @@ static constexpr const uint32_t miniature_railway_s_bend_left_tiles_track_floor[ /** rct2: 0x8AD150 */ static void paint_miniature_railway_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -1135,7 +1133,7 @@ static constexpr const uint32_t miniature_railway_s_bend_right_tiles_track_floor /** rct2: 0x008AD160 */ static void paint_miniature_railway_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -1267,7 +1265,7 @@ static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_3_tile_bou /** rct2: 0x008AD1B0 */ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isSupported = false; @@ -1333,12 +1331,12 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( /** rct2: 0x008AD1A0 */ static void paint_miniature_railway_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; paint_miniature_railway_track_right_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static constexpr const int8_t paint_miniature_railway_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; @@ -1416,7 +1414,7 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_left_eight_ /** rct2: 0x008AD1C0 */ static void paint_miniature_railway_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t supportType[4][5] = { { 0, 0, 3, 5, 1 }, { 1, 1, 4, 2, 0 }, { 0, 0, 5, 3, 1 }, { 1, 1, 2, 4, 0 } }; @@ -1554,7 +1552,7 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_right_eight /** rct2: 0x008AD1D0 */ static void paint_miniature_railway_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t supportType[4][5] = { { 0, 0, 2, 4, 1 }, { 1, 1, 3, 5, 0 }, { 0, 0, 4, 2, 1 }, { 1, 1, 5, 3, 0 } }; @@ -1623,22 +1621,20 @@ static void paint_miniature_railway_track_right_eighth_to_diag( /** rct2: 0x008AD1E0 */ static void paint_miniature_railway_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - paint_miniature_railway_track_right_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AD1F0 */ static void paint_miniature_railway_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - paint_miniature_railway_track_left_eighth_to_diag( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_miniature_railway_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static constexpr const bool miniature_railway_diag_image_segment[][4] = { @@ -1683,7 +1679,7 @@ static constexpr const floor_desc floors[] = { /** rct2: 0x008AD200 */ static void miniature_railway_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isSupported = false; @@ -1756,7 +1752,7 @@ static bool wooden_supports_paint_setup( /** rct2: 0x008AD230 */ static void miniature_railway_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { // TODO: The supports are inconsistent for different rotations @@ -1831,7 +1827,7 @@ static void miniature_railway_track_diag_25_deg_up( /** rct2: 0x008AD210 */ static void miniature_railway_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool hasSupports = false; @@ -1882,7 +1878,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( /** rct2: 0x008AD220 */ static void miniature_railway_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t supportOffsets[][4] = { @@ -1958,7 +1954,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( /** rct2: 0x008AD260 */ static void miniature_railway_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t supportOffsets[][4] = { @@ -2033,7 +2029,7 @@ static void miniature_railway_track_diag_25_deg_down( /** rct2: 0x008AD240 */ static void miniature_railway_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const int8_t supportOffsets[][4] = { @@ -2106,7 +2102,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( } static void miniature_railway_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool hasSupports = false; diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 956c423ad7..12bb602468 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -420,7 +420,7 @@ static constexpr const uint32_t monorail_track_pieces_diag_25_deg_up[4] = { /** rct2: 0x008AE1AC */ static void paint_monorail_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -455,12 +455,12 @@ static void paint_monorail_track_flat( /** rct2: 0x008AE25C, 0x008AE26C, 0x008AE27C */ static void paint_monorail_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; const StationObject* stationObject = nullptr; - const auto* ride = get_ride(rideIndex); + if (ride != nullptr) stationObject = ride_get_station_object(ride); @@ -508,7 +508,7 @@ static void paint_monorail_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -516,7 +516,7 @@ static void paint_monorail_station( /** rct2: 0x008AE1BC */ static void paint_monorail_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = monorail_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -558,7 +558,7 @@ static void paint_monorail_track_25_deg_up( /** rct2: 0x008AE1CC */ static void paint_monorail_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = monorail_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -600,7 +600,7 @@ static void paint_monorail_track_flat_to_25_deg_up( /** rct2: 0x008AE1DC */ static void paint_monorail_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = monorail_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -642,31 +642,31 @@ static void paint_monorail_track_25_deg_up_to_flat( /** rct2: 0x008AE1EC */ static void paint_monorail_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_monorail_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AE1FC */ static void paint_monorail_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_monorail_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AE20C */ static void paint_monorail_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_monorail_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AE22C */ static void paint_monorail_track_right_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_5_tiles_paint( @@ -729,17 +729,16 @@ static void paint_monorail_track_right_quarter_turn_5_tiles( /** rct2: 0x008AE21C */ static void paint_monorail_track_left_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - paint_monorail_track_right_quarter_turn_5_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + paint_monorail_track_right_quarter_turn_5_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } /** rct2: 0x */ static void paint_monorail_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -845,7 +844,7 @@ static void paint_monorail_track_s_bend_left( /** rct2: 0x008AE24C */ static void paint_monorail_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction == 2 || direction == 3) @@ -951,7 +950,7 @@ static void paint_monorail_track_s_bend_right( /** rct2: 0x008AE29C */ static void paint_monorail_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_3_tiles_paint( @@ -988,19 +987,18 @@ static void paint_monorail_track_right_quarter_turn_3_tiles( /** rct2: 0x008AE28C */ static void paint_monorail_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_monorail_track_right_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + paint_monorail_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; /** rct2: 0x008AE31C */ static void paint_monorail_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; @@ -1068,7 +1066,7 @@ static void paint_monorail_track_left_eighth_to_diag( /** rct2: 0x008AE32C */ static void paint_monorail_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; @@ -1136,22 +1134,22 @@ static void paint_monorail_track_right_eighth_to_diag( /** rct2: 0x008AE33C */ static void paint_monorail_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - paint_monorail_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } /** rct2: 0x008AE34C */ static void paint_monorail_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - paint_monorail_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static constexpr const bool monorail_diag_image_segment[][4] = { @@ -1170,7 +1168,7 @@ static constexpr const int32_t monorail_diag_blocked_segments[] = { SEGMENT_C4 | /** rct2: 0x008AE2AC */ static void paint_monorail_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1193,7 +1191,7 @@ static void paint_monorail_track_diag_flat( /** rct2: 0x008AE2DC */ static void paint_monorail_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1216,7 +1214,7 @@ static void paint_monorail_track_diag_25_deg_up( /** rct2: 0x008AE2BC */ static void paint_monorail_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1239,7 +1237,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_up( /** rct2: 0x008AE2CC */ static void paint_monorail_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1262,7 +1260,7 @@ static void paint_monorail_track_diag_25_deg_up_to_flat( /** rct2: 0x008AE30C */ static void paint_monorail_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1285,7 +1283,7 @@ static void paint_monorail_track_diag_25_deg_down( /** rct2: 0x008AE2EC */ static void paint_monorail_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1309,7 +1307,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_down( /** rct2: 0x008AE2FC */ static void paint_monorail_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (monorail_diag_image_segment[direction][trackSequence]) diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 24b340f232..6a629cd276 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -21,7 +21,7 @@ /** rct2: 0x008636F4 */ static void suspended_monorail_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -53,7 +53,7 @@ static void suspended_monorail_track_flat( /** rct2: 0x008637A4, 0x008637B4, 0x008637C4 */ static void suspended_monorail_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -72,7 +72,7 @@ static void suspended_monorail_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 32, 0, 6, height + 32); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, rideIndex, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -80,7 +80,7 @@ static void suspended_monorail_track_station( /** rct2: 0x00863704 */ static void suspended_monorail_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -145,7 +145,7 @@ static void suspended_monorail_track_25_deg_up( /** rct2: 0x00863714 */ static void suspended_monorail_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -210,7 +210,7 @@ static void suspended_monorail_track_flat_to_25_deg_up( /** rct2: 0x00863724 */ static void suspended_monorail_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -275,31 +275,31 @@ static void suspended_monorail_track_25_deg_up_to_flat( /** rct2: 0x00863734 */ static void suspended_monorail_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_monorail_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00863744 */ static void suspended_monorail_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_monorail_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00863754 */ static void suspended_monorail_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - suspended_monorail_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00863764 */ static void suspended_monorail_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -479,16 +479,16 @@ static void suspended_monorail_track_left_quarter_turn_5( /** rct2: 0x00863774 */ static void suspended_monorail_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - suspended_monorail_track_left_quarter_turn_5(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_monorail_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00863784 */ static void suspended_monorail_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -659,7 +659,7 @@ static void suspended_monorail_track_s_bend_left( /** rct2: 0x00863794 */ static void suspended_monorail_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -830,7 +830,7 @@ static void suspended_monorail_track_s_bend_right( /** rct2: 0x008637D4 */ static void suspended_monorail_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -949,16 +949,16 @@ static void suspended_monorail_track_left_quarter_turn_3( /** rct2: 0x008637E4 */ static void suspended_monorail_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - suspended_monorail_track_left_quarter_turn_3(session, rideIndex, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_monorail_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); } /** rct2: 0x00863864 */ static void suspended_monorail_track_left_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1121,7 +1121,7 @@ static void suspended_monorail_track_left_eighth_to_diag( /** rct2: 0x00863874 */ static void suspended_monorail_track_right_eighth_to_diag( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1284,25 +1284,25 @@ static void suspended_monorail_track_right_eighth_to_diag( /** rct2: 0x00863884 */ static void suspended_monorail_track_left_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_monorail_track_right_eighth_to_diag(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } /** rct2: 0x00863894 */ static void suspended_monorail_track_right_eighth_to_orthogonal( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_monorail_track_left_eighth_to_diag(session, rideIndex, trackSequence, (direction + 3) & 3, height, tileElement); + suspended_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); } /** rct2: 0x008637F4 */ static void suspended_monorail_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1385,7 +1385,7 @@ static void suspended_monorail_track_diag_flat( /** rct2: 0x00863824 */ static void suspended_monorail_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1468,7 +1468,7 @@ static void suspended_monorail_track_diag_25_deg_up( /** rct2: 0x00863804 */ static void suspended_monorail_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1551,7 +1551,7 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( /** rct2: 0x00863814 */ static void suspended_monorail_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1634,7 +1634,7 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( /** rct2: 0x00863854 */ static void suspended_monorail_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1717,7 +1717,7 @@ static void suspended_monorail_track_diag_25_deg_down( /** rct2: 0x00863834 */ static void suspended_monorail_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) @@ -1797,7 +1797,7 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( /** rct2: 0x00863844 */ static void suspended_monorail_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (trackSequence) diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index c8c9e3e141..2fddb5c9d0 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -31,7 +31,7 @@ enum /** rct2: 0x008B0E40 */ static void paint_boat_hire_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -61,10 +61,9 @@ static void paint_boat_hire_track_flat( /** rct2: 0x008B0E50 */ static void paint_boat_hire_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -89,7 +88,7 @@ static void paint_boat_hire_station( /** rct2: 0x008B0E80 */ static void paint_boat_hire_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -133,10 +132,10 @@ static void paint_boat_hire_track_left_quarter_turn_1_tile( /** rct2: 0x008B0E90 */ static void paint_boat_hire_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_boat_hire_track_left_quarter_turn_1_tile(session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + paint_boat_hire_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** diff --git a/src/openrct2/ride/water/DingySlide.cpp b/src/openrct2/ride/water/DingySlide.cpp index 6695bdb73e..e251ba9544 100644 --- a/src/openrct2/ride/water/DingySlide.cpp +++ b/src/openrct2/ride/water/DingySlide.cpp @@ -349,7 +349,7 @@ enum }; static void dinghy_slide_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -387,7 +387,7 @@ static void dinghy_slide_track_flat( } static void dinghy_slide_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -408,7 +408,7 @@ static void dinghy_slide_track_station( metal_a_supports_paint_setup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); - track_paint_util_draw_station(session, rideIndex, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -417,7 +417,7 @@ static void dinghy_slide_track_station( } static void dinghy_slide_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -462,7 +462,7 @@ static void dinghy_slide_track_25_deg_up( } static void dinghy_slide_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -498,7 +498,7 @@ static void dinghy_slide_track_60_deg_up( } static void dinghy_slide_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -543,7 +543,7 @@ static void dinghy_slide_track_flat_to_25_deg_up( } static void dinghy_slide_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -579,7 +579,7 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up( } static void dinghy_slide_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -615,7 +615,7 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up( } static void dinghy_slide_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[2][4][2] = { @@ -660,42 +660,42 @@ static void dinghy_slide_track_25_deg_up_to_flat( } static void dinghy_slide_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_right_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][5] = { @@ -823,22 +823,22 @@ static void dinghy_slide_track_right_quarter_turn_5( } static void dinghy_slide_track_left_quarter_turn_5( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_5(session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void dinghy_slide_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -933,7 +933,7 @@ static void dinghy_slide_track_s_bend_left( } static void dinghy_slide_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -1026,7 +1026,7 @@ static void dinghy_slide_track_s_bend_right( } static void dinghy_slide_track_right_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][3] = { @@ -1107,15 +1107,15 @@ static void dinghy_slide_track_right_quarter_turn_3( } static void dinghy_slide_track_left_quarter_turn_3( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_3(session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void dinghy_slide_track_flat_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1144,7 +1144,7 @@ static void dinghy_slide_track_flat_covered( } static void dinghy_slide_track_25_deg_up_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1180,7 +1180,7 @@ static void dinghy_slide_track_25_deg_up_covered( } static void dinghy_slide_track_60_deg_up_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1216,7 +1216,7 @@ static void dinghy_slide_track_60_deg_up_covered( } static void dinghy_slide_track_flat_to_25_deg_up_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1252,7 +1252,7 @@ static void dinghy_slide_track_flat_to_25_deg_up_covered( } static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1288,7 +1288,7 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( } static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1324,7 +1324,7 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( } static void dinghy_slide_track_25_deg_up_to_flat_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1360,43 +1360,42 @@ static void dinghy_slide_track_25_deg_up_to_flat_covered( } static void dinghy_slide_track_25_deg_down_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up_covered(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_60_deg_down_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_60_deg_up_covered(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_flat_to_25_deg_down_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up_to_flat_covered(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_flat_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_60_deg_up_to_25_deg_up_covered( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_25_deg_down_to_flat_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_flat_to_25_deg_up_covered(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_flat_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void dinghy_slide_track_right_quarter_turn_5_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][5] = { @@ -1524,16 +1523,15 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( } static void dinghy_slide_track_left_quarter_turn_5_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_5_covered( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_5_covered(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void dinghy_slide_track_s_bend_left_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -1628,7 +1626,7 @@ static void dinghy_slide_track_s_bend_left_covered( } static void dinghy_slide_track_s_bend_right_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -1721,7 +1719,7 @@ static void dinghy_slide_track_s_bend_right_covered( } static void dinghy_slide_track_right_quarter_turn_3_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const sprite_bb imageIds[4][3] = { @@ -1802,20 +1800,18 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( } static void dinghy_slide_track_left_quarter_turn_3_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_3_covered( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_3_covered(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void dinghy_slide_track_60_deg_down_to_25_deg_down_covered( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - dinghy_slide_track_25_deg_up_to_60_deg_up_covered( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int32_t trackType) diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 12cdfffb84..10a591c807 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -161,7 +161,7 @@ static constexpr const uint32_t LogFlumeTrackFlatImageIds[4][2] = { }; static void paint_log_flume_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = LogFlumeTrackFlatImageIds[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -182,7 +182,7 @@ static void paint_log_flume_track_flat( } static void paint_log_flume_track_station( - paint_session* session, ride_id_t rideIndex, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = LogFlumeTrackFlatImageIds[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -209,7 +209,7 @@ static void paint_log_flume_track_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station_3(session, rideIndex, direction, height + 2, height, tileElement); + track_paint_util_draw_station_3(session, ride, direction, height + 2, height, tileElement); // Covers shouldn't be offset by +2 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -219,7 +219,7 @@ static void paint_log_flume_track_station( } static void paint_log_flume_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -254,7 +254,7 @@ static void paint_log_flume_track_25_deg_up( } static void paint_log_flume_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -289,7 +289,7 @@ static void paint_log_flume_track_flat_to_25_deg_up( } static void paint_log_flume_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -324,7 +324,7 @@ static void paint_log_flume_track_25_deg_up_to_flat( } static void paint_log_flume_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -359,7 +359,7 @@ static void paint_log_flume_track_25_deg_down( } static void paint_log_flume_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -394,7 +394,7 @@ static void paint_log_flume_track_flat_to_25_deg_down( } static void paint_log_flume_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -429,7 +429,7 @@ static void paint_log_flume_track_25_deg_down_to_flat( } static void paint_log_flume_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -524,7 +524,7 @@ static void paint_log_flume_track_s_bend_left( } static void paint_log_flume_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -617,7 +617,7 @@ static void paint_log_flume_track_s_bend_right( } static void paint_log_flume_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -684,7 +684,7 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( } static void paint_log_flume_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -751,7 +751,7 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( } static void paint_log_flume_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SPR_STATION_BASE_D | IMAGE_TYPE_REMAP; @@ -782,7 +782,7 @@ static void paint_log_flume_track_on_ride_photo( } static void paint_log_flume_track_reverser( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][2] = { diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index d3f58ab408..c222f077e1 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -276,7 +276,7 @@ void vehicle_visual_river_rapids( /** rct2: 0x00757650 */ static void paint_river_rapids_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -319,11 +319,10 @@ static void paint_river_rapids_track_flat( /** rct2: 0x007576C0 */ static void paint_river_rapids_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_river_rapids_track_flat(session, rideIndex, trackSequence, direction, height, tileElement); - auto ride = get_ride(rideIndex); + paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, tileElement); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, tileElement); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -508,7 +507,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( /** rct2: 0x00757660 */ static void paint_river_rapids_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg(session, direction, height, river_rapids_track_pieces_25_deg_up); @@ -516,7 +515,7 @@ static void paint_river_rapids_track_25_deg_up( /** rct2: 0x00757670 */ static void paint_river_rapids_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg_to_flat_b(session, direction, height, river_rapids_track_pieces_flat_to_25_deg_up); @@ -524,7 +523,7 @@ static void paint_river_rapids_track_flat_to_25_deg_up( /** rct2: 0x00757680 */ static void paint_river_rapids_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg_to_flat_a(session, direction, height, river_rapids_track_pieces_25_deg_up_to_flat); @@ -532,7 +531,7 @@ static void paint_river_rapids_track_25_deg_up_to_flat( /** rct2: 0x00757690 */ static void paint_river_rapids_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg(session, (direction + 2) % 4, height, river_rapids_track_pieces_25_deg_down); @@ -540,7 +539,7 @@ static void paint_river_rapids_track_25_deg_down( /** rct2: 0x007576A0 */ static void paint_river_rapids_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg_to_flat_a( @@ -549,7 +548,7 @@ static void paint_river_rapids_track_flat_to_25_deg_down( /** rct2: 0x007576B0 */ static void paint_river_rapids_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { paint_river_rapids_track_25_deg_to_flat_b( @@ -558,7 +557,7 @@ static void paint_river_rapids_track_25_deg_down_to_flat( /** rct2: 0x007576F0 */ static void paint_river_rapids_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -614,7 +613,7 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( /** rct2: 0x00757700 */ static void paint_river_rapids_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -671,7 +670,7 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( /** rct2: 0x00757710 */ static void paint_river_rapids_track_waterfall( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -734,7 +733,7 @@ static void paint_river_rapids_track_waterfall( /** rct2: 0x00757720 */ static void paint_river_rapids_track_rapids( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -775,17 +774,17 @@ static void paint_river_rapids_track_rapids( /** rct2: 0x00757740 */ static void paint_river_rapids_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_river_rapids_track_flat(session, rideIndex, trackSequence, direction, height, tileElement); + paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, tileElement); track_paint_util_onride_photo_paint(session, direction, height + 13, tileElement); paint_util_set_general_support_height(session, height + 48, 0x20); } /** rct2: 0x */ static void paint_river_rapids_track_whirlpool( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 9589d5dab9..f54a63389a 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -476,7 +476,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { }; static void paint_splash_boats_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -501,7 +501,7 @@ static void paint_splash_boats_track_25_deg_up( } static void paint_splash_boats_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -527,7 +527,7 @@ static void paint_splash_boats_track_60_deg_up( } static void paint_splash_boats_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoatsFlatTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -552,7 +552,7 @@ static void paint_splash_boats_track_flat_to_25_deg_up( } static void paint_splash_boats_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats25DegUpToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -577,7 +577,7 @@ static void paint_splash_boats_track_25_deg_up_to_flat( } static void paint_splash_boats_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats25DegUpTo60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -603,7 +603,7 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up( } static void paint_splash_boats_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -629,7 +629,7 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up( } static void paint_splash_boats_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -655,14 +655,14 @@ static void paint_splash_boats_track_25_deg_down( } static void paint_splash_boats_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_splash_boats_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void paint_splash_boats_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoatsFlatTo25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -688,23 +688,21 @@ static void paint_splash_boats_track_flat_to_25_deg_down( } static void paint_splash_boats_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_splash_boats_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void paint_splash_boats_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - paint_splash_boats_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void paint_splash_boats_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId = SplashBoats25DegDownToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -742,7 +740,7 @@ static void paint_splash_boats_track_25_deg_down_to_flat( /** Start of elements originally from River Rafts */ /** rct2: 0x0089B170 */ static void paint_splash_boats_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { uint32_t imageId; @@ -785,7 +783,7 @@ static void paint_splash_boats_track_flat( /** rct2: 0x0089B1A0 */ static void paint_splash_boats_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { if (direction & 1) @@ -809,7 +807,6 @@ static void paint_splash_boats_station( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - auto ride = get_ride(rideIndex); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, tileElement); @@ -821,7 +818,7 @@ static void paint_splash_boats_station( /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_left_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -902,7 +899,7 @@ static void paint_splash_boats_track_left_quarter_turn_5_tiles( /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_right_quarter_turn_5_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -983,7 +980,7 @@ static void paint_splash_boats_track_right_quarter_turn_5_tiles( /** rct2: 0x0089B180 */ static void paint_splash_boats_track_s_bend_left( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -1075,7 +1072,7 @@ static void paint_splash_boats_track_s_bend_left( /** rct2: 0x0089B190 */ static void paint_splash_boats_track_s_bend_right( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { static constexpr const uint32_t imageIds[4][4][2] = { @@ -1166,7 +1163,7 @@ static void paint_splash_boats_track_s_bend_right( } static void paint_splash_boats_track_on_ride_photo( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { switch (direction) @@ -1185,7 +1182,7 @@ static void paint_splash_boats_track_on_ride_photo( break; } - paint_splash_boats_track_flat(session, rideIndex, trackSequence, direction, height, tileElement); + paint_splash_boats_track_flat(session, ride, trackSequence, direction, height, tileElement); track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index ad97018f6c..745fc4a0b9 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -81,10 +81,9 @@ void vehicle_visual_submarine( #endif static void submarine_ride_paint_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - auto ride = get_ride(rideIndex); if (ride == nullptr) return; @@ -116,7 +115,7 @@ static void submarine_ride_paint_track_station( } static void submarine_ride_paint_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { int32_t heightLower = height - 16; @@ -148,7 +147,7 @@ static void submarine_ride_paint_track_flat( } static void submarine_ride_paint_track_left_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_3_tiles_paint( @@ -181,16 +180,16 @@ static void submarine_ride_paint_track_left_quarter_turn_3_tiles( static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; static void submarine_ride_paint_track_right_quarter_turn_3_tiles( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; submarine_ride_paint_track_left_quarter_turn_3_tiles( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } static void submarine_ride_paint_track_left_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { track_paint_util_left_quarter_turn_1_tile_paint( @@ -204,11 +203,10 @@ static void submarine_ride_paint_track_left_quarter_turn_1_tile( } static void submarine_ride_paint_track_right_quarter_turn_1_tile( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - submarine_ride_paint_track_left_quarter_turn_1_tile( - session, rideIndex, trackSequence, (direction + 3) % 4, height, tileElement); + submarine_ride_paint_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); } /** diff --git a/src/openrct2/ride/water/WaterCoaster.cpp b/src/openrct2/ride/water/WaterCoaster.cpp index 0796783d47..7d2ae88a1e 100644 --- a/src/openrct2/ride/water/WaterCoaster.cpp +++ b/src/openrct2/ride/water/WaterCoaster.cpp @@ -13,309 +13,307 @@ #include "../coaster/JuniorRollerCoaster.h" static void water_rc_track_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void water_rc_track_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_25_deg_up_to_flat(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void water_rc_track_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); } static void water_rc_track_diag_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_flat_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_flat_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down_to_flat( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { bool isChained = tileElement->AsTrack()->HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, rideIndex, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, tileElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_station( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_paint_station(session, rideIndex, trackSequence, direction, height, tileElement, RIDE_TYPE_WATER_COASTER); + junior_rc_paint_station(session, ride, trackSequence, direction, height, tileElement, RIDE_TYPE_WATER_COASTER); } static void water_rc_track_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_paint_track_60_deg_up(session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + junior_rc_paint_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void water_rc_track_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_60_deg_up_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } static void water_rc_track_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - water_rc_track_25_deg_up_to_60_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); } // 5 tile turns static void water_rc_track_left_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static constexpr const uint8_t water_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; static void water_rc_track_left_quarter_turn_5_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { water_rc_track_right_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) % 4, height, + session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) % 4, height, tileElement); } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { water_rc_track_left_quarter_turn_5_tiles_25_deg_up( - session, rideIndex, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 3) % 4, height, + session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 3) % 4, height, tileElement); } // 3 tile turns static void water_rc_track_right_quarter_turn_3_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_right_quarter_turn_3_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static constexpr const uint8_t water_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { 3, 1, 2, 0 }; static void water_rc_track_left_quarter_turn_3_tiles_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = water_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; water_rc_track_right_quarter_turn_3_tiles_25_deg_down( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void water_rc_track_left_quarter_turn_3_tiles_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { trackSequence = water_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; - water_rc_track_right_quarter_turn_3_tiles_25_deg_up( - session, rideIndex, trackSequence, (direction + 1) % 4, height, tileElement); + water_rc_track_right_quarter_turn_3_tiles_25_deg_up(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); } static void water_rc_track_diag_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { - junior_rc_paint_track_diag_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + junior_rc_paint_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_diag_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, + paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - session, rideIndex, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); } TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int32_t trackType) From 71ff9bf6d60812d0aa94f76a00009e0aa0b1b9ce Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 28 Jul 2021 21:25:51 +0200 Subject: [PATCH 029/681] Allow loading images from .pob files (#15122) --- src/openrct2/FileClassifier.cpp | 2 +- src/openrct2/object/ImageTable.cpp | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index 6aa2b7b3f9..49dc9dd019 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -165,7 +165,7 @@ static bool TryClassifyAsTD4_TD6(OpenRCT2::IStream* stream, ClassifiedFileInfo* uint32_t get_file_extension_type(const utf8* path) { auto extension = Path::GetExtension(path); - if (String::Equals(extension, ".dat", true)) + if (String::Equals(extension, ".dat", true) || String::Equals(extension, ".pob", true)) return FILE_EXTENSION_DAT; if (String::Equals(extension, ".sc4", true)) return FILE_EXTENSION_SC4; diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index ab2e033ba3..fcf243bc6c 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -270,15 +270,32 @@ std::string ImageTable::FindLegacyObject(const std::string& name) const auto env = GetContext()->GetPlatformEnvironment(); auto objectsPath = env->GetDirectoryPath(DIRBASE::RCT2, DIRID::OBJECT); auto objectPath = Path::Combine(objectsPath, name); + if (File::Exists(objectPath)) + { + return objectPath; + } + + std::string altName = name; + auto rangeStart = name.find(".DAT"); + if (rangeStart != std::string::npos) + { + altName.replace(rangeStart, 4, ".POB"); + } + objectPath = Path::Combine(objectsPath, altName); + if (File::Exists(objectPath)) + { + return objectPath; + } + if (!File::Exists(objectPath)) { // Search recursively for any file with the target name (case insensitive) - auto filter = Path::Combine(objectsPath, "*.dat"); + auto filter = Path::Combine(objectsPath, "*.dat;*.pob"); auto scanner = Path::ScanDirectory(filter, true); while (scanner->Next()) { auto currentName = Path::GetFileName(scanner->GetPathRelative()); - if (String::Equals(currentName, name, true)) + if (String::Equals(currentName, name, true) || String::Equals(currentName, altName, true)) { objectPath = scanner->GetPath(); break; From d01a3a783a8da54082a50f0dc29c568b271a8045 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 29 Jul 2021 04:07:50 +0000 Subject: [PATCH 030/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ar-EG.txt | 45 --------------------------------------- data/language/ca-ES.txt | 45 --------------------------------------- data/language/cs-CZ.txt | 45 --------------------------------------- data/language/da-DK.txt | 45 --------------------------------------- data/language/de-DE.txt | 45 --------------------------------------- data/language/eo-OO.txt | 45 --------------------------------------- data/language/es-ES.txt | 45 --------------------------------------- data/language/fi-FI.txt | 47 +---------------------------------------- data/language/fr-FR.txt | 45 --------------------------------------- data/language/hu-HU.txt | 45 --------------------------------------- data/language/it-IT.txt | 45 --------------------------------------- data/language/ja-JP.txt | 45 --------------------------------------- data/language/ko-KR.txt | 45 --------------------------------------- data/language/nb-NO.txt | 45 --------------------------------------- data/language/nl-NL.txt | 45 --------------------------------------- data/language/pl-PL.txt | 45 --------------------------------------- data/language/pt-BR.txt | 45 --------------------------------------- data/language/ru-RU.txt | 45 --------------------------------------- data/language/sv-SE.txt | 45 --------------------------------------- data/language/tr-TR.txt | 45 --------------------------------------- data/language/vi-VN.txt | 45 --------------------------------------- data/language/zh-CN.txt | 45 --------------------------------------- data/language/zh-TW.txt | 45 --------------------------------------- 23 files changed, 1 insertion(+), 1036 deletions(-) diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index d38d4004eb..36ede8a126 100644 --- a/data/language/ar-EG.txt +++ b/data/language/ar-EG.txt @@ -2054,51 +2054,6 @@ STR_2854 :{RED}Guests can’t get to the entrance of {STRINGID} !{NEWLINE}Con STR_2855 :{RED}{STRINGID} has no path leading from its exit !{NEWLINE}Construct a path from the ride exit STR_2858 :Can’t start marketing campaign… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :معلومات عن الموسيقي… -STR_2863 :معلومات عن الموسيقي -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) لا حقوق نشر -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) لا حقوق نشر -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (تقليدية) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) لا حقوق نشر -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (تقليدية) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (تقليدية) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (تقليدية) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) لا حقوق نشر -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) لا حقوق نشر -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (تقليدية) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Main colour scheme STR_2972 :Alternative colour scheme 1 STR_2973 :Alternative colour scheme 2 diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index 681184493a..17c5e36385 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -2056,51 +2056,6 @@ STR_2854 :{RED}Els visitants no troben l'entrada de {STRINGID}!{NEWLINE}Const STR_2855 :{RED}{STRINGID} no disposa de camí a la sortida!{NEWLINE}Construïu-hi un camí de sortida. STR_2858 :No es pot començar la campanya de màrqueting… STR_2861 :{WINDOW_COLOUR_2}Sota llicència d'Infogrames Interactive Inc. -STR_2862 :Agraïments per la música… -STR_2863 :Agraïments per la música -STR_2864 :{WINDOW_COLOUR_2}Marxa - Children of the Regiment: (Fucik) sense copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) sense copyright -STR_2867 :{WINDOW_COLOUR_2}Viatge de bodes: (tradicional) -STR_2868 :{WINDOW_COLOUR_2}Contes dels boscos de Viena: (Johann Strauss) sense copyright -STR_2869 :{WINDOW_COLOUR_2}Dansa eslava: (tradicional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (tradicional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (tradicional) -STR_2872 :{WINDOW_COLOUR_2}Obertura - Poet and Peasant: (Suppe) sense copyright -STR_2873 :{WINDOW_COLOUR_2}Popurri de valsos: (Johann Strauss) sense copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (tradicional) -STR_2875 :{WINDOW_COLOUR_2}Gravacions originals (P) 1976 C.J.Mears Organization, amb els permisos corresponents -STR_2876 :{WINDOW_COLOUR_2}Música principal del RollerCoaster Tycoon 2: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Mostres cortesia de Spectrasonics «Liquid Grooves») -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, interpretat per Peter James Adcock) enregistraments © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Esquema de color principal STR_2972 :Esquema de color alternatiu 1 STR_2973 :Esquema de color alternatiu 2 diff --git a/data/language/cs-CZ.txt b/data/language/cs-CZ.txt index 06aeafb10d..954f318596 100644 --- a/data/language/cs-CZ.txt +++ b/data/language/cs-CZ.txt @@ -2056,51 +2056,6 @@ STR_2854 :{RED}Návštěvníci nemohou najít vstup do {STRINGID} !{NEWLINE}P STR_2855 :{RED}{STRINGID} nemá postavenou vestu z východu!{NEWLINE}Postavte cestu z východu atrakce STR_2858 :Nelze zahájit reklamní kampaň… STR_2861 :{WINDOW_COLOUR_2}Licencováno Infogrames Interactive Inc. -STR_2862 :Poděkování za hudbu… -STR_2863 :Poděkování za hudbu -STR_2864 :{WINDOW_COLOUR_2}Děti pluku - pochod: (Fučík) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics „Liquid Grooves“) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Primární barevná kombinace STR_2972 :Alternativní barevná kombinace 1 STR_2973 :Alternativní barevná kombinace 2 diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index 2b0bdcce0b..471ab7bba6 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -2055,51 +2055,6 @@ STR_2854 :{RED}Gæster kan ikke komme til indgangen af {STRINGID} !{NEWLINE}K STR_2855 :{RED}{STRINGID} Har ikke nogen gangsti fra udgangen!{NEWLINE}Konstruer en sti fra forlystelsens udgang STR_2858 :Kan ikke starte markedsføringskampagne… STR_2861 :{WINDOW_COLOUR_2}Licenseret til Infogrames Interactive Inc. -STR_2862 :Musik tilkendegivelser… -STR_2863 :Musik tilkendegivelser -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Grundfarveskema STR_2972 :Alternativ farveskema 1 STR_2973 :Alternativ farveskema 2 diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 9e5b5c57fc..29976466ed 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -2057,51 +2057,6 @@ STR_2854 :{RED}Besucher gelangen nicht zum Eingang von {STRINGID}!{NEWLINE}Ba STR_2855 :{RED}{STRINGID} hat keinen Fußweg, der vom Ausgang wegführt!{NEWLINE}Legen Sie einen Fußweg an, der vom Bahnausgang wegführt STR_2858 :Marketingkampage kann nicht gestartet werden… STR_2861 :{WINDOW_COLOUR_2}Lizenziert für Infogrames Interactive Inc. -STR_2862 :Musik… -STR_2863 :Musik -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) kein Copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole (Die schöne Spanierin): (Robert Vollstedt) kein Copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditionell) -STR_2868 :{WINDOW_COLOUR_2}Geschichten aus dem Wiener Wald: (Johann Strauss) kein Copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditionell) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditionell) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditionell) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) kein Copyright -STR_2873 :{WINDOW_COLOUR_2}Walzermedley: (Johann Strauss) kein Copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditionell) -STR_2875 :{WINDOW_COLOUR_2}Originalaufnahmen (P) 1976 C.J.Mears Organisation, mit freundlicher Genehmigung -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Titelmusik: (Allister Brimble) Copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) Copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) Copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) Copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) Copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) Copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) Copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) Copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) Copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) Copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) Copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) Copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) Copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) Copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) Copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) Copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) Copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) Copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) Copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) Copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) Copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) Copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) Copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) Copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Auszüge mit freundlicher Genehmigung von Spectrasonics „Liquid Grooves“) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, gespielt von Peter James Adcock) Aufnahme © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) Copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) Copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) Copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) Copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) Copyright © Chris Sawyer STR_2971 :Hauptfarbschema STR_2972 :Alternatives Farbschema 1 STR_2973 :Alternatives Farbschema 2 diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index 5b6eb0bd92..1967ea3060 100644 --- a/data/language/eo-OO.txt +++ b/data/language/eo-OO.txt @@ -2055,51 +2055,6 @@ STR_2854 :{RED}Gastoj ne eblas iri al la enirejo de {STRINGID}!{NEWLINE}Konst STR_2855 :{RED}{STRINGID} ne havas vojon el ĝia elirejo!{NEWLINE}Konstruu vojon de la elirejo STR_2858 :Ne eblas komenci kampanjon surmerkatigan… STR_2861 :{WINDOW_COLOUR_2}Rajtigita al Infogrames Interactive Inc. -STR_2862 :Dankesprimoj de muziko… -STR_2863 :Dankesprimoj de muziko -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) sen aŭtorrajto -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) sen aŭtorrajto -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Tradicia) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) sen aŭtorrajto -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Tradicia) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Tradicia) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Tradicia) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Franz von Suppé) sen aŭtorrajto -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) sen aŭtorrajto -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Tradicia) -STR_2875 :{WINDOW_COLOUR_2}Originalaj sonregistraĵoj (P) 1976 C.J.Mears Organization, uzitaj kun konsento -STR_2876 :{WINDOW_COLOUR_2}La Titola Muziko de “RollerCoaster Tycoon 2”: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) aŭtorrajto © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Por la sonpecoj, danke al Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, ludita de Peter James Adcock) sonregistraĵo © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) aŭtorrajto © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) aŭtorrajto © Chris Sawyer STR_2971 :Ĉefa kolorskemo STR_2972 :Alternativa kolorskemo 1 STR_2973 :Alternativa kolorskemo 2 diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 3896f289ec..3b59e1fbd1 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -2056,51 +2056,6 @@ STR_2854 :{RED}¡Los visitantes no encuentran la entrada de {STRINGID}!{NEWLI STR_2855 :{RED}¡{STRINGID} no tiene un camino de salida!{NEWLINE}Construye un camino desde la salida de la atracción. STR_2858 :No puedes iniciar una campaña publicitaria… STR_2861 :{WINDOW_COLOUR_2}Bajo licencia a Infogrames Interactive Inc. -STR_2862 :Agradecimientos musicales… -STR_2863 :Agradecimientos musicales -STR_2864 :{WINDOW_COLOUR_2}Marcha - Children of the Regiment: (Fucik) sin copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Bella Española: (Robert Vollstedt) Copyright Control -STR_2867 :{WINDOW_COLOUR_2}Viaje de bodas: (Tradicional) -STR_2868 :{WINDOW_COLOUR_2}Cuentos de los bosques de Viena: (Johann Strauss) sin copyright -STR_2869 :{WINDOW_COLOUR_2}Danza Slava: (Tradicional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Tradicional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Tradicional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) sin copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) sin copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Tradicional) -STR_2875 :{WINDOW_COLOUR_2}Grabaciones originales (P) 1976 C.J.Mears Organization, usados con permisos -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Música Principal: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Esquema de color principal STR_2972 :Esquema de color alternativo 1 STR_2973 :Esquema de color alternativo 2 diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 3f077759f1..6a2e3df826 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -2061,51 +2061,6 @@ STR_2854 :{RED}Kävijät eivät pääse laitteen {STRINGID} sisäänkäynnill STR_2855 :{RED}Laitteen {STRINGID} uloskäynnistä ei lähde polkua!{NEWLINE}Rakenna polku uloskäynniltä STR_2858 :Markkinointikampanjaa ei voi aloittaa… STR_2861 :{WINDOW_COLOUR_2}Lisensoinut Infogrames Interactive Inc. -STR_2862 :Musiikin lähdemaininnat… -STR_2863 :Musiikin lähdemaininnat -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) tekijänoikeuden ulkopuolella -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}In Continental Mood: (säveltäjä tuntematon) Copyright Control -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (perinteinen) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) tekijänoikeuden ulkopuolella -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (perinteinen) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (perinteinen) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (perinteinen) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) tekijänoikeuden ulkopuolella -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) tekijänoikeuden ulkopuolella -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (perinteinen) -STR_2875 :{WINDOW_COLOUR_2}Alkuperäiset nauhoitukset (P) 1976 C.J.Mears Organization, käytetty luvalla -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) tekijänoikeus © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Ääninäytteet Spectrasonicsin toimesta; ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, soittanut Peter James Adcock) nauhoitus © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) tekijänoikeus © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) tekijänoikeus © Chris Sawyer STR_2971 :Pääväriskeema STR_2972 :Vaihtoehtoinen väriskeema 1 STR_2973 :Vaihtoehtoinen väriskeema 2 @@ -4511,4 +4466,4 @@ STR_DTLS :Tämä vanha huvipuisto on nähnyt parempia päiviä. Auta sen omis STR_SCNR :Pandamaailma STR_PARK :Pandamaailma -STR_DTLS :Rakenna lisää laitteita ja houkuttele lisää kävijöitä tähän panda-teemaiseen puistoon \ No newline at end of file +STR_DTLS :Rakenna lisää laitteita ja houkuttele lisää kävijöitä tähän panda-teemaiseen puistoon diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 4e4159244d..4b175b3b99 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -2060,51 +2060,6 @@ STR_2854 :{RED}Vos visiteurs ne peuvent atteindre l’entrée de {STRINGID} STR_2855 :{RED}{STRINGID} ne dispose pas d’allée à partir de sa sortie !{NEWLINE}Construisez une allée à la sortie de l’attraction. STR_2858 :Impossible de commencer campagne marketing… STR_2861 :{WINDOW_COLOUR_2}Sous licence d’Infogrames Interactive Inc. -STR_2862 :Remerciements musique… -STR_2863 :Remerciements musique -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) sans copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade : (J.Heyken) British Standard Music Coy ; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole : (Robert Vollstedt) Copyright Control -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey : (Traditionnelle) -STR_2868 :{WINDOW_COLOUR_2}Les Histoires du Bois de Vienne : (Johann Strauss) sans copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance : (Traditionnelle) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn : (Traditionnelle) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor : (Traditionnelle) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant : (Suppe) sans copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley : (Johann Strauss) sans copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba : (Traditionnelle) -STR_2875 :{WINDOW_COLOUR_2}Enregistrements originaux (P) 1976 C.J.Mears Organisation, utilisés avec accord -STR_2876 :{WINDOW_COLOUR_2}Musique du titre RollerCoaster Tycoon 2 : (Allister Brimble) © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat : (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat : (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb : (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March : (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven : (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders : (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox : (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice : (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles : (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda : (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat : (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis : (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid : (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair : (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster : (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock : (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag : (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy : (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock : (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia : (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride : (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn : (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam : (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Extraits avec l’aimable autorisation de Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata : (C.M.Widor, joué par Peter James Adcock) enregistrements © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock : (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic : (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture : (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams : (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor : (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Palette de couleurs principale STR_2972 :Palette de couleurs second. 1 STR_2973 :Palette de couleurs second. 2 diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 1080211dd0..31475abf09 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -2049,51 +2049,6 @@ STR_2854 :{RED}A vendégek nem tudnak eljutni {STRINGID} bejáratáig !{NEWLI STR_2855 :{RED}Nem kapcsolódik út {STRINGID} kijáratához !{NEWLINE}Építs utat a játék kijáratához STR_2858 :Nem indítható marketingkampány… STR_2861 :{WINDOW_COLOUR_2}Az Infogrames Interactive Inc. számára licencelve -STR_2862 :Zenei köszönetnyilvánítások… -STR_2863 :Zenei köszönetnyilvánítások -STR_2864 :{WINDOW_COLOUR_2}Induló - Die Regimentskinder: (Fucik) copyright nélküli -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) copyright nélküli -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Tradicionális) -STR_2868 :{WINDOW_COLOUR_2}Mesél a bécsi erdő: (JohannSTRauss) copyright nélküli -STR_2869 :{WINDOW_COLOUR_2}Szláv tánc: (Tradicionális) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Tradicionális) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Tradicionális) -STR_2872 :{WINDOW_COLOUR_2}Nyitány - Költő és paraszt: (Franz von Suppé) copyright nélküli -STR_2873 :{WINDOW_COLOUR_2}Keringő egyveleg: (JohannSTRauss) copyright nélküli -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Tradicionális) -STR_2875 :{WINDOW_COLOUR_2}Eredeti felvételek (P) 1976 C.J.Mears Organization, engedéllyel használva -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 főcímzene: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(A minták a Spectrasonics „Liquid Grooves”-ának köszönhetőek) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, Előadja: Peter James Adcock) felvétel © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}Baj van a részeg tengerésszel: (Névtelen/Allister Brimble) copyright © Chris Sawyer STR_2971 :Fő színséma STR_2972 :Alternatív színséma 1 STR_2973 :Alternatív színséma 2 diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 692635e7c2..c3b5b6bc5e 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -2058,51 +2058,6 @@ STR_2854 :{RED}I visitatori non riescono a raggiungere l'entrata a {STRINGID} STR_2855 :{RED}{STRINGID} non è dotato di un percorso alla sua uscita!{NEWLINE}Costruisci un percorso che parta dall'uscita dell'attrazione STR_2858 :Impossibile avviare la campagna di marketing… STR_2861 :{WINDOW_COLOUR_2}Concesso in licenza a Infogrames Interactive -STR_2862 :Riconoscimenti dei brani musicali… -STR_2863 :Riconoscimento dei brani musicali -STR_2864 :{WINDOW_COLOUR_2}Marcia - I Bambini del Reggimento: (Fucik) senza copyright -STR_2865 :{WINDOW_COLOUR_2}Serenata di Heyken: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) senza copyright -STR_2867 :{WINDOW_COLOUR_2}Viaggio della sposa: (Tradizionale) -STR_2868 :{WINDOW_COLOUR_2}Racconti dei boschi di Vienna: (Johann Strauss) senza copyright -STR_2869 :{WINDOW_COLOUR_2}Danza slava: (Tradizionale) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Tradizionale) -STR_2871 :{WINDOW_COLOUR_2}Il Biondo Marinaio: (Tradizionale) -STR_2872 :{WINDOW_COLOUR_2}Overture - Il poeta e il Contadino: (Suppe) senza copyright -STR_2873 :{WINDOW_COLOUR_2}Medley di waltzer: (Johann Strauss) senza copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Tradizionale) -STR_2875 :{WINDOW_COLOUR_2}Orginal Recordings (P) 1976 C.J.Mears Organisation, usati per loro concessione -STR_2876 :{WINDOW_COLOUR_2}Musica dei titoli di RollerCoaster Tycoon 2: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Sample forniti da Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, eseguita da Peter James Adcock) registrazione © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Modello decorativo principale STR_2972 :Modello decorativo alternativo 1 STR_2973 :Modello decorativo alternativo 2 diff --git a/data/language/ja-JP.txt b/data/language/ja-JP.txt index c5620c9683..60539fe055 100644 --- a/data/language/ja-JP.txt +++ b/data/language/ja-JP.txt @@ -2051,51 +2051,6 @@ STR_2854 :{RED}{STRINGID}の入口に来園客が行けません!{NEWLINE}入 STR_2855 :{RED}{STRINGID}の出口からの歩道がありません!{NEWLINE}乗物の出口から歩道を敷設してください STR_2858 :キャンペーンを始めることができません… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :Music acknowledgements… -STR_2863 :Music acknowledgements -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Franz von Suppé) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :主な配色 STR_2972 :1番目の別の配色 STR_2973 :2番目の別の配色 diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index b4c2b7b49a..16e1ff17fe 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -2059,51 +2059,6 @@ STR_2854 :{RED}{STRINGID}의 입구로 가는 길이 없습니다 !{NEWLINE} STR_2855 :{RED}{STRINGID}의 출구에서 나오는 길이 없습니다 !{NEWLINE}출구로 가는 길을 만드세요 STR_2858 :광고 이벤트를 시작할 수 없습니다… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :음악 저작권… -STR_2863 :음악 저작권 -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (푸치크) 저작권 없음 -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) 저작권 없음 -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (민요) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (요한 슈트라우스) 저작권 없음 -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (민요) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (민요) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (민요) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (주페) 저작권 없음 -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (요한 슈트라우스) 저작권 없음 -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (민요) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 타이틀 음악: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :주 색상 조합 STR_2972 :부 색상 조합 1 STR_2973 :부 색상 조합 2 diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index 54068654b7..c1c48d17f8 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -2054,51 +2054,6 @@ STR_2854 :{RED}Guests can't get to the entrance of {STRINGID} !{NEWLINE}Const STR_2855 :{RED}{STRINGID} has no path leading from its exit !{NEWLINE}Construct a path from the ride exit STR_2858 :Can't start marketing campaign… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :Music acknowledgements… -STR_2863 :Music acknowledgements -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) ingen opphavsrett -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics «Liquid Grooves») -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Main colour scheme STR_2972 :Alternative colour scheme 1 STR_2973 :Alternative colour scheme 2 diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 0420fc3a25..fd5679f0bf 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -2054,51 +2054,6 @@ STR_2854 :{RED}Bezoekers kunnen niet bij de ingang van {STRINGID} komen!{NEWL STR_2855 :{RED}{STRINGID} heeft geen pad vanaf de uitgang!{NEWLINE}Bouw een pad vanaf de uitgang STR_2858 :Kan marketingcampagne niet starten… STR_2861 :{WINDOW_COLOUR_2}In licentie gegeven aan {NEWLINE}Infogrames Interactive Inc. -STR_2862 :Muziekdankwoord… -STR_2863 :Muziekdankwoord -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) geen copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole (Die schöne Spanierin): (Robert Vollstedt) geen copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditioneel) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) geen copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditioneel) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditioneel) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditioneel) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) geen copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) geen copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditioneel) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, gebruikt met toestemming -STR_2876 :{WINDOW_COLOUR_2}Titelmuziek RollerCoaster Tycoon 2: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples afkomstig van Spectrasonics ‘Liquid Grooves’) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, gespeeld door Peter James Adcock) opname © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Standaard kleurenschema STR_2972 :Alternatief kleurenschema 1 STR_2973 :Alternatief kleurenschema 2 diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index f23c53eacb..44dbfceba4 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -2055,51 +2055,6 @@ STR_2854 :{RED}Goście nie mogą dotrzeć do wejścia do atrakcji {STRINGID}! STR_2855 :Przy wyjściu z atrakcji {RED}{STRINGID} nie ma żadnej dróżki!{NEWLINE}Zbuduj ścieżkę prowadzącą do wyjścia STR_2858 :Nie można rozpocząć kampanii reklamowej… STR_2861 :{WINDOW_COLOUR_2}Licencja przyznana Infogrames Interactive Inc. -STR_2862 :Muzyka… -STR_2863 :Muzyka -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}In Continental Mood: (Composer unknown) Copyright Control -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Podstawowy schemat koloru STR_2972 :Alternatywny schemat kolorów nr 1 STR_2973 :Alternatywny schemat kolorów nr 2 diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 187c0be2fc..010a9667e5 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -2055,51 +2055,6 @@ STR_2854 :{RED}Os visitantes não conseguem entrar em {STRINGID}!{NEWLINE}Con STR_2855 :{RED}{STRINGID} não tem um caminho de saída!{NEWLINE}Construa um caminho a partir da saída da atração STR_2858 :Impossível iniciar campanha de marketing… STR_2861 :{WINDOW_COLOUR_2}Licenciado para Infogrames Interactive Inc. -STR_2862 :Créditos das músicas… -STR_2863 :Créditos das músicas -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) sem direitos autorais -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) sem direitos autorais -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Tradicional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) sem direitos autorais -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Tradicional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Tradicional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Tradicional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) sem direitos autorais -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) sem direitos autorais -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Tradicional) -STR_2875 :{WINDOW_COLOUR_2}Gravações originais (P) 1976 C.J.Mears Organization, usado com autorização -STR_2876 :{WINDOW_COLOUR_2}Música Título - RollerCoaster Tycoon 2: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) direitos autorais © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) direitos autorais © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Amostras Grátis de Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, executada por Peter James Adcock) gravada por © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) direitos autorais © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) direitos autorais © Chris Sawyer STR_2971 :Esquema de cor principal STR_2972 :Esquema de cor alternativo 1 STR_2973 :Esquema de cor alternativo 2 diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index 93b52e608c..f50e4f198f 100644 --- a/data/language/ru-RU.txt +++ b/data/language/ru-RU.txt @@ -2052,51 +2052,6 @@ STR_2854 :{RED}Гости не могут попасть ко входу на STR_2855 :{RED}{STRINGID} не имеет дорожки!{NEWLINE}Постройте дорожку от аттракциона. STR_2858 :Невозможно начать маркетинговую кампанию… STR_2861 :{WINDOW_COLOUR_2}Лицензия принадлежит Infogrames Interactive Inc. -STR_2862 :Музыка… -STR_2863 :Музыка -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}In Continental Mood: (Composer unknown) Copyright Control -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Главная цветовая схема STR_2972 :Альт. схема 1 STR_2973 :Альт. схема 2 diff --git a/data/language/sv-SE.txt b/data/language/sv-SE.txt index 9994f23fb9..4747803617 100644 --- a/data/language/sv-SE.txt +++ b/data/language/sv-SE.txt @@ -2057,51 +2057,6 @@ STR_2854 :{RED}Besökare kan inte komma fram till ingången till {STRINGID}!{ STR_2855 :{RED}{STRINGID} har ingen gångväg från sin utgång !{NEWLINE}Bygg en gångväg från åkturens utgång STR_2858 :Kan inte påbörja kampanj… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :Om musik… -STR_2863 :Om musik -STR_2864 :{WINDOW_COLOUR_2}March – Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture – Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin / Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon / Allister Brimble) copyright © Chris Sawyer STR_2971 :Huvudfärg STR_2972 :Andra färg STR_2973 :Tredje färg diff --git a/data/language/tr-TR.txt b/data/language/tr-TR.txt index dc49ca48ca..183110a244 100644 --- a/data/language/tr-TR.txt +++ b/data/language/tr-TR.txt @@ -2051,51 +2051,6 @@ STR_2854 :{RED}Müşteriler {STRINGID} aletinin girişini bulamıyor!{NEWLINE STR_2855 :{RED}{STRINGID} aletinin çıkışı yok !{NEWLINE}Alet çıkışına yol inşa ediniz STR_2858 :Pazarlama kampanyası başlatılamıyor… STR_2861 :{WINDOW_COLOUR_2}Infogrames Interactive Inc.'e lisanslı -STR_2862 :Müzik… -STR_2863 :Müzik -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics ”Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Ana renkler STR_2972 :Alternatif renkler 1 STR_2973 :Alternatif renkler 2 diff --git a/data/language/vi-VN.txt b/data/language/vi-VN.txt index 58cb37b683..e3ac81474a 100644 --- a/data/language/vi-VN.txt +++ b/data/language/vi-VN.txt @@ -2057,51 +2057,6 @@ STR_2854 :{RED}Guests can’t get to the entrance of {STRINGID}!{NEWLINE}Cons STR_2855 :{RED}{STRINGID} has no path leading from its exit!{NEWLINE}Construct a path from the ride exit STR_2858 :Can’t start marketing campaign… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :Music acknowledgements… -STR_2863 :Music acknowledgements -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) non copyright -STR_2865 :{WINDOW_COLOUR_2}Heyken’s Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) non copyright -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) non copyright -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Franz von Suppé) non copyright -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) non copyright -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) copyright © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer’s Heat: (Allister Brimble) copyright © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh’s Tomb: (Allister Brimble) copyright © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar’s March: (Allister Brimble) copyright © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) copyright © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) copyright © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) copyright © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) copyright © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja’s Noodles: (Allister Brimble) copyright © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) copyright © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble’s Beat: (Allister Brimble) copyright © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) copyright © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) copyright © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire’s Lair: (Allister Brimble) copyright © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) copyright © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) copyright © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) copyright © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) copyright © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) copyright © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) copyright © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) copyright © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) copyright © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) copyright © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) copyright © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) copyright © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) copyright © Chris Sawyer STR_2971 :Main colour scheme STR_2972 :Alternative colour scheme 1 STR_2973 :Alternative colour scheme 2 diff --git a/data/language/zh-CN.txt b/data/language/zh-CN.txt index 8d5c0afad9..b0f08e3d4f 100644 --- a/data/language/zh-CN.txt +++ b/data/language/zh-CN.txt @@ -2060,51 +2060,6 @@ STR_2854 :{RED}游客都不能走到去{STRINGID}的入口!{NEWLINE}请建造 STR_2855 :{RED}{STRINGID}的出口并没有道路连接!{NEWLINE}请建造道路连接出口 STR_2858 :不能开始实行营销计划… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :音乐鸣谢列表… -STR_2863 :音乐鸣谢列表 -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) 无版权 -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) 版权控制 -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (Traditional) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) 无版权 -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (Traditional) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (Traditional) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (Traditional) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) 无版权 -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) 无版权 -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (Traditional) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) 版权所有 © Chris Sawyer -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) 版权所有 © Chris Sawyer -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2901 :{WINDOW_COLOUR_2}(Samples courtesy of Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) 版权所有 © Chris Sawyer -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) 版权所有 © Chris Sawyer STR_2971 :主要配色主题 STR_2972 :额外配色主题1 STR_2973 :额外配色主题2 diff --git a/data/language/zh-TW.txt b/data/language/zh-TW.txt index 48b2e1fd34..83e83b4ce6 100644 --- a/data/language/zh-TW.txt +++ b/data/language/zh-TW.txt @@ -2059,51 +2059,6 @@ STR_2854 :{RED}遊客都不能走到去{STRINGID}的入口!{NEWLINE}請建造 STR_2855 :{RED}{STRINGID}的出口並沒有道路連接!{NEWLINE}請建造道路連接出口 STR_2858 :不能開始實行營銷計劃… STR_2861 :{WINDOW_COLOUR_2}Licensed to Infogrames Interactive Inc. -STR_2862 :音樂鳴謝列表… -STR_2863 :音樂鳴謝列表 -STR_2864 :{WINDOW_COLOUR_2}March - Children of the Regiment: (Fucik) 無版權 -STR_2865 :{WINDOW_COLOUR_2}Heyken's Serenade: (J.Heyken) British Standard Music Coy; GEMA, BRITICO -STR_2866 :{WINDOW_COLOUR_2}La Belle Espagnole: (Robert Vollstedt) 無版權 -STR_2867 :{WINDOW_COLOUR_2}Wedding Journey: (傳統樂曲) -STR_2868 :{WINDOW_COLOUR_2}Tales from the Vienna Woods: (Johann Strauss) 無版權 -STR_2869 :{WINDOW_COLOUR_2}Slavonic Dance: (傳統樂曲) -STR_2870 :{WINDOW_COLOUR_2}Das Alpenhorn: (傳統樂曲) -STR_2871 :{WINDOW_COLOUR_2}The Blond Sailor: (傳統樂曲) -STR_2872 :{WINDOW_COLOUR_2}Overture - Poet and Peasant: (Suppe) 無版權 -STR_2873 :{WINDOW_COLOUR_2}Waltz Medley: (Johann Strauss) 無版權 -STR_2874 :{WINDOW_COLOUR_2}Bella Bella Bimba: (傳統樂曲) -STR_2875 :{WINDOW_COLOUR_2}Original recordings (P) 1976 C.J.Mears Organization, used with consent -STR_2876 :{WINDOW_COLOUR_2}RollerCoaster Tycoon 2 Title Music: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2877 :{WINDOW_COLOUR_2}Dodgems Beat: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2878 :{WINDOW_COLOUR_2}Mid Summer's Heat: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2879 :{WINDOW_COLOUR_2}Pharaoh's Tomb: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2880 :{WINDOW_COLOUR_2}Caesar's March: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2881 :{WINDOW_COLOUR_2}Drifting To Heaven: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2882 :{WINDOW_COLOUR_2}Invaders: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2883 :{WINDOW_COLOUR_2}Eternal Toybox: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2884 :{WINDOW_COLOUR_2}Jungle Juice: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2885 :{WINDOW_COLOUR_2}Ninja's Noodles: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2886 :{WINDOW_COLOUR_2}Voyage to Andromeda: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2887 :{WINDOW_COLOUR_2}Brimble's Beat: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2888 :{WINDOW_COLOUR_2}Atlantis: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2889 :{WINDOW_COLOUR_2}Wild West Kid: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2890 :{WINDOW_COLOUR_2}Vampire's Lair: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2891 :{WINDOW_COLOUR_2}Blockbuster: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2892 :{WINDOW_COLOUR_2}Airtime Rock: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2893 :{WINDOW_COLOUR_2}Searchlight Rag: (Scott Joplin/Allister Brimble) © Chris Sawyer 版權所有 -STR_2894 :{WINDOW_COLOUR_2}Flight of Fantasy: (Steve Blenkinsopp) © Chris Sawyer 版權所有 -STR_2895 :{WINDOW_COLOUR_2}Big Rock: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2896 :{WINDOW_COLOUR_2}Hypothermia: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2897 :{WINDOW_COLOUR_2}Last Sleigh Ride: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2898 :{WINDOW_COLOUR_2}Pipes of Glencairn: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2899 :{WINDOW_COLOUR_2}Traffic Jam: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2901 :{WINDOW_COLOUR_2}(音樂採樣承蒙Spectrasonics “Liquid Grooves”) -STR_2902 :{WINDOW_COLOUR_2}Toccata: (C.M.Widor, played by Peter James Adcock) recording © Chris Sawyer 版權所有 -STR_2903 :{WINDOW_COLOUR_2}Space Rock: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2904 :{WINDOW_COLOUR_2}Manic Mechanic: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2905 :{WINDOW_COLOUR_2}Techno Torture: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2906 :{WINDOW_COLOUR_2}Sweat Dreams: (Allister Brimble) © Chris Sawyer 版權所有 -STR_2907 :{WINDOW_COLOUR_2}What shall we do with the Drunken Sailor: (Anon/Allister Brimble) © Chris Sawyer 版權所有 STR_2971 :主要色彩選配 STR_2972 :額外色彩選配1 STR_2973 :額外色彩選配2 From dbdca55645632cbb6afb3ff6979e5534e808c738 Mon Sep 17 00:00:00 2001 From: Kane Date: Thu, 29 Jul 2021 20:44:24 +1000 Subject: [PATCH 031/681] Fix #14316: Closing the Track Designs Manager window causes broken state When exiting the Track Design Manager window the user was placed into the scenario editor in a broken state. User is now returned to the main menu when the window is closed. --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/EditorObjectSelection.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/contributors.md b/contributors.md index 4213c6d9ad..38e134adc0 100644 --- a/contributors.md +++ b/contributors.md @@ -172,6 +172,7 @@ The following people are not part of the development team, but have been contrib * Emre Aydin (aemreaydin) * Daniel Karandikar (DKarandikar) * Struan Clark (xtruan) +* Kane Shaw (seifer7) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1c1281b442..d2c7c26844 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ +- Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Improved: [#3417] Crash dumps are now placed in their own folder. diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 7048fc880f..3649d9b4ec 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -456,6 +457,11 @@ static void window_editor_object_selection_mouseup(rct_window* w, rct_widgetinde { finish_object_selection(); } + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + game_unload_scripts(); + title_load(); + } break; case WIDX_FILTER_RIDE_TAB_ALL: _filter_flags |= FILTER_RIDES; From 1ea9bbbb1b309e77eb17224e1a61685dc664cc5e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 29 Jul 2021 13:32:48 +0200 Subject: [PATCH 032/681] Fix formatting --- 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 3649d9b4ec..53d6b67516 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include #include #include #include From a36e0a32f7f3962f93694a3ed7fab02632078372 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 19:54:15 +0300 Subject: [PATCH 033/681] Add EnumMap container for bidirectional key, enum mapping --- OpenRCT2.xcodeproj/project.pbxproj | 4 + src/openrct2/core/EnumMap.hpp | 157 +++++++++++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 1 + 3 files changed, 162 insertions(+) create mode 100644 src/openrct2/core/EnumMap.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index b6527ce470..82b726f9ed 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -767,6 +767,7 @@ F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */ = {isa = PBXBuildFile; fileRef = 091352A950004312BAB18717 /* EntityTweener.h */; }; 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9D3DD6CD73F5421880280D9D /* Litter.cpp */; }; B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */; }; + 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1836,6 +1837,7 @@ 091352A950004312BAB18717 /* EntityTweener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntityTweener.h; path = src/openrct2/world/EntityTweener.h; sourceTree = SOURCE_ROOT; }; 9D3DD6CD73F5421880280D9D /* Litter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Litter.cpp; path = src/openrct2/world/Litter.cpp; sourceTree = SOURCE_ROOT; }; 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideConstruction.cpp; path = src/openrct2/ride/RideConstruction.cpp; sourceTree = SOURCE_ROOT; }; + BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = EnumMap.hpp; path = src/openrct2/core/EnumMap.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2503,6 +2505,7 @@ 4C8BB67F25533D64005C8830 /* StringReader.h */, F76C83991EC4E7CC00FA49E2 /* Zip.cpp */, F76C839A1EC4E7CC00FA49E2 /* Zip.h */, + BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */, ); path = core; sourceTree = ""; @@ -3468,6 +3471,7 @@ 2ADE2F342244191E002598AF /* VirtualFloor.h in Headers */, 66A10F8B257F1E1800DD651A /* LandSmoothAction.h in Headers */, F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */, + 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/core/EnumMap.hpp b/src/openrct2/core/EnumMap.hpp new file mode 100644 index 0000000000..95f539421a --- /dev/null +++ b/src/openrct2/core/EnumMap.hpp @@ -0,0 +1,157 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 +#include +#include +#include + +/** + * Bi-directional map for converting between strings and enums / numbers. + */ +template class EnumMap +{ +private: + std::vector> _map; + bool _continiousValueIndex{ false }; + + static constexpr size_t BucketSize = 43; + std::array, BucketSize> _buckets; + + static constexpr bool ValueIndexable() + { + if constexpr (std::is_enum_v) + return true; + else if constexpr (std::is_integral_v) + return true; + return false; + } + + static constexpr auto ValueDistance(T a, T b) + { + if constexpr (std::is_enum_v) + return static_cast>(b) - static_cast>(a); + else if constexpr (std::is_integral_v) + return (b - a); + } + + static constexpr uint32_t MakeHash(const std::string_view str) + { + uint32_t res = 0x811c9dc5; + for (auto chr : str) + { + res ^= chr; + res *= 0x01000193; + } + return res; + } + +public: + EnumMap(const std::initializer_list>&& items) + : _map{ items } + { + std::sort(_map.begin(), _map.end(), [](const auto& a, const auto& b) { return a.second < b.second; }); + + if constexpr (ValueIndexable()) + { + _continiousValueIndex = true; + T cur{}; + for (size_t i = 1; i < _map.size(); i++) + { + auto nextVal = _map[i].second; + auto dist = ValueDistance(cur, _map[i].second); + if (dist != 1) + { + _continiousValueIndex = false; + break; + } + cur = nextVal; + } + } + + int32_t index = 0; + for (auto& kv : _map) + { + auto hash = MakeHash(kv.first); + auto bucketIndex = hash % BucketSize; + auto& bucket = _buckets[bucketIndex]; + bucket.push_back(index); + index++; + } + } + + std::string_view operator[](T k) const + { + auto it = find(k); + return it->first; + } + + T operator[](std::string_view k) const + { + auto it = find(k); + return it->second; + } + + auto find(const std::string_view k) const + { + const auto hash = MakeHash(k); + const auto bucketIndex = hash % BucketSize; + const auto& bucket = _buckets[bucketIndex]; + + for (auto index : bucket) + { + auto& entry = _map[index]; + if (entry.first == k) + { + return _map.begin() + index; + } + } + + return end(); + } + + auto find(const T k) const + { + const auto binarySearchValue = [&]() { + auto it = std::lower_bound(_map.begin(), _map.end(), k, [](const auto& a, const auto& b) { return a.second < b; }); + if (it == _map.end() || it->second != k) + return end(); + + return it; + }; + + if constexpr (ValueIndexable()) + { + if (_continiousValueIndex) + { + auto index = static_cast(k); + return _map.begin() + index; + } + else + { + return binarySearchValue(); + } + } + else + { + return binarySearchValue(); + } + } + + auto begin() const + { + return _map.begin(); + } + + auto end() const + { + return _map.end(); + } +}; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 2af6898f4a..8a82280aee 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -157,6 +157,7 @@ + From ce8040b8580eda7693fe7b6369dee86f67bee72a Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:13:55 +0300 Subject: [PATCH 034/681] Use EnumMap for string to colour conversion --- src/openrct2/interface/Colour.cpp | 72 ++++++++++++++++--------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/openrct2/interface/Colour.cpp b/src/openrct2/interface/Colour.cpp index 0f13bbc824..2f15032676 100644 --- a/src/openrct2/interface/Colour.cpp +++ b/src/openrct2/interface/Colour.cpp @@ -9,12 +9,12 @@ #include "Colour.h" +#include "../core/EnumMap.hpp" #include "../drawing/Drawing.h" #include "../sprites.h" #include #include -#include rct_colour_map ColourMapA[COLOUR_COUNT] = {}; @@ -60,45 +60,47 @@ void colours_init_maps() namespace Colour { + static const EnumMap LookupTable{ + { "black", COLOUR_BLACK }, + { "grey", COLOUR_GREY }, + { "white", COLOUR_WHITE }, + { "dark_purple", COLOUR_DARK_PURPLE }, + { "light_purple", COLOUR_LIGHT_PURPLE }, + { "bright_purple", COLOUR_BRIGHT_PURPLE }, + { "dark_blue", COLOUR_DARK_BLUE }, + { "light_blue", COLOUR_LIGHT_BLUE }, + { "icy_blue", COLOUR_ICY_BLUE }, + { "teal", COLOUR_TEAL }, + { "aquamarine", COLOUR_AQUAMARINE }, + { "saturated_green", COLOUR_SATURATED_GREEN }, + { "dark_green", COLOUR_DARK_GREEN }, + { "moss_green", COLOUR_MOSS_GREEN }, + { "bright_green", COLOUR_BRIGHT_GREEN }, + { "olive_green", COLOUR_OLIVE_GREEN }, + { "dark_olive_green", COLOUR_DARK_OLIVE_GREEN }, + { "bright_yellow", COLOUR_BRIGHT_YELLOW }, + { "yellow", COLOUR_YELLOW }, + { "dark_yellow", COLOUR_DARK_YELLOW }, + { "light_orange", COLOUR_LIGHT_ORANGE }, + { "dark_orange", COLOUR_DARK_ORANGE }, + { "light_brown", COLOUR_LIGHT_BROWN }, + { "saturated_brown", COLOUR_SATURATED_BROWN }, + { "dark_brown", COLOUR_DARK_BROWN }, + { "salmon_pink", COLOUR_SALMON_PINK }, + { "bordeaux_red", COLOUR_BORDEAUX_RED }, + { "saturated_red", COLOUR_SATURATED_RED }, + { "bright_red", COLOUR_BRIGHT_RED }, + { "dark_pink", COLOUR_DARK_PINK }, + { "bright_pink", COLOUR_BRIGHT_PINK }, + { "light_pink", COLOUR_LIGHT_PINK }, + }; + colour_t FromString(std::string_view s, colour_t defaultValue) { - static const std::unordered_map LookupTable{ - { "black", COLOUR_BLACK }, - { "grey", COLOUR_GREY }, - { "white", COLOUR_WHITE }, - { "dark_purple", COLOUR_DARK_PURPLE }, - { "light_purple", COLOUR_LIGHT_PURPLE }, - { "bright_purple", COLOUR_BRIGHT_PURPLE }, - { "dark_blue", COLOUR_DARK_BLUE }, - { "light_blue", COLOUR_LIGHT_BLUE }, - { "icy_blue", COLOUR_ICY_BLUE }, - { "teal", COLOUR_TEAL }, - { "aquamarine", COLOUR_AQUAMARINE }, - { "saturated_green", COLOUR_SATURATED_GREEN }, - { "dark_green", COLOUR_DARK_GREEN }, - { "moss_green", COLOUR_MOSS_GREEN }, - { "bright_green", COLOUR_BRIGHT_GREEN }, - { "olive_green", COLOUR_OLIVE_GREEN }, - { "dark_olive_green", COLOUR_DARK_OLIVE_GREEN }, - { "bright_yellow", COLOUR_BRIGHT_YELLOW }, - { "yellow", COLOUR_YELLOW }, - { "dark_yellow", COLOUR_DARK_YELLOW }, - { "light_orange", COLOUR_LIGHT_ORANGE }, - { "dark_orange", COLOUR_DARK_ORANGE }, - { "light_brown", COLOUR_LIGHT_BROWN }, - { "saturated_brown", COLOUR_SATURATED_BROWN }, - { "dark_brown", COLOUR_DARK_BROWN }, - { "salmon_pink", COLOUR_SALMON_PINK }, - { "bordeaux_red", COLOUR_BORDEAUX_RED }, - { "saturated_red", COLOUR_SATURATED_RED }, - { "bright_red", COLOUR_BRIGHT_RED }, - { "dark_pink", COLOUR_DARK_PINK }, - { "bright_pink", COLOUR_BRIGHT_PINK }, - { "light_pink", COLOUR_LIGHT_PINK }, - }; auto result = LookupTable.find(s); return (result != LookupTable.end()) ? result->second : defaultValue; } + } // namespace Colour #ifndef NO_TTF From f44687b6b2e71a00190541c40b4410a50dd7249f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:21:38 +0300 Subject: [PATCH 035/681] Use EnumMap for lookup tables in scripting --- src/openrct2/scripting/Duktape.hpp | 38 ++----------------------- src/openrct2/scripting/ScriptEngine.cpp | 14 +++++---- 2 files changed, 10 insertions(+), 42 deletions(-) diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index fdd7f0f327..95de254bb3 100644 --- a/src/openrct2/scripting/Duktape.hpp +++ b/src/openrct2/scripting/Duktape.hpp @@ -12,6 +12,7 @@ #ifdef ENABLE_SCRIPTING # include "../core/Console.hpp" +# include "../core/EnumMap.hpp" # include "../ride/Vehicle.h" # include "../world/Map.h" @@ -221,42 +222,7 @@ namespace OpenRCT2::Scripting /** * Bi-directional map for converting between strings and enums / numbers. */ - template class DukEnumMap - { - private: - std::unordered_map _s2n; - std::unordered_map _n2s; - - public: - DukEnumMap(const std::initializer_list>& items) - { - _s2n = std::unordered_map(items.begin(), items.end()); - for (const auto& kvp : items) - { - _n2s.emplace(std::get<1>(kvp), std::get<0>(kvp)); - } - } - - std::string_view operator[](T k) const - { - auto it = _n2s.find(k); - if (it == _n2s.end()) - { - return ""; - } - return it->second; - } - - T operator[](std::string_view k) const - { - auto it = _s2n.find(k); - if (it == _s2n.end()) - { - return static_cast(0); - } - return it->second; - } - }; + template using DukEnumMap = EnumMap; inline duk_ret_t duk_json_decode_wrapper(duk_context* ctx, void*) { diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index db2f1a1801..d7fb754e89 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -17,6 +17,7 @@ # include "../actions/RideCreateAction.h" # include "../actions/StaffHireNewAction.h" # include "../config/Config.h" +# include "../core/EnumMap.hpp" # include "../core/File.h" # include "../core/FileScanner.h" # include "../core/Path.hpp" @@ -987,7 +988,8 @@ public: } }; -const static std::unordered_map ActionNameToType = { +// clang-format off +const static EnumMap ActionNameToType = { { "balloonpress", GameCommand::BalloonPress }, { "bannerplace", GameCommand::PlaceBanner }, { "bannerremove", GameCommand::RemoveBanner }, @@ -1067,21 +1069,21 @@ const static std::unordered_map ActionNameToType = { { "waterraise", GameCommand::RaiseWater }, { "watersetheight", GameCommand::SetWaterHeight } }; +// clang-format on static std::string GetActionName(GameCommand commandId) { - auto it = std::find_if( - ActionNameToType.begin(), ActionNameToType.end(), [commandId](const auto& kvp) { return kvp.second == commandId; }); + auto it = ActionNameToType.find(commandId); if (it != ActionNameToType.end()) { - return it->first; + return std::string{ it->first }; } return {}; } -static std::unique_ptr CreateGameActionFromActionId(const std::string& actionid) +static std::unique_ptr CreateGameActionFromActionId(const std::string& name) { - auto result = ActionNameToType.find(actionid); + auto result = ActionNameToType.find(name); if (result != ActionNameToType.end()) { return GameActions::Create(result->second); From 3fbfa26dd3602edd0c550d254d961cc42009f191 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:22:47 +0300 Subject: [PATCH 036/681] Use EnumMap for Cursors string lookup --- src/openrct2/interface/Cursors.cpp | 62 +++++++++++++++--------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/openrct2/interface/Cursors.cpp b/src/openrct2/interface/Cursors.cpp index 01054812f3..5bf0051d46 100644 --- a/src/openrct2/interface/Cursors.cpp +++ b/src/openrct2/interface/Cursors.cpp @@ -9,43 +9,45 @@ #include "Cursors.h" +#include "../core/EnumMap.hpp" + #include -#include namespace Cursor { + static const EnumMap LookupTable{ + { "CURSOR_BLANK", CursorID::Blank }, + { "CURSOR_UP_ARROW", CursorID::UpArrow }, + { "CURSOR_UP_DOWN_ARROW", CursorID::UpDownArrow }, + { "CURSOR_HAND_POINT", CursorID::HandPoint }, + { "CURSOR_ZZZ", CursorID::ZZZ }, + { "CURSOR_DIAGONAL_ARROWS", CursorID::DiagonalArrows }, + { "CURSOR_PICKER", CursorID::Picker }, + { "CURSOR_TREE_DOWN", CursorID::TreeDown }, + { "CURSOR_FOUNTAIN_DOWN", CursorID::FountainDown }, + { "CURSOR_STATUE_DOWN", CursorID::StatueDown }, + { "CURSOR_BENCH_DOWN", CursorID::BenchDown }, + { "CURSOR_CROSS_HAIR", CursorID::CrossHair }, + { "CURSOR_BIN_DOWN", CursorID::BinDown }, + { "CURSOR_LAMPPOST_DOWN", CursorID::LamppostDown }, + { "CURSOR_FENCE_DOWN", CursorID::FenceDown }, + { "CURSOR_FLOWER_DOWN", CursorID::FlowerDown }, + { "CURSOR_PATH_DOWN", CursorID::PathDown }, + { "CURSOR_DIG_DOWN", CursorID::DigDown }, + { "CURSOR_WATER_DOWN", CursorID::WaterDown }, + { "CURSOR_HOUSE_DOWN", CursorID::HouseDown }, + { "CURSOR_VOLCANO_DOWN", CursorID::VolcanoDown }, + { "CURSOR_WALK_DOWN", CursorID::WalkDown }, + { "CURSOR_PAINT_DOWN", CursorID::PaintDown }, + { "CURSOR_ENTRANCE_DOWN", CursorID::EntranceDown }, + { "CURSOR_HAND_OPEN", CursorID::HandOpen }, + { "CURSOR_HAND_CLOSED", CursorID::HandClosed }, + { "CURSOR_ARROW", CursorID::Arrow }, + }; + CursorID FromString(const std::string& s, CursorID defaultValue) { assert(defaultValue != CursorID::Undefined); - static const std::unordered_map LookupTable{ - { "CURSOR_BLANK", CursorID::Blank }, - { "CURSOR_UP_ARROW", CursorID::UpArrow }, - { "CURSOR_UP_DOWN_ARROW", CursorID::UpDownArrow }, - { "CURSOR_HAND_POINT", CursorID::HandPoint }, - { "CURSOR_ZZZ", CursorID::ZZZ }, - { "CURSOR_DIAGONAL_ARROWS", CursorID::DiagonalArrows }, - { "CURSOR_PICKER", CursorID::Picker }, - { "CURSOR_TREE_DOWN", CursorID::TreeDown }, - { "CURSOR_FOUNTAIN_DOWN", CursorID::FountainDown }, - { "CURSOR_STATUE_DOWN", CursorID::StatueDown }, - { "CURSOR_BENCH_DOWN", CursorID::BenchDown }, - { "CURSOR_CROSS_HAIR", CursorID::CrossHair }, - { "CURSOR_BIN_DOWN", CursorID::BinDown }, - { "CURSOR_LAMPPOST_DOWN", CursorID::LamppostDown }, - { "CURSOR_FENCE_DOWN", CursorID::FenceDown }, - { "CURSOR_FLOWER_DOWN", CursorID::FlowerDown }, - { "CURSOR_PATH_DOWN", CursorID::PathDown }, - { "CURSOR_DIG_DOWN", CursorID::DigDown }, - { "CURSOR_WATER_DOWN", CursorID::WaterDown }, - { "CURSOR_HOUSE_DOWN", CursorID::HouseDown }, - { "CURSOR_VOLCANO_DOWN", CursorID::VolcanoDown }, - { "CURSOR_WALK_DOWN", CursorID::WalkDown }, - { "CURSOR_PAINT_DOWN", CursorID::PaintDown }, - { "CURSOR_ENTRANCE_DOWN", CursorID::EntranceDown }, - { "CURSOR_HAND_OPEN", CursorID::HandOpen }, - { "CURSOR_HAND_CLOSED", CursorID::HandClosed }, - { "CURSOR_ARROW", CursorID::Arrow }, - }; auto result = LookupTable.find(s); return (result != LookupTable.end()) ? result->second : defaultValue; From e991c128dcdcf2c257092b54b0988be16625dbc5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:25:38 +0300 Subject: [PATCH 037/681] Use EnumMap for format token lookups --- src/openrct2/localisation/FormatCodes.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/openrct2/localisation/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 204afcaa11..2b5c408520 100644 --- a/src/openrct2/localisation/FormatCodes.cpp +++ b/src/openrct2/localisation/FormatCodes.cpp @@ -9,13 +9,14 @@ #include "FormatCodes.h" +#include "../core/EnumMap.hpp" + #include #include -#include #include // clang-format off -static const std::unordered_map FormatTokenMap = { +static const EnumMap FormatTokenMap = { { "MOVE_X", FormatToken::Move, }, { "NEWLINE", FormatToken::Newline, }, { "NEWLINE_SMALLER", FormatToken::NewlineSmall, }, @@ -97,13 +98,10 @@ std::string_view FormatTokenToString(FormatToken token, bool withBraces) } else { - for (const auto& t : FormatTokenMap) - { - if (t.second == token) - { - return t.first; - } - } + auto it = FormatTokenMap.find(token); + if (it != FormatTokenMap.end()) + return it->first; + return {}; } } From e520e4f991efc897d894aefc3b5926ad53414ed5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:29:17 +0300 Subject: [PATCH 038/681] Use EnumMap for RideObject lookup tables --- src/openrct2/object/RideObject.cpp | 286 +++++++++++++++-------------- 1 file changed, 145 insertions(+), 141 deletions(-) diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index b475785b5b..fa2f76a39a 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -13,6 +13,7 @@ #include "../OpenRCT2.h" #include "../audio/audio.h" +#include "../core/EnumMap.hpp" #include "../core/IStream.hpp" #include "../core/Json.hpp" #include "../core/Memory.hpp" @@ -969,155 +970,158 @@ bool RideObject::IsRideTypeShopOrFacility(uint8_t rideType) } } +static const EnumMap RideTypeLookupTable{ + { "spiral_rc", RIDE_TYPE_SPIRAL_ROLLER_COASTER }, + { "stand_up_rc", RIDE_TYPE_STAND_UP_ROLLER_COASTER }, + { "suspended_swinging_rc", RIDE_TYPE_SUSPENDED_SWINGING_COASTER }, + { "inverted_rc", RIDE_TYPE_INVERTED_ROLLER_COASTER }, + { "junior_rc", RIDE_TYPE_JUNIOR_ROLLER_COASTER }, + { "miniature_railway", RIDE_TYPE_MINIATURE_RAILWAY }, + { "monorail", RIDE_TYPE_MONORAIL }, + { "mini_suspended_rc", RIDE_TYPE_MINI_SUSPENDED_COASTER }, + { "boat_hire", RIDE_TYPE_BOAT_HIRE }, + { "wooden_wild_mouse", RIDE_TYPE_WOODEN_WILD_MOUSE }, + { "steeplechase", RIDE_TYPE_STEEPLECHASE }, + { "car_ride", RIDE_TYPE_CAR_RIDE }, + { "launched_freefall", RIDE_TYPE_LAUNCHED_FREEFALL }, + { "bobsleigh_rc", RIDE_TYPE_BOBSLEIGH_COASTER }, + { "observation_tower", RIDE_TYPE_OBSERVATION_TOWER }, + { "looping_rc", RIDE_TYPE_LOOPING_ROLLER_COASTER }, + { "dinghy_slide", RIDE_TYPE_DINGHY_SLIDE }, + { "mine_train_rc", RIDE_TYPE_MINE_TRAIN_COASTER }, + { "chairlift", RIDE_TYPE_CHAIRLIFT }, + { "corkscrew_rc", RIDE_TYPE_CORKSCREW_ROLLER_COASTER }, + { "maze", RIDE_TYPE_MAZE }, + { "spiral_slide", RIDE_TYPE_SPIRAL_SLIDE }, + { "go_karts", RIDE_TYPE_GO_KARTS }, + { "log_flume", RIDE_TYPE_LOG_FLUME }, + { "river_rapids", RIDE_TYPE_RIVER_RAPIDS }, + { "dodgems", RIDE_TYPE_DODGEMS }, + { "swinging_ship", RIDE_TYPE_SWINGING_SHIP }, + { "swinging_inverter_ship", RIDE_TYPE_SWINGING_INVERTER_SHIP }, + { "food_stall", RIDE_TYPE_FOOD_STALL }, + { "drink_stall", RIDE_TYPE_DRINK_STALL }, + { "shop", RIDE_TYPE_SHOP }, + { "merry_go_round", RIDE_TYPE_MERRY_GO_ROUND }, + { "information_kiosk", RIDE_TYPE_INFORMATION_KIOSK }, + { "toilets", RIDE_TYPE_TOILETS }, + { "ferris_wheel", RIDE_TYPE_FERRIS_WHEEL }, + { "motion_simulator", RIDE_TYPE_MOTION_SIMULATOR }, + { "3d_cinema", RIDE_TYPE_3D_CINEMA }, + { "top_spin", RIDE_TYPE_TOP_SPIN }, + { "space_rings", RIDE_TYPE_SPACE_RINGS }, + { "reverse_freefall_rc", RIDE_TYPE_REVERSE_FREEFALL_COASTER }, + { "lift", RIDE_TYPE_LIFT }, + { "vertical_drop_rc", RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER }, + { "cash_machine", RIDE_TYPE_CASH_MACHINE }, + { "twist", RIDE_TYPE_TWIST }, + { "haunted_house", RIDE_TYPE_HAUNTED_HOUSE }, + { "first_aid", RIDE_TYPE_FIRST_AID }, + { "circus", RIDE_TYPE_CIRCUS }, + { "ghost_train", RIDE_TYPE_GHOST_TRAIN }, + { "twister_rc", RIDE_TYPE_TWISTER_ROLLER_COASTER }, + { "wooden_rc", RIDE_TYPE_WOODEN_ROLLER_COASTER }, + { "side_friction_rc", RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER }, + { "steel_wild_mouse", RIDE_TYPE_STEEL_WILD_MOUSE }, + { "multi_dimension_rc", RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER }, + { "flying_rc", RIDE_TYPE_FLYING_ROLLER_COASTER }, + { "virginia_reel", RIDE_TYPE_VIRGINIA_REEL }, + { "splash_boats", RIDE_TYPE_SPLASH_BOATS }, + { "mini_helicopters", RIDE_TYPE_MINI_HELICOPTERS }, + { "lay_down_rc", RIDE_TYPE_LAY_DOWN_ROLLER_COASTER }, + { "suspended_monorail", RIDE_TYPE_SUSPENDED_MONORAIL }, + { "reverser_rc", RIDE_TYPE_REVERSER_ROLLER_COASTER }, + { "heartline_twister_rc", RIDE_TYPE_HEARTLINE_TWISTER_COASTER }, + { "mini_golf", RIDE_TYPE_MINI_GOLF }, + { "giga_rc", RIDE_TYPE_GIGA_COASTER }, + { "roto_drop", RIDE_TYPE_ROTO_DROP }, + { "flying_saucers", RIDE_TYPE_FLYING_SAUCERS }, + { "crooked_house", RIDE_TYPE_CROOKED_HOUSE }, + { "monorail_cycles", RIDE_TYPE_MONORAIL_CYCLES }, + { "compact_inverted_rc", RIDE_TYPE_COMPACT_INVERTED_COASTER }, + { "water_coaster", RIDE_TYPE_WATER_COASTER }, + { "air_powered_vertical_rc", RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER }, + { "inverted_hairpin_rc", RIDE_TYPE_INVERTED_HAIRPIN_COASTER }, + { "magic_carpet", RIDE_TYPE_MAGIC_CARPET }, + { "submarine_ride", RIDE_TYPE_SUBMARINE_RIDE }, + { "river_rafts", RIDE_TYPE_RIVER_RAFTS }, + { "enterprise", RIDE_TYPE_ENTERPRISE }, + { "inverted_impulse_rc", RIDE_TYPE_INVERTED_IMPULSE_COASTER }, + { "mini_rc", RIDE_TYPE_MINI_ROLLER_COASTER }, + { "mine_ride", RIDE_TYPE_MINE_RIDE }, + { "lim_launched_rc", RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER }, + { "hypercoaster", RIDE_TYPE_HYPERCOASTER }, + { "hyper_twister", RIDE_TYPE_HYPER_TWISTER }, + { "monster_trucks", RIDE_TYPE_MONSTER_TRUCKS }, + { "spinning_wild_mouse", RIDE_TYPE_SPINNING_WILD_MOUSE }, + { "classic_mini_rc", RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER }, + { "hybrid_rc", RIDE_TYPE_HYBRID_COASTER }, + { "single_rail_rc", RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER }, +}; + uint8_t RideObject::ParseRideType(const std::string& s) { - static const std::unordered_map LookupTable{ - { "spiral_rc", RIDE_TYPE_SPIRAL_ROLLER_COASTER }, - { "stand_up_rc", RIDE_TYPE_STAND_UP_ROLLER_COASTER }, - { "suspended_swinging_rc", RIDE_TYPE_SUSPENDED_SWINGING_COASTER }, - { "inverted_rc", RIDE_TYPE_INVERTED_ROLLER_COASTER }, - { "junior_rc", RIDE_TYPE_JUNIOR_ROLLER_COASTER }, - { "miniature_railway", RIDE_TYPE_MINIATURE_RAILWAY }, - { "monorail", RIDE_TYPE_MONORAIL }, - { "mini_suspended_rc", RIDE_TYPE_MINI_SUSPENDED_COASTER }, - { "boat_hire", RIDE_TYPE_BOAT_HIRE }, - { "wooden_wild_mouse", RIDE_TYPE_WOODEN_WILD_MOUSE }, - { "steeplechase", RIDE_TYPE_STEEPLECHASE }, - { "car_ride", RIDE_TYPE_CAR_RIDE }, - { "launched_freefall", RIDE_TYPE_LAUNCHED_FREEFALL }, - { "bobsleigh_rc", RIDE_TYPE_BOBSLEIGH_COASTER }, - { "observation_tower", RIDE_TYPE_OBSERVATION_TOWER }, - { "looping_rc", RIDE_TYPE_LOOPING_ROLLER_COASTER }, - { "dinghy_slide", RIDE_TYPE_DINGHY_SLIDE }, - { "mine_train_rc", RIDE_TYPE_MINE_TRAIN_COASTER }, - { "chairlift", RIDE_TYPE_CHAIRLIFT }, - { "corkscrew_rc", RIDE_TYPE_CORKSCREW_ROLLER_COASTER }, - { "maze", RIDE_TYPE_MAZE }, - { "spiral_slide", RIDE_TYPE_SPIRAL_SLIDE }, - { "go_karts", RIDE_TYPE_GO_KARTS }, - { "log_flume", RIDE_TYPE_LOG_FLUME }, - { "river_rapids", RIDE_TYPE_RIVER_RAPIDS }, - { "dodgems", RIDE_TYPE_DODGEMS }, - { "swinging_ship", RIDE_TYPE_SWINGING_SHIP }, - { "swinging_inverter_ship", RIDE_TYPE_SWINGING_INVERTER_SHIP }, - { "food_stall", RIDE_TYPE_FOOD_STALL }, - { "drink_stall", RIDE_TYPE_DRINK_STALL }, - { "shop", RIDE_TYPE_SHOP }, - { "merry_go_round", RIDE_TYPE_MERRY_GO_ROUND }, - { "information_kiosk", RIDE_TYPE_INFORMATION_KIOSK }, - { "toilets", RIDE_TYPE_TOILETS }, - { "ferris_wheel", RIDE_TYPE_FERRIS_WHEEL }, - { "motion_simulator", RIDE_TYPE_MOTION_SIMULATOR }, - { "3d_cinema", RIDE_TYPE_3D_CINEMA }, - { "top_spin", RIDE_TYPE_TOP_SPIN }, - { "space_rings", RIDE_TYPE_SPACE_RINGS }, - { "reverse_freefall_rc", RIDE_TYPE_REVERSE_FREEFALL_COASTER }, - { "lift", RIDE_TYPE_LIFT }, - { "vertical_drop_rc", RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER }, - { "cash_machine", RIDE_TYPE_CASH_MACHINE }, - { "twist", RIDE_TYPE_TWIST }, - { "haunted_house", RIDE_TYPE_HAUNTED_HOUSE }, - { "first_aid", RIDE_TYPE_FIRST_AID }, - { "circus", RIDE_TYPE_CIRCUS }, - { "ghost_train", RIDE_TYPE_GHOST_TRAIN }, - { "twister_rc", RIDE_TYPE_TWISTER_ROLLER_COASTER }, - { "wooden_rc", RIDE_TYPE_WOODEN_ROLLER_COASTER }, - { "side_friction_rc", RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER }, - { "steel_wild_mouse", RIDE_TYPE_STEEL_WILD_MOUSE }, - { "multi_dimension_rc", RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER }, - { "flying_rc", RIDE_TYPE_FLYING_ROLLER_COASTER }, - { "virginia_reel", RIDE_TYPE_VIRGINIA_REEL }, - { "splash_boats", RIDE_TYPE_SPLASH_BOATS }, - { "mini_helicopters", RIDE_TYPE_MINI_HELICOPTERS }, - { "lay_down_rc", RIDE_TYPE_LAY_DOWN_ROLLER_COASTER }, - { "suspended_monorail", RIDE_TYPE_SUSPENDED_MONORAIL }, - { "reverser_rc", RIDE_TYPE_REVERSER_ROLLER_COASTER }, - { "heartline_twister_rc", RIDE_TYPE_HEARTLINE_TWISTER_COASTER }, - { "mini_golf", RIDE_TYPE_MINI_GOLF }, - { "giga_rc", RIDE_TYPE_GIGA_COASTER }, - { "roto_drop", RIDE_TYPE_ROTO_DROP }, - { "flying_saucers", RIDE_TYPE_FLYING_SAUCERS }, - { "crooked_house", RIDE_TYPE_CROOKED_HOUSE }, - { "monorail_cycles", RIDE_TYPE_MONORAIL_CYCLES }, - { "compact_inverted_rc", RIDE_TYPE_COMPACT_INVERTED_COASTER }, - { "water_coaster", RIDE_TYPE_WATER_COASTER }, - { "air_powered_vertical_rc", RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER }, - { "inverted_hairpin_rc", RIDE_TYPE_INVERTED_HAIRPIN_COASTER }, - { "magic_carpet", RIDE_TYPE_MAGIC_CARPET }, - { "submarine_ride", RIDE_TYPE_SUBMARINE_RIDE }, - { "river_rafts", RIDE_TYPE_RIVER_RAFTS }, - { "enterprise", RIDE_TYPE_ENTERPRISE }, - { "inverted_impulse_rc", RIDE_TYPE_INVERTED_IMPULSE_COASTER }, - { "mini_rc", RIDE_TYPE_MINI_ROLLER_COASTER }, - { "mine_ride", RIDE_TYPE_MINE_RIDE }, - { "lim_launched_rc", RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER }, - { "hypercoaster", RIDE_TYPE_HYPERCOASTER }, - { "hyper_twister", RIDE_TYPE_HYPER_TWISTER }, - { "monster_trucks", RIDE_TYPE_MONSTER_TRUCKS }, - { "spinning_wild_mouse", RIDE_TYPE_SPINNING_WILD_MOUSE }, - { "classic_mini_rc", RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER }, - { "hybrid_rc", RIDE_TYPE_HYBRID_COASTER }, - { "single_rail_rc", RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER } - }; - auto result = LookupTable.find(s); - return (result != LookupTable.end()) ? result->second : static_cast(RIDE_TYPE_NULL); + auto result = RideTypeLookupTable.find(s); + return (result != RideTypeLookupTable.end()) ? result->second : static_cast(RIDE_TYPE_NULL); } +static const EnumMap RideCategoryLookupTable{ + { "transport", RIDE_CATEGORY_TRANSPORT }, + { "gentle", RIDE_CATEGORY_GENTLE }, + { "rollercoaster", RIDE_CATEGORY_ROLLERCOASTER }, + { "thrill", RIDE_CATEGORY_THRILL }, + { "water", RIDE_CATEGORY_WATER }, + { "stall", RIDE_CATEGORY_SHOP }, +}; + uint8_t RideObject::ParseRideCategory(const std::string& s) { - static const std::unordered_map LookupTable{ - { "transport", RIDE_CATEGORY_TRANSPORT }, - { "gentle", RIDE_CATEGORY_GENTLE }, - { "rollercoaster", RIDE_CATEGORY_ROLLERCOASTER }, - { "thrill", RIDE_CATEGORY_THRILL }, - { "water", RIDE_CATEGORY_WATER }, - { "stall", RIDE_CATEGORY_SHOP }, - }; - auto result = LookupTable.find(s); - return (result != LookupTable.end()) ? result->second : static_cast(RIDE_CATEGORY_TRANSPORT); + auto result = RideCategoryLookupTable.find(s); + return (result != RideCategoryLookupTable.end()) ? result->second : static_cast(RIDE_CATEGORY_TRANSPORT); } +static const EnumMap ShopItemLookupTable{ + { "burger", ShopItem::Burger }, + { "chips", ShopItem::Chips }, + { "ice_cream", ShopItem::IceCream }, + { "candyfloss", ShopItem::Candyfloss }, + { "pizza", ShopItem::Pizza }, + { "popcorn", ShopItem::Popcorn }, + { "hot_dog", ShopItem::HotDog }, + { "tentacle", ShopItem::Tentacle }, + { "toffee_apple", ShopItem::ToffeeApple }, + { "doughnut", ShopItem::Doughnut }, + { "chicken", ShopItem::Chicken }, + { "pretzel", ShopItem::Pretzel }, + { "funnel_cake", ShopItem::FunnelCake }, + { "beef_noodles", ShopItem::BeefNoodles }, + { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, + { "wonton_soup", ShopItem::WontonSoup }, + { "meatball_soup", ShopItem::MeatballSoup }, + { "sub_sandwich", ShopItem::SubSandwich }, + { "cookie", ShopItem::Cookie }, + { "roast_sausage", ShopItem::RoastSausage }, + { "drink", ShopItem::Drink }, + { "coffee", ShopItem::Coffee }, + { "lemonade", ShopItem::Lemonade }, + { "chocolate", ShopItem::Chocolate }, + { "iced_tea", ShopItem::IcedTea }, + { "fruit_juice", ShopItem::FruitJuice }, + { "soybean_milk", ShopItem::SoybeanMilk }, + { "sujeonggwa", ShopItem::Sujeonggwa }, + { "balloon", ShopItem::Balloon }, + { "toy", ShopItem::Toy }, + { "map", ShopItem::Map }, + { "photo", ShopItem::Photo }, + { "umbrella", ShopItem::Umbrella }, + { "voucher", ShopItem::Voucher }, + { "hat", ShopItem::Hat }, + { "tshirt", ShopItem::TShirt }, + { "sunglasses", ShopItem::Sunglasses }, +}; + ShopItem RideObject::ParseShopItem(const std::string& s) { - static const std::unordered_map LookupTable{ - { "burger", ShopItem::Burger }, - { "chips", ShopItem::Chips }, - { "ice_cream", ShopItem::IceCream }, - { "candyfloss", ShopItem::Candyfloss }, - { "pizza", ShopItem::Pizza }, - { "popcorn", ShopItem::Popcorn }, - { "hot_dog", ShopItem::HotDog }, - { "tentacle", ShopItem::Tentacle }, - { "toffee_apple", ShopItem::ToffeeApple }, - { "doughnut", ShopItem::Doughnut }, - { "chicken", ShopItem::Chicken }, - { "pretzel", ShopItem::Pretzel }, - { "funnel_cake", ShopItem::FunnelCake }, - { "beef_noodles", ShopItem::BeefNoodles }, - { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, - { "wonton_soup", ShopItem::WontonSoup }, - { "meatball_soup", ShopItem::MeatballSoup }, - { "sub_sandwich", ShopItem::SubSandwich }, - { "cookie", ShopItem::Cookie }, - { "roast_sausage", ShopItem::RoastSausage }, - { "drink", ShopItem::Drink }, - { "coffee", ShopItem::Coffee }, - { "lemonade", ShopItem::Lemonade }, - { "chocolate", ShopItem::Chocolate }, - { "iced_tea", ShopItem::IcedTea }, - { "fruit_juice", ShopItem::FruitJuice }, - { "soybean_milk", ShopItem::SoybeanMilk }, - { "sujeonggwa", ShopItem::Sujeonggwa }, - { "balloon", ShopItem::Balloon }, - { "toy", ShopItem::Toy }, - { "map", ShopItem::Map }, - { "photo", ShopItem::Photo }, - { "umbrella", ShopItem::Umbrella }, - { "voucher", ShopItem::Voucher }, - { "hat", ShopItem::Hat }, - { "tshirt", ShopItem::TShirt }, - { "sunglasses", ShopItem::Sunglasses }, - }; - auto result = LookupTable.find(s); - return (result != LookupTable.end()) ? result->second : ShopItem::None; + auto result = ShopItemLookupTable.find(s); + return (result != ShopItemLookupTable.end()) ? result->second : ShopItem::None; } From d9f9e7542ae5747d53d34f106b514c85db822a35 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:51:15 +0300 Subject: [PATCH 039/681] Use EnumMap for HookEngine lookups --- src/openrct2/scripting/HookEngine.cpp | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/openrct2/scripting/HookEngine.cpp b/src/openrct2/scripting/HookEngine.cpp index 266c7050d2..e857a41025 100644 --- a/src/openrct2/scripting/HookEngine.cpp +++ b/src/openrct2/scripting/HookEngine.cpp @@ -11,29 +11,31 @@ # include "HookEngine.h" +# include "../core/EnumMap.hpp" # include "ScriptEngine.h" # include using namespace OpenRCT2::Scripting; +static const EnumMap HooksLookupTable({ + { "action.query", HOOK_TYPE::ACTION_QUERY }, + { "action.execute", HOOK_TYPE::ACTION_EXECUTE }, + { "interval.tick", HOOK_TYPE::INTERVAL_TICK }, + { "interval.day", HOOK_TYPE::INTERVAL_DAY }, + { "network.chat", HOOK_TYPE::NETWORK_CHAT }, + { "network.authenticate", HOOK_TYPE::NETWORK_AUTHENTICATE }, + { "network.join", HOOK_TYPE::NETWORK_JOIN }, + { "network.leave", HOOK_TYPE::NETWORK_LEAVE }, + { "ride.ratings.calculate", HOOK_TYPE::RIDE_RATINGS_CALCULATE }, + { "action.location", HOOK_TYPE::ACTION_LOCATION }, + { "guest.generation", HOOK_TYPE::GUEST_GENERATION }, +}); + HOOK_TYPE OpenRCT2::Scripting::GetHookType(const std::string& name) { - static const std::unordered_map LookupTable({ - { "action.query", HOOK_TYPE::ACTION_QUERY }, - { "action.execute", HOOK_TYPE::ACTION_EXECUTE }, - { "interval.tick", HOOK_TYPE::INTERVAL_TICK }, - { "interval.day", HOOK_TYPE::INTERVAL_DAY }, - { "network.chat", HOOK_TYPE::NETWORK_CHAT }, - { "network.authenticate", HOOK_TYPE::NETWORK_AUTHENTICATE }, - { "network.join", HOOK_TYPE::NETWORK_JOIN }, - { "network.leave", HOOK_TYPE::NETWORK_LEAVE }, - { "ride.ratings.calculate", HOOK_TYPE::RIDE_RATINGS_CALCULATE }, - { "action.location", HOOK_TYPE::ACTION_LOCATION }, - { "guest.generation", HOOK_TYPE::GUEST_GENERATION }, - }); - auto result = LookupTable.find(name); - return (result != LookupTable.end()) ? result->second : HOOK_TYPE::UNDEFINED; + auto result = HooksLookupTable.find(name); + return (result != HooksLookupTable.end()) ? result->second : HOOK_TYPE::UNDEFINED; } HookEngine::HookEngine(ScriptEngine& scriptEngine) From cd43cab9991d87d4305a4d7f9b668ce8d7214da5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 22 Jul 2021 20:51:28 +0300 Subject: [PATCH 040/681] Add tests for EnumMap --- test/tests/CMakeLists.txt | 9 +++ test/tests/EnumMapTest.cpp | 146 +++++++++++++++++++++++++++++++++++++ test/tests/tests.vcxproj | 1 + 3 files changed, 156 insertions(+) create mode 100644 test/tests/EnumMapTest.cpp diff --git a/test/tests/CMakeLists.txt b/test/tests/CMakeLists.txt index 191c63e1e9..703871f2d9 100644 --- a/test/tests/CMakeLists.txt +++ b/test/tests/CMakeLists.txt @@ -248,3 +248,12 @@ SET_CHECK_CXX_FLAGS(test_s6importexporttests) target_link_libraries(test_s6importexporttests ${GTEST_LIBRARIES} libopenrct2 ${LDL} z) target_link_platform_libraries(test_s6importexporttests) add_test(NAME s6importexporttests COMMAND test_s6importexporttests) + +# EnumMap Test +set(ENUMMAP_TEST_SOURCES "${CMAKE_CURRENT_LIST_DIR}/EnumMapTest.cpp.cpp" + "${CMAKE_CURRENT_LIST_DIR}/TestData.cpp") +add_executable(test_enummap ${S6IMPORTEXPORT_TEST_SOURCES}) +SET_CHECK_CXX_FLAGS(test_enummap) +target_link_libraries(test_enummap ${GTEST_LIBRARIES} libopenrct2 ${LDL} z) +target_link_platform_libraries(test_enummap) +add_test(NAME enummaptests COMMAND test_enummap) diff --git a/test/tests/EnumMapTest.cpp b/test/tests/EnumMapTest.cpp new file mode 100644 index 0000000000..98efbc8e73 --- /dev/null +++ b/test/tests/EnumMapTest.cpp @@ -0,0 +1,146 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 +#include + +enum class TestEnumClassContinous +{ + A, + B, + C, + D, + E, + F, + G +}; + +enum class TestEnumClassNonContinous +{ + A = 1, + B, + C = 7, + D, + E, + F, + G +}; + +template void TestEnumKeyLookup() +{ + // clang-format off + EnumMap enumMap = { + { "A", TEnum::A }, + { "B", TEnum::B }, + { "C", TEnum::C }, + { "D", TEnum::D }, + { "E", TEnum::E }, + { "F", TEnum::F }, + { "G", TEnum::G }, + }; + // clang-format on + + ASSERT_EQ(enumMap.find("Z"), enumMap.end()); + + auto itA = enumMap.find("A"); + ASSERT_NE(itA, enumMap.end()); + ASSERT_EQ(itA->second, TEnum::A); + + auto itB = enumMap.find("B"); + ASSERT_NE(itB, enumMap.end()); + ASSERT_EQ(itB->second, TEnum::B); + + auto itC = enumMap.find("C"); + ASSERT_NE(itC, enumMap.end()); + ASSERT_EQ(itC->second, TEnum::C); + + auto itD = enumMap.find("D"); + ASSERT_NE(itD, enumMap.end()); + ASSERT_EQ(itD->second, TEnum::D); + + auto itE = enumMap.find("E"); + ASSERT_NE(itE, enumMap.end()); + ASSERT_EQ(itE->second, TEnum::E); + + auto itF = enumMap.find("F"); + ASSERT_NE(itF, enumMap.end()); + ASSERT_EQ(itF->second, TEnum::F); + + auto itG = enumMap.find("G"); + ASSERT_NE(itG, enumMap.end()); + ASSERT_EQ(itG->second, TEnum::G); + + SUCCEED(); +} + +template void TestEnumValueLookup() +{ + // clang-format off + EnumMap enumMap = { + { "A", TEnum::A }, + { "B", TEnum::B }, + { "C", TEnum::C }, + { "D", TEnum::D }, + { "E", TEnum::E }, + { "F", TEnum::F }, + { "G", TEnum::G }, + }; + // clang-format on + + ASSERT_EQ(enumMap.find("Z"), enumMap.end()); + + auto itA = enumMap.find(TEnum::A); + ASSERT_NE(itA, enumMap.end()); + ASSERT_EQ(itA->second, TEnum::A); + + auto itB = enumMap.find(TEnum::B); + ASSERT_NE(itB, enumMap.end()); + ASSERT_EQ(itB->second, TEnum::B); + + auto itC = enumMap.find(TEnum::C); + ASSERT_NE(itC, enumMap.end()); + ASSERT_EQ(itC->second, TEnum::C); + + auto itD = enumMap.find(TEnum::D); + ASSERT_NE(itD, enumMap.end()); + ASSERT_EQ(itD->second, TEnum::D); + + auto itE = enumMap.find(TEnum::E); + ASSERT_NE(itE, enumMap.end()); + ASSERT_EQ(itE->second, TEnum::E); + + auto itF = enumMap.find(TEnum::F); + ASSERT_NE(itF, enumMap.end()); + ASSERT_EQ(itF->second, TEnum::F); + + auto itG = enumMap.find(TEnum::G); + ASSERT_NE(itG, enumMap.end()); + ASSERT_EQ(itG->second, TEnum::G); + + SUCCEED(); +} + +TEST(EnumMapTest, LookupContinousByKey) +{ + TestEnumKeyLookup(); +} + +TEST(EnumMapTest, LookupContiniousByValue) +{ + TestEnumValueLookup(); +} + +TEST(EnumMapTest, LookupNonContinousByKey) +{ + TestEnumKeyLookup(); +} + +TEST(EnumMapTest, LookupNonContiniousByValue) +{ + TestEnumValueLookup(); +} diff --git a/test/tests/tests.vcxproj b/test/tests/tests.vcxproj index 53a49a7ca0..a49cf5a70c 100644 --- a/test/tests/tests.vcxproj +++ b/test/tests/tests.vcxproj @@ -60,6 +60,7 @@ + From 86af7f486d7ab70d67df7034db2d083332b66116 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 29 Jul 2021 13:02:20 +0200 Subject: [PATCH 041/681] =?UTF-8?q?Fix=20spelling=20of=20=E2=80=9Ccontinuo?= =?UTF-8?q?us=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/tests/EnumMapTest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/tests/EnumMapTest.cpp b/test/tests/EnumMapTest.cpp index 98efbc8e73..f6d54f6321 100644 --- a/test/tests/EnumMapTest.cpp +++ b/test/tests/EnumMapTest.cpp @@ -9,7 +9,7 @@ #include #include -enum class TestEnumClassContinous +enum class TestEnumClassContinuous { A, B, @@ -20,7 +20,7 @@ enum class TestEnumClassContinous G }; -enum class TestEnumClassNonContinous +enum class TestEnumClassNonContinuous { A = 1, B, @@ -125,22 +125,22 @@ template void TestEnumValueLookup() SUCCEED(); } -TEST(EnumMapTest, LookupContinousByKey) +TEST(EnumMapTest, LookupContinuousByKey) { - TestEnumKeyLookup(); + TestEnumKeyLookup(); } -TEST(EnumMapTest, LookupContiniousByValue) +TEST(EnumMapTest, LookupContinuousByValue) { - TestEnumValueLookup(); + TestEnumValueLookup(); } -TEST(EnumMapTest, LookupNonContinousByKey) +TEST(EnumMapTest, LookupNonContinuousByKey) { - TestEnumKeyLookup(); + TestEnumKeyLookup(); } -TEST(EnumMapTest, LookupNonContiniousByValue) +TEST(EnumMapTest, LookupNonContinuousByValue) { - TestEnumValueLookup(); + TestEnumValueLookup(); } From 6877b8214ac1a5ae5fdecd9f8410e433fc91ea38 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 29 Jul 2021 01:24:24 +0300 Subject: [PATCH 042/681] Fix unhandled exceptions during packet processing --- src/openrct2/network/NetworkBase.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 053339fafc..4bce56d75e 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -1698,15 +1698,23 @@ bool NetworkBase::ProcessConnection(NetworkConnection& connection) void NetworkBase::ProcessPacket(NetworkConnection& connection, NetworkPacket& packet) { const auto& handlerList = GetMode() == NETWORK_MODE_SERVER ? server_command_handlers : client_command_handlers; - auto it = handlerList.find(packet.GetCommand()); - if (it != handlerList.end()) + + try { - auto commandHandler = it->second; - if (connection.AuthStatus == NetworkAuth::Ok || !packet.CommandRequiresAuth()) + auto it = handlerList.find(packet.GetCommand()); + if (it != handlerList.end()) { - (this->*commandHandler)(connection, packet); + auto commandHandler = it->second; + if (connection.AuthStatus == NetworkAuth::Ok || !packet.CommandRequiresAuth()) + { + (this->*commandHandler)(connection, packet); + } } } + catch (const std::exception& ex) + { + log_verbose("Exception during packet processing: %s", ex.what()); + } packet.Clear(); } From 4f54aa5c42a6614427e62ab116a74138fa2996ea Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 29 Jul 2021 02:26:02 +0300 Subject: [PATCH 043/681] Limit the count of packets processed per update --- src/openrct2/network/NetworkBase.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 4bce56d75e..84ac7ae653 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -49,6 +49,9 @@ static int32_t _pickup_peep_old_x = LOCATION_NULL; // with uint16_t and needs some spare room for other data in the packet. static constexpr uint32_t CHUNK_SIZE = 1024 * 63; +// If data is sent fast enough it would halt the entire server, process only a maximum amount. +static constexpr uint32_t MaxPacketsPerUpdate = 100; + # include "../Cheats.h" # include "../ParkImporter.h" # include "../Version.h" @@ -1654,8 +1657,11 @@ void NetworkBase::Server_Send_EVENT_PLAYER_DISCONNECTED(const char* playerName, bool NetworkBase::ProcessConnection(NetworkConnection& connection) { NetworkReadPacket packetStatus; + + uint32_t countProcessed = 0; do { + countProcessed++; packetStatus = connection.ReadPacket(); switch (packetStatus) { @@ -1681,7 +1687,7 @@ bool NetworkBase::ProcessConnection(NetworkConnection& connection) // could not read anything from socket break; } - } while (packetStatus == NetworkReadPacket::Success); + } while (packetStatus == NetworkReadPacket::Success && countProcessed < MaxPacketsPerUpdate); if (!connection.ReceivedPacketRecently()) { From dd2ffec14be3312549f84a2f4fb6b5dddc3debb4 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 29 Jul 2021 20:08:57 +0300 Subject: [PATCH 044/681] Code review changes --- src/openrct2/network/NetworkBase.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 84ac7ae653..cbacc0f88e 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -50,6 +50,7 @@ static int32_t _pickup_peep_old_x = LOCATION_NULL; static constexpr uint32_t CHUNK_SIZE = 1024 * 63; // If data is sent fast enough it would halt the entire server, process only a maximum amount. +// This limit is per connection, the current value was determined by tests with fuzzing. static constexpr uint32_t MaxPacketsPerUpdate = 100; # include "../Cheats.h" @@ -1705,22 +1706,22 @@ void NetworkBase::ProcessPacket(NetworkConnection& connection, NetworkPacket& pa { const auto& handlerList = GetMode() == NETWORK_MODE_SERVER ? server_command_handlers : client_command_handlers; - try + auto it = handlerList.find(packet.GetCommand()); + if (it != handlerList.end()) { - auto it = handlerList.find(packet.GetCommand()); - if (it != handlerList.end()) + auto commandHandler = it->second; + if (connection.AuthStatus == NetworkAuth::Ok || !packet.CommandRequiresAuth()) { - auto commandHandler = it->second; - if (connection.AuthStatus == NetworkAuth::Ok || !packet.CommandRequiresAuth()) + try { (this->*commandHandler)(connection, packet); } + catch (const std::exception& ex) + { + log_verbose("Exception during packet processing: %s", ex.what()); + } } } - catch (const std::exception& ex) - { - log_verbose("Exception during packet processing: %s", ex.what()); - } packet.Clear(); } From 2eb1ee631b888c94c86b63b72b4110059d39a964 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 30 Jul 2021 04:08:04 +0000 Subject: [PATCH 045/681] Merge Localisation/master into OpenRCT2/develop --- data/language/nl-NL.txt | 112 ++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index fd5679f0bf..02078d4657 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -3673,7 +3673,7 @@ STR_DTLS :Bouw vanaf het begin een pretpark rond een groot meer. STR_SCNR :Diamond Heights STR_PARK :Diamond Heights -STR_DTLS :Diamond Heights is al een succesvol pretpark met fantastische attracties - verander het om de waarde ervan te verdubbelen. +STR_DTLS :Diamond Heights is al een succesvol pretpark met fantastische attracties. Verbeter het om de waarde ervan te verdubbelen. STR_SCNR :Evergreen Gardens @@ -3693,7 +3693,7 @@ STR_DTLS :Verscheidene eilanden vormen de basis voor dit nieuwe park. STR_SCNR :Katie’s Dreamland STR_PARK :Katie’s Dreamland -STR_DTLS :Een klein pretpark met een paar attracties en ruimte voor uitbreiding - jouw doel is om de parkwaarde te verdubbelen. +STR_DTLS :Een klein pretpark met een paar attracties en ruimte voor uitbreiding. Jouw doel is om de parkwaarde te verdubbelen. STR_SCNR :Pokey Park @@ -3703,12 +3703,12 @@ STR_DTLS :Een klein, krap pretpark dat grote uitbreiding vereist. STR_SCNR :White Water Park STR_PARK :White Water Park -STR_DTLS :Een park met enkele uitstekende waterattracties vereist uitbreiding +STR_DTLS :Een park met enkele uitstekende waterattracties vereist uitbreiding. STR_SCNR :Millennium Mines STR_PARK :Millennium Mines -STR_DTLS :Verander een grote verlaten mijn, een toeristische attractie, in een pretpark. +STR_DTLS :Verander een grote verlaten mijn (een toeristische attractie) in een pretpark. STR_SCNR :Karts & Coasters @@ -3728,12 +3728,12 @@ STR_DTLS :Bouw vanaf het begin een pretpark in de heuvelachtige bossen van My STR_SCNR :Pacific Pyramids STR_PARK :Pacific Pyramids -STR_DTLS :Verander de Egyptische ruïnes, een toeristische attractie, in een bloeiend pretpark. +STR_DTLS :Verander de Egyptische ruïnes (een toeristische attractie) in een bloeiend pretpark. STR_SCNR :Crumbly Woods STR_PARK :Crumbly Woods -STR_DTLS :Een groot park met goed ontwerpen maar nogal oude attracties - vervang de oude attracties of voeg nieuwe toe om het park populairder te maken. +STR_DTLS :Een groot park met goed ontwerpen maar nogal oude attracties. Vervang de oude attracties of voeg nieuwe toe om het park populairder te maken. STR_SCNR :Paradise Pier @@ -3748,12 +3748,12 @@ STR_DTLS :De mooie bergen van Lightning Peaks zijn populair bij wandelaars en STR_SCNR :Ivory Towers STR_PARK :Ivory Towers -STR_DTLS :Een reeds gevestigd park dat wat problemen heeft. +STR_DTLS :Een gevestigd park met een aantal problemen. STR_SCNR :Rainbow Valley STR_PARK :Rainbow Valley -STR_DTLS :Van de gemeenteraad van Rainbow Valley mag het landschap niet gewijzigd worden en mogen er geen grote bomen worden gekapt, maar je moet het gebied ontwikkelen tot een groot pretpark. +STR_DTLS :Van de gemeenteraad van Rainbow Valley mag het landschap niet gewijzigd worden en er mogen er geen grote bomen worden gekapt. Desondanks moet je het gebied ontwikkelen tot een groot pretpark. STR_SCNR :Thunder Rock @@ -3774,12 +3774,12 @@ STR_DTLS :Ontwikkel het rotsgebied bij de kust tot een bloeiend pretpark. STR_SCNR :Three Monkeys Park STR_PARK :Three Monkeys Park -STR_DTLS :Het middelpunt van dit grote park in ontwikkeling is een enorme duellerende stalen achtbaan met drie banen. +STR_DTLS :Het middelpunt van dit grote park in ontwikkeling is een enorme duellerende stalen achtbaan met drie sporen. STR_SCNR :Canary Mines STR_PARK :Canary Mines -STR_DTLS :Deze verlaten mijn bezit, met een miniatuurspoorweg en een paar verticale achtbanen, reeds de kenmerken van een toeristische attractie. +STR_DTLS :Deze verlaten mijn heeft reeds kenmerken van een toeristische attractie: een miniatuurspoorweg en een paar verticale achtbanen. STR_SCNR :Barony Bridge @@ -3834,7 +3834,7 @@ STR_DTLS :Een groot stuk land is al voor je ontruimd en gedeeltelijk gethemat STR_SCNR :Fruit Farm STR_PARK :Fruit Farm -STR_DTLS :Een bloeiende fruitplantage heeft een spoorweg gebouwd om haar inkomen te vergroten. Jouw taak is om het uit te breiden tot een bloeiend pretpark. +STR_DTLS :Een bloeiende fruitplantage heeft een spoorweg gebouwd om haar inkomen te vergroten. Jouw taak is om de plantage uit te breiden tot een bloeiend pretpark. STR_SCNR :Butterfly Dam @@ -4111,17 +4111,17 @@ STR_DTLS :Het is je uitdaging om een zeer winstgevend park te bouwen op dit p STR_SCNR :Bumbly Bazaar STR_PARK :Bumbly Bazaar -STR_DTLS :Beginnend met een klein marktkraampje, is het je uitdaging om de winst van winkels en kraampjes te vergroten door attracties en achtbanen te bouwen en zo meer klanten te trekken. +STR_DTLS :Je begint met een kleine markt. Je opdracht is om de winst van je winkels en kraampjes te vergroten door attracties en achtbanen te bouwen en zo meer klanten te trekken. STR_SCNR :Crazy Castle STR_PARK :Crazy Castle -STR_DTLS :Je hebt een groot kasteel geërfd - het is je opdracht er een klein themapark van te maken. +STR_DTLS :Je hebt een groot kasteel geërfd. Het is je opdracht er een klein themapark van te maken. STR_SCNR :Dusty Greens STR_PARK :Dusty Greens -STR_DTLS :Dusty Greens ligt aan een snelwegknooppunt in de woestijn, en is een gelegenheid om van een kleine golfbaan een succesvol themapark te maken. +STR_DTLS :Dusty Greens ligt aan een snelwegknooppunt in de woestijn. Het is een gelegenheid om van een kleine golfbaan een succesvol themapark te maken. STR_SCNR :Electric Fields @@ -4131,22 +4131,22 @@ STR_DTLS :Je hebt een kleine boerderij geërfd, en het is je uitdaging een kl STR_SCNR :Extreme Heights STR_PARK :Extreme Heights -STR_DTLS :Vrij van financiële beperkingen, is het je uitdaging om dit woestijnpark uit te breiden om mensen te trekken die de extreemste sensaties zoeken. +STR_DTLS :Het is de uitdaging om dit woestijnpark uit te breiden om mensen te trekken die op zoek zijn naar extreme sensatie. Geld speelt geen rol. STR_SCNR :Factory Capers STR_PARK :Factory Capers -STR_DTLS :Een verlaten fabriekscomplex is een gelegenheid om een amusementspark met een mechanisch thema te bouwen. +STR_DTLS :Een verlaten fabriekscomplex is een gelegenheid om een amusementspark met een fabrieksthema te bouwen. STR_SCNR :Fungus Woods STR_PARK :Fungus Woods -STR_DTLS :Beperkt tot uitsluitend de ouderwetse houten attracties, is het je uitdaging om een succesvol themapark in Fungus Woods te bouwen. +STR_DTLS :Het is je uitdaging om een succesvol themapark in Fungus Woods te bouwen, maar je bent beperkt tot ouderwetse houten attracties. STR_SCNR :Ghost Town STR_PARK :Ghost Town -STR_DTLS :Je wordt aangenomen door een grote keten van amusementsparken en het is je taak een gigantisch park met achtbanen te bouwen rond een verlaten mijnstadje. +STR_DTLS :Je bent aangenomen door een grote keten van amusementsparken. Het is je taak een gigantisch park met achtbanen te bouwen rond een verlaten mijnstadje. STR_SCNR :Gravity Gardens @@ -4225,160 +4225,160 @@ STR_DTLS :Maak je eigen Six Flags-park, door gebruik te maken van attracties ## Wacky Worlds Scenarios -STR_SCNR : Afrika - Diamantmijn +STR_SCNR :Afrika - Diamantmijn STR_PARK :Mines of Africa -STR_DTLS :Je hebt in verlaten diamantmijn geërfd en een waardevolle diamant gevonden. Je besluit dit geld te investeren om een wereldberoemd themapark te bouwen. +STR_DTLS :Je hebt een verlaten diamantmijn geërfd en een waardevolle diamant gevonden. Je besluit dit geld te investeren om een wereldberoemd themapark te bouwen. -STR_SCNR : Afrika - Oase +STR_SCNR :Afrika - Oase STR_PARK :Mirage Madness STR_DTLS :Er is een oase in de woestijn gevonden die een prachtige locatie van een park zou vormen. Voor transport van en naar de oase is gezorgd. -STR_SCNR : Afrika - Victoriawatervallen +STR_SCNR :Afrika - Victoriawatervallen STR_PARK :Over The Edge STR_DTLS :Er is een stuwdam gebouwd die goedkope energie in overvloed levert voor je park. Je moet een hoge parkwaarde bereiken om de lening voor de dam terug te betalen. -STR_SCNR : Antarctica - Ecologische reddingsactie +STR_SCNR :Antarctica - Ecologische reddingsactie STR_PARK :Icy Adventures STR_DTLS :De milieuorganisatie heeft je gevraagd om een lelijke oude olieraffinaderij om te vormen tot een toeristische trekpleister. Land is goedkoop maar de rente op leningen is hoog. Je kunt de oude gebouwen verkopen als schroot. -STR_SCNR : Azië - Meer toeristen naar de Chinese Muur +STR_SCNR :Azië - Meer toeristen naar de Chinese Muur STR_PARK :De Chinese Muur STR_DTLS :De regering heeft besloten om meer toeristen naar de Chinese Muur door er een themapark naast te bouwen. Geld speelt geen rol! -STR_SCNR : Azië - Polderen aan de kust +STR_SCNR :Azië - Polderen aan de kust STR_PARK :Okinawa Coast STR_DTLS :Een bestaand pretpark heeft geen ruimte meer. Je enige optie is om naar de zee uit te breiden, waarvoor je geld hebt geleend. Vanwege het aardbevingsgevaar zijn er hoogtebeperkingen van kracht. -STR_SCNR : Azië - Paleis van de Maharadja +STR_SCNR :Azië - Paleis van de Maharadja STR_PARK :Park Maharadja STR_DTLS :De Maharadja heeft jou aangewezen om de lokale bevolking te vermaken. Bouw een park dat is geïnspireerd door het paleis van de Maharadja. -STR_SCNR : Australië - Ayers Rock +STR_SCNR :Australië - Ayers Rock STR_PARK :Ayers Adventure STR_DTLS :Je helpt de Aboriginals om een park te bouwen om het bewustzijn voor hun cultuur te vergroten. Je moet een groot aantal bezoekers aantrekken om hen de unieke geschiedenis van de Aboriginals bij te brengen. -STR_SCNR : Australië - Plezier op het strand +STR_SCNR :Australië - Plezier op het strand STR_PARK :Beach Barbecue Blast STR_DTLS :Het themapark van een lokale ondernemer is over de kop gegaan. Je bezit zelf al een klein park en hebt het andere park overgenomen. Combineer beide parken tot één groot park. -STR_SCNR : Europa - Europees Cultureel Festival +STR_SCNR :Europa - Europees Cultureel Festival STR_PARK :European Extravaganza STR_DTLS :Je bent aangesteld om het beheer over een attractiepark over de Europese cultuur over te nemen. Je moet het aantal bezoekers verhogen om de EU-subsidie terug te betalen voor het einde van de huidige termijn van het Europees Parlement. -STR_SCNR : Europa - Renovatie +STR_SCNR :Europa - Renovatie STR_PARK :From The Ashes STR_DTLS :Een oud park is vervallen. Je hebt een lening van de Europese Unie gekregen om het troosteloze terrein weer in oude luister te herstellen! Je moet het park renoveren en de lening terugbetalen. -STR_SCNR : Noord-Amerika - Extreem Hawaiiaans eiland +STR_SCNR :Noord-Amerika - Extreem Hawaiiaans eiland STR_PARK :Wacky Waikiki STR_DTLS :De bevolking van Hawaii wil wel eens iets spannenders dan surfen. Houd dit in het achterhoofd bij het bouwen van een park om zoveel mogelijk mogelijk toeristen aan te trekken. -STR_SCNR : Noord-Amerika - Grand Canyon +STR_SCNR :Noord-Amerika - Grand Canyon STR_PARK :Canyon Calamities STR_DTLS :Je moet een park bouwen op de beperkte ruimte aan weerszijden van dit natuurschoon. Hierbij heb je de mogelijkheid om land te kopen van de indianen. -STR_SCNR : Noord-Amerika - Rollercoaster Heaven +STR_SCNR :Noord-Amerika - Rollercoaster Heaven STR_PARK :Rollercoaster Heaven STR_DTLS :Je bent een succesvol zakenman op een lange sabbatical. Die wil je gebruiken om het stadspark om te toveren in een achtbanenparadijs. Geld speelt geen rol! -STR_SCNR : Zuid-Amerika - Verloren Incastad +STR_SCNR :Zuid-Amerika - Verloren Incastad STR_PARK :Lost City Founder STR_DTLS :Om nog meer toeristen te trekken moet je een park bouwen dat past bij de omgeving. Dat betekent ook dat er hoogtebeperkingen zijn. -STR_SCNR : Zuid-Amerika - Regenwoudplateau +STR_SCNR :Zuid-Amerika - Regenwoudplateau STR_PARK :Rainforest Romp STR_DTLS :In het regenwoud is er niet veel plek. Je moet zo veel mogelijk in de open plek zien te persen om een goed alternatief voor de lokale houtindustrie te vormen. -STR_SCNR : Zuid-Amerika - Carnival van Rio +STR_SCNR :Zuid-Amerika - Carnival van Rio STR_PARK :Sugarloaf Shores STR_DTLS :Je hebt een klein park in de buurt van Rio, maar de bank wil haar lening terug. Je moet je winst zien te verhogen om je schuld terug te betalen. ## Time Twister -STR_SCNR : Middeleeuwen - Kasteel +STR_SCNR :Middeleeuwen - Kasteel STR_PARK :Cliffside Castle -STR_DTLS :De leden van de lokale vereniging die oude veldslagen naspeelt nemen hun hobby serieus. Ze hebben jou de klus om van Cliffside Castle een middeleeuws themapark te maken toevertrouwd. +STR_DTLS :De leden van de lokale vereniging die oude veldslagen naspeelt nemen hun hobby serieus. Ze hebben jou de klus toevertrouwd om van Cliffside Castle een middeleeuws themapark te maken. -STR_SCNR : Middeleeuwen - Robin Hood +STR_SCNR :Middeleeuwen - Robin Hood STR_PARK :Sherwood Forest STR_DTLS :Om geld van de rijken naar de armen te brengen hebben jij en je Merry Men besloten een themapark te bouwen in Sherwood Forest. -STR_SCNR : Toekomst - Eerste ontmoeting +STR_SCNR :Toekomst - Eerste ontmoeting STR_PARK :Extraterrestrial Extravaganza -STR_DTLS :Er is leven aangetroffen op een verre planeet! Bouw een buitenaards themapark om munt te slaan uit de onverwachte golf van interesse. +STR_DTLS :Er is leven ontdekt op een verre planeet! Bouw een buitenaards themapark om munt te slaan uit de onverwachte golf van interesse. -STR_SCNR : Toekomst - Stad van de toekomst +STR_SCNR :Toekomst - Stad van de toekomst STR_PARK :Gemini City -STR_DTLS :Laat je inventieve, utopische visie van de toekomst zien - bedenk een furistisch ontwerp met state-of-the-art attracties. +STR_DTLS :Laat je inventieve, utopische visie van de toekomst zien! Bedenk een furistisch ontwerp met state-of-the-art attracties. -STR_SCNR : Mythologie - Animatronic-filmset +STR_SCNR :Mythologie - Animatronic-filmset STR_PARK :Animatronic Antics STR_DTLS :Je moet een bestaand pretpark, gebouwd op een oude filmset, beheren en verbeteren. Bouw een eerbetoon aan de pioniers van de stop-motionanimatie, die de wezens uit de mythologie tot leven brachten op het witte doek. -STR_SCNR : Mythologie - Wieg van de beschaving +STR_SCNR :Mythologie - Wieg van de beschaving STR_PARK :Mythological Madness STR_DTLS :Je bezit een eiland van grote archeologische waarde, dat je voor het nageslacht wilt beschermen. Dit wil je bekostigen door een park te bouwen met de mythologische geschiedenis van je eiland als thema. -STR_SCNR : Prehistorie - Na de meteoriet +STR_SCNR :Prehistorie - Na de meteoriet STR_PARK :Crater Carnage -STR_DTLS :Je bezig een stoffige oude meteorietkrater. Als echte ondernemer heb je besloten om er een themapark van te maken en zo munt te slaan uit je waardeloos lijkende land. +STR_DTLS :Je bezig een stoffige oude meteorietkrater. Als echte ondernemer heb je besloten om er een themapark van te maken en zo munt te slaan uit je (op het eerste gezicht) waardeloze land. -STR_SCNR : Prehistorie - Jurasafari +STR_SCNR :Prehistorie - Jurasafari STR_PARK :Coastersaurus STR_DTLS :Je moet een themapark bouwen in Jurastijl. Om de bezoekers zo dicht mogelijk bij de exotische planten en dieren te laten komen, moeten je attracties over en door de vallei gaan lopen. -STR_SCNR : Prehistorie - Steentijd +STR_SCNR :Prehistorie - Steentijd STR_PARK :Rocky Rambles STR_DTLS :Om te voorkomen dat er een snelweg wordt aangelegd en zo de mysterieuze prehistorische steencirkels te beschermen, moet je een winstgevend themapark bouwen. Het kan echter lastig worden om bezoekers aan te trekken, aangezien het terrein vrij ruw is. -STR_SCNR : Roaring Twenties - Alcatraz +STR_SCNR :Roaring Twenties - Alcatraz STR_PARK :Alcatraz STR_DTLS :Het beruchte gevangeniseiland, dat ooit volzat met illegale drankstokers en gangsters, is nu te koop. Je hebt besloten het te veranderen in een toeristentrekpleister. Geld speelt geen rol! -STR_SCNR : Roaring Twenties - Schneider Cup +STR_SCNR :Roaring Twenties - Schneider Cup STR_PARK :Schneider Shores STR_DTLS :Het is al bijna 75 jaar geleden dat je grootvader de Schneider Cup won. Je hebt besloten zijn prestatie te eren met een themapark dat is geïnspireerd door de beroemde watervliegtuigenrace. -STR_SCNR : Roaring Twenties - Wolkenkrabbers +STR_SCNR :Roaring Twenties - Wolkenkrabbers STR_PARK :Metropolis STR_DTLS :Je bezit een lege kavel in de stad, tussen de laagbouw. Bouw een themapark van wolkenkrabbers, geïnspireerd door de artdecostijl van de jaren twintig. -STR_SCNR : Rock ‘n’ Roll - Flower Power +STR_SCNR :Rock-’n-roll - Flower Power STR_PARK :Woodstock STR_DTLS :Een groot jaarlijks muziekfestival vindt plaats op jouw terrein. Bouw een hip themapark om het publiek van vrije geesten te vermaken. -STR_SCNR : Rock ‘n’ Roll - Rock ‘n’ Roll -STR_PARK :Rock ‘n’ Roll Revival -STR_DTLS :Dit verouderde themapark heeft betere tijden gekend. Geef het park een rock ‘n’ roll-makeover en verander het in een succesvolle onderneming. +STR_SCNR :Rock-’n-roll - Rock-’n-roll +STR_PARK :Rock ’n’ Roll Revival +STR_DTLS :Dit verouderde themapark heeft betere tijden gekend. Geef het park een rock-’n-roll-makeover en verander het in een succesvolle onderneming. #OCC From 62d66ca9d02bb6d78e4f110bef07bc6d9aa22588 Mon Sep 17 00:00:00 2001 From: andrewpratt64 Date: Fri, 30 Jul 2021 08:03:15 -0400 Subject: [PATCH 046/681] Add hook for vehicle crashes to plugin api (#15084) * Add initial implementation of "vehicle.crash" hook for the scripting api The hook will fire whenever a vehicle crashes, i.e. an individual car explodes and it's status becomes "Crashed!" * Update contributors.md Add name to contributors list under the "Additional implementation (OpenRCT2)" section. - If the added line needs to be changed or removed entirely let me know - I added this based off of the Github wiki: "If it's the first time you're contributing with the project, make sure to update the contributors.md file by appending your name at the end of the respective list." * Move hook code into function * Rename hook function Renamed function, "FireVehicleCrashHook" to "InvokeVehicleCrashHook" * Wrap InvokeVehicleCrashHook in #ifdef Move the #ifdef from inside the function body to the outside * Update changelog and api version - Added entry to changelog - Increment API version * Fix whitespace Replace tab character with four spaces * Update src/openrct2/scripting/HookEngine.cpp Co-authored-by: Tulio Leao --- contributors.md | 1 + distribution/changelog.txt | 1 + distribution/openrct2.d.ts | 10 ++++++- src/openrct2/ride/Vehicle.cpp | 39 +++++++++++++++++++++++++++ src/openrct2/scripting/HookEngine.cpp | 1 + src/openrct2/scripting/HookEngine.h | 1 + src/openrct2/scripting/ScriptEngine.h | 2 +- 7 files changed, 53 insertions(+), 2 deletions(-) diff --git a/contributors.md b/contributors.md index 38e134adc0..6938da9026 100644 --- a/contributors.md +++ b/contributors.md @@ -93,6 +93,7 @@ The following people are not part of the development team, but have been contrib * Keith Stellyes (keithstellyes) - Misc. * Bas Cantrijn (Basssiiie) - Misc. * Adrian Zdanowicz (CookiePLMonster) - Misc. +* Andrew Pratt (andrewpratt64) - Added api hook for vehicle crashes ## Bug fixes * (KirilAngelov) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d2c7c26844..34567e9393 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ +- Feature: [#15084] [Plugin] Add "vehicle.crash" hook - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Improved: [#3417] Crash dumps are now placed in their own folder. diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 72efec0980..e2efcf50df 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -267,6 +267,7 @@ declare global { subscribe(hook: "ride.ratings.calculate", callback: (e: RideRatingsCalculateArgs) => void): IDisposable; subscribe(hook: "action.location", callback: (e: ActionLocationArgs) => void): IDisposable; subscribe(hook: "guest.generation", callback: (id: number) => void): IDisposable; + subscribe(hook: "vehicle.crash", callback: (e: VehicleCrashArgs) => void): IDisposable; /** * Registers a function to be called every so often in realtime, specified by the given delay. @@ -365,7 +366,7 @@ declare global { type HookType = "interval.tick" | "interval.day" | "network.chat" | "network.action" | "network.join" | "network.leave" | - "ride.ratings.calculate" | "action.location"; + "ride.ratings.calculate" | "action.location" | "vehicle.crash"; type ExpenditureType = "ride_construction" | @@ -514,6 +515,13 @@ declare global { readonly isClientOnly: boolean; result: boolean; } + + type VehicleCrashIntoType = "another_vehicle" | "land" | "water"; + + interface VehicleCrashArgs { + readonly id: number; + readonly crashIntoType: VehicleCrashIntoType; + } /** * APIs for the in-game date. diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 0a9f05e8ed..c256d30f82 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -24,6 +24,8 @@ #include "../platform/platform.h" #include "../rct12/RCT12.h" #include "../scenario/Scenario.h" +#include "../scripting/HookEngine.h" +#include "../scripting/ScriptEngine.h" #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Map.h" @@ -738,6 +740,31 @@ template<> bool SpriteBase::Is() const return Type == EntityType::Vehicle; } +#ifdef ENABLE_SCRIPTING +/** + * Fires the "vehicle.crash" api hook + * @param vehicleId Entity id of the vehicle that just crashed + * @param crashId What the vehicle crashed into. Should be either "another_vehicle", "land", or "water" + */ +static void InvokeVehicleCrashHook(const uint16_t vehicleId, const std::string_view crashId) +{ + auto& hookEngine = OpenRCT2::GetContext()->GetScriptEngine().GetHookEngine(); + if (hookEngine.HasSubscriptions(OpenRCT2::Scripting::HOOK_TYPE::VEHICLE_CRASH)) + { + auto ctx = OpenRCT2::GetContext()->GetScriptEngine().GetContext(); + + // Create event args object + auto obj = OpenRCT2::Scripting::DukObject(ctx); + obj.Set("id", vehicleId); + obj.Set("crashIntoType", crashId); + + // Call the subscriptions + auto e = obj.Take(); + hookEngine.Call(OpenRCT2::Scripting::HOOK_TYPE::VEHICLE_CRASH, e, true); + } +} +#endif + static bool vehicle_move_info_valid( VehicleTrackSubposition trackSubposition, track_type_t type, uint8_t direction, int32_t offset) { @@ -3598,6 +3625,10 @@ void Vehicle::UpdateCollisionSetup() train->sub_state = 2; +#ifdef ENABLE_SCRIPTING + InvokeVehicleCrashHook(train->sprite_index, "another_vehicle"); +#endif + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { train->x, train->y, train->z }); ExplosionCloud::Create({ train->x, train->y, train->z }); @@ -5334,6 +5365,10 @@ void Vehicle::CrashOnLand() } SetState(Vehicle::Status::Crashed, sub_state); +#ifdef ENABLE_SCRIPTING + InvokeVehicleCrashHook(sprite_index, "land"); +#endif + if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) { auto frontVehicle = GetHead(); @@ -5396,6 +5431,10 @@ void Vehicle::CrashOnWater() } SetState(Vehicle::Status::Crashed, sub_state); +#ifdef ENABLE_SCRIPTING + InvokeVehicleCrashHook(sprite_index, "water"); +#endif + if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) { auto frontVehicle = GetHead(); diff --git a/src/openrct2/scripting/HookEngine.cpp b/src/openrct2/scripting/HookEngine.cpp index e857a41025..6c2a750348 100644 --- a/src/openrct2/scripting/HookEngine.cpp +++ b/src/openrct2/scripting/HookEngine.cpp @@ -30,6 +30,7 @@ static const EnumMap HooksLookupTable({ { "ride.ratings.calculate", HOOK_TYPE::RIDE_RATINGS_CALCULATE }, { "action.location", HOOK_TYPE::ACTION_LOCATION }, { "guest.generation", HOOK_TYPE::GUEST_GENERATION }, + { "vehicle.crash", HOOK_TYPE::VEHICLE_CRASH }, }); HOOK_TYPE OpenRCT2::Scripting::GetHookType(const std::string& name) diff --git a/src/openrct2/scripting/HookEngine.h b/src/openrct2/scripting/HookEngine.h index ce94ec8a20..b1a875eaa7 100644 --- a/src/openrct2/scripting/HookEngine.h +++ b/src/openrct2/scripting/HookEngine.h @@ -39,6 +39,7 @@ namespace OpenRCT2::Scripting RIDE_RATINGS_CALCULATE, ACTION_LOCATION, GUEST_GENERATION, + VEHICLE_CRASH, COUNT, UNDEFINED = -1, }; diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 3eebc71613..132d5055fa 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 31; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 32; # ifndef DISABLE_NETWORK class ScSocketBase; From fd823c8acb9f517c0155691f419619c122caa9a5 Mon Sep 17 00:00:00 2001 From: saad Date: Fri, 30 Jul 2021 18:38:42 +0400 Subject: [PATCH 047/681] Fix #14918 refactor while loop and int variable size --- src/openrct2-ui/windows/Ride.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 3403f0b486..912b05b4a6 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1601,15 +1601,15 @@ static void window_ride_init_viewport(rct_window* w) else if (eax >= ride->num_vehicles && eax < (ride->num_vehicles + ride->num_stations)) { StationIndex stationIndex = STATION_INDEX_NULL; - int32_t count = eax - ride->num_vehicles; - do + int count = eax - ride->num_vehicles; + while (count >= 0) { stationIndex++; if (!ride->stations[stationIndex].Start.isNull()) { count--; } - } while (count >= 0); + } auto location = ride->stations[stationIndex].GetStart(); focus.coordinate.x = location.x; From ab96ca85165ac1710c2cf5dac85ee5be4e9a78bb Mon Sep 17 00:00:00 2001 From: saad Date: Fri, 30 Jul 2021 19:34:42 +0400 Subject: [PATCH 048/681] Fix #14918 rename eax and refactor while loop to avoid overflow --- src/openrct2-ui/windows/Ride.cpp | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 912b05b4a6..eb1effd045 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1559,7 +1559,7 @@ static void window_ride_init_viewport(rct_window* w) if (ride == nullptr) return; - int32_t eax = w->viewport_focus_coordinates.var_480 - 1; + int32_t viewSelectionIndex = w->viewport_focus_coordinates.var_480 - 1; union { @@ -1576,9 +1576,9 @@ static void window_ride_init_viewport(rct_window* w) focus.coordinate.width = 0; focus.coordinate.height = 0; - if (eax >= 0 && eax < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { - focus.sprite.sprite_id = ride->vehicles[eax]; + focus.sprite.sprite_id = ride->vehicles[viewSelectionIndex]; rct_ride_entry* ride_entry = ride->GetRideEntry(); if (ride_entry && ride_entry->tab_vehicle != 0) @@ -1598,28 +1598,30 @@ static void window_ride_init_viewport(rct_window* w) focus.sprite.type |= VIEWPORT_FOCUS_TYPE_SPRITE; } } - else if (eax >= ride->num_vehicles && eax < (ride->num_vehicles + ride->num_stations)) + else if (viewSelectionIndex >= ride->num_vehicles && viewSelectionIndex < (ride->num_vehicles + ride->num_stations)) { - StationIndex stationIndex = STATION_INDEX_NULL; - int count = eax - ride->num_vehicles; - while (count >= 0) + int32_t count = viewSelectionIndex - ride->num_vehicles; + + for (const auto& station : ride->stations) { - stationIndex++; - if (!ride->stations[stationIndex].Start.isNull()) + if (!station.Start.isNull()) { count--; } - } - - auto location = ride->stations[stationIndex].GetStart(); - focus.coordinate.x = location.x; - focus.coordinate.y = location.y; - focus.coordinate.z = location.z; - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + if (count == 0) + { + auto location = station.GetStart(); + focus.coordinate.x = location.x; + focus.coordinate.y = location.y; + focus.coordinate.z = location.z; + focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + break; + } + } } else { - if (eax > 0) + if (viewSelectionIndex > 0) { w->viewport_focus_coordinates.var_480 = 0; } From 43b7c3a204bbd82b1620972bc8d693b328c1e078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 30 Jul 2021 10:33:48 -0700 Subject: [PATCH 049/681] Fix potential nullptr dereference (#15134) --- src/openrct2/actions/LargeSceneryPlaceAction.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index ac7eabb46e..ba4e3b5a3b 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -266,7 +266,10 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const isTree); if (canBuild->Error != GameActions::Status::Ok) { - DeleteBanner(banner->id); + if (banner != nullptr) + { + DeleteBanner(banner->id); + } canBuild->ErrorTitle = STR_CANT_POSITION_THIS_HERE; return canBuild; } From 0f74591f404d28d4b8a843b7b4d908eea212cabe Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 01:44:01 +0300 Subject: [PATCH 050/681] Use std::vector<> instead of malloc/free in CursorRepository.cpp --- src/openrct2-ui/CursorRepository.cpp | 34 +++++++++++++--------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/openrct2-ui/CursorRepository.cpp b/src/openrct2-ui/CursorRepository.cpp index 6fab01a596..4c703a1089 100644 --- a/src/openrct2-ui/CursorRepository.cpp +++ b/src/openrct2-ui/CursorRepository.cpp @@ -14,6 +14,7 @@ #include #include #include +#include using namespace OpenRCT2::Ui; @@ -45,19 +46,19 @@ void CursorRepository::SetCurrentCursor(CursorID cursorId) } } -static bool getBit(const uint8_t* data, size_t x, size_t y, size_t width) +static bool getBit(const uint8_t data[], size_t x, size_t y, size_t width) noexcept { - size_t position = y * width + x; + const size_t position = y * width + x; return (data[position / 8] & (1 << (7 - (x % 8)))) != 0; } -static void setBit(uint8_t* data, size_t x, size_t y, size_t width) +static void setBit(uint8_t data[], size_t x, size_t y, size_t width) noexcept { size_t position = y * width + x; data[position / 8] |= (1 << (7 - (position % 8))); } -static void drawRect(uint8_t* data, size_t x, size_t y, size_t width, size_t scale) +static void drawRect(uint8_t data[], size_t x, size_t y, size_t width, size_t scale) noexcept { for (size_t outY = (y * scale); outY < ((1 + y) * scale); outY++) { @@ -68,42 +69,39 @@ static void drawRect(uint8_t* data, size_t x, size_t y, size_t width, size_t sca } } -static uint8_t* scaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale) +static std::vector scaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale) { - size_t length = width * height; - auto* ret = static_cast(calloc(sizeof(uint8_t), length * scale * scale)); + const size_t length = width * height; + + std::vector res; + res.resize(length * scale * scale); for (size_t y = 0; y < height * 8; y++) { for (size_t x = 0; x < width; x++) { - bool value = getBit(data, x, y, width); + const bool value = getBit(data, x, y, width); if (!value) continue; - drawRect(ret, x, y, width, scale); + drawRect(res.data(), x, y, width, scale); } } - return ret; + return res; } SDL_Cursor* CursorRepository::Create(const CursorData* cursorInfo, uint8_t scale) { - SDL_Cursor* cursor; - - auto integer_scale = static_cast(round(scale)); + const auto integer_scale = static_cast(round(scale)); auto data = scaleDataArray(cursorInfo->Data, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast(integer_scale)); auto mask = scaleDataArray(cursorInfo->Mask, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast(integer_scale)); - cursor = SDL_CreateCursor( - data, mask, BASE_CURSOR_WIDTH * integer_scale, BASE_CURSOR_HEIGHT * integer_scale, + auto* cursor = SDL_CreateCursor( + data.data(), mask.data(), BASE_CURSOR_WIDTH * integer_scale, BASE_CURSOR_HEIGHT * integer_scale, cursorInfo->HotSpot.X * integer_scale, cursorInfo->HotSpot.Y * integer_scale); - free(data); - free(mask); - return cursor; } From ee129db4e07ae2b28735bdb3d6c05ef6ea248b3b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:14:23 +0300 Subject: [PATCH 051/681] Move static initialization out and fix bounds check --- src/openrct2/peep/Peep.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 6e7fff074e..36f9f1e6a8 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1460,6 +1460,13 @@ void Peep::FormatActionTo(Formatter& ft) const } } +static constexpr const rct_string_id _staffNames[] = { + STR_HANDYMAN_X, + STR_MECHANIC_X, + STR_SECURITY_GUARD_X, + STR_ENTERTAINER_X, +}; + void Peep::FormatNameTo(Formatter& ft) const { if (Name == nullptr) @@ -1467,20 +1474,13 @@ void Peep::FormatNameTo(Formatter& ft) const auto* staff = As(); if (staff != nullptr) { - static constexpr const rct_string_id staffNames[] = { - STR_HANDYMAN_X, - STR_MECHANIC_X, - STR_SECURITY_GUARD_X, - STR_ENTERTAINER_X, - }; - auto staffNameIndex = static_cast(staff->AssignedStaffType); - if (staffNameIndex > sizeof(staffNames)) + if (staffNameIndex >= std::size(_staffNames)) { staffNameIndex = 0; } - ft.Add(staffNames[staffNameIndex]); + ft.Add(_staffNames[staffNameIndex]); ft.Add(Id); } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) From b992951bb22059002b0d5ca15d80894471abc843 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:17:20 +0300 Subject: [PATCH 052/681] Default initialize SortOrder in ListViewColumn --- src/openrct2-ui/scripting/CustomListView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/scripting/CustomListView.h b/src/openrct2-ui/scripting/CustomListView.h index 093148cd58..43eb9edb4d 100644 --- a/src/openrct2-ui/scripting/CustomListView.h +++ b/src/openrct2-ui/scripting/CustomListView.h @@ -41,7 +41,7 @@ namespace OpenRCT2::Ui::Windows struct ListViewColumn { bool CanSort{}; - ColumnSortOrder SortOrder; + ColumnSortOrder SortOrder{}; std::string Header; std::string HeaderTooltip; std::optional RatioWidth{}; From aeb68008fae6b6b33c71f34574a47b4dd281d1a5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:19:18 +0300 Subject: [PATCH 053/681] Fix uninitialized variable in Http.h --- src/openrct2/core/Http.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/openrct2/core/Http.h b/src/openrct2/core/Http.h index 873d9b7e5e..e593518d3d 100644 --- a/src/openrct2/core/Http.h +++ b/src/openrct2/core/Http.h @@ -22,6 +22,7 @@ namespace Http { enum class Status { + Invalid = 0, Ok = 200, NotFound = 404 }; @@ -35,20 +36,20 @@ namespace Http struct Response { - Status status; + Status status{}; std::string content_type; - std::string body = ""; + std::string body; std::map header = {}; - std::string error = ""; + std::string error; }; struct Request { std::string url; - std::map header = {}; + std::map header; Method method = Method::GET; - std::string body = ""; - bool forceIPv4 = false; + std::string body; + bool forceIPv4{}; }; Response Do(const Request& req); @@ -56,7 +57,7 @@ namespace Http inline void DoAsync(const Request& req, std::function fn) { auto thread = std::thread([=]() { - Response res; + Response res{}; try { res = Do(req); From b111e104e3df6976419e4458600fd5a7892a8714 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:21:31 +0300 Subject: [PATCH 054/681] Add missing return statement for the nullptr path --- src/openrct2-ui/windows/Sign.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 28836b9741..f6efda0d8c 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -156,6 +156,7 @@ public: if (tileElement == nullptr) { Close(); + return; } auto bannerCoords = banner->position.ToCoordsXY(); From fbc689818e6b8e2e306a50a2d237b822a75a4b08 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:24:35 +0300 Subject: [PATCH 055/681] Default initialize ErrorMessageArgs in GameAction Result --- src/openrct2/actions/GameAction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 04ac4b2b36..856470f356 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -126,7 +126,7 @@ namespace GameActions GameActions::Status Error = GameActions::Status::Ok; StringVariant ErrorTitle; StringVariant ErrorMessage; - std::array ErrorMessageArgs; + std::array ErrorMessageArgs{}; CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL }; money32 Cost = 0; ExpenditureType Expenditure = ExpenditureType::Count; From 2a3b25af9aaeb9c0937e418a8d955a519dfe5dc6 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 30 Jul 2021 02:52:41 +0300 Subject: [PATCH 056/681] Mark values constexpr in FileAudioSource --- src/openrct2-ui/audio/FileAudioSource.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/audio/FileAudioSource.cpp b/src/openrct2-ui/audio/FileAudioSource.cpp index 60f4087b25..b26257fc64 100644 --- a/src/openrct2-ui/audio/FileAudioSource.cpp +++ b/src/openrct2-ui/audio/FileAudioSource.cpp @@ -68,11 +68,11 @@ namespace OpenRCT2::Audio bool LoadWAV(SDL_RWops* rw) { - const uint32_t DATA = 0x61746164; - const uint32_t FMT = 0x20746D66; - const uint32_t RIFF = 0x46464952; - const uint32_t WAVE = 0x45564157; - const uint16_t pcmformat = 0x0001; + constexpr uint32_t DATA = 0x61746164; + constexpr uint32_t FMT = 0x20746D66; + constexpr uint32_t RIFF = 0x46464952; + constexpr uint32_t WAVE = 0x45564157; + constexpr uint16_t pcmformat = 0x0001; Unload(); @@ -152,10 +152,10 @@ namespace OpenRCT2::Audio { return subchunkSize; } - const uint32_t FACT = 0x74636166; - const uint32_t LIST = 0x5453494c; - const uint32_t BEXT = 0x74786562; - const uint32_t JUNK = 0x4B4E554A; + constexpr uint32_t FACT = 0x74636166; + constexpr uint32_t LIST = 0x5453494c; + constexpr uint32_t BEXT = 0x74786562; + constexpr uint32_t JUNK = 0x4B4E554A; while (subchunkId == FACT || subchunkId == LIST || subchunkId == BEXT || subchunkId == JUNK) { SDL_RWseek(rw, subchunkSize, RW_SEEK_CUR); From 465d1c541446569fec7c627653ff5ea9543eea63 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 30 Jul 2021 20:53:13 +0100 Subject: [PATCH 057/681] Cleanup of Banner related actions (#15126) * Close #15107. Use correct type and provide appropriate error messages * Add further error messages to actions * Apply review comments --- data/language/en-GB.txt | 2 ++ src/openrct2/actions/BannerPlaceAction.cpp | 2 +- src/openrct2/actions/BannerPlaceAction.h | 2 +- src/openrct2/actions/BannerSetNameAction.cpp | 4 ++-- src/openrct2/actions/BannerSetStyleAction.cpp | 16 ++++++++-------- src/openrct2/actions/SignSetNameAction.cpp | 4 ++-- src/openrct2/actions/SignSetStyleAction.cpp | 12 ++++++------ src/openrct2/localisation/StringIds.h | 3 +++ src/openrct2/world/Banner.cpp | 4 ++-- 9 files changed, 27 insertions(+), 22 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 7997547cdc..73618a460e 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3651,6 +3651,8 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Sells: {BLACK}{STRING} STR_6453 :Copy version info +STR_6454 :Can’t rename banner… +STR_6455 :Can’t rename sign… ############# # Scenarios # diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 28a029cc40..88e6860d27 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -38,7 +38,7 @@ BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err, rct_st { } -BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, uint8_t primaryColour) +BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex bannerType, colour_t primaryColour) : _loc(loc) , _bannerType(bannerType) , _primaryColour(primaryColour) diff --git a/src/openrct2/actions/BannerPlaceAction.h b/src/openrct2/actions/BannerPlaceAction.h index 94d9e7feb3..c4195a18ca 100644 --- a/src/openrct2/actions/BannerPlaceAction.h +++ b/src/openrct2/actions/BannerPlaceAction.h @@ -31,7 +31,7 @@ private: public: BannerPlaceAction() = default; - BannerPlaceAction(const CoordsXYZD& loc, uint8_t bannerType, uint8_t primaryColour); + BannerPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex bannerType, colour_t primaryColour); void AcceptParameters(GameActionParameterVisitor & visitor) override; diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index 765acecb42..393fc3e3ad 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -48,7 +48,7 @@ GameActions::Result::Ptr BannerSetNameAction::Query() const if (banner == nullptr) { log_warning("Invalid banner id, banner id = %d", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } return MakeResult(); } @@ -59,7 +59,7 @@ GameActions::Result::Ptr BannerSetNameAction::Execute() const if (banner == nullptr) { log_warning("Invalid banner id, banner id = %d", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } banner->text = _name; diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 035b2bb3e7..6407112795 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -50,7 +50,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (banner == nullptr) { log_error("Invalid banner index: index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } res->Expenditure = ExpenditureType::Landscaping; @@ -62,7 +62,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (tileElement == nullptr) { log_error("Could not find banner index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } switch (_type) @@ -86,12 +86,12 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (tileElement->AsBanner() == nullptr) { log_error("Tile element was not a banner."); - return MakeResult(GameActions::Status::Unknown, STR_NONE); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); } break; default: log_error("Invalid type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } return res; } @@ -104,7 +104,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (banner == nullptr) { log_error("Invalid banner index: index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } res->Expenditure = ExpenditureType::Landscaping; @@ -116,7 +116,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (tileElement == nullptr) { log_error("Could not find banner index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } switch (_type) @@ -133,7 +133,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (bannerElement == nullptr) { log_error("Tile element was not a banner."); - return MakeResult(GameActions::Status::Unknown, STR_NONE); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); } banner->flags &= ~BANNER_FLAG_NO_ENTRY; @@ -148,7 +148,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const } default: log_error("Invalid type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index d13941edd7..92b9145ab7 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -49,7 +49,7 @@ GameActions::Result::Ptr SignSetNameAction::Query() const if (banner == nullptr) { log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } return MakeResult(); } @@ -60,7 +60,7 @@ GameActions::Result::Ptr SignSetNameAction::Execute() const if (banner == nullptr) { log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } if (!_name.empty()) diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index de79708f6b..e38319c71d 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -43,7 +43,7 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (banner == nullptr) { log_error("Invalid banner id. id = ", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } if (_isLarge) @@ -52,12 +52,12 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (tileElement == nullptr) { log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) { log_warning("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } } else @@ -67,7 +67,7 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (!wallElement) { log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } } @@ -80,7 +80,7 @@ GameActions::Result::Ptr SignSetStyleAction::Execute() const if (banner == nullptr) { log_error("Invalid banner id. id = ", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); } CoordsXY coords = banner->position.ToCoordsXY(); @@ -92,7 +92,7 @@ GameActions::Result::Ptr SignSetStyleAction::Execute() const { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { - return MakeResult(GameActions::Status::Unknown, STR_NONE); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); } } else diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 0671d62036..8a4a4ab5e2 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3905,6 +3905,9 @@ enum STR_COPY_BUILD_HASH = 6453, + STR_CANT_RENAME_BANNER = 6454, + STR_CANT_RENAME_SIGN = 6455, + // 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 }; diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 049540f4f0..f51937f5bf 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -424,8 +424,8 @@ Banner* CreateBanner() banner->flags = 0; banner->type = 0; banner->text = {}; - banner->colour = 2; - banner->text_colour = 2; + banner->colour = COLOUR_WHITE; + banner->text_colour = COLOUR_WHITE; } return banner; } From 2febffb721d1dc9d8e9de676aa5e774f8785f5ac Mon Sep 17 00:00:00 2001 From: saad Date: Sat, 31 Jul 2021 00:34:47 +0400 Subject: [PATCH 058/681] Fix #14918 remove whitespace --- src/openrct2-ui/windows/Ride.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index eb1effd045..4d6934a255 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1579,7 +1579,6 @@ static void window_ride_init_viewport(rct_window* w) if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { focus.sprite.sprite_id = ride->vehicles[viewSelectionIndex]; - rct_ride_entry* ride_entry = ride->GetRideEntry(); if (ride_entry && ride_entry->tab_vehicle != 0) { @@ -1601,7 +1600,6 @@ static void window_ride_init_viewport(rct_window* w) else if (viewSelectionIndex >= ride->num_vehicles && viewSelectionIndex < (ride->num_vehicles + ride->num_stations)) { int32_t count = viewSelectionIndex - ride->num_vehicles; - for (const auto& station : ride->stations) { if (!station.Start.isNull()) @@ -1625,7 +1623,6 @@ static void window_ride_init_viewport(rct_window* w) { w->viewport_focus_coordinates.var_480 = 0; } - if (w->number < ride_overall_views.size()) { const auto& view = ride_overall_views[w->number]; From 0df5d3cdf2f0998c19ba2d268d0bc1acd10ee5fc Mon Sep 17 00:00:00 2001 From: saad Date: Sat, 31 Jul 2021 02:07:35 +0400 Subject: [PATCH 059/681] add name to list of contributors --- contributors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.md b/contributors.md index 6938da9026..05b978b783 100644 --- a/contributors.md +++ b/contributors.md @@ -174,6 +174,7 @@ The following people are not part of the development team, but have been contrib * Daniel Karandikar (DKarandikar) * Struan Clark (xtruan) * Kane Shaw (seifer7) +* Saad Rehman (SaadRehmanCS) ## Toolchain * (Balletie) - macOS From 292b8b9ab73887c247554a0e74e1f1003f8500a9 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 31 Jul 2021 04:07:58 +0000 Subject: [PATCH 060/681] Merge Localisation/master into OpenRCT2/develop --- data/language/nl-NL.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 02078d4657..9faa62b71a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -3649,6 +3649,7 @@ STR_6449 :{WINDOW_COLOUR_2}Tracks: STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Verkoopt: {BLACK}{STRING} +STR_6453 :Versie-informatie kopiëren ############# # Scenarios # From 15423acf4af6e29b1066ce2bdd50fe9070eea3b6 Mon Sep 17 00:00:00 2001 From: Basssiiie Date: Sat, 31 Jul 2021 11:00:41 +0200 Subject: [PATCH 061/681] Move ToonTowner mine roofs to mine theme instead of pirate theme --- distribution/changelog.txt | 1 + src/openrct2/object/SmallSceneryObject.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 34567e9393..4ecbea4404 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. +- Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Improved: [#3417] Crash dumps are now placed in their own folder. 0.3.4.1 (2021-07-25) diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index a9aa6d30fd..47c83ecf17 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -215,7 +215,7 @@ ObjectEntryDescriptor SmallSceneryObject::GetScgPiratHeader() const ObjectEntryDescriptor SmallSceneryObject::GetScgMineHeader() const { - return ObjectEntryDescriptor("rct2.scgpirat"); + return ObjectEntryDescriptor("rct2.scgmine"); } ObjectEntryDescriptor SmallSceneryObject::GetScgAbstrHeader() const From 69f0020a62a35f9041492cc562697344b1efc32a Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 31 Jul 2021 13:10:00 +0100 Subject: [PATCH 062/681] =?UTF-8?q?Fix=20#8601:=20Revert=20fix=20to=20TT?= =?UTF-8?q?=E2=80=99s=20base=20blocks,=20for=20support=20blocker=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distribution/changelog.txt | 2 ++ src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/object/SmallSceneryObject.cpp | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4ecbea4404..b42eb9e744 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,8 @@ - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Improved: [#3417] Crash dumps are now placed in their own folder. +- Change: [#8601] Revert ToonTower base block fix to re-enable support +blocking. 0.3.4.1 (2021-07-25) ------------------------------------------------------------------------ diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index cbacc0f88e..444fa20f7c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // 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 static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 47c83ecf17..17cb16a03b 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -158,14 +158,12 @@ void SmallSceneryObject::PerformFixes() auto identifier = GetLegacyIdentifier(); static const auto& scgWalls = Object::GetScgWallsHeader(); - // ToonTowner's base blocks. Make them allow supports on top and put them in the Walls and Roofs group. + // ToonTowner's base blocks. Put them in the Walls and Roofs group. if (identifier == "XXBBCL01" || identifier == "XXBBMD01" || identifier == "ARBASE2 ") { SetPrimarySceneryGroup(scgWalls); - - _legacyType.flags |= SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP; } // ToonTowner's Pirate roofs. Make them show up in the Pirate Theming. From 6b94e81622eae8dac0d0a88bb6f4b32fb82b037f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 31 Jul 2021 07:34:40 -0700 Subject: [PATCH 063/681] Fix dereferencing memory from a temporary object (#15137) --- src/openrct2/config/Config.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index e29069d377..8e2a232172 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -739,7 +739,8 @@ namespace Config desc.filters[1].pattern = "*"; desc.filters[2].name = nullptr; - desc.initial_directory = Platform::GetFolderPath(SPECIAL_FOLDER::USER_HOME).c_str(); + const auto userHomePath = Platform::GetFolderPath(SPECIAL_FOLDER::USER_HOME); + desc.initial_directory = userHomePath.c_str(); return platform_open_common_file_dialog(installerPath, &desc, 4096); } From 660a5f9b023d083b850b38bb9a03eb29f413e012 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sun, 1 Aug 2021 04:07:50 +0000 Subject: [PATCH 064/681] Merge Localisation/master into OpenRCT2/develop --- data/language/de-DE.txt | 3 +++ data/language/fr-FR.txt | 2 ++ data/language/ko-KR.txt | 2 ++ 3 files changed, 7 insertions(+) diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 29976466ed..c6a3e8299f 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -3647,6 +3647,9 @@ STR_6449 :{WINDOW_COLOUR_2}Titel: STR_6450 :{BLACK}„{STRING}“ STR_6451 :{BLACK}„{STRING}“ - {STRING} STR_6452 :{WINDOW_COLOUR_2}Verkauft: {BLACK}{STRING} +STR_6453 :Versionsinfo kopieren +STR_6454 :Kann Banner nicht umbenennen … +STR_6455 :Kann Schild nicht umbenennen … ############# # Scenarios # diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 4b175b3b99..adc8f720db 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -3658,6 +3658,8 @@ STR_6450 :{BLACK}« {STRING} » STR_6451 :{BLACK}« {STRING} » — {STRING} STR_6452 :{WINDOW_COLOUR_2}Vend : {BLACK}{STRING} STR_6453 :Copier les informations de version +STR_6454 :Impossible de renommer la bannière… +STR_6455 :Impossible de renommer le panneau… ############# # Scenarios # diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 16e1ff17fe..0b2aa1aec2 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -3654,6 +3654,8 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}판매: {BLACK}{STRING} STR_6453 :버전 정보 복사 +STR_6454 :팻말 이름을 변경할 수 없습니다… +STR_6455 :팻말 이름을 변경할 수 없습니다… ############# # Scenarios # From bd8d3934e0df5b5ffd4e09560bcc8018d4144710 Mon Sep 17 00:00:00 2001 From: Kane Date: Sun, 1 Aug 2021 17:20:34 +1000 Subject: [PATCH 065/681] Close #15143: Add a shortcut key for Giant Screenshot --- 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/localisation/StringIds.h | 2 ++ 5 files changed, 6 insertions(+) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 73618a460e..80803ef36f 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3653,6 +3653,7 @@ STR_6452 :{WINDOW_COLOUR_2}Sells: {BLACK}{STRING} STR_6453 :Copy version info STR_6454 :Can’t rename banner… STR_6455 :Can’t rename sign… +STR_6456 :Giant Screenshot ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b42eb9e744..527824ffe7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook +- Feature: [#15143] Added a shortcut key for Giant Screenshot. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. diff --git a/src/openrct2-ui/input/ShortcutIds.h b/src/openrct2-ui/input/ShortcutIds.h index 4facaa43ba..16417a30f7 100644 --- a/src/openrct2-ui/input/ShortcutIds.h +++ b/src/openrct2-ui/input/ShortcutIds.h @@ -23,6 +23,7 @@ namespace OpenRCT2::Ui::ShortcutId constexpr std::string_view InterfaceIncreaseSpeed = "interface.misc.increase_speed"; constexpr std::string_view InterfaceToggleToolbars = "interface.misc.toggle_toolbars"; constexpr std::string_view InterfaceScreenshot = "interface.misc.screenshot"; + constexpr std::string_view InterfaceGiantScreenshot = "interface.misc.giant_screenshot"; constexpr std::string_view InterfaceLoadGame = "interface.misc.load_game"; constexpr std::string_view InterfaceSaveGame = "interface.misc.save_game"; constexpr std::string_view InterfaceMute = "interface.misc.mute"; diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index df9b193e9d..662f692f3f 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -773,6 +773,7 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::InterfaceLoadGame, STR_LOAD_GAME, "CTRL+L", []() { ShortcutLoadGame(); }); RegisterShortcut(ShortcutId::InterfaceSaveGame, STR_SAVE_GAME, "CTRL+F10", []() { ShortcutQuickSaveGame(); }); RegisterShortcut(ShortcutId::InterfaceScreenshot, STR_SHORTCUT_SCREENSHOT, "CTRL+S", []() { gScreenshotCountdown = 2; }); + RegisterShortcut(ShortcutId::InterfaceGiantScreenshot, STR_SHORTCUT_GIANT_SCREENSHOT, "CTRL+SHIFT+S", []() { screenshot_giant(); }); RegisterShortcut(ShortcutId::InterfaceMute, STR_SHORTCUT_MUTE_SOUND, []() { OpenRCT2::Audio::ToggleAllSounds(); }); RegisterShortcut(ShortcutId::InterfaceDisableClearance, STR_SHORTCUT_TOGGLE_CLEARANCE_CHECKS, []() { ShortcutToggleClearanceChecks(); }); RegisterShortcut(ShortcutId::MultiplayerChat, STR_SEND_MESSAGE, "C", []() { diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 8a4a4ab5e2..148b2821bf 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3908,6 +3908,8 @@ enum STR_CANT_RENAME_BANNER = 6454, STR_CANT_RENAME_SIGN = 6455, + STR_SHORTCUT_GIANT_SCREENSHOT = 6456, + // 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 9ba19689d7adbccb1ace62f34409a6da8fea5098 Mon Sep 17 00:00:00 2001 From: Kane Date: Sun, 1 Aug 2021 20:55:44 +1000 Subject: [PATCH 066/681] Fix #15148: Track Designs Manager delete confirmation window doesn't display properly (#15150) * Fix #15148: Track Designs Manager delete confirmation window doesn't display properly * Fix #15148: Track Designs Manager delete window doesn't display properly * More descriptive name for window size constants. * More constants usage, and fixed code style. * Fix code formatting. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TrackDesignManage.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 527824ffe7..d30b662143 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,7 @@ - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. +- Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 10d541600d..ffeedee4e8 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -19,6 +19,8 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_STRING; static constexpr const int32_t WH = 44; static constexpr const int32_t WW = 250; +static constexpr const int32_t WH_DELETE_PROMPT = 74; +static constexpr const int32_t WW_DELETE_PROMPT = 250; #pragma region Widgets @@ -42,7 +44,7 @@ static rct_widget window_track_manage_widgets[] = { }; static rct_widget window_track_delete_prompt_widgets[] = { - WINDOW_SHIM(WINDOW_TITLE, WW, WH), + 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 } @@ -93,7 +95,7 @@ rct_window* window_track_manage_open(track_design_file_ref* tdFileRef) window_close_by_class(WC_MANAGE_TRACK_DESIGN); rct_window* w = WindowCreateCentred( - 250, 44, &window_track_manage_events, WC_MANAGE_TRACK_DESIGN, WF_STICK_TO_FRONT | WF_TRANSPARENT); + WW, WH, &window_track_manage_events, WC_MANAGE_TRACK_DESIGN, WF_STICK_TO_FRONT | WF_TRANSPARENT); w->widgets = window_track_manage_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_RENAME) | (1ULL << WIDX_DELETE); WindowInitScrollWidgets(w); @@ -131,6 +133,7 @@ static void window_track_manage_mouseup(rct_window* w, rct_widgetindex widgetInd switch (widgetIndex) { case WIDX_CLOSE: + window_close_by_class(WC_TRACK_DELETE_PROMPT); window_close(w); break; case WIDX_RENAME: @@ -200,8 +203,9 @@ static void window_track_delete_prompt_open() int32_t screenWidth = context_get_width(); int32_t screenHeight = context_get_height(); rct_window* w = WindowCreate( - ScreenCoordsXY(std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - 250) / 2), (screenHeight - 44) / 2), 250, 74, - &window_track_delete_prompt_events, WC_TRACK_DELETE_PROMPT, WF_STICK_TO_FRONT); + ScreenCoordsXY( + std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), + WW_DELETE_PROMPT, WH_DELETE_PROMPT, &window_track_delete_prompt_events, WC_TRACK_DELETE_PROMPT, WF_STICK_TO_FRONT); w->widgets = window_track_delete_prompt_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_RENAME) | (1ULL << WIDX_DELETE); WindowInitScrollWidgets(w); @@ -244,8 +248,8 @@ static void window_track_delete_prompt_paint(rct_window* w, rct_drawpixelinfo* d WindowDrawWidgets(w, dpi); DrawTextWrapped( - dpi, { w->windowPos.x + 125, w->windowPos.y + 28 }, 246, STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, - &_trackDesignFileReference->name, { TextAlignment::CENTRE }); + dpi, { w->windowPos.x + (WW_DELETE_PROMPT / 2), w->windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), + STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, &_trackDesignFileReference->name, { TextAlignment::CENTRE }); } static void window_track_design_list_reload_tracks() From 70d9c1438ef460ccf89aad2e4c8fd07e21aa1ea8 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 10 Apr 2021 16:00:50 +0100 Subject: [PATCH 067/681] Change most things and formatting to money64 --- src/openrct2-ui/interface/Graph.cpp | 29 ++++++----- src/openrct2-ui/interface/Graph.h | 2 +- src/openrct2-ui/windows/Cheats.cpp | 2 +- .../windows/DemolishRidePrompt.cpp | 4 +- src/openrct2-ui/windows/Finances.cpp | 52 +++++++++---------- src/openrct2-ui/windows/Footpath.cpp | 3 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 14 ++--- src/openrct2-ui/windows/Land.cpp | 18 ++++--- src/openrct2-ui/windows/NewCampaign.cpp | 4 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/Park.cpp | 8 +-- src/openrct2-ui/windows/Research.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 19 +++---- src/openrct2-ui/windows/RideList.cpp | 6 +-- src/openrct2-ui/windows/ScenarioSelect.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2/Editor.cpp | 6 +-- src/openrct2/actions/RideCreateAction.cpp | 4 +- .../actions/ScenarioSetSettingAction.cpp | 8 +-- src/openrct2/common.h | 6 +++ src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/localisation/Formatter.h | 1 + src/openrct2/localisation/Formatting.cpp | 10 +++- src/openrct2/localisation/Formatting.h | 2 +- src/openrct2/management/Finance.cpp | 48 ++++++++--------- src/openrct2/management/Finance.h | 34 ++++++------ src/openrct2/paint/Paint.cpp | 5 +- src/openrct2/paint/Paint.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 8 +-- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Ride.h | 6 +-- src/openrct2/scenario/Scenario.cpp | 14 ++--- src/openrct2/scenario/Scenario.h | 8 +-- src/openrct2/scenario/ScenarioRepository.cpp | 10 ++-- src/openrct2/scenario/ScenarioRepository.h | 8 +-- src/openrct2/scripting/Duktape.hpp | 13 +++++ src/openrct2/scripting/ScPark.hpp | 24 ++++----- src/openrct2/scripting/ScScenario.hpp | 22 ++++---- src/openrct2/util/Util.cpp | 14 +++++ src/openrct2/util/Util.h | 2 + src/openrct2/world/MoneyEffect.cpp | 4 +- src/openrct2/world/Park.cpp | 28 +++++----- src/openrct2/world/Park.h | 10 ++-- 45 files changed, 264 insertions(+), 214 deletions(-) diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index 85b3272264..48e5dc233b 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -104,7 +104,7 @@ namespace Graph struct FinancialTooltipInfo { const ScreenCoordsXY coords; - const money32 money{}; + const money64 money{}; }; static constexpr auto ChartMaxDataCount = 64; @@ -122,21 +122,22 @@ static int32_t IndexForCursorAndHistory(const int32_t historyCount, const int32_ } static const ScreenCoordsXY ScreenCoordsForHistoryIndex( - const int32_t index, const money32* history, const int32_t chartX, const int32_t chartY, const int32_t modifier, + const int32_t index, const money64* history, const int32_t chartX, const int32_t chartY, const int32_t modifier, const int32_t offset) { auto coords = ScreenCoordsXY{ chartX + ChartDataWidth * (ChartMaxIndex - index), - chartY + ChartMaxHeight - ((((history[index] >> modifier) + offset) * 170) / 256) }; + chartY + ChartMaxHeight + - (((static_cast(history[index] >> modifier) + offset) * 170) / 256) }; return coords; } static const FinancialTooltipInfo finance_tooltip_info_from_money( - const money32* history, const int32_t historyCount, const int32_t modifier, const int32_t offset, + const money64* history, const int32_t historyCount, const int32_t modifier, const int32_t offset, const ScreenRect& chartFrame, const ScreenCoordsXY& cursorPosition) { if (!chartFrame.Contains(cursorPosition)) { - return { {}, MONEY32_UNDEFINED }; + return { {}, MONEY64_UNDEFINED }; } const auto historyIndex = IndexForCursorAndHistory(historyCount, cursorPosition.x, chartFrame.GetLeft()); @@ -148,7 +149,7 @@ static const FinancialTooltipInfo finance_tooltip_info_from_money( namespace Graph { - static void DrawMonths(rct_drawpixelinfo* dpi, const money32* history, int32_t count, const ScreenCoordsXY& origCoords) + static void DrawMonths(rct_drawpixelinfo* dpi, const money64* history, int32_t count, const ScreenCoordsXY& origCoords) { int32_t i, yearOver32, currentMonth, currentDay; @@ -158,7 +159,7 @@ namespace Graph auto screenCoords = origCoords; for (i = count - 1; i >= 0; i--) { - if (history[i] != MONEY32_UNDEFINED && yearOver32 % 4 == 0) + if (history[i] != MONEY64_UNDEFINED && yearOver32 % 4 == 0) { // Draw month text int32_t monthFormat = DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]; @@ -176,14 +177,14 @@ namespace Graph } static void DrawLineA( - rct_drawpixelinfo* dpi, const money32* history, int32_t count, const ScreenCoordsXY& origCoords, int32_t modifier, + rct_drawpixelinfo* dpi, const money64* history, int32_t count, const ScreenCoordsXY& origCoords, int32_t modifier, int32_t offset) { auto lastCoords = ScreenCoordsXY{ -1, -1 }; auto coords = origCoords; for (int32_t i = count - 1; i >= 0; i--) { - if (history[i] != MONEY32_UNDEFINED) + if (history[i] != MONEY64_UNDEFINED) { coords.y = origCoords.y + 170 - 6 - ((((history[i] >> modifier) + offset) * 170) / 256); @@ -206,14 +207,14 @@ namespace Graph } static void DrawLineB( - rct_drawpixelinfo* dpi, const money32* history, int32_t count, const ScreenCoordsXY& origCoords, int32_t modifier, + rct_drawpixelinfo* dpi, const money64* history, int32_t count, const ScreenCoordsXY& origCoords, int32_t modifier, int32_t offset) { auto lastCoords = ScreenCoordsXY{ -1, -1 }; auto coords = origCoords; for (int32_t i = count - 1; i >= 0; i--) { - if (history[i] != MONEY32_UNDEFINED) + if (history[i] != MONEY64_UNDEFINED) { coords.y = origCoords.y + 170 - 6 - ((((history[i] >> modifier) + offset) * 170) / 256); @@ -233,7 +234,7 @@ namespace Graph } static void DrawHoveredValue( - rct_drawpixelinfo* dpi, const money32* history, const int32_t historyCount, const ScreenCoordsXY& screenCoords, + rct_drawpixelinfo* dpi, const money64* history, const int32_t historyCount, const ScreenCoordsXY& screenCoords, const int32_t modifier, const int32_t offset) { const auto cursorPosition = context_get_cursor_position_scaled(); @@ -247,7 +248,7 @@ namespace Graph const auto info = finance_tooltip_info_from_money( history, ChartMaxDataCount, modifier, offset, chartFrame, cursorPosition); - if (info.money == MONEY32_UNDEFINED) + if (info.money == MONEY64_UNDEFINED) { return; } @@ -270,7 +271,7 @@ namespace Graph } void Draw( - rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const ScreenCoordsXY& screenCoords, + rct_drawpixelinfo* dpi, const money64* history, const int32_t count, const ScreenCoordsXY& screenCoords, const int32_t modifier, const int32_t offset) { DrawMonths(dpi, history, count, screenCoords); diff --git a/src/openrct2-ui/interface/Graph.h b/src/openrct2-ui/interface/Graph.h index 296c41ba88..509f19a5fd 100644 --- a/src/openrct2-ui/interface/Graph.h +++ b/src/openrct2-ui/interface/Graph.h @@ -18,7 +18,7 @@ namespace Graph { void Draw(rct_drawpixelinfo* dpi, uint8_t* history, int32_t count, const ScreenCoordsXY& screenPos); void Draw( - rct_drawpixelinfo* dpi, const money32* history, const int32_t count, const ScreenCoordsXY& coords, + rct_drawpixelinfo* dpi, const money64* history, const int32_t count, const ScreenCoordsXY& coords, const int32_t modifier, const int32_t offset); } // namespace Graph diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 03ad9bb394..1cce45704d 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -616,7 +616,7 @@ public: { auto colour = colours[1]; auto ft = Formatter(); - ft.Add(_moneySpinnerValue); + ft.Add(_moneySpinnerValue); if (IsWidgetDisabled(WIDX_MONEY_SPINNER)) { colour |= COLOUR_FLAG_INSET; diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index e79477b548..395bd145cf 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -167,7 +167,7 @@ static void window_ride_demolish_paint(rct_window* w, rct_drawpixelinfo* dpi) auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID : STR_DEMOLISH_RIDE_ID_MONEY; auto ft = Formatter(); ride->FormatNameTo(ft); - ft.Add(_demolishRideCost); + ft.Add(_demolishRideCost); ScreenCoordsXY stringCoords(w->windowPos.x + WW / 2, w->windowPos.y + (WH / 2) - 3); DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); @@ -184,7 +184,7 @@ static void window_ride_refurbish_paint(rct_window* w, rct_drawpixelinfo* dpi) auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY : STR_REFURBISH_RIDE_ID_MONEY; auto ft = Formatter(); ride->FormatNameTo(ft); - ft.Add(_demolishRideCost / 2); + ft.Add(_demolishRideCost / 2); ScreenCoordsXY stringCoords(w->windowPos.x + WW / 2, w->windowPos.y + (WH / 2) - 3); DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 16ee1e81b9..650dfb284b 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -515,7 +515,7 @@ static void window_finances_summary_invalidate(rct_window* w) window_finances_set_pressed_tab(w); auto ft = Formatter::Common(); ft.Increment(6); - ft.Add(gBankLoan); + ft.Add(gBankLoan); } /** @@ -566,9 +566,9 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi) // Objective related financial information if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) { - money32 lastMonthProfit = finance_get_last_month_shop_profit(); + auto lastMonthProfit = finance_get_last_month_shop_profit(); ft = Formatter(); - ft.Add(lastMonthProfit); + ft.Add(lastMonthProfit); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, ft); } @@ -621,17 +621,17 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo screenCoords.y += 14; // Month expenditures - money32 profit = 0; + money64 profit = 0; for (int32_t j = 0; j < static_cast(ExpenditureType::Count); j++) { - money32 expenditure = gExpenditureTable[i][j]; + auto expenditure = gExpenditureTable[i][j]; if (expenditure != 0) { profit += expenditure; const rct_string_id format = expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE; ft = Formatter(); - ft.Add(expenditure); + ft.Add(expenditure); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); } @@ -642,7 +642,7 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo // Month profit const rct_string_id format = profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE; ft = Formatter(); - ft.Add(profit); + ft.Add(profit); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); gfx_fill_rect( @@ -713,7 +713,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; // Cash (less loan) - money32 cashLessLoan = gCash - gBankLoan; + auto cashLessLoan = gCash - gBankLoan; DrawTextBasic( dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, @@ -728,8 +728,8 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin int32_t yAxisScale = 0; for (int32_t i = 0; i < 64; i++) { - money32 balance = gCashHistory[i]; - if (balance == MONEY32_UNDEFINED) + auto balance = gCashHistory[i]; + if (balance == MONEY64_UNDEFINED) continue; // Modifier balance then keep halving until less than 127 pixels @@ -743,12 +743,12 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin // Y axis labels auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money32 axisBase; + money64 axisBase; for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) { - money32 axisValue = axisBase << yAxisScale; + auto axisValue = axisBase << yAxisScale; auto ft = Formatter(); - ft.Add(axisValue); + ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -821,7 +821,7 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; // Park value - money32 parkValue = gParkValue; + auto parkValue = gParkValue; DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, &parkValue); // Graph @@ -831,8 +831,8 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli int32_t yAxisScale = 0; for (int32_t i = 0; i < 64; i++) { - money32 balance = gParkValueHistory[i]; - if (balance == MONEY32_UNDEFINED) + auto balance = gParkValueHistory[i]; + if (balance == MONEY64_UNDEFINED) continue; // Modifier balance then keep halving until less than 255 pixels @@ -846,12 +846,12 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli // Y axis labels auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money32 axisBase; + money64 axisBase; for (axisBase = MONEY(24, 00); axisBase >= MONEY(0, 00); axisBase -= MONEY(6, 00)) { - money32 axisValue = axisBase << yAxisScale; + auto axisValue = axisBase << yAxisScale; auto ft = Formatter(); - ft.Add(axisValue); + ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -923,7 +923,7 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; // Weekly profit - money32 weeklyPofit = gCurrentProfit; + auto weeklyPofit = gCurrentProfit; DrawTextBasic( dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, weeklyPofit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, &weeklyPofit); @@ -935,8 +935,8 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* int32_t yAxisScale = 0; for (int32_t i = 0; i < 64; i++) { - money32 balance = gWeeklyProfitHistory[i]; - if (balance == MONEY32_UNDEFINED) + auto balance = gWeeklyProfitHistory[i]; + if (balance == MONEY64_UNDEFINED) continue; // Modifier balance then keep halving until less than 127 pixels @@ -950,12 +950,12 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* // Y axis labels auto screenPos = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money32 axisBase; + money64 axisBase; for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) { - money32 axisValue = axisBase << yAxisScale; + money64 axisValue = axisBase << yAxisScale; auto ft = Formatter(); - ft.Add(axisValue); + ft.Add(axisValue); DrawTextBasic( dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontSpriteBase::SMALL, TextAlignment::RIGHT }); @@ -1117,7 +1117,7 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp if (campaignButton->type != WindowWidgetType::Empty) { // Draw button text - money32 pricePerWeek = AdvertisingCampaignPricePerWeek[i]; + money64 pricePerWeek = AdvertisingCampaignPricePerWeek[i]; DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, &pricePerWeek); diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index bd14160bb9..910ddf5218 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -633,7 +633,8 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) { if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &_window_footpath_cost, { TextAlignment::CENTRE }); + money64 cost = _window_footpath_cost; + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &cost, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 4f65f9a81b..097d5bc3c5 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -414,7 +414,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo* dpi, r : NOT_TRANSLUCENT(w->colours[0])); rct_string_id stringId = gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; auto ft = Formatter(); - ft.Add(gCash); + ft.Add(gCash); DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 8f379285be..b201bc6fb9 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1657,7 +1657,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Cash in pocket { auto ft = Formatter(); - ft.Add(peep->CashInPocket); + ft.Add(peep->CashInPocket); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -1665,7 +1665,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Cash spent { auto ft = Formatter(); - ft.Add(peep->CashSpent); + ft.Add(peep->CashSpent); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); screenCoords.y += LIST_ROW_HEIGHT * 2; } @@ -1677,14 +1677,14 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Paid to enter { auto ft = Formatter(); - ft.Add(peep->PaidToEnter); + 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->PaidOnRides); ft.Add(peep->GuestNumRides); if (peep->GuestNumRides != 1) { @@ -1699,7 +1699,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Paid on food { auto ft = Formatter(); - ft.Add(peep->PaidOnFood); + ft.Add(peep->PaidOnFood); ft.Add(peep->AmountOfFood); if (peep->AmountOfFood != 1) { @@ -1715,7 +1715,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Paid on drinks { auto ft = Formatter(); - ft.Add(peep->PaidOnDrink); + ft.Add(peep->PaidOnDrink); ft.Add(peep->AmountOfDrinks); if (peep->AmountOfDrinks != 1) { @@ -1730,7 +1730,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Paid on souvenirs { auto ft = Formatter(); - ft.Add(peep->PaidOnSouvenirs); + ft.Add(peep->PaidOnSouvenirs); ft.Add(peep->AmountOfSouvenirs); if (peep->AmountOfSouvenirs != 1) { diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 609e3fdfb7..ffda0b7008 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -256,7 +256,7 @@ public: { ScreenCoordsXY screenCoords; int32_t numTiles; - money32 price; + money64 price; rct_widget* previewWidget = &widgets[WIDX_PREVIEW]; DrawWidgets(dpi); @@ -284,12 +284,18 @@ public: { // Draw raise cost amount if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &gLandToolRaiseCost, { TextAlignment::CENTRE }); + { + price = gLandToolRaiseCost; + DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &price, { TextAlignment::CENTRE }); + } screenCoords.y += 10; // Draw lower cost amount if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &gLandToolLowerCost, { TextAlignment::CENTRE }); + { + price = gLandToolLowerCost; + DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &price, { TextAlignment::CENTRE }); + } screenCoords.y += 50; // Draw paint price @@ -302,17 +308,17 @@ public: objManager.GetLoadedObject(ObjectType::TerrainSurface, gLandToolTerrainSurface)); if (surfaceObj != nullptr) { - price += numTiles * surfaceObj->Price; + price += numTiles * static_cast(surfaceObj->Price); } } if (gLandToolTerrainEdge != OBJECT_ENTRY_INDEX_NULL) - price += numTiles * 100; + price += numTiles * 100LL; if (price != 0) { auto ft = Formatter(); - ft.Add(price); + ft.Add(price); DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft.Data(), { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 00940518e9..3be0a7a6ed 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -353,12 +353,12 @@ public: screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; // Price per week - money32 pricePerWeek = AdvertisingCampaignPricePerWeek[campaign.campaign_type]; + money64 pricePerWeek = AdvertisingCampaignPricePerWeek[campaign.campaign_type]; DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, &pricePerWeek); screenCoords.y += 13; // Total price - money32 totalPrice = AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks; + money64 totalPrice = AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks; DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, &totalPrice); } }; diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 3dbde5e4c3..6bdcc02b25 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -942,7 +942,7 @@ static void window_new_ride_paint_ride_information( { // Get price of ride int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece; - money32 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; + money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; price *= TrackPricing[unk2]; price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; @@ -952,7 +952,7 @@ static void window_new_ride_paint_ride_information( stringId = STR_NEW_RIDE_COST_FROM; ft = Formatter(); - ft.Add(price); + ft.Add(price); DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ width, 51 }, stringId, ft, { TextAlignment::RIGHT }); } } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index d8af2509a8..49afa0557a 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1183,7 +1183,7 @@ static void window_park_price_paint(rct_window* w, rct_drawpixelinfo* dpi) + ScreenCoordsXY{ w->widgets[WIDX_PAGE_BACKGROUND].left + 4, w->widgets[WIDX_PAGE_BACKGROUND].top + 30 }; DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, &gTotalIncomeFromAdmissions); - money32 parkEntranceFee = park_get_entrance_fee(); + money64 parkEntranceFee = park_get_entrance_fee(); auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PRICE].left + 1, w->widgets[WIDX_PRICE].top + 1 }; DrawTextBasic(dpi, screenCoords, stringId, &parkEntranceFee, { w->colours[1] }); @@ -1489,14 +1489,14 @@ static void window_park_objective_paint(rct_window* w, rct_drawpixelinfo* dpi) if (gScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) ft.Add(gScenarioObjective.MinimumExcitement); else - ft.Add(gScenarioObjective.Currency); + ft.Add(gScenarioObjective.Currency); } screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gScenarioObjective.Type], ft); screenCoords.y += 5; // Objective outcome - if (gScenarioCompletedCompanyValue != MONEY32_UNDEFINED) + if (gScenarioCompletedCompanyValue != MONEY64_UNDEFINED) { if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) { @@ -1507,7 +1507,7 @@ static void window_park_objective_paint(rct_window* w, rct_drawpixelinfo* dpi) { // Objective completed ft = Formatter(); - ft.Add(gScenarioCompletedCompanyValue); + ft.Add(gScenarioCompletedCompanyValue); DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft); } } diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index b3fea5afaf..446b83c243 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -561,7 +561,7 @@ void window_research_funding_page_paint(rct_window* w, rct_drawpixelinfo* dpi, r return; int32_t currentResearchLevel = gResearchFundingLevel; - money32 currentResearchCostPerWeek = research_cost_table[currentResearchLevel]; + money64 currentResearchCostPerWeek = research_cost_table[currentResearchLevel]; DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ¤tResearchCostPerWeek); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 4d6934a255..cbaef78e8f 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -6507,10 +6507,10 @@ static void window_ride_income_invalidate(rct_window* w) if (ride == nullptr) return; - w->widgets[WIDX_TITLE].text = STR_ARG_14_STRINGID; + w->widgets[WIDX_TITLE].text = STR_ARG_18_STRINGID; auto ft = Formatter::Common(); - ft.Increment(14); + ft.Increment(18); ride->FormatNameTo(ft); auto rideEntry = ride->GetRideEntry(); @@ -6536,11 +6536,10 @@ static void window_ride_income_invalidate(rct_window* w) window_ride_income_widgets[WIDX_SECONDARY_PRICE_LABEL].text = STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO; window_ride_income_widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Empty; - window_ride_income_widgets[WIDX_PRIMARY_PRICE].text = STR_ARG_6_CURRENCY2DP; + window_ride_income_widgets[WIDX_PRIMARY_PRICE].text = STR_BOTTOM_TOOLBAR_CASH; money16 ridePrimaryPrice = ride_get_price(ride); ft.Rewind(); - ft.Increment(6); - ft.Add(ridePrimaryPrice); + ft.Add(ridePrimaryPrice); if (ridePrimaryPrice == 0) window_ride_income_widgets[WIDX_PRIMARY_PRICE].text = STR_FREE; @@ -6591,7 +6590,9 @@ static void window_ride_income_invalidate(rct_window* w) // Set secondary item price window_ride_income_widgets[WIDX_SECONDARY_PRICE].text = STR_RIDE_SECONDARY_PRICE_VALUE; - ft.Add(ride->price[1]); + ft.Rewind(); + ft.Increment(10); + ft.Add(ride->price[1]); if (ride->price[1] == 0) window_ride_income_widgets[WIDX_SECONDARY_PRICE].text = STR_FREE; } @@ -6607,7 +6608,7 @@ static void window_ride_income_invalidate(rct_window* w) static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) { rct_string_id stringId; - money32 profit, costPerHour; + money64 profit, costPerHour; ShopItem primaryItem, secondaryItem; WindowDrawWidgets(w, dpi); @@ -6665,7 +6666,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords.y += 18; // Income per hour - if (ride->income_per_hour != MONEY32_UNDEFINED) + if (ride->income_per_hour != MONEY64_UNDEFINED) { DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, &ride->income_per_hour); screenCoords.y += LIST_ROW_HEIGHT; @@ -6678,7 +6679,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords.y += LIST_ROW_HEIGHT; // Profit per hour - if (ride->profit != MONEY32_UNDEFINED) + if (ride->profit != MONEY64_UNDEFINED) { DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, &ride->profit); screenCoords.y += LIST_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index e61ef1db77..ec9ff7d81a 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -632,7 +632,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, break; case INFORMATION_TYPE_PROFIT: formatSecondary = 0; - if (ride->profit != MONEY32_UNDEFINED) + if (ride->profit != MONEY64_UNDEFINED) { formatSecondary = STR_PROFIT_LABEL; ft.Add(ride->profit); @@ -644,7 +644,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, break; case INFORMATION_TYPE_TOTAL_PROFIT: formatSecondary = 0; - if (ride->total_profit != MONEY32_UNDEFINED) + if (ride->total_profit != MONEY64_UNDEFINED) { formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL; ft.Add(ride->total_profit); @@ -674,7 +674,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, } case INFORMATION_TYPE_INCOME: formatSecondary = 0; - if (ride->income_per_hour != MONEY32_UNDEFINED) + if (ride->income_per_hour != MONEY64_UNDEFINED) { formatSecondary = STR_RIDE_LIST_INCOME_LABEL; ft.Add(ride->income_per_hour); diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index c29d950b22..715fc3c707 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -535,7 +535,7 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi) if (scenario->objective_type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) ft.Add(scenario->objective_arg_2); else - ft.Add(scenario->objective_arg_2); + ft.Add(scenario->objective_arg_2); } screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; @@ -551,7 +551,7 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi) ft = Formatter(); ft.Add(STR_STRING); ft.Add(completedByName); - ft.Add(scenario->highscore->company_value); + ft.Add(scenario->highscore->company_value); screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); } } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 4ffd184587..e52024d075 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1071,7 +1071,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { auto ft = Formatter(); - ft.Add(GetStaffWage(peep->AssignedStaffType)); + ft.Add(GetStaffWage(peep->AssignedStaffType)); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); screenCoords.y += LIST_ROW_HEIGHT; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 52053bf080..e3458544f1 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -286,7 +286,7 @@ public: if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { auto ft = Formatter(); - ft.Add(GetStaffWage(GetSelectedStaffType())); + ft.Add(GetStaffWage(GetSelectedStaffType())); DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft); } diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 18e3262bbf..af4a1fbe30 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -345,12 +345,12 @@ namespace Editor gGuestInitialCash = std::clamp( gGuestInitialCash, static_cast(MONEY(10, 00)), static_cast(MAX_ENTRANCE_FEE)); - gInitialCash = std::min(gInitialCash, 100000); + gInitialCash = std::min(gInitialCash, 100000); finance_reset_cash_to_initial(); - gBankLoan = std::clamp(gBankLoan, MONEY(0, 00), MONEY(5000000, 00)); + gBankLoan = std::clamp(gBankLoan, MONEY(0, 00), MONEY(5000000, 00)); - gMaxBankLoan = std::clamp(gMaxBankLoan, MONEY(0, 00), MONEY(5000000, 00)); + gMaxBankLoan = std::clamp(gMaxBankLoan, MONEY(0, 00), MONEY(5000000, 00)); gBankLoanInterestRate = std::clamp(gBankLoanInterestRate, 5, 80); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index df9fa87135..3b57344c95 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -283,8 +283,8 @@ GameActions::Result::Ptr RideCreateAction::Execute() const ride->no_primary_items_sold = 0; ride->no_secondary_items_sold = 0; ride->last_crash_type = RIDE_CRASH_TYPE_NONE; - ride->income_per_hour = MONEY32_UNDEFINED; - ride->profit = MONEY32_UNDEFINED; + ride->income_per_hour = MONEY64_UNDEFINED; + ride->profit = MONEY64_UNDEFINED; ride->connected_message_throttle = 0; ride->entrance_style = 0; ride->num_block_brakes = 0; diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 6bd4291e86..9f0b58b7ee 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -73,18 +73,18 @@ GameActions::Result::Ptr ScenarioSetSettingAction::Execute() const } break; case ScenarioSetSetting::InitialCash: - gInitialCash = std::clamp(_value, MONEY(0, 00), MONEY(1000000, 00)); + gInitialCash = std::clamp(_value, MONEY(0, 00), MONEY(1000000, 00)); gCash = gInitialCash; window_invalidate_by_class(WC_FINANCES); window_invalidate_by_class(WC_BOTTOM_TOOLBAR); break; case ScenarioSetSetting::InitialLoan: - gBankLoan = std::clamp(_value, MONEY(0, 00), MONEY(5000000, 00)); + gBankLoan = std::clamp(_value, MONEY(0, 00), MONEY(5000000, 00)); gMaxBankLoan = std::max(gBankLoan, gMaxBankLoan); window_invalidate_by_class(WC_FINANCES); break; case ScenarioSetSetting::MaximumLoanSize: - gMaxBankLoan = std::clamp(_value, MONEY(0, 00), MONEY(5000000, 00)); + gMaxBankLoan = std::clamp(_value, MONEY(0, 00), MONEY(5000000, 00)); gBankLoan = std::min(gBankLoan, gMaxBankLoan); window_invalidate_by_class(WC_FINANCES); break; @@ -103,7 +103,7 @@ GameActions::Result::Ptr ScenarioSetSettingAction::Execute() const } break; case ScenarioSetSetting::AverageCashPerGuest: - gGuestInitialCash = std::clamp(_value, MONEY(0, 00), MONEY(1000, 00)); + gGuestInitialCash = std::clamp(_value, MONEY(0, 00), MONEY(1000, 00)); break; case ScenarioSetSetting::GuestInitialHappiness: gGuestInitialHappiness = std::clamp(_value, 40, 250); diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 7b81c78ae6..7592614748 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -141,6 +141,12 @@ using money64 = fixed64_1dp; #define MONEY_FREE MONEY(0, 00) #define MONEY16_UNDEFINED static_cast(static_cast(0xFFFF)) #define MONEY32_UNDEFINED (static_cast(0x80000000)) +#define MONEY64_UNDEFINED (static_cast(0x8000000000000000)) + +static constexpr money64 ToMoney64(money32 value) +{ + return value == MONEY32_UNDEFINED ? MONEY64_UNDEFINED : value; +} using EMPTY_ARGS_VOID_POINTER = void(); using rct_string_id = uint16_t; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 7545d42a93..59d7231374 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -774,7 +774,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "current_loan" && invalidArguments(&invalidArgs, int_valid[0])) { - gBankLoan = std::clamp(MONEY(int_val[0] - (int_val[0] % 1000), 0), MONEY(0, 0), gMaxBankLoan); + gBankLoan = std::clamp(MONEY(int_val[0] - (int_val[0] % 1000), 0), MONEY(0, 0), gMaxBankLoan); console.Execute("get current_loan"); } else if (argv[0] == "max_loan" && invalidArguments(&invalidArgs, int_valid[0])) diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index 49d03febb6..39a968603f 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -82,6 +82,7 @@ public: std::is_same_v::type, int16_t> || std::is_same_v::type, int32_t> || std::is_same_v::type, money32> || + std::is_same_v::type, money64> || std::is_same_v::type, rct_string_id> || std::is_same_v::type, uint16_t> || std::is_same_v::type, uint32_t> || diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 6c64e6e9f6..3cb8188cf7 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -657,6 +657,10 @@ namespace OpenRCT2 { FormatArgument(ss, token, std::get(value)); } + else if (std::holds_alternative(value)) + { + FormatArgument(ss, token, std::get(value)); + } else if (std::holds_alternative(value)) { FormatArgument(ss, token, std::get(value)); @@ -755,11 +759,13 @@ namespace OpenRCT2 case FormatToken::Comma32: case FormatToken::Int32: case FormatToken::Comma2dp32: - case FormatToken::Currency2dp: - case FormatToken::Currency: case FormatToken::Sprite: anyArgs.push_back(ReadFromArgs(args)); break; + case FormatToken::Currency2dp: + case FormatToken::Currency: + anyArgs.push_back(ReadFromArgs(args)); + break; case FormatToken::UInt16: case FormatToken::MonthYear: case FormatToken::Month: diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index cf056c8160..9726a89141 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -145,7 +145,7 @@ namespace OpenRCT2 using FormatBuffer = FormatBufferBase; - using FormatArg_t = std::variant; + using FormatArg_t = std::variant; class FmtString { diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 12f7858baf..dc78081c5d 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -35,20 +35,20 @@ static constexpr const int32_t dword_988E60[static_cast(ExpenditureType 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, }; -money32 gInitialCash; -money32 gCash; -money32 gBankLoan; +money64 gInitialCash; +money64 gCash; +money64 gBankLoan; uint8_t gBankLoanInterestRate; -money32 gMaxBankLoan; -money32 gCurrentExpenditure; -money32 gCurrentProfit; -money32 gHistoricalProfit; -money32 gWeeklyProfitAverageDividend; +money64 gMaxBankLoan; +money64 gCurrentExpenditure; +money64 gCurrentProfit; +money64 gHistoricalProfit; +money64 gWeeklyProfitAverageDividend; uint16_t gWeeklyProfitAverageDivisor; -money32 gCashHistory[FINANCE_GRAPH_SIZE]; -money32 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE]; -money32 gParkValueHistory[FINANCE_GRAPH_SIZE]; -money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; +money64 gCashHistory[FINANCE_GRAPH_SIZE]; +money64 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE]; +money64 gParkValueHistory[FINANCE_GRAPH_SIZE]; +money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; /** * Checks the condition if the game is required to use money. @@ -186,9 +186,9 @@ void finance_reset_history() { for (int32_t i = 0; i < FINANCE_GRAPH_SIZE; i++) { - gCashHistory[i] = MONEY32_UNDEFINED; - gWeeklyProfitHistory[i] = MONEY32_UNDEFINED; - gParkValueHistory[i] = MONEY32_UNDEFINED; + gCashHistory[i] = MONEY64_UNDEFINED; + gWeeklyProfitHistory[i] = MONEY64_UNDEFINED; + gParkValueHistory[i] = MONEY64_UNDEFINED; } } @@ -221,7 +221,7 @@ void finance_init() gBankLoanInterestRate = 10; gParkValue = 0; gCompanyValue = 0; - gScenarioCompletedCompanyValue = MONEY32_UNDEFINED; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; gTotalAdmissions = 0; gTotalIncomeFromAdmissions = 0; gScenarioCompletedBy = "?"; @@ -276,22 +276,22 @@ void finance_update_daily_profit() window_invalidate_by_class(WC_FINANCES); } -money32 finance_get_initial_cash() +money64 finance_get_initial_cash() { return gInitialCash; } -money32 finance_get_current_loan() +money64 finance_get_current_loan() { return gBankLoan; } -money32 finance_get_maximum_loan() +money64 finance_get_maximum_loan() { return gMaxBankLoan; } -money32 finance_get_current_cash() +money64 finance_get_current_cash() { return gCash; } @@ -306,7 +306,7 @@ void finance_shift_expenditure_table() // If EXPENDITURE_TABLE_MONTH_COUNT months have passed then is full, sum the oldest month if (gDateMonthsElapsed >= EXPENDITURE_TABLE_MONTH_COUNT) { - money32 sum = 0; + money64 sum = 0; for (uint32_t i = 0; i < static_cast(ExpenditureType::Count); i++) { sum += gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1][i]; @@ -344,12 +344,12 @@ void finance_reset_cash_to_initial() /** * Gets the last month's profit from food, drink and merchandise. */ -money32 finance_get_last_month_shop_profit() +money64 finance_get_last_month_shop_profit() { - money32 profit = 0; + money64 profit = 0; if (gDateMonthsElapsed != 0) { - money32* lastMonthExpenditure = gExpenditureTable[1]; + const auto* lastMonthExpenditure = gExpenditureTable[1]; profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)]; profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)]; diff --git a/src/openrct2/management/Finance.h b/src/openrct2/management/Finance.h index eea938e838..99a0a5f7b0 100644 --- a/src/openrct2/management/Finance.h +++ b/src/openrct2/management/Finance.h @@ -36,26 +36,26 @@ enum class ExpenditureType : int32_t extern const money32 research_cost_table[RESEARCH_FUNDING_COUNT]; -extern money32 gInitialCash; -extern money32 gCash; -extern money32 gBankLoan; +extern money64 gInitialCash; +extern money64 gCash; +extern money64 gBankLoan; extern uint8_t gBankLoanInterestRate; -extern money32 gMaxBankLoan; -extern money32 gCurrentExpenditure; -extern money32 gCurrentProfit; +extern money64 gMaxBankLoan; +extern money64 gCurrentExpenditure; +extern money64 gCurrentProfit; /** * The total profit for the entire scenario that precedes * the current financial table. */ -extern money32 gHistoricalProfit; +extern money64 gHistoricalProfit; -extern money32 gWeeklyProfitAverageDividend; +extern money64 gWeeklyProfitAverageDividend; extern uint16_t gWeeklyProfitAverageDivisor; -extern money32 gCashHistory[FINANCE_GRAPH_SIZE]; -extern money32 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE]; -extern money32 gParkValueHistory[FINANCE_GRAPH_SIZE]; -extern money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; +extern money64 gCashHistory[FINANCE_GRAPH_SIZE]; +extern money64 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE]; +extern money64 gParkValueHistory[FINANCE_GRAPH_SIZE]; +extern money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; bool finance_check_money_required(uint32_t flags); bool finance_check_affordability(money32 cost, uint32_t flags); @@ -70,9 +70,9 @@ void finance_update_daily_profit(); void finance_shift_expenditure_table(); void finance_reset_cash_to_initial(); -money32 finance_get_initial_cash(); -money32 finance_get_current_loan(); -money32 finance_get_maximum_loan(); -money32 finance_get_current_cash(); +money64 finance_get_initial_cash(); +money64 finance_get_current_loan(); +money64 finance_get_maximum_loan(); +money64 finance_get_current_cash(); -money32 finance_get_last_month_shop_profit(); +money64 finance_get_last_month_shop_profit(); diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index dcec3ea8b0..d39013413c 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -920,7 +920,7 @@ bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int16_t * @param rotation (ebp) */ void PaintFloatingMoneyEffect( - paint_session* session, money32 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, + paint_session* session, money64 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, uint32_t rotation) { auto* ps = session->AllocateStringPaintEntry(); @@ -938,8 +938,7 @@ void PaintFloatingMoneyEffect( ps->string_id = string_id; ps->next = nullptr; - ps->args[0] = amount; - ps->args[1] = y; + std::memcpy(ps->args, &amount, sizeof(amount)); ps->args[2] = 0; ps->args[3] = 0; ps->y_offsets = reinterpret_cast(y_offsets); diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 6b5ff077a2..756567c0e3 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -330,7 +330,7 @@ void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, u bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int16_t x, int16_t y); bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int16_t x, int16_t y); void PaintFloatingMoneyEffect( - paint_session* session, money32 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, + paint_session* session, money64 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, uint32_t rotation); paint_session* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6522fea81d..546368d65c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -280,7 +280,7 @@ public: return true; } - int32_t CorrectRCT1ParkValue(money32 oldParkValue) + money32 CorrectRCT1ParkValue(money32 oldParkValue) { if (oldParkValue == MONEY32_UNDEFINED) { @@ -1327,13 +1327,13 @@ private: gInitialCash = _s4.cash; gCompanyValue = _s4.company_value; - gParkValue = CorrectRCT1ParkValue(_s4.park_value); + gParkValue = ToMoney64(CorrectRCT1ParkValue(_s4.park_value)); gCurrentProfit = _s4.profit; for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) { gCashHistory[i] = _s4.cash_history[i]; - gParkValueHistory[i] = CorrectRCT1ParkValue(_s4.park_value_history[i]); + gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); gWeeklyProfitHistory[i] = _s4.weekly_profit_history[i]; } @@ -2300,7 +2300,7 @@ private: // This is corrected here, but since scenario_objective_currency doubles as minimum excitement rating, // we need to check the goal to avoid affecting scenarios like Volcania. if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) - gScenarioObjective.Currency = CorrectRCT1ParkValue(_s4.scenario_objective_currency); + gScenarioObjective.Currency = ToMoney64(CorrectRCT1ParkValue(_s4.scenario_objective_currency)); else gScenarioObjective.Currency = _s4.scenario_objective_currency; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ee7525c4a5..979c0f1ec5 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -321,7 +321,7 @@ public: { gCashHistory[i] = _s6.balance_history[i]; gWeeklyProfitHistory[i] = _s6.weekly_profit_history[i]; - gParkValueHistory[i] = _s6.park_value_history[i]; + gParkValueHistory[i] = ToMoney64(_s6.park_value_history[i]); } gScenarioCompletedCompanyValue = _s6.completed_company_value; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 521192e014..fb4a202d00 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -309,7 +309,7 @@ public: // Various flags stating whether a window needs to be refreshed uint8_t window_invalidate_flags; uint32_t total_customers; - money32 total_profit; + 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 @@ -359,8 +359,8 @@ public: uint8_t not_fixed_timeout; uint8_t last_crash_type; uint8_t connected_message_throttle; - money32 income_per_hour; - money32 profit; + money64 income_per_hour; + money64 profit; TrackColour track_colour[NUM_COLOUR_SCHEMES]; uint8_t music; uint8_t entrance_style; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 657db21cdd..4f74f49195 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -75,8 +75,8 @@ Objective gScenarioObjective; bool gAllowEarlyCompletionInNetworkPlay; uint16_t gScenarioParkRatingWarningDays; -money32 gScenarioCompletedCompanyValue; -money32 gScenarioCompanyValueRecord; +money64 gScenarioCompletedCompanyValue; +money64 gScenarioCompanyValueRecord; char gScenarioFileName[MAX_PATH]; @@ -144,7 +144,7 @@ void scenario_begin() gCurrentProfit = 0; gWeeklyProfitAverageDividend = 0; gWeeklyProfitAverageDivisor = 0; - gScenarioCompletedCompanyValue = MONEY32_UNDEFINED; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; gTotalAdmissions = 0; gTotalIncomeFromAdmissions = 0; gScenarioCompletedBy = "?"; @@ -197,7 +197,7 @@ void scenario_failure() */ void scenario_success() { - const money32 companyValue = gCompanyValue; + auto companyValue = gCompanyValue; gScenarioCompletedCompanyValue = companyValue; peep_applause(); @@ -928,8 +928,8 @@ ObjectiveStatus Objective::CheckRepayLoanAndParkValue() const ObjectiveStatus Objective::CheckMonthlyFoodIncome() const { - money32* lastMonthExpenditure = gExpenditureTable[1]; - int32_t lastMonthProfit = lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)] + const auto* lastMonthExpenditure = gExpenditureTable[1]; + auto lastMonthProfit = lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)] + lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)] + lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkSales)] + lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkStock)]; @@ -978,7 +978,7 @@ static void scenario_objective_check() */ ObjectiveStatus Objective::Check() const { - if (gScenarioCompletedCompanyValue != MONEY32_UNDEFINED) + if (gScenarioCompletedCompanyValue != MONEY64_UNDEFINED) { return ObjectiveStatus::Undecided; } diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index cb3daaf3dd..4c9513a124 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -373,7 +373,7 @@ struct Objective }; union { - money32 Currency; + money64 Currency; uint16_t MinimumExcitement; // For the "Finish 5 coaster with a minimum excitement rating" objective. }; @@ -423,7 +423,7 @@ enum #define AUTOSAVE_PAUSE 0 #define DEFAULT_NUM_AUTOSAVES_TO_KEEP 10 -static constexpr money32 COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; +static constexpr money64 COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x8000000000000001; extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; @@ -433,8 +433,8 @@ extern random_engine_t gScenarioRand; extern Objective gScenarioObjective; extern bool gAllowEarlyCompletionInNetworkPlay; extern uint16_t gScenarioParkRatingWarningDays; -extern money32 gScenarioCompletedCompanyValue; -extern money32 gScenarioCompanyValueRecord; +extern money64 gScenarioCompletedCompanyValue; +extern money64 gScenarioCompanyValueRecord; extern rct_s6_info gS6Info; extern std::string gScenarioName; diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 9f9aefcd48..822d884cf1 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -318,7 +318,7 @@ private: class ScenarioRepository final : public IScenarioRepository { private: - static constexpr uint32_t HighscoreFileVersion = 1; + static constexpr uint32_t HighscoreFileVersion = 2; std::shared_ptr const _env; ScenarioFileIndex const _fileIndex; @@ -416,7 +416,7 @@ public: return nullptr; } - bool TryRecordHighscore(int32_t language, const utf8* scenarioFileName, money32 companyValue, const utf8* name) override + bool TryRecordHighscore(int32_t language, const utf8* scenarioFileName, money64 companyValue, const utf8* name) override { // Scan the scenarios so we have a fresh list to query. This is to prevent the issue of scenario completions // not getting recorded, see #4951. @@ -598,7 +598,7 @@ private: { auto fs = FileStream(path, FILE_MODE_OPEN); uint32_t fileVersion = fs.ReadValue(); - if (fileVersion != 1) + if (fileVersion != 1 && fileVersion != 2) { Console::Error::WriteLine("Invalid or incompatible highscores file."); return; @@ -612,7 +612,7 @@ private: scenario_highscore_entry* highscore = InsertHighscore(); highscore->fileName = fs.ReadString(); highscore->name = fs.ReadString(); - highscore->company_value = fs.ReadValue(); + highscore->company_value = fileVersion == 1 ? fs.ReadValue() : fs.ReadValue(); highscore->timestamp = fs.ReadValue(); } } @@ -784,7 +784,7 @@ const scenario_index_entry* scenario_repository_get_by_index(size_t index) return repo->GetByIndex(index); } -bool scenario_repository_try_record_highscore(const utf8* scenarioFileName, money32 companyValue, const utf8* name) +bool scenario_repository_try_record_highscore(const utf8* scenarioFileName, money64 companyValue, const utf8* name) { IScenarioRepository* repo = GetScenarioRepository(); return repo->TryRecordHighscore(LocalisationService_GetCurrentLanguage(), scenarioFileName, companyValue, name); diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index 8a1b7b19b8..0ee807a384 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -20,7 +20,7 @@ struct scenario_highscore_entry { utf8* fileName; utf8* name; - money32 company_value; + money64 company_value; datetime64 timestamp; }; @@ -38,7 +38,7 @@ struct scenario_index_entry // Objective uint8_t objective_type; uint8_t objective_arg_1; - int32_t objective_arg_2; + int64_t objective_arg_2; int16_t objective_arg_3; scenario_highscore_entry* highscore = nullptr; @@ -71,7 +71,7 @@ struct IScenarioRepository virtual const scenario_index_entry* GetByPath(const utf8* path) const abstract; virtual bool TryRecordHighscore( - int32_t language, const utf8* scenarioFileName, money32 companyValue, const utf8* name) abstract; + int32_t language, const utf8* scenarioFileName, money64 companyValue, const utf8* name) abstract; }; std::unique_ptr CreateScenarioRepository(const std::shared_ptr& env); @@ -80,5 +80,5 @@ IScenarioRepository* GetScenarioRepository(); void scenario_repository_scan(); size_t scenario_repository_get_count(); const scenario_index_entry* scenario_repository_get_by_index(size_t index); -bool scenario_repository_try_record_highscore(const utf8* scenarioFileName, money32 companyValue, const utf8* name); +bool scenario_repository_try_record_highscore(const utf8* scenarioFileName, money64 companyValue, const utf8* name); void scenario_translate(scenario_index_entry* scenarioEntry); diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index 95de254bb3..de51173220 100644 --- a/src/openrct2/scripting/Duktape.hpp +++ b/src/openrct2/scripting/Duktape.hpp @@ -123,6 +123,13 @@ namespace OpenRCT2::Scripting duk_put_prop_string(_ctx, _idx, name); } + void Set(const char* name, int64_t value) + { + EnsureObjectPushed(); + duk_push_number(_ctx, value); + duk_put_prop_string(_ctx, _idx, name); + } + void Set(const char* name, uint64_t value) { EnsureObjectPushed(); @@ -280,6 +287,12 @@ namespace OpenRCT2::Scripting return DukValue::take_from_stack(ctx); } + template<> inline DukValue ToDuk(duk_context* ctx, const int64_t& value) + { + duk_push_number(ctx, value); + return DukValue::take_from_stack(ctx); + } + template<> inline DukValue ToDuk(duk_context* ctx, const std::string_view& value) { duk_push_lstring(ctx, value.data(), value.size()); diff --git a/src/openrct2/scripting/ScPark.hpp b/src/openrct2/scripting/ScPark.hpp index ba0b65a1e0..18be4cb1f2 100644 --- a/src/openrct2/scripting/ScPark.hpp +++ b/src/openrct2/scripting/ScPark.hpp @@ -247,11 +247,11 @@ namespace OpenRCT2::Scripting class ScPark { public: - money32 cash_get() const + money64 cash_get() const { return gCash; } - void cash_set(money32 value) + void cash_set(money64 value) { ThrowIfGameStateNotMutable(); @@ -280,11 +280,11 @@ namespace OpenRCT2::Scripting } } - money32 bankLoan_get() const + money64 bankLoan_get() const { return gBankLoan; } - void bankLoan_set(money32 value) + void bankLoan_set(money64 value) { ThrowIfGameStateNotMutable(); @@ -296,11 +296,11 @@ namespace OpenRCT2::Scripting } } - money32 maxBankLoan_get() const + money64 maxBankLoan_get() const { return gMaxBankLoan; } - void maxBankLoan_set(money32 value) + void maxBankLoan_set(money64 value) { ThrowIfGameStateNotMutable(); @@ -362,11 +362,11 @@ namespace OpenRCT2::Scripting return gGuestInitialThirst; } - money32 value_get() const + money64 value_get() const { return gParkValue; } - void value_set(money32 value) + void value_set(money64 value) { ThrowIfGameStateNotMutable(); @@ -378,11 +378,11 @@ namespace OpenRCT2::Scripting } } - money32 companyValue_get() const + money64 companyValue_get() const { return gCompanyValue; } - void companyValue_set(money32 value) + void companyValue_set(money64 value) { ThrowIfGameStateNotMutable(); @@ -414,11 +414,11 @@ namespace OpenRCT2::Scripting } } - money32 totalIncomeFromAdmissions_get() const + money64 totalIncomeFromAdmissions_get() const { return gTotalIncomeFromAdmissions; } - void totalIncomeFromAdmissions_set(money32 value) + void totalIncomeFromAdmissions_set(money64 value) { ThrowIfGameStateNotMutable(); diff --git a/src/openrct2/scripting/ScScenario.hpp b/src/openrct2/scripting/ScScenario.hpp index 5a2174a846..4d47ea3403 100644 --- a/src/openrct2/scripting/ScScenario.hpp +++ b/src/openrct2/scripting/ScScenario.hpp @@ -107,7 +107,7 @@ namespace OpenRCT2::Scripting } } - money32 excitement_get() + money64 excitement_get() { if (gScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) { @@ -116,7 +116,7 @@ namespace OpenRCT2::Scripting return 0; } - void excitement_set(money32 value) + void excitement_set(money64 value) { ThrowIfGameStateNotMutable(); if (gScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) @@ -125,7 +125,7 @@ namespace OpenRCT2::Scripting } } - money32 parkValue_get() + money64 parkValue_get() { if (gScenarioObjective.Type == OBJECTIVE_PARK_VALUE_BY || gScenarioObjective.Type == OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE) @@ -135,7 +135,7 @@ namespace OpenRCT2::Scripting return 0; } - void parkValue_set(money32 value) + void parkValue_set(money64 value) { ThrowIfGameStateNotMutable(); if (gScenarioObjective.Type == OBJECTIVE_PARK_VALUE_BY @@ -145,7 +145,7 @@ namespace OpenRCT2::Scripting } } - money32 monthlyIncome_get() + money64 monthlyIncome_get() { if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_RIDE_INCOME || gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) @@ -155,7 +155,7 @@ namespace OpenRCT2::Scripting return 0; } - void monthlyIncome_set(money32 value) + void monthlyIncome_set(money64 value) { ThrowIfGameStateNotMutable(); if (gScenarioObjective.Type == OBJECTIVE_PARK_VALUE_BY @@ -246,7 +246,7 @@ namespace OpenRCT2::Scripting DukValue completedCompanyValue_get() const { auto ctx = GetContext()->GetScriptEngine().GetContext(); - if (gScenarioCompletedCompanyValue == MONEY32_UNDEFINED + if (gScenarioCompletedCompanyValue == MONEY64_UNDEFINED || gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) { return ToDuk(ctx, nullptr); @@ -261,7 +261,7 @@ namespace OpenRCT2::Scripting std::string status_get() const { - if (gScenarioCompletedCompanyValue == MONEY32_UNDEFINED) + if (gScenarioCompletedCompanyValue == MONEY64_UNDEFINED) return "inProgress"; else if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) return "failed"; @@ -271,18 +271,18 @@ namespace OpenRCT2::Scripting { ThrowIfGameStateNotMutable(); if (value == "inProgress") - gScenarioCompletedCompanyValue = MONEY32_UNDEFINED; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; else if (value == "failed") gScenarioCompletedCompanyValue = COMPANY_VALUE_ON_FAILED_OBJECTIVE; else if (value == "completed") gScenarioCompletedCompanyValue = gCompanyValue; } - money32 companyValueRecord_get() const + money64 companyValueRecord_get() const { return gScenarioCompanyValueRecord; } - void companyValueRecord_set(money32 value) + void companyValueRecord_set(money64 value) { ThrowIfGameStateNotMutable(); gScenarioCompanyValueRecord = value; diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 1cd52ab180..78225880b7 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -729,6 +729,12 @@ int32_t add_clamp_int32_t(int32_t value, int32_t value_to_add) return value; } +int64_t add_clamp_int64_t(int64_t value, int64_t value_to_add) +{ + add_clamp_body(value, value_to_add, INT64_MIN, INT64_MAX); + return value; +} + money32 add_clamp_money32(money32 value, money32 value_to_add) { // This function is intended only for clarity, as money32 @@ -737,6 +743,14 @@ money32 add_clamp_money32(money32 value, money32 value_to_add) return add_clamp_int32_t(value, value_to_add); } +money32 add_clamp_money64(money64 value, money64 value_to_add) +{ + // This function is intended only for clarity, as money64 + // is technically the same as int64_t + assert_struct_size(money64, sizeof(int64_t)); + return add_clamp_int64_t(value, value_to_add); +} + #undef add_clamp_body uint8_t lerp(uint8_t a, uint8_t b, float t) diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 5040954e6e..766d60faa1 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -63,7 +63,9 @@ bool util_gzip_compress(FILE* source, FILE* dest); int8_t add_clamp_int8_t(int8_t value, int8_t value_to_add); int16_t add_clamp_int16_t(int16_t value, int16_t value_to_add); int32_t add_clamp_int32_t(int32_t value, int32_t value_to_add); +int64_t add_clamp_int64_t(int64_t value, int64_t value_to_add); money32 add_clamp_money32(money32 value, money32 value_to_add); +money32 add_clamp_money64(money64 value, money64 value_to_add); uint8_t lerp(uint8_t a, uint8_t b, float t); float flerp(float a, float b, float t); diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 4ff854a571..85e328b805 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -133,12 +133,12 @@ void MoneyEffect::Update() sprite_remove(this); } -std::pair MoneyEffect::GetStringId() const +std::pair MoneyEffect::GetStringId() const { rct_string_id spentStringId = Vertical ? STR_MONEY_EFFECT_SPEND_HIGHP : STR_MONEY_EFFECT_SPEND; rct_string_id receiveStringId = Vertical ? STR_MONEY_EFFECT_RECEIVE_HIGHP : STR_MONEY_EFFECT_RECEIVE; rct_string_id stringId = receiveStringId; - money32 outValue = Value; + money64 outValue = Value; if (Value < 0) { outValue *= -1; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 1fb1b4db18..91c2f07206 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -246,12 +246,12 @@ uint16_t Park::GetParkRating() const return gParkRating; } -money32 Park::GetParkValue() const +money64 Park::GetParkValue() const { return gParkValue; } -money32 Park::GetCompanyValue() const +money64 Park::GetCompanyValue() const { return gCompanyValue; } @@ -482,10 +482,10 @@ int32_t Park::CalculateParkRating() const return result; } -money32 Park::CalculateParkValue() const +money64 Park::CalculateParkValue() const { // Sum ride values - money32 result = 0; + money64 result = 0; for (const auto& ride : GetRideManager()) { result += CalculateRideValue(&ride); @@ -497,23 +497,23 @@ money32 Park::CalculateParkValue() const return result; } -money32 Park::CalculateRideValue(const Ride* ride) const +money64 Park::CalculateRideValue(const Ride* ride) const { - money32 result = 0; + money64 result = 0; if (ride != nullptr && ride->value != RIDE_VALUE_UNDEFINED) { const auto& rtd = ride->GetRideTypeDescriptor(); - result = (ride->value * 10) * (ride_customers_in_last_5_minutes(ride) + rtd.BonusValue * 4); + result = (ride->value * 10LL) * (static_cast(ride_customers_in_last_5_minutes(ride)) + rtd.BonusValue * 4); } return result; } -money32 Park::CalculateCompanyValue() const +money64 Park::CalculateCompanyValue() const { - money32 result = gParkValue - gBankLoan; + auto result = gParkValue - gBankLoan; // Clamp addition to prevent overflow - result = add_clamp_money32(result, finance_get_current_cash()); + result = add_clamp_money64(result, finance_get_current_cash()); return result; } @@ -767,20 +767,20 @@ void Park::UpdateHistories() // Update park rating, guests in park and current cash history HistoryPushRecord(gParkRatingHistory, CalculateParkRating() / 4); HistoryPushRecord(gGuestsInParkHistory, std::min(gNumGuestsInPark, 5000) / 20); - HistoryPushRecord(gCashHistory, finance_get_current_cash() - gBankLoan); + HistoryPushRecord(gCashHistory, finance_get_current_cash() - gBankLoan); // Update weekly profit history - money32 currentWeeklyProfit = gWeeklyProfitAverageDividend; + auto currentWeeklyProfit = gWeeklyProfitAverageDividend; if (gWeeklyProfitAverageDivisor != 0) { currentWeeklyProfit /= gWeeklyProfitAverageDivisor; } - HistoryPushRecord(gWeeklyProfitHistory, currentWeeklyProfit); + HistoryPushRecord(gWeeklyProfitHistory, currentWeeklyProfit); gWeeklyProfitAverageDividend = 0; gWeeklyProfitAverageDivisor = 0; // Update park value history - HistoryPushRecord(gParkValueHistory, gParkValue); + HistoryPushRecord(gParkValueHistory, gParkValue); // Invalidate relevant windows auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 8340666370..e998d48104 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -59,16 +59,16 @@ namespace OpenRCT2 bool IsOpen() const; uint16_t GetParkRating() const; - money32 GetParkValue() const; - money32 GetCompanyValue() const; + money64 GetParkValue() const; + money64 GetCompanyValue() const; void Initialise(); void Update(const Date& date); int32_t CalculateParkSize() const; int32_t CalculateParkRating() const; - money32 CalculateParkValue() const; - money32 CalculateCompanyValue() const; + money64 CalculateParkValue() const; + money64 CalculateCompanyValue() const; static uint8_t CalculateGuestInitialHappiness(uint8_t percentage); Guest* GenerateGuest(); @@ -77,7 +77,7 @@ namespace OpenRCT2 void UpdateHistories(); private: - money32 CalculateRideValue(const Ride* ride) const; + money64 CalculateRideValue(const Ride* ride) const; money16 CalculateTotalRideValueForMoney() const; uint32_t CalculateSuggestedMaxGuests() const; uint32_t CalculateGuestGenerationProbability() const; From 407fafbced7bb9c59a48e7b127549dbcae14e44c Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 10 Apr 2021 19:03:55 +0100 Subject: [PATCH 068/681] Fix more money64 issues --- src/openrct2-ui/windows/ClearScenery.cpp | 3 ++- src/openrct2-ui/windows/EditorScenarioOptions.cpp | 13 ++++++------- src/openrct2-ui/windows/RideConstruction.cpp | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 4875ccd888..dd54ca2a75 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -229,8 +229,9 @@ static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) // Draw cost amount if (gClearSceneryCost != MONEY32_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { + money64 value = gClearSceneryCost; screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + w->windowPos.x; screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 5 + 27; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, &gClearSceneryCost, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, &value, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 2647f982c0..07af0e751c 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1316,7 +1316,6 @@ static void window_editor_scenario_options_park_invalidate(rct_window* w) */ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpixelinfo* dpi) { - int32_t arg; ScreenCoordsXY screenCoords{}; rct_string_id stringId; @@ -1331,8 +1330,8 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix // Cost to buy land value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LAND_COST].left + 1, w->widgets[WIDX_LAND_COST].top }; - arg = gLandPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + money64 value = gLandPrice; + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); } if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WindowWidgetType::Empty) @@ -1345,8 +1344,8 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1, w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top }; - arg = gConstructionRightsPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + money64 value = gConstructionRightsPrice; + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); } if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WindowWidgetType::Empty) @@ -1375,8 +1374,8 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix // Entry price value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_ENTRY_PRICE].left + 1, w->widgets[WIDX_ENTRY_PRICE].top }; - arg = gParkEntranceFee; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + money64 value = gParkEntranceFee; + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); } // Climate label diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 6b045d31ab..a89a8b0b21 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2329,7 +2329,8 @@ static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi screenCoords.y += 11; if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, static_cast(&_currentTrackPrice), { TextAlignment::CENTRE }); + money64 value = _currentTrackPrice; + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); } } From 77a46a3d34894c2d94927743b207cce82acfc128 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 11 Apr 2021 17:16:56 +0100 Subject: [PATCH 069/681] Another money64 fix --- src/openrct2-ui/windows/TrackDesignPlace.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 2508daf583..226bac4c0a 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -497,9 +497,8 @@ static void window_track_place_paint(rct_window* w, rct_drawpixelinfo* dpi) // Price if (_window_track_place_last_cost != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, &_window_track_place_last_cost, - { TextAlignment::CENTRE }); + money64 value = _window_track_place_last_cost; + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); } } From 74de598cc06bf12596c21de6171cc3a14804e7d2 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Apr 2021 19:38:35 +0100 Subject: [PATCH 070/681] Fix money formatting on cheat window --- src/openrct2-ui/windows/Cheats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 1cce45704d..5d5932ce5c 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -559,7 +559,7 @@ public: case WINDOW_CHEATS_PAGE_GUESTS: { auto ft = Formatter::Common(); - ft.Add(MONEY(1000, 00)); + ft.Add(MONEY(1000, 00)); SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gCheatsIgnoreRideIntensity); SetCheckboxValue(WIDX_DISABLE_VANDALISM, gCheatsDisableVandalism); SetCheckboxValue(WIDX_DISABLE_LITTERING, gCheatsDisableLittering); From 8af70cf402d077c0032bc0032c75131132d4640b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 9 May 2021 19:44:58 +0200 Subject: [PATCH 071/681] Correctly import ride profits --- src/openrct2/rct1/S4Importer.cpp | 6 +++--- src/openrct2/rct2/S6Importer.cpp | 6 +++--- src/openrct2/ride/Ride.cpp | 6 +++--- src/openrct2/ride/Ride.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 546368d65c..fea362f075 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -958,10 +958,10 @@ private: dst->upkeep_cost = src->upkeep_cost; dst->price[0] = src->price; dst->price[1] = src->price_secondary; - dst->income_per_hour = src->income_per_hour; + dst->income_per_hour = ToMoney64(src->income_per_hour); dst->total_customers = src->total_customers; - dst->profit = src->profit; - dst->total_profit = src->total_profit; + dst->profit = ToMoney64(src->profit); + dst->total_profit = ToMoney64(src->total_profit); dst->value = src->value; for (size_t i = 0; i < std::size(src->num_customers); i++) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 979c0f1ec5..86f3f7f341 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -704,7 +704,7 @@ public: // pad_14E[0x02]; dst->total_customers = src->total_customers; - dst->total_profit = src->total_profit; + dst->total_profit = ToMoney64(src->total_profit); dst->popularity = src->popularity; dst->popularity_time_out = src->popularity_time_out; dst->popularity_next = src->popularity_next; @@ -755,8 +755,8 @@ public: dst->last_crash_type = src->last_crash_type; dst->connected_message_throttle = src->connected_message_throttle; - dst->income_per_hour = src->income_per_hour; - dst->profit = src->profit; + dst->income_per_hour = ToMoney64(src->income_per_hour); + dst->profit = ToMoney64(src->profit); for (uint8_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) { diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 1210e4ce54..dc14648a8e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -337,7 +337,7 @@ void ride_update_favourited_stat() * * rct2: 0x006AC3AB */ -money32 Ride::CalculateIncomePerHour() const +money64 Ride::CalculateIncomePerHour() const { // Get entry by ride to provide better reporting rct_ride_entry* entry = GetRideEntry(); @@ -345,8 +345,8 @@ money32 Ride::CalculateIncomePerHour() const { return 0; } - money32 customersPerHour = ride_customers_per_hour(this); - money32 priceMinusCost = ride_get_price(this); + auto customersPerHour = ride_customers_per_hour(this); + money64 priceMinusCost = ride_get_price(this); ShopItem currentShopItem = entry->shop_item[0]; if (currentShopItem != ShopItem::None) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index fb4a202d00..855a42b128 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -393,7 +393,7 @@ private: void UpdateQueueLength(StationIndex stationIndex); bool CreateVehicles(const CoordsXYE& element, bool isApplying); void MoveTrainsToBlockBrakes(TrackElement* firstBlock); - money32 CalculateIncomePerHour() const; + money64 CalculateIncomePerHour() const; void ChainQueues() const; void ConstructMissingEntranceOrExit() const; From f3337de260142739bdba938a53769e3e778d6fd7 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 9 May 2021 20:04:04 +0200 Subject: [PATCH 072/681] Fix weekly profit import --- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/scenario/Scenario.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fea362f075..643456e4dc 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1334,7 +1334,7 @@ private: { gCashHistory[i] = _s4.cash_history[i]; gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); - gWeeklyProfitHistory[i] = _s4.weekly_profit_history[i]; + gWeeklyProfitHistory[i] = ToMoney64(_s4.weekly_profit_history[i]); } for (size_t i = 0; i < RCT12_EXPENDITURE_TABLE_MONTH_COUNT; i++) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 86f3f7f341..336aa41207 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -311,7 +311,7 @@ public: gCurrentExpenditure = _s6.current_expenditure; gCurrentProfit = _s6.current_profit; - gWeeklyProfitAverageDividend = _s6.weekly_profit_average_dividend; + gWeeklyProfitAverageDividend = ToMoney64(_s6.weekly_profit_average_dividend); gWeeklyProfitAverageDivisor = _s6.weekly_profit_average_divisor; // pad_0135833A @@ -320,7 +320,7 @@ public: for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) { gCashHistory[i] = _s6.balance_history[i]; - gWeeklyProfitHistory[i] = _s6.weekly_profit_history[i]; + gWeeklyProfitHistory[i] = ToMoney64(_s6.weekly_profit_history[i]); gParkValueHistory[i] = ToMoney64(_s6.park_value_history[i]); } diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 4c9513a124..e3a74c6977 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -194,7 +194,7 @@ struct rct_s6_data // SC6[11] money32 current_expenditure; money32 current_profit; - uint32_t weekly_profit_average_dividend; + money32 weekly_profit_average_dividend; uint16_t weekly_profit_average_divisor; uint8_t pad_0135833A[2]; From 7f4927ced6908150f2f653b6d721598d66301428 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 9 May 2021 20:16:40 +0200 Subject: [PATCH 073/681] More money64 fixes --- src/openrct2/rct1/RCT1.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 22 +++++++++++----------- src/openrct2/rct2/S6Importer.cpp | 26 +++++++++++++------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 87e20d2334..e0dbcb6ddb 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -633,7 +633,7 @@ struct rct1_s4 money32 weekly_profit_history[RCT12_FINANCE_GRAPH_SIZE]; money32 park_value; money32 park_value_history[RCT12_FINANCE_GRAPH_SIZE]; - uint32_t completed_company_value; + money32 completed_company_value; uint32_t num_admissions; money32 admission_total_income; money32 company_value; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 643456e4dc..8b52b87f83 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1319,20 +1319,20 @@ private: gLandPrice = _s4.land_price; gConstructionRightsPrice = _s4.construction_rights_price; - gCash = _s4.cash; - gBankLoan = _s4.loan; - gMaxBankLoan = _s4.max_loan; + gCash = ToMoney64(_s4.cash); + gBankLoan = ToMoney64(_s4.loan); + gMaxBankLoan = ToMoney64(_s4.max_loan); // It's more like 1.33%, but we can only use integers. Can be fixed once we have our own save format. gBankLoanInterestRate = 1; - gInitialCash = _s4.cash; + gInitialCash = ToMoney64(_s4.cash); - gCompanyValue = _s4.company_value; + gCompanyValue = ToMoney64(_s4.company_value); gParkValue = ToMoney64(CorrectRCT1ParkValue(_s4.park_value)); - gCurrentProfit = _s4.profit; + gCurrentProfit = ToMoney64(_s4.profit); for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) { - gCashHistory[i] = _s4.cash_history[i]; + gCashHistory[i] = ToMoney64(_s4.cash_history[i]); gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); gWeeklyProfitHistory[i] = ToMoney64(_s4.weekly_profit_history[i]); } @@ -1341,14 +1341,14 @@ private: { for (size_t j = 0; j < RCT12_EXPENDITURE_TYPE_COUNT; j++) { - gExpenditureTable[i][j] = _s4.expenditure[i][j]; + gExpenditureTable[i][j] = ToMoney64(_s4.expenditure[i][j]); } } - gCurrentExpenditure = _s4.total_expenditure; + gCurrentExpenditure = ToMoney64(_s4.total_expenditure); - gScenarioCompletedCompanyValue = _s4.completed_company_value; + gScenarioCompletedCompanyValue = ToMoney64(_s4.completed_company_value); gTotalAdmissions = _s4.num_admissions; - gTotalIncomeFromAdmissions = _s4.admission_total_income; + gTotalIncomeFromAdmissions = ToMoney64(_s4.admission_total_income); // TODO marketing campaigns not working static_assert( diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 336aa41207..b2ae988bbf 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -230,8 +230,8 @@ public: ImportTileElements(); ImportEntities(); - gInitialCash = _s6.initial_cash; - gBankLoan = _s6.current_loan; + gInitialCash = ToMoney64(_s6.initial_cash); + gBankLoan = ToMoney64(_s6.current_loan); gParkFlags = _s6.park_flags; gParkEntranceFee = _s6.park_entrance_fee; // rct1_park_entrance_x @@ -256,7 +256,7 @@ public: { for (size_t j = 0; j < RCT12_EXPENDITURE_TYPE_COUNT; j++) { - gExpenditureTable[i][j] = _s6.expenditure_table[i][j]; + gExpenditureTable[i][j] = ToMoney64(_s6.expenditure_table[i][j]); } } @@ -293,7 +293,7 @@ public: gParkSize = _s6.park_size; _guestGenerationProbability = _s6.guest_generation_probability; gTotalRideValueForMoney = _s6.total_ride_value_for_money; - gMaxBankLoan = _s6.maximum_loan; + gMaxBankLoan = ToMoney64(_s6.maximum_loan); gGuestInitialCash = _s6.guest_initial_cash; gGuestInitialHunger = _s6.guest_initial_hunger; gGuestInitialThirst = _s6.guest_initial_thirst; @@ -309,25 +309,25 @@ public: gScenarioObjective.NumGuests = _s6.objective_guests; ImportMarketingCampaigns(); - gCurrentExpenditure = _s6.current_expenditure; - gCurrentProfit = _s6.current_profit; + gCurrentExpenditure = ToMoney64(_s6.current_expenditure); + gCurrentProfit = ToMoney64(_s6.current_profit); gWeeklyProfitAverageDividend = ToMoney64(_s6.weekly_profit_average_dividend); gWeeklyProfitAverageDivisor = _s6.weekly_profit_average_divisor; // pad_0135833A - gParkValue = _s6.park_value; + gParkValue = ToMoney64(_s6.park_value); for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) { - gCashHistory[i] = _s6.balance_history[i]; + gCashHistory[i] = ToMoney64(_s6.balance_history[i]); gWeeklyProfitHistory[i] = ToMoney64(_s6.weekly_profit_history[i]); gParkValueHistory[i] = ToMoney64(_s6.park_value_history[i]); } - gScenarioCompletedCompanyValue = _s6.completed_company_value; + gScenarioCompletedCompanyValue = ToMoney64(_s6.completed_company_value); gTotalAdmissions = _s6.total_admissions; - gTotalIncomeFromAdmissions = _s6.income_from_admissions; - gCompanyValue = _s6.company_value; + gTotalIncomeFromAdmissions = ToMoney64(_s6.income_from_admissions); + gCompanyValue = ToMoney64(_s6.company_value); std::memcpy(gPeepWarningThrottle, _s6.peep_warning_throttle, sizeof(_s6.peep_warning_throttle)); // Awards @@ -348,10 +348,10 @@ public: gScenarioCompanyValueRecord = _s6.completed_company_value_record; // _s6.loan_hash; // pad_013587CA - gHistoricalProfit = _s6.historical_profit; + gHistoricalProfit = ToMoney64(_s6.historical_profit); // pad_013587D4 gScenarioCompletedBy = std::string_view(_s6.scenario_completed_name, sizeof(_s6.scenario_completed_name)); - gCash = DECRYPT_MONEY(_s6.cash); + gCash = ToMoney64(DECRYPT_MONEY(_s6.cash)); // pad_013587FC gParkRatingCasualtyPenalty = _s6.park_rating_casualty_penalty; gMapSizeUnits = _s6.map_size_units; From e56b7ae4a4c1f95d6b1b709c47772d08c7cfab3c Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 10 May 2021 21:54:17 +0100 Subject: [PATCH 074/681] Fix more money64 issues --- src/openrct2-ui/windows/EditorScenarioOptions.cpp | 4 ++-- src/openrct2-ui/windows/GameBottomToolbar.cpp | 4 ++-- src/openrct2-ui/windows/RideList.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 07af0e751c..acea2a32ee 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -970,8 +970,8 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp // Cash per guest value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CASH_PER_GUEST].left + 1, w->widgets[WIDX_CASH_PER_GUEST].top }; - arg = gGuestInitialCash; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &arg); + money64 value = gGuestInitialCash; + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); } // Guest initial happiness label diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 097d5bc3c5..26e35e8d90 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -198,8 +198,8 @@ static OpenRCT2String window_game_bottom_toolbar_tooltip( switch (widgetIndex) { case WIDX_MONEY: - ft.Add(gCurrentProfit); - ft.Add(gParkValue); + ft.Add(gCurrentProfit); + ft.Add(gParkValue); break; case WIDX_PARK_RATING: ft.Add(gParkRating); diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index ec9ff7d81a..3fde2e97d5 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -635,7 +635,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (ride->profit != MONEY64_UNDEFINED) { formatSecondary = STR_PROFIT_LABEL; - ft.Add(ride->profit); + ft.Add(ride->profit); } break; case INFORMATION_TYPE_TOTAL_CUSTOMERS: @@ -647,7 +647,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (ride->total_profit != MONEY64_UNDEFINED) { formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL; - ft.Add(ride->total_profit); + ft.Add(ride->total_profit); } break; case INFORMATION_TYPE_CUSTOMERS: @@ -677,7 +677,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (ride->income_per_hour != MONEY64_UNDEFINED) { formatSecondary = STR_RIDE_LIST_INCOME_LABEL; - ft.Add(ride->income_per_hour); + ft.Add(ride->income_per_hour); } break; case INFORMATION_TYPE_RUNNING_COST: @@ -685,7 +685,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (ride->upkeep_cost != MONEY16_UNDEFINED) { formatSecondary = STR_RIDE_LIST_RUNNING_COST_LABEL; - ft.Add(ride->upkeep_cost * 16); + ft.Add(ride->upkeep_cost * 16); } break; case INFORMATION_TYPE_QUEUE_LENGTH: From 58ae6bbd8a6084aeb081385381138777bf48bd4c Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 11 May 2021 20:29:15 +0100 Subject: [PATCH 075/681] Fix money64 issue in scenario options --- src/openrct2-ui/windows/EditorObjectiveOptions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 5d0759806f..2444f3dcfb 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -790,7 +790,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi { int32_t width; rct_string_id stringId; - uint32_t arg; + uint64_t arg; WindowDrawWidgets(w, dpi); window_editor_objective_options_draw_tab_images(w, dpi); From f1a67dda618d59fe4a4b70415bdbe1f9676e145f Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 13 May 2021 11:16:36 +0200 Subject: [PATCH 076/681] Fix water window cost display --- src/openrct2-ui/windows/Water.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 3c42cdd7ac..2812e2d831 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -158,14 +158,18 @@ public: window_water_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 }; if (gWaterToolRaiseCost != MONEY32_UNDEFINED && gWaterToolRaiseCost != 0) { - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &gWaterToolRaiseCost, { TextAlignment::CENTRE }); + 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 != MONEY32_UNDEFINED && gWaterToolLowerCost != 0) { - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &gWaterToolLowerCost, { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(gWaterToolLowerCost); + DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } } From d78deacb6d6b50c483ad8603f93a2c6bf2f44237 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 24 May 2021 20:04:54 +0100 Subject: [PATCH 077/681] Fix park value objective string for currency 64 --- 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 80803ef36f..a64c2f6992 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -1735,7 +1735,7 @@ 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_2387 :{BLACK}To achieve a park value of at least {POP16}{POP16}{CURRENCY} at the end of {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 From d9003b05ef99626ab3e88232e9ad2cdc7a3a03d5 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 26 May 2021 19:02:47 +0300 Subject: [PATCH 078/681] Use money64 for track design costs --- src/openrct2-ui/windows/InstallTrack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 924e129b88..86007be17c 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -399,7 +399,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi) if (td6->cost != 0) { auto ft = Formatter(); - ft.Add(td6->cost); + ft.Add(td6->cost); DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); } } From c06d37021b22aab16664b3173bd70126e1df8656 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 27 Jul 2021 17:59:49 +0200 Subject: [PATCH 079/681] Change gClearSceneryCost to money64 --- src/openrct2-ui/windows/ClearScenery.cpp | 9 +++++---- src/openrct2-ui/windows/TopToolbar.cpp | 6 +++--- src/openrct2/world/Scenery.cpp | 2 +- src/openrct2/world/Scenery.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index dd54ca2a75..9d3bb975b1 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -88,7 +88,7 @@ rct_window* window_clear_scenery_open() window_push_others_below(window); gLandToolSize = 2; - gClearSceneryCost = MONEY32_UNDEFINED; + gClearSceneryCost = MONEY64_UNDEFINED; gClearSmallScenery = true; gClearLargeScenery = false; @@ -227,11 +227,12 @@ static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) } // Draw cost amount - if (gClearSceneryCost != MONEY32_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) + if (gClearSceneryCost != MONEY64_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - money64 value = gClearSceneryCost; + auto ft = Formatter(); + ft.Add(gClearSceneryCost); screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + w->windowPos.x; screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 5 + 27; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, &value, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index b540eece80..3124475c7e 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1999,9 +1999,9 @@ static uint8_t top_toolbar_tool_update_land_paint(const ScreenCoordsXY& screenPo if (!mapTile) { - if (gClearSceneryCost != MONEY32_UNDEFINED) + if (gClearSceneryCost != MONEY64_UNDEFINED) { - gClearSceneryCost = MONEY32_UNDEFINED; + gClearSceneryCost = MONEY64_UNDEFINED; window_invalidate_by_class(WC_CLEAR_SCENERY); } return state_changed; @@ -2069,7 +2069,7 @@ static void top_toolbar_tool_update_scenery_clear(const ScreenCoordsXY& screenPo auto action = GetClearAction(); auto result = GameActions::Query(&action); - auto cost = (result->Error == GameActions::Status::Ok ? result->Cost : MONEY32_UNDEFINED); + auto cost = (result->Error == GameActions::Status::Ok ? result->Cost : MONEY64_UNDEFINED); if (gClearSceneryCost != cost) { gClearSceneryCost = cost; diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 47c3e0366b..ba8e2b4982 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -50,7 +50,7 @@ int16_t gSceneryShiftPressZOffset; int16_t gSceneryCtrlPressed; int16_t gSceneryCtrlPressZ; -money32 gClearSceneryCost; +money64 gClearSceneryCost; // rct2: 0x009A3E74 const CoordsXY SceneryQuadrantOffsets[] = { { 7, 7 }, { 7, 23 }, { 23, 23 }, { 23, 7 } }; diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index b26027cb3b..f6d8620504 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -277,7 +277,7 @@ extern int16_t gSceneryCtrlPressZ; extern const CoordsXY SceneryQuadrantOffsets[]; -extern money32 gClearSceneryCost; +extern money64 gClearSceneryCost; void init_scenery(); void scenery_update_tile(const CoordsXY& sceneryPos); From c97e8d36f1cfda2338600b51a3e3b25469fff290 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 28 Jul 2021 09:54:42 +0200 Subject: [PATCH 080/681] Fix money effect --- src/openrct2/world/MoneyEffect.cpp | 4 ++-- src/openrct2/world/MoneyEffect.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 85e328b805..149231c19d 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -29,7 +29,7 @@ template<> bool SpriteBase::Is() const * * rct2: 0x0067351F */ -void MoneyEffect::CreateAt(money32 value, const CoordsXYZ& effectPos, bool vertical) +void MoneyEffect::CreateAt(money64 value, const CoordsXYZ& effectPos, bool vertical) { if (value == MONEY(0, 00)) return; @@ -63,7 +63,7 @@ void MoneyEffect::CreateAt(money32 value, const CoordsXYZ& effectPos, bool verti * * rct2: 0x0069C5D0 */ -void MoneyEffect::Create(money32 value, const CoordsXYZ& loc) +void MoneyEffect::Create(money64 value, const CoordsXYZ& loc) { auto offsetLoc = loc; if (loc.isNull()) diff --git a/src/openrct2/world/MoneyEffect.h b/src/openrct2/world/MoneyEffect.h index ba6aa34c81..bd48992c51 100644 --- a/src/openrct2/world/MoneyEffect.h +++ b/src/openrct2/world/MoneyEffect.h @@ -20,13 +20,13 @@ struct MoneyEffect : MiscEntity uint16_t MoveDelay; uint8_t NumMovements; uint8_t Vertical; - money32 Value; + money64 Value; int16_t OffsetX; uint16_t Wiggle; - static void CreateAt(money32 value, const CoordsXYZ& effectPos, bool vertical); - static void Create(money32 value, const CoordsXYZ& loc); + static void CreateAt(money64 value, const CoordsXYZ& effectPos, bool vertical); + static void Create(money64 value, const CoordsXYZ& loc); void Update(); - std::pair GetStringId() const; + std::pair GetStringId() const; void Serialise(DataSerialiser& stream); }; From 676ef7205e5175950c4b2d15402737cfebb60768 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 27 Jul 2021 20:32:27 +0200 Subject: [PATCH 081/681] Change all calls to DrawTextBasic to use Formatter --- src/openrct2-ui/interface/Graph.cpp | 10 +- src/openrct2-ui/scripting/CustomListView.cpp | 2 +- src/openrct2-ui/windows/ClearScenery.cpp | 5 +- src/openrct2-ui/windows/CustomCurrency.cpp | 2 +- .../windows/EditorInventionsList.cpp | 6 +- .../windows/EditorObjectiveOptions.cpp | 33 +-- .../windows/EditorScenarioOptions.cpp | 68 +++--- src/openrct2-ui/windows/Finances.cpp | 41 ++-- src/openrct2-ui/windows/Footpath.cpp | 5 +- src/openrct2-ui/windows/Land.cpp | 18 +- src/openrct2-ui/windows/LandRights.cpp | 9 +- src/openrct2-ui/windows/LoadSave.cpp | 8 +- src/openrct2-ui/windows/Map.cpp | 8 +- src/openrct2-ui/windows/MapGen.cpp | 71 +++--- src/openrct2-ui/windows/Multiplayer.cpp | 16 +- src/openrct2-ui/windows/NewCampaign.cpp | 14 +- src/openrct2-ui/windows/Options.cpp | 44 ++-- src/openrct2-ui/windows/Park.cpp | 21 +- src/openrct2-ui/windows/Research.cpp | 5 +- src/openrct2-ui/windows/Ride.cpp | 206 +++++++++++------- src/openrct2-ui/windows/RideConstruction.cpp | 7 +- src/openrct2-ui/windows/RideList.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 6 +- src/openrct2-ui/windows/SceneryScatter.cpp | 6 +- src/openrct2-ui/windows/ServerList.cpp | 16 +- src/openrct2-ui/windows/TileInspector.cpp | 186 +++++++++------- src/openrct2-ui/windows/TrackDesignPlace.cpp | 5 +- src/openrct2-ui/windows/TrackList.cpp | 69 +++--- src/openrct2-ui/windows/ViewClipping.cpp | 35 +-- src/openrct2-ui/windows/Water.cpp | 6 +- src/openrct2/drawing/Text.cpp | 8 +- src/openrct2/drawing/Text.h | 2 - 32 files changed, 558 insertions(+), 384 deletions(-) diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index 48e5dc233b..d355de70b1 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -162,9 +162,10 @@ namespace Graph if (history[i] != MONEY64_UNDEFINED && yearOver32 % 4 == 0) { // Draw month text - int32_t monthFormat = DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]; + auto ft = Formatter(); + ft.Add(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, &monthFormat, + dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, { FontSpriteBase::SMALL, TextAlignment::CENTRE }); // Draw month mark @@ -260,9 +261,10 @@ namespace Graph gfx_draw_dashed_line(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0); } + auto ft = Formatter(); + ft.Add(info.money); DrawTextBasic( - dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, &info.money, - { TextAlignment::CENTRE }); + dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE }); gfx_fill_rect( dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10); diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index e90060a8e5..d8de3f29c1 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -710,7 +710,7 @@ void CustomListView::PaintSeperator( // Draw string Formatter ft; ft.Add(text); - DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft.Data(), { baseColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE }); // Get string dimensions format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data()); diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 9d3bb975b1..822bcf7e71 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -222,8 +222,9 @@ static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) w->windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() }; if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) { - DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } // Draw cost amount diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 73772f03a3..6f10d2101a 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -241,5 +241,5 @@ static void custom_currency_window_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_string_id stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) ? STR_PREFIX : STR_SUFFIX; - DrawTextBasic(dpi, drawPos, stringId, w, { w->colours[1] }); + DrawTextBasic(dpi, drawPos, stringId, {}, { w->colours[1] }); } diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 527cba02aa..2f95e67c32 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -497,7 +497,6 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo { rct_widget* widget; ResearchItem* researchItem; - rct_string_id stringId; int32_t width; WindowDrawWidgets(w, dpi); @@ -566,8 +565,9 @@ static void window_editor_inventions_list_paint(rct_window* w, rct_drawpixelinfo // Item category screenPos.x = w->windowPos.x + w->widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; - stringId = researchItem->GetCategoryInventionString(); - DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, &stringId); + ft = Formatter(); + ft.Add(researchItem->GetCategoryInventionString()); + DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); } /** diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 2444f3dcfb..b13a2ffcf3 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -790,7 +790,6 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi { int32_t width; rct_string_id stringId; - uint64_t arg; WindowDrawWidgets(w, dpi); window_editor_objective_options_draw_tab_images(w, dpi); @@ -801,8 +800,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi // Objective value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top }; - stringId = ObjectiveDropdownOptionNames[gScenarioObjective.Type]; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); + auto ft = Formatter(); + ft.Add(ObjectiveDropdownOptionNames[gScenarioObjective.Type]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) { @@ -836,34 +836,35 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi // Objective argument 1 value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_1].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_1].top }; + ft = Formatter(); switch (gScenarioObjective.Type) { case OBJECTIVE_GUESTS_BY: case OBJECTIVE_GUESTS_AND_RATING: stringId = STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT; - arg = gScenarioObjective.NumGuests; + ft.Add(gScenarioObjective.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; - arg = gScenarioObjective.Currency; + ft.Add(gScenarioObjective.Currency); break; case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: stringId = STR_WINDOW_OBJECTIVE_VALUE_LENGTH; - arg = gScenarioObjective.MinimumLength; + ft.Add(gScenarioObjective.MinimumLength); break; case OBJECTIVE_FINISH_5_ROLLERCOASTERS: stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING; - arg = gScenarioObjective.MinimumExcitement; + ft.Add(gScenarioObjective.MinimumExcitement); break; default: stringId = STR_WINDOW_OBJECTIVE_VALUE_RATING; - arg = gScenarioObjective.Currency; + ft.Add(gScenarioObjective.Currency); break; } - DrawTextBasic(dpi, screenCoords, stringId, &arg, COLOUR_BLACK); + DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK); } if (w->widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty) @@ -875,8 +876,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi // Objective argument 2 value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_2].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_2].top }; - arg = (gScenarioObjective.Year * MONTH_COUNT) - 1; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, &arg); + ft = Formatter(); + ft.Add((gScenarioObjective.Year * MONTH_COUNT) - 1); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft); } // Park name @@ -887,7 +889,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto parkName = park.Name.c_str(); - auto ft = Formatter(); + ft = Formatter(); ft.Add(STR_STRING); ft.Add(parkName); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft); @@ -897,7 +899,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_SCENARIO_NAME].top }; width = w->widgets[WIDX_SCENARIO_NAME].left - 16; - auto ft = Formatter(); + ft = Formatter(); ft.Add(STR_STRING); ft.Add(gS6Info.name); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); @@ -921,8 +923,9 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi // Scenario category value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top }; - stringId = ScenarioCategoryStringIds[gS6Info.category]; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); + ft = Formatter(); + ft.Add(ScenarioCategoryStringIds[gS6Info.category]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } /** diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index acea2a32ee..fdf8721212 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -690,7 +690,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_CASH].left + 1, w->widgets[WIDX_INITIAL_CASH].top }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gInitialCash); + auto ft = Formatter(); + ft.Add(gInitialCash); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } if (w->widgets[WIDX_INITIAL_LOAN].type != WindowWidgetType::Empty) @@ -700,7 +702,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_LOAN].left + 1, w->widgets[WIDX_INITIAL_LOAN].top }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gBankLoan); + auto ft = Formatter(); + ft.Add(gBankLoan); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } if (w->widgets[WIDX_MAXIMUM_LOAN].type != WindowWidgetType::Empty) @@ -710,7 +714,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_MAXIMUM_LOAN].left + 1, w->widgets[WIDX_MAXIMUM_LOAN].top }; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &gMaxBankLoan); + auto ft = Formatter(); + ft.Add(gMaxBankLoan); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } if (w->widgets[WIDX_INTEREST_RATE].type != WindowWidgetType::Empty) @@ -721,8 +727,9 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_INTEREST_RATE].left + 1, w->widgets[WIDX_INTEREST_RATE].top }; - int16_t interestRate = std::clamp(static_cast(gBankLoanInterestRate), INT16_MIN, INT16_MAX); - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &interestRate); + auto ft = Formatter(); + ft.Add(std::clamp(static_cast(gBankLoanInterestRate), INT16_MIN, INT16_MAX)); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } } @@ -955,7 +962,6 @@ static void window_editor_scenario_options_guests_invalidate(rct_window* w) */ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawpixelinfo* dpi) { - int32_t arg; ScreenCoordsXY screenCoords{}; WindowDrawWidgets(w, dpi); @@ -970,8 +976,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp // Cash per guest value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CASH_PER_GUEST].left + 1, w->widgets[WIDX_CASH_PER_GUEST].top }; - money64 value = gGuestInitialCash; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); + auto ft = Formatter(); + ft.Add(gGuestInitialCash); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Guest initial happiness label @@ -981,8 +988,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp // Guest initial happiness value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].left + 1, w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top }; - arg = (gGuestInitialHappiness * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + auto ft = Formatter(); + ft.Add((gGuestInitialHappiness * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial hunger label screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; @@ -991,8 +999,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp // Guest initial hunger value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; - arg = ((255 - gGuestInitialHunger) * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + ft = Formatter(); + ft.Add(((255 - gGuestInitialHunger) * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial thirst label screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; @@ -1001,8 +1010,9 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp // Guest initial thirst value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_THIRST].left + 1, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; - arg = ((255 - gGuestInitialThirst) * 100) / 255; - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, &arg); + ft = Formatter(); + ft.Add(((255 - gGuestInitialThirst) * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } #pragma endregion @@ -1317,7 +1327,6 @@ static void window_editor_scenario_options_park_invalidate(rct_window* w) static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpixelinfo* dpi) { ScreenCoordsXY screenCoords{}; - rct_string_id stringId; WindowDrawWidgets(w, dpi); window_editor_scenario_options_draw_tab_images(w, dpi); @@ -1330,8 +1339,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix // Cost to buy land value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LAND_COST].left + 1, w->widgets[WIDX_LAND_COST].top }; - money64 value = gLandPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); + auto ft = Formatter(); + ft.Add(gLandPrice); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WindowWidgetType::Empty) @@ -1344,8 +1354,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1, w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top }; - money64 value = gConstructionRightsPrice; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); + auto ft = Formatter(); + ft.Add(gConstructionRightsPrice); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WindowWidgetType::Empty) @@ -1354,15 +1365,16 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].left + 1, w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].top }; + auto ft = Formatter(); // Pay for park and/or rides value if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) - stringId = STR_PAID_ENTRY_PAID_RIDES; + ft.Add(STR_PAID_ENTRY_PAID_RIDES); else if (gParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) - stringId = STR_FREE_PARK_ENTER; + ft.Add(STR_FREE_PARK_ENTER); else - stringId = STR_PAY_PARK_ENTER; + ft.Add(STR_PAY_PARK_ENTER); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } if (w->widgets[WIDX_ENTRY_PRICE].type != WindowWidgetType::Empty) @@ -1374,8 +1386,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix // Entry price value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_ENTRY_PRICE].left + 1, w->widgets[WIDX_ENTRY_PRICE].top }; - money64 value = gParkEntranceFee; - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, &value); + auto ft = Formatter(); + ft.Add(gParkEntranceFee); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Climate label @@ -1384,8 +1397,9 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix // Climate value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CLIMATE].left + 1, w->widgets[WIDX_CLIMATE].top }; - stringId = ClimateNames[static_cast(gClimate)]; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId); + auto ft = Formatter(); + ft.Add(ClimateNames[static_cast(gClimate)]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 650dfb284b..018cb68863 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -560,8 +560,10 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); // Current cash + ft = Formatter(); + ft.Add(gCash); rct_string_id stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, 294 }, stringId, &gCash); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); // Objective related financial information if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) @@ -575,8 +577,12 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi) else { // Park value and company value - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, &gParkValue); - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, &gCompanyValue); + ft = Formatter(); + ft.Add(gParkValue); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft); + ft = Formatter(); + ft.Add(gCompanyValue); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft); } } @@ -714,12 +720,14 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin // Cash (less loan) auto cashLessLoan = gCash - gBankLoan; + 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, - &cashLessLoan); + ft); // Graph gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); @@ -747,7 +755,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) { auto axisValue = axisBase << yAxisScale; - auto ft = Formatter(); + ft = Formatter(); ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, @@ -821,8 +829,9 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; // Park value - auto parkValue = gParkValue; - DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, &parkValue); + auto ft = Formatter(); + ft.Add(gParkValue); + DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft); // Graph gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); @@ -850,7 +859,7 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli for (axisBase = MONEY(24, 00); axisBase >= MONEY(0, 00); axisBase -= MONEY(6, 00)) { auto axisValue = axisBase << yAxisScale; - auto ft = Formatter(); + ft = Formatter(); ft.Add(axisValue); DrawTextBasic( dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, @@ -923,10 +932,11 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* auto graphBottomRight = w->windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; // Weekly profit - auto weeklyPofit = gCurrentProfit; + auto ft = Formatter(); + ft.Add(gCurrentProfit); DrawTextBasic( dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, - weeklyPofit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, &weeklyPofit); + gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft); // Graph gfx_fill_rect_inset(dpi, { graphTopLeft, graphBottomRight }, w->colours[1], INSET_RECT_F_30); @@ -954,7 +964,7 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* for (axisBase = MONEY(12, 00); axisBase >= MONEY(-12, 00); axisBase -= MONEY(6, 00)) { money64 axisValue = axisBase << yAxisScale; - auto ft = Formatter(); + ft = Formatter(); ft.Add(axisValue); DrawTextBasic( dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, @@ -1096,9 +1106,11 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp // Duration uint16_t weeksRemaining = campaign->WeeksLeft; + ft = Formatter(); + ft.Add(weeksRemaining); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, - &weeksRemaining); + ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -1117,9 +1129,10 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp if (campaignButton->type != WindowWidgetType::Empty) { // Draw button text - money64 pricePerWeek = AdvertisingCampaignPricePerWeek[i]; DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, &pricePerWeek); + 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; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 910ddf5218..c548259d2c 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -633,8 +633,9 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) { if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { - money64 cost = _window_footpath_cost; - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &cost, { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(_window_footpath_cost); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index ffda0b7008..b53097bcde 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -264,10 +264,10 @@ public: // Draw number for tool sizes bigger than 7 if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) { + 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, &gLandToolSize, - { TextAlignment::CENTRE }); + DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } else if (gLandMountainMode) { @@ -285,16 +285,18 @@ public: // Draw raise cost amount if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) { - price = gLandToolRaiseCost; - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, &price, { TextAlignment::CENTRE }); + 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 != MONEY32_UNDEFINED && gLandToolLowerCost != 0) { - price = gLandToolLowerCost; - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, &price, { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(gLandToolLowerCost); + DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } screenCoords.y += 50; @@ -319,7 +321,7 @@ public: { auto ft = Formatter(); ft.Add(price); - DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft.Data(), { TextAlignment::CENTRE }); + DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 93f37e93ea..2f6025acb1 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -262,16 +262,19 @@ static void window_land_rights_paint(rct_window* w, rct_drawpixelinfo* dpi) // Draw number for tool sizes bigger than 7 if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) { - DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, { TextAlignment::CENTRE }); + 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 != MONEY32_UNDEFINED && _landRightsCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { + auto ft = Formatter(); + ft.Add(_landRightsCost); screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + w->windowPos.x, window_land_rights_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 32 }; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, &_landRightsCost, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 74585956a9..67d1376a6d 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -714,8 +714,10 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi) // Draw name button indicator. rct_widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME]; + ft = Formatter(); + ft.Add(id); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, &id, + dpi, w->windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, { COLOUR_GREY }); // Date button text @@ -727,8 +729,10 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi) id = STR_NONE; rct_widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE]; + ft = Formatter(); + ft.Add(id); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, &id, + dpi, w->windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, { COLOUR_GREY }); } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b081489442..08dcfd61d7 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -822,9 +822,9 @@ static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi) // Draw land tool size if (WidgetIsActiveTool(w, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > MAX_TOOL_SIZE_WITH_SPRITE) { - DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &_landRightsToolSize, - { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(_landRightsToolSize); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } screenCoords.y = w->windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5; @@ -853,7 +853,7 @@ static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi) { gfx_fill_rect( dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, mapLabels[i], w); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, mapLabels[i], {}); screenCoords.y += LIST_ROW_HEIGHT; if (i == 3) { diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 9a63298231..bff808e558 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -686,8 +686,6 @@ static void window_mapgen_base_invalidate(rct_window* w) static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi) { - uint16_t arg; - WindowDrawWidgets(w, dpi); window_mapgen_draw_tab_images(dpi, w); @@ -705,20 +703,24 @@ static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi) // The practical map size is 2 lower than the technical map size // This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes. - uint16_t mapSizeArgs[] = { static_cast(_mapSize - 2), static_cast(_mapSize - 2) }; + auto ft = Formatter(); + ft.Add(static_cast(_mapSize - 2)); + ft.Add(static_cast(_mapSize - 2)); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_MAP_SIZE].left + 1, w->widgets[WIDX_MAP_SIZE].top + 1 }, - STR_RESOLUTION_X_BY_Y, &mapSizeArgs, { w->colours[1] }); + STR_RESOLUTION_X_BY_Y, ft, { w->colours[1] }); - arg = (_baseHeight - 12) / 2; + ft = Formatter(); + ft.Add((_baseHeight - 12) / 2); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_BASE_HEIGHT].left + 1, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, - STR_COMMA16, &arg, { w->colours[1] }); + STR_COMMA16, ft, { w->colours[1] }); - arg = (_waterLevel - 12) / 2; + ft = Formatter(); + ft.Add((_waterLevel - 12) / 2); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_WATER_LEVEL].left + 1, w->widgets[WIDX_WATER_LEVEL].top + 1 }, - STR_COMMA16, &arg, { w->colours[1] }); + STR_COMMA16, ft, { w->colours[1] }); } #pragma endregion @@ -1003,8 +1005,6 @@ static void window_mapgen_simplex_invalidate(rct_window* w) static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi) { - uint16_t arg; - WindowDrawWidgets(w, dpi); window_mapgen_draw_tab_images(dpi, w); @@ -1028,21 +1028,29 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi) dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { textColour }); + auto ft = Formatter(); + ft.Add(_simplex_low); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, - STR_COMMA16, &_simplex_low, { textColour }); + STR_COMMA16, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_high); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, - STR_COMMA16, &_simplex_high, { textColour }); + STR_COMMA16, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_base_freq); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, - STR_WINDOW_OBJECTIVE_VALUE_RATING, &_simplex_base_freq, { textColour }); + STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_octaves); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, - STR_COMMA16, &_simplex_octaves, { textColour }); + STR_COMMA16, ft, { textColour }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, {}, { textColour }); @@ -1052,18 +1060,21 @@ static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi) // The practical map size is 2 lower than the technical map size. // This needs to be cast down to a uint16_t because that's what the STR_RESOLUTION_X_BY_Y string takes. - uint16_t mapSizeArgs[] = { static_cast(_mapSize - 2), static_cast(_mapSize - 2) }; + ft = Formatter(); + ft.Add(static_cast(_mapSize - 2)); + ft.Add(static_cast(_mapSize - 2)); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1, w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1 }, - STR_RESOLUTION_X_BY_Y, &mapSizeArgs, { textColour }); + STR_RESOLUTION_X_BY_Y, ft, { textColour }); - arg = (_waterLevel - 12) / 2; + ft = Formatter(); + ft.Add((_waterLevel - 12) / 2); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, - STR_COMMA16, &arg, { textColour }); + STR_COMMA16, ft, { textColour }); } #pragma endregion @@ -1216,45 +1227,53 @@ static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi) // Smooth strength label and value const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour; - int16_t strength = _heightmapSmoothStrength; DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, { strengthColour }); + + auto ft = Formatter(); + ft.Add(_heightmapSmoothStrength); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, - STR_COMMA16, &strength, { strengthColour }); + STR_COMMA16, ft, { strengthColour }); // Low label and value const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour; - int16_t low = _heightmapLow; DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, { labelColour }); + + ft = Formatter(); + ft.Add(_heightmapLow); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_LOW].left + 1, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, - STR_COMMA16, &low, { labelColour }); + STR_COMMA16, ft, { labelColour }); // High label and value - int16_t high = _heightmapHigh; DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, { labelColour }); + + ft = Formatter(); + ft.Add(_heightmapHigh); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, - STR_COMMA16, &high, { labelColour }); + STR_COMMA16, ft, { labelColour }); // Water level label and value - int16_t waterLevel = _waterLevel; DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { labelColour }); + + ft = Formatter(); + ft.Add(_waterLevel); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, - STR_COMMA16, &waterLevel, { labelColour }); + STR_COMMA16, ft, { labelColour }); } #pragma endregion diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 95bf461411..0f4e52b165 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -431,21 +431,27 @@ static void window_multiplayer_information_paint(rct_window* w, rct_drawpixelinf const utf8* providerName = network_get_server_provider_name(); if (!str_is_null_or_empty(providerName)) { - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, static_cast(&providerName)); + auto ft = Formatter(); + ft.Add(providerName); + DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, ft); screenCoords.y += LIST_ROW_HEIGHT; } const utf8* providerEmail = network_get_server_provider_email(); if (!str_is_null_or_empty(providerEmail)) { - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, static_cast(&providerEmail)); + auto ft = Formatter(); + ft.Add(providerEmail); + DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, ft); screenCoords.y += LIST_ROW_HEIGHT; } const utf8* providerWebsite = network_get_server_provider_website(); if (!str_is_null_or_empty(providerWebsite)) { - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, static_cast(&providerWebsite)); + auto ft = Formatter(); + ft.Add(providerWebsite); + DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, ft); } } } @@ -558,7 +564,9 @@ static void window_multiplayer_players_paint(rct_window* w, rct_drawpixelinfo* d // Number of players stringId = w->no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }; - DrawTextBasic(dpi, screenCoords, stringId, &w->no_list_items, { w->colours[2] }); + auto ft = Formatter(); + ft.Add(w->no_list_items); + DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[2] }); } static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 3be0a7a6ed..d1ad6aa8d9 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -346,20 +346,24 @@ public: // Number of weeks rct_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, &campaign.no_weeks, { colours[0] }); + campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] }); screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; // Price per week - money64 pricePerWeek = AdvertisingCampaignPricePerWeek[campaign.campaign_type]; - DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, &pricePerWeek); + ft = Formatter(); + ft.Add(AdvertisingCampaignPricePerWeek[campaign.campaign_type]); + DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft); screenCoords.y += 13; // Total price - money64 totalPrice = AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks; - DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, &totalPrice); + ft = Formatter(); + ft.Add(AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks); + DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft); } }; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 55f9347c39..b1aba0fa3a 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -896,7 +896,7 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_FULLSCREEN].top + 1 }, STR_FULLSCREEN_MODE, - w, { w->colours[1] }); + {}, { w->colours[1] }); // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" colour_t colour = w->colours[1]; @@ -906,19 +906,20 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi) } DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10 + 15, window_options_display_widgets[WIDX_RESOLUTION].top + 1 }, - STR_DISPLAY_RESOLUTION, w, { colour }); + STR_DISPLAY_RESOLUTION, {}, { colour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, w, + dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1 }, - STR_DRAWING_ENGINE, w, { w->colours[1] }); + STR_DRAWING_ENGINE, {}, { w->colours[1] }); - int32_t scale = static_cast(gConfigGeneral.window_scale * 100); + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.window_scale * 100)); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SCALE].left + 1, w->widgets[WIDX_SCALE].top + 1 }, - STR_WINDOW_OBJECTIVE_VALUE_RATING, &scale, { w->colours[1] }); + STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { w->colours[1] }); colour = w->colours[1]; if (gConfigGeneral.drawing_engine == DrawingEngine::Software @@ -928,7 +929,7 @@ static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi) } DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 25, window_options_display_widgets[WIDX_SCALE_QUALITY].top + 1 }, - STR_SCALING_QUALITY, w, { colour }); + STR_SCALING_QUALITY, {}, { colour }); } #pragma region Rendering Tab @@ -1331,21 +1332,21 @@ static void window_options_culture_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_LANGUAGE].top + 1 }, STR_OPTIONS_LANGUAGE, - w, { w->colours[1] }); + {}, { w->colours[1] }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, w, + dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DISTANCE].top + 1 }, STR_DISTANCE_AND_SPEED, - w, { w->colours[1] }); + {}, { w->colours[1] }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, w, + dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_HEIGHT_LABELS].top + 1 }, STR_HEIGHT_LABELS, - w, { w->colours[1] }); + {}, { w->colours[1] }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, w, + dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, {}, { w->colours[1] }); } @@ -1748,7 +1749,7 @@ static void window_options_controls_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15 }, - STR_SHOW_TOOLBAR_BUTTONS_FOR, w, { w->colours[1] }); + STR_SHOW_TOOLBAR_BUTTONS_FOR, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_THEMES].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, {}, { w->colours[1] }); @@ -1964,13 +1965,13 @@ static void window_options_misc_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top + 1 }, STR_TITLE_SEQUENCE, - w, { w->colours[1] }); + {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_SCENARIO_GROUPING].top + 1 }, STR_OPTIONS_SCENARIO_GROUPING, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1 }, - STR_DEFAULT_INSPECTION_INTERVAL, w, { w->colours[1] }); + STR_DEFAULT_INSPECTION_INTERVAL, {}, { w->colours[1] }); } #pragma region Advanced Tab @@ -2130,7 +2131,7 @@ static void window_options_advanced_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE].top + 1 }, - STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, w, { w->colours[1] }); + STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos @@ -2139,14 +2140,15 @@ static void window_options_advanced_paint(rct_window* w, rct_drawpixelinfo* dpi) window_options_autosave_names[gConfigGeneral.autosave_frequency], {}, { w->colours[1] }); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_AUTOSAVE_AMOUNT, w, { w->colours[1] }); - int32_t autosavesToKeep = static_cast(gConfigGeneral.autosave_amount); + STR_AUTOSAVE_AMOUNT, {}, { w->colours[1] }); + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.autosave_amount)); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, w->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, &autosavesToKeep, { w->colours[1] }); + STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, ft, { w->colours[1] }); - auto ft = Formatter(); + ft = Formatter(); ft.Add(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path)); rct_widget pathWidget = window_options_advanced_widgets[WIDX_PATH_TO_RCT1_BUTTON]; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 49afa0557a..18d1f100fb 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -898,7 +898,9 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_widget* widget = &window_park_rating_widgets[WIDX_PAGE_BACKGROUND]; // Current value - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, &gParkRating); + auto ft = Formatter(); + ft.Add(gParkRating); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); // Graph border gfx_fill_rect_inset( @@ -912,7 +914,7 @@ static void window_park_rating_paint(rct_window* w, rct_drawpixelinfo* dpi) for (int i = 5; i >= 0; i--) { uint32_t axisValue = i * 200; - auto ft = Formatter(); + ft = Formatter(); ft.Add(axisValue); DrawTextBasic( dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, @@ -1033,8 +1035,9 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_widget* widget = &window_park_guests_widgets[WIDX_PAGE_BACKGROUND]; // Current value - DrawTextBasic( - dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, &gNumGuestsInPark); + auto ft = Formatter(); + ft.Add(gNumGuestsInPark); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); // Graph border gfx_fill_rect_inset( @@ -1048,7 +1051,7 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi) for (int i = 5; i >= 0; i--) { uint32_t axisValue = i * 1000; - auto ft = Formatter(); + ft = Formatter(); ft.Add(axisValue); DrawTextBasic( dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, @@ -1181,12 +1184,16 @@ static void window_park_price_paint(rct_window* w, rct_drawpixelinfo* dpi) auto screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PAGE_BACKGROUND].left + 4, w->widgets[WIDX_PAGE_BACKGROUND].top + 30 }; - DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, &gTotalIncomeFromAdmissions); + auto ft = Formatter(); + ft.Add(gTotalIncomeFromAdmissions); + DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); money64 parkEntranceFee = park_get_entrance_fee(); auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_PRICE].left + 1, w->widgets[WIDX_PRICE].top + 1 }; - DrawTextBasic(dpi, screenCoords, stringId, &parkEntranceFee, { w->colours[1] }); + ft = Formatter(); + ft.Add(parkEntranceFee); + DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[1] }); } #pragma endregion diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 446b83c243..708de4aed7 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -561,8 +561,9 @@ void window_research_funding_page_paint(rct_window* w, rct_drawpixelinfo* dpi, r return; int32_t currentResearchLevel = gResearchFundingLevel; - money64 currentResearchCostPerWeek = research_cost_table[currentResearchLevel]; - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ¤tResearchCostPerWeek); + auto ft = Formatter(); + ft.Add(research_cost_table[currentResearchLevel]); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index cbaef78e8f..d39b6a2f79 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2635,7 +2635,7 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi) widget = &window_ride_main_widgets[WIDX_VIEW]; DrawTextBasic( dpi, { w->windowPos.x + (widget->left + widget->right - 11) / 2, w->windowPos.y + widget->top }, - STR_WINDOW_COLOUR_2_STRINGID, ft.Data(), { TextAlignment::CENTRE }); + STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); // Status ft = Formatter(); @@ -2922,19 +2922,22 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords.y += 2; // Capacity - DrawTextBasic(dpi, screenCoords, STR_CAPACITY, &rideEntry->capacity, COLOUR_BLACK); + auto ft = Formatter(); + ft.Add(rideEntry->capacity); + DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); // Excitement Factor - auto factor = static_cast(rideEntry->excitement_multiplier); - if (factor > 0) + if (rideEntry->excitement_multiplier > 0) { screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, &factor, COLOUR_BLACK); + + ft = Formatter(); + ft.Add(rideEntry->intensity_multiplier); + DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, ft); } // Intensity Factor - factor = rideEntry->intensity_multiplier; - if (factor > 0) + if (rideEntry->intensity_multiplier > 0) { int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); if (lineHeight != 10) @@ -2942,18 +2945,22 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) else screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, &factor, COLOUR_BLACK); + ft = Formatter(); + ft.Add(rideEntry->intensity_multiplier); + DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, ft); if (lineHeight != 10) screenCoords.x -= 150; } // Nausea Factor - factor = rideEntry->nausea_multiplier; - if (factor > 0) + if (rideEntry->nausea_multiplier > 0) { screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, &factor, COLOUR_BLACK); + + ft = Formatter(); + ft.Add(rideEntry->nausea_multiplier); + DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, ft); } } @@ -3648,10 +3655,11 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi) // Number of block sections if (ride->IsBlockSectioned()) { - auto blockSections = ride->num_block_brakes + ride->num_stations; + auto ft = Formatter(); + ft.Add(ride->num_block_brakes + ride->num_stations); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, - STR_BLOCK_SECTIONS, &blockSections, COLOUR_BLACK); + STR_BLOCK_SECTIONS, ft, COLOUR_BLACK); } } @@ -4050,29 +4058,32 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords = w->windowPos + ScreenCoordsXY{ widget->left + 4, widget->top + 4 }; uint16_t reliability = ride->reliability_percentage; - DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, &reliability); + auto ft = Formatter(); + ft.Add(reliability); + DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft); window_ride_maintenance_draw_bar( w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max(10, reliability), COLOUR_BRIGHT_GREEN); screenCoords.y += 11; uint16_t downTime = ride->downtime; - DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, &downTime); + ft = Formatter(); + ft.Add(downTime); + DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft); window_ride_maintenance_draw_bar(w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED); screenCoords.y += 26; // Last inspection - uint16_t lastInspection = ride->last_inspection; - - // Use singular form for 1 minute of time or less rct_string_id stringId; - if (lastInspection <= 1) + if (ride->last_inspection <= 1) stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; - else if (lastInspection <= 240) + else if (ride->last_inspection <= 240) stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES; else stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS; - DrawTextBasic(dpi, screenCoords, stringId, &lastInspection); + ft = Formatter(); + ft.Add(ride->last_inspection); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Last / current breakdown @@ -4080,8 +4091,9 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) return; stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; - rct_string_id breakdownMessage = RideBreakdownReasonNames[ride->breakdown_reason]; - DrawTextBasic(dpi, screenCoords, stringId, &breakdownMessage); + ft = Formatter(); + ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Mechanic status @@ -4126,7 +4138,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) auto staff = GetEntity(ride->mechanic); if (staff != nullptr && staff->IsMechanic()) { - auto ft = Formatter(); + ft = Formatter(); staff->FormatNameTo(ft); DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); } @@ -5524,9 +5536,6 @@ static void window_ride_measurements_invalidate(rct_window* w) */ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi) { - int16_t holes, maxSpeed, averageSpeed, drops, highestDropHeight, inversions, time; - int32_t maxPositiveVerticalGs, maxNegativeVerticalGs, maxLateralGs, totalAirTime, length; - WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); @@ -5598,20 +5607,23 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi if (ride->type == RIDE_TYPE_MINI_GOLF) { // Holes - holes = ride->holes; - DrawTextBasic(dpi, screenCoords, STR_HOLES, &holes); + ft = Formatter(); + ft.Add(ride->holes); + DrawTextBasic(dpi, screenCoords, STR_HOLES, ft); screenCoords.y += LIST_ROW_HEIGHT; } else { // Max speed - maxSpeed = (ride->max_speed * 9) >> 18; - DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, &maxSpeed); + ft = Formatter(); + ft.Add((ride->max_speed * 9) >> 18); + DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); screenCoords.y += LIST_ROW_HEIGHT; // Average speed - averageSpeed = (ride->average_speed * 9) >> 18; - DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, &averageSpeed); + ft = Formatter(); + ft.Add((ride->average_speed * 9) >> 18); + DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); screenCoords.y += LIST_ROW_HEIGHT; // Ride time @@ -5619,7 +5631,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi int32_t numTimes = 0; for (int32_t i = 0; i < ride->num_stations; i++) { - time = ride->stations[numTimes].SegmentTime; + auto time = ride->stations[numTimes].SegmentTime; if (time != 0) { ft.Add(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); @@ -5656,7 +5668,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi int32_t numLengths = 0; for (int32_t i = 0; i < ride->num_stations; i++) { - length = ride->stations[i].SegmentLength; + auto length = ride->stations[i].SegmentLength; if (length != 0) { length >>= 16; @@ -5692,51 +5704,60 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) { // Max. positive vertical G's - maxPositiveVerticalGs = ride->max_positive_vertical_g; - stringId = maxPositiveVerticalGs >= RIDE_G_FORCES_RED_POS_VERTICAL ? STR_MAX_POSITIVE_VERTICAL_G_RED - : STR_MAX_POSITIVE_VERTICAL_G; - DrawTextBasic(dpi, screenCoords, stringId, &maxPositiveVerticalGs); + stringId = ride->max_positive_vertical_g >= RIDE_G_FORCES_RED_POS_VERTICAL ? STR_MAX_POSITIVE_VERTICAL_G_RED + : 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 - maxNegativeVerticalGs = ride->max_negative_vertical_g; - stringId = maxNegativeVerticalGs <= RIDE_G_FORCES_RED_NEG_VERTICAL ? STR_MAX_NEGATIVE_VERTICAL_G_RED - : STR_MAX_NEGATIVE_VERTICAL_G; - DrawTextBasic(dpi, screenCoords, stringId, &maxNegativeVerticalGs); + 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 - maxLateralGs = ride->max_lateral_g; - stringId = maxLateralGs >= RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; - DrawTextBasic(dpi, screenCoords, stringId, &maxLateralGs); + 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 - totalAirTime = ride->total_air_time * 3; - DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, &totalAirTime); + 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 - drops = ride->drops & 0x3F; - DrawTextBasic(dpi, screenCoords, STR_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 - highestDropHeight = (ride->highest_drop_height * 3) / 4; - DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight); + 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 - inversions = ride->inversions; - if (inversions != 0) + if (ride->inversions != 0) { - DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, &inversions); + ft = Formatter(); + ft.Add(ride->inversions); + DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft); screenCoords.y += LIST_ROW_HEIGHT; } } @@ -6077,15 +6098,20 @@ static void window_ride_graphs_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi if (listType == GRAPH_ALTITUDE) scaled_yUnit /= 2; - DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, &scaled_yUnit, { FontSpriteBase::SMALL }); + auto ft = Formatter(); + ft.Add(scaled_yUnit); + + DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontSpriteBase::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, &time, { FontSpriteBase::SMALL }); + DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontSpriteBase::SMALL }); time += 5; } @@ -6608,7 +6634,7 @@ static void window_ride_income_invalidate(rct_window* w) static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) { rct_string_id stringId; - money64 profit, costPerHour; + money64 profit; ShopItem primaryItem, secondaryItem; WindowDrawWidgets(w, dpi); @@ -6640,7 +6666,10 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) stringId = STR_LOSS_PER_ITEM_SOLD; } - DrawTextBasic(dpi, screenCoords, stringId, &profit); + auto ft = Formatter(); + ft.Add(profit); + + DrawTextBasic(dpi, screenCoords, stringId, ft); } screenCoords.y += 44; @@ -6661,33 +6690,45 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) stringId = STR_LOSS_PER_ITEM_SOLD; } - DrawTextBasic(dpi, screenCoords, stringId, &profit); + auto ft = Formatter(); + ft.Add(profit); + + DrawTextBasic(dpi, screenCoords, stringId, ft); } screenCoords.y += 18; // Income per hour if (ride->income_per_hour != MONEY64_UNDEFINED) { - DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, &ride->income_per_hour); + 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 - costPerHour = ride->upkeep_cost * 16; + money64 costPerHour = ride->upkeep_cost * 16; stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; - DrawTextBasic(dpi, screenCoords, stringId, &costPerHour); + auto ft = Formatter(); + ft.Add(costPerHour); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Profit per hour if (ride->profit != MONEY64_UNDEFINED) { - DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, &ride->profit); + ft = Formatter(); + ft.Add(ride->profit); + DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.y += 5; // Total profit - DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, &ride->total_profit); + ft = Formatter(); + ft.Add(ride->total_profit); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft); } #pragma endregion @@ -6821,7 +6862,6 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) { ShopItem shopItem; int16_t popularity, satisfaction, queueTime; - int32_t customersPerHour; rct_string_id stringId; WindowDrawWidgets(w, dpi); @@ -6838,14 +6878,16 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) // Customers currently on ride if (ride->IsRide()) { - int16_t customersOnRide = ride->num_riders; - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, &customersOnRide); + auto ft = Formatter(); + ft.Add(ride->num_riders); + DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); screenCoords.y += LIST_ROW_HEIGHT; } // Customers per hour - customersPerHour = ride_customers_per_hour(ride); - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, &customersPerHour); + auto ft = Formatter(); + ft.Add(ride_customers_per_hour(ride)); + DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); screenCoords.y += LIST_ROW_HEIGHT; // Popularity @@ -6859,7 +6901,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) stringId = STR_POPULARITY_PERCENT; popularity *= 4; } - DrawTextBasic(dpi, screenCoords, stringId, &popularity); + ft = Formatter(); + ft.Add(popularity); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Satisfaction @@ -6873,7 +6917,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) stringId = STR_SATISFACTION_PERCENT; satisfaction *= 5; } - DrawTextBasic(dpi, screenCoords, stringId, &satisfaction); + ft = Formatter(); + ft.Add(satisfaction); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Queue time @@ -6889,7 +6935,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) shopItem = ride->GetRideEntry()->shop_item[0]; if (shopItem != ShopItem::None) { - auto ft = Formatter(); + ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_primary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); @@ -6901,7 +6947,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) : ride->GetRideEntry()->shop_item[1]; if (shopItem != ShopItem::None) { - auto ft = Formatter(); + ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_secondary_items_sold); DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); @@ -6909,14 +6955,18 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) } // Total customers - DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, &ride->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, &ride->guests_favourite); + DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.y += 2; @@ -6925,7 +6975,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) // If the ride has a build date that is in the future, show it as built this year. int16_t age = std::max(date_get_year(ride->GetAge()), 0); stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; - DrawTextBasic(dpi, screenCoords, stringId, &age); + ft = Formatter(); + ft.Add(age); + DrawTextBasic(dpi, screenCoords, stringId, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index a89a8b0b21..b4484ebe19 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2324,13 +2324,14 @@ static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi // Draw cost screenCoords = { w->windowPos.x + widget->midX(), w->windowPos.y + widget->bottom - 23 }; if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_PLACE) - DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, w, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); screenCoords.y += 11; if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - money64 value = _currentTrackPrice; - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(_currentTrackPrice); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 3fde2e97d5..8d4ac072c2 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -560,9 +560,11 @@ static void window_ride_list_paint(rct_window* w, rct_drawpixelinfo* dpi) window_ride_list_draw_tab_images(dpi, w); // Draw number of attractions on bottom + auto ft = Formatter(); + ft.Add(w->no_list_items); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[w->page], - &w->no_list_items); + ft); } /** diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 715fc3c707..46884719ba 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -493,9 +493,9 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi) shorten_path(path, sizeof(path), scenario->path, w->width - 6, FontSpriteBase::MEDIUM); const utf8* pathPtr = path; - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 3, w->height - 3 - 11 }, STR_STRING, static_cast(&pathPtr), - { w->colours[1] }); + auto ft = Formatter(); + ft.Add(pathPtr); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] }); } // Scenario name diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index fa1c438dc7..0a6aba1bff 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -216,8 +216,8 @@ static void window_scenery_scatter_paint(rct_window* w, rct_drawpixelinfo* dpi) { auto preview = window_scenery_scatter_widgets[WIDX_PREVIEW]; auto screenCoords = ScreenCoordsXY{ w->windowPos.x + preview.midX(), w->windowPos.y + preview.midY() }; - DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gWindowSceneryScatterSize, - { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(gWindowSceneryScatterSize); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index bd23fdc524..ffe97ff1a5 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -401,19 +401,19 @@ static void window_server_list_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, nullptr, - { COLOUR_WHITE }); + dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, { COLOUR_WHITE }); // Draw version number std::string version = network_get_version(); - const char* versionCStr = version.c_str(); + auto ft = Formatter(); + ft.Add(version.c_str()); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, - static_cast(&versionCStr), { COLOUR_WHITE }); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, static_cast(&_numPlayersOnline), + dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft, { COLOUR_WHITE }); + + ft = Formatter(); + ft.Add(_numPlayersOnline); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE }); } static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index c0c16e4ab7..5e50110dfb 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1805,7 +1805,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { terrainNameId = surfaceStyle->NameStringId; } - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, &terrainNameId, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(terrainNameId); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { COLOUR_WHITE }); // Edge texture name rct_string_id terrainEdgeNameId = STR_EMPTY; @@ -1814,9 +1816,10 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { terrainEdgeNameId = edgeStyle->NameStringId; } + ft = Formatter(); + ft.Add(terrainEdgeNameId); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, &terrainEdgeNameId, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { COLOUR_WHITE }); // Land ownership rct_string_id landOwnership; @@ -1830,15 +1833,16 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) 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, &landOwnership, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { COLOUR_WHITE }); // Water level - uint32_t waterLevel = tileElement->AsSurface()->GetWaterHeight(); + ft = Formatter(); + ft.Add(tileElement->AsSurface()->GetWaterHeight()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, &waterLevel, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, { COLOUR_WHITE }); // Properties // Raise / lower label @@ -1848,8 +1852,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); // Raised corners screenCoords = w->windowPos @@ -1862,8 +1867,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // Details // Path name - rct_string_id pathNameId = tileElement->AsPath()->GetSurfaceEntry()->string_idx; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, &pathNameId, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(tileElement->AsPath()->GetSurfaceEntry()->string_idx); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); // Path addition if (tileElement->AsPath()->HasAddition()) @@ -1873,9 +1879,10 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_string_id additionNameId = pathBitEntry != nullptr ? pathBitEntry->name : static_cast(STR_UNKNOWN_OBJECT_TYPE); + ft = Formatter(); + ft.Add(additionNameId); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, &additionNameId, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, { COLOUR_WHITE }); } else DrawTextBasic( @@ -1890,8 +1897,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); // Path connections screenCoords = w->windowPos @@ -1909,31 +1917,35 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) auto ride = get_ride(rideId); if (ride != nullptr) { - auto rideName = ride->GetRideTypeDescriptor().Naming.Name; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, &rideName, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(ride->GetRideTypeDescriptor().Naming.Name); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { COLOUR_WHITE }); } + auto ft = Formatter(); + ft.Add(trackElement->GetRideIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, &rideId, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { COLOUR_WHITE }); if (ride != nullptr) { - auto ft = Formatter(); + ft = Formatter(); ride->FormatNameTo(ft); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { COLOUR_WHITE }); } // Track - auto trackType = trackElement->GetTrackType(); - int16_t sequenceNumber = trackElement->GetSequenceIndex(); + ft = Formatter(); + ft.Add(trackElement->GetTrackType()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, &trackType, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { COLOUR_WHITE }); + + ft = Formatter(); + ft.Add(trackElement->GetSequenceIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, &sequenceNumber, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { COLOUR_WHITE }); if (trackElement->IsStation()) { int16_t stationIndex = trackElement->GetStationIndex(); - auto ft = Formatter(); + ft = Formatter(); ft.Add(STR_COMMA16); ft.Add(stationIndex); DrawTextBasic( @@ -1942,17 +1954,17 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) else { const char* stationNone = "-"; - auto ft = Formatter(); + ft = Formatter(); ft.Add(STR_STRING); ft.Add(stationNone); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { COLOUR_WHITE }); } - rct_string_id colourScheme = ColourSchemeNames[trackElement->GetColourScheme()]; + ft = Formatter(); + ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, &colourScheme, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { COLOUR_WHITE }); // Properties // Raise / lower label @@ -1961,8 +1973,8 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; } @@ -1970,8 +1982,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // Details // Age - int16_t age = tileElement->AsSmallScenery()->GetAge(); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, &age, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(tileElement->AsSmallScenery()->GetAge()); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { COLOUR_WHITE }); // Quadrant value const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); @@ -1982,15 +1995,17 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE }; + ft = Formatter(); + ft.Add(quadrant_string_idx[quadrant]); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, - &quadrant_string_idx[quadrant], { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, { COLOUR_WHITE }); } // Scenery ID - int16_t idx = tileElement->AsSmallScenery()->GetEntryIndex(); + ft = Formatter(); + ft.Add(tileElement->AsSmallScenery()->GetEntryIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, &idx, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { COLOUR_WHITE }); // Properties // Raise / Lower @@ -1999,8 +2014,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); // Quarter tile screenCoords = w->windowPos @@ -2018,55 +2034,57 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // Details // Entrance type - rct_string_id entranceType = EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, &entranceType, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { COLOUR_WHITE }); if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) { // TODO: Make this work with Left/Right park entrance parts - int16_t parkEntranceIndex = park_entrance_get_index( - { windowTileInspectorToolMap, tileElement->GetBaseZ() }); + ft = Formatter(); + ft.Add(park_entrance_get_index({ windowTileInspectorToolMap, tileElement->GetBaseZ() })); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, - &parkEntranceIndex, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, + { COLOUR_WHITE }); } else { - int16_t rideEntranceIndex = tileElement->AsEntrance()->GetStationIndex(); + ft = Formatter(); + ft.Add(tileElement->AsEntrance()->GetStationIndex()); if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) { // Ride entrance ID DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, - &rideEntranceIndex, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, + { COLOUR_WHITE }); } else { // Ride exit ID DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, - &rideEntranceIndex, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft, + { COLOUR_WHITE }); } } if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) { // Entrance part - rct_string_id entrancePart = ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]; + ft = Formatter(); + ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, &entrancePart, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { COLOUR_WHITE }); } else { // Ride ID - int16_t rideId = tileElement->AsEntrance()->GetRideIndex(); + ft = Formatter(); + ft.Add(tileElement->AsEntrance()->GetRideIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, &rideId, - { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, { COLOUR_WHITE }); // Station index int16_t stationIndex = tileElement->AsEntrance()->GetStationIndex(); - auto ft = Formatter(); + ft = Formatter(); ft.Add(STR_COMMA16); ft.Add(stationIndex); DrawTextBasic( @@ -2080,7 +2098,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; - auto ft = Formatter(); + ft = Formatter(); ft.Add(tileElement->base_height); DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; @@ -2090,14 +2108,15 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // Details // Type - int16_t wallType = tileElement->AsWall()->GetEntryIndex(); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, &wallType, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(tileElement->AsWall()->GetEntryIndex()); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { COLOUR_WHITE }); // Banner info auto banner = tileElement->AsWall()->GetBanner(); if (banner != nullptr) { - Formatter ft; + ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, @@ -2117,8 +2136,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); // Slope label screenCoords = w->windowPos @@ -2136,8 +2156,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) colour = w->colours[0] | COLOUR_FLAG_INSET; } screenCoords.x = w->windowPos.x + w->widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3; - int32_t animationFrame = tileElement->AsWall()->GetAnimationFrame(); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &animationFrame, { colour }); + ft = Formatter(); + ft.Add(tileElement->AsWall()->GetAnimationFrame()); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour }); break; } @@ -2146,13 +2167,16 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Type auto sceneryElement = tileElement->AsLargeScenery(); - int16_t largeSceneryType = sceneryElement->GetEntryIndex(); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, &largeSceneryType, { COLOUR_WHITE }); + ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex(); + auto ft = Formatter(); + ft.Add(largeSceneryType); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { COLOUR_WHITE }); // Part ID - int16_t pieceID = sceneryElement->GetSequenceIndex(); + ft = Formatter(); + ft.Add(sceneryElement->GetSequenceIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, &pieceID, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft, { COLOUR_WHITE }); // Banner info @@ -2162,7 +2186,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) auto banner = sceneryElement->GetBanner(); if (banner != nullptr) { - Formatter ft; + ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, @@ -2183,8 +2207,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; } @@ -2207,8 +2232,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); // Blocked paths screenCoords.y += 28; @@ -2226,8 +2252,9 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_CORRUPT_SPINNER_HEIGHT].left + 3; - int32_t baseHeight = tileElement->base_height; - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, &baseHeight, { COLOUR_WHITE }); + auto ft = Formatter(); + ft.Add(tileElement->base_height); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; } @@ -2329,7 +2356,6 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* typeName = buffer; } - const int32_t baseHeight = tileElement->base_height; const int32_t clearanceHeight = tileElement->clearance_height; const bool ghost = tileElement->IsGhost(); const bool last = tileElement->IsLastForTile(); @@ -2346,7 +2372,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* // Base height ft = Formatter(); ft.Add(STR_FORMAT_INTEGER); - ft.Add(baseHeight); + ft.Add(tileElement->base_height); DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ COL_X_BH, 0 }, stringFormat, ft); // Clearance height diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 226bac4c0a..4a3db512f6 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -497,8 +497,9 @@ static void window_track_place_paint(rct_window* w, rct_drawpixelinfo* dpi) // Price if (_window_track_place_last_cost != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - money64 value = _window_track_place_last_cost; - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, &value, { TextAlignment::CENTRE }); + ft = Formatter(); + ft.Add(_window_track_place_last_cost); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 88ab3fd192..a1feeb4218 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -591,16 +591,19 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 2 }; // Stats - fixed32_2dp rating = _loadedTrackDesign->excitement * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, &rating); + ft = Formatter(); + ft.Add(_loadedTrackDesign->excitement * 10); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; - rating = _loadedTrackDesign->intensity * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, &rating); + ft = Formatter(); + ft.Add(_loadedTrackDesign->intensity * 10); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; - rating = _loadedTrackDesign->nausea * 10; - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, &rating); + 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. @@ -611,20 +614,23 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) if (_loadedTrackDesign->type == RIDE_TYPE_MINI_GOLF) { // Holes - uint16_t holes = _loadedTrackDesign->holes & 0x1F; - DrawTextBasic(dpi, screenPos, STR_HOLES, &holes); + ft = Formatter(); + ft.Add(_loadedTrackDesign->holes & 0x1F); + DrawTextBasic(dpi, screenPos, STR_HOLES, ft); screenPos.y += LIST_ROW_HEIGHT; } else { // Maximum speed - uint16_t speed = ((_loadedTrackDesign->max_speed << 16) * 9) >> 18; - DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, &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 - speed = ((_loadedTrackDesign->average_speed << 16) * 9) >> 18; - DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, &speed); + ft = Formatter(); + ft.Add(((_loadedTrackDesign->average_speed << 16) * 9) >> 18); + DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -639,25 +645,29 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) { // Maximum positive vertical Gs - int32_t gForces = _loadedTrackDesign->max_positive_vertical_g * 32; - DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, &gForces); + 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 - gForces = _loadedTrackDesign->max_negative_vertical_g * 32; - DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, &gForces); + 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 - gForces = _loadedTrackDesign->max_lateral_g * 32; - DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, &gForces); + 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 - int32_t airTime = _loadedTrackDesign->total_air_time * 25; - DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, &airTime); + ft = Formatter(); + ft.Add(_loadedTrackDesign->total_air_time * 25); + DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -665,13 +675,15 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) { // Drops - uint16_t drops = _loadedTrackDesign->drops & 0x3F; - DrawTextBasic(dpi, screenPos, STR_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 - uint16_t highestDropHeight = (_loadedTrackDesign->highest_drop_height * 3) / 4; - DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight); + ft = Formatter(); + ft.Add((_loadedTrackDesign->highest_drop_height * 3) / 4); + DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -680,8 +692,10 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) uint16_t inversions = _loadedTrackDesign->inversions & 0x1F; if (inversions != 0) { + ft = Formatter(); + ft.Add(inversions); // Inversions - DrawTextBasic(dpi, screenPos, STR_INVERSIONS, &inversions); + DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -743,8 +757,9 @@ static void window_track_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, stringId = STR_BLACK_STRING; } - rct_string_id stringId2 = STR_BUILD_CUSTOM_DESIGN; - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, &stringId2); + auto ft = Formatter(); + ft.Add(STR_BUILD_CUSTOM_DESIGN); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); screenCoords.y += SCROLLABLE_ROW_HEIGHT; listIndex++; } diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index aa7b185ef1..52da8f5083 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -386,27 +386,25 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, w->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - fixed16_1dp clipHeightValueInUnits; - fixed32_2dp clipHeightValueInMeters; - fixed16_1dp clipHeightValueInFeet; - int32_t clipHeightRawValue = static_cast(gClipHeight); switch (gClipHeightDisplayType) { case DISPLAY_TYPE::DISPLAY_RAW: default: - DrawTextBasic( - dpi, screenCoords, STR_FORMAT_INTEGER, &clipHeightRawValue, { w->colours[0] }); // Printing the raw value. + { + auto ft = Formatter(); + ft.Add(static_cast(gClipHeight)); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { w->colours[0] }); // Printing the raw value. break; - + } case DISPLAY_TYPE::DISPLAY_UNITS: // Print the value in the configured height label type: if (gConfigGeneral.show_height_as_units == 1) { // Height label is Units. - clipHeightValueInUnits = static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0)); + auto ft = Formatter(); + ft.Add(static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0))); DrawTextBasic( - dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, &clipHeightValueInUnits, - { w->colours[0] }); // Printing the value in Height Units. + dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, { w->colours[0] }); // Printing the value in Height Units. } else { @@ -416,16 +414,19 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi) { case MeasurementFormat::Metric: case MeasurementFormat::SI: - clipHeightValueInMeters = static_cast( - FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50)); - DrawTextBasic( - dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, &clipHeightValueInMeters, { w->colours[0] }); + { + 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, { w->colours[0] }); break; + } case MeasurementFormat::Imperial: - clipHeightValueInFeet = static_cast( - FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0)); - DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, &clipHeightValueInFeet, { w->colours[0] }); + { + 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, { w->colours[0] }); break; + } } } } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 2812e2d831..fe64fdb6da 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -146,9 +146,9 @@ public: // Draw number for tool sizes bigger than 7 if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) { - DrawTextBasic( - &dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, &gLandToolSize, - { TextAlignment::CENTRE }); + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index c095a02e8f..0c5a150993 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -112,16 +112,10 @@ static void DrawText( DrawText(dpi, coords, paint, buffer); } -void DrawTextBasic( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const void* args, TextPaint textPaint) -{ - DrawText(dpi, coords, textPaint, format, args); -} - void DrawTextBasic( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft, TextPaint textPaint) { - DrawTextBasic(dpi, coords, format, ft.Data(), textPaint); + DrawText(dpi, coords, textPaint, format, ft.Data()); } void DrawTextEllipsised( diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index 7c32cfed44..c49093e8a3 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -147,8 +147,6 @@ public: void DrawTextBasic( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft = {}, TextPaint textPaint = {}); -void DrawTextBasic( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const void* args, TextPaint textPaint = {}); void DrawTextEllipsised( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, TextPaint textPaint = {}); From 93515f4414cf1b1652bc58e40e04845b5523fde3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 28 Jul 2021 10:25:36 +0200 Subject: [PATCH 082/681] Use money64 for land and water tools Should hopefully also fix CI. --- src/openrct2-ui/interface/LandTool.cpp | 8 +-- src/openrct2-ui/interface/LandTool.h | 8 +-- src/openrct2-ui/windows/Land.cpp | 8 +-- src/openrct2-ui/windows/TopToolbar.cpp | 96 +++++++++++++------------- src/openrct2-ui/windows/Water.cpp | 8 +-- 5 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 4019c4486d..8301bd02ed 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -37,12 +37,12 @@ static uint16_t toolSizeSpriteIndices[] = // clang-format on uint16_t gLandToolSize; -money32 gLandToolRaiseCost; -money32 gLandToolLowerCost; +money64 gLandToolRaiseCost; +money64 gLandToolLowerCost; ObjectEntryIndex gLandToolTerrainSurface; ObjectEntryIndex gLandToolTerrainEdge; -money32 gWaterToolRaiseCost; -money32 gWaterToolLowerCost; +money64 gWaterToolRaiseCost; +money64 gWaterToolLowerCost; uint32_t LandTool::SizeToSpriteIndex(uint16_t size) { diff --git a/src/openrct2-ui/interface/LandTool.h b/src/openrct2-ui/interface/LandTool.h index c851ef7838..7dd689d0fa 100644 --- a/src/openrct2-ui/interface/LandTool.h +++ b/src/openrct2-ui/interface/LandTool.h @@ -19,12 +19,12 @@ #define MAX_TOOL_SIZE_WITH_SPRITE 7 extern uint16_t gLandToolSize; -extern money32 gLandToolRaiseCost; -extern money32 gLandToolLowerCost; +extern money64 gLandToolRaiseCost; +extern money64 gLandToolLowerCost; extern ObjectEntryIndex gLandToolTerrainSurface; extern ObjectEntryIndex gLandToolTerrainEdge; -extern money32 gWaterToolRaiseCost; -extern money32 gWaterToolLowerCost; +extern money64 gWaterToolRaiseCost; +extern money64 gWaterToolLowerCost; namespace LandTool { diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index b53097bcde..ed9a67a473 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -81,8 +81,8 @@ public: gLandPaintMode = false; _selectedFloorTexture = 0; _selectedWallTexture = 0; - gLandToolRaiseCost = MONEY32_UNDEFINED; - gLandToolLowerCost = MONEY32_UNDEFINED; + gLandToolRaiseCost = MONEY64_UNDEFINED; + gLandToolLowerCost = MONEY64_UNDEFINED; } void OnClose() override @@ -283,7 +283,7 @@ public: if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { // Draw raise cost amount - if (gLandToolRaiseCost != MONEY32_UNDEFINED && gLandToolRaiseCost != 0) + if (gLandToolRaiseCost != MONEY64_UNDEFINED && gLandToolRaiseCost != 0) { auto ft = Formatter(); ft.Add(gLandToolRaiseCost); @@ -292,7 +292,7 @@ public: screenCoords.y += 10; // Draw lower cost amount - if (gLandToolLowerCost != MONEY32_UNDEFINED && gLandToolLowerCost != 0) + if (gLandToolLowerCost != MONEY64_UNDEFINED && gLandToolLowerCost != 0) { auto ft = Formatter(); ft.Add(gLandToolLowerCost); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 3124475c7e..62368c5da4 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -308,8 +308,8 @@ static void toggle_land_window(rct_window* topToolbar, rct_widgetindex widgetInd static void toggle_clear_scenery_window(rct_window* topToolbar, rct_widgetindex widgetIndex); static void toggle_water_window(rct_window* topToolbar, rct_widgetindex widgetIndex); -static money32 selection_lower_land(uint8_t flags); -static money32 selection_raise_land(uint8_t flags); +static money64 selection_lower_land(uint8_t flags); +static money64 selection_raise_land(uint8_t flags); static ClearAction GetClearAction(); @@ -2092,8 +2092,8 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) return; - money32 lower_cost = selection_lower_land(0); - money32 raise_cost = selection_raise_land(0); + money64 lower_cost = selection_lower_land(0); + money64 raise_cost = selection_raise_land(0); if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) { @@ -2118,8 +2118,8 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) if (!mapTile) { - money32 lower_cost = MONEY32_UNDEFINED; - money32 raise_cost = MONEY32_UNDEFINED; + money64 lower_cost = MONEY64_UNDEFINED; + money64 raise_cost = MONEY64_UNDEFINED; if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) { @@ -2178,8 +2178,8 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) if (!state_changed) return; - money32 lower_cost = selection_lower_land(0); - money32 raise_cost = selection_raise_land(0); + money64 lower_cost = selection_lower_land(0); + money64 raise_cost = selection_raise_land(0); if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) { @@ -2195,8 +2195,8 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) if (!mapTile) { - money32 lower_cost = MONEY32_UNDEFINED; - money32 raise_cost = MONEY32_UNDEFINED; + money64 lower_cost = MONEY64_UNDEFINED; + money64 raise_cost = MONEY64_UNDEFINED; if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) { @@ -2304,8 +2304,8 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) if (!state_changed) return; - money32 lower_cost = selection_lower_land(0); - money32 raise_cost = selection_raise_land(0); + money64 lower_cost = selection_lower_land(0); + money64 raise_cost = selection_raise_land(0); if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) { @@ -2334,10 +2334,10 @@ static void top_toolbar_tool_update_water(const ScreenCoordsXY& screenPos) { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); auto res = GameActions::Query(&waterLowerAction); - money32 lowerCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + money64 lowerCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; res = GameActions::Query(&waterRaiseAction); - money32 raiseCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + money64 raiseCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; if (gWaterToolRaiseCost != raiseCost || gWaterToolLowerCost != lowerCost) { @@ -2355,10 +2355,10 @@ static void top_toolbar_tool_update_water(const ScreenCoordsXY& screenPos) if (info.SpriteType == ViewportInteractionItem::None) { - if (gWaterToolRaiseCost != MONEY32_UNDEFINED || gWaterToolLowerCost != MONEY32_UNDEFINED) + if (gWaterToolRaiseCost != MONEY64_UNDEFINED || gWaterToolLowerCost != MONEY64_UNDEFINED) { - gWaterToolRaiseCost = MONEY32_UNDEFINED; - gWaterToolLowerCost = MONEY32_UNDEFINED; + gWaterToolRaiseCost = MONEY64_UNDEFINED; + gWaterToolLowerCost = MONEY64_UNDEFINED; window_invalidate_by_class(WC_WATER); } return; @@ -2426,10 +2426,10 @@ static void top_toolbar_tool_update_water(const ScreenCoordsXY& screenPos) { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); auto res = GameActions::Query(&waterLowerAction); - money32 lowerCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + money64 lowerCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; res = GameActions::Query(&waterRaiseAction); - money32 raiseCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + money64 raiseCost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; if (gWaterToolRaiseCost != raiseCost || gWaterToolLowerCost != lowerCost) { @@ -2442,10 +2442,10 @@ static void top_toolbar_tool_update_water(const ScreenCoordsXY& screenPos) /** * * rct2: 0x006E24F6 - * On failure returns MONEY32_UNDEFINED + * On failure returns MONEY64_UNDEFINED * On success places ghost scenery and returns cost to place proper */ -static money32 try_place_ghost_small_scenery( +static money64 try_place_ghost_small_scenery( CoordsXYZD loc, uint8_t quadrant, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour) { scenery_remove_ghost_tool_placement(); @@ -2456,7 +2456,7 @@ static money32 try_place_ghost_small_scenery( auto res = GameActions::Execute(&smallSceneryPlaceAction); auto sspar = dynamic_cast(res.get()); if (sspar == nullptr || res->Error != GameActions::Status::Ok) - return MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; gSceneryPlaceRotation = loc.direction; gSceneryPlaceObject.SceneryType = SCENERY_TYPE_SMALL; @@ -2480,7 +2480,7 @@ static money32 try_place_ghost_small_scenery( return res->Cost; } -static money32 try_place_ghost_path_addition(CoordsXYZ loc, ObjectEntryIndex entryIndex) +static money64 try_place_ghost_path_addition(CoordsXYZ loc, ObjectEntryIndex entryIndex) { scenery_remove_ghost_tool_placement(); @@ -2497,12 +2497,12 @@ static money32 try_place_ghost_path_addition(CoordsXYZ loc, ObjectEntryIndex ent }); auto res = GameActions::Execute(&footpathAdditionPlaceAction); if (res->Error != GameActions::Status::Ok) - return MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; return res->Cost; } -static money32 try_place_ghost_wall( +static money64 try_place_ghost_wall( CoordsXYZ loc, uint8_t edge, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { @@ -2523,12 +2523,12 @@ static money32 try_place_ghost_wall( auto res = GameActions::Execute(&wallPlaceAction); if (res->Error != GameActions::Status::Ok) - return MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; return res->Cost; } -static money32 try_place_ghost_large_scenery( +static money64 try_place_ghost_large_scenery( CoordsXYZD loc, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour) { scenery_remove_ghost_tool_placement(); @@ -2539,7 +2539,7 @@ static money32 try_place_ghost_large_scenery( auto res = GameActions::Execute(&sceneryPlaceAction); auto lspar = dynamic_cast(res.get()); if (lspar == nullptr || res->Error != GameActions::Status::Ok) - return MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; gSceneryPlaceRotation = loc.direction; @@ -2559,7 +2559,7 @@ static money32 try_place_ghost_large_scenery( return res->Cost; } -static money32 try_place_ghost_banner(CoordsXYZD loc, ObjectEntryIndex entryIndex) +static money64 try_place_ghost_banner(CoordsXYZD loc, ObjectEntryIndex entryIndex) { scenery_remove_ghost_tool_placement(); @@ -2569,7 +2569,7 @@ static money32 try_place_ghost_banner(CoordsXYZD loc, ObjectEntryIndex entryInde 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 MONEY32_UNDEFINED; + return MONEY64_UNDEFINED; gSceneryGhostPosition = loc; gSceneryGhostPosition.z += PATH_HEIGHT_STEP; @@ -2608,7 +2608,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) return; } - money32 cost = 0; + money64 cost = 0; switch (selection.SceneryType) { @@ -2683,7 +2683,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) { mapTile, gSceneryPlaceZ, rotation }, quadrant, selection.EntryIndex, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour); - if (cost != MONEY32_UNDEFINED) + if (cost != MONEY64_UNDEFINED) break; gSceneryPlaceZ += 8; } @@ -2773,7 +2773,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) { mapTile, gSceneryPlaceZ }, edge, selection.EntryIndex, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - if (cost != MONEY32_UNDEFINED) + if (cost != MONEY64_UNDEFINED) break; gSceneryPlaceZ += 8; } @@ -2839,7 +2839,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) { mapTile, gSceneryPlaceZ, direction }, selection.EntryIndex, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour); - if (cost != MONEY32_UNDEFINED) + if (cost != MONEY64_UNDEFINED) break; gSceneryPlaceZ += COORDS_Z_STEP; } @@ -2983,7 +2983,7 @@ static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIn * * rct2: 0x006644DD */ -static money32 selection_raise_land(uint8_t flags) +static money64 selection_raise_land(uint8_t flags) { int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; @@ -2998,7 +2998,7 @@ static money32 selection_raise_land(uint8_t flags) false); auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) : GameActions::Query(&landSmoothAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } else { @@ -3008,7 +3008,7 @@ static money32 selection_raise_land(uint8_t flags) auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landRaiseAction) : GameActions::Query(&landRaiseAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } } @@ -3016,7 +3016,7 @@ static money32 selection_raise_land(uint8_t flags) * * rct2: 0x006645B3 */ -static money32 selection_lower_land(uint8_t flags) +static money64 selection_lower_land(uint8_t flags) { int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; @@ -3031,7 +3031,7 @@ static money32 selection_lower_land(uint8_t flags) true); auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) : GameActions::Query(&landSmoothAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } else { @@ -3041,7 +3041,7 @@ static money32 selection_lower_land(uint8_t flags) auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landLowerAction) : GameActions::Query(&landLowerAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } } @@ -3074,8 +3074,8 @@ static void window_top_toolbar_land_tool_drag(const ScreenCoordsXY& screenPos) selection_raise_land(GAME_COMMAND_FLAG_APPLY); - gLandToolRaiseCost = MONEY32_UNDEFINED; - gLandToolLowerCost = MONEY32_UNDEFINED; + gLandToolRaiseCost = MONEY64_UNDEFINED; + gLandToolLowerCost = MONEY64_UNDEFINED; } else if (y_diff >= -tile_height) { @@ -3083,8 +3083,8 @@ static void window_top_toolbar_land_tool_drag(const ScreenCoordsXY& screenPos) selection_lower_land(GAME_COMMAND_FLAG_APPLY); - gLandToolRaiseCost = MONEY32_UNDEFINED; - gLandToolLowerCost = MONEY32_UNDEFINED; + gLandToolRaiseCost = MONEY64_UNDEFINED; + gLandToolLowerCost = MONEY64_UNDEFINED; } } @@ -3119,8 +3119,8 @@ static void window_top_toolbar_water_tool_drag(const ScreenCoordsXY& screenPos) { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); GameActions::Execute(&waterRaiseAction); - gWaterToolRaiseCost = MONEY32_UNDEFINED; - gWaterToolLowerCost = MONEY32_UNDEFINED; + gWaterToolRaiseCost = MONEY64_UNDEFINED; + gWaterToolLowerCost = MONEY64_UNDEFINED; return; } @@ -3134,8 +3134,8 @@ static void window_top_toolbar_water_tool_drag(const ScreenCoordsXY& screenPos) auto waterLowerAction = WaterLowerAction( { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); GameActions::Execute(&waterLowerAction); - gWaterToolRaiseCost = MONEY32_UNDEFINED; - gWaterToolLowerCost = MONEY32_UNDEFINED; + gWaterToolRaiseCost = MONEY64_UNDEFINED; + gWaterToolLowerCost = MONEY64_UNDEFINED; return; } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index fe64fdb6da..d841579ac9 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -51,8 +51,8 @@ public: window_push_others_below(this); gLandToolSize = 1; - gWaterToolRaiseCost = MONEY32_UNDEFINED; - gWaterToolLowerCost = MONEY32_UNDEFINED; + gWaterToolRaiseCost = MONEY64_UNDEFINED; + gWaterToolLowerCost = MONEY64_UNDEFINED; } void OnClose() override @@ -156,7 +156,7 @@ public: // Draw raise cost amount screenCoords = { window_water_widgets[WIDX_PREVIEW].midX() + windowPos.x, window_water_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 }; - if (gWaterToolRaiseCost != MONEY32_UNDEFINED && gWaterToolRaiseCost != 0) + if (gWaterToolRaiseCost != MONEY64_UNDEFINED && gWaterToolRaiseCost != 0) { auto ft = Formatter(); ft.Add(gWaterToolRaiseCost); @@ -165,7 +165,7 @@ public: screenCoords.y += 10; // Draw lower cost amount - if (gWaterToolLowerCost != MONEY32_UNDEFINED && gWaterToolLowerCost != 0) + if (gWaterToolLowerCost != MONEY64_UNDEFINED && gWaterToolLowerCost != 0) { auto ft = Formatter(); ft.Add(gWaterToolLowerCost); From 2b78ee7b26796cdc4b3436509732d4981d690054 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 28 Jul 2021 10:31:16 +0200 Subject: [PATCH 083/681] Create other variants of ToMoney# --- src/openrct2/common.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 7592614748..405da3e3e1 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -148,6 +148,21 @@ static constexpr money64 ToMoney64(money32 value) return value == MONEY32_UNDEFINED ? MONEY64_UNDEFINED : value; } +static constexpr money64 ToMoney64(money16 value) +{ + return value == MONEY16_UNDEFINED ? MONEY64_UNDEFINED : value; +} + +static constexpr money32 ToMoney32(money64 value) +{ + return value == MONEY64_UNDEFINED ? MONEY32_UNDEFINED : static_cast(value); +} + +static constexpr money16 ToMoney16(money64 value) +{ + return value == MONEY64_UNDEFINED ? MONEY16_UNDEFINED : static_cast(value); +} + using EMPTY_ARGS_VOID_POINTER = void(); using rct_string_id = uint16_t; From 85043cb367636d996fdfb12f1c34c8050fadaa28 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 28 Jul 2021 10:34:48 +0200 Subject: [PATCH 084/681] Fix abs error --- src/openrct2-ui/windows/Finances.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 018cb68863..7b9c5a852e 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -741,7 +741,7 @@ static void window_finances_financial_graph_paint(rct_window* w, rct_drawpixelin continue; // Modifier balance then keep halving until less than 127 pixels - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 127) { balance /= 2; @@ -845,7 +845,7 @@ static void window_finances_park_value_graph_paint(rct_window* w, rct_drawpixeli continue; // Modifier balance then keep halving until less than 255 pixels - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 255) { balance /= 2; @@ -950,7 +950,7 @@ static void window_finances_profit_graph_paint(rct_window* w, rct_drawpixelinfo* continue; // Modifier balance then keep halving until less than 127 pixels - balance = abs(balance) >> yAxisScale; + balance = std::abs(balance) >> yAxisScale; while (balance > 127) { balance /= 2; From 584645a2d269604bfe1bf397d8075976d730f9c6 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 28 Jul 2021 10:38:09 +0200 Subject: [PATCH 085/681] Fix 'Type too large' error --- src/openrct2/localisation/Formatter.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index 39a968603f..7151fdbf94 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -72,8 +72,8 @@ public: template Formatter& Add(TDeduced value) { - static_assert(sizeof(TSpecified) <= sizeof(uintptr_t), "Type too large"); - static_assert(sizeof(TDeduced) <= sizeof(uintptr_t), "Type too large"); + static_assert(sizeof(TSpecified) <= sizeof(uint64_t), "Type too large"); + static_assert(sizeof(TDeduced) <= sizeof(uint64_t), "Type too large"); // clang-format off static_assert( @@ -91,14 +91,14 @@ public: ); // clang-format on - uintptr_t convertedValue; + uint64_t convertedValue; if constexpr (std::is_integral_v) { - convertedValue = static_cast(value); + convertedValue = static_cast(value); } else { - convertedValue = reinterpret_cast(value); + convertedValue = reinterpret_cast(value); } std::memcpy(CurrentBuf, &convertedValue, sizeof(TSpecified)); Increment(sizeof(TSpecified)); From b53b4d195274c83dbe7b11319d89259d2fcef04a Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Wed, 28 Jul 2021 13:00:03 +0100 Subject: [PATCH 086/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bac5da4cf4..0b50ae8fc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.44") +set(REPLAYS_VERSION "0.0.45") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "586F3930DE8D2C3880AAFD30ABC4D81ABC0B64A4") +set(REPLAYS_SHA1 "6E4108BF6F6C244EAE5A6F022EBA0F95B76647E5") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 369b497d2e..b702a16c38 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.44/replays.zip - 586F3930DE8D2C3880AAFD30ABC4D81ABC0B64A4 + https://github.com/OpenRCT2/replays/releases/download/v0.0.45/replays.zip + 6E4108BF6F6C244EAE5A6F022EBA0F95B76647E5 From 26ce138996d932a008081ee0275f733bb29f4c6e Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 29 Jul 2021 07:33:41 +0100 Subject: [PATCH 087/681] Update replays again --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b50ae8fc1..91e31c0b4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.45") +set(REPLAYS_VERSION "0.0.46") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "6E4108BF6F6C244EAE5A6F022EBA0F95B76647E5") +set(REPLAYS_SHA1 "4DDCF0A78F8B9A20601607173247C418A2526CC3") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index b702a16c38..014df4a74d 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.45/replays.zip - 6E4108BF6F6C244EAE5A6F022EBA0F95B76647E5 + https://github.com/OpenRCT2/replays/releases/download/v0.0.46/replays.zip + 4DDCF0A78F8B9A20601607173247C418A2526CC3 From efb3f8394b22f2fd1a7a437006c7893f991b2735 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 29 Jul 2021 12:37:28 +0200 Subject: [PATCH 088/681] Convert to/from money64 during export; convert completed company value --- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct12/RCT12.cpp | 17 ++++++++++++ src/openrct2/rct12/RCT12.h | 5 ++++ src/openrct2/rct2/S6Exporter.cpp | 47 ++++++++++++++++++-------------- src/openrct2/rct2/S6Importer.cpp | 2 +- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 8b52b87f83..070919e35b 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1346,7 +1346,7 @@ private: } gCurrentExpenditure = ToMoney64(_s4.total_expenditure); - gScenarioCompletedCompanyValue = ToMoney64(_s4.completed_company_value); + gScenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s4.completed_company_value); gTotalAdmissions = _s4.num_admissions; gTotalIncomeFromAdmissions = ToMoney64(_s4.admission_total_income); diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 3612b761e1..438ad3f979 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -13,6 +13,7 @@ #include "../localisation/Formatting.h" #include "../localisation/Localisation.h" #include "../ride/Track.h" +#include "../scenario/Scenario.h" #include "../world/Banner.h" #include "../world/Footpath.h" #include "../world/LargeScenery.h" @@ -1349,3 +1350,19 @@ RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType) return origTrackType; } + +money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue) +{ + if (origValue == RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE) + return COMPANY_VALUE_ON_FAILED_OBJECTIVE; + + return ToMoney64(origValue); +} + +money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue) +{ + if (origValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) + return RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE; + + return ToMoney32(origValue); +} diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 7d25590af7..d83239370f 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -932,3 +932,8 @@ std::string ConvertFormattedStringToRCT2(std::string_view buffer, size_t maxLeng std::string GetTruncatedRCT2String(std::string_view src, size_t maxLength); track_type_t RCT12FlatTrackTypeToOpenRCT2(RCT12TrackType origTrackType); RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType); + +static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; + +money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue); +money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 984a8d8bd6..ae2f35ecc8 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -200,8 +200,8 @@ void S6Exporter::Export() ExportEntities(); ExportParkName(); - _s6.initial_cash = gInitialCash; - _s6.current_loan = gBankLoan; + _s6.initial_cash = ToMoney32(gInitialCash); + _s6.current_loan = ToMoney32(gBankLoan); _s6.park_flags = gParkFlags; _s6.park_entrance_fee = gParkEntranceFee; // rct1_park_entrance_x @@ -226,7 +226,13 @@ void S6Exporter::Export() _s6.guests_in_park = gNumGuestsInPark; _s6.guests_heading_for_park = gNumGuestsHeadingForPark; - std::memcpy(_s6.expenditure_table, gExpenditureTable, sizeof(_s6.expenditure_table)); + for (size_t i = 0; i < RCT12_EXPENDITURE_TABLE_MONTH_COUNT; i++) + { + for (size_t j = 0; j < RCT12_EXPENDITURE_TYPE_COUNT; j++) + { + _s6.expenditure_table[i][j] = ToMoney32(gExpenditureTable[i][j]); + } + } _s6.last_guests_in_park = gNumGuestsInParkLastWeek; // pad_01357BCA @@ -268,7 +274,7 @@ void S6Exporter::Export() _s6.park_size = gParkSize; _s6.guest_generation_probability = _guestGenerationProbability; _s6.total_ride_value_for_money = gTotalRideValueForMoney; - _s6.maximum_loan = gMaxBankLoan; + _s6.maximum_loan = ToMoney32(gMaxBankLoan); _s6.guest_initial_cash = gGuestInitialCash; _s6.guest_initial_hunger = gGuestInitialHunger; _s6.guest_initial_thirst = gGuestInitialThirst; @@ -285,24 +291,25 @@ void S6Exporter::Export() ExportMarketingCampaigns(); - std::memcpy(_s6.balance_history, gCashHistory, sizeof(_s6.balance_history)); - - _s6.current_expenditure = gCurrentExpenditure; - _s6.current_profit = gCurrentProfit; - _s6.weekly_profit_average_dividend = gWeeklyProfitAverageDividend; + _s6.current_expenditure = ToMoney32(gCurrentExpenditure); + _s6.current_profit = ToMoney32(gCurrentProfit); + _s6.weekly_profit_average_dividend = ToMoney32(gWeeklyProfitAverageDividend); _s6.weekly_profit_average_divisor = gWeeklyProfitAverageDivisor; // pad_0135833A - std::memcpy(_s6.weekly_profit_history, gWeeklyProfitHistory, sizeof(_s6.weekly_profit_history)); + _s6.park_value = ToMoney32(gParkValue); - _s6.park_value = gParkValue; + for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) + { + _s6.balance_history[i] = ToMoney32(gCashHistory[i]); + _s6.weekly_profit_history[i] = ToMoney32(gWeeklyProfitHistory[i]); + _s6.park_value_history[i] = ToMoney32(gParkValueHistory[i]); + } - std::memcpy(_s6.park_value_history, gParkValueHistory, sizeof(_s6.park_value_history)); - - _s6.completed_company_value = gScenarioCompletedCompanyValue; + _s6.completed_company_value = OpenRCT2CompletedCompanyValueToRCT12(gScenarioCompletedCompanyValue); _s6.total_admissions = gTotalAdmissions; - _s6.income_from_admissions = gTotalIncomeFromAdmissions; - _s6.company_value = gCompanyValue; + _s6.income_from_admissions = ToMoney32(gTotalIncomeFromAdmissions); + _s6.company_value = ToMoney32(gCompanyValue); std::memcpy(_s6.peep_warning_throttle, gPeepWarningThrottle, sizeof(_s6.peep_warning_throttle)); // Awards @@ -324,10 +331,10 @@ void S6Exporter::Export() _s6.loan_hash = GetLoanHash(gInitialCash, gBankLoan, gMaxBankLoan); _s6.ride_count = ride_get_count(); // pad_013587CA - _s6.historical_profit = gHistoricalProfit; + _s6.historical_profit = ToMoney32(gHistoricalProfit); // pad_013587D4 String::Set(_s6.scenario_completed_name, sizeof(_s6.scenario_completed_name), gScenarioCompletedBy.c_str()); - _s6.cash = ENCRYPT_MONEY(gCash); + _s6.cash = ENCRYPT_MONEY(ToMoney32(gCash)); // pad_013587FC _s6.park_rating_casualty_penalty = gParkRatingCasualtyPenalty; _s6.map_size_units = gMapSizeUnits; @@ -693,7 +700,7 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) // pad_14E[0x02]; dst->total_customers = src->total_customers; - dst->total_profit = src->total_profit; + dst->total_profit = ToMoney32(src->total_profit); dst->popularity = src->popularity; dst->popularity_time_out = src->popularity_time_out; dst->popularity_next = src->popularity_next; @@ -743,7 +750,7 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) dst->connected_message_throttle = src->connected_message_throttle; dst->income_per_hour = src->income_per_hour; - dst->profit = src->profit; + dst->profit = ToMoney32(src->profit); for (uint8_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index b2ae988bbf..a7cbeb9458 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -324,7 +324,7 @@ public: gParkValueHistory[i] = ToMoney64(_s6.park_value_history[i]); } - gScenarioCompletedCompanyValue = ToMoney64(_s6.completed_company_value); + gScenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s6.completed_company_value); gTotalAdmissions = _s6.total_admissions; gTotalIncomeFromAdmissions = ToMoney64(_s6.income_from_admissions); gCompanyValue = ToMoney64(_s6.company_value); From 114eff46f09e6411e593b5a4a90cf09d1b6edd4c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 1 Aug 2021 10:12:37 +0200 Subject: [PATCH 089/681] Remove static attribute from ToMoney64/32/16 --- src/openrct2/common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 405da3e3e1..b562e64c00 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -143,22 +143,22 @@ using money64 = fixed64_1dp; #define MONEY32_UNDEFINED (static_cast(0x80000000)) #define MONEY64_UNDEFINED (static_cast(0x8000000000000000)) -static constexpr money64 ToMoney64(money32 value) +constexpr money64 ToMoney64(money32 value) { return value == MONEY32_UNDEFINED ? MONEY64_UNDEFINED : value; } -static constexpr money64 ToMoney64(money16 value) +constexpr money64 ToMoney64(money16 value) { return value == MONEY16_UNDEFINED ? MONEY64_UNDEFINED : value; } -static constexpr money32 ToMoney32(money64 value) +constexpr money32 ToMoney32(money64 value) { return value == MONEY64_UNDEFINED ? MONEY32_UNDEFINED : static_cast(value); } -static constexpr money16 ToMoney16(money64 value) +constexpr money16 ToMoney16(money64 value) { return value == MONEY64_UNDEFINED ? MONEY16_UNDEFINED : static_cast(value); } From abc4a02ff5dd8ffa7921c1ec81e33b55e115d7e0 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 1 Aug 2021 10:52:38 +0200 Subject: [PATCH 090/681] Fix missed ToMoney64() occurrence --- src/openrct2/rct1/S4Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 070919e35b..ecfa41ca63 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2302,7 +2302,7 @@ private: if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) gScenarioObjective.Currency = ToMoney64(CorrectRCT1ParkValue(_s4.scenario_objective_currency)); else - gScenarioObjective.Currency = _s4.scenario_objective_currency; + gScenarioObjective.Currency = ToMoney64(_s4.scenario_objective_currency); // This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead. if (_s4.scenario_objective_type == OBJECTIVE_BUILD_THE_BEST) From 277317b6f1191aee8a2fe983c35e8d285133cd5b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 1 Aug 2021 15:15:33 +0200 Subject: [PATCH 091/681] Bump network and plug-in API version --- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/scripting/ScriptEngine.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 444fa20f7c..e995de63f7 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // 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 static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 132d5055fa..ccba2dc6b3 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 32; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 33; # ifndef DISABLE_NETWORK class ScSocketBase; From 417c0f584f965a14003b848985069cf6b3417c08 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 4 May 2021 21:05:21 +0100 Subject: [PATCH 092/681] Handle > 255 rides in ride list window --- src/openrct2-ui/windows/RideList.cpp | 83 ++++++++++++++-------------- src/openrct2/interface/Window.cpp | 12 ---- src/openrct2/interface/Window.h | 2 - 3 files changed, 43 insertions(+), 54 deletions(-) diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 8d4ac072c2..aa932db73e 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -73,6 +73,7 @@ static rct_widget window_ride_list_widgets[] = { }; static bool _quickDemolishMode = false; +static std::vector _rideList; static void window_ride_list_mouseup(rct_window *w, rct_widgetindex widgetIndex); static void window_ride_list_resize(rct_window *w); @@ -198,7 +199,6 @@ rct_window* window_ride_list_open() } WindowInitScrollWidgets(window); window->page = PAGE_RIDES; - window->no_list_items = 0; window->selected_list_item = -1; window->frame_no = 0; window->min_width = 340; @@ -227,7 +227,6 @@ static void window_ride_list_mouseup(rct_window* w, rct_widgetindex widgetIndex) break; case WIDX_SORT: w->list_information_type = _window_ride_list_information_type; - w->no_list_items = 0; w->selected_list_item = -1; window_ride_list_refresh_list(w); break; @@ -237,7 +236,6 @@ static void window_ride_list_mouseup(rct_window* w, rct_widgetindex widgetIndex) if (w->page != widgetIndex - WIDX_TAB_1) { w->page = widgetIndex - WIDX_TAB_1; - w->no_list_items = 0; w->frame_no = 0; w->selected_list_item = -1; if (w->page != PAGE_RIDES && _window_ride_list_information_type > INFORMATION_TYPE_RUNNING_COST) @@ -407,16 +405,14 @@ static void window_ride_list_update(rct_window* w) */ static void window_ride_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) { - int32_t top; - - *height = w->no_list_items * SCROLLABLE_ROW_HEIGHT; + *height = static_cast(_rideList.size() * SCROLLABLE_ROW_HEIGHT); if (w->selected_list_item != -1) { w->selected_list_item = -1; w->Invalidate(); } - top = *height - window_ride_list_widgets[WIDX_LIST].bottom + window_ride_list_widgets[WIDX_LIST].top + 21; + auto top = *height - window_ride_list_widgets[WIDX_LIST].bottom + window_ride_list_widgets[WIDX_LIST].top + 21; if (top < 0) top = 0; if (top < w->scrolls[0].v_top) @@ -432,14 +428,12 @@ static void window_ride_list_scrollgetsize(rct_window* w, int32_t scrollIndex, i */ static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - int32_t index; - - index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index >= w->no_list_items) + auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index < 0 || static_cast(index) >= _rideList.size()) return; // Open ride window - auto rideIndex = w->list_item_positions[index]; + auto rideIndex = _rideList[index]; auto ride = get_ride(rideIndex); if (_quickDemolishMode && network_get_mode() != NETWORK_MODE_CLIENT) { @@ -460,10 +454,8 @@ static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, */ static void window_ride_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - int32_t index; - - index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index >= w->no_list_items) + auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index < 0 || static_cast(index) >= _rideList.size()) return; w->selected_list_item = index; @@ -521,7 +513,7 @@ static void window_ride_list_invalidate(rct_window* w) const auto& rideManager = GetRideManager(); auto allClosed = true; auto allOpen = false; - if (w->no_list_items > 0 && std::size(rideManager) != 0) + if (_rideList.size() > 0 && std::size(rideManager) != 0) { auto c = static_cast(w->page); allClosed = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& ride) { @@ -561,7 +553,7 @@ static void window_ride_list_paint(rct_window* w, rct_drawpixelinfo* dpi) // Draw number of attractions on bottom auto ft = Formatter(); - ft.Add(w->no_list_items); + ft.Add(static_cast(_rideList.size())); DrawTextBasic( dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[w->page], ft); @@ -578,10 +570,10 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi->width, dpi->height } }, ColourMapA[w->colours[1]].mid_light); auto y = 0; - for (auto i = 0; i < w->no_list_items; i++) + for (size_t i = 0; i < _rideList.size(); i++) { rct_string_id format = (_quickDemolishMode ? STR_RED_STRINGID : STR_BLACK_STRING); - if (i == w->selected_list_item) + if (i == static_cast(w->selected_list_item)) { // Background highlight gfx_filter_rect(dpi, 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1, FilterPaletteID::PaletteDarken1); @@ -589,7 +581,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, } // Get ride - auto ride = get_ride(w->list_item_positions[i]); + auto ride = get_ride(_rideList[i]); if (ride == nullptr) continue; @@ -783,13 +775,25 @@ static void window_ride_list_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* dpi, ImageId(sprite_idx), w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_TAB_3].left, w->widgets[WIDX_TAB_3].top }); } +/** + * Bubbles an item one position up in the window list. This is done by swapping + * the two locations. + * rct2: New function not from rct2 + */ +static void window_bubble_list_item(rct_window* w, int32_t index) +{ + std::swap(_rideList[index], _rideList[index + 1]); +} + /** * * rct2: 0x006B39A8 */ void window_ride_list_refresh_list(rct_window* w) { - int32_t list_index = 0; + _rideList.clear(); + + size_t list_index = 0; for (auto& ridec : GetRideManager()) { auto ride = &ridec; @@ -802,8 +806,8 @@ void window_ride_list_refresh_list(rct_window* w) ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_LIST; } - w->list_item_positions[list_index] = ride->id; - int32_t current_list_position = list_index; + _rideList.push_back(ride->id); + auto current_list_position = static_cast(list_index); switch (w->list_information_type) { case INFORMATION_TYPE_STATUS: @@ -811,7 +815,7 @@ void window_ride_list_refresh_list(rct_window* w) auto strA = ride->GetName(); while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { auto strB = otherRide->GetName(); @@ -826,7 +830,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_POPULARITY: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->popularity * 4 <= otherRide->popularity * 4) @@ -839,7 +843,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_SATISFACTION: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->satisfaction * 5 <= otherRide->satisfaction * 5) @@ -852,7 +856,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_PROFIT: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->profit <= otherRide->profit) @@ -865,7 +869,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_TOTAL_CUSTOMERS: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->total_customers <= otherRide->total_customers) @@ -878,7 +882,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_TOTAL_PROFIT: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->total_profit <= otherRide->total_profit) @@ -891,7 +895,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_CUSTOMERS: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride_customers_per_hour(ride) <= ride_customers_per_hour(otherRide)) @@ -904,7 +908,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_AGE: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->build_date <= otherRide->build_date) @@ -917,7 +921,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_INCOME: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->income_per_hour <= otherRide->income_per_hour) @@ -930,7 +934,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_RUNNING_COST: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->upkeep_cost <= otherRide->upkeep_cost) @@ -943,7 +947,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_QUEUE_LENGTH: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->GetTotalQueueLength() <= otherRide->GetTotalQueueLength()) @@ -956,7 +960,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_QUEUE_TIME: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->GetMaxQueueTime() <= otherRide->GetMaxQueueTime()) @@ -969,7 +973,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_RELIABILITY: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->reliability_percentage <= otherRide->reliability_percentage) @@ -982,7 +986,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_DOWN_TIME: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->downtime <= otherRide->downtime) @@ -995,7 +999,7 @@ void window_ride_list_refresh_list(rct_window* w) case INFORMATION_TYPE_GUESTS_FAVOURITE: while (--current_list_position >= 0) { - auto otherRide = get_ride(w->list_item_positions[current_list_position]); + auto otherRide = get_ride(_rideList[current_list_position]); if (otherRide != nullptr) { if (ride->guests_favourite <= otherRide->guests_favourite) @@ -1010,7 +1014,6 @@ void window_ride_list_refresh_list(rct_window* w) list_index++; } - w->no_list_items = list_index; w->selected_list_item = -1; w->Invalidate(); } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index d12d1b5318..2722987872 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1631,18 +1631,6 @@ void window_event_scroll_paint_call(rct_window* w, rct_drawpixelinfo* dpi, int32 w->event_handlers->scroll_paint(w, dpi, scrollIndex); } -/** - * Bubbles an item one position up in the window list. This is done by swapping - * the two locations. - * rct2: New function not from rct2 - */ -void window_bubble_list_item(rct_window* w, int32_t item_position) -{ - char swap = w->list_item_positions[item_position]; - w->list_item_positions[item_position] = w->list_item_positions[item_position + 1]; - w->list_item_positions[item_position + 1] = swap; -} - /** * * rct2: 0x006ED710 diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index bbb9727606..9ad150c9b9 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -805,8 +805,6 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords); void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords); -void window_bubble_list_item(rct_window* w, int32_t item_position); - void window_align_tabs(rct_window* w, rct_widgetindex start_tab_id, rct_widgetindex end_tab_id); void window_staff_list_init_vars(); From 864de57877773bda0d1b96714faae082df635849 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 1 Aug 2021 17:26:43 +0200 Subject: [PATCH 093/681] Fix #14667: Unpurchaseable land tiles in Extreme Hawaiian Island --- distribution/changelog.txt | 1 + src/openrct2/rct2/S6Importer.cpp | 35 ++++++++++++++++++++++++++++++-- src/openrct2/world/Map.cpp | 5 ++++- src/openrct2/world/Map.h | 3 ++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d30b662143..bfcd3d25e8 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook - Feature: [#15143] Added a shortcut key for Giant Screenshot. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. +- Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index a7cbeb9458..adfd8c04f4 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -472,6 +472,12 @@ public: auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); park.Name = GetUserString(_s6.park_name); + FixLandOwnership(); + + research_determine_first_of_type(); + } + void FixLandOwnership() const + { if (String::Equals(_s6.scenario_filename, "Europe - European Cultural Festival.SC6")) { // This scenario breaks pathfinding. Create passages between the worlds. (List is grouped by neighbouring tiles.) @@ -486,8 +492,33 @@ public: OWNERSHIP_OWNED); // clang-format on } - - research_determine_first_of_type(); + else if (String::Equals(gScenarioFileName, "N America - Extreme Hawaiian Island.SC6")) + { + FixLandOwnershipTilesWithOwnership( + { + { 132, 124 }, + { 133, 124 }, + { 133, 125 }, + { 133, 126 }, + { 119, 35 }, + { 132, 62 }, + { 133, 67 }, + { 136, 71 }, + { 87, 33 }, + { 87, 34 }, + { 90, 36 }, + { 91, 36 }, + }, + OWNERSHIP_OWNED); + // We set the doNotDowngrade flag for cases where the player has used a cheat to own all land. + FixLandOwnershipTilesWithOwnership( + { + { 49, 99 }, + { 50, 99 }, + { 88, 110 }, + }, + OWNERSHIP_AVAILABLE, true); + } } void ImportRides() diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 875484769e..8500825095 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2494,13 +2494,16 @@ void FixLandOwnershipTiles(std::initializer_list tiles) FixLandOwnershipTilesWithOwnership(tiles, OWNERSHIP_AVAILABLE); } -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8_t ownership) +void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade) { for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile) { auto surfaceElement = map_get_surface_element_at(tile->ToCoordsXY()); if (surfaceElement != nullptr) { + if (doNotDowngrade && surfaceElement->GetOwnership() == OWNERSHIP_OWNED) + continue; + surfaceElement->SetOwnership(ownership); update_park_fences_around_tile({ (*tile).x * 32, (*tile).y * 32 }); } diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index ec2ff4f335..9fae19b987 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -300,6 +300,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos); void FixLandOwnershipTiles(std::initializer_list tiles); -void FixLandOwnershipTilesWithOwnership(std::initializer_list tiles, uint8_t ownership); +void FixLandOwnershipTilesWithOwnership( + std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade = false); #endif From e3c15817e472a470fa82c201970a6a09f6720813 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 7 Jun 2021 19:14:11 +0200 Subject: [PATCH 094/681] Use GitHub issue forms --- .github/ISSUE_TEMPLATE/bug_report.md | 35 -------------- .github/ISSUE_TEMPLATE/bug_report.yaml | 63 ++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + 3 files changed, 64 insertions(+), 35 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index e0406d2257..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug Report -about: Describe an issue you encountered when playing OpenRCT2 -title: '' -labels: '' -assignees: '' - ---- - - -**OS:** [e.g. Windows 10] -**Version:** [e.g. 0.3.4.1] -**Commit/Build:** [e.g. 426e106] - - - - - -- [ ] Reproducible in RCT2 (vanilla)? -- [ ] Specific to multiplayer? - -**Steps to reproduce:** -1. -2. - -**Dump file** - - -**Screenshots / Video:** - - -**Save game:** - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000000..1d69d594c9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,63 @@ +name: Bug report +title: "[Bug] " +description: Report an issue you encountered when playing OpenRCT2 +labels: +- bug + +body: +- type: markdown + attributes: + value: Before filing this bug, [please check if it hasn't already been reported](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+is%3Aopen+label%3Abug). If it has, please add useful information to the existing issue instead. + +- type: input + attributes: + label: Operating System + placeholder: Windows 10, 64-bit + validations: + required: true + +- type: input + attributes: + label: OpenRCT2 build + placeholder: OpenRCT2, v0.3.4.1 (d76611e on develop) provided by GitHub + description: You can copy the version information from the About window. + validations: + required: true + +- type: textarea + attributes: + label: Describe the issue + description: Please describe the issue you are experiencing here. + validations: + required: true + +- type: dropdown + attributes: + label: Area(s) with issue? + description: What things had an issue? Check all that apply. + multiple: true + options: + - The bug also exists in RCT2 (vanilla) + - This bug is specific to multiplayer + validations: + required: false + +- type: textarea + attributes: + label: Steps to reproduce + description: We highly suggest including a screenshots and a bug report log (System tray->Report bug). + placeholder: Tell us the steps required to trigger your bug. + value: | + 1. + 2. + 3. + validations: + required: true + +- type: textarea + attributes: + label: Attachments + description: Please add any screenshots, dump files and/or videos here that may help us fix the issue. + placeholder: Drag and drop files here to add them + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3ba13e0cec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false From 6ff1832cc6493b67872b04b8ac664c99988a1490 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 24 Jul 2021 13:07:32 +0200 Subject: [PATCH 095/681] Add Localisation and Discord links to issue page --- .github/ISSUE_TEMPLATE/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0cec..7f833fb616 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,8 @@ blank_issues_enabled: false +contact_links: +- name: Localisation + url: https://github.com/OpenRCT2/Localisation + about: For localisation issues, go to the localisation repository +- name: OpenRCT2 Discord Server + url: https://discord.gg/ZXZd8D8 + about: Join our Discord server From 8ef9e9f6cca9c90f03ad7980bc3a554b7bdc536f Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 24 Jul 2021 12:46:16 +0200 Subject: [PATCH 096/681] Add feature request form --- .github/ISSUE_TEMPLATE/feature_request.yaml | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000000..f09bfa50be --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,30 @@ +name: Feature request +title: "[Feature] " +description: Request a new feature to be added to OpenRCT2. +labels: +- feature + +body: +- type: markdown + attributes: + value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+is%3Aopen+label%3Afeature). If it has, please add to the existing issue instead. + +- type: textarea + attributes: + label: Describe the feature + placeholder: Describe your feature idea here. You can paste or drag & drop attachments here. + validations: + required: true + +- type: dropdown + attributes: + label: Feature type + description: What things had an issue? Check all that apply. + multiple: true + options: + - Quality of life + - Multiplayer + - Plug-ins + - Other + validations: + required: true From 3011cb87c20ce147efaad2c881f11b40ee90e102 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 24 Jul 2021 13:40:40 +0200 Subject: [PATCH 097/681] Add missing full stops --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 1d69d594c9..66b91afd2b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,6 +1,6 @@ name: Bug report title: "[Bug] " -description: Report an issue you encountered when playing OpenRCT2 +description: Report an issue you encountered when playing OpenRCT2. labels: - bug diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7f833fb616..04d4701a79 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: false contact_links: - name: Localisation url: https://github.com/OpenRCT2/Localisation - about: For localisation issues, go to the localisation repository + about: For localisation issues, go to the localisation repository. - name: OpenRCT2 Discord Server url: https://discord.gg/ZXZd8D8 - about: Join our Discord server + about: Join our Discord server. From 5ed86390293dbb87ca917ec49f1786f8dd30858c Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 28 Jul 2021 00:16:45 +0200 Subject: [PATCH 098/681] Make suggested changes - Remove titles (we have tags, and forces user to enter something) - Remove double space - Update discord invite description --- .github/ISSUE_TEMPLATE/bug_report.yaml | 3 +-- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 66b91afd2b..455806140e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,5 +1,4 @@ name: Bug report -title: "[Bug] " description: Report an issue you encountered when playing OpenRCT2. labels: - bug @@ -34,7 +33,7 @@ body: - type: dropdown attributes: label: Area(s) with issue? - description: What things had an issue? Check all that apply. + description: What things had an issue? Check all that apply. multiple: true options: - The bug also exists in RCT2 (vanilla) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 04d4701a79..f09f42a938 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,4 +5,4 @@ contact_links: about: For localisation issues, go to the localisation repository. - name: OpenRCT2 Discord Server url: https://discord.gg/ZXZd8D8 - about: Join our Discord server. + about: For help with running or playing the game, join our Discord server. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index f09bfa50be..c428c1d7c2 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,5 +1,4 @@ name: Feature request -title: "[Feature] " description: Request a new feature to be added to OpenRCT2. labels: - feature @@ -19,7 +18,7 @@ body: - type: dropdown attributes: label: Feature type - description: What things had an issue? Check all that apply. + description: What things had an issue? Check all that apply. multiple: true options: - Quality of life From 3503a433dc277f740f6dc1106b99b9df20fb6b1b Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Mon, 2 Aug 2021 04:07:54 +0000 Subject: [PATCH 099/681] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-OO.txt | 3 +++ data/language/fi-FI.txt | 2 ++ data/language/fr-FR.txt | 1 + data/language/pt-BR.txt | 3 +++ 4 files changed, 9 insertions(+) diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index 1967ea3060..c516132598 100644 --- a/data/language/eo-OO.txt +++ b/data/language/eo-OO.txt @@ -3651,6 +3651,9 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Vendas: {BLACK}{STRING} STR_6453 :Kopii informojn de versio +STR_6454 :Ne povas renomi rubandon… +STR_6455 :Ne povas renomi surskribaĵon… +STR_6456 :Giganta Ekrankopio ############# # Scenarios # diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 6a2e3df826..0df643a943 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -3658,6 +3658,8 @@ STR_6450 :{BLACK}”{STRING}” STR_6451 :{BLACK}”{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Myy: {BLACK}{STRING} STR_6453 :Kopioi versiotiedot +STR_6454 :Banneria ei voi uudelleennimetä… +STR_6455 :Kylttiä ei voi uudelleennimetä… ############# # Scenarios # diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index adc8f720db..37fd6ffb0f 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -3660,6 +3660,7 @@ STR_6452 :{WINDOW_COLOUR_2}Vend : {BLACK}{STRING} STR_6453 :Copier les informations de version STR_6454 :Impossible de renommer la bannière… STR_6455 :Impossible de renommer le panneau… +STR_6456 :Capture d’écran géante ############# # Scenarios # diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 010a9667e5..34266b9163 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -3651,6 +3651,9 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Vende: {BLACK}{STRING} STR_6453 :Copiar informações da versão +STR_6454 :Não é possível renomear o banner… +STR_6455 :Não é possível renomear a placa… +STR_6456 :Captura Gigante de Tela ############# # Scenarios # From 5f853df1fde09aa0e98ce2895d945831784c6e47 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 5 Apr 2021 18:01:43 +0100 Subject: [PATCH 100/681] Remove gS6Info --- src/openrct2-ui/input/Shortcuts.cpp | 18 ++++----- .../interface/ViewportInteraction.cpp | 4 +- .../windows/EditorBottomToolbar.cpp | 38 +++++++++---------- .../windows/EditorObjectSelection.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 25 ++++++------ src/openrct2-ui/windows/LoadSave.cpp | 4 +- src/openrct2-ui/windows/SavePrompt.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 12 +++--- src/openrct2/Editor.cpp | 28 ++++++-------- src/openrct2/Editor.h | 2 + src/openrct2/EditorObjectSelectionSession.cpp | 4 +- src/openrct2/interface/Window.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 6 +-- src/openrct2/rct2/S6Importer.cpp | 15 ++++---- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 4 +- src/openrct2/scenario/Scenario.cpp | 19 +--------- src/openrct2/scenario/Scenario.h | 2 +- src/openrct2/scripting/ScPark.hpp | 2 +- src/openrct2/world/Park.cpp | 5 ++- 20 files changed, 90 insertions(+), 108 deletions(-) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 662f692f3f..087009bdcc 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -189,7 +189,7 @@ static void ShortcutAdjustLand() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { @@ -208,7 +208,7 @@ static void ShortcutAdjustWater() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { @@ -227,7 +227,7 @@ static void ShortcutBuildScenery() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { @@ -246,7 +246,7 @@ static void ShortcutBuildPaths() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { @@ -353,7 +353,7 @@ static void ShortcutShowMap() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) context_open_window(WC_MAP); } @@ -396,7 +396,7 @@ static void ShortcutClearScenery() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { @@ -422,7 +422,7 @@ static void ShortcutQuickSaveGame() { auto intent = Intent(WC_LOADSAVE); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name }); + intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); context_open_intent(&intent); } } @@ -439,7 +439,7 @@ static void ShortcutLoadGame() static void ShortcutOpenSceneryPicker() { if ((gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - || (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gS6Info.editor_step != EditorStep::LandscapeEditor)) + || (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gEditorStep != EditorStep::LandscapeEditor)) return; rct_window* window_scenery = window_find_by_class(WC_SCENERY); @@ -729,7 +729,7 @@ void ShortcutManager::RegisterDefaultShortcuts() { window_close_all(); } - else if (gS6Info.editor_step == EditorStep::LandscapeEditor) + else if (gEditorStep == EditorStep::LandscapeEditor) { window_close_top(); } diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index eb1628903d..24f5914c2e 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -63,7 +63,7 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord return info; // - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner) return info; info = get_map_coordinates_from_pos( @@ -250,7 +250,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor return info; // - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner) return info; constexpr auto flags = static_cast( diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 62f4d61997..4301a10584 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -126,7 +126,7 @@ rct_window* window_editor_bottom_toolbar_open() void window_editor_bottom_toolbar_jump_back_to_object_selection() { window_close_all(); - gS6Info.editor_step = EditorStep::ObjectSelection; + gEditorStep = EditorStep::ObjectSelection; gfx_invalidate_screen(); } @@ -139,7 +139,7 @@ void window_editor_bottom_toolbar_jump_back_to_landscape_editor() window_close_all(); set_all_scenery_items_invented(); scenery_set_default_placement_configuration(); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; context_open_window(WC_MAP); gfx_invalidate_screen(); } @@ -152,7 +152,7 @@ static void window_editor_bottom_toolbar_jump_back_to_invention_list_set_up() { window_close_all(); context_open_window(WC_EDITOR_INVENTION_LIST); - gS6Info.editor_step = EditorStep::InventionsListSetUp; + gEditorStep = EditorStep::InventionsListSetUp; gfx_invalidate_screen(); } @@ -164,7 +164,7 @@ void window_editor_bottom_toolbar_jump_back_to_options_selection() { window_close_all(); context_open_window(WC_EDITOR_SCENARIO_OPTIONS); - gS6Info.editor_step = EditorStep::OptionsSelection; + gEditorStep = EditorStep::OptionsSelection; gfx_invalidate_screen(); } @@ -224,7 +224,7 @@ void window_editor_bottom_toolbar_jump_forward_to_invention_list_set_up() { window_close_all(); context_open_window(WC_EDITOR_INVENTION_LIST); - gS6Info.editor_step = EditorStep::InventionsListSetUp; + gEditorStep = EditorStep::InventionsListSetUp; } else { @@ -242,7 +242,7 @@ void window_editor_bottom_toolbar_jump_forward_to_options_selection() { window_close_all(); context_open_window(WC_EDITOR_SCENARIO_OPTIONS); - gS6Info.editor_step = EditorStep::OptionsSelection; + gEditorStep = EditorStep::OptionsSelection; gfx_invalidate_screen(); } @@ -254,7 +254,7 @@ void window_editor_bottom_toolbar_jump_forward_to_objective_selection() { window_close_all(); context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS); - gS6Info.editor_step = EditorStep::ObjectiveSelection; + gEditorStep = EditorStep::ObjectiveSelection; gfx_invalidate_screen(); } @@ -274,7 +274,7 @@ void window_editor_bottom_toolbar_jump_forward_to_save_scenario() window_close_all(); auto intent = Intent(WC_LOADSAVE); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); - intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name }); + intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); context_open_intent(&intent); } @@ -289,12 +289,12 @@ static void window_editor_bottom_toolbar_mouseup([[maybe_unused]] rct_window* w, if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) || (GetNumFreeEntities() == MAX_ENTITIES && !(gParkFlags & PARK_FLAGS_SPRITES_INITIALISED))) { - previous_button_mouseup_events[EnumValue(gS6Info.editor_step)](); + previous_button_mouseup_events[EnumValue(gEditorStep)](); } } else if (widgetIndex == WIDX_NEXT_STEP_BUTTON) { - next_button_mouseup_events[EnumValue(gS6Info.editor_step)](); + next_button_mouseup_events[EnumValue(gEditorStep)](); } } @@ -337,11 +337,11 @@ void window_editor_bottom_toolbar_invalidate(rct_window* w) } else { - if (gS6Info.editor_step == EditorStep::ObjectSelection) + if (gEditorStep == EditorStep::ObjectSelection) { hide_previous_step_button(); } - else if (gS6Info.editor_step == EditorStep::RollercoasterDesigner) + else if (gEditorStep == EditorStep::RollercoasterDesigner) { hide_next_step_button(); } @@ -364,7 +364,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) bool drawPreviousButton = false; bool drawNextButton = false; - if (gS6Info.editor_step == EditorStep::ObjectSelection) + if (gEditorStep == EditorStep::ObjectSelection) { drawNextButton = true; } @@ -396,7 +396,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom + w->windowPos.y, FilterPaletteID::Palette51); } - if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner) { gfx_filter_rect( dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + w->windowPos.x, @@ -421,7 +421,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30); } - if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner) { gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30); } @@ -432,7 +432,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) + w->windowPos.x; int16_t stateY = w->height - 0x0C + w->windowPos.y; DrawTextBasic( - dpi, { stateX, stateY }, EditorStepNames[EnumValue(gS6Info.editor_step)], {}, + dpi, { stateX, stateY }, EditorStepNames[EnumValue(gEditorStep)], {}, { static_cast(NOT_TRANSLUCENT(w->colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE }); if (drawPreviousButton) @@ -456,7 +456,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) + w->windowPos.x; int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->windowPos.y; - rct_string_id stringId = EditorStepNames[EnumValue(gS6Info.editor_step) - 1]; + rct_string_id stringId = EditorStepNames[EnumValue(gEditorStep) - 1]; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_OBJECT_SELECTION; @@ -464,7 +464,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); } - if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner) { gfx_draw_sprite( dpi, ImageId(SPR_NEXT), @@ -485,7 +485,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) + w->windowPos.x; int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->windowPos.y; - rct_string_id stringId = EditorStepNames[EnumValue(gS6Info.editor_step) + 1]; + rct_string_id stringId = EditorStepNames[EnumValue(gEditorStep) + 1]; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 53d6b67516..86f7cd248d 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1336,7 +1336,7 @@ static void window_editor_object_selection_manage_tracks() set_every_ride_type_invented(); set_every_ride_entry_invented(); - gS6Info.editor_step = EditorStep::DesignsManager; + gEditorStep = EditorStep::DesignsManager; int32_t entry_index = 0; for (; object_entry_get_chunk(ObjectType::Ride, entry_index) == nullptr; entry_index++) diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index b13a2ffcf3..60fac3b0ee 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -375,11 +375,12 @@ static void window_editor_objective_options_main_mouseup(rct_window* w, rct_widg break; } case WIDX_SCENARIO_NAME: - window_text_input_raw_open(w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gS6Info.name, 64); + window_text_input_raw_open( + w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gScenarioName.c_str(), 64); break; case WIDX_DETAILS: window_text_input_raw_open( - w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gS6Info.details, 256); + w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gScenarioDetails.c_str(), 256); break; } } @@ -448,7 +449,7 @@ static void window_editor_objective_options_show_category_dropdown(rct_window* w WindowDropdownShowTextCustomWidth( { w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, w->colours[1], 0, Dropdown::Flag::StayOpen, 5, dropdownWidget->width() - 3); - Dropdown::SetChecked(gS6Info.category, true); + Dropdown::SetChecked(gScenarioCategory, true); } static void window_editor_objective_options_arg_1_increase(rct_window* w) @@ -654,9 +655,9 @@ static void window_editor_objective_options_main_dropdown(rct_window* w, rct_wid window_editor_objective_options_set_objective(w, newObjectiveType); break; case WIDX_CATEGORY_DROPDOWN: - if (gS6Info.category != static_cast(dropdownIndex)) + if (gScenarioCategory != static_cast(dropdownIndex)) { - gS6Info.category = static_cast(dropdownIndex); + gScenarioCategory = static_cast(dropdownIndex); w->Invalidate(); } break; @@ -708,19 +709,19 @@ static void window_editor_objective_options_main_textinput(rct_window* w, rct_wi auto action = ParkSetNameAction(text); GameActions::Execute(&action); - if (gS6Info.name[0] == '\0') + if (gScenarioName.empty()) { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - String::Set(gS6Info.name, sizeof(gS6Info.name), park.Name.c_str()); + gScenarioName = park.Name; } break; } case WIDX_SCENARIO_NAME: - safe_strcpy(gS6Info.name, text, std::size(gS6Info.name)); + gScenarioName = text; w->Invalidate(); break; case WIDX_DETAILS: - safe_strcpy(gS6Info.details, text, std::size(gS6Info.details)); + gScenarioDetails = text; w->Invalidate(); break; } @@ -901,7 +902,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi ft = Formatter(); ft.Add(STR_STRING); - ft.Add(gS6Info.name); + ft.Add(gScenarioName.c_str()); DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); // Scenario details label @@ -914,7 +915,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi ft = Formatter(); ft.Add(STR_STRING); - ft.Add(gS6Info.details); + ft.Add(gScenarioDetails.c_str()); DrawTextWrapped(dpi, screenCoords, width, STR_BLACK_STRING, ft); // Scenario category label @@ -924,7 +925,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi // Scenario category value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top }; ft = Formatter(); - ft.Add(ScenarioCategoryStringIds[gS6Info.category]); + ft.Add(ScenarioCategoryStringIds[gScenarioCategory]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 67d1376a6d..7a26d65808 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -1061,7 +1061,7 @@ static void window_loadsave_select(rct_window* w, const char* path) save_path(&gConfigGeneral.last_save_scenario_directory, pathBuffer); int32_t parkFlagsBackup = gParkFlags; gParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED; - gS6Info.editor_step = EditorStep::Invalid; + gEditorStep = EditorStep::Invalid; safe_strcpy(gScenarioFileName, pathBuffer, sizeof(gScenarioFileName)); int32_t success = scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2); gParkFlags = parkFlagsBackup; @@ -1075,7 +1075,7 @@ static void window_loadsave_select(rct_window* w, const char* path) else { context_show_error(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); - gS6Info.editor_step = EditorStep::ObjectiveSelection; + gEditorStep = EditorStep::ObjectiveSelection; window_loadsave_invoke_callback(MODAL_RESULT_FAIL, pathBuffer); } break; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index cb320b9d40..96e8b886ea 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -220,7 +220,7 @@ static void window_save_prompt_mouseup(rct_window* w, rct_widgetindex widgetInde { intent = new Intent(WC_LOADSAVE); intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent->putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name }); + intent->putExtra(INTENT_EXTRA_PATH, gScenarioName); } else { diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 62368c5da4..1f4f1f08b1 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -561,7 +561,7 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd { auto intent = Intent(WC_LOADSAVE); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name }); + intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); context_open_intent(&intent); } else @@ -685,20 +685,20 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; - if (gS6Info.editor_step != EditorStep::LandscapeEditor) + if (gEditorStep != EditorStep::LandscapeEditor) { window_top_toolbar_widgets[WIDX_LAND].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_WATER].type = WindowWidgetType::Empty; } - if (gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if (gEditorStep != EditorStep::RollercoasterDesigner) { window_top_toolbar_widgets[WIDX_RIDES].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; } - if (gS6Info.editor_step != EditorStep::LandscapeEditor && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if (gEditorStep != EditorStep::LandscapeEditor && gEditorStep != EditorStep::RollercoasterDesigner) { window_top_toolbar_widgets[WIDX_MAP].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_SCENERY].type = WindowWidgetType::Empty; @@ -3273,7 +3273,7 @@ static void top_toolbar_init_map_menu(rct_window* w, rct_widget* widget) auto i = 0; gDropdownItemsFormat[i++] = STR_SHORTCUT_SHOW_MAP; gDropdownItemsFormat[i++] = STR_EXTRA_VIEWPORT; - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gS6Info.editor_step == EditorStep::LandscapeEditor) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gEditorStep == EditorStep::LandscapeEditor) { gDropdownItemsFormat[i++] = STR_MAPGEN_WINDOW_TITLE; } @@ -3301,7 +3301,7 @@ static void top_toolbar_init_map_menu(rct_window* w, rct_widget* widget) static void top_toolbar_map_menu_dropdown(int16_t dropdownIndex) { int32_t customStartIndex = 3; - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gS6Info.editor_step == EditorStep::LandscapeEditor) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gEditorStep == EditorStep::LandscapeEditor) { customStartIndex++; } diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index af4a1fbe30..96444bb90e 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -47,6 +47,8 @@ using namespace OpenRCT2; +EditorStep gEditorStep; + namespace Editor { static std::array, EnumValue(ObjectType::Count)> _editorSelectedObjectFlags; @@ -84,9 +86,9 @@ namespace Editor object_list_load(); OpenRCT2::GetContext()->GetGameState()->InitAll(150); gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; - gS6Info.editor_step = EditorStep::ObjectSelection; + gEditorStep = EditorStep::ObjectSelection; gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; - gS6Info.category = SCENARIO_CATEGORY_OTHER; + gScenarioCategory = SCENARIO_CATEGORY_OTHER; viewport_init_all(); rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN); mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); @@ -130,17 +132,11 @@ namespace Editor } gParkFlags |= PARK_FLAGS_NO_MONEY; - safe_strcpy(gS6Info.name, gScenarioName.c_str(), sizeof(gS6Info.name)); - safe_strcpy(gS6Info.details, gScenarioDetails.c_str(), sizeof(gS6Info.details)); - gS6Info.objective_type = gScenarioObjective.Type; - gS6Info.objective_arg_1 = gScenarioObjective.Year; - gS6Info.objective_arg_2 = gScenarioObjective.Currency; - gS6Info.objective_arg_3 = gScenarioObjective.NumGuests; climate_reset(gClimate); gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; - gS6Info.editor_step = EditorStep::ObjectiveSelection; - gS6Info.category = SCENARIO_CATEGORY_OTHER; + gEditorStep = EditorStep::ObjectiveSelection; + gScenarioCategory = SCENARIO_CATEGORY_OTHER; viewport_init_all(); News::InitQueue(); context_open_window_view(WV_EDITOR_MAIN); @@ -162,7 +158,7 @@ namespace Editor object_list_load(); OpenRCT2::GetContext()->GetGameState()->InitAll(150); SetAllLandOwned(); - gS6Info.editor_step = EditorStep::ObjectSelection; + gEditorStep = EditorStep::ObjectSelection; viewport_init_all(); rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN); mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); @@ -183,7 +179,7 @@ namespace Editor object_list_load(); OpenRCT2::GetContext()->GetGameState()->InitAll(150); SetAllLandOwned(); - gS6Info.editor_step = EditorStep::ObjectSelection; + gEditorStep = EditorStep::ObjectSelection; viewport_init_all(); rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN); mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ()); @@ -242,7 +238,7 @@ namespace Editor load_from_sv4(path); ClearMapForEditing(true); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; gScreenAge = 0; gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; viewport_init_all(); @@ -256,7 +252,7 @@ namespace Editor load_from_sc4(path); ClearMapForEditing(false); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; gScreenAge = 0; gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; viewport_init_all(); @@ -285,7 +281,7 @@ namespace Editor ClearMapForEditing(loadedFromSave); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; gScreenAge = 0; gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; viewport_init_all(); @@ -371,7 +367,7 @@ namespace Editor return; } - switch (gS6Info.editor_step) + switch (gEditorStep) { case EditorStep::ObjectSelection: if (window_find_by_class(WC_EDITOR_OBJECT_SELECTION)) diff --git a/src/openrct2/Editor.h b/src/openrct2/Editor.h index cc617791b0..8a7499f2d8 100644 --- a/src/openrct2/Editor.h +++ b/src/openrct2/Editor.h @@ -44,6 +44,8 @@ enum class EditorStep : uint8_t Invalid = 255, // 255 }; +extern EditorStep gEditorStep; + void editor_open_windows_for_current_step(); #endif diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index cd13e2f396..687233c39f 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -448,14 +448,14 @@ void finish_object_selection() { set_every_ride_type_invented(); set_every_ride_entry_invented(); - gS6Info.editor_step = EditorStep::RollercoasterDesigner; + gEditorStep = EditorStep::RollercoasterDesigner; gfx_invalidate_screen(); } else { set_all_scenery_items_invented(); scenery_set_default_placement_configuration(); - gS6Info.editor_step = EditorStep::LandscapeEditor; + gEditorStep = EditorStep::LandscapeEditor; gfx_invalidate_screen(); } } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 2722987872..6d54804b2c 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -349,7 +349,7 @@ void window_close_top() if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - if (gS6Info.editor_step != EditorStep::LandscapeEditor) + if (gEditorStep != EditorStep::LandscapeEditor) return; } @@ -1082,7 +1082,7 @@ void main_window_zoom(bool zoomIn, bool atCursor) { if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) { if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ecfa41ca63..c0e9c05d26 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -349,9 +349,9 @@ private: auto context = OpenRCT2::GetContext(); context->GetObjectManager().UnloadAll(); context->GetGameState()->InitAll(mapSize); - gS6Info.editor_step = EditorStep::ObjectSelection; + gEditorStep = EditorStep::ObjectSelection; gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; - gS6Info.category = SCENARIO_CATEGORY_OTHER; + gScenarioCategory = SCENARIO_CATEGORY_OTHER; } std::string GetRCT1ScenarioName() @@ -2284,8 +2284,6 @@ private: } } - String::Set(gS6Info.name, sizeof(gS6Info.name), name.c_str()); - String::Set(gS6Info.details, sizeof(gS6Info.details), details.c_str()); gScenarioName = name; gScenarioDetails = details; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index adfd8c04f4..206dabcd4a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -9,6 +9,7 @@ #include "../Context.h" #include "../Diagnostic.h" +#include "../Editor.h" #include "../Game.h" #include "../GameState.h" #include "../OpenRCT2.h" @@ -204,21 +205,19 @@ public: { Initialise(); - // _s6.header - gS6Info = _s6.info; + gEditorStep = _s6.info.editor_step; + gScenarioCategory = static_cast(_s6.info.category); // Some scenarios have their scenario details in UTF-8, due to earlier bugs in OpenRCT2. if (!IsLikelyUTF8(_s6.info.name) && !IsLikelyUTF8(_s6.info.details)) { - auto temp = rct2_to_utf8(_s6.info.name, RCT2LanguageId::EnglishUK); - safe_strcpy(gS6Info.name, temp.data(), sizeof(gS6Info.name)); - auto temp2 = rct2_to_utf8(_s6.info.details, RCT2LanguageId::EnglishUK); - safe_strcpy(gS6Info.details, temp2.data(), sizeof(gS6Info.details)); + gScenarioName = rct2_to_utf8(_s6.info.name, RCT2LanguageId::EnglishUK); + gScenarioDetails = rct2_to_utf8(_s6.info.details, RCT2LanguageId::EnglishUK); } else { - safe_strcpy(gS6Info.name, _s6.info.name, sizeof(gS6Info.name)); - safe_strcpy(gS6Info.details, _s6.info.details, sizeof(gS6Info.details)); + gScenarioName = _s6.info.name; + gScenarioDetails = _s6.info.details; } gDateMonthsElapsed = static_cast(_s6.elapsed_months); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index dc14648a8e..222f02ab3a 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -912,7 +912,7 @@ void Ride::UpdateAll() // Remove all rides if scenario editor if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - switch (gS6Info.editor_step) + switch (gEditorStep) { case EditorStep::ObjectSelection: case EditorStep::LandscapeEditor: diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index c256d30f82..50f1c0c22d 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -960,7 +960,7 @@ bool Vehicle::SoundCanPlay() const if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) return false; - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner) return false; if (sound1_id == OpenRCT2::Audio::SoundId::Null && sound2_id == OpenRCT2::Audio::SoundId::Null) @@ -1404,7 +1404,7 @@ void vehicle_update_all() if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) return; - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner) + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner) return; for (auto vehicle : TrainManager::View()) diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 4f74f49195..8f840df3f9 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -58,7 +58,7 @@ const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT] = { STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, }; -rct_s6_info gS6Info; +SCENARIO_CATEGORY gScenarioCategory; std::string gScenarioName; std::string gScenarioDetails; std::string gScenarioCompletedBy; @@ -108,12 +108,9 @@ void scenario_begin() gHistoricalProfit = gInitialCash - gBankLoan; gCash = gInitialCash; - gScenarioDetails = std::string_view(gS6Info.details, 256); - gScenarioName = std::string_view(gS6Info.name, 64); - { utf8 normalisedName[64]; - ScenarioSources::NormaliseName(normalisedName, sizeof(normalisedName), gS6Info.name); + ScenarioSources::NormaliseName(normalisedName, sizeof(normalisedName), gScenarioName.c_str()); rct_string_id localisedStringIds[3]; if (language_get_localised_scenario_strings(normalisedName, localisedStringIds)) @@ -586,18 +583,6 @@ static bool scenario_prepare_rides_for_save() */ bool scenario_prepare_for_save() { - auto& park = GetContext()->GetGameState()->GetPark(); - auto parkName = park.Name.c_str(); - - gS6Info.entry.flags = 255; - if (gS6Info.name[0] == 0) - String::Set(gS6Info.name, sizeof(gS6Info.name), parkName); - - gS6Info.objective_type = gScenarioObjective.Type; - gS6Info.objective_arg_1 = gScenarioObjective.Year; - gS6Info.objective_arg_2 = gScenarioObjective.Currency; - gS6Info.objective_arg_3 = gScenarioObjective.NumGuests; - // This can return false if the goal is 'Finish 5 roller coaster' and there are too few. if (!scenario_prepare_rides_for_save()) { diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index e3a74c6977..26e7f177ed 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -436,7 +436,7 @@ extern uint16_t gScenarioParkRatingWarningDays; extern money64 gScenarioCompletedCompanyValue; extern money64 gScenarioCompanyValueRecord; -extern rct_s6_info gS6Info; +extern SCENARIO_CATEGORY gScenarioCategory; extern std::string gScenarioName; extern std::string gScenarioDetails; extern std::string gScenarioCompletedBy; diff --git a/src/openrct2/scripting/ScPark.hpp b/src/openrct2/scripting/ScPark.hpp index 18be4cb1f2..202f06de4c 100644 --- a/src/openrct2/scripting/ScPark.hpp +++ b/src/openrct2/scripting/ScPark.hpp @@ -227,7 +227,7 @@ namespace OpenRCT2::Scripting } }; - static const DukEnumMap ParkFlagMap({ + static const DukEnumMap ParkFlagMap({ { "open", PARK_FLAGS_PARK_OPEN }, { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, { "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES }, diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 91c2f07206..98745ca80a 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -18,6 +18,7 @@ #include "../actions/ParkSetParameterAction.h" #include "../config/Config.h" #include "../core/Memory.hpp" +#include "../core/String.hpp" #include "../interface/Colour.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" @@ -303,8 +304,8 @@ void Park::Initialise() finance_reset_history(); award_reset(); - gS6Info.name[0] = '\0'; - format_string(gS6Info.details, 256, STR_NO_DETAILS_YET, nullptr); + gScenarioName = ""; + gScenarioDetails = String::ToStd(language_get_string(STR_NO_DETAILS_YET)); } void Park::Update(const Date& date) From 5ec2a2e471042ce44a32922e2f92aca0aa92756c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 1 Aug 2021 16:29:18 +0200 Subject: [PATCH 101/681] Export gS6Info in S6Exporter --- src/openrct2/rct2/S6Exporter.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index ae2f35ecc8..3a5781ba5d 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -10,6 +10,7 @@ #include "S6Exporter.h" #include "../Context.h" +#include "../Editor.h" #include "../Game.h" #include "../GameState.h" #include "../OpenRCT2.h" @@ -159,15 +160,24 @@ void S6Exporter::Save(OpenRCT2::IStream* stream, bool isScenario) void S6Exporter::Export() { - _s6.info = gS6Info; + _s6.info = {}; + _s6.info.editor_step = gEditorStep; + _s6.info.category = gScenarioCategory; + _s6.info.objective_type = gScenarioObjective.Type; + _s6.info.objective_arg_1 = gScenarioObjective.Year; + _s6.info.objective_arg_2 = gScenarioObjective.Currency; + _s6.info.objective_arg_3 = gScenarioObjective.NumGuests; + _s6.info.entry.flags = 0xFFFFFFFF; + { - auto temp = utf8_to_rct2(gS6Info.name); + auto temp = utf8_to_rct2(gScenarioName.c_str()); safe_strcpy(_s6.info.name, temp.data(), sizeof(_s6.info.name)); } { - auto temp = utf8_to_rct2(gS6Info.details); + auto temp = utf8_to_rct2(gScenarioDetails.c_str()); safe_strcpy(_s6.info.details, temp.data(), sizeof(_s6.info.details)); } + uint32_t researchedTrackPiecesA[128] = {}; uint32_t researchedTrackPiecesB[128] = {}; From 8ecbabf8bf62622cbf3d80275a38ded0f934169d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 2 Aug 2021 22:02:06 +0200 Subject: [PATCH 102/681] Fix #14974: too many dodgems not handled correctly Properly check if all vehicles have been created, and clean them up properly if not. --- src/openrct2/ride/Ride.cpp | 25 +++++++++++++++++++++--- src/openrct2/ride/Ride.h | 2 ++ src/openrct2/ride/RideConstruction.cpp | 27 ++++++++++++++++++-------- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 222f02ab3a..729ff69192 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3087,9 +3087,15 @@ static Vehicle* vehicle_create_car( vehicle->update_flags = 0; CoordsXY chosenLoc; + auto numAttempts = 0; // loc_6DDD26: do { + numAttempts++; + // This can happen when trying to spawn dozens of cars in a tiny area. + if (numAttempts > 10000) + return nullptr; + vehicle->sprite_direction = scenario_rand() & 0x1E; chosenLoc.y = dodgemPos.y + (scenario_rand() & 0xFF); chosenLoc.x = dodgemPos.x + (scenario_rand() & 0xFF); @@ -3233,15 +3239,16 @@ static train_ref vehicle_create_train( return train; } -static void vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement) +static bool vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPos, TrackElement* trackElement) { auto ride = get_ride(rideIndex); if (ride == nullptr) - return; + return false; train_ref firstTrain = {}; train_ref lastTrain = {}; int32_t remainingDistance = 0; + bool allTrainsCreated = true; for (int32_t vehicleIndex = 0; vehicleIndex < ride->num_vehicles; vehicleIndex++) { @@ -3251,7 +3258,10 @@ static void vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPo } train_ref train = vehicle_create_train(rideIndex, trainsPos, vehicleIndex, &remainingDistance, trackElement); if (train.head == nullptr || train.tail == nullptr) + { + allTrainsCreated = false; continue; + } if (vehicleIndex == 0) { @@ -3280,6 +3290,8 @@ static void vehicle_create_trains(ride_id_t rideIndex, const CoordsXYZ& trainsPo firstTrain.head->prev_vehicle_on_ride = lastTrain.tail->sprite_index; if (firstTrain.head != nullptr) lastTrain.tail->next_vehicle_on_ride = firstTrain.head->sprite_index; + + return allTrainsCreated; } /** @@ -3389,7 +3401,14 @@ bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying) direction = trackElement->GetDirection(); } - vehicle_create_trains(id, vehiclePos, trackElement); + if (!vehicle_create_trains(id, vehiclePos, trackElement)) + { + // This flag is needed for Ride::RemoveVehicles() + lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK; + RemoveVehicles(); + gGameCommandErrorText = STR_UNABLE_TO_CREATE_ENOUGH_VEHICLES; + return false; + } // return true; // Initialise station departs diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 855a42b128..066330478b 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -466,6 +466,8 @@ public: uint8_t GetNumShelteredSections() const; void IncreaseNumShelteredSections(); + + void RemoveVehicles(); }; #pragma pack(push, 1) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index e2fa615baa..8272d94d78 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -40,6 +40,7 @@ #include "RideData.h" #include "Track.h" #include "TrackData.h" +#include "TrainManager.h" #include "Vehicle.h" bool gGotoStartPlacementMode = false; @@ -173,16 +174,16 @@ static void ride_remove_cable_lift(Ride* ride) * * rct2: 0x006DD506 */ -static void ride_remove_vehicles(Ride* ride) +void Ride::RemoveVehicles() { - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + if (lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { - ride->lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK; - ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); + lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK; + lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE); for (size_t i = 0; i <= MAX_VEHICLES_PER_RIDE; i++) { - uint16_t spriteIndex = ride->vehicles[i]; + uint16_t spriteIndex = vehicles[i]; while (spriteIndex != SPRITE_INDEX_NULL) { Vehicle* vehicle = GetEntity(spriteIndex); @@ -195,11 +196,21 @@ static void ride_remove_vehicles(Ride* ride) sprite_remove(vehicle); } - ride->vehicles[i] = SPRITE_INDEX_NULL; + vehicles[i] = SPRITE_INDEX_NULL; } for (size_t i = 0; i < MAX_STATIONS; i++) - ride->stations[i].TrainAtStation = RideStation::NO_TRAIN; + stations[i].TrainAtStation = RideStation::NO_TRAIN; + + // Also clean up orphaned vehicles for good measure. + for (auto* vehicle : TrainManager::View()) + { + if (vehicle->ride == id) + { + vehicle->Invalidate(); + sprite_remove(vehicle); + } + } } } @@ -223,7 +234,7 @@ void ride_clear_for_construction(Ride* ride) } ride_remove_cable_lift(ride); - ride_remove_vehicles(ride); + ride->RemoveVehicles(); ride_clear_blocked_tiles(ride); auto w = window_find_by_number(WC_RIDE, ride->id); From 2beed229a9686aadaa04379c66e4a45de3b60fd2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 3 Aug 2021 06:25:06 +0200 Subject: [PATCH 103/681] Fix negative Gs display (#15171) --- src/openrct2-ui/windows/Ride.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index d39b6a2f79..27854bab16 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5715,7 +5715,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi 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); + ft.Add(ride->max_negative_vertical_g); DrawTextBasic(dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; From 8a09406b64d9a61825cab7def2d509f8700ef33e Mon Sep 17 00:00:00 2001 From: ocalhoun6 <7485697@gmail.com> Date: Wed, 4 Aug 2021 04:31:53 -0700 Subject: [PATCH 104/681] =?UTF-8?q?Fix=20#13465:=20Creating=20a=20scenario?= =?UTF-8?q?=20based=20on=20a=20won=20save=20game=20results=20in=20a=20scen?= =?UTF-8?q?ario=20that=E2=80=99s=20instantly=20won?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2/Editor.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/contributors.md b/contributors.md index 05b978b783..39d8b882a9 100644 --- a/contributors.md +++ b/contributors.md @@ -175,6 +175,7 @@ The following people are not part of the development team, but have been contrib * Struan Clark (xtruan) * Kane Shaw (seifer7) * Saad Rehman (SaadRehmanCS) +* (ocalhoun6) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index bfcd3d25e8..fc9446032b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook - Feature: [#15143] Added a shortcut key for Giant Screenshot. +- Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 96444bb90e..d72df4dd1c 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -134,6 +134,10 @@ namespace Editor climate_reset(gClimate); + // Clear the scenario completion status + gParkFlags &= ~PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT; + gScenarioCompletedCompanyValue = MONEY64_UNDEFINED; + gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; gEditorStep = EditorStep::ObjectiveSelection; gScenarioCategory = SCENARIO_CATEGORY_OTHER; From 40a4a993de0ec2431b893fdeef680ebe4bc78bc4 Mon Sep 17 00:00:00 2001 From: Ted John Date: Wed, 4 Aug 2021 20:47:13 +0100 Subject: [PATCH 105/681] Fix #15170: Plugin: incorrect label text alignment (#15175) Initialise CustomWidgetDesc::TextAlign. --- distribution/changelog.txt | 1 + src/openrct2-ui/scripting/CustomWindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index fc9446032b..53862f3865 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -8,6 +8,7 @@ - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. +- Fix: [#15170] Plugin: incorrect label text alignment. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index fd0a123a30..2765c06daf 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -62,7 +62,7 @@ namespace OpenRCT2::Ui::Windows std::string Name; ImageId Image; std::string Text; - TextAlignment TextAlign; + TextAlignment TextAlign{}; colour_t Colour{}; std::string Tooltip; std::vector Items; From 78cff6e2937c275ac51f726984da0a1b60e48ca9 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 4 Aug 2021 17:53:07 +0300 Subject: [PATCH 106/681] Implement getter for "guest" and "staff" types in getAllEntities --- src/openrct2/scripting/ScMap.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index a86423cf63..b895769654 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -147,6 +147,20 @@ namespace OpenRCT2::Scripting result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); } } + else if (type == "guest") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "staff") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } else { duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); From 8f23670df8bf1c68fd567d98fcc7d08cc2b4b6d8 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 4 Aug 2021 17:53:33 +0300 Subject: [PATCH 107/681] Bump up scripting version --- src/openrct2/scripting/ScriptEngine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index ccba2dc6b3..ae5fa8859b 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 33; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 34; # ifndef DISABLE_NETWORK class ScSocketBase; From 5a7d2da6bb2d5f930647802d75d123d84549e6d7 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 4 Aug 2021 17:53:46 +0300 Subject: [PATCH 108/681] Update typescript definitions --- distribution/openrct2.d.ts | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index e2efcf50df..3beeb00378 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -515,13 +515,13 @@ declare global { readonly isClientOnly: boolean; result: boolean; } - - type VehicleCrashIntoType = "another_vehicle" | "land" | "water"; - - interface VehicleCrashArgs { - readonly id: number; - readonly crashIntoType: VehicleCrashIntoType; - } + + type VehicleCrashIntoType = "another_vehicle" | "land" | "water"; + + interface VehicleCrashArgs { + readonly id: number; + readonly crashIntoType: VehicleCrashIntoType; + } /** * APIs for the in-game date. @@ -570,7 +570,12 @@ declare global { getTile(x: number, y: number): Tile; getEntity(id: number): Entity; getAllEntities(type: EntityType): Entity[]; + /** + * @deprecated since version 34, use guest or staff instead. + */ getAllEntities(type: "peep"): Peep[]; + getAllEntities(type: "guest"): Guest[]; + getAllEntities(type: "staff"): Staff[]; } type TileElementType = @@ -1064,7 +1069,12 @@ declare global { "jumping_fountain_water" | "litter" | "money_effect" | + /** + * @deprecated since version 34, use guest or staff instead. + */ "peep" | + "guest" | + "staff" | "steam_particle"; /** @@ -1076,7 +1086,7 @@ declare global { */ readonly id: number; /** - * The type of entity, e.g. car, duck, litter, or peep. + * The type of entity, e.g. guest, vehicle, etc. */ readonly type: EntityType; /** @@ -1214,7 +1224,7 @@ declare global { readonly remainingDistance: number; /** - * List of peep IDs ordered by seat. + * List of guest IDs ordered by seat. */ peeps: Array; @@ -1261,6 +1271,7 @@ declare global { /** * Represents a guest or staff member. + * @deprecated since version 34, use guest or staff instead. */ interface Peep extends Entity { /** @@ -1329,6 +1340,9 @@ declare global { "iceCream" | "hereWeAre"; + /** + * @deprecated since version 34, use EntityType instead. + */ type PeepType = "guest" | "staff"; /** From af102e391e7b9894099691bdbb651c6831023a9b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 4 Aug 2021 18:04:25 +0300 Subject: [PATCH 109/681] Return correct entity type, API breaking change --- src/openrct2/scripting/ScEntity.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index f1b581206d..f5d90937cc 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -56,8 +56,9 @@ namespace OpenRCT2::Scripting case EntityType::Vehicle: return "car"; case EntityType::Guest: + return "guest"; case EntityType::Staff: - return "peep"; + return "staff"; case EntityType::SteamParticle: return "steam_particle"; case EntityType::MoneyEffect: From a7bef5442b5d2e59a6c469e7862d2e36a570528f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 4 Aug 2021 20:58:02 +0300 Subject: [PATCH 110/681] Allow plugins to target a specific API version --- distribution/openrct2.d.ts | 1 + src/openrct2/scripting/Plugin.cpp | 17 +++++++++++++++++ src/openrct2/scripting/Plugin.h | 3 +++ src/openrct2/scripting/ScEntity.hpp | 12 ++++++++++-- src/openrct2/scripting/ScriptEngine.cpp | 7 +++++++ src/openrct2/scripting/ScriptEngine.h | 2 ++ 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 3beeb00378..b2ff807db4 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -135,6 +135,7 @@ declare global { type: PluginType; licence: string; minApiVersion?: number; + targetApiVersion?: number; main: () => void; } diff --git a/src/openrct2/scripting/Plugin.cpp b/src/openrct2/scripting/Plugin.cpp index fc7ca48821..084ad97ce6 100644 --- a/src/openrct2/scripting/Plugin.cpp +++ b/src/openrct2/scripting/Plugin.cpp @@ -15,6 +15,7 @@ # include "../OpenRCT2.h" # include "../core/File.h" # include "Duktape.hpp" +# include "ScriptEngine.h" # include # include @@ -120,6 +121,7 @@ PluginMetadata Plugin::GetMetadata(const DukValue& dukMetadata) metadata.Name = TryGetString(dukMetadata["name"], "Plugin name not specified."); metadata.Version = TryGetString(dukMetadata["version"], "Plugin version not specified."); metadata.Type = ParsePluginType(TryGetString(dukMetadata["type"], "Plugin type not specified.")); + CheckForLicence(dukMetadata["licence"], metadata.Name); auto dukMinApiVersion = dukMetadata["minApiVersion"]; @@ -128,6 +130,12 @@ PluginMetadata Plugin::GetMetadata(const DukValue& dukMetadata) metadata.MinApiVersion = dukMinApiVersion.as_int(); } + auto dukTargetApiVersion = dukMetadata["targetApiVersion"]; + if (dukTargetApiVersion.type() == DukValue::Type::NUMBER) + { + metadata.TargetApiVersion = dukTargetApiVersion.as_int(); + } + auto dukAuthors = dukMetadata["authors"]; dukAuthors.push(); if (dukAuthors.is_array()) @@ -161,4 +169,13 @@ void Plugin::CheckForLicence(const DukValue& dukLicence, std::string_view plugin log_error("Plugin %s does not specify a licence", std::string(pluginName).c_str()); } +int32_t Plugin::GetTargetAPIVersion() const +{ + if (_metadata.TargetApiVersion) + return *_metadata.TargetApiVersion; + + // If not specified, default to 33 since that is the API version from before 'targetAPIVersion' was introduced. + return 33; +} + #endif diff --git a/src/openrct2/scripting/Plugin.h b/src/openrct2/scripting/Plugin.h index f0e30b8a79..b6fcb41027 100644 --- a/src/openrct2/scripting/Plugin.h +++ b/src/openrct2/scripting/Plugin.h @@ -42,6 +42,7 @@ namespace OpenRCT2::Scripting std::vector Authors; PluginType Type{}; int32_t MinApiVersion{}; + std::optional TargetApiVersion{}; DukValue Main; }; @@ -80,6 +81,8 @@ namespace OpenRCT2::Scripting return _hasStarted; } + int32_t GetTargetAPIVersion() const; + Plugin() = default; Plugin(duk_context* context, const std::string& path); Plugin(const Plugin&) = delete; diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index f5d90937cc..65bbfcefb4 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -48,6 +48,8 @@ namespace OpenRCT2::Scripting std::string type_get() const { + const auto targetApiVersion = GetTargetAPIVersion(); + auto entity = GetEntity(); if (entity != nullptr) { @@ -56,9 +58,15 @@ namespace OpenRCT2::Scripting case EntityType::Vehicle: return "car"; case EntityType::Guest: - return "guest"; + if (targetApiVersion <= 33) + return "peep"; + else + return "guest"; case EntityType::Staff: - return "staff"; + if (targetApiVersion <= 33) + return "peep"; + else + return "staff"; case EntityType::SteamParticle: return "steam_particle"; case EntityType::MoneyEffect: diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index d7fb754e89..e3478a84d9 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -1419,4 +1419,11 @@ void OpenRCT2::Scripting::ThrowIfGameStateNotMutable() } } +int32_t OpenRCT2::Scripting::GetTargetAPIVersion() +{ + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& execInfo = scriptEngine.GetExecInfo(); + return execInfo.GetCurrentPlugin()->GetTargetAPIVersion(); +} + #endif diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index ae5fa8859b..fcdd51bcef 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -264,6 +264,8 @@ namespace OpenRCT2::Scripting bool IsGameStateMutable(); void ThrowIfGameStateNotMutable(); + int32_t GetTargetAPIVersion(); + std::string Stringify(const DukValue& value); } // namespace OpenRCT2::Scripting From f3f25ad8e06dfce1bb9a0aea1614a0b39fb07744 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 5 Aug 2021 16:44:20 +0300 Subject: [PATCH 111/681] Update changelog.txt --- distribution/changelog.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d30b662143..4e2c6dd48f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,14 +1,14 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ -- Feature: [#15084] [Plugin] Add "vehicle.crash" hook +- Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Improved: [#3417] Crash dumps are now placed in their own folder. -- Change: [#8601] Revert ToonTower base block fix to re-enable support -blocking. +- Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. +- Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. 0.3.4.1 (2021-07-25) ------------------------------------------------------------------------ From dca117e5a086b5f51a778a68f4d71265fa43df72 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 5 Aug 2021 17:08:19 +0300 Subject: [PATCH 112/681] Update scripting.md --- distribution/scripting.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/distribution/scripting.md b/distribution/scripting.md index e820e7e248..7304f56a57 100644 --- a/distribution/scripting.md +++ b/distribution/scripting.md @@ -41,6 +41,7 @@ registerPlugin({ authors: ['Your Name'], type: 'remote', licence: 'MIT', + targetApiVersion: 34, main: main }); ``` @@ -49,6 +50,12 @@ This will log a message to the terminal screen (`stdout`) when you open any park The hot reload feature can be enabled by editing your `config.ini` file and setting `enable_hot_reloading` to `true` under `[plugin]`. When this is enabled, the game will auto-reload the script in real-time whenever you save your JavaScript file. This allows rapid development of plug-ins as you can write code and quickly preview your changes, such as closing and opening a specific custom window on startup. A demonstration of this can be found on YouTube: [OpenRCT2 plugin hot-reload demo](https://www.youtube.com/watch?v=jmjWzEhmDjk) +## Breaking changes +As of version 34 there are breaking Api changes. + +> Version 34 +```Entity.type will now return "guest" or "staff" instead of "peep"``` + ## Frequently Asked Questions > Why was JavaScript chosen instead of LUA or Python. @@ -73,6 +80,12 @@ Scripts can consist of any behaviour and have a large memory pool available to t The APIs for OpenRCT2 try to mimic the internal data structures as close as possible but we can only add so many at a time. The best way to grow the plug-in system is to add APIs on-demand. So if you find an API is missing, please raise an issue for it on GitHub and also feel free to submit a pull request afterwards. +> What is ```targetApiVersion``` + +In case there are breaking Api changes plugins can use this to keep the old Api behavior, as an example in version 34 ```Entity.Type``` would no longer return "peep" for +guests and staff, instead it would return either "guest" or "staff", so if your plugin expects "peep" you can specify the version 33 to keep the old behavior. See the list +of breaking changes. If this is not specified it will default to version 33, it is recommended to specify the current api version. + > How do I debug my script? Debugging has not yet been implemented, but is planned. In the meantime, you can use `console.log` to print useful information for diagnosing problems. From aa2b7d99725f029e16a46ae5c1e6171bdc14ca71 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Thu, 5 Aug 2021 17:16:02 +0300 Subject: [PATCH 113/681] Deprecate peeps property in scripting for Car entity --- distribution/openrct2.d.ts | 6 ++++++ src/openrct2/scripting/ScEntity.hpp | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index b2ff807db4..df1af42a77 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1226,9 +1226,15 @@ declare global { /** * List of guest IDs ordered by seat. + * @deprecated since version 34, use guests instead. */ peeps: Array; + /** + * List of guest IDs ordered by seat. + */ + guests: Array; + /** * Moves the vehicle forward or backwards along the track, relative to its current * position. A single visible step is about 8.000 to 14.000 in distance depending diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 65bbfcefb4..00e6dfcd1b 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -276,7 +276,8 @@ namespace OpenRCT2::Scripting ctx, &ScVehicle::poweredAcceleration_get, &ScVehicle::poweredAcceleration_set, "poweredAcceleration"); dukglue_register_property(ctx, &ScVehicle::poweredMaxSpeed_get, &ScVehicle::poweredMaxSpeed_set, "poweredMaxSpeed"); dukglue_register_property(ctx, &ScVehicle::status_get, &ScVehicle::status_set, "status"); - dukglue_register_property(ctx, &ScVehicle::peeps_get, nullptr, "peeps"); + dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "peeps"); + dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "guests"); dukglue_register_property(ctx, &ScVehicle::gForces_get, nullptr, "gForces"); dukglue_register_method(ctx, &ScVehicle::travelBy, "travelBy"); } @@ -609,7 +610,7 @@ namespace OpenRCT2::Scripting } } - std::vector peeps_get() const + std::vector guests_get() const { auto ctx = GetContext()->GetScriptEngine().GetContext(); std::vector result; From 87fbb9faf5824cbdb196445f1b022cdbfc8bb244 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 6 Aug 2021 18:16:24 +0300 Subject: [PATCH 114/681] Fix potential crash on corrupted network data --- src/openrct2/network/NetworkBase.cpp | 6 ++++++ src/openrct2/network/NetworkConnection.cpp | 3 ++- src/openrct2/network/NetworkPacket.cpp | 24 ++++++++++++++-------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index e995de63f7..7f3578ff38 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -2488,6 +2488,12 @@ void NetworkBase::Server_Handle_MAPREQUEST(NetworkConnection& connection, Networ for (uint32_t i = 0; i < size; i++) { const char* name = reinterpret_cast(packet.Read(8)); + if (name == nullptr) + { + log_error("Client sent malformed object request data %s", connection.Socket->GetHostName()); + return; + } + // This is required, as packet does not have null terminator std::string s(name, name + 8); log_verbose("Client requested object %s", s.c_str()); diff --git a/src/openrct2/network/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index ffb0e46e1d..14039d7888 100644 --- a/src/openrct2/network/NetworkConnection.cpp +++ b/src/openrct2/network/NetworkConnection.cpp @@ -61,13 +61,14 @@ NetworkReadPacket NetworkConnection::ReadPacket() // NOTE: For compatibility reasons for the master server we need to remove sizeof(Header.Id) from the size. // Previously the Id field was not part of the header rather part of the body. - header.Size -= sizeof(header.Id); + header.Size -= std::min(header.Size, sizeof(header.Id)); // Fall-through: Read rest of packet. } // Read packet body. { + // NOTE: BytesTransfered includes the header length, this will not underflow. const size_t missingLength = header.Size - (InboundPacket.BytesTransferred - sizeof(header)); uint8_t buffer[NetworkBufferSize]; diff --git a/src/openrct2/network/NetworkPacket.cpp b/src/openrct2/network/NetworkPacket.cpp index ee71eebf8b..9efca470db 100644 --- a/src/openrct2/network/NetworkPacket.cpp +++ b/src/openrct2/network/NetworkPacket.cpp @@ -73,13 +73,13 @@ void NetworkPacket::WriteString(const utf8* string) const uint8_t* NetworkPacket::Read(size_t size) { - if (BytesRead + size > Header.Size) + if (BytesRead + size > Data.size()) { return nullptr; } else { - uint8_t* data = &GetData()[BytesRead]; + const uint8_t* data = Data.data() + BytesRead; BytesRead += size; return data; } @@ -87,18 +87,24 @@ const uint8_t* NetworkPacket::Read(size_t size) const utf8* NetworkPacket::ReadString() { - char* str = reinterpret_cast(&GetData()[BytesRead]); - char* strend = str; - while (BytesRead < Header.Size && *strend != 0) + if (BytesRead >= Data.size()) + return nullptr; + + const char* str = reinterpret_cast(Data.data() + BytesRead); + + size_t stringLen = 0; + while (BytesRead < Data.size() && str[stringLen] != '\0') { BytesRead++; - strend++; + stringLen++; } - if (*strend != 0) - { + + if (str[stringLen] != '\0') return nullptr; - } + + // Skip null terminator. BytesRead++; + return str; } From 900f9c919062aa1a921e9140e05ef0d31b5dea84 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 7 Aug 2021 20:14:06 +0300 Subject: [PATCH 115/681] Apply code review --- distribution/openrct2.d.ts | 8 ++++---- src/openrct2/scripting/ScEntity.hpp | 4 ++-- src/openrct2/scripting/ScriptEngine.h | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index df1af42a77..720b75e9d7 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1070,13 +1070,13 @@ declare global { "jumping_fountain_water" | "litter" | "money_effect" | + "guest" | + "staff" | + "steam_particle" | /** * @deprecated since version 34, use guest or staff instead. */ - "peep" | - "guest" | - "staff" | - "steam_particle"; + "peep"; /** * Represents an object "entity" on the map that can typically moves and has a sub-tile coordinate. diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 00e6dfcd1b..34e3f4ba12 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -58,12 +58,12 @@ namespace OpenRCT2::Scripting case EntityType::Vehicle: return "car"; case EntityType::Guest: - if (targetApiVersion <= 33) + if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) return "peep"; else return "guest"; case EntityType::Staff: - if (targetApiVersion <= 33) + if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) return "peep"; else return "staff"; diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index fcdd51bcef..6c9d470fd6 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -48,6 +48,9 @@ namespace OpenRCT2::Scripting { static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 34; + // Versions marking breaking changes. + static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; + # ifndef DISABLE_NETWORK class ScSocketBase; # endif From c1d97b845e08775aabef32f1e8a863c0b905bbd5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 02:40:05 +0300 Subject: [PATCH 116/681] Small cleanup in ScMap.hpp --- src/openrct2/scripting/ScMap.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index b895769654..d3be992d42 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -38,13 +38,7 @@ namespace OpenRCT2::Scripting DukValue size_get() const { - auto ctx = _context; - auto objIdx = duk_push_object(ctx); - duk_push_number(ctx, gMapSize); - duk_put_prop_string(ctx, objIdx, "x"); - duk_push_number(ctx, gMapSize); - duk_put_prop_string(ctx, objIdx, "y"); - return DukValue::take_from_stack(ctx); + return ToDuk(_context, CoordsXY{ gMapSize, gMapSize }); } int32_t numRides_get() const @@ -110,7 +104,7 @@ namespace OpenRCT2::Scripting result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); } } - if (type == "car") + else if (type == "car") { for (auto trainHead : TrainManager::View()) { From 5e3913965de31746c33f09eaa8cb18bf81350cdc Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 03:34:55 +0300 Subject: [PATCH 117/681] Add scripting API to create entities --- distribution/openrct2.d.ts | 1 + src/openrct2/scripting/ScMap.hpp | 76 ++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 720b75e9d7..9701d00821 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -577,6 +577,7 @@ declare global { getAllEntities(type: "peep"): Peep[]; getAllEntities(type: "guest"): Guest[]; getAllEntities(type: "staff"): Staff[]; + createEntity(type: EntityType, initializer: object): Entity; } type TileElementType = diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index d3be992d42..d4f90f7220 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -17,7 +17,11 @@ # include "../world/Balloon.h" # include "../world/Duck.h" # include "../world/EntityList.h" +# include "../world/Fountain.h" +# include "../world/Litter.h" # include "../world/Map.h" +# include "../world/MoneyEffect.h" +# include "../world/Particle.h" # include "Duktape.hpp" # include "ScEntity.hpp" # include "ScRide.hpp" @@ -163,6 +167,77 @@ namespace OpenRCT2::Scripting return result; } + template DukValue createEntityType(const DukValue& initializer) + { + TEntityType* entity = CreateEntity(); + + auto entityPos = CoordsXYZ{ AsOrDefault(initializer["x"], 0), AsOrDefault(initializer["y"], 0), + AsOrDefault(initializer["z"], 0) }; + entity->MoveTo(entityPos); + + return GetObjectAsDukValue(_context, std::make_shared(entity->sprite_index)); + } + + DukValue createEntity(const std::string& type, const DukValue& initializer) + { + if (type == "car") + { + return createEntityType(initializer); + } + else if (type == "staff") + { + return createEntityType(initializer); + } + else if (type == "guest") + { + return createEntityType(initializer); + } + else if (type == "steam_particle") + { + return createEntityType(initializer); + } + else if (type == "money_effect") + { + return createEntityType(initializer); + } + else if (type == "crashed_vehicle_particle") + { + return createEntityType(initializer); + } + else if (type == "explosion_cloud") + { + return createEntityType(initializer); + } + else if (type == "crash_splash") + { + return createEntityType(initializer); + } + else if (type == "explosion_flare") + { + return createEntityType(initializer); + } + else if (type == "balloon") + { + return createEntityType(initializer); + } + else if (type == "duck") + { + return createEntityType(initializer); + } + else if (type == "jumping_fountain") + { + return createEntityType(initializer); + } + else if (type == "litter") + { + return createEntityType(initializer); + } + else + { + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); + } + } + static void Register(duk_context* ctx) { dukglue_register_property(ctx, &ScMap::size_get, nullptr, "size"); @@ -173,6 +248,7 @@ namespace OpenRCT2::Scripting dukglue_register_method(ctx, &ScMap::getTile, "getTile"); dukglue_register_method(ctx, &ScMap::getEntity, "getEntity"); dukglue_register_method(ctx, &ScMap::getAllEntities, "getAllEntities"); + dukglue_register_method(ctx, &ScMap::createEntity, "createEntity"); } private: From 94daa1e42c499849d1e92cef2f342d8d775014fe Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 7 Aug 2021 22:02:51 +0300 Subject: [PATCH 118/681] Bump up scripting version --- src/openrct2/scripting/ScriptEngine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 6c9d470fd6..f5f8bc9a2d 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 34; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 35; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; From 29e5ec634c74d967a9cd7b79953e4db07b364c72 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 7 Aug 2021 22:28:48 +0300 Subject: [PATCH 119/681] Add litter entity to scripting --- distribution/openrct2.d.ts | 28 ++++++++++++ src/openrct2/scripting/ScEntity.hpp | 66 +++++++++++++++++++++++++++++ src/openrct2/scripting/ScMap.hpp | 4 +- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 9701d00821..88ba2f9378 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1470,6 +1470,34 @@ declare global { type StaffType = "handyman" | "mechanic" | "security" | "entertainer"; + /** + * Represents litter entity. + */ + interface Litter extends Entity { + /** + * The type of the litter. + */ + litterType: LitterType; + + /** + * The tick number this entity was created. + */ + creationTime: number; + } + + type LitterType = "vomit" | + "vomit_alt" | + "empty_can" | + "rubbish" | + "burger_box" | + "empty_cup" | + "empty_box" | + "empty_bottle" | + "empty_bowl_red" | + "empty_drink_carton" | + "empty_juice_cup" | + "empty_bowl_blue"; + /** * Network APIs * Use `network.status` to determine whether the current game is a client, server or in single player mode. diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 34e3f4ba12..656efd69c7 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -17,6 +17,7 @@ # include "../peep/Staff.h" # include "../util/Util.h" # include "../world/EntityList.h" +# include "../world/Litter.h" # include "../world/Sprite.h" # include "Duktape.hpp" # include "ScRide.hpp" @@ -1244,6 +1245,71 @@ namespace OpenRCT2::Scripting } }; + static const DukEnumMap LitterTypeMap({ + { "vomit", Litter::Type::Vomit }, + { "vomit_alt", Litter::Type::VomitAlt }, + { "empty_can", Litter::Type::EmptyCan }, + { "rubbish", Litter::Type::Rubbish }, + { "burger_box", Litter::Type::BurgerBox }, + { "empty_cup", Litter::Type::EmptyCup }, + { "empty_box", Litter::Type::EmptyBox }, + { "empty_bottle", Litter::Type::EmptyBottle }, + { "empty_bowl_red", Litter::Type::EmptyBowlRed }, + { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, + { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, + { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, + }); + + class ScLitter : public ScEntity + { + public: + ScLitter(uint16_t Id) + : ScEntity(Id) + { + } + + static void Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScLitter::litterType_get, &ScLitter::litterType_set, "litterType"); + dukglue_register_property(ctx, &ScLitter::creationTick_get, nullptr, "creationTick"); + } + + private: + Litter* GetLitter() const + { + return ::GetEntity(_id); + } + + std::string litterType_get() const + { + auto* litter = GetLitter(); + auto it = LitterTypeMap.find(litter->SubType); + if (it == LitterTypeMap.end()) + return ""; + return std::string{ it->first }; + } + + void litterType_set(const std::string& litterType) + { + ThrowIfGameStateNotMutable(); + + auto it = LitterTypeMap.find(litterType); + if (it == LitterTypeMap.end()) + return; + auto* litter = GetLitter(); + litter->SubType = it->second; + } + + uint32_t creationTick_get() const + { + auto* litter = GetLitter(); + if (litter == nullptr) + return 0; + return litter->creationTick; + } + }; + } // namespace OpenRCT2::Scripting #endif diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index d4f90f7220..78e87b0b22 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -230,7 +230,7 @@ namespace OpenRCT2::Scripting } else if (type == "litter") { - return createEntityType(initializer); + return createEntityType(initializer); } else { @@ -263,6 +263,8 @@ namespace OpenRCT2::Scripting return GetObjectAsDukValue(_context, std::make_shared(spriteId)); case EntityType::Guest: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + case EntityType::Litter: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); default: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); } From 30739de7cc0bddf6f7d1dba72515d021a75eda84 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 7 Aug 2021 22:31:37 +0300 Subject: [PATCH 120/681] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 51f8f05898..387f922a1c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. +- Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). From ada164ac92c4c4caafb800d8d41c9b7f5bfdeb1f Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 31 Jul 2021 21:39:43 +0200 Subject: [PATCH 121/681] Remove one write to gGameCommandErrorText All callers assume the landscape data area is full if the function returns false and set that error themselves. --- src/openrct2/world/Map.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 8500825095..4dcbba361a 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -207,7 +207,6 @@ static bool map_check_free_elements_and_reorganise(size_t numElementsOnTile, siz // Check hard cap on num in use tiles (this would be the size of _tileElements immediately after a reorg) if (_tileElementsInUse + numNewElements > MAX_TILE_ELEMENTS) { - gGameCommandErrorText = STR_ERR_LANDSCAPE_DATA_AREA_FULL; return false; } From 5a721cc5e282c17eba907c0807a1263eef0dafb6 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 31 Jul 2021 22:33:40 +0200 Subject: [PATCH 122/681] Make track_design_place_all_scenery() take a CoordsXYZ --- src/openrct2/ride/TrackDesign.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 496b2c1e45..8152a9eb48 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1267,7 +1267,7 @@ static bool TrackDesignPlaceSceneryElement( * rct2: 0x006D0964 */ static int32_t track_design_place_all_scenery( - const std::vector& sceneryList, int32_t originX, int32_t originY, int32_t originZ) + const std::vector& sceneryList, const CoordsXYZ& origin) { for (uint8_t mode = 0; mode <= 1; mode++) { @@ -1284,14 +1284,14 @@ static int32_t track_design_place_all_scenery( for (const auto& scenery : sceneryList) { uint8_t rotation = _currentTrackPieceDirection; - TileCoordsXY tileCoords = { originX / COORDS_XY_STEP, originY / COORDS_XY_STEP }; + TileCoordsXY tileCoords = TileCoordsXY(origin); TileCoordsXY offsets = { scenery.x, scenery.y }; tileCoords += offsets.Rotate(rotation); - auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), originZ }; + auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), origin.z }; track_design_update_max_min_coordinates(mapCoord); - if (!TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, originZ)) + if (!TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z)) { return 0; } @@ -1824,8 +1824,7 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc // Scenery elements if (track_place_success) { - if (!track_design_place_all_scenery( - td6->scenery_elements, _trackPreviewOrigin.x, _trackPreviewOrigin.y, _trackPreviewOrigin.z)) + if (!track_design_place_all_scenery(td6->scenery_elements, _trackPreviewOrigin)) { return _trackDesignPlaceCost; } From 31ccac8354af02bb868a52ad5215e3d7b474223b Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sun, 8 Aug 2021 04:07:52 +0000 Subject: [PATCH 123/681] Merge Localisation/master into OpenRCT2/develop --- data/language/it-IT.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index c3b5b6bc5e..6b44aac962 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -2067,15 +2067,15 @@ STR_2976 :Dipingi una determinata area di quest'attrazione secondo il modello STR_2977 :Nome del dipendente STR_2978 :Digita il nome di questo dipendente: STR_2979 :Impossibile battezzare il dipendente… -STR_2980 :Troppe insegne nella partita +STR_2980 :Troppi cartelli nella partita STR_2981 :{RED}Vietato l'ingresso -STR_2982 :Testo dell'insegna -STR_2983 :Digita il testo di questa insegna: -STR_2984 :Impossibile fissare il testo dell'insegna… -STR_2985 :Insegna -STR_2986 :Modifica il testo dell'insegna -STR_2987 :Imposta quest'insegna come cartello di “Vietato l'ingresso” per i visitatori -STR_2988 :Demolisci questa insegna +STR_2982 :Testo del cartello +STR_2983 :Digita il testo di questo cartello: +STR_2984 :Impossibile impostare il testo del cartello… +STR_2985 :Cartello +STR_2986 :Modifica il testo del cartello +STR_2987 :Imposta questo cartello come “Vietato l'ingresso” per i visitatori +STR_2988 :Demolisci questo cartello STR_2989 :Scegli il colore principale STR_2990 :Scegli il colore del testo STR_2991 :Insegna @@ -2514,7 +2514,7 @@ STR_5204 :Lista attrazioni STR_5205 :Visitatore STR_5206 :Lista visitatori STR_5207 :Personale -STR_5208 :Lista personale +STR_5208 :Lista del personale STR_5209 :Cartello STR_5210 :Selezione oggetti STR_5211 :Lista delle invenzioni @@ -2753,7 +2753,7 @@ STR_5470 :Scorri la mappa a sinistra STR_5471 :Scorri la mappa in basso STR_5472 :Scorri la mappa a destra STR_5473 :Ciclo giorno/notte -STR_5474 :Mostra testo nei cartelli in maiuscolo +STR_5474 :Mostra testo in maiuscolo nei cartelli STR_5475 :{COMMA16} settimane STR_5476 :Hardware STR_5477 :Rendering della Mappa @@ -3601,7 +3601,7 @@ STR_6392 :Impossibile trovare {STRING} in questo percorso. STR_6393 :Selezione obiettivo STR_6394 :Obiettivo STR_6395 :Manutenzione -STR_6396 :Disattiva screensaver e risparmio energetico dello schermo +STR_6396 :Disattiva screensaver e autospegnimento schermo STR_6397 :Se attivato, le funzionalità di screensaver e di risparmio energetico dello schermo saranno disabilitate mentre OpenRCT2 è in esecuzione. STR_6398 :Il file contiene tipi di percorsi non supportati. Aggiornare a una nuova versione di OpenRCT2. STR_6399 :OpenRCT2 necessita dei file originali di RollerCoaster Tycoon 2 per funzionare. Impostare la variabile “game_path” nel file config.ini al percorso nel quale è installato RollerCoaster Tycoon 2, dopodiché riavviare OpenRCT2. @@ -3659,6 +3659,9 @@ STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Vende: {BLACK}{STRING} STR_6453 :Copia info versione +STR_6454 :Impossibile rinominare il cartello… +STR_6455 :Impossibile rinominare l’insegna… +STR_6456 :Screenshot gigante ############# From b4f39231624572f5dc836fbc3a915526d77d83a2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 8 Aug 2021 18:10:52 +0200 Subject: [PATCH 124/681] Name byte_9D8150 --- src/openrct2/actions/SmallSceneryPlaceAction.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 4 ++-- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 8 ++++---- src/openrct2/ride/TrackDesign.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 5aaeabc114..d78fc3fea1 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -121,7 +121,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const return std::make_unique(GameActions::Status::NoFreeElements); } - if (!byte_9D8150 && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) + if (!_trackDesignDrawingPreview && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) { return std::make_unique(GameActions::Status::InvalidParameters); } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 4858dff29e..ec4ce6cb29 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -284,7 +284,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const GameActions::Status::Disallowed, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } - if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !byte_9D8150) + if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !_trackDesignDrawingPreview) { auto surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) @@ -347,7 +347,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } ride_height /= COORDS_Z_PER_TINY_Z; - if (ride_height > maxHeight && !byte_9D8150) + if (ride_height > maxHeight && !_trackDesignDrawingPreview) { return std::make_unique(GameActions::Status::Disallowed, STR_TOO_HIGH_FOR_SUPPORTS); } diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index a02479b4ed..e250a017b4 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -109,7 +109,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const return std::make_unique(GameActions::Status::NotOwned); } } - else if (!byte_9D8150 && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) + else if (!_trackDesignDrawingPreview && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) { log_error("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y); return std::make_unique(GameActions::Status::InvalidParameters); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 8152a9eb48..f44b72501e 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -83,7 +83,7 @@ static CoordsXYZ _trackPreviewMin; static CoordsXYZ _trackPreviewMax; static CoordsXYZ _trackPreviewOrigin; -bool byte_9D8150; +bool _trackDesignDrawingPreview; static uint8_t _trackDesignPlaceOperation; static money32 _trackDesignPlaceCost; static int16_t _trackDesignPlaceZ; @@ -1919,7 +1919,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o } } - byte_9D8150 = true; + _trackDesignDrawingPreview = true; uint8_t backup_rotation = _currentTrackPieceDirection; uint32_t backup_park_flags = gParkFlags; gParkFlags &= ~PARK_FLAGS_FORBID_HIGH_CONSTRUCTION; @@ -1958,7 +1958,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o } _currentTrackPieceDirection = backup_rotation; - byte_9D8150 = false; + _trackDesignDrawingPreview = false; *cost = resultCost; *outRide = ride; return true; @@ -1967,7 +1967,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o { _currentTrackPieceDirection = backup_rotation; ride->Delete(); - byte_9D8150 = false; + _trackDesignDrawingPreview = false; return false; } } diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index a1161469c0..1f5c069c15 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -195,7 +195,7 @@ enum extern TrackDesign* gActiveTrackDesign; extern bool gTrackDesignSceneryToggle; -extern bool byte_9D8150; +extern bool _trackDesignDrawingPreview; extern bool _trackDesignPlaceStateSceneryUnavailable; extern bool gTrackDesignSaveMode; From 14785155dd59d59064367b60986db960044e04f1 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 8 Aug 2021 22:11:13 +0200 Subject: [PATCH 125/681] Apply feedback --- .github/ISSUE_TEMPLATE/bug_report.yaml | 6 +++--- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 455806140e..76264b3f41 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -6,7 +6,7 @@ labels: body: - type: markdown attributes: - value: Before filing this bug, [please check if it hasn't already been reported](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+is%3Aopen+label%3Abug). If it has, please add useful information to the existing issue instead. + value: Before filing this bug, [please check if it hasn't already been reported](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+label%3Abug). If it has, please add useful information to the existing issue instead. - type: input attributes: @@ -19,7 +19,7 @@ body: attributes: label: OpenRCT2 build placeholder: OpenRCT2, v0.3.4.1 (d76611e on develop) provided by GitHub - description: You can copy the version information from the About window. + description: You can copy the version information from the About window. Open the "Disk and game options" menu (floppy disk on the top toolbar), choose "About 'OpenRCT2'" and click the copy button next to the version information. validations: required: true @@ -44,7 +44,7 @@ body: - type: textarea attributes: label: Steps to reproduce - description: We highly suggest including a screenshots and a bug report log (System tray->Report bug). + description: We highly suggest including a screenshot and a bug report log (System tray->Report bug). placeholder: Tell us the steps required to trigger your bug. value: | 1. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f09f42a938..d56bb91510 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,6 +1,6 @@ blank_issues_enabled: false contact_links: -- name: Localisation +- name: Translation / Localisation url: https://github.com/OpenRCT2/Localisation about: For localisation issues, go to the localisation repository. - name: OpenRCT2 Discord Server diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index c428c1d7c2..6986b22216 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -6,19 +6,19 @@ labels: body: - type: markdown attributes: - value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+is%3Aopen+label%3Afeature). If it has, please add to the existing issue instead. + value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+label%3Afeature). If it has, please add to the existing issue instead. - type: textarea attributes: label: Describe the feature - placeholder: Describe your feature idea here. You can paste or drag & drop attachments here. + placeholder: Describe your feature idea here. You can paste or drag & drop attachments here to help on illustrating it. validations: required: true - type: dropdown attributes: label: Feature type - description: What things had an issue? Check all that apply. + description: What would this feature improve? Check all that apply. multiple: true options: - Quality of life From bc550bfe7a1184d891b6e3e343b29c1a46d881d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 9 Aug 2021 20:56:48 +0200 Subject: [PATCH 126/681] Update bug_report.yaml --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 76264b3f41..2da13b1c73 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -19,7 +19,7 @@ body: attributes: label: OpenRCT2 build placeholder: OpenRCT2, v0.3.4.1 (d76611e on develop) provided by GitHub - description: You can copy the version information from the About window. Open the "Disk and game options" menu (floppy disk on the top toolbar), choose "About 'OpenRCT2'" and click the copy button next to the version information. + description: You can see the version by running `openrct2 --version` or copy it from the About window. Open the "Disk and game options" menu (floppy disk on the top toolbar), choose "About 'OpenRCT2'" and click the copy button next to the version information. validations: required: true From 22a2a1a71f0d1d82a16041ded7ff672cbeb10664 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Tue, 10 Aug 2021 08:09:55 +0200 Subject: [PATCH 127/681] Enable blank issue template (#15192) --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d56bb91510..fb2d52387e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ -blank_issues_enabled: false +blank_issues_enabled: true contact_links: - name: Translation / Localisation url: https://github.com/OpenRCT2/Localisation From 575a24956d3490cb923de5dd5bb802260ab3f6f8 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sun, 1 Aug 2021 23:13:12 +0300 Subject: [PATCH 128/681] Feature #15164: Highlight selected Tile Inspector element --- src/openrct2-ui/windows/TileInspector.cpp | 14 ++++++++++++++ src/openrct2/paint/tile_element/Paint.Banner.cpp | 5 +++++ .../paint/tile_element/Paint.Entrance.cpp | 12 ++++++++++++ .../paint/tile_element/Paint.LargeScenery.cpp | 16 +++++++++++----- src/openrct2/paint/tile_element/Paint.Path.cpp | 8 ++++++++ .../paint/tile_element/Paint.SmallScenery.cpp | 5 +++++ .../paint/tile_element/Paint.Surface.cpp | 6 ++++++ src/openrct2/paint/tile_element/Paint.Wall.cpp | 5 +++++ src/openrct2/world/TileInspector.cpp | 14 ++++++++++++++ src/openrct2/world/TileInspector.h | 3 +++ 10 files changed, 83 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 5e50110dfb..54103820a2 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -32,6 +32,7 @@ #include #include #include +#include // clang-format off static constexpr const rct_string_id EntranceTypeStringIds[] = { @@ -438,6 +439,7 @@ static void window_tile_inspector_invalidate(rct_window* w); static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi); static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); static void window_tile_inspector_set_page(rct_window* w, const TileInspectorPage page); +static void window_tile_inspector_close(rct_window* w); // clang-format off static rct_window_event_list TileInspectorWindowEvents([](auto& events) @@ -456,6 +458,7 @@ static rct_window_event_list TileInspectorWindowEvents([](auto& events) events.invalidate = &window_tile_inspector_invalidate; events.paint = &window_tile_inspector_paint; events.scroll_paint = &window_tile_inspector_scrollpaint; + events.close = &window_tile_inspector_close; }); static uint64_t PageEnabledWidgets[] = { @@ -542,10 +545,14 @@ static void window_tile_inspector_select_element_from_list(rct_window* w, int32_ if (index < 0 || index >= windowTileInspectorElementCount) { windowTileInspectorSelectedIndex = -1; + OpenRCT2::TileInspector::SetSelectedElement(nullptr); } else { windowTileInspectorSelectedIndex = index; + + const TileElement* const tileElement = window_tile_inspector_get_selected_element(w); + OpenRCT2::TileInspector::SetSelectedElement(tileElement); } w->Invalidate(); @@ -761,6 +768,11 @@ static void window_tile_inspector_clamp_corrupt(int32_t elementIndex) GameActions::Execute(&modifyTile); } +static void window_tile_inspector_close(rct_window* w) +{ + OpenRCT2::TileInspector::SetSelectedElement(nullptr); +} + static void window_tile_inspector_mouseup(rct_window* w, rct_widgetindex widgetIndex) { switch (widgetIndex) @@ -1287,6 +1299,8 @@ static void window_tile_inspector_update_selected_tile(rct_window* w, const Scre windowTileInspectorToolMap = mapCoords; windowTileInspectorTile = TileCoordsXY(mapCoords); + OpenRCT2::TileInspector::SetSelectedElement(clickedElement); + window_tile_inspector_load_tile(w, clickedElement); } diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 0b3f492ba6..a6bd774e65 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -15,6 +15,7 @@ #include "../../sprites.h" #include "../../world/Banner.h" #include "../../world/Scenery.h" +#include "../../world/TileInspector.h" #include "../Paint.h" #include "Paint.TileElement.h" @@ -74,6 +75,10 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con session->InteractionType = ViewportInteractionItem::None; image_id |= CONSTRUCTION_MARKER; } + else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + { + image_id |= CONSTRUCTION_MARKER; + } else { image_id |= (banner->colour << 19) | IMAGE_TYPE_REMAP; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 8a7b106617..4f268bce17 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -21,6 +21,7 @@ #include "../../world/Entrance.h" #include "../../world/Footpath.h" #include "../../world/Park.h" +#include "../../world/TileInspector.h" #include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" @@ -100,6 +101,13 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, if (transparant_image_id) transparant_image_id = image_id; } + else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + { + image_id = CONSTRUCTION_MARKER; + entranceImageId = image_id; + if (transparant_image_id) + transparant_image_id = image_id; + } if (is_exit) { @@ -227,6 +235,10 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 session->InteractionType = ViewportInteractionItem::None; ghost_id = CONSTRUCTION_MARKER; } + else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + { + ghost_id = CONSTRUCTION_MARKER; + } // Index to which part of the entrance // Middle, left, right diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 155a442efb..273bb2bf74 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -19,6 +19,7 @@ #include "../../world/LargeScenery.h" #include "../../world/Map.h" #include "../../world/Scenery.h" +#include "../../world/TileInspector.h" #include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" @@ -227,7 +228,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei return; } session->InteractionType = ViewportInteractionItem::LargeScenery; - uint32_t sequenceNum = tileElement->AsLargeScenery()->GetSequenceIndex(); + const uint32_t sequenceNum = tileElement->AsLargeScenery()->GetSequenceIndex(); const LargeSceneryObject* object = tileElement->AsLargeScenery()->GetObject(); if (object == nullptr) return; @@ -250,20 +251,25 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei { if (!track_design_save_contains_tile_element(tileElement)) { - sequenceNum = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); image_id &= 0x7FFFF; - dword_F4387C = sequenceNum; + dword_F4387C = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); image_id |= dword_F4387C; } } if (tileElement->IsGhost()) { session->InteractionType = ViewportInteractionItem::None; - sequenceNum = CONSTRUCTION_MARKER; image_id &= 0x7FFFF; - dword_F4387C = sequenceNum; + dword_F4387C = CONSTRUCTION_MARKER; image_id |= dword_F4387C; } + else if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + { + image_id &= 0x7FFFF; + dword_F4387C = CONSTRUCTION_MARKER; + image_id |= dword_F4387C; + } + int32_t boxlengthZ = tile->z_clearance; if (boxlengthZ > 0x80) { diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 1b6e59dfa2..5437e4ccfc 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -23,11 +23,14 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/Surface.h" +#include "../../world/TileInspector.h" #include "../Paint.h" #include "../Supports.h" #include "Paint.Surface.h" #include "Paint.TileElement.h" +using namespace OpenRCT2; + bool gPaintWidePathsAsGhost = false; // clang-format off @@ -844,6 +847,11 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile session->InteractionType = ViewportInteractionItem::None; imageFlags = CONSTRUCTION_MARKER; } + else if (TileInspector::IsElementSelected(tile_element)) + { + imageFlags |= CONSTRUCTION_MARKER; + sceneryImageFlags = CONSTRUCTION_MARKER; + } // For debugging purpose, show blocked tiles with a colour if (gPaintBlockedTiles && tile_element->AsPath()->IsBlockedByVehicle()) diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index e07c6bd115..31a3755871 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -16,6 +16,7 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/SmallScenery.h" +#include "../../world/TileInspector.h" #include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" @@ -58,6 +59,10 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co session->InteractionType = ViewportInteractionItem::None; marker = CONSTRUCTION_MARKER; } + else if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + { + marker = CONSTRUCTION_MARKER; + } auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index d25d25f660..771215b680 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -27,6 +27,7 @@ #include "../../sprites.h" #include "../../world/Entity.h" #include "../../world/Surface.h" +#include "../../world/TileInspector.h" #include "Paint.TileElement.h" #include @@ -1075,6 +1076,11 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c imageId |= 0x41880000; } + if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + { + imageId |= CONSTRUCTION_MARKER; + } + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, -1 }); has_surface = true; } diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index ffe208e5df..1792186556 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -19,6 +19,7 @@ #include "../../world/Banner.h" #include "../../world/Map.h" #include "../../world/Scenery.h" +#include "../../world/TileInspector.h" #include "../../world/Wall.h" #include "../Paint.h" #include "Paint.TileElement.h" @@ -203,6 +204,10 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons session->InteractionType = ViewportInteractionItem::None; dword_141F710 = CONSTRUCTION_MARKER; } + else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + { + dword_141F710 = CONSTRUCTION_MARKER; + } // Save tile_element diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index ac95bbfe60..e4599bbbd5 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -1131,4 +1131,18 @@ namespace OpenRCT2::TileInspector return std::make_unique(); } + // NOTE: The pointer is exclusively used to determine the current selection, + // do not access the data, points to potentially invalid memory. + static const TileElement* _highlightedElement = nullptr; + + void SetSelectedElement(const TileElement* elem) + { + _highlightedElement = elem; + } + + bool IsElementSelected(const TileElement* elem) + { + return _highlightedElement == elem; + } + } // namespace OpenRCT2::TileInspector diff --git a/src/openrct2/world/TileInspector.h b/src/openrct2/world/TileInspector.h index 1c1d9d180e..212320fa4c 100644 --- a/src/openrct2/world/TileInspector.h +++ b/src/openrct2/world/TileInspector.h @@ -21,6 +21,9 @@ namespace OpenRCT2::TileInspector { using GameActionResultPtr = std::unique_ptr; + void SetSelectedElement(const TileElement* elem); + bool IsElementSelected(const TileElement* elem); + GameActionResultPtr InsertCorruptElementAt(const CoordsXY& loc, int16_t elementIndex, bool isExecuting); GameActionResultPtr RemoveElementAt(const CoordsXY& loc, int16_t elementIndex, bool isExecuting); GameActionResultPtr SwapElementsAt(const CoordsXY& loc, int16_t first, int16_t second, bool isExecuting); From ede11be41c3a803a3ab1bad3219cf8cadd753226 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 10:18:42 +0300 Subject: [PATCH 129/681] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 387f922a1c..af5ff2a9c2 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. +- Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. - Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. From 177f19f64ef70bdf40761c75a05532eb13fa97a2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 11 Aug 2021 13:52:23 +0200 Subject: [PATCH 130/681] Remove unused track design symbols --- src/openrct2/ride/TrackDesign.cpp | 12 ------------ src/openrct2/ride/TrackDesign.h | 1 - 2 files changed, 13 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index f44b72501e..4a6655993f 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -66,18 +66,6 @@ using namespace OpenRCT2; using namespace OpenRCT2::Drawing; -struct map_backup -{ - TileElement tile_elements[MAX_TILE_ELEMENTS]; - TileElement* tile_pointers[MAX_TILE_TILE_ELEMENT_POINTERS]; - TileElement* next_free_tile_element; - uint16_t map_size_units; - uint16_t map_size_units_minus_2; - uint16_t map_size; - uint8_t current_rotation; -}; - -TrackDesign* gActiveTrackDesign; bool gTrackDesignSceneryToggle; static CoordsXYZ _trackPreviewMin; static CoordsXYZ _trackPreviewMax; diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 1f5c069c15..68587c8c34 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -192,7 +192,6 @@ enum MAZE_ELEMENT_TYPE_EXIT = (1 << 7) }; -extern TrackDesign* gActiveTrackDesign; extern bool gTrackDesignSceneryToggle; extern bool _trackDesignDrawingPreview; From 23bae61b7a0519dc99596937dbd6aa4e69e8e76e Mon Sep 17 00:00:00 2001 From: Basssiiie Date: Wed, 11 Aug 2021 13:54:00 +0200 Subject: [PATCH 131/681] Add new plugin API properties to entity, ride and park --- contributors.md | 2 +- distribution/changelog.txt | 1 + distribution/openrct2.d.ts | 54 ++++++++++++++++++++------- src/openrct2/scripting/ScEntity.hpp | 30 +++++++++++++++ src/openrct2/scripting/ScPark.hpp | 11 ++++++ src/openrct2/scripting/ScRide.hpp | 7 ++++ src/openrct2/scripting/ScriptEngine.h | 2 +- 7 files changed, 92 insertions(+), 15 deletions(-) diff --git a/contributors.md b/contributors.md index 39d8b882a9..21c84806fa 100644 --- a/contributors.md +++ b/contributors.md @@ -91,7 +91,7 @@ The following people are not part of the development team, but have been contrib * Jim Verheijde (Jimver) - Make handymen less likely to get stuck in queue lines, misc. * Helio Batimarqui (batimarqui) - Misc. * Keith Stellyes (keithstellyes) - Misc. -* Bas Cantrijn (Basssiiie) - Misc. +* Bas Cantrijn (Basssiiie) - Various plugin additions, misc. * Adrian Zdanowicz (CookiePLMonster) - Misc. * Andrew Pratt (andrewpratt64) - Added api hook for vehicle crashes diff --git a/distribution/changelog.txt b/distribution/changelog.txt index af5ff2a9c2..f83f6731cc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Feature: [#15143] Added a shortcut key for Giant Screenshot. - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. - Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". +- Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 88ba2f9378..1bd55ee09c 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -516,9 +516,9 @@ declare global { readonly isClientOnly: boolean; result: boolean; } - + type VehicleCrashIntoType = "another_vehicle" | "land" | "water"; - + interface VehicleCrashArgs { readonly id: number; readonly crashIntoType: VehicleCrashIntoType; @@ -577,6 +577,8 @@ declare global { getAllEntities(type: "peep"): Peep[]; getAllEntities(type: "guest"): Guest[]; getAllEntities(type: "staff"): Staff[]; + getAllEntities(type: "car"): Car[]; + getAllEntities(type: "litter"): Litter[]; createEntity(type: EntityType, initializer: object): Entity; } @@ -1034,6 +1036,11 @@ declare global { * The value of the ride. */ value: number; + + /** + * The percentage of downtime for this ride from 0 to 100. + */ + readonly downtime: number; } type RideClassification = "ride" | "stall" | "facility"; @@ -1441,6 +1448,21 @@ declare global { * Amount of cash in the guest's pocket. */ cash: number; + + /** + * Whether the guest is within the boundaries of the park. + */ + readonly isInPark: boolean; + + /** + * Whether the guest is lost or not. The guest is lost when the countdown is below 90. + */ + readonly isLost: boolean; + + /** + * Countdown between 0 and 255 that keeps track of how long the guest has been looking for its current destination. + */ + lostCountdown: number; } /** @@ -1485,17 +1507,17 @@ declare global { creationTime: number; } - type LitterType = "vomit" | - "vomit_alt" | - "empty_can" | - "rubbish" | - "burger_box" | - "empty_cup" | - "empty_box" | - "empty_bottle" | - "empty_bowl_red" | - "empty_drink_carton" | - "empty_juice_cup" | + type LitterType = "vomit" | + "vomit_alt" | + "empty_can" | + "rubbish" | + "burger_box" | + "empty_cup" | + "empty_box" | + "empty_bottle" | + "empty_bowl_red" | + "empty_drink_carton" | + "empty_juice_cup" | "empty_bowl_blue"; /** @@ -1750,6 +1772,12 @@ declare global { */ constructionRightsPrice: number; + /** + * The amount of penalty points currentlty applied to the park rating for + * drowned guests and crashed coaster cars. + */ + casualtyPenalty: number; + /** * The number of tiles on the map with park ownership or construction rights. * Updated every 4096 ticks. diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 656efd69c7..a94b74f883 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -848,6 +848,9 @@ namespace OpenRCT2::Scripting dukglue_register_property(ctx, &ScGuest::maxIntensity_get, &ScGuest::maxIntensity_set, "maxIntensity"); dukglue_register_property(ctx, &ScGuest::nauseaTolerance_get, &ScGuest::nauseaTolerance_set, "nauseaTolerance"); dukglue_register_property(ctx, &ScGuest::cash_get, &ScGuest::cash_set, "cash"); + dukglue_register_property(ctx, &ScGuest::isInPark_get, nullptr, "isInPark"); + dukglue_register_property(ctx, &ScGuest::isLost_get, nullptr, "isLost"); + dukglue_register_property(ctx, &ScGuest::lostCountdown_get, &ScGuest::lostCountdown_set, "lostCountdown"); } private: @@ -1115,6 +1118,33 @@ namespace OpenRCT2::Scripting peep->CashInPocket = std::max(0, value); } } + + bool isInPark_get() const + { + auto peep = GetGuest(); + return (peep != nullptr && !peep->OutsideOfPark); + } + + bool isLost_get() const + { + auto peep = GetGuest(); + return (peep != nullptr && peep->GuestIsLostCountdown < 90); + } + + uint8_t lostCountdown_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->GuestIsLostCountdown : 0; + } + void lostCountdown_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->GuestIsLostCountdown = value; + } + } }; class ScStaff : public ScPeep diff --git a/src/openrct2/scripting/ScPark.hpp b/src/openrct2/scripting/ScPark.hpp index 202f06de4c..ec6269f4d7 100644 --- a/src/openrct2/scripting/ScPark.hpp +++ b/src/openrct2/scripting/ScPark.hpp @@ -449,6 +449,16 @@ namespace OpenRCT2::Scripting gConstructionRightsPrice = value; } + int16_t casualtyPenalty_get() const + { + return gParkRatingCasualtyPenalty; + } + void casualtyPenalty_set(int16_t value) + { + ThrowIfGameStateNotMutable(); + gParkRatingCasualtyPenalty = value; + } + uint16_t parkSize_get() const { return gParkSize; @@ -600,6 +610,7 @@ namespace OpenRCT2::Scripting dukglue_register_property(ctx, &ScPark::parkSize_get, nullptr, "parkSize"); dukglue_register_property(ctx, &ScPark::name_get, &ScPark::name_set, "name"); dukglue_register_property(ctx, &ScPark::messages_get, &ScPark::messages_set, "messages"); + dukglue_register_property(ctx, &ScPark::casualtyPenalty_get, &ScPark::casualtyPenalty_set, "casualtyPenalty"); dukglue_register_method(ctx, &ScPark::getFlag, "getFlag"); dukglue_register_method(ctx, &ScPark::setFlag, "setFlag"); dukglue_register_method(ctx, &ScPark::postMessage, "postMessage"); diff --git a/src/openrct2/scripting/ScRide.hpp b/src/openrct2/scripting/ScRide.hpp index 877baca8f7..96043482da 100644 --- a/src/openrct2/scripting/ScRide.hpp +++ b/src/openrct2/scripting/ScRide.hpp @@ -642,6 +642,12 @@ namespace OpenRCT2::Scripting } } + uint8_t downtime_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->downtime : 0; + } + Ride* GetRide() const { return get_ride(_rideId); @@ -681,6 +687,7 @@ namespace OpenRCT2::Scripting dukglue_register_property( ctx, &ScRide::inspectionInterval_get, &ScRide::inspectionInterval_set, "inspectionInterval"); dukglue_register_property(ctx, &ScRide::value_get, &ScRide::value_set, "value"); + dukglue_register_property(ctx, &ScRide::downtime_get, nullptr, "downtime"); } }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index f5f8bc9a2d..9210a3622c 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 35; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 36; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; From 1168425f14ffeebdabb9624702e18b78fde96025 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 11 Aug 2021 16:37:42 +0200 Subject: [PATCH 132/681] Fix compilation on Ubuntu 20.04 / GCC 9 --- src/openrct2/scripting/ScMap.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index 78e87b0b22..10c3e10242 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -236,6 +236,8 @@ namespace OpenRCT2::Scripting { duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); } + + return DukValue(); } static void Register(duk_context* ctx) From 385c9ee5ffc38be6c822a51fb5958e38e0a21ca8 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 11 Aug 2021 17:51:20 +0200 Subject: [PATCH 133/681] Fix #15184: Crash when hovering over water types in Object Selection --- distribution/changelog.txt | 1 + src/openrct2/drawing/Image.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f83f6731cc..c23034eb8b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -12,6 +12,7 @@ - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Fix: [#15170] Plugin: incorrect label text alignment. +- Fix: [#15184] Crash when hovering over water types in Object Selection. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index ea6ab9f4c3..3e54059abd 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -30,7 +30,7 @@ static bool _initialised = false; static std::list _freeLists; static uint32_t _allocatedImageCount; -#ifdef DEBUG +#ifdef DEBUG_LEVEL_1 static std::list _allocatedLists; // MSVC's compiler doesn't support the [[maybe_unused]] attribute for unused static functions. Until this has been resolved, we @@ -76,7 +76,7 @@ static void InitialiseImageList() _freeLists.clear(); _freeLists.push_back({ BASE_IMAGE_ID, MAX_IMAGES }); -#ifdef DEBUG +#ifdef DEBUG_LEVEL_1 _allocatedLists.clear(); #endif _allocatedImageCount = 0; @@ -124,7 +124,7 @@ static uint32_t TryAllocateImageList(uint32_t count) _freeLists.push_back(remainder); } -#ifdef DEBUG +#ifdef DEBUG_LEVEL_1 _allocatedLists.push_back({ imageList.BaseId, count }); #endif _allocatedImageCount += count; @@ -163,9 +163,11 @@ static void FreeImageList(uint32_t baseImageId, uint32_t count) Guard::Assert(_initialised, GUARD_LINE); Guard::Assert(baseImageId >= BASE_IMAGE_ID, GUARD_LINE); -#ifdef DEBUG - bool contains = AllocatedListRemove(baseImageId, count); - Guard::Assert(contains, GUARD_LINE); +#ifdef DEBUG_LEVEL_1 + if (!AllocatedListRemove(baseImageId, count)) + { + log_error("Cannot unload %u items from offset %u", count, baseImageId); + } #endif _allocatedImageCount -= count; @@ -234,7 +236,7 @@ void gfx_object_check_all_images_freed() { if (_allocatedImageCount != 0) { -#ifdef DEBUG +#ifdef DEBUG_LEVEL_1 Guard::Assert(_allocatedImageCount == 0, "%u images were not freed", _allocatedImageCount); #else Console::Error::WriteLine("%u images were not freed", _allocatedImageCount); From e547dd96db0d5144c591697bbd3a261e0458054c Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 11 Aug 2021 17:51:59 +0200 Subject: [PATCH 134/681] Make RideConstructionState a strong enum --- src/openrct2-ui/windows/MazeConstruction.cpp | 50 ++++--- src/openrct2-ui/windows/RideConstruction.cpp | 134 ++++++++++--------- src/openrct2/interface/Window.h | 3 +- src/openrct2/ride/Ride.cpp | 14 +- src/openrct2/ride/Ride.h | 24 ++-- src/openrct2/ride/RideConstruction.cpp | 68 +++++----- src/openrct2/windows/_legacy.cpp | 26 ++-- 7 files changed, 166 insertions(+), 153 deletions(-) diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 9b5a9f1de2..171a49942c 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -187,11 +187,11 @@ static void window_maze_construction_entrance_mouseup(rct_window* w, rct_widgeti ride_construction_invalidate_current_track(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState != RideConstructionState::EntranceExit) { gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; } - _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; + _rideConstructionState = RideConstructionState::EntranceExit; window_maze_construction_update_pressed_widgets(); } @@ -227,14 +227,14 @@ static void window_maze_construction_mouseup(rct_window* w, rct_widgetindex widg static void window_maze_construction_resize(rct_window* w) { uint64_t disabledWidgets = 0; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE) + 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 == RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + 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); @@ -255,9 +255,9 @@ static void window_maze_construction_resize(rct_window* w) w->disabled_widgets = disabledWidgets; } -static void window_maze_construction_build_mode_mousedown(uint8_t rideConstructionState) +static void window_maze_construction_build_mode_mousedown(RideConstructionState rideConstructionState) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState == RideConstructionState::EntranceExit) { tool_cancel(); } @@ -274,13 +274,13 @@ static void window_maze_construction_mousedown(rct_window* w, rct_widgetindex wi switch (widgetIndex) { case WIDX_MAZE_BUILD_MODE: - window_maze_construction_build_mode_mousedown(RIDE_CONSTRUCTION_STATE_MAZE_BUILD); + window_maze_construction_build_mode_mousedown(RideConstructionState::Build); break; case WIDX_MAZE_MOVE_MODE: - window_maze_construction_build_mode_mousedown(RIDE_CONSTRUCTION_STATE_MAZE_MOVE); + window_maze_construction_build_mode_mousedown(RideConstructionState::MazeMove); break; case WIDX_MAZE_FILL_MODE: - window_maze_construction_build_mode_mousedown(RIDE_CONSTRUCTION_STATE_MAZE_FILL); + window_maze_construction_build_mode_mousedown(RideConstructionState::MazeFill); break; } } @@ -300,32 +300,36 @@ static void window_maze_construction_update(rct_window* w) switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_PLACE: + case RideConstructionState::Place: if (!WidgetIsActiveTool(w, WIDX_MAZE_DIRECTION_GROUPBOX)) { window_close(w); return; } break; - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + case RideConstructionState::EntranceExit: if (!WidgetIsActiveTool(w, WIDX_MAZE_ENTRANCE) && !WidgetIsActiveTool(w, WIDX_MAZE_EXIT)) { _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; window_maze_construction_update_pressed_widgets(); } break; + default: + break; } switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: - case RIDE_CONSTRUCTION_STATE_SELECTED: + case RideConstructionState::Front: + case RideConstructionState::Back: + case RideConstructionState::Selected: if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WC_RIDE_CONSTRUCTION) { tool_cancel(); } break; + default: + break; } sub_6C94D8(); } @@ -470,7 +474,7 @@ void window_maze_construction_update_pressed_widgets() switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + case RideConstructionState::EntranceExit: if (gCurrentToolWidget.widget_index == WIDX_MAZE_ENTRANCE) { pressedWidgets |= EnumToFlag(WIDX_MAZE_ENTRANCE); @@ -480,15 +484,17 @@ void window_maze_construction_update_pressed_widgets() pressedWidgets |= EnumToFlag(WIDX_MAZE_EXIT); } break; - case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: + case RideConstructionState::Build: pressedWidgets |= EnumToFlag(WIDX_MAZE_BUILD_MODE); break; - case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: + case RideConstructionState::MazeMove: pressedWidgets |= EnumToFlag(WIDX_MAZE_MOVE_MODE); break; - case RIDE_CONSTRUCTION_STATE_MAZE_FILL: + case RideConstructionState::MazeFill: pressedWidgets |= EnumToFlag(WIDX_MAZE_FILL_MODE); break; + default: + break; } w->pressed_widgets = pressedWidgets; @@ -513,16 +519,16 @@ static void window_maze_construction_construct(int32_t direction) z = _currentTrackBegin.z; switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: + case RideConstructionState::Build: mode = GC_SET_MAZE_TRACK_BUILD; flags = GAME_COMMAND_FLAG_APPLY; break; - case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: + case RideConstructionState::MazeMove: mode = GC_SET_MAZE_TRACK_MOVE; flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED; break; default: - case RIDE_CONSTRUCTION_STATE_MAZE_FILL: + case RideConstructionState::MazeFill: mode = GC_SET_MAZE_TRACK_FILL; flags = GAME_COMMAND_FLAG_APPLY; break; @@ -536,7 +542,7 @@ static void window_maze_construction_construct(int32_t direction) _currentTrackBegin.x = x; _currentTrackBegin.y = y; - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_MAZE_MOVE) + if (_rideConstructionState != RideConstructionState::MazeMove) { OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { x, y, z }); } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b4484ebe19..f66bae7077 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -563,7 +563,7 @@ rct_window* window_ride_construction_open() _previousTrackSlopeEnd = 0; _currentTrackPieceDirection = 0; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; + _rideConstructionState = RideConstructionState::Place; _currentTrackSelectionFlags = 0; _autoOpeningShop = false; _autoRotatingShop = true; @@ -686,7 +686,7 @@ static void window_ride_construction_resize(rct_window* w) { window_ride_construction_update_enabled_track_pieces(); w->enabled_widgets &= ~(1ULL << WIDX_CONSTRUCT); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_PLACE) + if (_rideConstructionState != RideConstructionState::Place) { w->enabled_widgets |= (1ULL << WIDX_CONSTRUCT); } @@ -767,7 +767,7 @@ static void window_ride_construction_resize(rct_window* w) | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP); } } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_0) + if (_rideConstructionState == RideConstructionState::State0) { disabledWidgets |= (1ULL << WIDX_CONSTRUCT) | (1ULL << WIDX_DEMOLISH) | (1ULL << WIDX_PREVIOUS_SECTION) | (1ULL << WIDX_NEXT_SECTION); @@ -1001,7 +1001,7 @@ static void window_ride_construction_resize(rct_window* w) { disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP); if (_currentTrackCurve == TRACK_CURVE_LEFT || _currentTrackCurve == TRACK_CURVE_RIGHT - || _rideConstructionState != RIDE_CONSTRUCTION_STATE_BACK || !is_track_enabled(TRACK_SLOPE_CURVE_BANKED)) + || _rideConstructionState != RideConstructionState::Back || !is_track_enabled(TRACK_SLOPE_CURVE_BANKED)) { disabledWidgets |= (1ULL << WIDX_LEVEL); } @@ -1010,7 +1010,7 @@ static void window_ride_construction_resize(rct_window* w) { disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP); if (_currentTrackCurve == TRACK_CURVE_LEFT || _currentTrackCurve == TRACK_CURVE_RIGHT - || _rideConstructionState != RIDE_CONSTRUCTION_STATE_FRONT || !is_track_enabled(TRACK_SLOPE_CURVE_BANKED)) + || _rideConstructionState != RideConstructionState::Front || !is_track_enabled(TRACK_SLOPE_CURVE_BANKED)) { disabledWidgets |= (1ULL << WIDX_LEVEL); } @@ -1147,7 +1147,7 @@ static void window_ride_construction_resize(rct_window* w) } if (is_track_enabled(TRACK_SLOPE_CURVE_BANKED)) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState == RideConstructionState::Front) { if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL || _currentTrackCurve == TRACK_CURVE_RIGHT_SMALL) { @@ -1157,7 +1157,7 @@ static void window_ride_construction_resize(rct_window* w) } } } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState == RideConstructionState::Back) { if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL || _currentTrackCurve == TRACK_CURVE_RIGHT_SMALL) { @@ -1173,7 +1173,7 @@ static void window_ride_construction_resize(rct_window* w) 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 == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState == RideConstructionState::Front) { disabledWidgets |= (1ULL << WIDX_NEXT_SECTION); if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) @@ -1181,7 +1181,7 @@ static void window_ride_construction_resize(rct_window* w) disabledWidgets |= (1ULL << WIDX_CONSTRUCT); } } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState == RideConstructionState::Back) { disabledWidgets |= (1ULL << WIDX_PREVIOUS_SECTION); if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) @@ -1193,8 +1193,8 @@ static void window_ride_construction_resize(rct_window* w) { disabledWidgets &= ~(1ULL << WIDX_BANKING_GROUPBOX); } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT - || _rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + 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) @@ -1383,7 +1383,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi break; case WIDX_SLOPE_DOWN: ride_construction_invalidate_current_track(); - if (_rideConstructionState == 2 && _currentTrackBankEnd != TRACK_BANK_NONE) + if (_rideConstructionState == RideConstructionState::Back && _currentTrackBankEnd != TRACK_BANK_NONE) { _currentTrackBankEnd = TRACK_BANK_NONE; } @@ -1391,7 +1391,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi break; case WIDX_LEVEL: ride_construction_invalidate_current_track(); - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT && _previousTrackSlopeEnd == 6) + if (_rideConstructionState == RideConstructionState::Front && _previousTrackSlopeEnd == 6) { if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL) { @@ -1402,7 +1402,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi _currentTrackBankEnd = TRACK_BANK_RIGHT; } } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK && _previousTrackSlopeEnd == 2) + else if (_rideConstructionState == RideConstructionState::Back && _previousTrackSlopeEnd == 2) { if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL) { @@ -1417,13 +1417,13 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi break; case WIDX_SLOPE_UP: ride_construction_invalidate_current_track(); - if (_rideConstructionState == 1 && _currentTrackBankEnd != TRACK_BANK_NONE) + if (_rideConstructionState == RideConstructionState::Front && _currentTrackBankEnd != TRACK_BANK_NONE) { _currentTrackBankEnd = TRACK_BANK_NONE; } if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT && _currentTrackCurve == TRACK_CURVE_NONE) + if (_rideConstructionState == RideConstructionState::Front && _currentTrackCurve == TRACK_CURVE_NONE) { _currentTrackCurve = TrackElemType::ReverseFreefallSlope | RideConstructionSpecialPieceSelected; window_ride_construction_update_active_elements(); @@ -1547,7 +1547,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi uint8_t brakesSpeed = *brakesSpeedPtr + 2; if (brakesSpeed <= maxBrakesSpeed) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_construction_set_brakes_speed(brakesSpeed); } @@ -1573,7 +1573,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi uint8_t brakesSpeed = *brakesSpeedPtr - 2; if (brakesSpeed >= 2) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_construction_set_brakes_speed(brakesSpeed); } @@ -1604,7 +1604,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi case WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP: if (_currentSeatRotationAngle < 15) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_selected_track_set_seat_rotation(_currentSeatRotationAngle + 1); } @@ -1618,7 +1618,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi case WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN: if (_currentSeatRotationAngle > 0) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_selected_track_set_seat_rotation(_currentSeatRotationAngle - 1); } @@ -1668,7 +1668,7 @@ static void CloseConstructWindowOnCompletion(Ride* ride); static void CloseConstructWindowOnCompletion(Ride* ride) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_0) + if (_rideConstructionState == RideConstructionState::State0) { auto w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr) @@ -1711,14 +1711,14 @@ static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, c _currentTrackPieceDirection = next_track.element->GetDirection(); _currentTrackPieceType = next_track.element->AsTrack()->GetTrackType(); _currentTrackSelectionFlags = 0; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _rideConstructionNextArrowPulse = 0; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; ride_select_next_section(); } else { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; } window_ride_construction_do_station_check(); @@ -1756,14 +1756,14 @@ static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, _currentTrackPieceDirection = trackBeginEnd.begin_direction; _currentTrackPieceType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); _currentTrackSelectionFlags = 0; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _rideConstructionNextArrowPulse = 0; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; ride_select_previous_section(); } else { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; } window_ride_construction_do_station_check(); @@ -1796,11 +1796,11 @@ static void window_ride_construction_construct(rct_window* w) auto trackPlaceAction = TrackPlaceAction( rideIndex, trackType, { trackPos, static_cast(trackDirection) }, (properties)&0xFF, (properties >> 8) & 0x0F, (properties >> 12) & 0x0F, liftHillAndAlternativeState, false); - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) { trackPlaceAction.SetCallback(RideConstructPlacedBackwardGameActionCallback); } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + else if (_rideConstructionState == RideConstructionState::Front) { trackPlaceAction.SetCallback(RideConstructPlacedForwardGameActionCallback); } @@ -1863,24 +1863,24 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) ride_construction_invalidate_current_track(); // Select the track element that is to be deleted - _rideConstructionState2 = RIDE_CONSTRUCTION_STATE_SELECTED; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + _rideConstructionState2 = RideConstructionState::Selected; + if (_rideConstructionState == RideConstructionState::Front) { if (!ride_select_backwards_from_front()) { window_ride_construction_update_active_elements(); return; } - _rideConstructionState2 = RIDE_CONSTRUCTION_STATE_FRONT; + _rideConstructionState2 = RideConstructionState::Front; } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState == RideConstructionState::Back) { if (!ride_select_forwards_from_back()) { window_ride_construction_update_active_elements(); return; } - _rideConstructionState2 = RIDE_CONSTRUCTION_STATE_BACK; + _rideConstructionState2 = RideConstructionState::Back; } // Invalidate the selected track element or make sure it's at origin??? @@ -1986,10 +1986,10 @@ static void window_ride_construction_entrance_click(rct_window* w) gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); ride_construction_invalidate_current_track(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState != RideConstructionState::EntranceExit) { gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; + _rideConstructionState = RideConstructionState::EntranceExit; } window_ride_construction_update_active_elements(); } @@ -2016,10 +2016,10 @@ static void window_ride_construction_exit_click(rct_window* w) gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); ride_construction_invalidate_current_track(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState != RideConstructionState::EntranceExit) { gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; + _rideConstructionState = RideConstructionState::EntranceExit; } window_ride_construction_update_active_elements(); } @@ -2053,7 +2053,7 @@ static void window_ride_construction_update(rct_window* w) break; } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE) + if (_rideConstructionState == RideConstructionState::Place) { if (!WidgetIsActiveTool(w, WIDX_CONSTRUCT)) { @@ -2062,7 +2062,7 @@ static void window_ride_construction_update(rct_window* w) } } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState == RideConstructionState::EntranceExit) { if (!WidgetIsActiveTool(w, WIDX_ENTRANCE) && !WidgetIsActiveTool(w, WIDX_EXIT)) { @@ -2073,14 +2073,16 @@ static void window_ride_construction_update(rct_window* w) switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: - case RIDE_CONSTRUCTION_STATE_SELECTED: + case RideConstructionState::Front: + case RideConstructionState::Back: + case RideConstructionState::Selected: if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WC_RIDE_CONSTRUCTION) { tool_cancel(); } break; + default: + break; } sub_6C94D8(); @@ -2323,7 +2325,7 @@ static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi // Draw cost screenCoords = { w->windowPos.x + widget->midX(), w->windowPos.y + widget->bottom - 23 }; - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_PLACE) + if (_rideConstructionState != RideConstructionState::Place) DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); screenCoords.y += 11; @@ -2488,7 +2490,7 @@ void window_ride_construction_update_active_elements_impl() window_ride_construction_update_map_selection(); _selectedTrackType = TrackElemType::None; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { if (sub_6C683D( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, @@ -2549,8 +2551,8 @@ void sub_6C94D8() switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: + case RideConstructionState::Front: + case RideConstructionState::Back: { if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) { @@ -2578,7 +2580,7 @@ void sub_6C94D8() type = _currentTrackPieceType; if (direction >= 4) direction += 4; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) direction = direction_reverse(direction); gMapSelectArrowPosition = trackPos; gMapSelectArrowDirection = direction; @@ -2588,7 +2590,7 @@ void sub_6C94D8() map_invalidate_tile_full(trackPos); break; } - case RIDE_CONSTRUCTION_STATE_SELECTED: + case RideConstructionState::Selected: { auto curTime = platform_get_ticks(); if (_rideConstructionNextArrowPulse >= curTime) @@ -2604,13 +2606,13 @@ void sub_6C94D8() if (newCoords == std::nullopt) { ride_construction_remove_ghosts(); - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; } break; } - case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: - case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: - case RIDE_CONSTRUCTION_STATE_MAZE_FILL: + case RideConstructionState::Build: + case RideConstructionState::MazeMove: + case RideConstructionState::MazeFill: { auto curTime = platform_get_ticks(); if (_rideConstructionNextArrowPulse >= curTime) @@ -2637,6 +2639,8 @@ void sub_6C94D8() map_invalidate_tile_full(trackPos); break; } + default: + break; } } @@ -2655,17 +2659,17 @@ static void window_ride_construction_update_map_selection() switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_0: + case RideConstructionState::State0: trackDirection = _currentTrackPieceDirection; trackType = 0; trackPos = _currentTrackBegin; break; - case RIDE_CONSTRUCTION_STATE_SELECTED: + case RideConstructionState::Selected: trackDirection = _currentTrackPieceDirection; trackType = _currentTrackPieceType; trackPos = _currentTrackBegin; break; - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + case RideConstructionState::EntranceExit: gMapSelectionTiles.clear(); return; default: @@ -2715,12 +2719,12 @@ static void window_ride_construction_update_possible_ride_configurations() } int32_t slope, bank; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT || _rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE) + if (_rideConstructionState == RideConstructionState::Front || _rideConstructionState == RideConstructionState::Place) { slope = TrackDefinitions[trackType].vangle_start; bank = TrackDefinitions[trackType].bank_start; } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState == RideConstructionState::Back) { slope = TrackDefinitions[trackType].vangle_end; bank = TrackDefinitions[trackType].bank_end; @@ -3166,22 +3170,22 @@ static void window_ride_construction_update_widgets(rct_window* w) switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: + case RideConstructionState::Front: window_ride_construction_widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; window_ride_construction_widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; break; - case RIDE_CONSTRUCTION_STATE_BACK: + case RideConstructionState::Back: window_ride_construction_widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; window_ride_construction_widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; break; - case RIDE_CONSTRUCTION_STATE_PLACE: + case RideConstructionState::Place: window_ride_construction_widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; window_ride_construction_widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; window_ride_construction_widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; window_ride_construction_widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; window_ride_construction_widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; break; - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + case RideConstructionState::EntranceExit: window_ride_construction_widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; window_ride_construction_widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; window_ride_construction_widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; @@ -3368,7 +3372,7 @@ static void loc_6C7502(int32_t al) { _currentTrackSlopeEnd = al; _currentTrackPrice = MONEY32_UNDEFINED; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState == RideConstructionState::Front) { if (al != 2 && al != 4 && al != 0) { @@ -3542,7 +3546,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) _currentTrackBegin.z += 16; } - if (_autoRotatingShop && _rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE + if (_autoRotatingShop && _rideConstructionState == RideConstructionState::Place && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) { TileElement* pathsByDir[NumOrthogonalDirections]; @@ -3731,7 +3735,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) { for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD; + _rideConstructionState = RideConstructionState::Build; _currentTrackBegin.x = mapCoords.x; _currentTrackBegin.y = mapCoords.y; _currentTrackBegin.z = z; @@ -3752,7 +3756,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (_trackPlaceCost == MONEY32_UNDEFINED) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; + _rideConstructionState = RideConstructionState::Place; rct_string_id errorText = gGameCommandErrorText; z -= 8; if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER @@ -3787,7 +3791,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; + _rideConstructionState = RideConstructionState::Front; _currentTrackBegin.x = mapCoords.x; _currentTrackBegin.y = mapCoords.y; _currentTrackBegin.z = z; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 9ad150c9b9..17db7753c0 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -32,6 +32,7 @@ struct scenario_index_entry; enum class VisibilityCache : uint8_t; enum class CursorID : uint8_t; +enum class RideConstructionState : uint8_t; #define SCROLLABLE_ROW_HEIGHT 12 #define LIST_ROW_HEIGHT 12 @@ -892,7 +893,7 @@ money32 place_provisional_track_piece( const CoordsXYZ& trackPos); extern uint64_t _enabledRidePieces; -extern uint8_t _rideConstructionState2; +extern RideConstructionState _rideConstructionState2; extern bool _stationConstructed; extern bool _deferClose; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 729ff69192..0cc906322d 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -715,7 +715,7 @@ int32_t ride_find_track_gap(const Ride* ride, CoordsXYE* input, CoordsXYE* outpu } rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && _currentRideIndex == ride->id) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == ride->id) { ride_construction_invalidate_current_track(); } @@ -2581,7 +2581,7 @@ static int32_t ride_check_block_brakes(CoordsXYE* input, CoordsXYE* output) { ride_id_t rideIndex = input->element->AsTrack()->GetRideIndex(); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && _currentRideIndex == rideIndex) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) ride_construction_invalidate_current_track(); track_circuit_iterator it; @@ -2645,7 +2645,7 @@ static bool ride_check_track_contains_inversions(CoordsXYE* input, CoordsXYE* ou return true; rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && rideIndex == _currentRideIndex) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); } @@ -2703,7 +2703,7 @@ static bool ride_check_track_contains_banked(CoordsXYE* input, CoordsXYE* output return true; rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && rideIndex == _currentRideIndex) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); } @@ -2743,7 +2743,7 @@ static bool ride_check_track_contains_banked(CoordsXYE* input, CoordsXYE* output static int32_t ride_check_station_length(CoordsXYE* input, CoordsXYE* output) { rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == input->element->AsTrack()->GetRideIndex()) { ride_construction_invalidate_current_track(); @@ -2804,7 +2804,7 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) return false; auto w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && rideIndex == _currentRideIndex) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && rideIndex == _currentRideIndex) { ride_construction_invalidate_current_track(); } @@ -4886,7 +4886,7 @@ static int32_t ride_get_track_length(Ride* ride) ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); rct_window* w = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (w != nullptr && _rideConstructionState != RIDE_CONSTRUCTION_STATE_0 && _currentRideIndex == rideIndex) + if (w != nullptr && _rideConstructionState != RideConstructionState::State0 && _currentRideIndex == rideIndex) { ride_construction_invalidate_current_track(); } diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 066330478b..d86a11a40f 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -881,17 +881,17 @@ enum RIDE_CRASH_TYPE_FATALITIES = 8 }; -enum +enum class RideConstructionState : uint8_t { - RIDE_CONSTRUCTION_STATE_0, - RIDE_CONSTRUCTION_STATE_FRONT, - RIDE_CONSTRUCTION_STATE_BACK, - RIDE_CONSTRUCTION_STATE_SELECTED, - RIDE_CONSTRUCTION_STATE_PLACE, - RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT, - RIDE_CONSTRUCTION_STATE_MAZE_BUILD, - RIDE_CONSTRUCTION_STATE_MAZE_MOVE, - RIDE_CONSTRUCTION_STATE_MAZE_FILL + State0, + Front, + Back, + Selected, + Place, + EntranceExit, + Build, + MazeMove, + MazeFill }; enum @@ -1086,7 +1086,7 @@ extern uint16_t _numCurrentPossibleRideConfigurations; extern uint16_t _numCurrentPossibleSpecialTrackPieces; extern uint32_t _currentTrackCurve; -extern uint8_t _rideConstructionState; +extern RideConstructionState _rideConstructionState; extern ride_id_t _currentRideIndex; extern CoordsXYZ _currentTrackBegin; @@ -1114,7 +1114,7 @@ extern CoordsXYZD _unkF440C5; extern uint8_t gRideEntranceExitPlaceType; extern ride_id_t gRideEntranceExitPlaceRideIndex; extern StationIndex gRideEntranceExitPlaceStationIndex; -extern uint8_t gRideEntranceExitPlacePreviousRideConstructionState; +extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; extern uint8_t gRideEntranceExitPlaceDirection; extern bool gGotoStartPlacementMode; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 8272d94d78..45cbc3e523 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -53,7 +53,7 @@ uint16_t _numCurrentPossibleRideConfigurations; uint16_t _numCurrentPossibleSpecialTrackPieces; uint32_t _currentTrackCurve; -uint8_t _rideConstructionState; +RideConstructionState _rideConstructionState; ride_id_t _currentRideIndex; CoordsXYZ _currentTrackBegin; @@ -83,7 +83,7 @@ uint8_t gLastEntranceStyle; uint8_t gRideEntranceExitPlaceType; ride_id_t gRideEntranceExitPlaceRideIndex; StationIndex gRideEntranceExitPlaceStationIndex; -uint8_t gRideEntranceExitPlacePreviousRideConstructionState; +RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; Direction gRideEntranceExitPlaceDirection; using namespace OpenRCT2; @@ -545,24 +545,24 @@ void ride_construction_invalidate_current_track() { switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_SELECTED: + case RideConstructionState::Selected: sub_6C683D( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); break; - case RIDE_CONSTRUCTION_STATE_MAZE_BUILD: - case RIDE_CONSTRUCTION_STATE_MAZE_MOVE: - case RIDE_CONSTRUCTION_STATE_MAZE_FILL: - case RIDE_CONSTRUCTION_STATE_FRONT: - case RIDE_CONSTRUCTION_STATE_BACK: + case RideConstructionState::Build: + case RideConstructionState::MazeMove: + case RideConstructionState::MazeFill: + case RideConstructionState::Front: + case RideConstructionState::Back: if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) { map_invalidate_tile_full(_currentTrackBegin.ToTileStart()); } ride_construction_remove_ghosts(); break; - case RIDE_CONSTRUCTION_STATE_PLACE: - case RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT: + case RideConstructionState::Place: + case RideConstructionState::EntranceExit: default: if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) { @@ -604,7 +604,7 @@ static void ride_construction_reset_current_piece() else { _currentTrackCurve = TrackElemType::None; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; } } @@ -628,7 +628,7 @@ void ride_construction_set_default_next_piece() _currentTrackPrice = MONEY32_UNDEFINED; switch (_rideConstructionState) { - case RIDE_CONSTRUCTION_STATE_FRONT: + case RideConstructionState::Front: direction = _currentTrackPieceDirection; if (!track_block_get_previous_from_zero(_currentTrackBegin, ride, direction, &trackBeginEnd)) { @@ -679,7 +679,7 @@ void ride_construction_set_default_next_piece() _currentTrackLiftHill = tileElement->AsTrack()->HasChain() && slope != TRACK_SLOPE_DOWN_25 && slope != TRACK_SLOPE_DOWN_60; break; - case RIDE_CONSTRUCTION_STATE_BACK: + case RideConstructionState::Back: direction = direction_reverse(_currentTrackPieceDirection); if (!track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &xyElement, &z, &direction, false)) { @@ -726,6 +726,8 @@ void ride_construction_set_default_next_piece() _currentTrackLiftHill = tileElement->AsTrack()->HasChain(); } break; + default: + break; } } @@ -735,7 +737,7 @@ void ride_construction_set_default_next_piece() */ void ride_select_next_section() { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_construction_invalidate_current_track(); int32_t direction = _currentTrackPieceDirection; @@ -744,7 +746,7 @@ void ride_select_next_section() auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; window_ride_construction_update_active_elements(); return; } @@ -775,7 +777,7 @@ void ride_select_next_section() } else { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; + _rideConstructionState = RideConstructionState::Front; _currentTrackBegin = { outputElement, newCoords->z }; _currentTrackPieceDirection = direction; _currentTrackPieceType = tileElement->AsTrack()->GetTrackType(); @@ -784,7 +786,7 @@ void ride_select_next_section() window_ride_construction_update_active_elements(); } } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState == RideConstructionState::Back) { gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -801,7 +803,7 @@ void ride_select_next_section() */ void ride_select_previous_section() { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_SELECTED) + if (_rideConstructionState == RideConstructionState::Selected) { ride_construction_invalidate_current_track(); int32_t direction = _currentTrackPieceDirection; @@ -810,7 +812,7 @@ void ride_select_previous_section() auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_0; + _rideConstructionState = RideConstructionState::State0; window_ride_construction_update_active_elements(); return; } @@ -836,7 +838,7 @@ void ride_select_previous_section() } else { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_BACK; + _rideConstructionState = RideConstructionState::Back; _currentTrackBegin.x = trackBeginEnd.end_x; _currentTrackBegin.y = trackBeginEnd.end_y; _currentTrackBegin.z = trackBeginEnd.begin_z; @@ -847,7 +849,7 @@ void ride_select_previous_section() window_ride_construction_update_active_elements(); } } - else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + else if (_rideConstructionState == RideConstructionState::Front) { gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -895,7 +897,7 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) } ride_construction_invalidate_current_track(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) + if (_rideConstructionState != RideConstructionState::EntranceExit || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) || gCurrentToolWidget.window_classification != WC_RIDE_CONSTRUCTION) { // Replace entrance / exit @@ -907,10 +909,10 @@ static bool ride_modify_entrance_or_exit(const CoordsXYE& tileElement) gRideEntranceExitPlaceRideIndex = rideIndex; gRideEntranceExitPlaceStationIndex = stationIndex; input_set_flag(INPUT_FLAG_6, true); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT) + if (_rideConstructionState != RideConstructionState::EntranceExit) { gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_ENTRANCE_EXIT; + _rideConstructionState = RideConstructionState::EntranceExit; } window_ride_construction_update_active_elements(); @@ -948,7 +950,7 @@ static bool ride_modify_maze(const CoordsXYE& tileElement) if (trackElement != nullptr) { _currentRideIndex = trackElement->GetRideIndex(); - _rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD; + _rideConstructionState = RideConstructionState::Build; _currentTrackBegin.x = tileElement.x; _currentTrackBegin.y = tileElement.y; _currentTrackBegin.z = trackElement->GetBaseZ(); @@ -1030,7 +1032,7 @@ bool ride_modify(CoordsXYE* input) return false; _currentRideIndex = rideIndex; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _currentTrackBegin = *newCoords; _currentTrackPieceDirection = direction; _currentTrackPieceType = type; @@ -1045,13 +1047,13 @@ bool ride_modify(CoordsXYE* input) } ride_select_next_section(); - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState == RideConstructionState::Front) { window_ride_construction_update_active_elements(); return true; } - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _currentTrackBegin = *newCoords; _currentTrackPieceDirection = direction; _currentTrackPieceType = type; @@ -1059,9 +1061,9 @@ bool ride_modify(CoordsXYE* input) ride_select_previous_section(); - if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState != RideConstructionState::Back) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _currentTrackBegin = *newCoords; _currentTrackPieceDirection = direction; _currentTrackPieceType = type; @@ -1110,7 +1112,7 @@ int32_t ride_initialise_construction_window(Ride* ride) _previousTrackSlopeEnd = 0; _currentTrackPieceDirection = 0; - _rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE; + _rideConstructionState = RideConstructionState::Place; _currentTrackSelectionFlags = 0; window_ride_construction_update_active_elements(); @@ -1657,7 +1659,7 @@ bool ride_select_backwards_from_front() track_begin_end trackBeginEnd; if (track_block_get_previous_from_zero(_currentTrackBegin, ride, _currentTrackPieceDirection, &trackBeginEnd)) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _currentTrackBegin.x = trackBeginEnd.begin_x; _currentTrackBegin.y = trackBeginEnd.begin_y; _currentTrackBegin.z = trackBeginEnd.begin_z; @@ -1682,7 +1684,7 @@ bool ride_select_forwards_from_back() CoordsXYE next_track; if (track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &next_track, &z, &direction, false)) { - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; _currentTrackBegin.x = next_track.x; _currentTrackBegin.y = next_track.y; _currentTrackBegin.z = z; diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 3116c22498..bfbcb7da71 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -30,7 +30,7 @@ bool gDisableErrorWindowSound = false; uint64_t _enabledRidePieces; -uint8_t _rideConstructionState2; +RideConstructionState _rideConstructionState2; // This variable is updated separately from ride->num_stations because the latter // is unreliable if currently in station construction mode @@ -133,7 +133,7 @@ static std::tuple window_ride_construction_update_state_get_ uint8_t startBank = _previousTrackBankEnd; uint8_t endBank = _currentTrackBankEnd; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) { startSlope = _currentTrackSlopeEnd; endSlope = _previousTrackSlopeEnd; @@ -150,7 +150,7 @@ static std::tuple window_ride_construction_update_state_get_ bool startsDiagonal = (_currentTrackPieceDirection & (1 << 2)) != 0; if (curve == TRACK_CURVE_LEFT_LARGE || curve == TRACK_CURVE_RIGHT_LARGE) { - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) { startsDiagonal = !startsDiagonal; } @@ -205,7 +205,7 @@ static std::tuple window_ride_construction_update_state_get_ return std::make_tuple(false, 0); } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) { if (endSlope != TRACK_SLOPE_DOWN_25) { @@ -317,7 +317,7 @@ bool window_ride_construction_update_state( x = _currentTrackBegin.x; y = _currentTrackBegin.y; auto z = _currentTrackBegin.z; - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState == RideConstructionState::Back) { z -= trackCoordinates.z_end; trackDirection = _currentTrackPieceDirection ^ 0x02; @@ -401,7 +401,7 @@ void window_ride_construction_do_entrance_exit_check() return; } - if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_0) + if (_rideConstructionState == RideConstructionState::State0) { w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr) @@ -432,7 +432,7 @@ void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piec if (gGotoStartPlacementMode) { _currentTrackBegin.z = floor2(piecePos.z, COORDS_Z_STEP); - _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; + _rideConstructionState = RideConstructionState::Front; _currentTrackSelectionFlags = 0; _currentTrackPieceDirection = piecePos.direction & 3; auto savedCurrentTrackCurve = _currentTrackCurve; @@ -464,15 +464,15 @@ void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piec } else { - if (_rideConstructionState2 == RIDE_CONSTRUCTION_STATE_SELECTED - || _rideConstructionState2 == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState2 == RideConstructionState::Selected + || _rideConstructionState2 == RideConstructionState::Front) { if (type == TrackElemType::MiddleStation || type == TrackElemType::BeginStation) { type = TrackElemType::EndStation; } } - if (_rideConstructionState2 == RIDE_CONSTRUCTION_STATE_BACK) + if (_rideConstructionState2 == RideConstructionState::Back) { if (type == TrackElemType::MiddleStation) { @@ -482,17 +482,17 @@ void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piec if (network_get_mode() == NETWORK_MODE_CLIENT) { // rideConstructionState needs to be set again to the proper value, this only affects the client - _rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED; + _rideConstructionState = RideConstructionState::Selected; } _currentTrackBegin = piecePos; _currentTrackPieceDirection = piecePos.direction; _currentTrackPieceType = type; _currentTrackSelectionFlags = 0; - if (_rideConstructionState2 == RIDE_CONSTRUCTION_STATE_FRONT) + if (_rideConstructionState2 == RideConstructionState::Front) { ride_select_next_section(); } - else if (_rideConstructionState2 == RIDE_CONSTRUCTION_STATE_BACK) + else if (_rideConstructionState2 == RideConstructionState::Back) { ride_select_previous_section(); } From adf5829cd696c94f300345b0e0ee7d239dcf7296 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 19:34:23 +0300 Subject: [PATCH 135/681] Re-arrange structure of scripting --- OpenRCT2.xcodeproj/project.pbxproj | 156 ++++++++++++++---- src/openrct2/libopenrct2.vcxproj | 32 ++-- src/openrct2/scripting/ScriptEngine.cpp | 30 ++-- .../{ => bindings/entity}/ScEntity.hpp | 2 +- .../{ => bindings/game}/ScCheats.hpp | 4 +- .../{ => bindings/game}/ScConfiguration.hpp | 10 +- .../{ => bindings/game}/ScConsole.hpp | 6 +- .../{ => bindings/game}/ScContext.hpp | 22 +-- .../{ => bindings/game}/ScDisposable.hpp | 2 +- .../{ => bindings/network}/ScNetwork.hpp | 16 +- .../{ => bindings/network}/ScSocket.hpp | 10 +- .../{ => bindings/object}/ScObject.hpp | 14 +- .../scripting/{ => bindings/ride}/ScRide.hpp | 12 +- .../{ => bindings/world}/ScClimate.hpp | 12 +- .../scripting/{ => bindings/world}/ScDate.hpp | 16 +- .../scripting/{ => bindings/world}/ScMap.hpp | 30 ++-- .../scripting/{ => bindings/world}/ScPark.hpp | 22 +-- .../{ => bindings/world}/ScScenario.hpp | 16 +- .../scripting/{ => bindings/world}/ScTile.hpp | 20 +-- 19 files changed, 258 insertions(+), 174 deletions(-) rename src/openrct2/scripting/{ => bindings/entity}/ScEntity.hpp (99%) rename src/openrct2/scripting/{ => bindings/game}/ScCheats.hpp (99%) rename src/openrct2/scripting/{ => bindings/game}/ScConfiguration.hpp (97%) rename src/openrct2/scripting/{ => bindings/game}/ScConsole.hpp (93%) rename src/openrct2/scripting/{ => bindings/game}/ScContext.hpp (96%) rename src/openrct2/scripting/{ => bindings/game}/ScDisposable.hpp (97%) rename src/openrct2/scripting/{ => bindings/network}/ScNetwork.hpp (97%) rename src/openrct2/scripting/{ => bindings/network}/ScSocket.hpp (98%) rename src/openrct2/scripting/{ => bindings/object}/ScObject.hpp (99%) rename src/openrct2/scripting/{ => bindings/ride}/ScRide.hpp (99%) rename src/openrct2/scripting/{ => bindings/world}/ScClimate.hpp (94%) rename src/openrct2/scripting/{ => bindings/world}/ScDate.hpp (90%) rename src/openrct2/scripting/{ => bindings/world}/ScMap.hpp (94%) rename src/openrct2/scripting/{ => bindings/world}/ScPark.hpp (97%) rename src/openrct2/scripting/{ => bindings/world}/ScScenario.hpp (97%) rename src/openrct2/scripting/{ => bindings/world}/ScTile.hpp (99%) diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 82b726f9ed..796d07d86a 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -344,23 +344,11 @@ 93DFD02E24521BA0001FCBAF /* FileWatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD02C24521B9F001FCBAF /* FileWatcher.h */; }; 93DFD02F24521BA0001FCBAF /* FileWatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD02D24521BA0001FCBAF /* FileWatcher.cpp */; }; 93DFD04424521C1A001FCBAF /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03124521C19001FCBAF /* Plugin.h */; }; - 93DFD04524521C1A001FCBAF /* ScObject.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03224521C19001FCBAF /* ScObject.hpp */; }; 93DFD04624521C1A001FCBAF /* HookEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03324521C19001FCBAF /* HookEngine.h */; }; - 93DFD04724521C1A001FCBAF /* ScNetwork.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03424521C19001FCBAF /* ScNetwork.hpp */; }; 93DFD04824521C1A001FCBAF /* HookEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03524521C19001FCBAF /* HookEngine.cpp */; }; - 93DFD04924521C1A001FCBAF /* ScTile.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03624521C19001FCBAF /* ScTile.hpp */; }; - 93DFD04A24521C1A001FCBAF /* ScConfiguration.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03724521C19001FCBAF /* ScConfiguration.hpp */; }; 93DFD04B24521C1A001FCBAF /* ScriptEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */; }; - 93DFD04C24521C1A001FCBAF /* ScDisposable.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03924521C19001FCBAF /* ScDisposable.hpp */; }; - 93DFD04D24521C1A001FCBAF /* ScEntity.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03A24521C19001FCBAF /* ScEntity.hpp */; }; 93DFD04E24521C1A001FCBAF /* Duktape.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03B24521C19001FCBAF /* Duktape.hpp */; }; - 93DFD04F24521C1A001FCBAF /* ScConsole.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03C24521C19001FCBAF /* ScConsole.hpp */; }; - 93DFD05024521C1A001FCBAF /* ScPark.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03D24521C19001FCBAF /* ScPark.hpp */; }; - 93DFD05124521C1A001FCBAF /* ScContext.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03E24521C19001FCBAF /* ScContext.hpp */; }; 93DFD05224521C1A001FCBAF /* Plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03F24521C19001FCBAF /* Plugin.cpp */; }; - 93DFD05324521C1A001FCBAF /* ScRide.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD04024521C19001FCBAF /* ScRide.hpp */; }; - 93DFD05424521C1A001FCBAF /* ScDate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD04124521C19001FCBAF /* ScDate.hpp */; }; - 93DFD05524521C1A001FCBAF /* ScMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD04224521C19001FCBAF /* ScMap.hpp */; }; 93DFD05624521C1A001FCBAF /* ScriptEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD04324521C19001FCBAF /* ScriptEngine.h */; }; 93F6004C213DD7DD00EEB83E /* TerrainSurfaceObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F60049213DD7DC00EEB83E /* TerrainSurfaceObject.cpp */; }; 93F6004D213DD7DD00EEB83E /* TerrainEdgeObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F6004A213DD7DC00EEB83E /* TerrainEdgeObject.cpp */; }; @@ -768,6 +756,22 @@ 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9D3DD6CD73F5421880280D9D /* Litter.cpp */; }; B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */; }; 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */; }; + 8C801369C7E44292A5348DFB /* ScEntity.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6DF61461D47C40CF92019B24 /* ScEntity.hpp */; }; + BCCE3EDC711F4F0587F1C359 /* ScCheats.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */; }; + F396A397541149D6ACA290D2 /* ScConfiguration.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */; }; + 2EEDD899BAF94706ACED5F6D /* ScConsole.hpp in Headers */ = {isa = PBXBuildFile; fileRef = E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */; }; + 74E3377F2FC04316959F1AED /* ScContext.hpp in Headers */ = {isa = PBXBuildFile; fileRef = DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */; }; + A10C0EE3C2614B53AFB6ED35 /* ScDisposable.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */; }; + 05F6EF4AAFEC4BA4A454046B /* ScNetwork.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */; }; + AC4C9184C93A4113A6BEEC60 /* ScSocket.hpp in Headers */ = {isa = PBXBuildFile; fileRef = D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */; }; + A962C2EF5FA6429C92318441 /* ScObject.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 24F9DF02868247738D05CC40 /* ScObject.hpp */; }; + E09450B2440E465CBCE62DEB /* ScRide.hpp in Headers */ = {isa = PBXBuildFile; fileRef = AD97B712FDF7454CADC7A328 /* ScRide.hpp */; }; + A2EC8BBCB8AD49ECB1C22F9D /* ScClimate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */; }; + 2AE59B9E2E4D496286970915 /* ScDate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */; }; + 7930E9462549403181C5D164 /* ScMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 74CDED6B7EF041458032681A /* ScMap.hpp */; }; + 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 9AB8D336AB654D0280549A89 /* ScPark.hpp */; }; + 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A9F55F2291284217BA0E4E51 /* ScScenario.hpp */; }; + F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 22D7DD798F054A068273739B /* ScTile.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1462,23 +1466,11 @@ 93DFD02C24521B9F001FCBAF /* FileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileWatcher.h; sourceTree = ""; }; 93DFD02D24521BA0001FCBAF /* FileWatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileWatcher.cpp; sourceTree = ""; }; 93DFD03124521C19001FCBAF /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = ""; }; - 93DFD03224521C19001FCBAF /* ScObject.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScObject.hpp; sourceTree = ""; }; 93DFD03324521C19001FCBAF /* HookEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HookEngine.h; sourceTree = ""; }; - 93DFD03424521C19001FCBAF /* ScNetwork.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScNetwork.hpp; sourceTree = ""; }; 93DFD03524521C19001FCBAF /* HookEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HookEngine.cpp; sourceTree = ""; }; - 93DFD03624521C19001FCBAF /* ScTile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScTile.hpp; sourceTree = ""; }; - 93DFD03724521C19001FCBAF /* ScConfiguration.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScConfiguration.hpp; sourceTree = ""; }; 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptEngine.cpp; sourceTree = ""; }; - 93DFD03924521C19001FCBAF /* ScDisposable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScDisposable.hpp; sourceTree = ""; }; - 93DFD03A24521C19001FCBAF /* ScEntity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScEntity.hpp; sourceTree = ""; }; 93DFD03B24521C19001FCBAF /* Duktape.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Duktape.hpp; sourceTree = ""; }; - 93DFD03C24521C19001FCBAF /* ScConsole.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScConsole.hpp; sourceTree = ""; }; - 93DFD03D24521C19001FCBAF /* ScPark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScPark.hpp; sourceTree = ""; }; - 93DFD03E24521C19001FCBAF /* ScContext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScContext.hpp; sourceTree = ""; }; 93DFD03F24521C19001FCBAF /* Plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Plugin.cpp; sourceTree = ""; }; - 93DFD04024521C19001FCBAF /* ScRide.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScRide.hpp; sourceTree = ""; }; - 93DFD04124521C19001FCBAF /* ScDate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScDate.hpp; sourceTree = ""; }; - 93DFD04224521C19001FCBAF /* ScMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScMap.hpp; sourceTree = ""; }; 93DFD04324521C19001FCBAF /* ScriptEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptEngine.h; sourceTree = ""; }; 93F60048213DD7DC00EEB83E /* TerrainSurfaceObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TerrainSurfaceObject.h; sourceTree = ""; }; 93F60049213DD7DC00EEB83E /* TerrainSurfaceObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TerrainSurfaceObject.cpp; sourceTree = ""; }; @@ -1838,6 +1830,22 @@ 9D3DD6CD73F5421880280D9D /* Litter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Litter.cpp; path = src/openrct2/world/Litter.cpp; sourceTree = SOURCE_ROOT; }; 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideConstruction.cpp; path = src/openrct2/ride/RideConstruction.cpp; sourceTree = SOURCE_ROOT; }; BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = EnumMap.hpp; path = src/openrct2/core/EnumMap.hpp; sourceTree = SOURCE_ROOT; }; + 6DF61461D47C40CF92019B24 /* ScEntity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScEntity.hpp; path = src/openrct2/scripting/bindings/entity/ScEntity.hpp; sourceTree = SOURCE_ROOT; }; + 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScCheats.hpp; path = src/openrct2/scripting/bindings/game/ScCheats.hpp; sourceTree = SOURCE_ROOT; }; + FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScConfiguration.hpp; path = src/openrct2/scripting/bindings/game/ScConfiguration.hpp; sourceTree = SOURCE_ROOT; }; + E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScConsole.hpp; path = src/openrct2/scripting/bindings/game/ScConsole.hpp; sourceTree = SOURCE_ROOT; }; + DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScContext.hpp; path = src/openrct2/scripting/bindings/game/ScContext.hpp; sourceTree = SOURCE_ROOT; }; + 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScDisposable.hpp; path = src/openrct2/scripting/bindings/game/ScDisposable.hpp; sourceTree = SOURCE_ROOT; }; + BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScNetwork.hpp; path = src/openrct2/scripting/bindings/network/ScNetwork.hpp; sourceTree = SOURCE_ROOT; }; + D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScSocket.hpp; path = src/openrct2/scripting/bindings/network/ScSocket.hpp; sourceTree = SOURCE_ROOT; }; + 24F9DF02868247738D05CC40 /* ScObject.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScObject.hpp; path = src/openrct2/scripting/bindings/object/ScObject.hpp; sourceTree = SOURCE_ROOT; }; + AD97B712FDF7454CADC7A328 /* ScRide.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRide.hpp; path = src/openrct2/scripting/bindings/ride/ScRide.hpp; sourceTree = SOURCE_ROOT; }; + 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScClimate.hpp; path = src/openrct2/scripting/bindings/world/ScClimate.hpp; sourceTree = SOURCE_ROOT; }; + 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScDate.hpp; path = src/openrct2/scripting/bindings/world/ScDate.hpp; sourceTree = SOURCE_ROOT; }; + 74CDED6B7EF041458032681A /* ScMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScMap.hpp; path = src/openrct2/scripting/bindings/world/ScMap.hpp; sourceTree = SOURCE_ROOT; }; + 9AB8D336AB654D0280549A89 /* ScPark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPark.hpp; path = src/openrct2/scripting/bindings/world/ScPark.hpp; sourceTree = SOURCE_ROOT; }; + A9F55F2291284217BA0E4E51 /* ScScenario.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScScenario.hpp; path = src/openrct2/scripting/bindings/world/ScScenario.hpp; sourceTree = SOURCE_ROOT; }; + 22D7DD798F054A068273739B /* ScTile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTile.hpp; path = src/openrct2/scripting/bindings/world/ScTile.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1963,6 +1971,7 @@ 93DFD03024521C19001FCBAF /* scripting */ = { isa = PBXGroup; children = ( + 59B0CA75A27A4C5EB9EF6CA7 /* bindings */, 93DFD03B24521C19001FCBAF /* Duktape.hpp */, 93DFD03524521C19001FCBAF /* HookEngine.cpp */, 93DFD03324521C19001FCBAF /* HookEngine.h */, @@ -3333,6 +3342,77 @@ path = input; sourceTree = ""; }; + 59B0CA75A27A4C5EB9EF6CA7 /* bindings */ = { + isa = PBXGroup; + children = ( + EDFE9D20A43646C7981E7254 /* entity */, + C1C271EB7D2B4A3AA23CE0E6 /* game */, + 9192A7EACCF44110BF1B89BC /* network */, + CCCD0912DE2D444FA8DA7222 /* object */, + 0B69C59376EB45E58BA6ADF5 /* ride */, + 281760CC5B1249CBA8E771D7 /* world */, + ); + name = bindings; + sourceTree = ""; + }; + EDFE9D20A43646C7981E7254 /* entity */ = { + isa = PBXGroup; + children = ( + 6DF61461D47C40CF92019B24 /* ScEntity.hpp */, + ); + name = entity; + sourceTree = ""; + }; + C1C271EB7D2B4A3AA23CE0E6 /* game */ = { + isa = PBXGroup; + children = ( + 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */, + FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */, + E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */, + DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */, + 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */, + ); + name = game; + sourceTree = ""; + }; + 9192A7EACCF44110BF1B89BC /* network */ = { + isa = PBXGroup; + children = ( + BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */, + D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */, + ); + name = network; + sourceTree = ""; + }; + CCCD0912DE2D444FA8DA7222 /* object */ = { + isa = PBXGroup; + children = ( + 24F9DF02868247738D05CC40 /* ScObject.hpp */, + ); + name = object; + sourceTree = ""; + }; + 0B69C59376EB45E58BA6ADF5 /* ride */ = { + isa = PBXGroup; + children = ( + AD97B712FDF7454CADC7A328 /* ScRide.hpp */, + ); + name = ride; + sourceTree = ""; + }; + 281760CC5B1249CBA8E771D7 /* world */ = { + isa = PBXGroup; + children = ( + 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */, + 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */, + 74CDED6B7EF041458032681A /* ScMap.hpp */, + 9AB8D336AB654D0280549A89 /* ScPark.hpp */, + A9F55F2291284217BA0E4E51 /* ScScenario.hpp */, + 22D7DD798F054A068273739B /* ScTile.hpp */, + ); + name = world; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -3357,7 +3437,6 @@ 66A10F8D257F1E1800DD651A /* GuestSetFlagsAction.h in Headers */, 66A10FA7257F1E1800DD651A /* PeepPickupAction.h in Headers */, 939A359C20C12FC800630B3F /* Paint.Sprite.h in Headers */, - 93DFD05524521C1A001FCBAF /* ScMap.hpp in Headers */, 9308DA04209908090079EE96 /* TileElement.h in Headers */, C67B28152002D67A00109C93 /* Widget.h in Headers */, 66A10F99257F1E1800DD651A /* LargeScenerySetColourAction.h in Headers */, @@ -3370,7 +3449,6 @@ C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */, 66A10F50257F1E1700DD651A /* ParkEntranceRemoveAction.h in Headers */, 66A10F4D257F1E1700DD651A /* StaffSetNameAction.h in Headers */, - 93DFD05124521C1A001FCBAF /* ScContext.hpp in Headers */, 66A10FD6257F1E3000DD651A /* WallRemoveAction.h in Headers */, 939A359F20C12FDE00630B3F /* Paint.Surface.h in Headers */, 66A10F7B257F1E1800DD651A /* MazeSetTrackAction.h in Headers */, @@ -3378,14 +3456,12 @@ 66A10F53257F1E1700DD651A /* LandLowerAction.h in Headers */, 66A10F5E257F1E1700DD651A /* LargeSceneryRemoveAction.h in Headers */, 66A10F5D257F1E1700DD651A /* RideSetStatusAction.h in Headers */, - 93DFD05024521C1A001FCBAF /* ScPark.hpp in Headers */, 93B4DC1625487CDF008D63FF /* Formatting.h in Headers */, 66A10F86257F1E1800DD651A /* LoadOrQuitAction.h in Headers */, 93DFD02E24521BA0001FCBAF /* FileWatcher.h in Headers */, 2ADE2F28224418B2002598AF /* DataSerialiserTag.h in Headers */, 66A10F74257F1E1800DD651A /* RideEntranceExitRemoveAction.h in Headers */, 66A10F9A257F1E1800DD651A /* StaffFireAction.h in Headers */, - 93DFD04C24521C1A001FCBAF /* ScDisposable.hpp in Headers */, 66A10FAC257F1E1800DD651A /* RideSetSettingAction.h in Headers */, 2ADE2F2E224418E7002598AF /* ConversionTables.h in Headers */, 933F2CBB20935668001B33FD /* LocalisationService.h in Headers */, @@ -3399,7 +3475,6 @@ 66A10F77257F1E1800DD651A /* StaffSetOrdersAction.h in Headers */, 2ADE2F2C224418B2002598AF /* FileIndex.hpp in Headers */, 66A10FAF257F1E1800DD651A /* RideSetNameAction.h in Headers */, - 93DFD04A24521C1A001FCBAF /* ScConfiguration.hpp in Headers */, 93CBA4CC20A7504500867D56 /* ImageImporter.h in Headers */, 66A10F62257F1E1700DD651A /* SurfaceSetStyleAction.h in Headers */, 66A10EC1257F1DF800DD651A /* FootpathAdditionRemoveAction.h in Headers */, @@ -3408,11 +3483,9 @@ 66A10F96257F1E1800DD651A /* SignSetStyleAction.h in Headers */, 2ADE2F29224418B2002598AF /* Numerics.hpp in Headers */, 66A10FD5257F1E3000DD651A /* WaterRaiseAction.h in Headers */, - 93DFD04924521C1A001FCBAF /* ScTile.hpp in Headers */, 936F412B24CE030F00E07BCF /* NetworkBase.h in Headers */, 66A10EC2257F1DF800DD651A /* FootpathRemoveAction.h in Headers */, 66A10EA3257F1DE100DD651A /* BalloonPressAction.h in Headers */, - 93DFD04524521C1A001FCBAF /* ScObject.hpp in Headers */, 2ADE2F382244198B002598AF /* SpriteBase.h in Headers */, 66A10EC8257F1DF800DD651A /* BannerPlaceAction.h in Headers */, C62D838B1FD36D6F008C04F1 /* EditorObjectSelectionSession.h in Headers */, @@ -3422,17 +3495,13 @@ 66A10FD7257F1E3000DD651A /* WaterLowerAction.h in Headers */, 939A35A220C12FFD00630B3F /* InteractiveConsole.h in Headers */, 93CBA4C320A7502E00867D56 /* Imaging.h in Headers */, - 93DFD04D24521C1A001FCBAF /* ScEntity.hpp in Headers */, 66A10F4E257F1E1700DD651A /* PauseToggleAction.h in Headers */, 93DFD04E24521C1A001FCBAF /* Duktape.hpp in Headers */, 66A10FA2257F1E1800DD651A /* LargeSceneryPlaceAction.h in Headers */, 2ADE2F3622441960002598AF /* RideTypes.h in Headers */, 66A10F68257F1E1800DD651A /* NetworkModifyGroupAction.h in Headers */, - 93DFD05324521C1A001FCBAF /* ScRide.hpp in Headers */, 66A10F88257F1E1800DD651A /* SignSetNameAction.h in Headers */, 93AE2389252F948A00CD03C3 /* Formatter.h in Headers */, - 93DFD05424521C1A001FCBAF /* ScDate.hpp in Headers */, - 93DFD04F24521C1A001FCBAF /* ScConsole.hpp in Headers */, 66A10F91257F1E1800DD651A /* StaffHireNewAction.h in Headers */, 9308DA05209908090079EE96 /* Surface.h in Headers */, 66A10F9F257F1E1800DD651A /* LandBuyRightsAction.h in Headers */, @@ -3455,7 +3524,6 @@ 66A10F84257F1E1800DD651A /* StaffSetPatrolAreaAction.h in Headers */, 66A10F56257F1E1700DD651A /* SmallSceneryRemoveAction.h in Headers */, 66A10F5C257F1E1700DD651A /* SetParkEntranceFeeAction.h in Headers */, - 93DFD04724521C1A001FCBAF /* ScNetwork.hpp in Headers */, 66A10F8F257F1E1800DD651A /* StaffSetCostumeAction.h in Headers */, 66A10ED5257F1DF800DD651A /* BannerSetStyleAction.h in Headers */, 66A10F97257F1E1800DD651A /* SetCheatAction.h in Headers */, @@ -3472,6 +3540,22 @@ 66A10F8B257F1E1800DD651A /* LandSmoothAction.h in Headers */, F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */, 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */, + 8C801369C7E44292A5348DFB /* ScEntity.hpp in Headers */, + BCCE3EDC711F4F0587F1C359 /* ScCheats.hpp in Headers */, + F396A397541149D6ACA290D2 /* ScConfiguration.hpp in Headers */, + 2EEDD899BAF94706ACED5F6D /* ScConsole.hpp in Headers */, + 74E3377F2FC04316959F1AED /* ScContext.hpp in Headers */, + A10C0EE3C2614B53AFB6ED35 /* ScDisposable.hpp in Headers */, + 05F6EF4AAFEC4BA4A454046B /* ScNetwork.hpp in Headers */, + AC4C9184C93A4113A6BEEC60 /* ScSocket.hpp in Headers */, + A962C2EF5FA6429C92318441 /* ScObject.hpp in Headers */, + E09450B2440E465CBCE62DEB /* ScRide.hpp in Headers */, + A2EC8BBCB8AD49ECB1C22F9D /* ScClimate.hpp in Headers */, + 2AE59B9E2E4D496286970915 /* ScDate.hpp in Headers */, + 7930E9462549403181C5D164 /* ScMap.hpp in Headers */, + 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */, + 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */, + F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 8a82280aee..dd92804284 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -408,23 +408,23 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index e3478a84d9..6536717f78 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -24,21 +24,21 @@ # include "../interface/InteractiveConsole.h" # include "../platform/Platform2.h" # include "Duktape.hpp" -# include "ScCheats.hpp" -# include "ScClimate.hpp" -# include "ScConsole.hpp" -# include "ScContext.hpp" -# include "ScDate.hpp" -# include "ScDisposable.hpp" -# include "ScEntity.hpp" -# include "ScMap.hpp" -# include "ScNetwork.hpp" -# include "ScObject.hpp" -# include "ScPark.hpp" -# include "ScRide.hpp" -# include "ScScenario.hpp" -# include "ScSocket.hpp" -# include "ScTile.hpp" +# include "bindings/entity/ScEntity.hpp" +# include "bindings/game/ScCheats.hpp" +# include "bindings/game/ScConsole.hpp" +# include "bindings/game/ScContext.hpp" +# include "bindings/game/ScDisposable.hpp" +# include "bindings/network/ScNetwork.hpp" +# include "bindings/network/ScSocket.hpp" +# include "bindings/object/ScObject.hpp" +# include "bindings/ride/ScRide.hpp" +# include "bindings/world/ScClimate.hpp" +# include "bindings/world/ScDate.hpp" +# include "bindings/world/ScMap.hpp" +# include "bindings/world/ScPark.hpp" +# include "bindings/world/ScScenario.hpp" +# include "bindings/world/ScTile.hpp" # include # include diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp similarity index 99% rename from src/openrct2/scripting/ScEntity.hpp rename to src/openrct2/scripting/bindings/entity/ScEntity.hpp index a94b74f883..0f840d916a 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -15,12 +15,12 @@ # include "../common.h" # include "../peep/Peep.h" # include "../peep/Staff.h" +# include "../ride/ScRide.hpp" # include "../util/Util.h" # include "../world/EntityList.h" # include "../world/Litter.h" # include "../world/Sprite.h" # include "Duktape.hpp" -# include "ScRide.hpp" # include "ScriptEngine.h" # include diff --git a/src/openrct2/scripting/ScCheats.hpp b/src/openrct2/scripting/bindings/game/ScCheats.hpp similarity index 99% rename from src/openrct2/scripting/ScCheats.hpp rename to src/openrct2/scripting/bindings/game/ScCheats.hpp index fdcb606955..740a13c085 100644 --- a/src/openrct2/scripting/ScCheats.hpp +++ b/src/openrct2/scripting/bindings/game/ScCheats.hpp @@ -11,9 +11,9 @@ #ifdef ENABLE_SCRIPTING -# include "../Cheats.h" +# include "../../../Cheats.h" +# include "../../ScriptEngine.h" # include "Duktape.hpp" -# include "ScriptEngine.h" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScConfiguration.hpp b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp similarity index 97% rename from src/openrct2/scripting/ScConfiguration.hpp rename to src/openrct2/scripting/bindings/game/ScConfiguration.hpp index 69fb3ab8d8..0a63b35065 100644 --- a/src/openrct2/scripting/ScConfiguration.hpp +++ b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp @@ -11,11 +11,11 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../config/Config.h" -# include "../localisation/LocalisationService.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../config/Config.h" +# include "../../../localisation/LocalisationService.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScConsole.hpp b/src/openrct2/scripting/bindings/game/ScConsole.hpp similarity index 93% rename from src/openrct2/scripting/ScConsole.hpp rename to src/openrct2/scripting/bindings/game/ScConsole.hpp index 6d15102512..1ab39af85d 100644 --- a/src/openrct2/scripting/ScConsole.hpp +++ b/src/openrct2/scripting/bindings/game/ScConsole.hpp @@ -11,9 +11,9 @@ #ifdef ENABLE_SCRIPTING -# include "../interface/InteractiveConsole.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../interface/InteractiveConsole.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScContext.hpp b/src/openrct2/scripting/bindings/game/ScContext.hpp similarity index 96% rename from src/openrct2/scripting/ScContext.hpp rename to src/openrct2/scripting/bindings/game/ScContext.hpp index 049e37963e..1005d9299b 100644 --- a/src/openrct2/scripting/ScContext.hpp +++ b/src/openrct2/scripting/bindings/game/ScContext.hpp @@ -11,17 +11,17 @@ #ifdef ENABLE_SCRIPTING -# include "../actions/GameAction.h" -# include "../interface/Screenshot.h" -# include "../localisation/Formatting.h" -# include "../object/ObjectManager.h" -# include "../scenario/Scenario.h" -# include "Duktape.hpp" -# include "HookEngine.h" -# include "ScConfiguration.hpp" -# include "ScDisposable.hpp" -# include "ScObject.hpp" -# include "ScriptEngine.h" +# include "../../../actions/GameAction.h" +# include "../../../interface/Screenshot.h" +# include "../../../localisation/Formatting.h" +# include "../../../object/ObjectManager.h" +# include "../../../scenario/Scenario.h" +# include "../../Duktape.hpp" +# include "../../HookEngine.h" +# include "../../ScriptEngine.h" +# include "../game/ScConfiguration.hpp" +# include "../game/ScDisposable.hpp" +# include "../object/ScObject.hpp" # include # include diff --git a/src/openrct2/scripting/ScDisposable.hpp b/src/openrct2/scripting/bindings/game/ScDisposable.hpp similarity index 97% rename from src/openrct2/scripting/ScDisposable.hpp rename to src/openrct2/scripting/bindings/game/ScDisposable.hpp index c3c11450c9..c3033295b5 100644 --- a/src/openrct2/scripting/ScDisposable.hpp +++ b/src/openrct2/scripting/bindings/game/ScDisposable.hpp @@ -11,7 +11,7 @@ #ifdef ENABLE_SCRIPTING -# include "Duktape.hpp" +# include "../../Duktape.hpp" # include diff --git a/src/openrct2/scripting/ScNetwork.hpp b/src/openrct2/scripting/bindings/network/ScNetwork.hpp similarity index 97% rename from src/openrct2/scripting/ScNetwork.hpp rename to src/openrct2/scripting/bindings/network/ScNetwork.hpp index ae8ddec4b1..3b1cf27184 100644 --- a/src/openrct2/scripting/ScNetwork.hpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.hpp @@ -11,14 +11,14 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../actions/NetworkModifyGroupAction.h" -# include "../actions/PlayerKickAction.h" -# include "../actions/PlayerSetGroupAction.h" -# include "../network/NetworkAction.h" -# include "../network/network.h" -# include "Duktape.hpp" -# include "ScSocket.hpp" +# include "../../../Context.h" +# include "../../../actions/NetworkModifyGroupAction.h" +# include "../../../actions/PlayerKickAction.h" +# include "../../../actions/PlayerSetGroupAction.h" +# include "../../../network/NetworkAction.h" +# include "../../../network/network.h" +# include "../../Duktape.hpp" +# include "../network/ScSocket.hpp" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScSocket.hpp b/src/openrct2/scripting/bindings/network/ScSocket.hpp similarity index 98% rename from src/openrct2/scripting/ScSocket.hpp rename to src/openrct2/scripting/bindings/network/ScSocket.hpp index 804759b66f..add92f5ac1 100644 --- a/src/openrct2/scripting/ScSocket.hpp +++ b/src/openrct2/scripting/bindings/network/ScSocket.hpp @@ -12,11 +12,11 @@ #ifdef ENABLE_SCRIPTING # ifndef DISABLE_NETWORK -# include "../Context.h" -# include "../config/Config.h" -# include "../network/Socket.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../config/Config.h" +# include "../../../network/Socket.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include # include diff --git a/src/openrct2/scripting/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp similarity index 99% rename from src/openrct2/scripting/ScObject.hpp rename to src/openrct2/scripting/bindings/object/ScObject.hpp index dfa3e0c457..a2d1938ae9 100644 --- a/src/openrct2/scripting/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -11,13 +11,13 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../common.h" -# include "../object/ObjectManager.h" -# include "../object/RideObject.h" -# include "../object/SmallSceneryObject.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../object/ObjectManager.h" +# include "../../../object/RideObject.h" +# include "../../../object/SmallSceneryObject.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include diff --git a/src/openrct2/scripting/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp similarity index 99% rename from src/openrct2/scripting/ScRide.hpp rename to src/openrct2/scripting/bindings/ride/ScRide.hpp index 96043482da..aefa164cd6 100644 --- a/src/openrct2/scripting/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -11,12 +11,12 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../common.h" -# include "../ride/Ride.h" -# include "Duktape.hpp" -# include "ScObject.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "../object/ScObject.hpp" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScClimate.hpp b/src/openrct2/scripting/bindings/world/ScClimate.hpp similarity index 94% rename from src/openrct2/scripting/ScClimate.hpp rename to src/openrct2/scripting/bindings/world/ScClimate.hpp index 779d22ada2..272c24ae45 100644 --- a/src/openrct2/scripting/ScClimate.hpp +++ b/src/openrct2/scripting/bindings/world/ScClimate.hpp @@ -11,12 +11,12 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../common.h" -# include "../core/String.hpp" -# include "../world/Climate.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../core/String.hpp" +# include "../../../world/Climate.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScDate.hpp b/src/openrct2/scripting/bindings/world/ScDate.hpp similarity index 90% rename from src/openrct2/scripting/ScDate.hpp rename to src/openrct2/scripting/bindings/world/ScDate.hpp index 227ec5ad75..a2a08e7012 100644 --- a/src/openrct2/scripting/ScDate.hpp +++ b/src/openrct2/scripting/bindings/world/ScDate.hpp @@ -11,14 +11,14 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../Date.h" -# include "../Game.h" -# include "../GameState.h" -# include "../common.h" -# include "../localisation/Date.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../Date.h" +# include "../../../Game.h" +# include "../../../GameState.h" +# include "../../../common.h" +# include "../../../localisation/Date.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/bindings/world/ScMap.hpp similarity index 94% rename from src/openrct2/scripting/ScMap.hpp rename to src/openrct2/scripting/bindings/world/ScMap.hpp index 10c3e10242..e7be5ad335 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/bindings/world/ScMap.hpp @@ -11,21 +11,21 @@ #ifdef ENABLE_SCRIPTING -# include "../common.h" -# include "../ride/Ride.h" -# include "../ride/TrainManager.h" -# include "../world/Balloon.h" -# include "../world/Duck.h" -# include "../world/EntityList.h" -# include "../world/Fountain.h" -# include "../world/Litter.h" -# include "../world/Map.h" -# include "../world/MoneyEffect.h" -# include "../world/Particle.h" -# include "Duktape.hpp" -# include "ScEntity.hpp" -# include "ScRide.hpp" -# include "ScTile.hpp" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../../ride/TrainManager.h" +# include "../../../world/Balloon.h" +# include "../../../world/Duck.h" +# include "../../../world/EntityList.h" +# include "../../../world/Fountain.h" +# include "../../../world/Litter.h" +# include "../../../world/Map.h" +# include "../../../world/MoneyEffect.h" +# include "../../../world/Particle.h" +# include "../../Duktape.hpp" +# include "../entity/ScEntity.hpp" +# include "../ride/ScRide.hpp" +# include "../world/ScTile.hpp" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/ScPark.hpp b/src/openrct2/scripting/bindings/world/ScPark.hpp similarity index 97% rename from src/openrct2/scripting/ScPark.hpp rename to src/openrct2/scripting/bindings/world/ScPark.hpp index ec6269f4d7..58bdda0299 100644 --- a/src/openrct2/scripting/ScPark.hpp +++ b/src/openrct2/scripting/bindings/world/ScPark.hpp @@ -11,17 +11,17 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../GameState.h" -# include "../common.h" -# include "../core/String.hpp" -# include "../management/Finance.h" -# include "../management/NewsItem.h" -# include "../peep/Peep.h" -# include "../windows/Intent.h" -# include "../world/Park.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../GameState.h" +# include "../../../common.h" +# include "../../../core/String.hpp" +# include "../../../management/Finance.h" +# include "../../../management/NewsItem.h" +# include "../../../peep/Peep.h" +# include "../../../windows/Intent.h" +# include "../../../world/Park.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include diff --git a/src/openrct2/scripting/ScScenario.hpp b/src/openrct2/scripting/bindings/world/ScScenario.hpp similarity index 97% rename from src/openrct2/scripting/ScScenario.hpp rename to src/openrct2/scripting/bindings/world/ScScenario.hpp index 4d47ea3403..944f7a47b9 100644 --- a/src/openrct2/scripting/ScScenario.hpp +++ b/src/openrct2/scripting/bindings/world/ScScenario.hpp @@ -11,14 +11,14 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../GameState.h" -# include "../common.h" -# include "../core/String.hpp" -# include "../scenario/Scenario.h" -# include "../world/Park.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../GameState.h" +# include "../../../common.h" +# include "../../../core/String.hpp" +# include "../../../scenario/Scenario.h" +# include "../../../world/Park.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include diff --git a/src/openrct2/scripting/ScTile.hpp b/src/openrct2/scripting/bindings/world/ScTile.hpp similarity index 99% rename from src/openrct2/scripting/ScTile.hpp rename to src/openrct2/scripting/bindings/world/ScTile.hpp index e4dad4855b..182b20f9ef 100644 --- a/src/openrct2/scripting/ScTile.hpp +++ b/src/openrct2/scripting/bindings/world/ScTile.hpp @@ -11,16 +11,16 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../common.h" -# include "../core/Guard.hpp" -# include "../ride/Track.h" -# include "../world/Footpath.h" -# include "../world/Scenery.h" -# include "../world/Sprite.h" -# include "../world/Surface.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../core/Guard.hpp" +# include "../../../ride/Track.h" +# include "../../../world/Footpath.h" +# include "../../../world/Scenery.h" +# include "../../../world/Sprite.h" +# include "../../../world/Surface.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include # include From 244025ec17e5dd16fe110621a887303dc32c5e9f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 19:46:29 +0300 Subject: [PATCH 136/681] Fix includes --- .../scripting/bindings/entity/ScEntity.hpp | 470 +----------------- 1 file changed, 10 insertions(+), 460 deletions(-) diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 0f840d916a..43e92ee8fc 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -11,17 +11,17 @@ #ifdef ENABLE_SCRIPTING -# include "../Context.h" -# include "../common.h" -# include "../peep/Peep.h" -# include "../peep/Staff.h" +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../peep/Peep.h" +# include "../../../peep/Staff.h" +# include "../../../util/Util.h" +# include "../../../world/EntityList.h" +# include "../../../world/Litter.h" +# include "../../../world/Sprite.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" # include "../ride/ScRide.hpp" -# include "../util/Util.h" -# include "../world/EntityList.h" -# include "../world/Litter.h" -# include "../world/Sprite.h" -# include "Duktape.hpp" -# include "ScriptEngine.h" # include # include @@ -210,456 +210,6 @@ namespace OpenRCT2::Scripting } }; - static const DukEnumMap VehicleStatusMap({ - { "moving_to_end_of_station", Vehicle::Status::MovingToEndOfStation }, - { "waiting_for_passengers", Vehicle::Status::WaitingForPassengers }, - { "waiting_to_depart", Vehicle::Status::WaitingToDepart }, - { "departing", Vehicle::Status::Departing }, - { "travelling", Vehicle::Status::Travelling }, - { "arriving", Vehicle::Status::Arriving }, - { "unloading_passengers", Vehicle::Status::UnloadingPassengers }, - { "travelling_boat", Vehicle::Status::TravellingBoat }, - { "crashing", Vehicle::Status::Crashing }, - { "crashed", Vehicle::Status::Crashed }, - { "travelling_dodgems", Vehicle::Status::TravellingDodgems }, - { "swinging", Vehicle::Status::Swinging }, - { "rotating", Vehicle::Status::Rotating }, - { "ferris_wheel_rotating", Vehicle::Status::FerrisWheelRotating }, - { "simulator_operating", Vehicle::Status::SimulatorOperating }, - { "showing_film", Vehicle::Status::ShowingFilm }, - { "space_rings_operating", Vehicle::Status::SpaceRingsOperating }, - { "top_spin_operating", Vehicle::Status::TopSpinOperating }, - { "haunted_house_operating", Vehicle::Status::HauntedHouseOperating }, - { "doing_circus_show", Vehicle::Status::DoingCircusShow }, - { "crooked_house_operating", Vehicle::Status::CrookedHouseOperating }, - { "waiting_for_cable_lift", Vehicle::Status::WaitingForCableLift }, - { "travelling_cable_lift", Vehicle::Status::TravellingCableLift }, - { "stopping", Vehicle::Status::Stopping }, - { "waiting_for_passengers_17", Vehicle::Status::WaitingForPassengers17 }, - { "waiting_to_start", Vehicle::Status::WaitingToStart }, - { "starting", Vehicle::Status::Starting }, - { "operating_1a", Vehicle::Status::Operating1A }, - { "stopping_1b", Vehicle::Status::Stopping1B }, - { "unloading_passengers_1c", Vehicle::Status::UnloadingPassengers1C }, - { "stopped_by_block_brake", Vehicle::Status::StoppedByBlockBrakes }, - }); - - class ScVehicle : public ScEntity - { - public: - ScVehicle(uint16_t id) - : ScEntity(id) - { - } - - static void Register(duk_context* ctx) - { - dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScVehicle::ride_get, &ScVehicle::ride_set, "ride"); - dukglue_register_property(ctx, &ScVehicle::rideObject_get, &ScVehicle::rideObject_set, "rideObject"); - dukglue_register_property(ctx, &ScVehicle::vehicleObject_get, &ScVehicle::vehicleObject_set, "vehicleObject"); - dukglue_register_property(ctx, &ScVehicle::spriteType_get, &ScVehicle::spriteType_set, "spriteType"); - dukglue_register_property(ctx, &ScVehicle::numSeats_get, &ScVehicle::numSeats_set, "numSeats"); - dukglue_register_property(ctx, &ScVehicle::nextCarOnTrain_get, &ScVehicle::nextCarOnTrain_set, "nextCarOnTrain"); - dukglue_register_property( - ctx, &ScVehicle::previousCarOnRide_get, &ScVehicle::previousCarOnRide_set, "previousCarOnRide"); - dukglue_register_property(ctx, &ScVehicle::nextCarOnRide_get, &ScVehicle::nextCarOnRide_set, "nextCarOnRide"); - dukglue_register_property(ctx, &ScVehicle::currentStation_get, &ScVehicle::currentStation_set, "currentStation"); - dukglue_register_property(ctx, &ScVehicle::mass_get, &ScVehicle::mass_set, "mass"); - dukglue_register_property(ctx, &ScVehicle::acceleration_get, &ScVehicle::acceleration_set, "acceleration"); - dukglue_register_property(ctx, &ScVehicle::velocity_get, &ScVehicle::velocity_set, "velocity"); - dukglue_register_property(ctx, &ScVehicle::bankRotation_get, &ScVehicle::bankRotation_set, "bankRotation"); - dukglue_register_property(ctx, &ScVehicle::colours_get, &ScVehicle::colours_set, "colours"); - dukglue_register_property(ctx, &ScVehicle::trackLocation_get, &ScVehicle::trackLocation_set, "trackLocation"); - dukglue_register_property(ctx, &ScVehicle::trackProgress_get, nullptr, "trackProgress"); - dukglue_register_property(ctx, &ScVehicle::remainingDistance_get, nullptr, "remainingDistance"); - dukglue_register_property( - ctx, &ScVehicle::poweredAcceleration_get, &ScVehicle::poweredAcceleration_set, "poweredAcceleration"); - dukglue_register_property(ctx, &ScVehicle::poweredMaxSpeed_get, &ScVehicle::poweredMaxSpeed_set, "poweredMaxSpeed"); - dukglue_register_property(ctx, &ScVehicle::status_get, &ScVehicle::status_set, "status"); - dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "peeps"); - dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "guests"); - dukglue_register_property(ctx, &ScVehicle::gForces_get, nullptr, "gForces"); - dukglue_register_method(ctx, &ScVehicle::travelBy, "travelBy"); - } - - private: - Vehicle* GetVehicle() const - { - return ::GetEntity(_id); - } - - uint8_t rideObject_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->ride_subtype : 0; - } - void rideObject_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->ride_subtype = value; - } - } - - uint8_t vehicleObject_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->vehicle_type : 0; - } - void vehicleObject_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->vehicle_type = value; - } - } - - uint8_t spriteType_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->Pitch : 0; - } - void spriteType_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->Pitch = value; - } - } - - ride_id_t ride_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->ride : 0; - } - void ride_set(ride_id_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->ride = value; - } - } - - uint8_t numSeats_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->num_seats & VEHICLE_SEAT_NUM_MASK : 0; - } - void numSeats_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->num_seats &= ~VEHICLE_SEAT_NUM_MASK; - vehicle->num_seats |= value & VEHICLE_SEAT_NUM_MASK; - } - } - - DukValue nextCarOnTrain_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) - { - return ToDuk(ctx, vehicle->next_vehicle_on_train); - } - } - return ToDuk(ctx, nullptr); - } - void nextCarOnTrain_set(DukValue value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - if (value.type() == DukValue::Type::NUMBER) - { - vehicle->next_vehicle_on_train = static_cast(value.as_int()); - } - else - { - vehicle->next_vehicle_on_train = SPRITE_INDEX_NULL; - } - } - } - - uint16_t previousCarOnRide_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->prev_vehicle_on_ride : 0; - } - void previousCarOnRide_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->prev_vehicle_on_ride = value; - } - } - - uint16_t nextCarOnRide_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->next_vehicle_on_ride : 0; - } - void nextCarOnRide_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->next_vehicle_on_ride = value; - } - } - - StationIndex currentStation_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->current_station : 0; - } - void currentStation_set(StationIndex value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->current_station = value; - } - } - - uint16_t mass_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->mass : 0; - } - void mass_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->mass = value; - } - } - - int32_t acceleration_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->acceleration : 0; - } - void acceleration_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->acceleration = value; - } - } - - int32_t velocity_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->velocity : 0; - } - void velocity_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->velocity = value; - } - } - - uint8_t bankRotation_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->bank_rotation : 0; - } - void bankRotation_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->bank_rotation = value; - } - } - - DukValue colours_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - VehicleColour colours; - colours.Body = vehicle->colours.body_colour; - colours.Trim = vehicle->colours.trim_colour; - colours.Ternary = vehicle->colours_extended; - return ToDuk(ctx, colours); - } - return ToDuk(ctx, nullptr); - } - void colours_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - auto colours = FromDuk(value); - vehicle->colours.body_colour = colours.Body; - vehicle->colours.trim_colour = colours.Trim; - vehicle->colours_extended = colours.Ternary; - } - } - - DukValue trackLocation_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - auto coords = CoordsXYZD(vehicle->TrackLocation, vehicle->GetTrackDirection()); - return ToDuk(ctx, coords); - } - return ToDuk(ctx, nullptr); - } - void trackLocation_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - auto coords = FromDuk(value); - vehicle->TrackLocation = CoordsXYZ(coords.x, coords.y, coords.z); - vehicle->SetTrackDirection(coords.direction); - } - } - - uint16_t trackProgress_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->track_progress : 0; - } - - int32_t remainingDistance_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->remaining_distance : 0; - } - - uint8_t poweredAcceleration_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->powered_acceleration : 0; - } - void poweredAcceleration_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->powered_acceleration = value; - } - } - - uint8_t poweredMaxSpeed_get() const - { - auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->speed : 0; - } - void poweredMaxSpeed_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->speed = value; - } - } - - std::string status_get() const - { - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - return std::string(VehicleStatusMap[vehicle->status]); - } - return {}; - } - void status_set(const std::string& value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->status = VehicleStatusMap[value]; - } - } - - std::vector guests_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - std::vector result; - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - size_t len = 0; - for (size_t i = 0; i < std::size(vehicle->peep); i++) - { - auto peep = vehicle->peep[i]; - if (peep == SPRITE_INDEX_NULL) - { - result.push_back(ToDuk(ctx, nullptr)); - } - else - { - result.push_back(ToDuk(ctx, peep)); - len = i + 1; - } - } - result.resize(len); - } - return result; - } - - DukValue gForces_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - GForces gForces = vehicle->GetGForces(); - return ToDuk(ctx, gForces); - } - return ToDuk(ctx, nullptr); - } - - void travelBy(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto vehicle = GetVehicle(); - if (vehicle != nullptr) - { - vehicle->MoveRelativeDistance(value); - } - } - }; - static const DukEnumMap PeepFlagMap({ { "leavingPark", PEEP_FLAGS_LEAVING_PARK }, { "slowWalk", PEEP_FLAGS_SLOW_WALK }, From 82451b031a45ef8bd0be6092c2a7f21a27ea4f59 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 19:46:52 +0300 Subject: [PATCH 137/681] Fix declaration --- src/openrct2/scripting/bindings/ride/ScRide.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/scripting/bindings/ride/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp index aefa164cd6..fdab16479c 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -29,7 +29,7 @@ namespace OpenRCT2::Scripting return obj.Take(); } - template<> TrackColour FromDuk(const DukValue& s) + template<> inline TrackColour FromDuk(const DukValue& s) { TrackColour result{}; result.main = AsOrDefault(s["main"], 0); @@ -47,7 +47,7 @@ namespace OpenRCT2::Scripting return obj.Take(); } - template<> VehicleColour FromDuk(const DukValue& s) + template<> inline VehicleColour FromDuk(const DukValue& s) { VehicleColour result{}; result.Body = AsOrDefault(s["body"], 0); From 33e2878d2dfec42bdec9e11a05606a572504424b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 19:47:14 +0300 Subject: [PATCH 138/681] Move ScVehicle into its own files --- OpenRCT2.xcodeproj/project.pbxproj | 32 +- src/openrct2/libopenrct2.vcxproj | 2 + .../scripting/bindings/entity/ScVehicle.cpp | 463 ++++++++++++++++++ .../scripting/bindings/entity/ScVehicle.hpp | 96 ++++ .../scripting/bindings/world/ScMap.hpp | 1 + 5 files changed, 582 insertions(+), 12 deletions(-) create mode 100644 src/openrct2/scripting/bindings/entity/ScVehicle.cpp create mode 100644 src/openrct2/scripting/bindings/entity/ScVehicle.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 796d07d86a..fe40905938 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -772,6 +772,8 @@ 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 9AB8D336AB654D0280549A89 /* ScPark.hpp */; }; 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A9F55F2291284217BA0E4E51 /* ScScenario.hpp */; }; F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 22D7DD798F054A068273739B /* ScTile.hpp */; }; + 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */; }; + D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1846,6 +1848,8 @@ 9AB8D336AB654D0280549A89 /* ScPark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPark.hpp; path = src/openrct2/scripting/bindings/world/ScPark.hpp; sourceTree = SOURCE_ROOT; }; A9F55F2291284217BA0E4E51 /* ScScenario.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScScenario.hpp; path = src/openrct2/scripting/bindings/world/ScScenario.hpp; sourceTree = SOURCE_ROOT; }; 22D7DD798F054A068273739B /* ScTile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTile.hpp; path = src/openrct2/scripting/bindings/world/ScTile.hpp; sourceTree = SOURCE_ROOT; }; + B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScVehicle.cpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.cpp; sourceTree = SOURCE_ROOT; }; + 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScVehicle.hpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1977,20 +1981,20 @@ 93DFD03324521C19001FCBAF /* HookEngine.h */, 93DFD03F24521C19001FCBAF /* Plugin.cpp */, 93DFD03124521C19001FCBAF /* Plugin.h */, - 93DFD03724521C19001FCBAF /* ScConfiguration.hpp */, - 93DFD03C24521C19001FCBAF /* ScConsole.hpp */, - 93DFD03E24521C19001FCBAF /* ScContext.hpp */, - 93DFD04124521C19001FCBAF /* ScDate.hpp */, - 93DFD03924521C19001FCBAF /* ScDisposable.hpp */, - 93DFD03A24521C19001FCBAF /* ScEntity.hpp */, - 93DFD04224521C19001FCBAF /* ScMap.hpp */, - 93DFD03424521C19001FCBAF /* ScNetwork.hpp */, - 93DFD03224521C19001FCBAF /* ScObject.hpp */, - 93DFD03D24521C19001FCBAF /* ScPark.hpp */, - 93DFD04024521C19001FCBAF /* ScRide.hpp */, + 93DFD03724521C19001FCBAF, + 93DFD03C24521C19001FCBAF, + 93DFD03E24521C19001FCBAF, + 93DFD04124521C19001FCBAF, + 93DFD03924521C19001FCBAF, + 93DFD03A24521C19001FCBAF, + 93DFD04224521C19001FCBAF, + 93DFD03424521C19001FCBAF, + 93DFD03224521C19001FCBAF, + 93DFD03D24521C19001FCBAF, + 93DFD04024521C19001FCBAF, 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */, 93DFD04324521C19001FCBAF /* ScriptEngine.h */, - 93DFD03624521C19001FCBAF /* ScTile.hpp */, + 93DFD03624521C19001FCBAF, ); path = scripting; sourceTree = ""; @@ -3359,6 +3363,8 @@ isa = PBXGroup; children = ( 6DF61461D47C40CF92019B24 /* ScEntity.hpp */, + B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */, + 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */, ); name = entity; sourceTree = ""; @@ -3556,6 +3562,7 @@ 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */, 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */, F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */, + D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4361,6 +4368,7 @@ E73A781EBC3C440A99D59821 /* EntityTweener.cpp in Sources */, 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */, B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */, + 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index dd92804284..1d9e6af0da 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -405,6 +405,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp new file mode 100644 index 0000000000..8012d5b582 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -0,0 +1,463 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "ScVehicle.hpp" + +#ifdef ENABLE_SCRIPTING + +namespace OpenRCT2::Scripting +{ + static const DukEnumMap VehicleStatusMap({ + { "moving_to_end_of_station", Vehicle::Status::MovingToEndOfStation }, + { "waiting_for_passengers", Vehicle::Status::WaitingForPassengers }, + { "waiting_to_depart", Vehicle::Status::WaitingToDepart }, + { "departing", Vehicle::Status::Departing }, + { "travelling", Vehicle::Status::Travelling }, + { "arriving", Vehicle::Status::Arriving }, + { "unloading_passengers", Vehicle::Status::UnloadingPassengers }, + { "travelling_boat", Vehicle::Status::TravellingBoat }, + { "crashing", Vehicle::Status::Crashing }, + { "crashed", Vehicle::Status::Crashed }, + { "travelling_dodgems", Vehicle::Status::TravellingDodgems }, + { "swinging", Vehicle::Status::Swinging }, + { "rotating", Vehicle::Status::Rotating }, + { "ferris_wheel_rotating", Vehicle::Status::FerrisWheelRotating }, + { "simulator_operating", Vehicle::Status::SimulatorOperating }, + { "showing_film", Vehicle::Status::ShowingFilm }, + { "space_rings_operating", Vehicle::Status::SpaceRingsOperating }, + { "top_spin_operating", Vehicle::Status::TopSpinOperating }, + { "haunted_house_operating", Vehicle::Status::HauntedHouseOperating }, + { "doing_circus_show", Vehicle::Status::DoingCircusShow }, + { "crooked_house_operating", Vehicle::Status::CrookedHouseOperating }, + { "waiting_for_cable_lift", Vehicle::Status::WaitingForCableLift }, + { "travelling_cable_lift", Vehicle::Status::TravellingCableLift }, + { "stopping", Vehicle::Status::Stopping }, + { "waiting_for_passengers_17", Vehicle::Status::WaitingForPassengers17 }, + { "waiting_to_start", Vehicle::Status::WaitingToStart }, + { "starting", Vehicle::Status::Starting }, + { "operating_1a", Vehicle::Status::Operating1A }, + { "stopping_1b", Vehicle::Status::Stopping1B }, + { "unloading_passengers_1c", Vehicle::Status::UnloadingPassengers1C }, + { "stopped_by_block_brake", Vehicle::Status::StoppedByBlockBrakes }, + }); + + ScVehicle::ScVehicle(uint16_t id) + : ScEntity(id) + { + } + + void ScVehicle::Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScVehicle::ride_get, &ScVehicle::ride_set, "ride"); + dukglue_register_property(ctx, &ScVehicle::rideObject_get, &ScVehicle::rideObject_set, "rideObject"); + dukglue_register_property(ctx, &ScVehicle::vehicleObject_get, &ScVehicle::vehicleObject_set, "vehicleObject"); + dukglue_register_property(ctx, &ScVehicle::spriteType_get, &ScVehicle::spriteType_set, "spriteType"); + dukglue_register_property(ctx, &ScVehicle::numSeats_get, &ScVehicle::numSeats_set, "numSeats"); + dukglue_register_property(ctx, &ScVehicle::nextCarOnTrain_get, &ScVehicle::nextCarOnTrain_set, "nextCarOnTrain"); + dukglue_register_property( + ctx, &ScVehicle::previousCarOnRide_get, &ScVehicle::previousCarOnRide_set, "previousCarOnRide"); + dukglue_register_property(ctx, &ScVehicle::nextCarOnRide_get, &ScVehicle::nextCarOnRide_set, "nextCarOnRide"); + dukglue_register_property(ctx, &ScVehicle::currentStation_get, &ScVehicle::currentStation_set, "currentStation"); + dukglue_register_property(ctx, &ScVehicle::mass_get, &ScVehicle::mass_set, "mass"); + dukglue_register_property(ctx, &ScVehicle::acceleration_get, &ScVehicle::acceleration_set, "acceleration"); + dukglue_register_property(ctx, &ScVehicle::velocity_get, &ScVehicle::velocity_set, "velocity"); + dukglue_register_property(ctx, &ScVehicle::bankRotation_get, &ScVehicle::bankRotation_set, "bankRotation"); + dukglue_register_property(ctx, &ScVehicle::colours_get, &ScVehicle::colours_set, "colours"); + dukglue_register_property(ctx, &ScVehicle::trackLocation_get, &ScVehicle::trackLocation_set, "trackLocation"); + dukglue_register_property(ctx, &ScVehicle::trackProgress_get, nullptr, "trackProgress"); + dukglue_register_property(ctx, &ScVehicle::remainingDistance_get, nullptr, "remainingDistance"); + dukglue_register_property( + ctx, &ScVehicle::poweredAcceleration_get, &ScVehicle::poweredAcceleration_set, "poweredAcceleration"); + dukglue_register_property(ctx, &ScVehicle::poweredMaxSpeed_get, &ScVehicle::poweredMaxSpeed_set, "poweredMaxSpeed"); + dukglue_register_property(ctx, &ScVehicle::status_get, &ScVehicle::status_set, "status"); + dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "peeps"); + dukglue_register_property(ctx, &ScVehicle::guests_get, nullptr, "guests"); + dukglue_register_property(ctx, &ScVehicle::gForces_get, nullptr, "gForces"); + dukglue_register_method(ctx, &ScVehicle::travelBy, "travelBy"); + } + + Vehicle* ScVehicle::GetVehicle() const + { + return ::GetEntity(_id); + } + + uint8_t ScVehicle::rideObject_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->ride_subtype : 0; + } + void ScVehicle::rideObject_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->ride_subtype = value; + } + } + + uint8_t ScVehicle::vehicleObject_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->vehicle_type : 0; + } + void ScVehicle::vehicleObject_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->vehicle_type = value; + } + } + + uint8_t ScVehicle::spriteType_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->Pitch : 0; + } + void ScVehicle::spriteType_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->Pitch = value; + } + } + + ride_id_t ScVehicle::ride_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->ride : 0; + } + void ScVehicle::ride_set(ride_id_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->ride = value; + } + } + + uint8_t ScVehicle::numSeats_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->num_seats & VEHICLE_SEAT_NUM_MASK : 0; + } + void ScVehicle::numSeats_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->num_seats &= ~VEHICLE_SEAT_NUM_MASK; + vehicle->num_seats |= value & VEHICLE_SEAT_NUM_MASK; + } + } + + DukValue ScVehicle::nextCarOnTrain_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) + { + return ToDuk(ctx, vehicle->next_vehicle_on_train); + } + } + return ToDuk(ctx, nullptr); + } + void ScVehicle::nextCarOnTrain_set(DukValue value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + if (value.type() == DukValue::Type::NUMBER) + { + vehicle->next_vehicle_on_train = static_cast(value.as_int()); + } + else + { + vehicle->next_vehicle_on_train = SPRITE_INDEX_NULL; + } + } + } + + uint16_t ScVehicle::previousCarOnRide_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->prev_vehicle_on_ride : 0; + } + void ScVehicle::previousCarOnRide_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->prev_vehicle_on_ride = value; + } + } + + uint16_t ScVehicle::nextCarOnRide_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->next_vehicle_on_ride : 0; + } + void ScVehicle::nextCarOnRide_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->next_vehicle_on_ride = value; + } + } + + StationIndex ScVehicle::currentStation_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->current_station : 0; + } + void ScVehicle::currentStation_set(StationIndex value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->current_station = value; + } + } + + uint16_t ScVehicle::mass_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->mass : 0; + } + void ScVehicle::mass_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->mass = value; + } + } + + int32_t ScVehicle::acceleration_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->acceleration : 0; + } + void ScVehicle::acceleration_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->acceleration = value; + } + } + + int32_t ScVehicle::velocity_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->velocity : 0; + } + void ScVehicle::velocity_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->velocity = value; + } + } + + uint8_t ScVehicle::bankRotation_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->bank_rotation : 0; + } + void ScVehicle::bankRotation_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->bank_rotation = value; + } + } + + DukValue ScVehicle::colours_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + VehicleColour colours; + colours.Body = vehicle->colours.body_colour; + colours.Trim = vehicle->colours.trim_colour; + colours.Ternary = vehicle->colours_extended; + return ToDuk(ctx, colours); + } + return ToDuk(ctx, nullptr); + } + void ScVehicle::colours_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + auto colours = FromDuk(value); + vehicle->colours.body_colour = colours.Body; + vehicle->colours.trim_colour = colours.Trim; + vehicle->colours_extended = colours.Ternary; + } + } + + DukValue ScVehicle::trackLocation_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + auto coords = CoordsXYZD(vehicle->TrackLocation, vehicle->GetTrackDirection()); + return ToDuk(ctx, coords); + } + return ToDuk(ctx, nullptr); + } + void ScVehicle::trackLocation_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + auto coords = FromDuk(value); + vehicle->TrackLocation = CoordsXYZ(coords.x, coords.y, coords.z); + vehicle->SetTrackDirection(coords.direction); + } + } + + uint16_t ScVehicle::trackProgress_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->track_progress : 0; + } + + int32_t ScVehicle::remainingDistance_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->remaining_distance : 0; + } + + uint8_t ScVehicle::poweredAcceleration_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->powered_acceleration : 0; + } + void ScVehicle::poweredAcceleration_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->powered_acceleration = value; + } + } + + uint8_t ScVehicle::poweredMaxSpeed_get() const + { + auto vehicle = GetVehicle(); + return vehicle != nullptr ? vehicle->speed : 0; + } + void ScVehicle::poweredMaxSpeed_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->speed = value; + } + } + + std::string ScVehicle::status_get() const + { + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + return std::string(VehicleStatusMap[vehicle->status]); + } + return {}; + } + void ScVehicle::status_set(const std::string& value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->status = VehicleStatusMap[value]; + } + } + + std::vector ScVehicle::guests_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + std::vector result; + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + size_t len = 0; + for (size_t i = 0; i < std::size(vehicle->peep); i++) + { + auto peep = vehicle->peep[i]; + if (peep == SPRITE_INDEX_NULL) + { + result.push_back(ToDuk(ctx, nullptr)); + } + else + { + result.push_back(ToDuk(ctx, peep)); + len = i + 1; + } + } + result.resize(len); + } + return result; + } + + DukValue ScVehicle::gForces_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + GForces gForces = vehicle->GetGForces(); + return ToDuk(ctx, gForces); + } + return ToDuk(ctx, nullptr); + } + + void ScVehicle::travelBy(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto vehicle = GetVehicle(); + if (vehicle != nullptr) + { + vehicle->MoveRelativeDistance(value); + } + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.hpp b/src/openrct2/scripting/bindings/entity/ScVehicle.hpp new file mode 100644 index 0000000000..57d29c6194 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.hpp @@ -0,0 +1,96 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../../ride/Ride.h" +# include "ScEntity.hpp" + +namespace OpenRCT2::Scripting +{ + class ScVehicle : public ScEntity + { + public: + ScVehicle(uint16_t id); + + static void Register(duk_context* ctx); + + private: + Vehicle* GetVehicle() const; + + uint8_t rideObject_get() const; + void rideObject_set(uint8_t value); + + uint8_t vehicleObject_get() const; + void vehicleObject_set(uint8_t value); + + uint8_t spriteType_get() const; + void spriteType_set(uint8_t value); + + ride_id_t ride_get() const; + void ride_set(ride_id_t value); + + uint8_t numSeats_get() const; + void numSeats_set(uint8_t value); + + DukValue nextCarOnTrain_get() const; + void nextCarOnTrain_set(DukValue value); + + uint16_t previousCarOnRide_get() const; + void previousCarOnRide_set(uint16_t value); + + uint16_t nextCarOnRide_get() const; + void nextCarOnRide_set(uint16_t value); + + StationIndex currentStation_get() const; + void currentStation_set(StationIndex value); + + uint16_t mass_get() const; + void mass_set(uint16_t value); + + int32_t acceleration_get() const; + void acceleration_set(int32_t value); + + int32_t velocity_get() const; + void velocity_set(int32_t value); + + uint8_t bankRotation_get() const; + void bankRotation_set(uint8_t value); + + DukValue colours_get() const; + void colours_set(const DukValue& value); + + DukValue trackLocation_get() const; + void trackLocation_set(const DukValue& value); + + uint16_t trackProgress_get() const; + + int32_t remainingDistance_get() const; + + uint8_t poweredAcceleration_get() const; + void poweredAcceleration_set(uint8_t value); + + uint8_t poweredMaxSpeed_get() const; + void poweredMaxSpeed_set(uint8_t value); + + std::string status_get() const; + void status_set(const std::string& value); + + std::vector guests_get() const; + + DukValue gForces_get() const; + + void travelBy(int32_t value); + }; + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScMap.hpp b/src/openrct2/scripting/bindings/world/ScMap.hpp index e7be5ad335..461ec53c56 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.hpp +++ b/src/openrct2/scripting/bindings/world/ScMap.hpp @@ -24,6 +24,7 @@ # include "../../../world/Particle.h" # include "../../Duktape.hpp" # include "../entity/ScEntity.hpp" +# include "../entity/ScVehicle.hpp" # include "../ride/ScRide.hpp" # include "../world/ScTile.hpp" From 2e951877cb063498152e9e2eb5eb3be91f1bf0ca Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 19:56:11 +0300 Subject: [PATCH 139/681] Move ScPeep ScGuest and ScStaff to their own files --- OpenRCT2.xcodeproj/project.pbxproj | 20 + src/openrct2/libopenrct2.vcxproj | 5 + src/openrct2/scripting/ScriptEngine.cpp | 3 + .../scripting/bindings/entity/ScEntity.hpp | 615 ------------------ .../scripting/bindings/entity/ScGuest.cpp | 342 ++++++++++ .../scripting/bindings/entity/ScGuest.hpp | 89 +++ .../scripting/bindings/entity/ScPeep.hpp | 180 +++++ .../scripting/bindings/entity/ScStaff.cpp | 141 ++++ .../scripting/bindings/entity/ScStaff.hpp | 43 ++ 9 files changed, 823 insertions(+), 615 deletions(-) create mode 100644 src/openrct2/scripting/bindings/entity/ScGuest.cpp create mode 100644 src/openrct2/scripting/bindings/entity/ScGuest.hpp create mode 100644 src/openrct2/scripting/bindings/entity/ScPeep.hpp create mode 100644 src/openrct2/scripting/bindings/entity/ScStaff.cpp create mode 100644 src/openrct2/scripting/bindings/entity/ScStaff.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index fe40905938..8550bdd4c8 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -774,6 +774,11 @@ F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 22D7DD798F054A068273739B /* ScTile.hpp */; }; 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */; }; D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */; }; + BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */; }; + 428B1DADD66C4829894AD0A1 /* ScGuest.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */; }; + D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */; }; + 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */; }; + 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30AB6C640464647ABE90EC4 /* ScStaff.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1850,6 +1855,11 @@ 22D7DD798F054A068273739B /* ScTile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTile.hpp; path = src/openrct2/scripting/bindings/world/ScTile.hpp; sourceTree = SOURCE_ROOT; }; B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScVehicle.cpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.cpp; sourceTree = SOURCE_ROOT; }; 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScVehicle.hpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.hpp; sourceTree = SOURCE_ROOT; }; + 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScGuest.cpp; path = src/openrct2/scripting/bindings/entity/ScGuest.cpp; sourceTree = SOURCE_ROOT; }; + CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScGuest.hpp; path = src/openrct2/scripting/bindings/entity/ScGuest.hpp; sourceTree = SOURCE_ROOT; }; + 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPeep.hpp; path = src/openrct2/scripting/bindings/entity/ScPeep.hpp; sourceTree = SOURCE_ROOT; }; + 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScStaff.cpp; path = src/openrct2/scripting/bindings/entity/ScStaff.cpp; sourceTree = SOURCE_ROOT; }; + C30AB6C640464647ABE90EC4 /* ScStaff.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScStaff.hpp; path = src/openrct2/scripting/bindings/entity/ScStaff.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3365,6 +3375,11 @@ 6DF61461D47C40CF92019B24 /* ScEntity.hpp */, B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */, 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */, + 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */, + CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */, + 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */, + 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */, + C30AB6C640464647ABE90EC4 /* ScStaff.hpp */, ); name = entity; sourceTree = ""; @@ -3563,6 +3578,9 @@ 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */, F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */, D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */, + 428B1DADD66C4829894AD0A1 /* ScGuest.hpp in Headers */, + D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */, + 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4369,6 +4387,8 @@ 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */, B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */, 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */, + BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */, + 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 1d9e6af0da..8f2773e65e 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -405,6 +405,9 @@ + + + @@ -850,6 +853,8 @@ + + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 6536717f78..4a01eb97fb 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -25,6 +25,9 @@ # include "../platform/Platform2.h" # include "Duktape.hpp" # include "bindings/entity/ScEntity.hpp" +# include "bindings/entity/ScGuest.hpp" +# include "bindings/entity/ScPeep.hpp" +# include "bindings/entity/ScStaff.hpp" # include "bindings/game/ScCheats.hpp" # include "bindings/game/ScConsole.hpp" # include "bindings/game/ScContext.hpp" diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 43e92ee8fc..ba9a176bef 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -210,621 +210,6 @@ namespace OpenRCT2::Scripting } }; - static const DukEnumMap PeepFlagMap({ - { "leavingPark", PEEP_FLAGS_LEAVING_PARK }, - { "slowWalk", PEEP_FLAGS_SLOW_WALK }, - { "tracking", PEEP_FLAGS_TRACKING }, - { "waving", PEEP_FLAGS_WAVING }, - { "hasPaidForParkEntry", PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY }, - { "photo", PEEP_FLAGS_PHOTO }, - { "painting", PEEP_FLAGS_PAINTING }, - { "wow", PEEP_FLAGS_WOW }, - { "litter", PEEP_FLAGS_LITTER }, - { "lost", PEEP_FLAGS_LOST }, - { "hunger", PEEP_FLAGS_HUNGER }, - { "toilet", PEEP_FLAGS_TOILET }, - { "crowded", PEEP_FLAGS_CROWDED }, - { "happiness", PEEP_FLAGS_HAPPINESS }, - { "nausea", PEEP_FLAGS_NAUSEA }, - { "purple", PEEP_FLAGS_PURPLE }, - { "pizza", PEEP_FLAGS_PIZZA }, - { "explode", PEEP_FLAGS_EXPLODE }, - { "rideShouldBeMarkedAsFavourite", PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE }, - { "parkEntranceChosen", PEEP_FLAGS_PARK_ENTRANCE_CHOSEN }, - { "contagious", PEEP_FLAGS_CONTAGIOUS }, - { "joy", PEEP_FLAGS_JOY }, - { "angry", PEEP_FLAGS_ANGRY }, - { "iceCream", PEEP_FLAGS_ICE_CREAM }, - { "hereWeAre", PEEP_FLAGS_HERE_WE_ARE }, - }); - - class ScPeep : public ScEntity - { - public: - ScPeep(uint16_t id) - : ScEntity(id) - { - } - - static void Register(duk_context* ctx) - { - dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScPeep::peepType_get, nullptr, "peepType"); - dukglue_register_property(ctx, &ScPeep::name_get, &ScPeep::name_set, "name"); - dukglue_register_property(ctx, &ScPeep::destination_get, &ScPeep::destination_set, "destination"); - dukglue_register_property(ctx, &ScPeep::energy_get, &ScPeep::energy_set, "energy"); - dukglue_register_property(ctx, &ScPeep::energyTarget_get, &ScPeep::energyTarget_set, "energyTarget"); - dukglue_register_method(ctx, &ScPeep::getFlag, "getFlag"); - dukglue_register_method(ctx, &ScPeep::setFlag, "setFlag"); - } - - private: - std::string peepType_get() const - { - auto peep = GetPeep(); - if (peep != nullptr) - { - return peep->Is() ? "staff" : "guest"; - } - return ""; - } - - std::string name_get() const - { - auto peep = GetPeep(); - return peep != nullptr ? peep->GetName() : std::string(); - } - void name_set(const std::string& value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetPeep(); - if (peep != nullptr) - { - peep->SetName(value); - } - } - - bool getFlag(const std::string& key) const - { - auto peep = GetPeep(); - if (peep != nullptr) - { - auto mask = PeepFlagMap[key]; - return (peep->PeepFlags & mask) != 0; - } - return false; - } - - void setFlag(const std::string& key, bool value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetPeep(); - if (peep != nullptr) - { - auto mask = PeepFlagMap[key]; - if (value) - peep->PeepFlags |= mask; - else - peep->PeepFlags &= ~mask; - peep->Invalidate(); - } - } - - DukValue destination_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto peep = GetPeep(); - if (peep != nullptr) - { - return ToDuk(ctx, peep->GetDestination()); - } - return ToDuk(ctx, nullptr); - } - - void destination_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetPeep(); - if (peep != nullptr) - { - auto pos = FromDuk(value); - peep->SetDestination(pos); - peep->Invalidate(); - } - } - - uint8_t energy_get() const - { - auto peep = GetPeep(); - return peep != nullptr ? peep->Energy : 0; - } - void energy_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetPeep(); - if (peep != nullptr) - { - peep->Energy = value; - } - } - - uint8_t energyTarget_get() const - { - auto peep = GetPeep(); - return peep != nullptr ? peep->EnergyTarget : 0; - } - void energyTarget_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetPeep(); - if (peep != nullptr) - { - peep->EnergyTarget = value; - } - } - - protected: - Peep* GetPeep() const - { - return ::GetEntity(_id); - } - }; - - class ScGuest : public ScPeep - { - public: - ScGuest(uint16_t id) - : ScPeep(id) - { - } - - static void Register(duk_context* ctx) - { - dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScGuest::tshirtColour_get, &ScGuest::tshirtColour_set, "tshirtColour"); - dukglue_register_property(ctx, &ScGuest::trousersColour_get, &ScGuest::trousersColour_set, "trousersColour"); - dukglue_register_property(ctx, &ScGuest::balloonColour_get, &ScGuest::balloonColour_set, "balloonColour"); - dukglue_register_property(ctx, &ScGuest::hatColour_get, &ScGuest::hatColour_set, "hatColour"); - dukglue_register_property(ctx, &ScGuest::umbrellaColour_get, &ScGuest::umbrellaColour_set, "umbrellaColour"); - dukglue_register_property(ctx, &ScGuest::happiness_get, &ScGuest::happiness_set, "happiness"); - dukglue_register_property(ctx, &ScGuest::happinessTarget_get, &ScGuest::happinessTarget_set, "happinessTarget"); - dukglue_register_property(ctx, &ScGuest::nausea_get, &ScGuest::nausea_set, "nausea"); - dukglue_register_property(ctx, &ScGuest::nauseaTarget_get, &ScGuest::nauseaTarget_set, "nauseaTarget"); - dukglue_register_property(ctx, &ScGuest::hunger_get, &ScGuest::hunger_set, "hunger"); - dukglue_register_property(ctx, &ScGuest::thirst_get, &ScGuest::thirst_set, "thirst"); - dukglue_register_property(ctx, &ScGuest::toilet_get, &ScGuest::toilet_set, "toilet"); - dukglue_register_property(ctx, &ScGuest::mass_get, &ScGuest::mass_set, "mass"); - dukglue_register_property(ctx, &ScGuest::minIntensity_get, &ScGuest::minIntensity_set, "minIntensity"); - dukglue_register_property(ctx, &ScGuest::maxIntensity_get, &ScGuest::maxIntensity_set, "maxIntensity"); - dukglue_register_property(ctx, &ScGuest::nauseaTolerance_get, &ScGuest::nauseaTolerance_set, "nauseaTolerance"); - dukglue_register_property(ctx, &ScGuest::cash_get, &ScGuest::cash_set, "cash"); - dukglue_register_property(ctx, &ScGuest::isInPark_get, nullptr, "isInPark"); - dukglue_register_property(ctx, &ScGuest::isLost_get, nullptr, "isLost"); - dukglue_register_property(ctx, &ScGuest::lostCountdown_get, &ScGuest::lostCountdown_set, "lostCountdown"); - } - - private: - Guest* GetGuest() const - { - return ::GetEntity(_id); - } - - uint8_t tshirtColour_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->TshirtColour : 0; - } - void tshirtColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->TshirtColour = value; - peep->Invalidate(); - } - } - - uint8_t trousersColour_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->TrousersColour : 0; - } - void trousersColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->TrousersColour = value; - peep->Invalidate(); - } - } - - uint8_t balloonColour_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->BalloonColour : 0; - } - void balloonColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->BalloonColour = value; - peep->Invalidate(); - } - } - - uint8_t hatColour_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->HatColour : 0; - } - void hatColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->HatColour = value; - peep->Invalidate(); - } - } - - uint8_t umbrellaColour_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->UmbrellaColour : 0; - } - void umbrellaColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->UmbrellaColour = value; - peep->Invalidate(); - } - } - - uint8_t happiness_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Happiness : 0; - } - void happiness_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Happiness = value; - } - } - - uint8_t happinessTarget_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->HappinessTarget : 0; - } - void happinessTarget_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->HappinessTarget = value; - } - } - - uint8_t nausea_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Nausea : 0; - } - void nausea_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Nausea = value; - } - } - - uint8_t nauseaTarget_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->NauseaTarget : 0; - } - void nauseaTarget_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->NauseaTarget = value; - } - } - - uint8_t hunger_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Hunger : 0; - } - void hunger_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Hunger = value; - } - } - - uint8_t thirst_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Thirst : 0; - } - void thirst_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Thirst = value; - } - } - - uint8_t toilet_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Toilet : 0; - } - void toilet_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Toilet = value; - } - } - - uint8_t mass_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Mass : 0; - } - void mass_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Mass = value; - } - } - - uint8_t minIntensity_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Intensity.GetMinimum() : 0; - } - void minIntensity_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Intensity = peep->Intensity.WithMinimum(value); - } - } - - uint8_t maxIntensity_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->Intensity.GetMaximum() : 0; - } - void maxIntensity_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->Intensity = peep->Intensity.WithMaximum(value); - } - } - - uint8_t nauseaTolerance_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? EnumValue(peep->NauseaTolerance) : 0; - } - void nauseaTolerance_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->NauseaTolerance = static_cast(std::min(value, 3)); - } - } - - int32_t cash_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->CashInPocket : 0; - } - void cash_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->CashInPocket = std::max(0, value); - } - } - - bool isInPark_get() const - { - auto peep = GetGuest(); - return (peep != nullptr && !peep->OutsideOfPark); - } - - bool isLost_get() const - { - auto peep = GetGuest(); - return (peep != nullptr && peep->GuestIsLostCountdown < 90); - } - - uint8_t lostCountdown_get() const - { - auto peep = GetGuest(); - return peep != nullptr ? peep->GuestIsLostCountdown : 0; - } - void lostCountdown_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetGuest(); - if (peep != nullptr) - { - peep->GuestIsLostCountdown = value; - } - } - }; - - class ScStaff : public ScPeep - { - public: - ScStaff(uint16_t Id) - : ScPeep(Id) - { - } - - static void Register(duk_context* ctx) - { - dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScStaff::staffType_get, &ScStaff::staffType_set, "staffType"); - dukglue_register_property(ctx, &ScStaff::colour_get, &ScStaff::colour_set, "colour"); - dukglue_register_property(ctx, &ScStaff::costume_get, &ScStaff::costume_set, "costume"); - dukglue_register_property(ctx, &ScStaff::orders_get, &ScStaff::orders_set, "orders"); - } - - private: - Staff* GetStaff() const - { - return ::GetEntity(_id); - } - - std::string staffType_get() const - { - auto peep = GetStaff(); - if (peep != nullptr) - { - switch (peep->AssignedStaffType) - { - case StaffType::Handyman: - return "handyman"; - case StaffType::Mechanic: - return "mechanic"; - case StaffType::Security: - return "security"; - case StaffType::Entertainer: - return "entertainer"; - case StaffType::Count: - break; - } - } - return ""; - } - - void staffType_set(const std::string& value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetStaff(); - if (peep != nullptr) - { - if (value == "handyman" && peep->AssignedStaffType != StaffType::Handyman) - { - peep->AssignedStaffType = StaffType::Handyman; - peep->SpriteType = PeepSpriteType::Handyman; - } - else if (value == "mechanic" && peep->AssignedStaffType != StaffType::Mechanic) - { - peep->AssignedStaffType = StaffType::Mechanic; - peep->SpriteType = PeepSpriteType::Mechanic; - } - else if (value == "security" && peep->AssignedStaffType != StaffType::Security) - { - peep->AssignedStaffType = StaffType::Security; - peep->SpriteType = PeepSpriteType::Security; - } - else if (value == "entertainer" && peep->AssignedStaffType != StaffType::Entertainer) - { - peep->AssignedStaffType = StaffType::Entertainer; - peep->SpriteType = PeepSpriteType::EntertainerPanda; - } - } - } - - uint8_t colour_get() const - { - auto peep = GetStaff(); - return peep != nullptr ? peep->TshirtColour : 0; - } - - void colour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetStaff(); - if (peep != nullptr) - { - peep->TshirtColour = value; - peep->TrousersColour = value; - } - } - - uint8_t costume_get() const - { - auto peep = GetStaff(); - if (peep != nullptr && peep->AssignedStaffType == StaffType::Entertainer) - { - return peep->GetCostume(); - } - return 0; - } - - void costume_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetStaff(); - if (peep != nullptr) - { - peep->SetCostume(value); - } - } - - uint8_t orders_get() const - { - auto peep = GetStaff(); - return peep != nullptr ? peep->StaffOrders : 0; - } - - void orders_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto peep = GetStaff(); - if (peep != nullptr) - { - peep->StaffOrders = value; - } - } - }; - static const DukEnumMap LitterTypeMap({ { "vomit", Litter::Type::Vomit }, { "vomit_alt", Litter::Type::VomitAlt }, diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp new file mode 100644 index 0000000000..e0e20d4f4d --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -0,0 +1,342 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScGuest.hpp" + +namespace OpenRCT2::Scripting +{ + ScGuest::ScGuest(uint16_t id) + : ScPeep(id) + { + } + + void ScGuest::Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScGuest::tshirtColour_get, &ScGuest::tshirtColour_set, "tshirtColour"); + dukglue_register_property(ctx, &ScGuest::trousersColour_get, &ScGuest::trousersColour_set, "trousersColour"); + dukglue_register_property(ctx, &ScGuest::balloonColour_get, &ScGuest::balloonColour_set, "balloonColour"); + dukglue_register_property(ctx, &ScGuest::hatColour_get, &ScGuest::hatColour_set, "hatColour"); + dukglue_register_property(ctx, &ScGuest::umbrellaColour_get, &ScGuest::umbrellaColour_set, "umbrellaColour"); + dukglue_register_property(ctx, &ScGuest::happiness_get, &ScGuest::happiness_set, "happiness"); + dukglue_register_property(ctx, &ScGuest::happinessTarget_get, &ScGuest::happinessTarget_set, "happinessTarget"); + dukglue_register_property(ctx, &ScGuest::nausea_get, &ScGuest::nausea_set, "nausea"); + dukglue_register_property(ctx, &ScGuest::nauseaTarget_get, &ScGuest::nauseaTarget_set, "nauseaTarget"); + dukglue_register_property(ctx, &ScGuest::hunger_get, &ScGuest::hunger_set, "hunger"); + dukglue_register_property(ctx, &ScGuest::thirst_get, &ScGuest::thirst_set, "thirst"); + dukglue_register_property(ctx, &ScGuest::toilet_get, &ScGuest::toilet_set, "toilet"); + dukglue_register_property(ctx, &ScGuest::mass_get, &ScGuest::mass_set, "mass"); + dukglue_register_property(ctx, &ScGuest::minIntensity_get, &ScGuest::minIntensity_set, "minIntensity"); + dukglue_register_property(ctx, &ScGuest::maxIntensity_get, &ScGuest::maxIntensity_set, "maxIntensity"); + dukglue_register_property(ctx, &ScGuest::nauseaTolerance_get, &ScGuest::nauseaTolerance_set, "nauseaTolerance"); + dukglue_register_property(ctx, &ScGuest::cash_get, &ScGuest::cash_set, "cash"); + dukglue_register_property(ctx, &ScGuest::isInPark_get, nullptr, "isInPark"); + dukglue_register_property(ctx, &ScGuest::isLost_get, nullptr, "isLost"); + dukglue_register_property(ctx, &ScGuest::lostCountdown_get, &ScGuest::lostCountdown_set, "lostCountdown"); + } + + Guest* ScGuest::GetGuest() const + { + return ::GetEntity(_id); + } + + uint8_t ScGuest::tshirtColour_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->TshirtColour : 0; + } + void ScGuest::tshirtColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->TshirtColour = value; + peep->Invalidate(); + } + } + + uint8_t ScGuest::trousersColour_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->TrousersColour : 0; + } + void ScGuest::trousersColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->TrousersColour = value; + peep->Invalidate(); + } + } + + uint8_t ScGuest::balloonColour_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->BalloonColour : 0; + } + void ScGuest::balloonColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->BalloonColour = value; + peep->Invalidate(); + } + } + + uint8_t ScGuest::hatColour_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->HatColour : 0; + } + void ScGuest::hatColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->HatColour = value; + peep->Invalidate(); + } + } + + uint8_t ScGuest::umbrellaColour_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->UmbrellaColour : 0; + } + void ScGuest::umbrellaColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->UmbrellaColour = value; + peep->Invalidate(); + } + } + + uint8_t ScGuest::happiness_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Happiness : 0; + } + void ScGuest::happiness_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Happiness = value; + } + } + + uint8_t ScGuest::happinessTarget_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->HappinessTarget : 0; + } + void ScGuest::happinessTarget_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->HappinessTarget = value; + } + } + + uint8_t ScGuest::nausea_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Nausea : 0; + } + void ScGuest::nausea_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Nausea = value; + } + } + + uint8_t ScGuest::nauseaTarget_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->NauseaTarget : 0; + } + void ScGuest::nauseaTarget_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->NauseaTarget = value; + } + } + + uint8_t ScGuest::hunger_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Hunger : 0; + } + void ScGuest::hunger_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Hunger = value; + } + } + + uint8_t ScGuest::thirst_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Thirst : 0; + } + void ScGuest::thirst_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Thirst = value; + } + } + + uint8_t ScGuest::toilet_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Toilet : 0; + } + void ScGuest::toilet_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Toilet = value; + } + } + + uint8_t ScGuest::mass_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Mass : 0; + } + void ScGuest::mass_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Mass = value; + } + } + + uint8_t ScGuest::minIntensity_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Intensity.GetMinimum() : 0; + } + void ScGuest::minIntensity_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Intensity = peep->Intensity.WithMinimum(value); + } + } + + uint8_t ScGuest::maxIntensity_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->Intensity.GetMaximum() : 0; + } + void ScGuest::maxIntensity_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->Intensity = peep->Intensity.WithMaximum(value); + } + } + + uint8_t ScGuest::nauseaTolerance_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? EnumValue(peep->NauseaTolerance) : 0; + } + void ScGuest::nauseaTolerance_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->NauseaTolerance = static_cast(std::min(value, 3)); + } + } + + int32_t ScGuest::cash_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->CashInPocket : 0; + } + void ScGuest::cash_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->CashInPocket = std::max(0, value); + } + } + + bool ScGuest::isInPark_get() const + { + auto peep = GetGuest(); + return (peep != nullptr && !peep->OutsideOfPark); + } + + bool ScGuest::isLost_get() const + { + auto peep = GetGuest(); + return (peep != nullptr && peep->GuestIsLostCountdown < 90); + } + + uint8_t ScGuest::lostCountdown_get() const + { + auto peep = GetGuest(); + return peep != nullptr ? peep->GuestIsLostCountdown : 0; + } + void ScGuest::lostCountdown_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetGuest(); + if (peep != nullptr) + { + peep->GuestIsLostCountdown = value; + } + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.hpp b/src/openrct2/scripting/bindings/entity/ScGuest.hpp new file mode 100644 index 0000000000..e387cb22d9 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScGuest.hpp @@ -0,0 +1,89 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScPeep.hpp" + +namespace OpenRCT2::Scripting +{ + class ScGuest : public ScPeep + { + public: + ScGuest(uint16_t id); + + static void Register(duk_context* ctx); + + private: + Guest* GetGuest() const; + + uint8_t tshirtColour_get() const; + void tshirtColour_set(uint8_t value); + + uint8_t trousersColour_get() const; + void trousersColour_set(uint8_t value); + + uint8_t balloonColour_get() const; + void balloonColour_set(uint8_t value); + + uint8_t hatColour_get() const; + void hatColour_set(uint8_t value); + + uint8_t umbrellaColour_get() const; + void umbrellaColour_set(uint8_t value); + + uint8_t happiness_get() const; + void happiness_set(uint8_t value); + + uint8_t happinessTarget_get() const; + void happinessTarget_set(uint8_t value); + + uint8_t nausea_get() const; + void nausea_set(uint8_t value); + + uint8_t nauseaTarget_get() const; + void nauseaTarget_set(uint8_t value); + + uint8_t hunger_get() const; + void hunger_set(uint8_t value); + + uint8_t thirst_get() const; + void thirst_set(uint8_t value); + + uint8_t toilet_get() const; + void toilet_set(uint8_t value); + + uint8_t mass_get() const; + void mass_set(uint8_t value); + + uint8_t minIntensity_get() const; + void minIntensity_set(uint8_t value); + + uint8_t maxIntensity_get() const; + void maxIntensity_set(uint8_t value); + + uint8_t nauseaTolerance_get() const; + void nauseaTolerance_set(uint8_t value); + + int32_t cash_get() const; + void cash_set(int32_t value); + + bool isInPark_get() const; + + bool isLost_get() const; + + uint8_t lostCountdown_get() const; + void lostCountdown_set(uint8_t value); + }; + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScPeep.hpp b/src/openrct2/scripting/bindings/entity/ScPeep.hpp new file mode 100644 index 0000000000..96173a3a29 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScPeep.hpp @@ -0,0 +1,180 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScEntity.hpp" + +namespace OpenRCT2::Scripting +{ + static const DukEnumMap PeepFlagMap({ + { "leavingPark", PEEP_FLAGS_LEAVING_PARK }, + { "slowWalk", PEEP_FLAGS_SLOW_WALK }, + { "tracking", PEEP_FLAGS_TRACKING }, + { "waving", PEEP_FLAGS_WAVING }, + { "hasPaidForParkEntry", PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY }, + { "photo", PEEP_FLAGS_PHOTO }, + { "painting", PEEP_FLAGS_PAINTING }, + { "wow", PEEP_FLAGS_WOW }, + { "litter", PEEP_FLAGS_LITTER }, + { "lost", PEEP_FLAGS_LOST }, + { "hunger", PEEP_FLAGS_HUNGER }, + { "toilet", PEEP_FLAGS_TOILET }, + { "crowded", PEEP_FLAGS_CROWDED }, + { "happiness", PEEP_FLAGS_HAPPINESS }, + { "nausea", PEEP_FLAGS_NAUSEA }, + { "purple", PEEP_FLAGS_PURPLE }, + { "pizza", PEEP_FLAGS_PIZZA }, + { "explode", PEEP_FLAGS_EXPLODE }, + { "rideShouldBeMarkedAsFavourite", PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE }, + { "parkEntranceChosen", PEEP_FLAGS_PARK_ENTRANCE_CHOSEN }, + { "contagious", PEEP_FLAGS_CONTAGIOUS }, + { "joy", PEEP_FLAGS_JOY }, + { "angry", PEEP_FLAGS_ANGRY }, + { "iceCream", PEEP_FLAGS_ICE_CREAM }, + { "hereWeAre", PEEP_FLAGS_HERE_WE_ARE }, + }); + + class ScPeep : public ScEntity + { + public: + ScPeep(uint16_t id) + : ScEntity(id) + { + } + + static void Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScPeep::peepType_get, nullptr, "peepType"); + dukglue_register_property(ctx, &ScPeep::name_get, &ScPeep::name_set, "name"); + dukglue_register_property(ctx, &ScPeep::destination_get, &ScPeep::destination_set, "destination"); + dukglue_register_property(ctx, &ScPeep::energy_get, &ScPeep::energy_set, "energy"); + dukglue_register_property(ctx, &ScPeep::energyTarget_get, &ScPeep::energyTarget_set, "energyTarget"); + dukglue_register_method(ctx, &ScPeep::getFlag, "getFlag"); + dukglue_register_method(ctx, &ScPeep::setFlag, "setFlag"); + } + + private: + std::string peepType_get() const + { + auto peep = GetPeep(); + if (peep != nullptr) + { + return peep->Is() ? "staff" : "guest"; + } + return ""; + } + + std::string name_get() const + { + auto peep = GetPeep(); + return peep != nullptr ? peep->GetName() : std::string(); + } + void name_set(const std::string& value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetPeep(); + if (peep != nullptr) + { + peep->SetName(value); + } + } + + bool getFlag(const std::string& key) const + { + auto peep = GetPeep(); + if (peep != nullptr) + { + auto mask = PeepFlagMap[key]; + return (peep->PeepFlags & mask) != 0; + } + return false; + } + + void setFlag(const std::string& key, bool value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetPeep(); + if (peep != nullptr) + { + auto mask = PeepFlagMap[key]; + if (value) + peep->PeepFlags |= mask; + else + peep->PeepFlags &= ~mask; + peep->Invalidate(); + } + } + + DukValue destination_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto peep = GetPeep(); + if (peep != nullptr) + { + return ToDuk(ctx, peep->GetDestination()); + } + return ToDuk(ctx, nullptr); + } + + void destination_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetPeep(); + if (peep != nullptr) + { + auto pos = FromDuk(value); + peep->SetDestination(pos); + peep->Invalidate(); + } + } + + uint8_t energy_get() const + { + auto peep = GetPeep(); + return peep != nullptr ? peep->Energy : 0; + } + void energy_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetPeep(); + if (peep != nullptr) + { + peep->Energy = value; + } + } + + uint8_t energyTarget_get() const + { + auto peep = GetPeep(); + return peep != nullptr ? peep->EnergyTarget : 0; + } + void energyTarget_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetPeep(); + if (peep != nullptr) + { + peep->EnergyTarget = value; + } + } + + protected: + Peep* GetPeep() const + { + return ::GetEntity(_id); + } + }; + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp new file mode 100644 index 0000000000..1d92e4cf29 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -0,0 +1,141 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScStaff.hpp" + +namespace OpenRCT2::Scripting +{ + ScStaff::ScStaff(uint16_t Id) + : ScPeep(Id) + { + } + + void ScStaff::Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScStaff::staffType_get, &ScStaff::staffType_set, "staffType"); + dukglue_register_property(ctx, &ScStaff::colour_get, &ScStaff::colour_set, "colour"); + dukglue_register_property(ctx, &ScStaff::costume_get, &ScStaff::costume_set, "costume"); + dukglue_register_property(ctx, &ScStaff::orders_get, &ScStaff::orders_set, "orders"); + } + + Staff* ScStaff::GetStaff() const + { + return ::GetEntity(_id); + } + + std::string ScStaff::staffType_get() const + { + auto peep = GetStaff(); + if (peep != nullptr) + { + switch (peep->AssignedStaffType) + { + case StaffType::Handyman: + return "handyman"; + case StaffType::Mechanic: + return "mechanic"; + case StaffType::Security: + return "security"; + case StaffType::Entertainer: + return "entertainer"; + case StaffType::Count: + break; + } + } + return ""; + } + + void ScStaff::staffType_set(const std::string& value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetStaff(); + if (peep != nullptr) + { + if (value == "handyman" && peep->AssignedStaffType != StaffType::Handyman) + { + peep->AssignedStaffType = StaffType::Handyman; + peep->SpriteType = PeepSpriteType::Handyman; + } + else if (value == "mechanic" && peep->AssignedStaffType != StaffType::Mechanic) + { + peep->AssignedStaffType = StaffType::Mechanic; + peep->SpriteType = PeepSpriteType::Mechanic; + } + else if (value == "security" && peep->AssignedStaffType != StaffType::Security) + { + peep->AssignedStaffType = StaffType::Security; + peep->SpriteType = PeepSpriteType::Security; + } + else if (value == "entertainer" && peep->AssignedStaffType != StaffType::Entertainer) + { + peep->AssignedStaffType = StaffType::Entertainer; + peep->SpriteType = PeepSpriteType::EntertainerPanda; + } + } + } + + uint8_t ScStaff::colour_get() const + { + auto peep = GetStaff(); + return peep != nullptr ? peep->TshirtColour : 0; + } + + void ScStaff::colour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetStaff(); + if (peep != nullptr) + { + peep->TshirtColour = value; + peep->TrousersColour = value; + } + } + + uint8_t ScStaff::costume_get() const + { + auto peep = GetStaff(); + if (peep != nullptr && peep->AssignedStaffType == StaffType::Entertainer) + { + return peep->GetCostume(); + } + return 0; + } + + void ScStaff::costume_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetStaff(); + if (peep != nullptr) + { + peep->SetCostume(value); + } + } + + uint8_t ScStaff::orders_get() const + { + auto peep = GetStaff(); + return peep != nullptr ? peep->StaffOrders : 0; + } + + void ScStaff::orders_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto peep = GetStaff(); + if (peep != nullptr) + { + peep->StaffOrders = value; + } + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.hpp b/src/openrct2/scripting/bindings/entity/ScStaff.hpp new file mode 100644 index 0000000000..0102144075 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScStaff.hpp @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScPeep.hpp" + +namespace OpenRCT2::Scripting +{ + class ScStaff : public ScPeep + { + public: + ScStaff(uint16_t Id); + + static void Register(duk_context* ctx); + + private: + Staff* GetStaff() const; + + std::string staffType_get() const; + void staffType_set(const std::string& value); + + uint8_t colour_get() const; + void colour_set(uint8_t value); + + uint8_t costume_get() const; + void costume_set(uint8_t value); + + uint8_t orders_get() const; + void orders_set(uint8_t value); + }; + +} // namespace OpenRCT2::Scripting + +#endif From 371bbc0675643ea76339c2cfa7765451b985708d Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 20:32:20 +0300 Subject: [PATCH 140/681] Move ScLitter to its own files --- OpenRCT2.xcodeproj/project.pbxproj | 8 ++ src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/entity/ScEntity.hpp | 68 ---------------- .../scripting/bindings/entity/ScLitter.cpp | 80 +++++++++++++++++++ .../scripting/bindings/entity/ScLitter.hpp | 36 +++++++++ 6 files changed, 127 insertions(+), 68 deletions(-) create mode 100644 src/openrct2/scripting/bindings/entity/ScLitter.cpp create mode 100644 src/openrct2/scripting/bindings/entity/ScLitter.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 8550bdd4c8..7b4962d138 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -779,6 +779,8 @@ D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */; }; 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */; }; 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30AB6C640464647ABE90EC4 /* ScStaff.hpp */; }; + 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */; }; + 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30388F4F6D34DF59EF7072C /* ScLitter.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1860,6 +1862,8 @@ 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPeep.hpp; path = src/openrct2/scripting/bindings/entity/ScPeep.hpp; sourceTree = SOURCE_ROOT; }; 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScStaff.cpp; path = src/openrct2/scripting/bindings/entity/ScStaff.cpp; sourceTree = SOURCE_ROOT; }; C30AB6C640464647ABE90EC4 /* ScStaff.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScStaff.hpp; path = src/openrct2/scripting/bindings/entity/ScStaff.hpp; sourceTree = SOURCE_ROOT; }; + 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScLitter.cpp; path = src/openrct2/scripting/bindings/entity/ScLitter.cpp; sourceTree = SOURCE_ROOT; }; + C30388F4F6D34DF59EF7072C /* ScLitter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScLitter.hpp; path = src/openrct2/scripting/bindings/entity/ScLitter.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3380,6 +3384,8 @@ 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */, 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */, C30AB6C640464647ABE90EC4 /* ScStaff.hpp */, + 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */, + C30388F4F6D34DF59EF7072C /* ScLitter.hpp */, ); name = entity; sourceTree = ""; @@ -3581,6 +3587,7 @@ 428B1DADD66C4829894AD0A1 /* ScGuest.hpp in Headers */, D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */, 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */, + 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4389,6 +4396,7 @@ 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */, BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */, 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */, + 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 8f2773e65e..6e68b44c43 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -406,6 +406,7 @@ + @@ -854,6 +855,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 4a01eb97fb..bc3fe0ee34 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -26,6 +26,7 @@ # include "Duktape.hpp" # include "bindings/entity/ScEntity.hpp" # include "bindings/entity/ScGuest.hpp" +# include "bindings/entity/ScLitter.hpp" # include "bindings/entity/ScPeep.hpp" # include "bindings/entity/ScStaff.hpp" # include "bindings/game/ScCheats.hpp" diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index ba9a176bef..6531862fdf 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -14,14 +14,11 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../peep/Peep.h" -# include "../../../peep/Staff.h" # include "../../../util/Util.h" # include "../../../world/EntityList.h" -# include "../../../world/Litter.h" # include "../../../world/Sprite.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" -# include "../ride/ScRide.hpp" # include # include @@ -210,71 +207,6 @@ namespace OpenRCT2::Scripting } }; - static const DukEnumMap LitterTypeMap({ - { "vomit", Litter::Type::Vomit }, - { "vomit_alt", Litter::Type::VomitAlt }, - { "empty_can", Litter::Type::EmptyCan }, - { "rubbish", Litter::Type::Rubbish }, - { "burger_box", Litter::Type::BurgerBox }, - { "empty_cup", Litter::Type::EmptyCup }, - { "empty_box", Litter::Type::EmptyBox }, - { "empty_bottle", Litter::Type::EmptyBottle }, - { "empty_bowl_red", Litter::Type::EmptyBowlRed }, - { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, - { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, - { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, - }); - - class ScLitter : public ScEntity - { - public: - ScLitter(uint16_t Id) - : ScEntity(Id) - { - } - - static void Register(duk_context* ctx) - { - dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScLitter::litterType_get, &ScLitter::litterType_set, "litterType"); - dukglue_register_property(ctx, &ScLitter::creationTick_get, nullptr, "creationTick"); - } - - private: - Litter* GetLitter() const - { - return ::GetEntity(_id); - } - - std::string litterType_get() const - { - auto* litter = GetLitter(); - auto it = LitterTypeMap.find(litter->SubType); - if (it == LitterTypeMap.end()) - return ""; - return std::string{ it->first }; - } - - void litterType_set(const std::string& litterType) - { - ThrowIfGameStateNotMutable(); - - auto it = LitterTypeMap.find(litterType); - if (it == LitterTypeMap.end()) - return; - auto* litter = GetLitter(); - litter->SubType = it->second; - } - - uint32_t creationTick_get() const - { - auto* litter = GetLitter(); - if (litter == nullptr) - return 0; - return litter->creationTick; - } - }; - } // namespace OpenRCT2::Scripting #endif diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp new file mode 100644 index 0000000000..1163666230 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -0,0 +1,80 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScLitter.hpp" + +namespace OpenRCT2::Scripting +{ + static const DukEnumMap LitterTypeMap({ + { "vomit", Litter::Type::Vomit }, + { "vomit_alt", Litter::Type::VomitAlt }, + { "empty_can", Litter::Type::EmptyCan }, + { "rubbish", Litter::Type::Rubbish }, + { "burger_box", Litter::Type::BurgerBox }, + { "empty_cup", Litter::Type::EmptyCup }, + { "empty_box", Litter::Type::EmptyBox }, + { "empty_bottle", Litter::Type::EmptyBottle }, + { "empty_bowl_red", Litter::Type::EmptyBowlRed }, + { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, + { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, + { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, + }); + + ScLitter::ScLitter(uint16_t Id) + : ScEntity(Id) + { + } + + void ScLitter::Register(duk_context* ctx) + { + dukglue_set_base_class(ctx); + dukglue_register_property(ctx, &ScLitter::litterType_get, &ScLitter::litterType_set, "litterType"); + dukglue_register_property(ctx, &ScLitter::creationTick_get, nullptr, "creationTick"); + } + + Litter* ScLitter::GetLitter() const + { + return ::GetEntity(_id); + } + + std::string ScLitter::litterType_get() const + { + auto* litter = GetLitter(); + auto it = LitterTypeMap.find(litter->SubType); + if (it == LitterTypeMap.end()) + return ""; + return std::string{ it->first }; + } + + void ScLitter::litterType_set(const std::string& litterType) + { + ThrowIfGameStateNotMutable(); + + auto it = LitterTypeMap.find(litterType); + if (it == LitterTypeMap.end()) + return; + auto* litter = GetLitter(); + litter->SubType = it->second; + } + + uint32_t ScLitter::creationTick_get() const + { + auto* litter = GetLitter(); + if (litter == nullptr) + return 0; + return litter->creationTick; + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.hpp b/src/openrct2/scripting/bindings/entity/ScLitter.hpp new file mode 100644 index 0000000000..d2184b1075 --- /dev/null +++ b/src/openrct2/scripting/bindings/entity/ScLitter.hpp @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScEntity.hpp" + +namespace OpenRCT2::Scripting +{ + class ScLitter : public ScEntity + { + public: + ScLitter(uint16_t Id); + + static void Register(duk_context* ctx); + + private: + Litter* GetLitter() const; + + std::string litterType_get() const; + void litterType_set(const std::string& litterType); + + uint32_t creationTick_get() const; + }; + +} // namespace OpenRCT2::Scripting + +#endif From 68a795d6070a3b82fb38235f133e151318617bd8 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 20:45:07 +0300 Subject: [PATCH 141/681] Fix include --- src/openrct2/scripting/bindings/entity/ScVehicle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index 8012d5b582..90389d7157 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -9,6 +9,8 @@ #include "ScVehicle.hpp" +#include "../ride/ScRide.hpp" + #ifdef ENABLE_SCRIPTING namespace OpenRCT2::Scripting From 64b57734e1b72d8378c1ef58a5dbc7ab640655b8 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 20:55:58 +0300 Subject: [PATCH 142/681] Move ScPlayerGroup into its own files --- OpenRCT2.xcodeproj/project.pbxproj | 8 + src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/network/ScNetwork.hpp | 132 +-------------- .../bindings/network/ScPlayerGroup.cpp | 150 ++++++++++++++++++ .../bindings/network/ScPlayerGroup.hpp | 41 +++++ 6 files changed, 203 insertions(+), 131 deletions(-) create mode 100644 src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp create mode 100644 src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 7b4962d138..62174b2d6d 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -781,6 +781,8 @@ 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30AB6C640464647ABE90EC4 /* ScStaff.hpp */; }; 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */; }; 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30388F4F6D34DF59EF7072C /* ScLitter.hpp */; }; + 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */; }; + 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1864,6 +1866,8 @@ C30AB6C640464647ABE90EC4 /* ScStaff.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScStaff.hpp; path = src/openrct2/scripting/bindings/entity/ScStaff.hpp; sourceTree = SOURCE_ROOT; }; 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScLitter.cpp; path = src/openrct2/scripting/bindings/entity/ScLitter.cpp; sourceTree = SOURCE_ROOT; }; C30388F4F6D34DF59EF7072C /* ScLitter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScLitter.hpp; path = src/openrct2/scripting/bindings/entity/ScLitter.hpp; sourceTree = SOURCE_ROOT; }; + DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayerGroup.cpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp; sourceTree = SOURCE_ROOT; }; + 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayerGroup.hpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3407,6 +3411,8 @@ children = ( BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */, D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */, + DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */, + 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */, ); name = network; sourceTree = ""; @@ -3588,6 +3594,7 @@ D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */, 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */, 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */, + 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4397,6 +4404,7 @@ BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */, 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */, 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */, + 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 6e68b44c43..e4579359cc 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -410,6 +410,7 @@ + @@ -858,6 +859,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index bc3fe0ee34..519b031a12 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -34,6 +34,7 @@ # include "bindings/game/ScContext.hpp" # include "bindings/game/ScDisposable.hpp" # include "bindings/network/ScNetwork.hpp" +# include "bindings/network/ScPlayerGroup.hpp" # include "bindings/network/ScSocket.hpp" # include "bindings/object/ScObject.hpp" # include "bindings/ride/ScRide.hpp" diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.hpp b/src/openrct2/scripting/bindings/network/ScNetwork.hpp index 3b1cf27184..15073ba207 100644 --- a/src/openrct2/scripting/bindings/network/ScNetwork.hpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.hpp @@ -19,140 +19,10 @@ # include "../../../network/network.h" # include "../../Duktape.hpp" # include "../network/ScSocket.hpp" +# include "ScPlayerGroup.hpp" namespace OpenRCT2::Scripting { - class ScPlayerGroup - { - private: - int32_t _id; - - public: - ScPlayerGroup(int32_t id) - : _id(id) - { - } - - int32_t id_get() - { - return _id; - } - - std::string name_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_group_index(_id); - if (index == -1) - return {}; - return network_get_group_name(index); -# else - return {}; -# endif - } - void name_set(std::string value) - { -# ifndef DISABLE_NETWORK - auto action = NetworkModifyGroupAction(ModifyGroupType::SetName, _id, value); - GameActions::Execute(&action); -# endif - } - - std::vector permissions_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_group_index(_id); - if (index == -1) - return {}; - - // Create array of permissions - std::vector result; - auto permissionIndex = 0; - for (const auto& action : NetworkActions::Actions) - { - if (network_can_perform_action(index, static_cast(permissionIndex))) - { - result.push_back(TransformPermissionKeyToJS(action.PermissionName)); - } - permissionIndex++; - } - return result; -# else - return {}; -# endif - } - void permissions_set(std::vector value) - { -# ifndef DISABLE_NETWORK - auto groupIndex = network_get_group_index(_id); - if (groupIndex == -1) - return; - - // First clear all permissions - auto networkAction = NetworkModifyGroupAction( - ModifyGroupType::SetPermissions, _id, "", 0, PermissionState::ClearAll); - GameActions::Execute(&networkAction); - - std::vector enabledPermissions; - enabledPermissions.resize(NetworkActions::Actions.size()); - for (const auto& p : value) - { - auto permissionName = TransformPermissionKeyToInternal(p); - - auto permissionIndex = 0; - for (const auto& action : NetworkActions::Actions) - { - if (action.PermissionName == permissionName) - { - enabledPermissions[permissionIndex] = true; - } - permissionIndex++; - } - } - - for (size_t i = 0; i < enabledPermissions.size(); i++) - { - auto toggle - = (enabledPermissions[i] - != (network_can_perform_action(groupIndex, static_cast(i)) != 0)); - if (toggle) - { - auto networkAction2 = NetworkModifyGroupAction( - ModifyGroupType::SetPermissions, _id, "", static_cast(i), PermissionState::Toggle); - GameActions::Execute(&networkAction2); - } - } -# endif - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScPlayerGroup::id_get, nullptr, "id"); - dukglue_register_property(ctx, &ScPlayerGroup::name_get, &ScPlayerGroup::name_set, "name"); - dukglue_register_property(ctx, &ScPlayerGroup::permissions_get, &ScPlayerGroup::permissions_set, "permissions"); - } - - private: - static std::string TransformPermissionKeyToJS(const std::string& s) - { - auto result = s.substr(sizeof("PERMISSION_") - 1); - for (auto& c : result) - { - c = std::tolower(c); - } - return result; - } - - static std::string TransformPermissionKeyToInternal(const std::string& s) - { - auto result = "PERMISSION_" + s; - for (auto& c : result) - { - c = std::toupper(c); - } - return result; - } - }; - class ScPlayer { private: diff --git a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp new file mode 100644 index 0000000000..9c6f5a399d --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp @@ -0,0 +1,150 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScPlayerGroup.hpp" + +# include "../../../Context.h" +# include "../../../actions/NetworkModifyGroupAction.h" +# include "../../../actions/PlayerSetGroupAction.h" +# include "../../../network/NetworkAction.h" +# include "../../../network/network.h" +# include "../../Duktape.hpp" + +namespace OpenRCT2::Scripting +{ + ScPlayerGroup::ScPlayerGroup(int32_t id) + : _id(id) + { + } + + int32_t ScPlayerGroup::id_get() + { + return _id; + } + + std::string ScPlayerGroup::name_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_group_index(_id); + if (index == -1) + return {}; + return network_get_group_name(index); +# else + return {}; +# endif + } + + void ScPlayerGroup::name_set(std::string value) + { +# ifndef DISABLE_NETWORK + auto action = NetworkModifyGroupAction(ModifyGroupType::SetName, _id, value); + GameActions::Execute(&action); +# endif + } + + static std::string TransformPermissionKeyToJS(const std::string& s) + { + auto result = s.substr(sizeof("PERMISSION_") - 1); + for (auto& c : result) + { + c = std::tolower(c); + } + return result; + } + + std::vector ScPlayerGroup::permissions_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_group_index(_id); + if (index == -1) + return {}; + + // Create array of permissions + std::vector result; + auto permissionIndex = 0; + for (const auto& action : NetworkActions::Actions) + { + if (network_can_perform_action(index, static_cast(permissionIndex))) + { + result.push_back(TransformPermissionKeyToJS(action.PermissionName)); + } + permissionIndex++; + } + return result; +# else + return {}; +# endif + } + + static std::string TransformPermissionKeyToInternal(const std::string& s) + { + auto result = "PERMISSION_" + s; + for (auto& c : result) + { + c = std::toupper(c); + } + return result; + } + + void ScPlayerGroup::permissions_set(std::vector value) + { +# ifndef DISABLE_NETWORK + auto groupIndex = network_get_group_index(_id); + if (groupIndex == -1) + return; + + // First clear all permissions + auto networkAction = NetworkModifyGroupAction(ModifyGroupType::SetPermissions, _id, "", 0, PermissionState::ClearAll); + GameActions::Execute(&networkAction); + + std::vector enabledPermissions; + enabledPermissions.resize(NetworkActions::Actions.size()); + for (const auto& p : value) + { + auto permissionName = TransformPermissionKeyToInternal(p); + + auto permissionIndex = 0; + for (const auto& action : NetworkActions::Actions) + { + if (action.PermissionName == permissionName) + { + enabledPermissions[permissionIndex] = true; + } + permissionIndex++; + } + } + + for (size_t i = 0; i < enabledPermissions.size(); i++) + { + auto toggle + = (enabledPermissions[i] != (network_can_perform_action(groupIndex, static_cast(i)) != 0)); + if (toggle) + { + auto networkAction2 = NetworkModifyGroupAction( + ModifyGroupType::SetPermissions, _id, "", static_cast(i), PermissionState::Toggle); + GameActions::Execute(&networkAction2); + } + } +# endif + } + + void ScPlayerGroup::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScPlayerGroup::id_get, nullptr, "id"); + dukglue_register_property(ctx, &ScPlayerGroup::name_get, &ScPlayerGroup::name_set, "name"); + dukglue_register_property(ctx, &ScPlayerGroup::permissions_get, &ScPlayerGroup::permissions_set, "permissions"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp b/src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp new file mode 100644 index 0000000000..757fbda24a --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../Duktape.hpp" + +# include +# include + +namespace OpenRCT2::Scripting +{ + class ScPlayerGroup + { + int32_t _id; + + public: + ScPlayerGroup(int32_t id); + + int32_t id_get(); + + std::string name_get() const; + void name_set(std::string value); + + std::vector permissions_get() const; + void permissions_set(std::vector value); + + static void Register(duk_context* ctx); + }; + +} // namespace OpenRCT2::Scripting + +#endif From 99eee53c605a60757323d78559d0d409c324877a Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 21:08:35 +0300 Subject: [PATCH 143/681] Move ScNetwork and ScPlayer into their own files --- OpenRCT2.xcodeproj/project.pbxproj | 12 + src/openrct2/libopenrct2.vcxproj | 3 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/network/ScNetwork.cpp | 297 +++++++++++++ .../scripting/bindings/network/ScNetwork.hpp | 406 ++---------------- .../scripting/bindings/network/ScPlayer.cpp | 124 ++++++ .../scripting/bindings/network/ScPlayer.hpp | 50 +++ 7 files changed, 522 insertions(+), 371 deletions(-) create mode 100644 src/openrct2/scripting/bindings/network/ScNetwork.cpp create mode 100644 src/openrct2/scripting/bindings/network/ScPlayer.cpp create mode 100644 src/openrct2/scripting/bindings/network/ScPlayer.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 62174b2d6d..0584f1857a 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -783,6 +783,9 @@ 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30388F4F6D34DF59EF7072C /* ScLitter.hpp */; }; 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */; }; 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */; }; + E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */; }; + 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 7A08C451885D4D419FB4820D /* ScPlayer.hpp */; }; + F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1868,6 +1871,9 @@ C30388F4F6D34DF59EF7072C /* ScLitter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScLitter.hpp; path = src/openrct2/scripting/bindings/entity/ScLitter.hpp; sourceTree = SOURCE_ROOT; }; DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayerGroup.cpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp; sourceTree = SOURCE_ROOT; }; 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayerGroup.hpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp; sourceTree = SOURCE_ROOT; }; + E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayer.cpp; path = src/openrct2/scripting/bindings/network/ScPlayer.cpp; sourceTree = SOURCE_ROOT; }; + 7A08C451885D4D419FB4820D /* ScPlayer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayer.hpp; path = src/openrct2/scripting/bindings/network/ScPlayer.hpp; sourceTree = SOURCE_ROOT; }; + 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScNetwork.cpp; path = src/openrct2/scripting/bindings/network/ScNetwork.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3413,6 +3419,9 @@ D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */, DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */, 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */, + E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */, + 7A08C451885D4D419FB4820D /* ScPlayer.hpp */, + 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */, ); name = network; sourceTree = ""; @@ -3595,6 +3604,7 @@ 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */, 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */, 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */, + 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4405,6 +4415,8 @@ 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */, 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */, 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */, + E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */, + F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index e4579359cc..46cd93b2e7 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -410,6 +410,7 @@ + @@ -859,6 +860,8 @@ + + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 519b031a12..8d25a6c226 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -34,6 +34,7 @@ # include "bindings/game/ScContext.hpp" # include "bindings/game/ScDisposable.hpp" # include "bindings/network/ScNetwork.hpp" +# include "bindings/network/ScPlayer.hpp" # include "bindings/network/ScPlayerGroup.hpp" # include "bindings/network/ScSocket.hpp" # include "bindings/object/ScObject.hpp" diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.cpp b/src/openrct2/scripting/bindings/network/ScNetwork.cpp new file mode 100644 index 0000000000..2ce1e7b423 --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScNetwork.cpp @@ -0,0 +1,297 @@ +/***************************************************************************** + * Copyright (c) 2014-2020 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScNetwork.hpp" + +# include "../../../Context.h" +# include "../../../actions/NetworkModifyGroupAction.h" +# include "../../../actions/PlayerKickAction.h" +# include "../../../network/NetworkAction.h" +# include "../../../network/network.h" + +namespace OpenRCT2::Scripting +{ + ScNetwork::ScNetwork(duk_context* ctx) + : _context(ctx) + { + } + + std::string ScNetwork::mode_get() const + { +# ifndef DISABLE_NETWORK + switch (network_get_mode()) + { + case NETWORK_MODE_SERVER: + return "server"; + case NETWORK_MODE_CLIENT: + return "client"; + } +# endif + return "none"; + } + + int32_t ScNetwork::numPlayers_get() const + { +# ifndef DISABLE_NETWORK + return network_get_num_players(); +# else + return 0; +# endif + } + + int32_t ScNetwork::numGroups_get() const + { +# ifndef DISABLE_NETWORK + return network_get_num_groups(); +# else + return 0; +# endif + } + + int32_t ScNetwork::defaultGroup_get() const + { +# ifndef DISABLE_NETWORK + return network_get_default_group(); +# else + return 0; +# endif + } + + void ScNetwork::defaultGroup_set(int32_t value) + { +# ifndef DISABLE_NETWORK + auto action = NetworkModifyGroupAction(ModifyGroupType::SetDefault, value); + GameActions::Execute(&action); +# endif + } + + std::vector> ScNetwork::groups_get() const + { + std::vector> groups; +# ifndef DISABLE_NETWORK + auto numGroups = network_get_num_groups(); + for (int32_t i = 0; i < numGroups; i++) + { + auto groupId = network_get_group_id(i); + groups.push_back(std::make_shared(groupId)); + } +# endif + return groups; + } + + std::vector> ScNetwork::players_get() const + { + std::vector> players; +# ifndef DISABLE_NETWORK + auto numPlayers = network_get_num_players(); + for (int32_t i = 0; i < numPlayers; i++) + { + auto playerId = network_get_player_id(i); + players.push_back(std::make_shared(playerId)); + } +# endif + return players; + } + + std::shared_ptr ScNetwork::currentPlayer_get() const + { + std::shared_ptr player; +# ifndef DISABLE_NETWORK + auto playerId = network_get_current_player_id(); + player = std::make_shared(playerId); +# endif + return player; + } + + std::shared_ptr ScNetwork::getPlayer(int32_t index) const + { +# ifndef DISABLE_NETWORK + auto numPlayers = network_get_num_players(); + if (index < numPlayers) + { + auto playerId = network_get_player_id(index); + return std::make_shared(playerId); + } +# endif + return nullptr; + } + + DukValue ScNetwork::stats_get() const + { +# ifndef DISABLE_NETWORK + auto obj = OpenRCT2::Scripting::DukObject(_context); + auto networkStats = network_get_stats(); + { + duk_push_array(_context); + duk_uarridx_t index = 0; + for (auto v : networkStats.bytesReceived) + { + duk_push_number(_context, v); + duk_put_prop_index(_context, -2, index); + index++; + } + obj.Set("bytesReceived", DukValue::take_from_stack(_context)); + } + { + duk_push_array(_context); + duk_uarridx_t index = 0; + for (auto v : networkStats.bytesSent) + { + duk_push_number(_context, v); + duk_put_prop_index(_context, -2, index); + index++; + } + obj.Set("bytesSent", DukValue::take_from_stack(_context)); + } + return obj.Take(); +# else + return ToDuk(_context, nullptr); +# endif + } + + std::shared_ptr ScNetwork::getGroup(int32_t index) const + { +# ifndef DISABLE_NETWORK + auto numGroups = network_get_num_groups(); + if (index < numGroups) + { + auto groupId = network_get_group_id(index); + return std::make_shared(groupId); + } +# endif + return nullptr; + } + + void ScNetwork::addGroup() + { +# ifndef DISABLE_NETWORK + auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::AddGroup); + GameActions::Execute(&networkModifyGroup); +# endif + } + + void ScNetwork::removeGroup(int32_t index) + { +# ifndef DISABLE_NETWORK + auto numGroups = network_get_num_groups(); + if (index < numGroups) + { + auto groupId = network_get_group_id(index); + auto networkAction = NetworkModifyGroupAction(ModifyGroupType::RemoveGroup, groupId); + GameActions::Execute(&networkAction); + } +# endif + } + + void ScNetwork::kickPlayer(int32_t index) + { +# ifndef DISABLE_NETWORK + auto numPlayers = network_get_num_players(); + if (index < numPlayers) + { + auto playerId = network_get_player_id(index); + auto kickPlayerAction = PlayerKickAction(playerId); + GameActions::Execute(&kickPlayerAction); + } +# endif + } + + void ScNetwork::sendMessage(std::string message, DukValue players) + { +# ifndef DISABLE_NETWORK + if (players.is_array()) + { + if (network_get_mode() == NETWORK_MODE_SERVER) + { + std::vector playerIds; + auto playerArray = players.as_array(); + for (const auto& item : playerArray) + { + if (item.type() == DukValue::Type::NUMBER) + { + playerIds.push_back(static_cast(item.as_int())); + } + } + if (!playerArray.empty()) + { + network_send_chat(message.c_str(), playerIds); + } + } + else + { + duk_error(players.context(), DUK_ERR_ERROR, "Only servers can send private messages."); + } + } + else + { + network_send_chat(message.c_str()); + } +# endif + } + +# ifndef DISABLE_NETWORK + std::shared_ptr ScNetwork::createListener() + { + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto plugin = scriptEngine.GetExecInfo().GetCurrentPlugin(); + auto socket = std::make_shared(plugin); + scriptEngine.AddSocket(socket); + return socket; + } +# else + void ScNetwork::createListener() + { + duk_error(_context, DUK_ERR_ERROR, "Networking has been disabled."); + } +# endif + +# ifndef DISABLE_NETWORK + std::shared_ptr ScNetwork::createSocket() + { + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto plugin = scriptEngine.GetExecInfo().GetCurrentPlugin(); + auto socket = std::make_shared(plugin); + scriptEngine.AddSocket(socket); + return socket; + } +# else + void ScNetwork::createSocket() + { + duk_error(_context, DUK_ERR_ERROR, "Networking has been disabled."); + } +# endif + + void ScNetwork::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScNetwork::mode_get, nullptr, "mode"); + dukglue_register_property(ctx, &ScNetwork::numGroups_get, nullptr, "numGroups"); + dukglue_register_property(ctx, &ScNetwork::numPlayers_get, nullptr, "numPlayers"); + dukglue_register_property(ctx, &ScNetwork::groups_get, nullptr, "groups"); + dukglue_register_property(ctx, &ScNetwork::players_get, nullptr, "players"); + dukglue_register_property(ctx, &ScNetwork::currentPlayer_get, nullptr, "currentPlayer"); + dukglue_register_property(ctx, &ScNetwork::defaultGroup_get, &ScNetwork::defaultGroup_set, "defaultGroup"); + dukglue_register_property(ctx, &ScNetwork::stats_get, nullptr, "stats"); + dukglue_register_method(ctx, &ScNetwork::addGroup, "addGroup"); + dukglue_register_method(ctx, &ScNetwork::getGroup, "getGroup"); + dukglue_register_method(ctx, &ScNetwork::removeGroup, "removeGroup"); + dukglue_register_method(ctx, &ScNetwork::getPlayer, "getPlayer"); + dukglue_register_method(ctx, &ScNetwork::kickPlayer, "kickPlayer"); + dukglue_register_method(ctx, &ScNetwork::sendMessage, "sendMessage"); + + dukglue_register_method(ctx, &ScNetwork::createListener, "createListener"); + dukglue_register_method(ctx, &ScNetwork::createSocket, "createSocket"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.hpp b/src/openrct2/scripting/bindings/network/ScNetwork.hpp index 15073ba207..e659b110d5 100644 --- a/src/openrct2/scripting/bindings/network/ScNetwork.hpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.hpp @@ -11,124 +11,13 @@ #ifdef ENABLE_SCRIPTING -# include "../../../Context.h" -# include "../../../actions/NetworkModifyGroupAction.h" -# include "../../../actions/PlayerKickAction.h" -# include "../../../actions/PlayerSetGroupAction.h" -# include "../../../network/NetworkAction.h" -# include "../../../network/network.h" # include "../../Duktape.hpp" -# include "../network/ScSocket.hpp" +# include "ScPlayer.hpp" # include "ScPlayerGroup.hpp" +# include "ScSocket.hpp" namespace OpenRCT2::Scripting { - class ScPlayer - { - private: - int32_t _id; - - public: - ScPlayer(int32_t id) - : _id(id) - { - } - - int32_t id_get() const - { - return _id; - } - - std::string name_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_player_index(_id); - if (index == -1) - return {}; - return network_get_player_name(index); -# else - return {}; -# endif - } - - int32_t group_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_player_index(_id); - if (index == -1) - return {}; - return network_get_player_group(index); -# else - return 0; -# endif - } - void group_set(int32_t value) - { -# ifndef DISABLE_NETWORK - auto playerSetGroupAction = PlayerSetGroupAction(_id, value); - GameActions::Execute(&playerSetGroupAction); -# endif - } - - int32_t ping_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_player_index(_id); - if (index == -1) - return {}; - return network_get_player_ping(index); -# else - return 0; -# endif - } - - int32_t commandsRan_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_player_index(_id); - if (index == -1) - return {}; - return network_get_player_commands_ran(index); -# else - return 0; -# endif - } - - int32_t moneySpent_get() const - { -# ifndef DISABLE_NETWORK - auto index = network_get_player_index(_id); - if (index == -1) - return {}; - return network_get_player_money_spent(index); -# else - return 0; -# endif - } - - std::string ipAddress_get() const - { - return network_get_player_ip_address(_id); - } - - std::string publicKeyHash_get() const - { - return network_get_player_public_key_hash(_id); - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScPlayer::id_get, nullptr, "id"); - dukglue_register_property(ctx, &ScPlayer::name_get, nullptr, "name"); - dukglue_register_property(ctx, &ScPlayer::group_get, &ScPlayer::group_set, "group"); - dukglue_register_property(ctx, &ScPlayer::ping_get, nullptr, "ping"); - dukglue_register_property(ctx, &ScPlayer::commandsRan_get, nullptr, "commandsRan"); - dukglue_register_property(ctx, &ScPlayer::moneySpent_get, nullptr, "moneySpent"); - dukglue_register_property(ctx, &ScPlayer::ipAddress_get, nullptr, "ipAddress"); - dukglue_register_property(ctx, &ScPlayer::publicKeyHash_get, nullptr, "publicKeyHash"); - } - }; - class ScNetwork { private: @@ -138,272 +27,47 @@ namespace OpenRCT2::Scripting duk_context* _context; public: - ScNetwork(duk_context* ctx) - : _context(ctx) - { - } + ScNetwork(duk_context* ctx); + + std::string mode_get() const; + int32_t numPlayers_get() const; + int32_t numGroups_get() const; + int32_t defaultGroup_get() const; + void defaultGroup_set(int32_t value); + + std::vector> groups_get() const; + + std::vector> players_get() const; + + std::shared_ptr currentPlayer_get() const; + + std::shared_ptr getPlayer(int32_t index) const; + + DukValue stats_get() const; + + std::shared_ptr getGroup(int32_t index) const; + + void addGroup(); + + void removeGroup(int32_t index); + + void kickPlayer(int32_t index); + + void sendMessage(std::string message, DukValue players); - std::string mode_get() const - { # ifndef DISABLE_NETWORK - switch (network_get_mode()) - { - case NETWORK_MODE_SERVER: - return "server"; - case NETWORK_MODE_CLIENT: - return "client"; - } -# endif - return "none"; - } - int32_t numPlayers_get() const - { -# ifndef DISABLE_NETWORK - return network_get_num_players(); + std::shared_ptr createListener(); # else - return 0; + void createListener(); # endif - } - int32_t numGroups_get() const - { + # ifndef DISABLE_NETWORK - return network_get_num_groups(); + std::shared_ptr createSocket(); # else - return 0; -# endif - } - int32_t defaultGroup_get() const - { -# ifndef DISABLE_NETWORK - return network_get_default_group(); -# else - return 0; -# endif - } - void defaultGroup_set(int32_t value) - { -# ifndef DISABLE_NETWORK - auto action = NetworkModifyGroupAction(ModifyGroupType::SetDefault, value); - GameActions::Execute(&action); -# endif - } - - std::vector> groups_get() const - { - std::vector> groups; -# ifndef DISABLE_NETWORK - auto numGroups = network_get_num_groups(); - for (int32_t i = 0; i < numGroups; i++) - { - auto groupId = network_get_group_id(i); - groups.push_back(std::make_shared(groupId)); - } -# endif - return groups; - } - - std::vector> players_get() const - { - std::vector> players; -# ifndef DISABLE_NETWORK - auto numPlayers = network_get_num_players(); - for (int32_t i = 0; i < numPlayers; i++) - { - auto playerId = network_get_player_id(i); - players.push_back(std::make_shared(playerId)); - } -# endif - return players; - } - - std::shared_ptr currentPlayer_get() const - { - std::shared_ptr player; -# ifndef DISABLE_NETWORK - auto playerId = network_get_current_player_id(); - player = std::make_shared(playerId); -# endif - return player; - } - - std::shared_ptr getPlayer(int32_t index) const - { -# ifndef DISABLE_NETWORK - auto numPlayers = network_get_num_players(); - if (index < numPlayers) - { - auto playerId = network_get_player_id(index); - return std::make_shared(playerId); - } -# endif - return nullptr; - } - - DukValue stats_get() const - { -# ifndef DISABLE_NETWORK - auto obj = OpenRCT2::Scripting::DukObject(_context); - auto networkStats = network_get_stats(); - { - duk_push_array(_context); - duk_uarridx_t index = 0; - for (auto v : networkStats.bytesReceived) - { - duk_push_number(_context, v); - duk_put_prop_index(_context, -2, index); - index++; - } - obj.Set("bytesReceived", DukValue::take_from_stack(_context)); - } - { - duk_push_array(_context); - duk_uarridx_t index = 0; - for (auto v : networkStats.bytesSent) - { - duk_push_number(_context, v); - duk_put_prop_index(_context, -2, index); - index++; - } - obj.Set("bytesSent", DukValue::take_from_stack(_context)); - } - return obj.Take(); -# else - return ToDuk(_context, nullptr); -# endif - } - - std::shared_ptr getGroup(int32_t index) const - { -# ifndef DISABLE_NETWORK - auto numGroups = network_get_num_groups(); - if (index < numGroups) - { - auto groupId = network_get_group_id(index); - return std::make_shared(groupId); - } -# endif - return nullptr; - } - - void addGroup() - { -# ifndef DISABLE_NETWORK - auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::AddGroup); - GameActions::Execute(&networkModifyGroup); -# endif - } - - void removeGroup(int32_t index) - { -# ifndef DISABLE_NETWORK - auto numGroups = network_get_num_groups(); - if (index < numGroups) - { - auto groupId = network_get_group_id(index); - auto networkAction = NetworkModifyGroupAction(ModifyGroupType::RemoveGroup, groupId); - GameActions::Execute(&networkAction); - } -# endif - } - - void kickPlayer(int32_t index) - { -# ifndef DISABLE_NETWORK - auto numPlayers = network_get_num_players(); - if (index < numPlayers) - { - auto playerId = network_get_player_id(index); - auto kickPlayerAction = PlayerKickAction(playerId); - GameActions::Execute(&kickPlayerAction); - } -# endif - } - - void sendMessage(std::string message, DukValue players) - { -# ifndef DISABLE_NETWORK - if (players.is_array()) - { - if (network_get_mode() == NETWORK_MODE_SERVER) - { - std::vector playerIds; - auto playerArray = players.as_array(); - for (const auto& item : playerArray) - { - if (item.type() == DukValue::Type::NUMBER) - { - playerIds.push_back(static_cast(item.as_int())); - } - } - if (!playerArray.empty()) - { - network_send_chat(message.c_str(), playerIds); - } - } - else - { - duk_error(players.context(), DUK_ERR_ERROR, "Only servers can send private messages."); - } - } - else - { - network_send_chat(message.c_str()); - } -# endif - } - -# ifndef DISABLE_NETWORK - std::shared_ptr createListener() - { - auto& scriptEngine = GetContext()->GetScriptEngine(); - auto plugin = scriptEngine.GetExecInfo().GetCurrentPlugin(); - auto socket = std::make_shared(plugin); - scriptEngine.AddSocket(socket); - return socket; - } -# else - void createListener() - { - duk_error(_context, DUK_ERR_ERROR, "Networking has been disabled."); - } + void createSocket(); # endif -# ifndef DISABLE_NETWORK - std::shared_ptr createSocket() - { - auto& scriptEngine = GetContext()->GetScriptEngine(); - auto plugin = scriptEngine.GetExecInfo().GetCurrentPlugin(); - auto socket = std::make_shared(plugin); - scriptEngine.AddSocket(socket); - return socket; - } -# else - void createSocket() - { - duk_error(_context, DUK_ERR_ERROR, "Networking has been disabled."); - } -# endif - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScNetwork::mode_get, nullptr, "mode"); - dukglue_register_property(ctx, &ScNetwork::numGroups_get, nullptr, "numGroups"); - dukglue_register_property(ctx, &ScNetwork::numPlayers_get, nullptr, "numPlayers"); - dukglue_register_property(ctx, &ScNetwork::groups_get, nullptr, "groups"); - dukglue_register_property(ctx, &ScNetwork::players_get, nullptr, "players"); - dukglue_register_property(ctx, &ScNetwork::currentPlayer_get, nullptr, "currentPlayer"); - dukglue_register_property(ctx, &ScNetwork::defaultGroup_get, &ScNetwork::defaultGroup_set, "defaultGroup"); - dukglue_register_property(ctx, &ScNetwork::stats_get, nullptr, "stats"); - dukglue_register_method(ctx, &ScNetwork::addGroup, "addGroup"); - dukglue_register_method(ctx, &ScNetwork::getGroup, "getGroup"); - dukglue_register_method(ctx, &ScNetwork::removeGroup, "removeGroup"); - dukglue_register_method(ctx, &ScNetwork::getPlayer, "getPlayer"); - dukglue_register_method(ctx, &ScNetwork::kickPlayer, "kickPlayer"); - dukglue_register_method(ctx, &ScNetwork::sendMessage, "sendMessage"); - - dukglue_register_method(ctx, &ScNetwork::createListener, "createListener"); - dukglue_register_method(ctx, &ScNetwork::createSocket, "createSocket"); - } + static void Register(duk_context* ctx); }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/bindings/network/ScPlayer.cpp b/src/openrct2/scripting/bindings/network/ScPlayer.cpp new file mode 100644 index 0000000000..672358917e --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScPlayer.cpp @@ -0,0 +1,124 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScPlayer.hpp" + +# include "../../../Context.h" +# include "../../../actions/PlayerSetGroupAction.h" +# include "../../../network/NetworkAction.h" +# include "../../../network/network.h" + +namespace OpenRCT2::Scripting +{ + ScPlayer::ScPlayer(int32_t id) + : _id(id) + { + } + + int32_t ScPlayer::id_get() const + { + return _id; + } + + std::string ScPlayer::name_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_player_index(_id); + if (index == -1) + return {}; + return network_get_player_name(index); +# else + return {}; +# endif + } + + int32_t ScPlayer::group_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_player_index(_id); + if (index == -1) + return {}; + return network_get_player_group(index); +# else + return 0; +# endif + } + void ScPlayer::group_set(int32_t value) + { +# ifndef DISABLE_NETWORK + auto playerSetGroupAction = PlayerSetGroupAction(_id, value); + GameActions::Execute(&playerSetGroupAction); +# endif + } + + int32_t ScPlayer::ping_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_player_index(_id); + if (index == -1) + return {}; + return network_get_player_ping(index); +# else + return 0; +# endif + } + + int32_t ScPlayer::commandsRan_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_player_index(_id); + if (index == -1) + return {}; + return network_get_player_commands_ran(index); +# else + return 0; +# endif + } + + int32_t ScPlayer::moneySpent_get() const + { +# ifndef DISABLE_NETWORK + auto index = network_get_player_index(_id); + if (index == -1) + return {}; + return network_get_player_money_spent(index); +# else + return 0; +# endif + } + + std::string ScPlayer::ipAddress_get() const + { + return network_get_player_ip_address(_id); + } + + std::string ScPlayer::publicKeyHash_get() const + { + return network_get_player_public_key_hash(_id); + } + + void ScPlayer::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScPlayer::id_get, nullptr, "id"); + dukglue_register_property(ctx, &ScPlayer::name_get, nullptr, "name"); + dukglue_register_property(ctx, &ScPlayer::group_get, &ScPlayer::group_set, "group"); + dukglue_register_property(ctx, &ScPlayer::ping_get, nullptr, "ping"); + dukglue_register_property(ctx, &ScPlayer::commandsRan_get, nullptr, "commandsRan"); + dukglue_register_property(ctx, &ScPlayer::moneySpent_get, nullptr, "moneySpent"); + dukglue_register_property(ctx, &ScPlayer::ipAddress_get, nullptr, "ipAddress"); + dukglue_register_property(ctx, &ScPlayer::publicKeyHash_get, nullptr, "publicKeyHash"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/network/ScPlayer.hpp b/src/openrct2/scripting/bindings/network/ScPlayer.hpp new file mode 100644 index 0000000000..fec0f9de4d --- /dev/null +++ b/src/openrct2/scripting/bindings/network/ScPlayer.hpp @@ -0,0 +1,50 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../Duktape.hpp" + +# include + +namespace OpenRCT2::Scripting +{ + class ScPlayer + { + private: + int32_t _id; + + public: + ScPlayer(int32_t id); + + int32_t id_get() const; + + std::string name_get() const; + + int32_t group_get() const; + void group_set(int32_t value); + + int32_t ping_get() const; + + int32_t commandsRan_get() const; + + int32_t moneySpent_get() const; + + std::string ipAddress_get() const; + + std::string publicKeyHash_get() const; + + static void Register(duk_context* ctx); + }; + +} // namespace OpenRCT2::Scripting + +#endif From fe57dece6b8c0dd01d43eb909176da08086d0b4f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 21:20:40 +0300 Subject: [PATCH 144/681] Move ScRideStation into its own files --- OpenRCT2.xcodeproj/project.pbxproj | 8 ++ src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/ride/ScRide.hpp | 119 +-------------- .../scripting/bindings/ride/ScRideStation.cpp | 136 ++++++++++++++++++ .../scripting/bindings/ride/ScRideStation.hpp | 54 +++++++ 6 files changed, 202 insertions(+), 118 deletions(-) create mode 100644 src/openrct2/scripting/bindings/ride/ScRideStation.cpp create mode 100644 src/openrct2/scripting/bindings/ride/ScRideStation.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 0584f1857a..65b94c530f 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -786,6 +786,8 @@ E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */; }; 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 7A08C451885D4D419FB4820D /* ScPlayer.hpp */; }; F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */; }; + CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */; }; + 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1874,6 +1876,8 @@ E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayer.cpp; path = src/openrct2/scripting/bindings/network/ScPlayer.cpp; sourceTree = SOURCE_ROOT; }; 7A08C451885D4D419FB4820D /* ScPlayer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayer.hpp; path = src/openrct2/scripting/bindings/network/ScPlayer.hpp; sourceTree = SOURCE_ROOT; }; 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScNetwork.cpp; path = src/openrct2/scripting/bindings/network/ScNetwork.cpp; sourceTree = SOURCE_ROOT; }; + 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRideStation.cpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.cpp; sourceTree = SOURCE_ROOT; }; + 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRideStation.hpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3438,6 +3442,8 @@ isa = PBXGroup; children = ( AD97B712FDF7454CADC7A328 /* ScRide.hpp */, + 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */, + 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */, ); name = ride; sourceTree = ""; @@ -3605,6 +3611,7 @@ 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */, 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */, 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */, + 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4417,6 +4424,7 @@ 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */, E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */, F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */, + CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 46cd93b2e7..ca6974de07 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -412,6 +412,7 @@ + @@ -863,6 +864,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 8d25a6c226..04e11e54c8 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -39,6 +39,7 @@ # include "bindings/network/ScSocket.hpp" # include "bindings/object/ScObject.hpp" # include "bindings/ride/ScRide.hpp" +# include "bindings/ride/ScRideStation.hpp" # include "bindings/world/ScClimate.hpp" # include "bindings/world/ScDate.hpp" # include "bindings/world/ScMap.hpp" diff --git a/src/openrct2/scripting/bindings/ride/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp index fdab16479c..c8d32bb2b6 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -17,6 +17,7 @@ # include "../../Duktape.hpp" # include "../../ScriptEngine.h" # include "../object/ScObject.hpp" +# include "ScRideStation.hpp" namespace OpenRCT2::Scripting { @@ -56,124 +57,6 @@ namespace OpenRCT2::Scripting return result; } - class ScRideStation - { - private: - ride_id_t _rideId = RIDE_ID_NULL; - StationIndex _stationIndex{}; - - public: - ScRideStation(ride_id_t rideId, StationIndex stationIndex) - : _rideId(rideId) - , _stationIndex(stationIndex) - { - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScRideStation::start_get, &ScRideStation::start_set, "start"); - dukglue_register_property(ctx, &ScRideStation::length_get, &ScRideStation::length_set, "length"); - dukglue_register_property(ctx, &ScRideStation::entrance_get, &ScRideStation::entrance_set, "entrance"); - dukglue_register_property(ctx, &ScRideStation::exit_get, &ScRideStation::exit_set, "exit"); - } - - private: - DukValue start_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto station = GetRideStation(); - if (station != nullptr) - { - auto start = CoordsXYZ(station->Start, station->GetBaseZ()); - return ToDuk(ctx, start); - } - return ToDuk(ctx, nullptr); - } - - void start_set(const DukValue& value) - { - auto station = GetRideStation(); - if (station != nullptr) - { - auto start = FromDuk(value); - station->Start = { start.x, start.y }; - station->SetBaseZ(start.z); - } - } - - int32_t length_get() const - { - auto station = GetRideStation(); - if (station != nullptr) - { - return station->Length; - } - return 0; - } - - void length_set(int32_t value) - { - auto station = GetRideStation(); - if (station != nullptr) - { - station->Length = value; - } - } - - DukValue entrance_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto station = GetRideStation(); - if (station != nullptr) - { - return ToDuk(ctx, station->Entrance.ToCoordsXYZD()); - } - return ToDuk(ctx, nullptr); - } - - void entrance_set(const DukValue& value) - { - auto station = GetRideStation(); - if (station != nullptr) - { - station->Entrance = FromDuk(value); - } - } - - DukValue exit_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto station = GetRideStation(); - if (station != nullptr) - { - return ToDuk(ctx, station->Exit.ToCoordsXYZD()); - } - return ToDuk(ctx, nullptr); - } - - void exit_set(const DukValue& value) - { - auto station = GetRideStation(); - if (station != nullptr) - { - station->Exit = FromDuk(value); - } - } - - RideStation* GetRideStation() const - { - auto ride = get_ride(_rideId); - if (ride != nullptr) - { - if (_stationIndex < std::size(ride->stations)) - { - return &ride->stations[_stationIndex]; - } - } - return nullptr; - } - }; - class ScRide { private: diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp new file mode 100644 index 0000000000..7717dc724d --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp @@ -0,0 +1,136 @@ +/***************************************************************************** + * Copyright (c) 2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScRideStation.hpp" + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "../object/ScObject.hpp" + +namespace OpenRCT2::Scripting +{ + ScRideStation::ScRideStation(ride_id_t rideId, StationIndex stationIndex) + : _rideId(rideId) + , _stationIndex(stationIndex) + { + } + + void ScRideStation::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScRideStation::start_get, &ScRideStation::start_set, "start"); + dukglue_register_property(ctx, &ScRideStation::length_get, &ScRideStation::length_set, "length"); + dukglue_register_property(ctx, &ScRideStation::entrance_get, &ScRideStation::entrance_set, "entrance"); + dukglue_register_property(ctx, &ScRideStation::exit_get, &ScRideStation::exit_set, "exit"); + } + + DukValue ScRideStation::start_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto station = GetRideStation(); + if (station != nullptr) + { + auto start = CoordsXYZ(station->Start, station->GetBaseZ()); + return ToDuk(ctx, start); + } + return ToDuk(ctx, nullptr); + } + + void ScRideStation::start_set(const DukValue& value) + { + auto station = GetRideStation(); + if (station != nullptr) + { + auto start = FromDuk(value); + station->Start = { start.x, start.y }; + station->SetBaseZ(start.z); + } + } + + int32_t ScRideStation::length_get() const + { + auto station = GetRideStation(); + if (station != nullptr) + { + return station->Length; + } + return 0; + } + + void ScRideStation::length_set(int32_t value) + { + auto station = GetRideStation(); + if (station != nullptr) + { + station->Length = value; + } + } + + DukValue ScRideStation::entrance_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto station = GetRideStation(); + if (station != nullptr) + { + return ToDuk(ctx, station->Entrance.ToCoordsXYZD()); + } + return ToDuk(ctx, nullptr); + } + + void ScRideStation::entrance_set(const DukValue& value) + { + auto station = GetRideStation(); + if (station != nullptr) + { + station->Entrance = FromDuk(value); + } + } + + DukValue ScRideStation::exit_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto station = GetRideStation(); + if (station != nullptr) + { + return ToDuk(ctx, station->Exit.ToCoordsXYZD()); + } + return ToDuk(ctx, nullptr); + } + + void ScRideStation::exit_set(const DukValue& value) + { + auto station = GetRideStation(); + if (station != nullptr) + { + station->Exit = FromDuk(value); + } + } + + RideStation* ScRideStation::GetRideStation() const + { + auto ride = get_ride(_rideId); + if (ride != nullptr) + { + if (_stationIndex < std::size(ride->stations)) + { + return &ride->stations[_stationIndex]; + } + } + return nullptr; + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.hpp b/src/openrct2/scripting/bindings/ride/ScRideStation.hpp new file mode 100644 index 0000000000..7b8c1804b9 --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.hpp @@ -0,0 +1,54 @@ +/***************************************************************************** + * Copyright (c) 2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../Duktape.hpp" + +namespace OpenRCT2::Scripting +{ + class ScRideStation + { + private: + ride_id_t _rideId = RIDE_ID_NULL; + StationIndex _stationIndex{}; + + public: + ScRideStation(ride_id_t rideId, StationIndex stationIndex); + + static void Register(duk_context* ctx); + + private: + DukValue start_get() const; + + void start_set(const DukValue& value); + + int32_t length_get() const; + + void length_set(int32_t value); + + DukValue entrance_get() const; + + void entrance_set(const DukValue& value); + + DukValue exit_get() const; + + void exit_set(const DukValue& value); + + RideStation* GetRideStation() const; + }; + +} // namespace OpenRCT2::Scripting + +#endif From 2bd348c39e5d7a169afbc12713c347dd9ffa2953 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 21:27:16 +0300 Subject: [PATCH 145/681] Move ScRide into a cpp file --- OpenRCT2.xcodeproj/project.pbxproj | 4 + src/openrct2/libopenrct2.vcxproj | 1 + .../scripting/bindings/ride/ScRide.cpp | 532 ++++++++++++++++++ .../scripting/bindings/ride/ScRide.hpp | 517 ++--------------- 4 files changed, 589 insertions(+), 465 deletions(-) create mode 100644 src/openrct2/scripting/bindings/ride/ScRide.cpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 65b94c530f..4c50996ea1 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -788,6 +788,7 @@ F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */; }; CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */; }; 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */; }; + 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3B00C9900ED42AFA72764ED /* ScRide.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1878,6 +1879,7 @@ 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScNetwork.cpp; path = src/openrct2/scripting/bindings/network/ScNetwork.cpp; sourceTree = SOURCE_ROOT; }; 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRideStation.cpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.cpp; sourceTree = SOURCE_ROOT; }; 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRideStation.hpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.hpp; sourceTree = SOURCE_ROOT; }; + F3B00C9900ED42AFA72764ED /* ScRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRide.cpp; path = src/openrct2/scripting/bindings/ride/ScRide.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3444,6 +3446,7 @@ AD97B712FDF7454CADC7A328 /* ScRide.hpp */, 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */, 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */, + F3B00C9900ED42AFA72764ED /* ScRide.cpp */, ); name = ride; sourceTree = ""; @@ -4425,6 +4428,7 @@ E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */, F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */, CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */, + 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index ca6974de07..50f78fc5f2 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -864,6 +864,7 @@ + diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp new file mode 100644 index 0000000000..ca90098dd5 --- /dev/null +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -0,0 +1,532 @@ +/***************************************************************************** + * Copyright (c) 2020 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 + +#ifdef ENABLE_SCRIPTING + +# include "ScRide.hpp" + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "../object/ScObject.hpp" + +namespace OpenRCT2::Scripting +{ + ScRide::ScRide(ride_id_t rideId) + : _rideId(rideId) + { + } + + int32_t ScRide::id_get() const + { + return _rideId; + } + + std::shared_ptr ScRide::object_get() + { + auto ride = GetRide(); + if (ride != nullptr) + { + auto rideObject = GetContext()->GetObjectManager().GetLoadedObject(ObjectType::Ride, ride->subtype); + if (rideObject != nullptr) + { + return std::make_shared(ObjectType::Ride, ride->subtype); + } + } + return nullptr; + } + + int32_t ScRide::type_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->type : 0; + } + + std::string ScRide::classification_get() const + { + auto ride = GetRide(); + if (ride != nullptr) + { + switch (ride->GetClassification()) + { + case RideClassification::Ride: + return "ride"; + case RideClassification::ShopOrStall: + return "stall"; + case RideClassification::KioskOrFacility: + return "facility"; + } + } + return ""; + } + + std::string ScRide::name_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->GetName() : std::string(); + } + void ScRide::name_set(std::string value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->custom_name = value; + } + } + + std::string ScRide::status_get() const + { + auto ride = GetRide(); + if (ride != nullptr) + { + switch (ride->status) + { + case RideStatus::Closed: + return "closed"; + case RideStatus::Open: + return "open"; + case RideStatus::Testing: + return "testing"; + case RideStatus::Simulating: + return "simulating"; + case RideStatus::Count: // Meaningless but necessary to satisfy -Wswitch + return "count"; + } + } + return ""; + } + + uint32_t ScRide::lifecycleFlags_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->lifecycle_flags : 0; + } + + void ScRide::lifecycleFlags_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->lifecycle_flags = value; + } + } + + uint8_t ScRide::mode_get() const + { + auto ride = GetRide(); + return ride != nullptr ? static_cast(ride->mode) : 0; + } + + void ScRide::mode_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->mode = static_cast(value); + } + } + + uint8_t ScRide::departFlags_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->depart_flags : 0; + } + + void ScRide::departFlags_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->depart_flags = value; + } + } + + uint8_t ScRide::minimumWaitingTime_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->min_waiting_time : 0; + } + + void ScRide::minimumWaitingTime_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->min_waiting_time = value; + } + } + + uint8_t ScRide::maximumWaitingTime_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->max_waiting_time : 0; + } + + void ScRide::maximumWaitingTime_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->max_waiting_time = value; + } + } + + std::vector ScRide::vehicles_get() const + { + std::vector result; + auto ride = GetRide(); + if (ride != nullptr) + { + result.insert(result.begin(), std::begin(ride->vehicles), std::begin(ride->vehicles) + ride->num_vehicles); + } + return result; + } + + std::vector ScRide::vehicleColours_get() const + { + std::vector result; + auto ride = GetRide(); + if (ride != nullptr) + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + for (const auto& vehicleColour : ride->vehicle_colours) + { + result.push_back(ToDuk(ctx, vehicleColour)); + } + } + return result; + } + + void ScRide::vehicleColours_set(const std::vector& value) + { + auto ride = GetRide(); + if (ride != nullptr) + { + auto count = std::min(value.size(), std::size(ride->vehicle_colours)); + for (size_t i = 0; i < count; i++) + { + ride->vehicle_colours[i] = FromDuk(value[i]); + } + } + } + + std::vector ScRide::colourSchemes_get() const + { + std::vector result; + auto ride = GetRide(); + if (ride != nullptr) + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + for (const auto& trackColour : ride->track_colour) + { + result.push_back(ToDuk(ctx, trackColour)); + } + } + return result; + } + + void ScRide::colourSchemes_set(const std::vector& value) + { + auto ride = GetRide(); + if (ride != nullptr) + { + auto count = std::min(value.size(), std::size(ride->track_colour)); + for (size_t i = 0; i < count; i++) + { + ride->track_colour[i] = FromDuk(value[i]); + } + } + } + + uint8_t ScRide::stationStyle_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->entrance_style : 0; + } + + void ScRide::stationStyle_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->entrance_style = value; + } + } + + uint8_t ScRide::music_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->music : 0; + } + + void ScRide::music_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->music = value; + } + } + + std::vector> ScRide::stations_get() const + { + std::vector> result; + auto ride = GetRide(); + if (ride != nullptr) + { + for (size_t i = 0; i < std::size(ride->stations); i++) + { + result.push_back(std::make_shared(ride->id, static_cast(i))); + } + } + return result; + } + + std::vector ScRide::price_get() const + { + std::vector result; + auto ride = GetRide(); + if (ride != nullptr) + { + auto numPrices = ride->GetNumPrices(); + for (size_t i = 0; i < numPrices; i++) + { + result.push_back(ride->price[i]); + }; + } + return result; + } + + void ScRide::price_set(const std::vector& value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + auto numPrices = std::min(value.size(), ride->GetNumPrices()); + for (size_t i = 0; i < numPrices; i++) + { + ride->price[i] = static_cast(value[i]); + } + } + } + + int32_t ScRide::excitement_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->excitement : 0; + } + void ScRide::excitement_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->excitement = value; + } + } + + int32_t ScRide::intensity_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->intensity : 0; + } + void ScRide::intensity_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->intensity = value; + } + } + + int32_t ScRide::nausea_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->nausea : 0; + } + void ScRide::nausea_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->nausea = value; + } + } + + int32_t ScRide::totalCustomers_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->total_customers : 0; + } + void ScRide::totalCustomers_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->total_customers = value; + } + } + + int32_t ScRide::buildDate_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->build_date : 0; + } + void ScRide::buildDate_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->build_date = value; + } + } + + int32_t ScRide::age_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->GetAge() : 0; + } + + int16_t ScRide::runningCost_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->upkeep_cost : 0; + } + void ScRide::runningCost_set(int16_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->upkeep_cost = value; + } + } + + int32_t ScRide::totalProfit_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->total_profit : 0; + } + void ScRide::totalProfit_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->total_profit = value; + } + } + + uint8_t ScRide::inspectionInterval_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->inspection_interval : 0; + } + void ScRide::inspectionInterval_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + ride->inspection_interval = std::clamp(value, RIDE_INSPECTION_EVERY_10_MINUTES, RIDE_INSPECTION_NEVER); + } + } + + DukValue ScRide::value_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto ride = GetRide(); + if (ride != nullptr && ride->value != RIDE_VALUE_UNDEFINED) + { + return ToDuk(ctx, ride->value); + } + return ToDuk(ctx, nullptr); + } + + void ScRide::value_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto ride = GetRide(); + if (ride != nullptr) + { + if (value.type() == DukValue::Type::NUMBER) + { + ride->value = value.as_int(); + } + else + { + ride->value = RIDE_VALUE_UNDEFINED; + } + } + } + + Ride* ScRide::GetRide() const + { + return get_ride(_rideId); + } + + uint8_t ScRide::downtime_get() const + { + auto ride = GetRide(); + return ride != nullptr ? ride->downtime : 0; + } + + void ScRide::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScRide::id_get, nullptr, "id"); + dukglue_register_property(ctx, &ScRide::object_get, nullptr, "object"); + dukglue_register_property(ctx, &ScRide::type_get, nullptr, "type"); + dukglue_register_property(ctx, &ScRide::classification_get, nullptr, "classification"); + dukglue_register_property(ctx, &ScRide::name_get, &ScRide::name_set, "name"); + dukglue_register_property(ctx, &ScRide::status_get, nullptr, "status"); + dukglue_register_property(ctx, &ScRide::lifecycleFlags_get, &ScRide::lifecycleFlags_set, "lifecycleFlags"); + dukglue_register_property(ctx, &ScRide::mode_get, &ScRide::mode_set, "mode"); + dukglue_register_property(ctx, &ScRide::departFlags_get, &ScRide::departFlags_set, "departFlags"); + dukglue_register_property(ctx, &ScRide::minimumWaitingTime_get, &ScRide::minimumWaitingTime_set, "minimumWaitingTime"); + dukglue_register_property(ctx, &ScRide::maximumWaitingTime_get, &ScRide::maximumWaitingTime_set, "maximumWaitingTime"); + dukglue_register_property(ctx, &ScRide::vehicles_get, nullptr, "vehicles"); + dukglue_register_property(ctx, &ScRide::vehicleColours_get, &ScRide::vehicleColours_set, "vehicleColours"); + dukglue_register_property(ctx, &ScRide::colourSchemes_get, &ScRide::colourSchemes_set, "colourSchemes"); + dukglue_register_property(ctx, &ScRide::stationStyle_get, &ScRide::stationStyle_set, "stationStyle"); + dukglue_register_property(ctx, &ScRide::music_get, &ScRide::music_set, "music"); + dukglue_register_property(ctx, &ScRide::stations_get, nullptr, "stations"); + dukglue_register_property(ctx, &ScRide::price_get, &ScRide::price_set, "price"); + dukglue_register_property(ctx, &ScRide::excitement_get, &ScRide::excitement_set, "excitement"); + dukglue_register_property(ctx, &ScRide::intensity_get, &ScRide::intensity_set, "intensity"); + dukglue_register_property(ctx, &ScRide::nausea_get, &ScRide::nausea_set, "nausea"); + dukglue_register_property(ctx, &ScRide::totalCustomers_get, &ScRide::totalCustomers_set, "totalCustomers"); + dukglue_register_property(ctx, &ScRide::buildDate_get, &ScRide::buildDate_set, "buildDate"); + dukglue_register_property(ctx, &ScRide::age_get, nullptr, "age"); + dukglue_register_property(ctx, &ScRide::runningCost_get, &ScRide::runningCost_set, "runningCost"); + dukglue_register_property(ctx, &ScRide::totalProfit_get, &ScRide::totalProfit_set, "totalProfit"); + dukglue_register_property(ctx, &ScRide::inspectionInterval_get, &ScRide::inspectionInterval_set, "inspectionInterval"); + dukglue_register_property(ctx, &ScRide::value_get, &ScRide::value_set, "value"); + dukglue_register_property(ctx, &ScRide::downtime_get, nullptr, "downtime"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/ride/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp index c8d32bb2b6..4b05584f3c 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -63,515 +63,102 @@ namespace OpenRCT2::Scripting ride_id_t _rideId = RIDE_ID_NULL; public: - ScRide(ride_id_t rideId) - : _rideId(rideId) - { - } + ScRide(ride_id_t rideId); private: - int32_t id_get() const - { - return _rideId; - } + int32_t id_get() const; - std::shared_ptr object_get() - { - auto ride = GetRide(); - if (ride != nullptr) - { - auto rideObject = GetContext()->GetObjectManager().GetLoadedObject(ObjectType::Ride, ride->subtype); - if (rideObject != nullptr) - { - return std::make_shared(ObjectType::Ride, ride->subtype); - } - } - return nullptr; - } + std::shared_ptr object_get(); - int32_t type_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->type : 0; - } + int32_t type_get() const; - std::string classification_get() const - { - auto ride = GetRide(); - if (ride != nullptr) - { - switch (ride->GetClassification()) - { - case RideClassification::Ride: - return "ride"; - case RideClassification::ShopOrStall: - return "stall"; - case RideClassification::KioskOrFacility: - return "facility"; - } - } - return ""; - } + std::string classification_get() const; - std::string name_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->GetName() : std::string(); - } - void name_set(std::string value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->custom_name = value; - } - } + std::string name_get() const; + void name_set(std::string value); - std::string status_get() const - { - auto ride = GetRide(); - if (ride != nullptr) - { - switch (ride->status) - { - case RideStatus::Closed: - return "closed"; - case RideStatus::Open: - return "open"; - case RideStatus::Testing: - return "testing"; - case RideStatus::Simulating: - return "simulating"; - case RideStatus::Count: // Meaningless but necessary to satisfy -Wswitch - return "count"; - } - } - return ""; - } + std::string status_get() const; - uint32_t lifecycleFlags_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->lifecycle_flags : 0; - } + uint32_t lifecycleFlags_get() const; - void lifecycleFlags_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->lifecycle_flags = value; - } - } + void lifecycleFlags_set(uint32_t value); - uint8_t mode_get() const - { - auto ride = GetRide(); - return ride != nullptr ? static_cast(ride->mode) : 0; - } + uint8_t mode_get() const; - void mode_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->mode = static_cast(value); - } - } + void mode_set(uint8_t value); - uint8_t departFlags_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->depart_flags : 0; - } + uint8_t departFlags_get() const; - void departFlags_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->depart_flags = value; - } - } + void departFlags_set(uint8_t value); - uint8_t minimumWaitingTime_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->min_waiting_time : 0; - } + uint8_t minimumWaitingTime_get() const; - void minimumWaitingTime_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->min_waiting_time = value; - } - } + void minimumWaitingTime_set(uint8_t value); - uint8_t maximumWaitingTime_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->max_waiting_time : 0; - } + uint8_t maximumWaitingTime_get() const; - void maximumWaitingTime_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->max_waiting_time = value; - } - } + void maximumWaitingTime_set(uint8_t value); - std::vector vehicles_get() const - { - std::vector result; - auto ride = GetRide(); - if (ride != nullptr) - { - result.insert(result.begin(), std::begin(ride->vehicles), std::begin(ride->vehicles) + ride->num_vehicles); - } - return result; - } + std::vector vehicles_get() const; - std::vector vehicleColours_get() const - { - std::vector result; - auto ride = GetRide(); - if (ride != nullptr) - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - for (const auto& vehicleColour : ride->vehicle_colours) - { - result.push_back(ToDuk(ctx, vehicleColour)); - } - } - return result; - } + std::vector vehicleColours_get() const; - void vehicleColours_set(const std::vector& value) - { - auto ride = GetRide(); - if (ride != nullptr) - { - auto count = std::min(value.size(), std::size(ride->vehicle_colours)); - for (size_t i = 0; i < count; i++) - { - ride->vehicle_colours[i] = FromDuk(value[i]); - } - } - } + void vehicleColours_set(const std::vector& value); - std::vector colourSchemes_get() const - { - std::vector result; - auto ride = GetRide(); - if (ride != nullptr) - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - for (const auto& trackColour : ride->track_colour) - { - result.push_back(ToDuk(ctx, trackColour)); - } - } - return result; - } + std::vector colourSchemes_get() const; - void colourSchemes_set(const std::vector& value) - { - auto ride = GetRide(); - if (ride != nullptr) - { - auto count = std::min(value.size(), std::size(ride->track_colour)); - for (size_t i = 0; i < count; i++) - { - ride->track_colour[i] = FromDuk(value[i]); - } - } - } + void colourSchemes_set(const std::vector& value); - uint8_t stationStyle_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->entrance_style : 0; - } + uint8_t stationStyle_get() const; - void stationStyle_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->entrance_style = value; - } - } + void stationStyle_set(uint8_t value); - uint8_t music_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->music : 0; - } + uint8_t music_get() const; - void music_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->music = value; - } - } + void music_set(uint8_t value); - std::vector> stations_get() const - { - std::vector> result; - auto ride = GetRide(); - if (ride != nullptr) - { - for (size_t i = 0; i < std::size(ride->stations); i++) - { - result.push_back(std::make_shared(ride->id, static_cast(i))); - } - } - return result; - } + std::vector> stations_get() const; - std::vector price_get() const - { - std::vector result; - auto ride = GetRide(); - if (ride != nullptr) - { - auto numPrices = ride->GetNumPrices(); - for (size_t i = 0; i < numPrices; i++) - { - result.push_back(ride->price[i]); - }; - } - return result; - } + std::vector price_get() const; - void price_set(const std::vector& value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - auto numPrices = std::min(value.size(), ride->GetNumPrices()); - for (size_t i = 0; i < numPrices; i++) - { - ride->price[i] = static_cast(value[i]); - } - } - } + void price_set(const std::vector& value); - int32_t excitement_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->excitement : 0; - } - void excitement_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->excitement = value; - } - } + int32_t excitement_get() const; + void excitement_set(int32_t value); - int32_t intensity_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->intensity : 0; - } - void intensity_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->intensity = value; - } - } + int32_t intensity_get() const; + void intensity_set(int32_t value); - int32_t nausea_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->nausea : 0; - } - void nausea_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->nausea = value; - } - } + int32_t nausea_get() const; + void nausea_set(int32_t value); - int32_t totalCustomers_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->total_customers : 0; - } - void totalCustomers_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->total_customers = value; - } - } + int32_t totalCustomers_get() const; + void totalCustomers_set(int32_t value); - int32_t buildDate_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->build_date : 0; - } - void buildDate_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->build_date = value; - } - } + int32_t buildDate_get() const; + void buildDate_set(int32_t value); - int32_t age_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->GetAge() : 0; - } + int32_t age_get() const; - int16_t runningCost_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->upkeep_cost : 0; - } - void runningCost_set(int16_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->upkeep_cost = value; - } - } + int16_t runningCost_get() const; + void runningCost_set(int16_t value); - int32_t totalProfit_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->total_profit : 0; - } - void totalProfit_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->total_profit = value; - } - } + int32_t totalProfit_get() const; + void totalProfit_set(int32_t value); - uint8_t inspectionInterval_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->inspection_interval : 0; - } - void inspectionInterval_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - ride->inspection_interval = std::clamp(value, RIDE_INSPECTION_EVERY_10_MINUTES, RIDE_INSPECTION_NEVER); - } - } + uint8_t inspectionInterval_get() const; + void inspectionInterval_set(uint8_t value); - DukValue value_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto ride = GetRide(); - if (ride != nullptr && ride->value != RIDE_VALUE_UNDEFINED) - { - return ToDuk(ctx, ride->value); - } - return ToDuk(ctx, nullptr); - } + DukValue value_get() const; - void value_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto ride = GetRide(); - if (ride != nullptr) - { - if (value.type() == DukValue::Type::NUMBER) - { - ride->value = value.as_int(); - } - else - { - ride->value = RIDE_VALUE_UNDEFINED; - } - } - } + void value_set(const DukValue& value); - uint8_t downtime_get() const - { - auto ride = GetRide(); - return ride != nullptr ? ride->downtime : 0; - } + uint8_t downtime_get() const; - Ride* GetRide() const - { - return get_ride(_rideId); - } + Ride* GetRide() const; public: - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScRide::id_get, nullptr, "id"); - dukglue_register_property(ctx, &ScRide::object_get, nullptr, "object"); - dukglue_register_property(ctx, &ScRide::type_get, nullptr, "type"); - dukglue_register_property(ctx, &ScRide::classification_get, nullptr, "classification"); - dukglue_register_property(ctx, &ScRide::name_get, &ScRide::name_set, "name"); - dukglue_register_property(ctx, &ScRide::status_get, nullptr, "status"); - dukglue_register_property(ctx, &ScRide::lifecycleFlags_get, &ScRide::lifecycleFlags_set, "lifecycleFlags"); - dukglue_register_property(ctx, &ScRide::mode_get, &ScRide::mode_set, "mode"); - dukglue_register_property(ctx, &ScRide::departFlags_get, &ScRide::departFlags_set, "departFlags"); - dukglue_register_property( - ctx, &ScRide::minimumWaitingTime_get, &ScRide::minimumWaitingTime_set, "minimumWaitingTime"); - dukglue_register_property( - ctx, &ScRide::maximumWaitingTime_get, &ScRide::maximumWaitingTime_set, "maximumWaitingTime"); - dukglue_register_property(ctx, &ScRide::vehicles_get, nullptr, "vehicles"); - dukglue_register_property(ctx, &ScRide::vehicleColours_get, &ScRide::vehicleColours_set, "vehicleColours"); - dukglue_register_property(ctx, &ScRide::colourSchemes_get, &ScRide::colourSchemes_set, "colourSchemes"); - dukglue_register_property(ctx, &ScRide::stationStyle_get, &ScRide::stationStyle_set, "stationStyle"); - dukglue_register_property(ctx, &ScRide::music_get, &ScRide::music_set, "music"); - dukglue_register_property(ctx, &ScRide::stations_get, nullptr, "stations"); - dukglue_register_property(ctx, &ScRide::price_get, &ScRide::price_set, "price"); - dukglue_register_property(ctx, &ScRide::excitement_get, &ScRide::excitement_set, "excitement"); - dukglue_register_property(ctx, &ScRide::intensity_get, &ScRide::intensity_set, "intensity"); - dukglue_register_property(ctx, &ScRide::nausea_get, &ScRide::nausea_set, "nausea"); - dukglue_register_property(ctx, &ScRide::totalCustomers_get, &ScRide::totalCustomers_set, "totalCustomers"); - dukglue_register_property(ctx, &ScRide::buildDate_get, &ScRide::buildDate_set, "buildDate"); - dukglue_register_property(ctx, &ScRide::age_get, nullptr, "age"); - dukglue_register_property(ctx, &ScRide::runningCost_get, &ScRide::runningCost_set, "runningCost"); - dukglue_register_property(ctx, &ScRide::totalProfit_get, &ScRide::totalProfit_set, "totalProfit"); - dukglue_register_property( - ctx, &ScRide::inspectionInterval_get, &ScRide::inspectionInterval_set, "inspectionInterval"); - dukglue_register_property(ctx, &ScRide::value_get, &ScRide::value_set, "value"); - dukglue_register_property(ctx, &ScRide::downtime_get, nullptr, "downtime"); - } + static void Register(duk_context* ctx); }; } // namespace OpenRCT2::Scripting From 1848dd783934077ff20749892e83e8fee46737bd Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 21:42:45 +0300 Subject: [PATCH 146/681] Remove copy paste mistake #pragma once --- src/openrct2/scripting/bindings/entity/ScGuest.cpp | 2 -- src/openrct2/scripting/bindings/entity/ScLitter.cpp | 2 -- src/openrct2/scripting/bindings/network/ScNetwork.cpp | 2 -- src/openrct2/scripting/bindings/network/ScPlayer.cpp | 2 -- src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp | 2 -- src/openrct2/scripting/bindings/ride/ScRide.cpp | 2 -- src/openrct2/scripting/bindings/ride/ScRideStation.cpp | 2 -- 7 files changed, 14 deletions(-) diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index e0e20d4f4d..ea85c8efa6 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScGuest.hpp" diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index 1163666230..df59a9b7fe 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScLitter.hpp" diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.cpp b/src/openrct2/scripting/bindings/network/ScNetwork.cpp index 2ce1e7b423..7b10801034 100644 --- a/src/openrct2/scripting/bindings/network/ScNetwork.cpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScNetwork.hpp" diff --git a/src/openrct2/scripting/bindings/network/ScPlayer.cpp b/src/openrct2/scripting/bindings/network/ScPlayer.cpp index 672358917e..86fd493ba6 100644 --- a/src/openrct2/scripting/bindings/network/ScPlayer.cpp +++ b/src/openrct2/scripting/bindings/network/ScPlayer.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScPlayer.hpp" diff --git a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp index 9c6f5a399d..0839bebe50 100644 --- a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp +++ b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScPlayerGroup.hpp" diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp index ca90098dd5..9e81db6ce2 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScRide.hpp" diff --git a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp index 7717dc724d..1168d96060 100644 --- a/src/openrct2/scripting/bindings/ride/ScRideStation.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRideStation.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#pragma once - #ifdef ENABLE_SCRIPTING # include "ScRideStation.hpp" From 53c5519cb3c2f0941dce05a9aa88a2a77ea725f0 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 9 Aug 2021 22:22:01 +0300 Subject: [PATCH 147/681] Fix missing include and guard functions with network macro --- .../scripting/bindings/game/ScCheats.hpp | 2 +- .../bindings/network/ScPlayerGroup.cpp | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/openrct2/scripting/bindings/game/ScCheats.hpp b/src/openrct2/scripting/bindings/game/ScCheats.hpp index 740a13c085..6c56554417 100644 --- a/src/openrct2/scripting/bindings/game/ScCheats.hpp +++ b/src/openrct2/scripting/bindings/game/ScCheats.hpp @@ -12,8 +12,8 @@ #ifdef ENABLE_SCRIPTING # include "../../../Cheats.h" +# include "../../Duktape.hpp" # include "../../ScriptEngine.h" -# include "Duktape.hpp" namespace OpenRCT2::Scripting { diff --git a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp index 0839bebe50..697712f5ba 100644 --- a/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp +++ b/src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp @@ -50,6 +50,7 @@ namespace OpenRCT2::Scripting # endif } +# ifndef DISABLE_NETWORK static std::string TransformPermissionKeyToJS(const std::string& s) { auto result = s.substr(sizeof("PERMISSION_") - 1); @@ -60,6 +61,17 @@ namespace OpenRCT2::Scripting return result; } + static std::string TransformPermissionKeyToInternal(const std::string& s) + { + auto result = "PERMISSION_" + s; + for (auto& c : result) + { + c = std::toupper(c); + } + return result; + } +# endif + std::vector ScPlayerGroup::permissions_get() const { # ifndef DISABLE_NETWORK @@ -84,16 +96,6 @@ namespace OpenRCT2::Scripting # endif } - static std::string TransformPermissionKeyToInternal(const std::string& s) - { - auto result = "PERMISSION_" + s; - for (auto& c : result) - { - c = std::toupper(c); - } - return result; - } - void ScPlayerGroup::permissions_set(std::vector value) { # ifndef DISABLE_NETWORK From 437321ac8f6c1b6bb116de2c099cba862ccc821a Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 15:05:50 +0300 Subject: [PATCH 148/681] Move ScMap code into cpp --- OpenRCT2.xcodeproj/project.pbxproj | 4 + src/openrct2/libopenrct2.vcxproj | 1 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/world/ScMap.cpp | 273 ++++++++++++++++++ .../scripting/bindings/world/ScMap.hpp | 251 +--------------- 5 files changed, 293 insertions(+), 237 deletions(-) create mode 100644 src/openrct2/scripting/bindings/world/ScMap.cpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 4c50996ea1..c9a57f561b 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -789,6 +789,7 @@ CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */; }; 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */; }; 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3B00C9900ED42AFA72764ED /* ScRide.cpp */; }; + 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BE60702D7549488A32CC0B /* ScMap.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1880,6 +1881,7 @@ 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRideStation.cpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.cpp; sourceTree = SOURCE_ROOT; }; 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRideStation.hpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.hpp; sourceTree = SOURCE_ROOT; }; F3B00C9900ED42AFA72764ED /* ScRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRide.cpp; path = src/openrct2/scripting/bindings/ride/ScRide.cpp; sourceTree = SOURCE_ROOT; }; + E4BE60702D7549488A32CC0B /* ScMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScMap.cpp; path = src/openrct2/scripting/bindings/world/ScMap.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3460,6 +3462,7 @@ 9AB8D336AB654D0280549A89 /* ScPark.hpp */, A9F55F2291284217BA0E4E51 /* ScScenario.hpp */, 22D7DD798F054A068273739B /* ScTile.hpp */, + E4BE60702D7549488A32CC0B /* ScMap.cpp */, ); name = world; sourceTree = ""; @@ -4429,6 +4432,7 @@ F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */, CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */, 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */, + 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 50f78fc5f2..4624771168 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -866,6 +866,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 04e11e54c8..5d3c8309ba 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -29,6 +29,7 @@ # include "bindings/entity/ScLitter.hpp" # include "bindings/entity/ScPeep.hpp" # include "bindings/entity/ScStaff.hpp" +# include "bindings/entity/ScVehicle.hpp" # include "bindings/game/ScCheats.hpp" # include "bindings/game/ScConsole.hpp" # include "bindings/game/ScContext.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp new file mode 100644 index 0000000000..c3e95f20fa --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -0,0 +1,273 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScMap.hpp" + +# include "../../../common.h" +# include "../../../ride/Ride.h" +# include "../../../ride/TrainManager.h" +# include "../../../world/Balloon.h" +# include "../../../world/Duck.h" +# include "../../../world/EntityList.h" +# include "../../../world/Fountain.h" +# include "../../../world/Litter.h" +# include "../../../world/Map.h" +# include "../../../world/MoneyEffect.h" +# include "../../../world/Particle.h" +# include "../../Duktape.hpp" +# include "../entity/ScEntity.hpp" +# include "../entity/ScGuest.hpp" +# include "../entity/ScLitter.hpp" +# include "../entity/ScStaff.hpp" +# include "../entity/ScVehicle.hpp" +# include "../ride/ScRide.hpp" +# include "../world/ScTile.hpp" + +namespace OpenRCT2::Scripting +{ + ScMap::ScMap(duk_context* ctx) + : _context(ctx) + { + } + + DukValue ScMap::size_get() const + { + return ToDuk(_context, CoordsXY{ gMapSize, gMapSize }); + } + + int32_t ScMap::numRides_get() const + { + return static_cast(GetRideManager().size()); + } + + int32_t ScMap::numEntities_get() const + { + return MAX_ENTITIES; + } + + std::vector> ScMap::rides_get() const + { + std::vector> result; + auto rideManager = GetRideManager(); + for (const auto& ride : rideManager) + { + result.push_back(std::make_shared(ride.id)); + } + return result; + } + + std::shared_ptr ScMap::getRide(int32_t id) const + { + auto rideManager = GetRideManager(); + auto ride = rideManager[static_cast(id)]; + if (ride != nullptr) + { + return std::make_shared(ride->id); + } + return {}; + } + + std::shared_ptr ScMap::getTile(int32_t x, int32_t y) const + { + auto coords = TileCoordsXY(x, y).ToCoordsXY(); + return std::make_shared(coords); + } + + DukValue ScMap::getEntity(int32_t id) const + { + if (id >= 0 && id < MAX_ENTITIES) + { + auto spriteId = static_cast(id); + auto sprite = GetEntity(spriteId); + if (sprite != nullptr && sprite->Type != EntityType::Null) + { + return GetEntityAsDukValue(sprite); + } + } + duk_push_null(_context); + return DukValue::take_from_stack(_context); + } + + std::vector ScMap::getAllEntities(const std::string& type) const + { + std::vector result; + if (type == "balloon") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "car") + { + for (auto trainHead : TrainManager::View()) + { + for (auto carId = trainHead->sprite_index; carId != SPRITE_INDEX_NULL;) + { + auto car = GetEntity(carId); + result.push_back(GetObjectAsDukValue(_context, std::make_shared(carId))); + carId = car->next_vehicle_on_train; + } + } + } + else if (type == "litter") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "duck") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "peep") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "guest") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else if (type == "staff") + { + for (auto sprite : EntityList()) + { + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + } + } + else + { + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); + } + + return result; + } + + template + DukValue createEntityType(duk_context* ctx, const DukValue& initializer) + { + TEntityType* entity = CreateEntity(); + + auto entityPos = CoordsXYZ{ AsOrDefault(initializer["x"], 0), AsOrDefault(initializer["y"], 0), + AsOrDefault(initializer["z"], 0) }; + entity->MoveTo(entityPos); + + return GetObjectAsDukValue(ctx, std::make_shared(entity->sprite_index)); + } + + DukValue ScMap::createEntity(const std::string& type, const DukValue& initializer) + { + if (type == "car") + { + return createEntityType(_context, initializer); + } + else if (type == "staff") + { + return createEntityType(_context, initializer); + } + else if (type == "guest") + { + return createEntityType(_context, initializer); + } + else if (type == "steam_particle") + { + return createEntityType(_context, initializer); + } + else if (type == "money_effect") + { + return createEntityType(_context, initializer); + } + else if (type == "crashed_vehicle_particle") + { + return createEntityType(_context, initializer); + } + else if (type == "explosion_cloud") + { + return createEntityType(_context, initializer); + } + else if (type == "crash_splash") + { + return createEntityType(_context, initializer); + } + else if (type == "explosion_flare") + { + return createEntityType(_context, initializer); + } + else if (type == "balloon") + { + return createEntityType(_context, initializer); + } + else if (type == "duck") + { + return createEntityType(_context, initializer); + } + else if (type == "jumping_fountain") + { + return createEntityType(_context, initializer); + } + else if (type == "litter") + { + return createEntityType(_context, initializer); + } + else + { + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); + } + } + + void ScMap::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScMap::size_get, nullptr, "size"); + dukglue_register_property(ctx, &ScMap::numRides_get, nullptr, "numRides"); + dukglue_register_property(ctx, &ScMap::numEntities_get, nullptr, "numEntities"); + dukglue_register_property(ctx, &ScMap::rides_get, nullptr, "rides"); + dukglue_register_method(ctx, &ScMap::getRide, "getRide"); + dukglue_register_method(ctx, &ScMap::getTile, "getTile"); + dukglue_register_method(ctx, &ScMap::getEntity, "getEntity"); + dukglue_register_method(ctx, &ScMap::getAllEntities, "getAllEntities"); + dukglue_register_method(ctx, &ScMap::createEntity, "createEntity"); + } + + DukValue ScMap::GetEntityAsDukValue(const SpriteBase* sprite) const + { + auto spriteId = sprite->sprite_index; + switch (sprite->Type) + { + case EntityType::Vehicle: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + case EntityType::Staff: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + case EntityType::Guest: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + case EntityType::Litter: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + default: + return GetObjectAsDukValue(_context, std::make_shared(spriteId)); + } + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScMap.hpp b/src/openrct2/scripting/bindings/world/ScMap.hpp index 461ec53c56..a2994fd04b 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.hpp +++ b/src/openrct2/scripting/bindings/world/ScMap.hpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -12,19 +12,7 @@ #ifdef ENABLE_SCRIPTING # include "../../../common.h" -# include "../../../ride/Ride.h" -# include "../../../ride/TrainManager.h" -# include "../../../world/Balloon.h" -# include "../../../world/Duck.h" -# include "../../../world/EntityList.h" -# include "../../../world/Fountain.h" -# include "../../../world/Litter.h" -# include "../../../world/Map.h" -# include "../../../world/MoneyEffect.h" -# include "../../../world/Particle.h" # include "../../Duktape.hpp" -# include "../entity/ScEntity.hpp" -# include "../entity/ScVehicle.hpp" # include "../ride/ScRide.hpp" # include "../world/ScTile.hpp" @@ -36,243 +24,32 @@ namespace OpenRCT2::Scripting duk_context* _context; public: - ScMap(duk_context* ctx) - : _context(ctx) - { - } + ScMap(duk_context* ctx); - DukValue size_get() const - { - return ToDuk(_context, CoordsXY{ gMapSize, gMapSize }); - } + DukValue size_get() const; - int32_t numRides_get() const - { - return static_cast(GetRideManager().size()); - } + int32_t numRides_get() const; - int32_t numEntities_get() const - { - return MAX_ENTITIES; - } + int32_t numEntities_get() const; - std::vector> rides_get() const - { - std::vector> result; - auto rideManager = GetRideManager(); - for (const auto& ride : rideManager) - { - result.push_back(std::make_shared(ride.id)); - } - return result; - } + std::vector> rides_get() const; - std::shared_ptr getRide(int32_t id) const - { - auto rideManager = GetRideManager(); - auto ride = rideManager[static_cast(id)]; - if (ride != nullptr) - { - return std::make_shared(ride->id); - } - return {}; - } + std::shared_ptr getRide(int32_t id) const; - std::shared_ptr getTile(int32_t x, int32_t y) const - { - auto coords = TileCoordsXY(x, y).ToCoordsXY(); - return std::make_shared(coords); - } + std::shared_ptr getTile(int32_t x, int32_t y) const; - DukValue getEntity(int32_t id) const - { - if (id >= 0 && id < MAX_ENTITIES) - { - auto spriteId = static_cast(id); - auto sprite = GetEntity(spriteId); - if (sprite != nullptr && sprite->Type != EntityType::Null) - { - return GetEntityAsDukValue(sprite); - } - } - duk_push_null(_context); - return DukValue::take_from_stack(_context); - } + DukValue getEntity(int32_t id) const; - std::vector getAllEntities(const std::string& type) const - { - std::vector result; - if (type == "balloon") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else if (type == "car") - { - for (auto trainHead : TrainManager::View()) - { - for (auto carId = trainHead->sprite_index; carId != SPRITE_INDEX_NULL;) - { - auto car = GetEntity(carId); - result.push_back(GetObjectAsDukValue(_context, std::make_shared(carId))); - carId = car->next_vehicle_on_train; - } - } - } - else if (type == "litter") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else if (type == "duck") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else if (type == "peep") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else if (type == "guest") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else if (type == "staff") - { - for (auto sprite : EntityList()) - { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); - } - } - else - { - duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); - } + std::vector getAllEntities(const std::string& type) const; - return result; - } + DukValue createEntity(const std::string& type, const DukValue& initializer); - template DukValue createEntityType(const DukValue& initializer) - { - TEntityType* entity = CreateEntity(); - - auto entityPos = CoordsXYZ{ AsOrDefault(initializer["x"], 0), AsOrDefault(initializer["y"], 0), - AsOrDefault(initializer["z"], 0) }; - entity->MoveTo(entityPos); - - return GetObjectAsDukValue(_context, std::make_shared(entity->sprite_index)); - } - - DukValue createEntity(const std::string& type, const DukValue& initializer) - { - if (type == "car") - { - return createEntityType(initializer); - } - else if (type == "staff") - { - return createEntityType(initializer); - } - else if (type == "guest") - { - return createEntityType(initializer); - } - else if (type == "steam_particle") - { - return createEntityType(initializer); - } - else if (type == "money_effect") - { - return createEntityType(initializer); - } - else if (type == "crashed_vehicle_particle") - { - return createEntityType(initializer); - } - else if (type == "explosion_cloud") - { - return createEntityType(initializer); - } - else if (type == "crash_splash") - { - return createEntityType(initializer); - } - else if (type == "explosion_flare") - { - return createEntityType(initializer); - } - else if (type == "balloon") - { - return createEntityType(initializer); - } - else if (type == "duck") - { - return createEntityType(initializer); - } - else if (type == "jumping_fountain") - { - return createEntityType(initializer); - } - else if (type == "litter") - { - return createEntityType(initializer); - } - else - { - duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); - } - - return DukValue(); - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScMap::size_get, nullptr, "size"); - dukglue_register_property(ctx, &ScMap::numRides_get, nullptr, "numRides"); - dukglue_register_property(ctx, &ScMap::numEntities_get, nullptr, "numEntities"); - dukglue_register_property(ctx, &ScMap::rides_get, nullptr, "rides"); - dukglue_register_method(ctx, &ScMap::getRide, "getRide"); - dukglue_register_method(ctx, &ScMap::getTile, "getTile"); - dukglue_register_method(ctx, &ScMap::getEntity, "getEntity"); - dukglue_register_method(ctx, &ScMap::getAllEntities, "getAllEntities"); - dukglue_register_method(ctx, &ScMap::createEntity, "createEntity"); - } + static void Register(duk_context* ctx); private: - DukValue GetEntityAsDukValue(const SpriteBase* sprite) const - { - auto spriteId = sprite->sprite_index; - switch (sprite->Type) - { - case EntityType::Vehicle: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Staff: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Guest: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - case EntityType::Litter: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - default: - return GetObjectAsDukValue(_context, std::make_shared(spriteId)); - } - } + DukValue GetEntityAsDukValue(const SpriteBase* sprite) const; }; + } // namespace OpenRCT2::Scripting #endif From d558920606ba217f6d3f5bd1e1a84ffcd674cedb Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 15:19:10 +0300 Subject: [PATCH 149/681] Move ScParkMessage into its own files --- OpenRCT2.xcodeproj/project.pbxproj | 8 + src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/world/ScPark.hpp | 201 +----------------- .../bindings/world/ScParkMessage.cpp | 184 ++++++++++++++++ .../bindings/world/ScParkMessage.hpp | 102 +++++++++ 6 files changed, 298 insertions(+), 200 deletions(-) create mode 100644 src/openrct2/scripting/bindings/world/ScParkMessage.cpp create mode 100644 src/openrct2/scripting/bindings/world/ScParkMessage.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index c9a57f561b..c21907297b 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -790,6 +790,8 @@ 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */; }; 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3B00C9900ED42AFA72764ED /* ScRide.cpp */; }; 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BE60702D7549488A32CC0B /* ScMap.cpp */; }; + BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */; }; + AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1882,6 +1884,8 @@ 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRideStation.hpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.hpp; sourceTree = SOURCE_ROOT; }; F3B00C9900ED42AFA72764ED /* ScRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRide.cpp; path = src/openrct2/scripting/bindings/ride/ScRide.cpp; sourceTree = SOURCE_ROOT; }; E4BE60702D7549488A32CC0B /* ScMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScMap.cpp; path = src/openrct2/scripting/bindings/world/ScMap.cpp; sourceTree = SOURCE_ROOT; }; + 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScParkMessage.cpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.cpp; sourceTree = SOURCE_ROOT; }; + 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScParkMessage.hpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3463,6 +3467,8 @@ A9F55F2291284217BA0E4E51 /* ScScenario.hpp */, 22D7DD798F054A068273739B /* ScTile.hpp */, E4BE60702D7549488A32CC0B /* ScMap.cpp */, + 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */, + 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */, ); name = world; sourceTree = ""; @@ -3618,6 +3624,7 @@ 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */, 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */, 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */, + AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4433,6 +4440,7 @@ CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */, 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */, 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */, + BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 4624771168..b67b150cf5 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -413,6 +413,7 @@ + @@ -867,6 +868,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 5d3c8309ba..d4f7bb88a4 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -45,6 +45,7 @@ # include "bindings/world/ScDate.hpp" # include "bindings/world/ScMap.hpp" # include "bindings/world/ScPark.hpp" +# include "bindings/world/ScParkMessage.hpp" # include "bindings/world/ScScenario.hpp" # include "bindings/world/ScTile.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScPark.hpp b/src/openrct2/scripting/bindings/world/ScPark.hpp index 58bdda0299..9a6784abdf 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.hpp +++ b/src/openrct2/scripting/bindings/world/ScPark.hpp @@ -22,211 +22,12 @@ # include "../../../world/Park.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" +# include "ScParkMessage.hpp" # include namespace OpenRCT2::Scripting { - static constexpr const char* ParkMessageTypeStrings[] = { - "attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart", - }; - - inline News::ItemType GetParkMessageType(const std::string& key) - { - // Get the first ItemType that appears in ParkMessageTypeStrings that isn't Null - auto firstType = static_cast(News::ItemType::Ride); - - auto begin = std::begin(ParkMessageTypeStrings); - auto end = std::end(ParkMessageTypeStrings); - - auto it = std::find(begin, end, key); - return it != end ? static_cast(firstType + std::distance(begin, it)) : News::ItemType::Blank; - } - - inline std::string GetParkMessageType(News::ItemType type) - { - // Decrement 1 as ParkMessageTypeStrings doesn't contain the null type - auto scriptType = static_cast(type) - 1; - - if (scriptType < std::size(ParkMessageTypeStrings)) - { - return ParkMessageTypeStrings[scriptType]; - } - return {}; - } - - template<> inline News::Item FromDuk(const DukValue& value) - { - News::Item result{}; - result.Type = GetParkMessageType(value["type"].as_string()); - result.Assoc = value["subject"].as_int(); - result.Ticks = value["tickCount"].as_int(); - result.MonthYear = value["month"].as_int(); - result.Day = value["day"].as_int(); - result.Text = value["text"].as_string(); - return result; - } - - class ScParkMessage - { - private: - size_t _index{}; - - public: - ScParkMessage(size_t index) - : _index(index) - { - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScParkMessage::isArchived_get, nullptr, "isArchived"); - dukglue_register_property(ctx, &ScParkMessage::month_get, &ScParkMessage::month_set, "month"); - dukglue_register_property(ctx, &ScParkMessage::day_get, &ScParkMessage::day_set, "day"); - dukglue_register_property(ctx, &ScParkMessage::tickCount_get, &ScParkMessage::tickCount_set, "tickCount"); - dukglue_register_property(ctx, &ScParkMessage::type_get, &ScParkMessage::type_set, "type"); - dukglue_register_property(ctx, &ScParkMessage::subject_get, &ScParkMessage::subject_set, "subject"); - dukglue_register_property(ctx, &ScParkMessage::text_get, &ScParkMessage::text_set, "text"); - dukglue_register_method(ctx, &ScParkMessage::remove, "remove"); - } - - private: - News::Item* GetMessage() const - { - return &gNewsItems[_index]; - } - - bool isArchived_get() const - { - return _index >= News::ItemHistoryStart; - } - - uint16_t month_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return msg->MonthYear; - } - return 0; - } - - void month_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->MonthYear = value; - } - } - - uint8_t day_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return msg->Day; - } - return 0; - } - - void day_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->Day = value; - } - } - - uint16_t tickCount_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return msg->Ticks; - } - return 0; - } - - void tickCount_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->Ticks = value; - } - } - - std::string type_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return GetParkMessageType(msg->Type); - } - return {}; - } - - void type_set(const std::string& value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->Type = GetParkMessageType(value); - } - } - - uint32_t subject_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return msg->Assoc; - } - return 0; - } - - void subject_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->Assoc = value; - } - } - - std::string text_get() const - { - auto msg = GetMessage(); - if (msg != nullptr) - { - return msg->Text; - } - return {}; - } - - void text_set(const std::string& value) - { - ThrowIfGameStateNotMutable(); - auto msg = GetMessage(); - if (msg != nullptr) - { - msg->Text = value; - } - } - - void remove() - { - News::RemoveItem(static_cast(_index)); - } - }; - static const DukEnumMap ParkFlagMap({ { "open", PARK_FLAGS_PARK_OPEN }, { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.cpp b/src/openrct2/scripting/bindings/world/ScParkMessage.cpp new file mode 100644 index 0000000000..0df7790750 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.cpp @@ -0,0 +1,184 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScParkMessage.hpp" + +# include "../../../Context.h" +# include "../../../GameState.h" +# include "../../../common.h" +# include "../../../core/String.hpp" +# include "../../../management/Finance.h" +# include "../../../management/NewsItem.h" +# include "../../../peep/Peep.h" +# include "../../../windows/Intent.h" +# include "../../../world/Park.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" + +# include + +namespace OpenRCT2::Scripting +{ + ScParkMessage::ScParkMessage(size_t index) + : _index(index) + { + } + + void ScParkMessage::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScParkMessage::isArchived_get, nullptr, "isArchived"); + dukglue_register_property(ctx, &ScParkMessage::month_get, &ScParkMessage::month_set, "month"); + dukglue_register_property(ctx, &ScParkMessage::day_get, &ScParkMessage::day_set, "day"); + dukglue_register_property(ctx, &ScParkMessage::tickCount_get, &ScParkMessage::tickCount_set, "tickCount"); + dukglue_register_property(ctx, &ScParkMessage::type_get, &ScParkMessage::type_set, "type"); + dukglue_register_property(ctx, &ScParkMessage::subject_get, &ScParkMessage::subject_set, "subject"); + dukglue_register_property(ctx, &ScParkMessage::text_get, &ScParkMessage::text_set, "text"); + dukglue_register_method(ctx, &ScParkMessage::remove, "remove"); + } + + News::Item* ScParkMessage::GetMessage() const + { + return &gNewsItems[_index]; + } + + bool ScParkMessage::isArchived_get() const + { + return _index >= News::ItemHistoryStart; + } + + uint16_t ScParkMessage::month_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return msg->MonthYear; + } + return 0; + } + + void ScParkMessage::month_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->MonthYear = value; + } + } + + uint8_t ScParkMessage::day_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return msg->Day; + } + return 0; + } + + void ScParkMessage::day_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->Day = value; + } + } + + uint16_t ScParkMessage::tickCount_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return msg->Ticks; + } + return 0; + } + + void ScParkMessage::tickCount_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->Ticks = value; + } + } + + std::string ScParkMessage::type_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return GetParkMessageType(msg->Type); + } + return {}; + } + + void ScParkMessage::type_set(const std::string& value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->Type = GetParkMessageType(value); + } + } + + uint32_t ScParkMessage::subject_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return msg->Assoc; + } + return 0; + } + + void ScParkMessage::subject_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->Assoc = value; + } + } + + std::string ScParkMessage::text_get() const + { + auto msg = GetMessage(); + if (msg != nullptr) + { + return msg->Text; + } + return {}; + } + + void ScParkMessage::text_set(const std::string& value) + { + ThrowIfGameStateNotMutable(); + auto msg = GetMessage(); + if (msg != nullptr) + { + msg->Text = value; + } + } + + void ScParkMessage::remove() + { + News::RemoveItem(static_cast(_index)); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp new file mode 100644 index 0000000000..58f124520f --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp @@ -0,0 +1,102 @@ +/***************************************************************************** + * Copyright (c) 2014-2020 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../management/NewsItem.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" + +# include + +namespace OpenRCT2::Scripting +{ + static constexpr const char* ParkMessageTypeStrings[] = { + "attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart", + }; + + inline News::ItemType GetParkMessageType(const std::string& key) + { + // Get the first ItemType that appears in ParkMessageTypeStrings that isn't Null + auto firstType = static_cast(News::ItemType::Ride); + + auto begin = std::begin(ParkMessageTypeStrings); + auto end = std::end(ParkMessageTypeStrings); + + auto it = std::find(begin, end, key); + return it != end ? static_cast(firstType + std::distance(begin, it)) : News::ItemType::Blank; + } + + inline std::string GetParkMessageType(News::ItemType type) + { + // Decrement 1 as ParkMessageTypeStrings doesn't contain the null type + auto scriptType = static_cast(type) - 1; + + if (scriptType < std::size(ParkMessageTypeStrings)) + { + return ParkMessageTypeStrings[scriptType]; + } + return {}; + } + + template<> inline News::Item FromDuk(const DukValue& value) + { + News::Item result{}; + result.Type = GetParkMessageType(value["type"].as_string()); + result.Assoc = value["subject"].as_int(); + result.Ticks = value["tickCount"].as_int(); + result.MonthYear = value["month"].as_int(); + result.Day = value["day"].as_int(); + result.Text = value["text"].as_string(); + return result; + } + + class ScParkMessage + { + private: + size_t _index{}; + + public: + ScParkMessage(size_t index); + + static void Register(duk_context* ctx); + + private: + News::Item* GetMessage() const; + + bool isArchived_get() const; + + uint16_t month_get() const; + void month_set(uint16_t value); + + uint8_t day_get() const; + void day_set(uint8_t value); + + uint16_t tickCount_get() const; + void tickCount_set(uint16_t value); + + std::string type_get() const; + void type_set(const std::string& value); + + uint32_t subject_get() const; + void subject_set(uint32_t value); + + std::string text_get() const; + void text_set(const std::string& value); + + void remove(); + }; + +} // namespace OpenRCT2::Scripting + +#endif From 4684f39df9c79345376c20bd460e1d415f65096b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 15:27:15 +0300 Subject: [PATCH 150/681] Move ScPark code into cpp --- src/openrct2/libopenrct2.vcxproj | 1 + .../scripting/bindings/world/ScPark.cpp | 418 ++++++++++++++++++ .../scripting/bindings/world/ScPark.hpp | 410 ++--------------- .../bindings/world/ScParkMessage.hpp | 1 + 4 files changed, 463 insertions(+), 367 deletions(-) create mode 100644 src/openrct2/scripting/bindings/world/ScPark.cpp diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index b67b150cf5..dd3f6892d1 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -868,6 +868,7 @@ + diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp new file mode 100644 index 0000000000..0ff6063fa3 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -0,0 +1,418 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScPark.hpp" + +# include "../../../Context.h" +# include "../../../GameState.h" +# include "../../../common.h" +# include "../../../core/String.hpp" +# include "../../../management/Finance.h" +# include "../../../management/NewsItem.h" +# include "../../../peep/Peep.h" +# include "../../../windows/Intent.h" +# include "../../../world/Park.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "ScParkMessage.hpp" + +# include + +namespace OpenRCT2::Scripting +{ + static const DukEnumMap ParkFlagMap({ + { "open", PARK_FLAGS_PARK_OPEN }, + { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, + { "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES }, + { "forbidTreeRemoval", PARK_FLAGS_FORBID_TREE_REMOVAL }, + { "forbidHighConstruction", PARK_FLAGS_FORBID_HIGH_CONSTRUCTION }, + { "preferLessIntenseRides", PARK_FLAGS_PREF_LESS_INTENSE_RIDES }, + { "forbidMarketingCampaigns", PARK_FLAGS_FORBID_MARKETING_CAMPAIGN }, + { "preferMoreIntenseRides", PARK_FLAGS_PREF_MORE_INTENSE_RIDES }, + { "noMoney", PARK_FLAGS_NO_MONEY }, + { "difficultGuestGeneration", PARK_FLAGS_DIFFICULT_GUEST_GENERATION }, + { "freeParkEntry", PARK_FLAGS_PARK_FREE_ENTRY }, + { "difficultParkRating", PARK_FLAGS_DIFFICULT_PARK_RATING }, + { "noMoney", PARK_FLAGS_NO_MONEY_SCENARIO }, + { "unlockAllPrices", PARK_FLAGS_UNLOCK_ALL_PRICES }, + }); + + money64 ScPark::cash_get() const + { + return gCash; + } + void ScPark::cash_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gCash != value) + { + gCash = value; + auto intent = Intent(INTENT_ACTION_UPDATE_CASH); + context_broadcast_intent(&intent); + } + } + + int32_t ScPark::rating_get() const + { + return gParkRating; + } + void ScPark::rating_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + + auto valueClamped = std::min(std::max(0, value), 999); + if (gParkRating != valueClamped) + { + gParkRating = std::min(std::max(0, value), 999); + auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); + context_broadcast_intent(&intent); + } + } + + money64 ScPark::bankLoan_get() const + { + return gBankLoan; + } + void ScPark::bankLoan_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gBankLoan != value) + { + gBankLoan = value; + auto intent = Intent(INTENT_ACTION_UPDATE_CASH); + context_broadcast_intent(&intent); + } + } + + money64 ScPark::maxBankLoan_get() const + { + return gMaxBankLoan; + } + void ScPark::maxBankLoan_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gMaxBankLoan != value) + { + gMaxBankLoan = value; + auto intent = Intent(INTENT_ACTION_UPDATE_CASH); + context_broadcast_intent(&intent); + } + } + + money16 ScPark::entranceFee_get() const + { + return gParkEntranceFee; + } + void ScPark::entranceFee_set(money16 value) + { + ThrowIfGameStateNotMutable(); + + if (gParkEntranceFee != value) + { + gParkEntranceFee = value; + window_invalidate_by_class(WC_PARK_INFORMATION); + } + } + + uint32_t ScPark::guests_get() const + { + return gNumGuestsInPark; + } + + uint32_t ScPark::suggestedGuestMaximum_get() const + { + return _suggestedGuestMaximum; + } + + int32_t ScPark::guestGenerationProbability_get() const + { + return _guestGenerationProbability; + } + + money16 ScPark::guestInitialCash_get() const + { + return gGuestInitialCash; + } + + uint8_t ScPark::guestInitialHappiness_get() const + { + return gGuestInitialHappiness; + } + + uint8_t ScPark::guestInitialHunger_get() const + { + return gGuestInitialHunger; + } + + uint8_t ScPark::guestInitialThirst_get() const + { + return gGuestInitialThirst; + } + + money64 ScPark::value_get() const + { + return gParkValue; + } + void ScPark::value_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gParkValue != value) + { + gParkValue = value; + auto intent = Intent(INTENT_ACTION_UPDATE_CASH); + context_broadcast_intent(&intent); + } + } + + money64 ScPark::companyValue_get() const + { + return gCompanyValue; + } + void ScPark::companyValue_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gCompanyValue != value) + { + gCompanyValue = value; + auto intent = Intent(INTENT_ACTION_UPDATE_CASH); + context_broadcast_intent(&intent); + } + } + + money16 ScPark::totalRideValueForMoney_get() const + { + return gTotalRideValueForMoney; + } + + uint32_t ScPark::totalAdmissions_get() const + { + return gTotalAdmissions; + } + void ScPark::totalAdmissions_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + + if (gTotalAdmissions != value) + { + gTotalAdmissions = value; + window_invalidate_by_class(WC_PARK_INFORMATION); + } + } + + money64 ScPark::totalIncomeFromAdmissions_get() const + { + return gTotalIncomeFromAdmissions; + } + void ScPark::totalIncomeFromAdmissions_set(money64 value) + { + ThrowIfGameStateNotMutable(); + + if (gTotalIncomeFromAdmissions != value) + { + gTotalIncomeFromAdmissions = value; + window_invalidate_by_class(WC_PARK_INFORMATION); + } + } + + money32 ScPark::landPrice_get() const + { + return gLandPrice; + } + void ScPark::landPrice_set(money32 value) + { + ThrowIfGameStateNotMutable(); + gLandPrice = value; + } + + money32 ScPark::constructionRightsPrice_get() const + { + return gConstructionRightsPrice; + } + void ScPark::constructionRightsPrice_set(money32 value) + { + ThrowIfGameStateNotMutable(); + gConstructionRightsPrice = value; + } + + int16_t ScPark::casualtyPenalty_get() const + { + return gParkRatingCasualtyPenalty; + } + void ScPark::casualtyPenalty_set(int16_t value) + { + ThrowIfGameStateNotMutable(); + gParkRatingCasualtyPenalty = value; + } + + uint16_t ScPark::parkSize_get() const + { + return gParkSize; + } + + std::string ScPark::name_get() const + { + return GetContext()->GetGameState()->GetPark().Name; + } + void ScPark::name_set(std::string value) + { + ThrowIfGameStateNotMutable(); + + auto& park = GetContext()->GetGameState()->GetPark(); + if (park.Name != value) + { + park.Name = value; + gfx_invalidate_screen(); + } + } + + bool ScPark::getFlag(const std::string& key) const + { + auto mask = ParkFlagMap[key]; + return (gParkFlags & mask) != 0; + } + + void ScPark::setFlag(const std::string& key, bool value) + { + ThrowIfGameStateNotMutable(); + auto mask = ParkFlagMap[key]; + if (value) + gParkFlags |= mask; + else + gParkFlags &= ~mask; + gfx_invalidate_screen(); + } + + std::vector> ScPark::messages_get() const + { + std::vector> result; + for (size_t i = 0, newsSize = gNewsItems.GetRecent().size(); i < newsSize; i++) + { + result.push_back(std::make_shared(i)); + } + for (size_t i = 0, newsSize = gNewsItems.GetArchived().size(); i < newsSize; i++) + { + result.push_back(std::make_shared(i + News::ItemHistoryStart)); + } + return result; + } + + void ScPark::messages_set(const std::vector& value) + { + int32_t index = 0; + int32_t archiveIndex = News::ItemHistoryStart; + for (const auto& item : value) + { + auto isArchived = item["isArchived"].as_bool(); + auto newsItem = FromDuk(item); + if (isArchived) + { + if (archiveIndex < News::MaxItems) + { + gNewsItems[archiveIndex] = newsItem; + archiveIndex++; + } + } + else + { + if (index < News::ItemHistoryStart) + { + gNewsItems[index] = newsItem; + index++; + } + } + } + + // End the lists by setting next item to null + if (index < News::ItemHistoryStart) + { + gNewsItems[index].Type = News::ItemType::Null; + } + if (archiveIndex < News::MaxItems) + { + gNewsItems[archiveIndex].Type = News::ItemType::Null; + } + } + + void ScPark::postMessage(DukValue message) + { + ThrowIfGameStateNotMutable(); + try + { + uint32_t assoc = std::numeric_limits::max(); + auto type = News::ItemType::Blank; + std::string text; + if (message.type() == DukValue::Type::STRING) + { + text = message.as_string(); + } + else + { + type = GetParkMessageType(message["type"].as_string()); + text = message["text"].as_string(); + if (type == News::ItemType::Blank) + { + assoc = static_cast(((COORDS_NULL & 0xFFFF) << 16) | (COORDS_NULL & 0xFFFF)); + } + + auto dukSubject = message["subject"]; + if (dukSubject.type() == DukValue::Type::NUMBER) + { + assoc = static_cast(dukSubject.as_int()); + } + } + News::AddItemToQueue(type, text.c_str(), assoc); + } + catch (const DukException&) + { + duk_error(message.context(), DUK_ERR_ERROR, "Invalid message argument."); + } + } + + void ScPark::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScPark::cash_get, &ScPark::cash_set, "cash"); + dukglue_register_property(ctx, &ScPark::rating_get, &ScPark::rating_set, "rating"); + dukglue_register_property(ctx, &ScPark::bankLoan_get, &ScPark::bankLoan_set, "bankLoan"); + dukglue_register_property(ctx, &ScPark::maxBankLoan_get, &ScPark::maxBankLoan_set, "maxBankLoan"); + dukglue_register_property(ctx, &ScPark::entranceFee_get, &ScPark::entranceFee_set, "entranceFee"); + dukglue_register_property(ctx, &ScPark::guests_get, nullptr, "guests"); + dukglue_register_property(ctx, &ScPark::suggestedGuestMaximum_get, nullptr, "suggestedGuestMaximum"); + dukglue_register_property(ctx, &ScPark::guestGenerationProbability_get, nullptr, "guestGenerationProbability"); + dukglue_register_property(ctx, &ScPark::guestInitialCash_get, nullptr, "guestInitialCash"); + dukglue_register_property(ctx, &ScPark::guestInitialHappiness_get, nullptr, "guestInitialHappiness"); + dukglue_register_property(ctx, &ScPark::guestInitialHunger_get, nullptr, "guestInitialHunger"); + dukglue_register_property(ctx, &ScPark::guestInitialThirst_get, nullptr, "guestInitialThirst"); + dukglue_register_property(ctx, &ScPark::value_get, &ScPark::value_set, "value"); + dukglue_register_property(ctx, &ScPark::companyValue_get, &ScPark::companyValue_set, "companyValue"); + dukglue_register_property(ctx, &ScPark::totalRideValueForMoney_get, nullptr, "totalRideValueForMoney"); + dukglue_register_property(ctx, &ScPark::totalAdmissions_get, &ScPark::totalAdmissions_set, "totalAdmissions"); + dukglue_register_property( + ctx, &ScPark::totalIncomeFromAdmissions_get, &ScPark::totalIncomeFromAdmissions_set, "totalIncomeFromAdmissions"); + dukglue_register_property(ctx, &ScPark::landPrice_get, &ScPark::landPrice_set, "landPrice"); + dukglue_register_property( + ctx, &ScPark::constructionRightsPrice_get, &ScPark::constructionRightsPrice_set, "constructionRightsPrice"); + dukglue_register_property(ctx, &ScPark::parkSize_get, nullptr, "parkSize"); + dukglue_register_property(ctx, &ScPark::name_get, &ScPark::name_set, "name"); + dukglue_register_property(ctx, &ScPark::messages_get, &ScPark::messages_set, "messages"); + dukglue_register_property(ctx, &ScPark::casualtyPenalty_get, &ScPark::casualtyPenalty_set, "casualtyPenalty"); + dukglue_register_method(ctx, &ScPark::getFlag, "getFlag"); + dukglue_register_method(ctx, &ScPark::setFlag, "setFlag"); + dukglue_register_method(ctx, &ScPark::postMessage, "postMessage"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScPark.hpp b/src/openrct2/scripting/bindings/world/ScPark.hpp index 9a6784abdf..10fb765abb 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.hpp +++ b/src/openrct2/scripting/bindings/world/ScPark.hpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -12,410 +12,86 @@ #ifdef ENABLE_SCRIPTING # include "../../../Context.h" -# include "../../../GameState.h" # include "../../../common.h" -# include "../../../core/String.hpp" -# include "../../../management/Finance.h" -# include "../../../management/NewsItem.h" -# include "../../../peep/Peep.h" -# include "../../../windows/Intent.h" -# include "../../../world/Park.h" # include "../../Duktape.hpp" -# include "../../ScriptEngine.h" # include "ScParkMessage.hpp" # include +# include namespace OpenRCT2::Scripting { - static const DukEnumMap ParkFlagMap({ - { "open", PARK_FLAGS_PARK_OPEN }, - { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, - { "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES }, - { "forbidTreeRemoval", PARK_FLAGS_FORBID_TREE_REMOVAL }, - { "forbidHighConstruction", PARK_FLAGS_FORBID_HIGH_CONSTRUCTION }, - { "preferLessIntenseRides", PARK_FLAGS_PREF_LESS_INTENSE_RIDES }, - { "forbidMarketingCampaigns", PARK_FLAGS_FORBID_MARKETING_CAMPAIGN }, - { "preferMoreIntenseRides", PARK_FLAGS_PREF_MORE_INTENSE_RIDES }, - { "noMoney", PARK_FLAGS_NO_MONEY }, - { "difficultGuestGeneration", PARK_FLAGS_DIFFICULT_GUEST_GENERATION }, - { "freeParkEntry", PARK_FLAGS_PARK_FREE_ENTRY }, - { "difficultParkRating", PARK_FLAGS_DIFFICULT_PARK_RATING }, - { "noMoney", PARK_FLAGS_NO_MONEY_SCENARIO }, - { "unlockAllPrices", PARK_FLAGS_UNLOCK_ALL_PRICES }, - }); - class ScPark { public: - money64 cash_get() const - { - return gCash; - } - void cash_set(money64 value) - { - ThrowIfGameStateNotMutable(); + money64 cash_get() const; + void cash_set(money64 value); - if (gCash != value) - { - gCash = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } + int32_t rating_get() const; + void rating_set(int32_t value); - int32_t rating_get() const - { - return gParkRating; - } - void rating_set(int32_t value) - { - ThrowIfGameStateNotMutable(); + money64 bankLoan_get() const; + void bankLoan_set(money64 value); - auto valueClamped = std::min(std::max(0, value), 999); - if (gParkRating != valueClamped) - { - gParkRating = std::min(std::max(0, value), 999); - auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); - context_broadcast_intent(&intent); - } - } + money64 maxBankLoan_get() const; + void maxBankLoan_set(money64 value); - money64 bankLoan_get() const - { - return gBankLoan; - } - void bankLoan_set(money64 value) - { - ThrowIfGameStateNotMutable(); + money16 entranceFee_get() const; + void entranceFee_set(money16 value); - if (gBankLoan != value) - { - gBankLoan = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } + uint32_t guests_get() const; - money64 maxBankLoan_get() const - { - return gMaxBankLoan; - } - void maxBankLoan_set(money64 value) - { - ThrowIfGameStateNotMutable(); + uint32_t suggestedGuestMaximum_get() const; - if (gMaxBankLoan != value) - { - gMaxBankLoan = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } + int32_t guestGenerationProbability_get() const; - money16 entranceFee_get() const - { - return gParkEntranceFee; - } - void entranceFee_set(money16 value) - { - ThrowIfGameStateNotMutable(); + money16 guestInitialCash_get() const; - if (gParkEntranceFee != value) - { - gParkEntranceFee = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } + uint8_t guestInitialHappiness_get() const; - uint32_t guests_get() const - { - return gNumGuestsInPark; - } + uint8_t guestInitialHunger_get() const; - uint32_t suggestedGuestMaximum_get() const - { - return _suggestedGuestMaximum; - } + uint8_t guestInitialThirst_get() const; - int32_t guestGenerationProbability_get() const - { - return _guestGenerationProbability; - } + money64 value_get() const; + void value_set(money64 value); - money16 guestInitialCash_get() const - { - return gGuestInitialCash; - } + money64 companyValue_get() const; + void companyValue_set(money64 value); - uint8_t guestInitialHappiness_get() const - { - return gGuestInitialHappiness; - } + money16 totalRideValueForMoney_get() const; - uint8_t guestInitialHunger_get() const - { - return gGuestInitialHunger; - } + uint32_t totalAdmissions_get() const; + void totalAdmissions_set(uint32_t value); - uint8_t guestInitialThirst_get() const - { - return gGuestInitialThirst; - } + money64 totalIncomeFromAdmissions_get() const; + void totalIncomeFromAdmissions_set(money64 value); - money64 value_get() const - { - return gParkValue; - } - void value_set(money64 value) - { - ThrowIfGameStateNotMutable(); + money32 landPrice_get() const; + void landPrice_set(money32 value); - if (gParkValue != value) - { - gParkValue = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } + money32 constructionRightsPrice_get() const; + void constructionRightsPrice_set(money32 value); - money64 companyValue_get() const - { - return gCompanyValue; - } - void companyValue_set(money64 value) - { - ThrowIfGameStateNotMutable(); + int16_t casualtyPenalty_get() const; + void casualtyPenalty_set(int16_t value); - if (gCompanyValue != value) - { - gCompanyValue = value; - auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); - } - } + uint16_t parkSize_get() const; - money16 totalRideValueForMoney_get() const - { - return gTotalRideValueForMoney; - } + std::string name_get() const; + void name_set(std::string value); - uint32_t totalAdmissions_get() const - { - return gTotalAdmissions; - } - void totalAdmissions_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); + bool getFlag(const std::string& key) const; - if (gTotalAdmissions != value) - { - gTotalAdmissions = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } + void setFlag(const std::string& key, bool value); - money64 totalIncomeFromAdmissions_get() const - { - return gTotalIncomeFromAdmissions; - } - void totalIncomeFromAdmissions_set(money64 value) - { - ThrowIfGameStateNotMutable(); + std::vector> messages_get() const; - if (gTotalIncomeFromAdmissions != value) - { - gTotalIncomeFromAdmissions = value; - window_invalidate_by_class(WC_PARK_INFORMATION); - } - } + void messages_set(const std::vector& value); - money32 landPrice_get() const - { - return gLandPrice; - } - void landPrice_set(money32 value) - { - ThrowIfGameStateNotMutable(); - gLandPrice = value; - } + void postMessage(DukValue message); - money32 constructionRightsPrice_get() const - { - return gConstructionRightsPrice; - } - void constructionRightsPrice_set(money32 value) - { - ThrowIfGameStateNotMutable(); - gConstructionRightsPrice = value; - } - - int16_t casualtyPenalty_get() const - { - return gParkRatingCasualtyPenalty; - } - void casualtyPenalty_set(int16_t value) - { - ThrowIfGameStateNotMutable(); - gParkRatingCasualtyPenalty = value; - } - - uint16_t parkSize_get() const - { - return gParkSize; - } - - std::string name_get() const - { - return GetContext()->GetGameState()->GetPark().Name; - } - void name_set(std::string value) - { - ThrowIfGameStateNotMutable(); - - auto& park = GetContext()->GetGameState()->GetPark(); - if (park.Name != value) - { - park.Name = value; - gfx_invalidate_screen(); - } - } - - bool getFlag(const std::string& key) const - { - auto mask = ParkFlagMap[key]; - return (gParkFlags & mask) != 0; - } - - void setFlag(const std::string& key, bool value) - { - ThrowIfGameStateNotMutable(); - auto mask = ParkFlagMap[key]; - if (value) - gParkFlags |= mask; - else - gParkFlags &= ~mask; - gfx_invalidate_screen(); - } - - std::vector> messages_get() const - { - std::vector> result; - for (size_t i = 0, newsSize = gNewsItems.GetRecent().size(); i < newsSize; i++) - { - result.push_back(std::make_shared(i)); - } - for (size_t i = 0, newsSize = gNewsItems.GetArchived().size(); i < newsSize; i++) - { - result.push_back(std::make_shared(i + News::ItemHistoryStart)); - } - return result; - } - - void messages_set(const std::vector& value) - { - int32_t index = 0; - int32_t archiveIndex = News::ItemHistoryStart; - for (const auto& item : value) - { - auto isArchived = item["isArchived"].as_bool(); - auto newsItem = FromDuk(item); - if (isArchived) - { - if (archiveIndex < News::MaxItems) - { - gNewsItems[archiveIndex] = newsItem; - archiveIndex++; - } - } - else - { - if (index < News::ItemHistoryStart) - { - gNewsItems[index] = newsItem; - index++; - } - } - } - - // End the lists by setting next item to null - if (index < News::ItemHistoryStart) - { - gNewsItems[index].Type = News::ItemType::Null; - } - if (archiveIndex < News::MaxItems) - { - gNewsItems[archiveIndex].Type = News::ItemType::Null; - } - } - - void postMessage(DukValue message) - { - ThrowIfGameStateNotMutable(); - try - { - uint32_t assoc = std::numeric_limits::max(); - auto type = News::ItemType::Blank; - std::string text; - if (message.type() == DukValue::Type::STRING) - { - text = message.as_string(); - } - else - { - type = GetParkMessageType(message["type"].as_string()); - text = message["text"].as_string(); - if (type == News::ItemType::Blank) - { - assoc = static_cast(((COORDS_NULL & 0xFFFF) << 16) | (COORDS_NULL & 0xFFFF)); - } - - auto dukSubject = message["subject"]; - if (dukSubject.type() == DukValue::Type::NUMBER) - { - assoc = static_cast(dukSubject.as_int()); - } - } - News::AddItemToQueue(type, text.c_str(), assoc); - } - catch (const DukException&) - { - duk_error(message.context(), DUK_ERR_ERROR, "Invalid message argument."); - } - } - - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScPark::cash_get, &ScPark::cash_set, "cash"); - dukglue_register_property(ctx, &ScPark::rating_get, &ScPark::rating_set, "rating"); - dukglue_register_property(ctx, &ScPark::bankLoan_get, &ScPark::bankLoan_set, "bankLoan"); - dukglue_register_property(ctx, &ScPark::maxBankLoan_get, &ScPark::maxBankLoan_set, "maxBankLoan"); - dukglue_register_property(ctx, &ScPark::entranceFee_get, &ScPark::entranceFee_set, "entranceFee"); - dukglue_register_property(ctx, &ScPark::guests_get, nullptr, "guests"); - dukglue_register_property(ctx, &ScPark::suggestedGuestMaximum_get, nullptr, "suggestedGuestMaximum"); - dukglue_register_property(ctx, &ScPark::guestGenerationProbability_get, nullptr, "guestGenerationProbability"); - dukglue_register_property(ctx, &ScPark::guestInitialCash_get, nullptr, "guestInitialCash"); - dukglue_register_property(ctx, &ScPark::guestInitialHappiness_get, nullptr, "guestInitialHappiness"); - dukglue_register_property(ctx, &ScPark::guestInitialHunger_get, nullptr, "guestInitialHunger"); - dukglue_register_property(ctx, &ScPark::guestInitialThirst_get, nullptr, "guestInitialThirst"); - dukglue_register_property(ctx, &ScPark::value_get, &ScPark::value_set, "value"); - dukglue_register_property(ctx, &ScPark::companyValue_get, &ScPark::companyValue_set, "companyValue"); - dukglue_register_property(ctx, &ScPark::totalRideValueForMoney_get, nullptr, "totalRideValueForMoney"); - dukglue_register_property(ctx, &ScPark::totalAdmissions_get, &ScPark::totalAdmissions_set, "totalAdmissions"); - dukglue_register_property( - ctx, &ScPark::totalIncomeFromAdmissions_get, &ScPark::totalIncomeFromAdmissions_set, - "totalIncomeFromAdmissions"); - dukglue_register_property(ctx, &ScPark::landPrice_get, &ScPark::landPrice_set, "landPrice"); - dukglue_register_property( - ctx, &ScPark::constructionRightsPrice_get, &ScPark::constructionRightsPrice_set, "constructionRightsPrice"); - dukglue_register_property(ctx, &ScPark::parkSize_get, nullptr, "parkSize"); - dukglue_register_property(ctx, &ScPark::name_get, &ScPark::name_set, "name"); - dukglue_register_property(ctx, &ScPark::messages_get, &ScPark::messages_set, "messages"); - dukglue_register_property(ctx, &ScPark::casualtyPenalty_get, &ScPark::casualtyPenalty_set, "casualtyPenalty"); - dukglue_register_method(ctx, &ScPark::getFlag, "getFlag"); - dukglue_register_method(ctx, &ScPark::setFlag, "setFlag"); - dukglue_register_method(ctx, &ScPark::postMessage, "postMessage"); - } + static void Register(duk_context* ctx); }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp index 58f124520f..48801a50a3 100644 --- a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp @@ -18,6 +18,7 @@ # include "../../ScriptEngine.h" # include +# include namespace OpenRCT2::Scripting { From 9f95b006d3587db81b6003f92b30ba7de799aafd Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 16:21:20 +0300 Subject: [PATCH 151/681] Move ScTileElement into its own files --- src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/scripting/ScriptEngine.cpp | 1 + .../scripting/bindings/world/ScTile.hpp | 1551 +--------------- .../bindings/world/ScTileElement.cpp | 1569 +++++++++++++++++ .../bindings/world/ScTileElement.hpp | 198 +++ 5 files changed, 1771 insertions(+), 1550 deletions(-) create mode 100644 src/openrct2/scripting/bindings/world/ScTileElement.cpp create mode 100644 src/openrct2/scripting/bindings/world/ScTileElement.hpp diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index dd3f6892d1..67c5d17b36 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -414,6 +414,7 @@ + @@ -870,6 +871,7 @@ + diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index d4f7bb88a4..e5e132ceb1 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -48,6 +48,7 @@ # include "bindings/world/ScParkMessage.hpp" # include "bindings/world/ScScenario.hpp" # include "bindings/world/ScTile.hpp" +# include "bindings/world/ScTileElement.hpp" # include # include diff --git a/src/openrct2/scripting/bindings/world/ScTile.hpp b/src/openrct2/scripting/bindings/world/ScTile.hpp index 182b20f9ef..2126d5cc0e 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.hpp +++ b/src/openrct2/scripting/bindings/world/ScTile.hpp @@ -21,6 +21,7 @@ # include "../../../world/Surface.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" +# include "ScTileElement.hpp" # include # include @@ -28,1556 +29,6 @@ namespace OpenRCT2::Scripting { - class ScSurfaceElement; - - class ScTileElement - { - protected: - CoordsXY _coords; - TileElement* _element; - - public: - ScTileElement(const CoordsXY& coords, TileElement* element) - : _coords(coords) - , _element(element) - { - } - - private: - std::string type_get() const - { - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SURFACE: - return "surface"; - case TILE_ELEMENT_TYPE_PATH: - return "footpath"; - case TILE_ELEMENT_TYPE_TRACK: - return "track"; - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - return "small_scenery"; - case TILE_ELEMENT_TYPE_ENTRANCE: - return "entrance"; - case TILE_ELEMENT_TYPE_WALL: - return "wall"; - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - return "large_scenery"; - case TILE_ELEMENT_TYPE_BANNER: - return "banner"; - case TILE_ELEMENT_TYPE_CORRUPT: - return "openrct2_corrupt_deprecated"; - default: - return "unknown"; - } - } - - void type_set(std::string value) - { - auto type = _element->type; - if (value == "surface") - type = TILE_ELEMENT_TYPE_SURFACE; - else if (value == "footpath") - type = TILE_ELEMENT_TYPE_PATH; - else if (value == "track") - type = TILE_ELEMENT_TYPE_TRACK; - else if (value == "small_scenery") - type = TILE_ELEMENT_TYPE_SMALL_SCENERY; - else if (value == "entrance") - type = TILE_ELEMENT_TYPE_ENTRANCE; - else if (value == "wall") - type = TILE_ELEMENT_TYPE_WALL; - else if (value == "large_scenery") - type = TILE_ELEMENT_TYPE_LARGE_SCENERY; - else if (value == "banner") - type = TILE_ELEMENT_TYPE_BANNER; - else - { - if (value == "openrct2_corrupt_deprecated") - std::puts( - "Creation of new corrupt elements is deprecated. To hide elements, use the 'hidden' property instead."); - return; - } - - _element->type = type; - Invalidate(); - } - - uint8_t baseHeight_get() const - { - return _element->base_height; - } - void baseHeight_set(uint8_t newBaseHeight) - { - ThrowIfGameStateNotMutable(); - _element->base_height = newBaseHeight; - Invalidate(); - } - - uint16_t baseZ_get() const - { - return _element->GetBaseZ(); - } - void baseZ_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - _element->SetBaseZ(value); - Invalidate(); - } - - uint8_t clearanceHeight_get() const - { - return _element->clearance_height; - } - void clearanceHeight_set(uint8_t newClearanceHeight) - { - ThrowIfGameStateNotMutable(); - _element->clearance_height = newClearanceHeight; - Invalidate(); - } - - uint16_t clearanceZ_get() const - { - return _element->GetClearanceZ(); - } - void clearanceZ_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - _element->SetClearanceZ(value); - Invalidate(); - } - - DukValue slope_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SURFACE: - { - auto el = _element->AsSurface(); - duk_push_int(ctx, el->GetSlope()); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - duk_push_int(ctx, el->GetSlope()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void slope_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SURFACE: - { - auto el = _element->AsSurface(); - el->SetSlope(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - el->SetSlope(value); - Invalidate(); - break; - } - } - } - - DukValue waterHeight_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetWaterHeight()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void waterHeight_set(int32_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - el->SetWaterHeight(value); - Invalidate(); - } - } - - DukValue surfaceStyle_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetSurfaceStyle()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void surfaceStyle_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - el->SetSurfaceStyle(value); - Invalidate(); - } - } - - DukValue edgeStyle_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetEdgeStyle()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void edgeStyle_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - el->SetEdgeStyle(value); - Invalidate(); - } - } - - DukValue grassLength_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetGrassLength()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void grassLength_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - // TODO: Give warning when value > GRASS_LENGTH_CLUMPS_2 - el->SetGrassLengthAndInvalidate(value, _coords); - Invalidate(); - } - } - - DukValue hasOwnership_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_boolean(ctx, el->GetOwnership() & OWNERSHIP_OWNED); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - - DukValue hasConstructionRights_get() - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - auto ownership = el->GetOwnership(); - duk_push_boolean(ctx, (ownership & OWNERSHIP_OWNED) || (ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)); - } - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - - DukValue ownership_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetOwnership()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void ownership_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - el->SetOwnership(value); - Invalidate(); - } - } - - DukValue parkFences_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSurface(); - if (el != nullptr) - duk_push_int(ctx, el->GetParkFences()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void parkFences_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSurface(); - if (el != nullptr) - { - el->SetParkFences(value); - Invalidate(); - } - } - - DukValue trackType_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr) - duk_push_int(ctx, el->GetTrackType()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void trackType_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - { - el->SetTrackType(value); - Invalidate(); - } - } - - DukValue sequence_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - duk_push_int(ctx, el->GetSequenceIndex()); - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - duk_push_int(ctx, el->GetSequenceIndex()); - else - duk_push_null(ctx); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - duk_push_int(ctx, el->GetSequenceIndex()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void sequence_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - el->SetSequenceIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - { - el->SetSequenceIndex(value); - Invalidate(); - } - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - el->SetSequenceIndex(value); - Invalidate(); - break; - } - } - } - - DukValue ride_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL) - duk_push_int(ctx, el->GetRideIndex()); - else - duk_push_null(ctx); - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - duk_push_int(ctx, el->GetRideIndex()); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - duk_push_int(ctx, el->GetRideIndex()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void ride_set(ride_id_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - if (!el->HasAddition()) - { - el->SetRideIndex(value); - Invalidate(); - } - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - el->SetRideIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - el->SetRideIndex(value); - Invalidate(); - break; - } - } - } - - DukValue station_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL) - duk_push_int(ctx, el->GetStationIndex()); - else - duk_push_null(ctx); - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - if (el->IsStation()) - duk_push_int(ctx, el->GetStationIndex()); - else - duk_push_null(ctx); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - duk_push_int(ctx, el->GetStationIndex()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void station_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - el->SetStationIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto el = _element->AsTrack(); - el->SetStationIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - el->SetStationIndex(value); - Invalidate(); - break; - } - } - } - - DukValue hasChainLift_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr) - duk_push_boolean(ctx, el->HasChain()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void hasChainLift_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - { - el->SetHasChain(value); - Invalidate(); - } - } - - DukValue mazeEntry_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr && get_ride(el->GetRideIndex())->type == RIDE_TYPE_MAZE) - duk_push_int(ctx, el->GetMazeEntry()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void mazeEntry_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - if (get_ride(el->GetRideIndex())->type == RIDE_TYPE_MAZE) - { - el->SetMazeEntry(value); - Invalidate(); - } - } - - DukValue colourScheme_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr && get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - duk_push_int(ctx, el->GetColourScheme()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void colourScheme_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - { - el->SetColourScheme(value); - Invalidate(); - } - } - - DukValue seatRotation_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr && get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - duk_push_int(ctx, el->GetSeatRotation()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void seatRotation_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) - { - el->SetSeatRotation(value); - Invalidate(); - } - } - - DukValue brakeBoosterSpeed_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr && TrackTypeHasSpeedSetting(el->GetTrackType())) - duk_push_int(ctx, el->GetBrakeBoosterSpeed()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void brakeBoosterSpeed_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - if (TrackTypeHasSpeedSetting(el->GetTrackType())) - { - el->SetBrakeBoosterSpeed(value); - Invalidate(); - } - } - - DukValue isInverted_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr) - duk_push_boolean(ctx, el->IsInverted()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isInverted_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - { - el->SetInverted(value); - Invalidate(); - } - } - - DukValue hasCableLift_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsTrack(); - if (el != nullptr) - duk_push_boolean(ctx, el->HasCableLift()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void hasCableLift_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsTrack(); - if (el != nullptr) - { - el->SetHasCableLift(value); - Invalidate(); - } - } - - DukValue object_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - duk_push_int(ctx, el->GetSurfaceEntryIndex()); - break; - } - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - duk_push_int(ctx, el->GetEntryIndex()); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - duk_push_int(ctx, el->GetEntryIndex()); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - duk_push_int(ctx, el->GetEntryIndex()); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - duk_push_int(ctx, el->GetEntranceType()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void object_set(uint32_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_PATH: - { - auto el = _element->AsPath(); - el->SetSurfaceEntryIndex(value & 0xFF); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - el->SetEntryIndex(value & 0xFF); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - el->SetEntryIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - el->SetEntryIndex(value & 0xFFFF); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto el = _element->AsEntrance(); - el->SetEntranceType(value & 0xFF); - Invalidate(); - break; - } - } - } - - bool isHidden_get() const - { - // TODO: Simply return the 'hidden' field once corrupt elements are superseded. - const TileElement* element = map_get_first_element_at(_coords); - bool previousElementWasUsefulCorrupt = false; - do - { - if (element == _element) - return previousElementWasUsefulCorrupt; - - if (element->GetType() == TILE_ELEMENT_TYPE_CORRUPT) - previousElementWasUsefulCorrupt = !previousElementWasUsefulCorrupt; - else - previousElementWasUsefulCorrupt = false; - } while (!(element++)->IsLastForTile()); - - Guard::Assert(false); - return false; - } - void isHidden_set(bool hide) - { - // TODO: Simply update the 'hidden' field once corrupt elements are superseded. - ThrowIfGameStateNotMutable(); - const bool isHidden = isHidden_get(); - if (hide == isHidden) - return; - - if (hide) - { - // Get index of our current element (has to be done now before inserting the corrupt element) - const auto elementIndex = _element - map_get_first_element_at(_coords); - - // Insert corrupt element at the end of the list for this tile - // Note: Z = MAX_ELEMENT_HEIGHT to guarantee this - TileElement* insertedElement = tile_element_insert( - { _coords, MAX_ELEMENT_HEIGHT * COORDS_Z_STEP }, 0, TileElementType::Corrupt); - if (insertedElement == nullptr) - { - // TODO: Show error - return; - } - - // Since inserting a new element may move the tile elements in memory, we have to update the local pointer - _element = map_get_first_element_at(_coords) + elementIndex; - - // Move the corrupt element down in the list until it's right under our element - while (insertedElement > _element) - { - std::swap(*insertedElement, *(insertedElement - 1)); - insertedElement--; - - // Un-swap the last-for-tile flag - if (insertedElement->IsLastForTile()) - { - insertedElement->SetLastForTile(false); - (insertedElement + 1)->SetLastForTile(true); - } - } - - // Now the corrupt element took the hidden element's place, increment it by one - _element++; - - // Update base and clearance heights of inserted corrupt element to match the element to hide - insertedElement->base_height = insertedElement->clearance_height = _element->base_height; - } - else - { - TileElement* const elementToRemove = _element - 1; - Guard::Assert(elementToRemove->GetType() == TILE_ELEMENT_TYPE_CORRUPT); - tile_element_remove(elementToRemove); - _element--; - } - - Invalidate(); - } - - DukValue age_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSmallScenery(); - if (el != nullptr) - duk_push_int(ctx, el->GetAge()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void age_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSmallScenery(); - if (el != nullptr) - { - el->SetAge(value); - Invalidate(); - } - } - - DukValue quadrant_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsSmallScenery(); - if (el != nullptr) - duk_push_int(ctx, el->GetSceneryQuadrant()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void quadrant_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsSmallScenery(); - if (el != nullptr) - { - el->SetSceneryQuadrant(value); - Invalidate(); - } - } - - uint8_t occupiedQuadrants_get() const - { - return _element->GetOccupiedQuadrants(); - } - void occupiedQuadrants_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - _element->SetOccupiedQuadrants(value); - Invalidate(); - } - - bool isGhost_get() const - { - return _element->IsGhost(); - } - void isGhost_set(bool value) - { - ThrowIfGameStateNotMutable(); - _element->SetGhost(value); - Invalidate(); - } - - DukValue primaryColour_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - duk_push_int(ctx, el->GetPrimaryColour()); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - duk_push_int(ctx, el->GetPrimaryColour()); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - duk_push_int(ctx, el->GetPrimaryColour()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void primaryColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - el->SetPrimaryColour(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - el->SetPrimaryColour(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - el->SetPrimaryColour(value); - Invalidate(); - break; - } - } - } - - DukValue secondaryColour_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - duk_push_int(ctx, el->GetSecondaryColour()); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - duk_push_int(ctx, el->GetSecondaryColour()); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - duk_push_int(ctx, el->GetSecondaryColour()); - break; - } - default: - { - duk_push_null(ctx); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void secondaryColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto el = _element->AsSmallScenery(); - el->SetSecondaryColour(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - el->SetSecondaryColour(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - el->SetSecondaryColour(value); - Invalidate(); - break; - } - } - } - - DukValue tertiaryColour_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsWall(); - if (el != nullptr) - duk_push_int(ctx, el->GetTertiaryColour()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void tertiaryColour_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsWall(); - if (el != nullptr) - { - el->SetTertiaryColour(value); - Invalidate(); - } - } - - DukValue bannerIndex_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - BannerIndex idx = _element->GetBannerIndex(); - if (idx == BANNER_INDEX_NULL) - duk_push_null(ctx); - else - duk_push_int(ctx, idx); - return DukValue::take_from_stack(ctx); - } - void bannerIndex_set(uint16_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto el = _element->AsLargeScenery(); - el->SetBannerIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto el = _element->AsWall(); - el->SetBannerIndex(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_BANNER: - { - auto el = _element->AsBanner(); - el->SetIndex(value); - Invalidate(); - break; - } - } - } - - // Deprecated in favor of seperate 'edges' and 'corners' properties, - // left here to maintain compatibility with older plugins. - /** @deprecated */ - uint8_t edgesAndCorners_get() const - { - auto el = _element->AsPath(); - return el != nullptr ? el->GetEdgesAndCorners() : 0; - } - /** @deprecated */ - void edgesAndCorners_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetEdgesAndCorners(value); - Invalidate(); - } - } - - DukValue edges_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr) - duk_push_int(ctx, el->GetEdges()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void edges_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetEdges(value); - Invalidate(); - } - } - - DukValue corners_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr) - duk_push_int(ctx, el->GetCorners()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void corners_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetCorners(value); - Invalidate(); - } - } - - DukValue slopeDirection_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->IsSloped()) - duk_push_int(ctx, el->GetSlopeDirection()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void slopeDirection_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - if (value.type() == DukValue::Type::NUMBER) - { - el->SetSloped(true); - el->SetSlopeDirection(value.as_int()); - } - else - { - el->SetSloped(false); - el->SetSlopeDirection(0); - } - Invalidate(); - } - } - - DukValue isQueue_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr) - duk_push_boolean(ctx, el->IsQueue()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isQueue_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetIsQueue(value); - Invalidate(); - } - } - - DukValue queueBannerDirection_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->HasQueueBanner()) - duk_push_int(ctx, el->GetQueueBannerDirection()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void queueBannerDirection_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - if (value.type() == DukValue::Type::NUMBER) - { - el->SetHasQueueBanner(true); - el->SetQueueBannerDirection(value.as_int()); - } - else - { - el->SetHasQueueBanner(false); - el->SetQueueBannerDirection(0); - } - Invalidate(); - } - } - - DukValue isBlockedByVehicle_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr) - duk_push_boolean(ctx, el->IsBlockedByVehicle()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isBlockedByVehicle_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetIsBlockedByVehicle(value); - Invalidate(); - } - } - - DukValue isWide_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr) - duk_push_boolean(ctx, el->IsWide()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isWide_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetWide(value); - Invalidate(); - } - } - - DukValue addition_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->HasAddition()) - duk_push_int(ctx, el->GetAddition() - 1); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void addition_set(const DukValue& value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - if (value.type() == DukValue::Type::NUMBER) - { - auto addition = value.as_int(); - if (addition >= 0 && addition <= 254) - { - el->SetAddition(addition + 1); - } - } - else - { - el->SetAddition(0); - } - Invalidate(); - } - } - - DukValue additionStatus_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->HasAddition()) - duk_push_int(ctx, el->GetAdditionStatus()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void additionStatus_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - if (el->HasAddition()) - { - el->SetAdditionStatus(value); - Invalidate(); - } - } - - DukValue isAdditionBroken_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->HasAddition()) - duk_push_boolean(ctx, el->IsBroken()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isAdditionBroken_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetIsBroken(value); - Invalidate(); - } - } - - DukValue isAdditionGhost_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsPath(); - if (el != nullptr && el->HasAddition()) - duk_push_boolean(ctx, el->AdditionIsGhost()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void isAdditionGhost_set(bool value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsPath(); - if (el != nullptr) - { - el->SetAdditionIsGhost(value); - Invalidate(); - } - } - - DukValue footpathObject_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - auto el = _element->AsEntrance(); - if (el != nullptr) - duk_push_int(ctx, el->GetPathType()); - else - duk_push_null(ctx); - return DukValue::take_from_stack(ctx); - } - void footpathObject_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - auto el = _element->AsEntrance(); - if (el != nullptr) - { - el->SetPathType(value); - Invalidate(); - } - } - - DukValue direction_get() const - { - auto ctx = GetContext()->GetScriptEngine().GetContext(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_BANNER: - { - auto el = _element->AsBanner(); - duk_push_int(ctx, el->GetPosition()); - break; - } - case TILE_ELEMENT_TYPE_PATH: - case TILE_ELEMENT_TYPE_SURFACE: - { - duk_push_null(ctx); - break; - } - default: - { - duk_push_int(ctx, _element->GetDirection()); - break; - } - } - return DukValue::take_from_stack(ctx); - } - void direction_set(uint8_t value) - { - ThrowIfGameStateNotMutable(); - switch (_element->GetType()) - { - case TILE_ELEMENT_TYPE_BANNER: - { - auto el = _element->AsBanner(); - el->SetPosition(value); - Invalidate(); - break; - } - case TILE_ELEMENT_TYPE_PATH: - case TILE_ELEMENT_TYPE_SURFACE: - { - break; - } - default: - { - _element->SetDirection(value); - Invalidate(); - } - } - } - - void Invalidate() - { - map_invalidate_tile_full(_coords); - } - - public: - static void Register(duk_context* ctx) - { - // All - dukglue_register_property(ctx, &ScTileElement::type_get, &ScTileElement::type_set, "type"); - dukglue_register_property(ctx, &ScTileElement::baseHeight_get, &ScTileElement::baseHeight_set, "baseHeight"); - dukglue_register_property(ctx, &ScTileElement::baseZ_get, &ScTileElement::baseZ_set, "baseZ"); - dukglue_register_property( - ctx, &ScTileElement::clearanceHeight_get, &ScTileElement::clearanceHeight_set, "clearanceHeight"); - dukglue_register_property(ctx, &ScTileElement::clearanceZ_get, &ScTileElement::clearanceZ_set, "clearanceZ"); - dukglue_register_property( - ctx, &ScTileElement::occupiedQuadrants_get, &ScTileElement::occupiedQuadrants_set, "occupiedQuadrants"); - dukglue_register_property(ctx, &ScTileElement::isGhost_get, &ScTileElement::isGhost_set, "isGhost"); - dukglue_register_property(ctx, &ScTileElement::isHidden_get, &ScTileElement::isHidden_set, "isHidden"); - - // 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 - dukglue_register_property(ctx, &ScTileElement::object_get, &ScTileElement::object_set, "object"); - - // Small Scenery | Wall | Large Scenery - dukglue_register_property( - ctx, &ScTileElement::primaryColour_get, &ScTileElement::primaryColour_set, "primaryColour"); - dukglue_register_property( - ctx, &ScTileElement::secondaryColour_get, &ScTileElement::secondaryColour_set, "secondaryColour"); - - // Wall | Large Scenery | Banner - dukglue_register_property(ctx, &ScTileElement::bannerIndex_get, &ScTileElement::bannerIndex_set, "bannerIndex"); - - // Path | Track | Entrance - dukglue_register_property(ctx, &ScTileElement::ride_get, &ScTileElement::ride_set, "ride"); - dukglue_register_property(ctx, &ScTileElement::station_get, &ScTileElement::station_set, "station"); - - // Track | Entrance | Large Scenery - dukglue_register_property(ctx, &ScTileElement::sequence_get, &ScTileElement::sequence_set, "sequence"); - - // Surface | Wall - dukglue_register_property(ctx, &ScTileElement::slope_get, &ScTileElement::slope_set, "slope"); - - // Surface only - dukglue_register_property(ctx, &ScTileElement::waterHeight_get, &ScTileElement::waterHeight_set, "waterHeight"); - dukglue_register_property(ctx, &ScTileElement::surfaceStyle_get, &ScTileElement::surfaceStyle_set, "surfaceStyle"); - dukglue_register_property(ctx, &ScTileElement::edgeStyle_get, &ScTileElement::edgeStyle_set, "edgeStyle"); - dukglue_register_property(ctx, &ScTileElement::grassLength_get, &ScTileElement::grassLength_set, "grassLength"); - dukglue_register_property(ctx, &ScTileElement::hasOwnership_get, nullptr, "hasOwnership"); - dukglue_register_property(ctx, &ScTileElement::hasConstructionRights_get, nullptr, "hasConstructionRights"); - dukglue_register_property(ctx, &ScTileElement::ownership_get, &ScTileElement::ownership_set, "ownership"); - dukglue_register_property(ctx, &ScTileElement::parkFences_get, &ScTileElement::parkFences_set, "parkFences"); - - // Footpath only - dukglue_register_property( - ctx, &ScTileElement::edgesAndCorners_get, &ScTileElement::edgesAndCorners_set, "edgesAndCorners"); - dukglue_register_property(ctx, &ScTileElement::edges_get, &ScTileElement::edges_set, "edges"); - dukglue_register_property(ctx, &ScTileElement::corners_get, &ScTileElement::corners_set, "corners"); - dukglue_register_property( - ctx, &ScTileElement::slopeDirection_get, &ScTileElement::slopeDirection_set, "slopeDirection"); - dukglue_register_property(ctx, &ScTileElement::isQueue_get, &ScTileElement::isQueue_set, "isQueue"); - dukglue_register_property( - ctx, &ScTileElement::queueBannerDirection_get, &ScTileElement::queueBannerDirection_set, - "queueBannerDirection"); - dukglue_register_property(ctx, &ScTileElement::queueBannerDirection_get, &ScTileElement::edges_set, "test"); - - dukglue_register_property( - ctx, &ScTileElement::isBlockedByVehicle_get, &ScTileElement::isBlockedByVehicle_set, "isBlockedByVehicle"); - dukglue_register_property(ctx, &ScTileElement::isWide_get, &ScTileElement::isWide_set, "isWide"); - - dukglue_register_property(ctx, &ScTileElement::addition_get, &ScTileElement::addition_set, "addition"); - dukglue_register_property( - ctx, &ScTileElement::additionStatus_get, &ScTileElement::additionStatus_set, "additionStatus"); - dukglue_register_property( - ctx, &ScTileElement::isAdditionBroken_get, &ScTileElement::isAdditionBroken_set, "isAdditionBroken"); - dukglue_register_property( - ctx, &ScTileElement::isAdditionGhost_get, &ScTileElement::isAdditionGhost_set, "isAdditionGhost"); - - // Track only - dukglue_register_property(ctx, &ScTileElement::trackType_get, &ScTileElement::trackType_set, "trackType"); - dukglue_register_property(ctx, &ScTileElement::mazeEntry_get, &ScTileElement::mazeEntry_set, "mazeEntry"); - dukglue_register_property(ctx, &ScTileElement::colourScheme_get, &ScTileElement::colourScheme_set, "colourScheme"); - dukglue_register_property(ctx, &ScTileElement::seatRotation_get, &ScTileElement::seatRotation_set, "seatRotation"); - dukglue_register_property( - ctx, &ScTileElement::brakeBoosterSpeed_get, &ScTileElement::brakeBoosterSpeed_set, "brakeBoosterSpeed"); - dukglue_register_property(ctx, &ScTileElement::hasChainLift_get, &ScTileElement::hasChainLift_set, "hasChainLift"); - dukglue_register_property(ctx, &ScTileElement::isInverted_get, &ScTileElement::isInverted_set, "isInverted"); - dukglue_register_property(ctx, &ScTileElement::hasCableLift_get, &ScTileElement::hasCableLift_set, "hasCableLift"); - - // Small Scenery only - dukglue_register_property(ctx, &ScTileElement::age_get, &ScTileElement::age_set, "age"); - dukglue_register_property(ctx, &ScTileElement::quadrant_get, &ScTileElement::quadrant_set, "quadrant"); - - // Wall only - dukglue_register_property( - ctx, &ScTileElement::tertiaryColour_get, &ScTileElement::tertiaryColour_set, "tertiaryColour"); - - // Entrance only - dukglue_register_property( - ctx, &ScTileElement::footpathObject_get, &ScTileElement::footpathObject_set, "footpathObject"); - } - }; - class ScTile { private: diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp new file mode 100644 index 0000000000..40251c55a4 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -0,0 +1,1569 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScTileElement.hpp" + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../core/Guard.hpp" +# include "../../../ride/Track.h" +# include "../../../world/Footpath.h" +# include "../../../world/Scenery.h" +# include "../../../world/Sprite.h" +# include "../../../world/Surface.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" + +# include +# include +# include + +namespace OpenRCT2::Scripting +{ + ScTileElement::ScTileElement(const CoordsXY& coords, TileElement* element) + : _coords(coords) + , _element(element) + { + } + + std::string ScTileElement::type_get() const + { + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SURFACE: + return "surface"; + case TILE_ELEMENT_TYPE_PATH: + return "footpath"; + case TILE_ELEMENT_TYPE_TRACK: + return "track"; + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + return "small_scenery"; + case TILE_ELEMENT_TYPE_ENTRANCE: + return "entrance"; + case TILE_ELEMENT_TYPE_WALL: + return "wall"; + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + return "large_scenery"; + case TILE_ELEMENT_TYPE_BANNER: + return "banner"; + case TILE_ELEMENT_TYPE_CORRUPT: + return "openrct2_corrupt_deprecated"; + default: + return "unknown"; + } + } + + void ScTileElement::type_set(std::string value) + { + auto type = _element->type; + if (value == "surface") + type = TILE_ELEMENT_TYPE_SURFACE; + else if (value == "footpath") + type = TILE_ELEMENT_TYPE_PATH; + else if (value == "track") + type = TILE_ELEMENT_TYPE_TRACK; + else if (value == "small_scenery") + type = TILE_ELEMENT_TYPE_SMALL_SCENERY; + else if (value == "entrance") + type = TILE_ELEMENT_TYPE_ENTRANCE; + else if (value == "wall") + type = TILE_ELEMENT_TYPE_WALL; + else if (value == "large_scenery") + type = TILE_ELEMENT_TYPE_LARGE_SCENERY; + else if (value == "banner") + type = TILE_ELEMENT_TYPE_BANNER; + else + { + if (value == "openrct2_corrupt_deprecated") + std::puts( + "Creation of new corrupt elements is deprecated. To hide elements, use the 'hidden' property instead."); + return; + } + + _element->type = type; + Invalidate(); + } + + uint8_t ScTileElement::baseHeight_get() const + { + return _element->base_height; + } + void ScTileElement::baseHeight_set(uint8_t newBaseHeight) + { + ThrowIfGameStateNotMutable(); + _element->base_height = newBaseHeight; + Invalidate(); + } + + uint16_t ScTileElement::baseZ_get() const + { + return _element->GetBaseZ(); + } + void ScTileElement::baseZ_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + _element->SetBaseZ(value); + Invalidate(); + } + + uint8_t ScTileElement::clearanceHeight_get() const + { + return _element->clearance_height; + } + void ScTileElement::clearanceHeight_set(uint8_t newClearanceHeight) + { + ThrowIfGameStateNotMutable(); + _element->clearance_height = newClearanceHeight; + Invalidate(); + } + + uint16_t ScTileElement::clearanceZ_get() const + { + return _element->GetClearanceZ(); + } + void ScTileElement::clearanceZ_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + _element->SetClearanceZ(value); + Invalidate(); + } + + DukValue ScTileElement::slope_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SURFACE: + { + auto el = _element->AsSurface(); + duk_push_int(ctx, el->GetSlope()); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + duk_push_int(ctx, el->GetSlope()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::slope_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SURFACE: + { + auto el = _element->AsSurface(); + el->SetSlope(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + el->SetSlope(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::waterHeight_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetWaterHeight()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::waterHeight_set(int32_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + el->SetWaterHeight(value); + Invalidate(); + } + } + + DukValue ScTileElement::surfaceStyle_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetSurfaceStyle()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::surfaceStyle_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + el->SetSurfaceStyle(value); + Invalidate(); + } + } + + DukValue ScTileElement::edgeStyle_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetEdgeStyle()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::edgeStyle_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + el->SetEdgeStyle(value); + Invalidate(); + } + } + + DukValue ScTileElement::grassLength_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetGrassLength()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::grassLength_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + // TODO: Give warning when value > GRASS_LENGTH_CLUMPS_2 + el->SetGrassLengthAndInvalidate(value, _coords); + Invalidate(); + } + } + + DukValue ScTileElement::hasOwnership_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_boolean(ctx, el->GetOwnership() & OWNERSHIP_OWNED); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + + DukValue ScTileElement::hasConstructionRights_get() + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + auto ownership = el->GetOwnership(); + duk_push_boolean(ctx, (ownership & OWNERSHIP_OWNED) || (ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)); + } + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + + DukValue ScTileElement::ownership_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetOwnership()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::ownership_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + el->SetOwnership(value); + Invalidate(); + } + } + + DukValue ScTileElement::parkFences_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSurface(); + if (el != nullptr) + duk_push_int(ctx, el->GetParkFences()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::parkFences_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSurface(); + if (el != nullptr) + { + el->SetParkFences(value); + Invalidate(); + } + } + + DukValue ScTileElement::trackType_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr) + duk_push_int(ctx, el->GetTrackType()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::trackType_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + { + el->SetTrackType(value); + Invalidate(); + } + } + + DukValue ScTileElement::sequence_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + duk_push_int(ctx, el->GetSequenceIndex()); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + duk_push_int(ctx, el->GetSequenceIndex()); + else + duk_push_null(ctx); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + duk_push_int(ctx, el->GetSequenceIndex()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::sequence_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + el->SetSequenceIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + { + el->SetSequenceIndex(value); + Invalidate(); + } + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + el->SetSequenceIndex(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::ride_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL) + duk_push_int(ctx, el->GetRideIndex()); + else + duk_push_null(ctx); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + duk_push_int(ctx, el->GetRideIndex()); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + duk_push_int(ctx, el->GetRideIndex()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::ride_set(ride_id_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + if (!el->HasAddition()) + { + el->SetRideIndex(value); + Invalidate(); + } + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + el->SetRideIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + el->SetRideIndex(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::station_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL) + duk_push_int(ctx, el->GetStationIndex()); + else + duk_push_null(ctx); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + if (el->IsStation()) + duk_push_int(ctx, el->GetStationIndex()); + else + duk_push_null(ctx); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + duk_push_int(ctx, el->GetStationIndex()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::station_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + el->SetStationIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto el = _element->AsTrack(); + el->SetStationIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + el->SetStationIndex(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::hasChainLift_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr) + duk_push_boolean(ctx, el->HasChain()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::hasChainLift_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + { + el->SetHasChain(value); + Invalidate(); + } + } + + DukValue ScTileElement::mazeEntry_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr && get_ride(el->GetRideIndex())->type == RIDE_TYPE_MAZE) + duk_push_int(ctx, el->GetMazeEntry()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::mazeEntry_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + if (get_ride(el->GetRideIndex())->type == RIDE_TYPE_MAZE) + { + el->SetMazeEntry(value); + Invalidate(); + } + } + + DukValue ScTileElement::colourScheme_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr && get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + duk_push_int(ctx, el->GetColourScheme()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::colourScheme_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + { + el->SetColourScheme(value); + Invalidate(); + } + } + + DukValue ScTileElement::seatRotation_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr && get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + duk_push_int(ctx, el->GetSeatRotation()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::seatRotation_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE) + { + el->SetSeatRotation(value); + Invalidate(); + } + } + + DukValue ScTileElement::brakeBoosterSpeed_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr && TrackTypeHasSpeedSetting(el->GetTrackType())) + duk_push_int(ctx, el->GetBrakeBoosterSpeed()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::brakeBoosterSpeed_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + if (TrackTypeHasSpeedSetting(el->GetTrackType())) + { + el->SetBrakeBoosterSpeed(value); + Invalidate(); + } + } + + DukValue ScTileElement::isInverted_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr) + duk_push_boolean(ctx, el->IsInverted()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isInverted_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + { + el->SetInverted(value); + Invalidate(); + } + } + + DukValue ScTileElement::hasCableLift_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsTrack(); + if (el != nullptr) + duk_push_boolean(ctx, el->HasCableLift()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::hasCableLift_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsTrack(); + if (el != nullptr) + { + el->SetHasCableLift(value); + Invalidate(); + } + } + + DukValue ScTileElement::object_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + duk_push_int(ctx, el->GetSurfaceEntryIndex()); + break; + } + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + duk_push_int(ctx, el->GetEntryIndex()); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + duk_push_int(ctx, el->GetEntryIndex()); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + duk_push_int(ctx, el->GetEntryIndex()); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + duk_push_int(ctx, el->GetEntranceType()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::object_set(uint32_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + auto el = _element->AsPath(); + el->SetSurfaceEntryIndex(value & 0xFF); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + el->SetEntryIndex(value & 0xFF); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + el->SetEntryIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + el->SetEntryIndex(value & 0xFFFF); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto el = _element->AsEntrance(); + el->SetEntranceType(value & 0xFF); + Invalidate(); + break; + } + } + } + + bool ScTileElement::isHidden_get() const + { + // TODO: Simply return the 'hidden' field once corrupt elements are superseded. + const TileElement* element = map_get_first_element_at(_coords); + bool previousElementWasUsefulCorrupt = false; + do + { + if (element == _element) + return previousElementWasUsefulCorrupt; + + if (element->GetType() == TILE_ELEMENT_TYPE_CORRUPT) + previousElementWasUsefulCorrupt = !previousElementWasUsefulCorrupt; + else + previousElementWasUsefulCorrupt = false; + } while (!(element++)->IsLastForTile()); + + Guard::Assert(false); + return false; + } + void ScTileElement::isHidden_set(bool hide) + { + // TODO: Simply update the 'hidden' field once corrupt elements are superseded. + ThrowIfGameStateNotMutable(); + const bool isHidden = isHidden_get(); + if (hide == isHidden) + return; + + if (hide) + { + // Get index of our current element (has to be done now before inserting the corrupt element) + const auto elementIndex = _element - map_get_first_element_at(_coords); + + // Insert corrupt element at the end of the list for this tile + // Note: Z = MAX_ELEMENT_HEIGHT to guarantee this + TileElement* insertedElement = tile_element_insert( + { _coords, MAX_ELEMENT_HEIGHT * COORDS_Z_STEP }, 0, TileElementType::Corrupt); + if (insertedElement == nullptr) + { + // TODO: Show error + return; + } + + // Since inserting a new element may move the tile elements in memory, we have to update the local pointer + _element = map_get_first_element_at(_coords) + elementIndex; + + // Move the corrupt element down in the list until it's right under our element + while (insertedElement > _element) + { + std::swap(*insertedElement, *(insertedElement - 1)); + insertedElement--; + + // Un-swap the last-for-tile flag + if (insertedElement->IsLastForTile()) + { + insertedElement->SetLastForTile(false); + (insertedElement + 1)->SetLastForTile(true); + } + } + + // Now the corrupt element took the hidden element's place, increment it by one + _element++; + + // Update base and clearance heights of inserted corrupt element to match the element to hide + insertedElement->base_height = insertedElement->clearance_height = _element->base_height; + } + else + { + TileElement* const elementToRemove = _element - 1; + Guard::Assert(elementToRemove->GetType() == TILE_ELEMENT_TYPE_CORRUPT); + tile_element_remove(elementToRemove); + _element--; + } + + Invalidate(); + } + + DukValue ScTileElement::age_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSmallScenery(); + if (el != nullptr) + duk_push_int(ctx, el->GetAge()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::age_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSmallScenery(); + if (el != nullptr) + { + el->SetAge(value); + Invalidate(); + } + } + + DukValue ScTileElement::quadrant_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsSmallScenery(); + if (el != nullptr) + duk_push_int(ctx, el->GetSceneryQuadrant()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::quadrant_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsSmallScenery(); + if (el != nullptr) + { + el->SetSceneryQuadrant(value); + Invalidate(); + } + } + + uint8_t ScTileElement::occupiedQuadrants_get() const + { + return _element->GetOccupiedQuadrants(); + } + void ScTileElement::occupiedQuadrants_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + _element->SetOccupiedQuadrants(value); + Invalidate(); + } + + bool ScTileElement::isGhost_get() const + { + return _element->IsGhost(); + } + void ScTileElement::isGhost_set(bool value) + { + ThrowIfGameStateNotMutable(); + _element->SetGhost(value); + Invalidate(); + } + + DukValue ScTileElement::primaryColour_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + duk_push_int(ctx, el->GetPrimaryColour()); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + duk_push_int(ctx, el->GetPrimaryColour()); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + duk_push_int(ctx, el->GetPrimaryColour()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::primaryColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + el->SetPrimaryColour(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + el->SetPrimaryColour(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + el->SetPrimaryColour(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::secondaryColour_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + duk_push_int(ctx, el->GetSecondaryColour()); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + duk_push_int(ctx, el->GetSecondaryColour()); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + duk_push_int(ctx, el->GetSecondaryColour()); + break; + } + default: + { + duk_push_null(ctx); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::secondaryColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto el = _element->AsSmallScenery(); + el->SetSecondaryColour(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + el->SetSecondaryColour(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + el->SetSecondaryColour(value); + Invalidate(); + break; + } + } + } + + DukValue ScTileElement::tertiaryColour_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsWall(); + if (el != nullptr) + duk_push_int(ctx, el->GetTertiaryColour()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::tertiaryColour_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsWall(); + if (el != nullptr) + { + el->SetTertiaryColour(value); + Invalidate(); + } + } + + DukValue ScTileElement::bannerIndex_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + BannerIndex idx = _element->GetBannerIndex(); + if (idx == BANNER_INDEX_NULL) + duk_push_null(ctx); + else + duk_push_int(ctx, idx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::bannerIndex_set(uint16_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto el = _element->AsLargeScenery(); + el->SetBannerIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto el = _element->AsWall(); + el->SetBannerIndex(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_BANNER: + { + auto el = _element->AsBanner(); + el->SetIndex(value); + Invalidate(); + break; + } + } + } + + // Deprecated in favor of seperate 'edges' and 'corners' properties, + // left here to maintain compatibility with older plugins. + /** @deprecated */ + uint8_t ScTileElement::edgesAndCorners_get() const + { + auto el = _element->AsPath(); + return el != nullptr ? el->GetEdgesAndCorners() : 0; + } + /** @deprecated */ + void ScTileElement::edgesAndCorners_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetEdgesAndCorners(value); + Invalidate(); + } + } + + DukValue ScTileElement::edges_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr) + duk_push_int(ctx, el->GetEdges()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::edges_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetEdges(value); + Invalidate(); + } + } + + DukValue ScTileElement::corners_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr) + duk_push_int(ctx, el->GetCorners()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::corners_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetCorners(value); + Invalidate(); + } + } + + DukValue ScTileElement::slopeDirection_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->IsSloped()) + duk_push_int(ctx, el->GetSlopeDirection()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::slopeDirection_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + if (value.type() == DukValue::Type::NUMBER) + { + el->SetSloped(true); + el->SetSlopeDirection(value.as_int()); + } + else + { + el->SetSloped(false); + el->SetSlopeDirection(0); + } + Invalidate(); + } + } + + DukValue ScTileElement::isQueue_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr) + duk_push_boolean(ctx, el->IsQueue()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isQueue_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetIsQueue(value); + Invalidate(); + } + } + + DukValue ScTileElement::queueBannerDirection_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->HasQueueBanner()) + duk_push_int(ctx, el->GetQueueBannerDirection()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::queueBannerDirection_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + if (value.type() == DukValue::Type::NUMBER) + { + el->SetHasQueueBanner(true); + el->SetQueueBannerDirection(value.as_int()); + } + else + { + el->SetHasQueueBanner(false); + el->SetQueueBannerDirection(0); + } + Invalidate(); + } + } + + DukValue ScTileElement::isBlockedByVehicle_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr) + duk_push_boolean(ctx, el->IsBlockedByVehicle()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isBlockedByVehicle_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetIsBlockedByVehicle(value); + Invalidate(); + } + } + + DukValue ScTileElement::isWide_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr) + duk_push_boolean(ctx, el->IsWide()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isWide_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetWide(value); + Invalidate(); + } + } + + DukValue ScTileElement::addition_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->HasAddition()) + duk_push_int(ctx, el->GetAddition() - 1); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::addition_set(const DukValue& value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + if (value.type() == DukValue::Type::NUMBER) + { + auto addition = value.as_int(); + if (addition >= 0 && addition <= 254) + { + el->SetAddition(addition + 1); + } + } + else + { + el->SetAddition(0); + } + Invalidate(); + } + } + + DukValue ScTileElement::additionStatus_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->HasAddition()) + duk_push_int(ctx, el->GetAdditionStatus()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::additionStatus_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + if (el->HasAddition()) + { + el->SetAdditionStatus(value); + Invalidate(); + } + } + + DukValue ScTileElement::isAdditionBroken_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->HasAddition()) + duk_push_boolean(ctx, el->IsBroken()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isAdditionBroken_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetIsBroken(value); + Invalidate(); + } + } + + DukValue ScTileElement::isAdditionGhost_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsPath(); + if (el != nullptr && el->HasAddition()) + duk_push_boolean(ctx, el->AdditionIsGhost()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isAdditionGhost_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsPath(); + if (el != nullptr) + { + el->SetAdditionIsGhost(value); + Invalidate(); + } + } + + DukValue ScTileElement::footpathObject_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + auto el = _element->AsEntrance(); + if (el != nullptr) + duk_push_int(ctx, el->GetPathType()); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::footpathObject_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + auto el = _element->AsEntrance(); + if (el != nullptr) + { + el->SetPathType(value); + Invalidate(); + } + } + + DukValue ScTileElement::direction_get() const + { + auto ctx = GetContext()->GetScriptEngine().GetContext(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_BANNER: + { + auto el = _element->AsBanner(); + duk_push_int(ctx, el->GetPosition()); + break; + } + case TILE_ELEMENT_TYPE_PATH: + case TILE_ELEMENT_TYPE_SURFACE: + { + duk_push_null(ctx); + break; + } + default: + { + duk_push_int(ctx, _element->GetDirection()); + break; + } + } + return DukValue::take_from_stack(ctx); + } + void ScTileElement::direction_set(uint8_t value) + { + ThrowIfGameStateNotMutable(); + switch (_element->GetType()) + { + case TILE_ELEMENT_TYPE_BANNER: + { + auto el = _element->AsBanner(); + el->SetPosition(value); + Invalidate(); + break; + } + case TILE_ELEMENT_TYPE_PATH: + case TILE_ELEMENT_TYPE_SURFACE: + { + break; + } + default: + { + _element->SetDirection(value); + Invalidate(); + } + } + } + + void ScTileElement::Invalidate() + { + map_invalidate_tile_full(_coords); + } + + void ScTileElement::Register(duk_context* ctx) + { + // All + dukglue_register_property(ctx, &ScTileElement::type_get, &ScTileElement::type_set, "type"); + dukglue_register_property(ctx, &ScTileElement::baseHeight_get, &ScTileElement::baseHeight_set, "baseHeight"); + dukglue_register_property(ctx, &ScTileElement::baseZ_get, &ScTileElement::baseZ_set, "baseZ"); + dukglue_register_property( + ctx, &ScTileElement::clearanceHeight_get, &ScTileElement::clearanceHeight_set, "clearanceHeight"); + dukglue_register_property(ctx, &ScTileElement::clearanceZ_get, &ScTileElement::clearanceZ_set, "clearanceZ"); + dukglue_register_property( + ctx, &ScTileElement::occupiedQuadrants_get, &ScTileElement::occupiedQuadrants_set, "occupiedQuadrants"); + dukglue_register_property(ctx, &ScTileElement::isGhost_get, &ScTileElement::isGhost_set, "isGhost"); + dukglue_register_property(ctx, &ScTileElement::isHidden_get, &ScTileElement::isHidden_set, "isHidden"); + + // 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 + dukglue_register_property(ctx, &ScTileElement::object_get, &ScTileElement::object_set, "object"); + + // Small Scenery | Wall | Large Scenery + dukglue_register_property(ctx, &ScTileElement::primaryColour_get, &ScTileElement::primaryColour_set, "primaryColour"); + dukglue_register_property( + ctx, &ScTileElement::secondaryColour_get, &ScTileElement::secondaryColour_set, "secondaryColour"); + + // Wall | Large Scenery | Banner + dukglue_register_property(ctx, &ScTileElement::bannerIndex_get, &ScTileElement::bannerIndex_set, "bannerIndex"); + + // Path | Track | Entrance + dukglue_register_property(ctx, &ScTileElement::ride_get, &ScTileElement::ride_set, "ride"); + dukglue_register_property(ctx, &ScTileElement::station_get, &ScTileElement::station_set, "station"); + + // Track | Entrance | Large Scenery + dukglue_register_property(ctx, &ScTileElement::sequence_get, &ScTileElement::sequence_set, "sequence"); + + // Surface | Wall + dukglue_register_property(ctx, &ScTileElement::slope_get, &ScTileElement::slope_set, "slope"); + + // Surface only + dukglue_register_property(ctx, &ScTileElement::waterHeight_get, &ScTileElement::waterHeight_set, "waterHeight"); + dukglue_register_property(ctx, &ScTileElement::surfaceStyle_get, &ScTileElement::surfaceStyle_set, "surfaceStyle"); + dukglue_register_property(ctx, &ScTileElement::edgeStyle_get, &ScTileElement::edgeStyle_set, "edgeStyle"); + dukglue_register_property(ctx, &ScTileElement::grassLength_get, &ScTileElement::grassLength_set, "grassLength"); + dukglue_register_property(ctx, &ScTileElement::hasOwnership_get, nullptr, "hasOwnership"); + dukglue_register_property(ctx, &ScTileElement::hasConstructionRights_get, nullptr, "hasConstructionRights"); + dukglue_register_property(ctx, &ScTileElement::ownership_get, &ScTileElement::ownership_set, "ownership"); + dukglue_register_property(ctx, &ScTileElement::parkFences_get, &ScTileElement::parkFences_set, "parkFences"); + + // Footpath only + dukglue_register_property( + ctx, &ScTileElement::edgesAndCorners_get, &ScTileElement::edgesAndCorners_set, "edgesAndCorners"); + dukglue_register_property(ctx, &ScTileElement::edges_get, &ScTileElement::edges_set, "edges"); + dukglue_register_property(ctx, &ScTileElement::corners_get, &ScTileElement::corners_set, "corners"); + dukglue_register_property( + ctx, &ScTileElement::slopeDirection_get, &ScTileElement::slopeDirection_set, "slopeDirection"); + dukglue_register_property(ctx, &ScTileElement::isQueue_get, &ScTileElement::isQueue_set, "isQueue"); + dukglue_register_property( + ctx, &ScTileElement::queueBannerDirection_get, &ScTileElement::queueBannerDirection_set, "queueBannerDirection"); + dukglue_register_property(ctx, &ScTileElement::queueBannerDirection_get, &ScTileElement::edges_set, "test"); + + dukglue_register_property( + ctx, &ScTileElement::isBlockedByVehicle_get, &ScTileElement::isBlockedByVehicle_set, "isBlockedByVehicle"); + dukglue_register_property(ctx, &ScTileElement::isWide_get, &ScTileElement::isWide_set, "isWide"); + + dukglue_register_property(ctx, &ScTileElement::addition_get, &ScTileElement::addition_set, "addition"); + dukglue_register_property( + ctx, &ScTileElement::additionStatus_get, &ScTileElement::additionStatus_set, "additionStatus"); + dukglue_register_property( + ctx, &ScTileElement::isAdditionBroken_get, &ScTileElement::isAdditionBroken_set, "isAdditionBroken"); + dukglue_register_property( + ctx, &ScTileElement::isAdditionGhost_get, &ScTileElement::isAdditionGhost_set, "isAdditionGhost"); + + // Track only + dukglue_register_property(ctx, &ScTileElement::trackType_get, &ScTileElement::trackType_set, "trackType"); + dukglue_register_property(ctx, &ScTileElement::mazeEntry_get, &ScTileElement::mazeEntry_set, "mazeEntry"); + dukglue_register_property(ctx, &ScTileElement::colourScheme_get, &ScTileElement::colourScheme_set, "colourScheme"); + dukglue_register_property(ctx, &ScTileElement::seatRotation_get, &ScTileElement::seatRotation_set, "seatRotation"); + dukglue_register_property( + ctx, &ScTileElement::brakeBoosterSpeed_get, &ScTileElement::brakeBoosterSpeed_set, "brakeBoosterSpeed"); + dukglue_register_property(ctx, &ScTileElement::hasChainLift_get, &ScTileElement::hasChainLift_set, "hasChainLift"); + dukglue_register_property(ctx, &ScTileElement::isInverted_get, &ScTileElement::isInverted_set, "isInverted"); + dukglue_register_property(ctx, &ScTileElement::hasCableLift_get, &ScTileElement::hasCableLift_set, "hasCableLift"); + + // Small Scenery only + dukglue_register_property(ctx, &ScTileElement::age_get, &ScTileElement::age_set, "age"); + dukglue_register_property(ctx, &ScTileElement::quadrant_get, &ScTileElement::quadrant_set, "quadrant"); + + // Wall only + dukglue_register_property( + ctx, &ScTileElement::tertiaryColour_get, &ScTileElement::tertiaryColour_set, "tertiaryColour"); + + // Entrance only + dukglue_register_property( + ctx, &ScTileElement::footpathObject_get, &ScTileElement::footpathObject_set, "footpathObject"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp new file mode 100644 index 0000000000..9b0fcd7060 --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -0,0 +1,198 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +#ifdef ENABLE_SCRIPTING + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../core/Guard.hpp" +# include "../../../ride/Track.h" +# include "../../../world/Footpath.h" +# include "../../../world/Scenery.h" +# include "../../../world/Sprite.h" +# include "../../../world/Surface.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" + +# include +# include +# include + +namespace OpenRCT2::Scripting +{ + class ScTileElement + { + protected: + CoordsXY _coords; + TileElement* _element; + + public: + ScTileElement(const CoordsXY& coords, TileElement* element); + + private: + std::string type_get() const; + void type_set(std::string value); + + uint8_t baseHeight_get() const; + void baseHeight_set(uint8_t newBaseHeight); + + uint16_t baseZ_get() const; + void baseZ_set(uint16_t value); + + uint8_t clearanceHeight_get() const; + void clearanceHeight_set(uint8_t newClearanceHeight); + + uint16_t clearanceZ_get() const; + void clearanceZ_set(uint16_t value); + + DukValue slope_get() const; + void slope_set(uint8_t value); + + DukValue waterHeight_get() const; + void waterHeight_set(int32_t value); + + DukValue surfaceStyle_get() const; + void surfaceStyle_set(uint32_t value); + + DukValue edgeStyle_get() const; + void edgeStyle_set(uint32_t value); + + DukValue grassLength_get() const; + void grassLength_set(uint8_t value); + + DukValue hasOwnership_get() const; + + DukValue hasConstructionRights_get(); + + DukValue ownership_get() const; + void ownership_set(uint8_t value); + + DukValue parkFences_get() const; + void parkFences_set(uint8_t value); + + DukValue trackType_get() const; + void trackType_set(uint8_t value); + + DukValue sequence_get() const; + void sequence_set(uint8_t value); + + DukValue ride_get() const; + void ride_set(ride_id_t value); + + DukValue station_get() const; + void station_set(uint8_t value); + + DukValue hasChainLift_get() const; + void hasChainLift_set(bool value); + + DukValue mazeEntry_get() const; + void mazeEntry_set(uint16_t value); + + DukValue colourScheme_get() const; + void colourScheme_set(uint8_t value); + + DukValue seatRotation_get() const; + void seatRotation_set(uint8_t value); + + DukValue brakeBoosterSpeed_get() const; + void brakeBoosterSpeed_set(uint8_t value); + + DukValue isInverted_get() const; + void isInverted_set(bool value); + + DukValue hasCableLift_get() const; + void hasCableLift_set(bool value); + + DukValue object_get() const; + void object_set(uint32_t value); + + bool isHidden_get() const; + void isHidden_set(bool hide); + + DukValue age_get() const; + void age_set(uint8_t value); + + DukValue quadrant_get() const; + void quadrant_set(uint8_t value); + + uint8_t occupiedQuadrants_get() const; + void occupiedQuadrants_set(uint8_t value); + + bool isGhost_get() const; + void isGhost_set(bool value); + + DukValue primaryColour_get() const; + void primaryColour_set(uint8_t value); + + DukValue secondaryColour_get() const; + void secondaryColour_set(uint8_t value); + + DukValue tertiaryColour_get() const; + void tertiaryColour_set(uint8_t value); + + DukValue bannerIndex_get() const; + void bannerIndex_set(uint16_t value); + + // Deprecated in favor of seperate 'edges' and 'corners' properties, + // left here to maintain compatibility with older plugins. + /** @deprecated */ + uint8_t edgesAndCorners_get() const; + /** @deprecated */ + void edgesAndCorners_set(uint8_t value); + + DukValue edges_get() const; + void edges_set(uint8_t value); + + DukValue corners_get() const; + void corners_set(uint8_t value); + + DukValue slopeDirection_get() const; + void slopeDirection_set(const DukValue& value); + + DukValue isQueue_get() const; + void isQueue_set(bool value); + + DukValue queueBannerDirection_get() const; + void queueBannerDirection_set(const DukValue& value); + + DukValue isBlockedByVehicle_get() const; + void isBlockedByVehicle_set(bool value); + + DukValue isWide_get() const; + void isWide_set(bool value); + + DukValue addition_get() const; + void addition_set(const DukValue& value); + + DukValue additionStatus_get() const; + void additionStatus_set(uint8_t value); + + DukValue isAdditionBroken_get() const; + void isAdditionBroken_set(bool value); + + DukValue isAdditionGhost_get() const; + void isAdditionGhost_set(bool value); + + DukValue footpathObject_get() const; + void footpathObject_set(uint8_t value); + + DukValue direction_get() const; + void direction_set(uint8_t value); + + void Invalidate(); + + public: + static void Register(duk_context* ctx); + }; + +} // namespace OpenRCT2::Scripting + +#endif From 5a69f22f2d44478dd1f4c7b00f9922436579c7c8 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 16:27:58 +0300 Subject: [PATCH 152/681] Move ScTile code into cpp --- src/openrct2/libopenrct2.vcxproj | 1 + .../scripting/bindings/world/ScTile.cpp | 243 ++++++++++++++++++ .../scripting/bindings/world/ScTile.hpp | 222 ++-------------- 3 files changed, 260 insertions(+), 206 deletions(-) create mode 100644 src/openrct2/scripting/bindings/world/ScTile.cpp diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 67c5d17b36..7029514897 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -871,6 +871,7 @@ + diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp new file mode 100644 index 0000000000..28d4d2751b --- /dev/null +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -0,0 +1,243 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#ifdef ENABLE_SCRIPTING + +# include "ScTile.hpp" + +# include "../../../Context.h" +# include "../../../common.h" +# include "../../../core/Guard.hpp" +# include "../../../ride/Track.h" +# include "../../../world/Footpath.h" +# include "../../../world/Scenery.h" +# include "../../../world/Sprite.h" +# include "../../../world/Surface.h" +# include "../../Duktape.hpp" +# include "../../ScriptEngine.h" +# include "ScTileElement.hpp" + +# include +# include +# include + +namespace OpenRCT2::Scripting +{ + ScTile::ScTile(const CoordsXY& coords) + : _coords(coords) + { + } + + int32_t ScTile::x_get() const + { + return _coords.x / COORDS_XY_STEP; + } + + int32_t ScTile::y_get() const + { + return _coords.y / COORDS_XY_STEP; + } + + uint32_t ScTile::numElements_get() const + { + auto first = GetFirstElement(); + return static_cast(GetNumElements(first)); + } + + std::vector> ScTile::elements_get() const + { + std::vector> result; + auto first = GetFirstElement(); + auto currentNumElements = GetNumElements(first); + if (currentNumElements != 0) + { + result.reserve(currentNumElements); + for (size_t i = 0; i < currentNumElements; i++) + { + result.push_back(std::make_shared(_coords, &first[i])); + } + } + return result; + } + + DukValue ScTile::data_get() const + { + auto ctx = GetDukContext(); + auto first = map_get_first_element_at(_coords); + auto dataLen = GetNumElements(first) * sizeof(TileElement); + auto data = duk_push_fixed_buffer(ctx, dataLen); + if (first != nullptr) + { + std::memcpy(data, first, dataLen); + } + duk_push_buffer_object(ctx, -1, 0, dataLen, DUK_BUFOBJ_UINT8ARRAY); + return DukValue::take_from_stack(ctx); + } + + void ScTile::data_set(DukValue value) + { + ThrowIfGameStateNotMutable(); + auto ctx = value.context(); + value.push(); + if (duk_is_buffer_data(ctx, -1)) + { + duk_size_t dataLen{}; + auto data = duk_get_buffer_data(ctx, -1, &dataLen); + auto numElements = dataLen / sizeof(TileElement); + if (numElements == 0) + { + map_set_tile_element(TileCoordsXY(_coords), nullptr); + } + else + { + auto first = GetFirstElement(); + auto currentNumElements = GetNumElements(first); + if (numElements > currentNumElements) + { + // Allocate space for the extra tile elements (inefficient but works) + auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ(); + auto numToInsert = numElements - currentNumElements; + for (size_t i = 0; i < numToInsert; i++) + { + tile_element_insert(pos, 0, TileElementType::Surface); + } + + // Copy data to element span + first = map_get_first_element_at(_coords); + currentNumElements = GetNumElements(first); + if (currentNumElements != 0) + { + std::memcpy(first, data, currentNumElements * sizeof(TileElement)); + // Safely force last tile flag for last element to avoid read overrun + first[numElements - 1].SetLastForTile(true); + } + } + else + { + std::memcpy(first, data, numElements * sizeof(TileElement)); + // Safely force last tile flag for last element to avoid read overrun + first[numElements - 1].SetLastForTile(true); + } + } + map_invalidate_tile_full(_coords); + } + } + + std::shared_ptr ScTile::getElement(uint32_t index) const + { + auto first = GetFirstElement(); + if (static_cast(index) < GetNumElements(first)) + { + return std::make_shared(_coords, &first[index]); + } + return {}; + } + + std::shared_ptr ScTile::insertElement(uint32_t index) + { + ThrowIfGameStateNotMutable(); + std::shared_ptr result; + auto first = GetFirstElement(); + auto origNumElements = GetNumElements(first); + if (index <= origNumElements) + { + std::vector data(first, first + origNumElements); + + auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ(); + auto newElement = tile_element_insert(pos, 0, TileElementType::Surface); + if (newElement == nullptr) + { + auto ctx = GetDukContext(); + duk_error(ctx, DUK_ERR_ERROR, "Unable to allocate element."); + } + else + { + // Inefficient, requires a dedicated method in tile element manager + first = GetFirstElement(); + // Copy elements before index + if (index > 0) + { + std::memcpy(first, &data[0], index * sizeof(TileElement)); + } + // Zero new element + std::memset(first + index, 0, sizeof(TileElement)); + // Copy elements after index + if (index < origNumElements) + { + std::memcpy(first + index + 1, &data[index], (origNumElements - index) * sizeof(TileElement)); + } + for (size_t i = 0; i < origNumElements; i++) + { + first[i].SetLastForTile(false); + } + first[origNumElements].SetLastForTile(true); + map_invalidate_tile_full(_coords); + result = std::make_shared(_coords, &first[index]); + } + } + else + { + auto ctx = GetDukContext(); + duk_error(ctx, DUK_ERR_RANGE_ERROR, "Index must be between zero and the number of elements on the tile."); + } + return result; + } + + void ScTile::removeElement(uint32_t index) + { + ThrowIfGameStateNotMutable(); + auto first = GetFirstElement(); + if (index < GetNumElements(first)) + { + tile_element_remove(&first[index]); + map_invalidate_tile_full(_coords); + } + } + + TileElement* ScTile::GetFirstElement() const + { + return map_get_first_element_at(_coords); + } + + size_t ScTile::GetNumElements(const TileElement* first) + { + size_t count = 0; + if (first != nullptr) + { + auto element = first; + do + { + count++; + } while (!(element++)->IsLastForTile()); + } + return count; + } + + duk_context* ScTile::GetDukContext() const + { + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto ctx = scriptEngine.GetContext(); + return ctx; + } + + void ScTile::Register(duk_context* ctx) + { + dukglue_register_property(ctx, &ScTile::x_get, nullptr, "x"); + dukglue_register_property(ctx, &ScTile::y_get, nullptr, "y"); + dukglue_register_property(ctx, &ScTile::elements_get, nullptr, "elements"); + dukglue_register_property(ctx, &ScTile::numElements_get, nullptr, "numElements"); + dukglue_register_property(ctx, &ScTile::data_get, &ScTile::data_set, "data"); + dukglue_register_method(ctx, &ScTile::getElement, "getElement"); + dukglue_register_method(ctx, &ScTile::insertElement, "insertElement"); + dukglue_register_method(ctx, &ScTile::removeElement, "removeElement"); + } + +} // namespace OpenRCT2::Scripting + +#endif diff --git a/src/openrct2/scripting/bindings/world/ScTile.hpp b/src/openrct2/scripting/bindings/world/ScTile.hpp index 2126d5cc0e..1698377c42 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.hpp +++ b/src/openrct2/scripting/bindings/world/ScTile.hpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -11,21 +11,14 @@ #ifdef ENABLE_SCRIPTING -# include "../../../Context.h" # include "../../../common.h" -# include "../../../core/Guard.hpp" -# include "../../../ride/Track.h" -# include "../../../world/Footpath.h" -# include "../../../world/Scenery.h" -# include "../../../world/Sprite.h" -# include "../../../world/Surface.h" # include "../../Duktape.hpp" -# include "../../ScriptEngine.h" # include "ScTileElement.hpp" # include # include # include +# include namespace OpenRCT2::Scripting { @@ -35,216 +28,33 @@ namespace OpenRCT2::Scripting CoordsXY _coords; public: - ScTile(const CoordsXY& coords) - : _coords(coords) - { - } + ScTile(const CoordsXY& coords); private: - int32_t x_get() const - { - return _coords.x / COORDS_XY_STEP; - } + int32_t x_get() const; - int32_t y_get() const - { - return _coords.y / COORDS_XY_STEP; - } + int32_t y_get() const; - uint32_t numElements_get() const - { - auto first = GetFirstElement(); - return static_cast(GetNumElements(first)); - } + uint32_t numElements_get() const; - std::vector> elements_get() const - { - std::vector> result; - auto first = GetFirstElement(); - auto currentNumElements = GetNumElements(first); - if (currentNumElements != 0) - { - result.reserve(currentNumElements); - for (size_t i = 0; i < currentNumElements; i++) - { - result.push_back(std::make_shared(_coords, &first[i])); - } - } - return result; - } + std::vector> elements_get() const; - DukValue data_get() const - { - auto ctx = GetDukContext(); - auto first = map_get_first_element_at(_coords); - auto dataLen = GetNumElements(first) * sizeof(TileElement); - auto data = duk_push_fixed_buffer(ctx, dataLen); - if (first != nullptr) - { - std::memcpy(data, first, dataLen); - } - duk_push_buffer_object(ctx, -1, 0, dataLen, DUK_BUFOBJ_UINT8ARRAY); - return DukValue::take_from_stack(ctx); - } + DukValue data_get() const; + void data_set(DukValue value); - void data_set(DukValue value) - { - ThrowIfGameStateNotMutable(); - auto ctx = value.context(); - value.push(); - if (duk_is_buffer_data(ctx, -1)) - { - duk_size_t dataLen{}; - auto data = duk_get_buffer_data(ctx, -1, &dataLen); - auto numElements = dataLen / sizeof(TileElement); - if (numElements == 0) - { - map_set_tile_element(TileCoordsXY(_coords), nullptr); - } - else - { - auto first = GetFirstElement(); - auto currentNumElements = GetNumElements(first); - if (numElements > currentNumElements) - { - // Allocate space for the extra tile elements (inefficient but works) - auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ(); - auto numToInsert = numElements - currentNumElements; - for (size_t i = 0; i < numToInsert; i++) - { - tile_element_insert(pos, 0, TileElementType::Surface); - } + std::shared_ptr getElement(uint32_t index) const; + std::shared_ptr insertElement(uint32_t index); - // Copy data to element span - first = map_get_first_element_at(_coords); - currentNumElements = GetNumElements(first); - if (currentNumElements != 0) - { - std::memcpy(first, data, currentNumElements * sizeof(TileElement)); - // Safely force last tile flag for last element to avoid read overrun - first[numElements - 1].SetLastForTile(true); - } - } - else - { - std::memcpy(first, data, numElements * sizeof(TileElement)); - // Safely force last tile flag for last element to avoid read overrun - first[numElements - 1].SetLastForTile(true); - } - } - map_invalidate_tile_full(_coords); - } - } + void removeElement(uint32_t index); - std::shared_ptr getElement(uint32_t index) const - { - auto first = GetFirstElement(); - if (static_cast(index) < GetNumElements(first)) - { - return std::make_shared(_coords, &first[index]); - } - return {}; - } + TileElement* GetFirstElement() const; - std::shared_ptr insertElement(uint32_t index) - { - ThrowIfGameStateNotMutable(); - std::shared_ptr result; - auto first = GetFirstElement(); - auto origNumElements = GetNumElements(first); - if (index <= origNumElements) - { - std::vector data(first, first + origNumElements); + static size_t GetNumElements(const TileElement* first); - auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ(); - auto newElement = tile_element_insert(pos, 0, TileElementType::Surface); - if (newElement == nullptr) - { - auto ctx = GetDukContext(); - duk_error(ctx, DUK_ERR_ERROR, "Unable to allocate element."); - } - else - { - // Inefficient, requires a dedicated method in tile element manager - first = GetFirstElement(); - // Copy elements before index - if (index > 0) - { - std::memcpy(first, &data[0], index * sizeof(TileElement)); - } - // Zero new element - std::memset(first + index, 0, sizeof(TileElement)); - // Copy elements after index - if (index < origNumElements) - { - std::memcpy(first + index + 1, &data[index], (origNumElements - index) * sizeof(TileElement)); - } - for (size_t i = 0; i < origNumElements; i++) - { - first[i].SetLastForTile(false); - } - first[origNumElements].SetLastForTile(true); - map_invalidate_tile_full(_coords); - result = std::make_shared(_coords, &first[index]); - } - } - else - { - auto ctx = GetDukContext(); - duk_error(ctx, DUK_ERR_RANGE_ERROR, "Index must be between zero and the number of elements on the tile."); - } - return result; - } - - void removeElement(uint32_t index) - { - ThrowIfGameStateNotMutable(); - auto first = GetFirstElement(); - if (index < GetNumElements(first)) - { - tile_element_remove(&first[index]); - map_invalidate_tile_full(_coords); - } - } - - TileElement* GetFirstElement() const - { - return map_get_first_element_at(_coords); - } - - static size_t GetNumElements(const TileElement* first) - { - size_t count = 0; - if (first != nullptr) - { - auto element = first; - do - { - count++; - } while (!(element++)->IsLastForTile()); - } - return count; - } - - duk_context* GetDukContext() const - { - auto& scriptEngine = GetContext()->GetScriptEngine(); - auto ctx = scriptEngine.GetContext(); - return ctx; - } + duk_context* GetDukContext() const; public: - static void Register(duk_context* ctx) - { - dukglue_register_property(ctx, &ScTile::x_get, nullptr, "x"); - dukglue_register_property(ctx, &ScTile::y_get, nullptr, "y"); - dukglue_register_property(ctx, &ScTile::elements_get, nullptr, "elements"); - dukglue_register_property(ctx, &ScTile::numElements_get, nullptr, "numElements"); - dukglue_register_property(ctx, &ScTile::data_get, &ScTile::data_set, "data"); - dukglue_register_method(ctx, &ScTile::getElement, "getElement"); - dukglue_register_method(ctx, &ScTile::insertElement, "insertElement"); - dukglue_register_method(ctx, &ScTile::removeElement, "removeElement"); - } + static void Register(duk_context* ctx); }; } // namespace OpenRCT2::Scripting From 6d1f730359ec9517db91e0a018ff4771b10b0b57 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 10 Aug 2021 16:28:09 +0300 Subject: [PATCH 153/681] Update xcode project --- OpenRCT2.xcodeproj/project.pbxproj | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index c21907297b..5b071a34fb 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -792,6 +792,10 @@ 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BE60702D7549488A32CC0B /* ScMap.cpp */; }; BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */; }; AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */; }; + 887B0043454440BAB322A9E8 /* ScPark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9C4DE37309A4B5F965D7718 /* ScPark.cpp */; }; + 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43D18154E96444749737E3F6 /* ScTileElement.cpp */; }; + DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */; }; + 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B67E36A8620400CA70FBA49 /* ScTile.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1886,6 +1890,10 @@ E4BE60702D7549488A32CC0B /* ScMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScMap.cpp; path = src/openrct2/scripting/bindings/world/ScMap.cpp; sourceTree = SOURCE_ROOT; }; 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScParkMessage.cpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.cpp; sourceTree = SOURCE_ROOT; }; 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScParkMessage.hpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.hpp; sourceTree = SOURCE_ROOT; }; + E9C4DE37309A4B5F965D7718 /* ScPark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPark.cpp; path = src/openrct2/scripting/bindings/world/ScPark.cpp; sourceTree = SOURCE_ROOT; }; + 43D18154E96444749737E3F6 /* ScTileElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTileElement.cpp; path = src/openrct2/scripting/bindings/world/ScTileElement.cpp; sourceTree = SOURCE_ROOT; }; + F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTileElement.hpp; path = src/openrct2/scripting/bindings/world/ScTileElement.hpp; sourceTree = SOURCE_ROOT; }; + 5B67E36A8620400CA70FBA49 /* ScTile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTile.cpp; path = src/openrct2/scripting/bindings/world/ScTile.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3469,6 +3477,10 @@ E4BE60702D7549488A32CC0B /* ScMap.cpp */, 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */, 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */, + E9C4DE37309A4B5F965D7718 /* ScPark.cpp */, + 43D18154E96444749737E3F6 /* ScTileElement.cpp */, + F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */, + 5B67E36A8620400CA70FBA49 /* ScTile.cpp */, ); name = world; sourceTree = ""; @@ -3625,6 +3637,7 @@ 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */, 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */, AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */, + DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4441,6 +4454,9 @@ 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */, 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */, BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */, + 887B0043454440BAB322A9E8 /* ScPark.cpp in Sources */, + 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */, + 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 055ef319122c8c333e8478730c09ced1284808eb Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 11 Aug 2021 22:11:25 +0300 Subject: [PATCH 154/681] Fix compile error for missing return --- src/openrct2/scripting/bindings/world/ScMap.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index c3e95f20fa..6e68adc6ef 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -231,10 +231,9 @@ namespace OpenRCT2::Scripting { return createEntityType(_context, initializer); } - else - { - duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); - } + + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); + return DukValue{}; } void ScMap::Register(duk_context* ctx) From 8f5ec434865a017db922b26679caf8c90d28fb54 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 11 Aug 2021 23:26:46 +0200 Subject: [PATCH 155/681] Pass derived tile element classes to functions (#15206) --- src/openrct2/paint/Paint.h | 4 +- .../paint/tile_element/Paint.Banner.cpp | 18 +- .../paint/tile_element/Paint.Entrance.cpp | 39 +- .../paint/tile_element/Paint.LargeScenery.cpp | 33 +- .../paint/tile_element/Paint.Path.cpp | 209 +++-- .../paint/tile_element/Paint.SmallScenery.cpp | 37 +- .../paint/tile_element/Paint.Surface.cpp | 46 +- .../paint/tile_element/Paint.TileElement.cpp | 20 +- .../paint/tile_element/Paint.TileElement.h | 16 +- .../paint/tile_element/Paint.Wall.cpp | 56 +- src/openrct2/ride/TrackPaint.cpp | 178 ++--- src/openrct2/ride/TrackPaint.h | 22 +- .../coaster/AirPoweredVerticalCoaster.cpp | 63 +- .../ride/coaster/BobsleighCoaster.cpp | 134 ++-- .../ride/coaster/BolligerMabillardTrack.cpp | 648 ++++++++-------- .../ride/coaster/BolligerMabillardTrack.h | 360 ++++----- .../ride/coaster/CompactInvertedCoaster.cpp | 363 ++++----- .../ride/coaster/CorkscrewRollerCoaster.cpp | 418 +++++----- .../ride/coaster/FlyingRollerCoaster.cpp | 712 ++++++++--------- src/openrct2/ride/coaster/GigaCoaster.cpp | 472 ++++++------ .../ride/coaster/HeartlineTwisterCoaster.cpp | 64 +- src/openrct2/ride/coaster/HybridCoaster.cpp | 556 +++++++------- .../ride/coaster/InvertedHairpinCoaster.cpp | 100 +-- .../ride/coaster/InvertedImpulseCoaster.cpp | 70 +- .../ride/coaster/InvertedRollerCoaster.cpp | 452 +++++------ .../ride/coaster/JuniorRollerCoaster.cpp | 452 +++++------ .../ride/coaster/JuniorRollerCoaster.h | 61 +- .../ride/coaster/LayDownRollerCoaster.cpp | 578 +++++++------- .../ride/coaster/LimLaunchedRollerCoaster.cpp | 73 +- .../ride/coaster/LoopingRollerCoaster.cpp | 490 ++++++------ src/openrct2/ride/coaster/MineRide.cpp | 184 ++--- .../ride/coaster/MineTrainCoaster.cpp | 314 ++++---- .../ride/coaster/MiniRollerCoaster.cpp | 440 +++++------ .../ride/coaster/MiniSuspendedCoaster.cpp | 130 ++-- .../coaster/MultiDimensionRollerCoaster.cpp | 489 ++++++------ .../ride/coaster/ReverseFreefallCoaster.cpp | 16 +- .../ride/coaster/ReverserRollerCoaster.cpp | 54 +- .../coaster/SideFrictionRollerCoaster.cpp | 168 ++-- .../ride/coaster/SingleRailRollerCoaster.cpp | 638 ++++++++-------- .../ride/coaster/StandUpRollerCoaster.cpp | 416 +++++----- src/openrct2/ride/coaster/Steeplechase.cpp | 134 ++-- .../ride/coaster/SuspendedSwingingCoaster.cpp | 198 ++--- .../ride/coaster/TwisterRollerCoaster.cpp | 721 +++++++++--------- .../coaster/VerticalDropRollerCoaster.cpp | 721 +++++++++--------- src/openrct2/ride/coaster/VirginiaReel.cpp | 45 +- src/openrct2/ride/coaster/WildMouse.cpp | 108 +-- .../ride/coaster/WoodenRollerCoaster.cpp | 458 +++++------ src/openrct2/ride/coaster/WoodenWildMouse.cpp | 82 +- src/openrct2/ride/gentle/CarRide.cpp | 58 +- src/openrct2/ride/gentle/Circus.cpp | 4 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 4 +- src/openrct2/ride/gentle/Dodgems.cpp | 4 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 10 +- src/openrct2/ride/gentle/FlyingSaucers.cpp | 4 +- src/openrct2/ride/gentle/GhostTrain.cpp | 95 ++- src/openrct2/ride/gentle/HauntedHouse.cpp | 4 +- src/openrct2/ride/gentle/Maze.cpp | 4 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 4 +- src/openrct2/ride/gentle/MiniGolf.cpp | 54 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 36 +- src/openrct2/ride/gentle/MonorailCycles.cpp | 22 +- src/openrct2/ride/gentle/ObservationTower.cpp | 10 +- src/openrct2/ride/gentle/SpaceRings.cpp | 8 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 16 +- src/openrct2/ride/shops/Facility.cpp | 2 +- src/openrct2/ride/shops/Shop.cpp | 2 +- src/openrct2/ride/thrill/3dCinema.cpp | 4 +- src/openrct2/ride/thrill/Enterprise.cpp | 32 +- src/openrct2/ride/thrill/GoKarts.cpp | 42 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 10 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 2 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 12 +- src/openrct2/ride/thrill/RotoDrop.cpp | 10 +- .../ride/thrill/SwingingInverterShip.cpp | 2 +- src/openrct2/ride/thrill/SwingingShip.cpp | 10 +- src/openrct2/ride/thrill/TopSpin.cpp | 20 +- src/openrct2/ride/thrill/Twist.cpp | 8 +- src/openrct2/ride/transport/Chairlift.cpp | 82 +- src/openrct2/ride/transport/Lift.cpp | 6 +- .../ride/transport/MiniatureRailway.cpp | 70 +- src/openrct2/ride/transport/Monorail.cpp | 66 +- .../ride/transport/SuspendedMonorail.cpp | 66 +- src/openrct2/ride/water/BoatHire.cpp | 14 +- src/openrct2/ride/water/DingySlide.cpp | 120 +-- src/openrct2/ride/water/LogFlume.cpp | 32 +- src/openrct2/ride/water/RiverRapids.cpp | 36 +- src/openrct2/ride/water/SplashBoats.cpp | 50 +- src/openrct2/ride/water/SubmarineRide.cpp | 21 +- src/openrct2/ride/water/WaterCoaster.cpp | 164 ++-- src/openrct2/world/Footpath.cpp | 22 +- src/openrct2/world/Footpath.h | 1 - src/openrct2/world/TileElement.h | 2 + 92 files changed, 6659 insertions(+), 6646 deletions(-) diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 756567c0e3..303d9102c8 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -197,8 +197,8 @@ struct PaintSessionCore attached_paint_struct* LastAttachedPS; const TileElement* SurfaceElement; const void* CurrentlyDrawnItem; - TileElement* PathElementOnSameHeight; - TileElement* TrackElementOnSameHeight; + const TileElement* PathElementOnSameHeight; + const TileElement* TrackElementOnSameHeight; paint_struct PaintHead; uint32_t ViewFlags; uint32_t QuadrantBackIndex; diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index a6bd774e65..a3b6946732 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -33,7 +33,7 @@ constexpr CoordsXY BannerBoundBoxes[][2] = { * * rct2: 0x006B9CC4 */ -void banner_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) +void PaintBanner(paint_session* session, uint8_t direction, int32_t height, const BannerElement& bannerElement) { rct_drawpixelinfo* dpi = &session->DPI; @@ -44,13 +44,7 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con height -= 16; - auto bannerElement = tile_element->AsBanner(); - if (bannerElement == nullptr) - { - return; - } - - auto banner = bannerElement->GetBanner(); + auto banner = bannerElement.GetBanner(); if (banner == nullptr) { return; @@ -62,7 +56,7 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con return; } - direction += bannerElement->GetPosition(); + direction += bannerElement.GetPosition(); direction &= 3; CoordsXYZ boundBoxOffset = CoordsXYZ(BannerBoundBoxes[direction][0], height + 2); @@ -70,12 +64,12 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con uint32_t base_id = (direction << 1) + bannerEntry->image; uint32_t image_id = base_id; - if (tile_element->IsGhost()) // if being placed + if (bannerElement.IsGhost()) // if being placed { session->InteractionType = ViewportInteractionItem::None; image_id |= CONSTRUCTION_MARKER; } - else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&bannerElement))) { image_id |= CONSTRUCTION_MARKER; } @@ -95,7 +89,7 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con direction = direction_reverse(direction); direction--; // If text not showing / ghost - if (direction >= 2 || (tile_element->IsGhost())) + if (direction >= 2 || (bannerElement.IsGhost())) return; uint16_t scrollingMode = bannerEntry->scrolling_mode; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 4f268bce17..7db9c608ae 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -30,13 +30,14 @@ * * rct2: 0x0066508C, 0x00665540 */ -static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) +static void ride_entrance_exit_paint( + paint_session* session, uint8_t direction, int32_t height, const EntranceElement& tile_element) { - uint8_t is_exit = tile_element->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT; + uint8_t is_exit = tile_element.GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT; if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { - if (tile_element->AsEntrance()->GetRideIndex() != gTrackDesignSaveRideIndex) + if (tile_element.GetRideIndex() != gTrackDesignSaveRideIndex) return; } @@ -48,7 +49,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, 0, height + 45, LightType::Lantern3); } - switch (tile_element->GetDirection()) + switch (tile_element.GetDirection()) { case 0: lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 16, 0, height + 16, LightType::Lantern2); @@ -66,7 +67,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, } #endif - auto ride = get_ride(tile_element->AsEntrance()->GetRideIndex()); + auto ride = get_ride(tile_element.GetRideIndex()); if (ride == nullptr) { return; @@ -93,7 +94,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, session->InteractionType = ViewportInteractionItem::Ride; uint32_t entranceImageId = 0; - if (tile_element->IsGhost()) + if (tile_element.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; image_id = CONSTRUCTION_MARKER; @@ -101,7 +102,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, if (transparant_image_id) transparant_image_id = image_id; } - else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&tile_element))) { image_id = CONSTRUCTION_MARKER; entranceImageId = image_id; @@ -166,7 +167,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } - if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != RIDE_ID_NULL + if (!is_exit && !(tile_element.IsGhost()) && tile_element.GetRideIndex() != RIDE_ID_NULL && stationObj->ScrollingMode != SCROLLING_MODE_NONE) { auto ft = Formatter(); @@ -216,7 +217,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, * * rct2: 0x006658ED */ -static void park_entrance_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) +static void park_entrance_paint(paint_session* session, uint8_t direction, int32_t height, const EntranceElement& tile_element) { if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) return; @@ -230,25 +231,25 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 session->InteractionType = ViewportInteractionItem::ParkEntrance; uint32_t image_id, ghost_id = 0; - if (tile_element->IsGhost()) + if (tile_element.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; ghost_id = CONSTRUCTION_MARKER; } - else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&tile_element))) { ghost_id = CONSTRUCTION_MARKER; } // Index to which part of the entrance // Middle, left, right - uint8_t part_index = tile_element->AsEntrance()->GetSequenceIndex(); + uint8_t part_index = tile_element.GetSequenceIndex(); PathSurfaceEntry* path_entry = nullptr; // The left and right of the park entrance often have this set to 127. // So only attempt to get the footpath type if we're dealing with the middle bit of the entrance. if (part_index == 0) - path_entry = get_path_surface_entry(tile_element->AsEntrance()->GetPathType()); + path_entry = get_path_surface_entry(tile_element.GetPathType()); rct_entrance_type* entrance; uint8_t di = ((direction / 2 + part_index / 2) & 1) ? 0x1A : 0x20; @@ -340,15 +341,15 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 * * rct2: 0x00664FD4 */ -void entrance_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) +void PaintEntrance(paint_session* session, uint8_t direction, int32_t height, const EntranceElement& entranceElement) { session->InteractionType = ViewportInteractionItem::Label; if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_PATH_HEIGHTS)) { - if (entrance_get_directions(tile_element) & 0xF) + if (entranceElement.GetDirections() & 0xF) { - int32_t z = tile_element->GetBaseZ() + 3; + int32_t z = entranceElement.GetBaseZ() + 3; uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16); image_id -= gMapBaseZ; @@ -356,14 +357,14 @@ void entrance_paint(paint_session* session, uint8_t direction, int32_t height, c } } - switch (tile_element->AsEntrance()->GetEntranceType()) + switch (entranceElement.GetEntranceType()) { case ENTRANCE_TYPE_RIDE_ENTRANCE: case ENTRANCE_TYPE_RIDE_EXIT: - ride_entrance_exit_paint(session, direction, height, tile_element); + ride_entrance_exit_paint(session, direction, height, entranceElement); break; case ENTRANCE_TYPE_PARK_ENTRANCE: - park_entrance_paint(session, direction, height, tile_element); + park_entrance_paint(session, direction, height, entranceElement); break; } } diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 273bb2bf74..53f97ed098 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -28,7 +28,7 @@ // 6B8172: static void large_scenery_paint_supports( - paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement, uint32_t dword_F4387C, + paint_session* session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement, uint32_t dword_F4387C, const rct_large_scenery_tile* tile) { if (tile->flags & LARGE_SCENERY_TILE_FLAG_NO_SUPPORTS) @@ -54,7 +54,7 @@ static void large_scenery_paint_supports( wooden_b_supports_paint_setup(session, (direction & 1), ax, supportHeight, supportImageColourFlags, nullptr); - int32_t clearanceHeight = ceil2(tileElement->GetClearanceZ() + 15, 16); + int32_t clearanceHeight = ceil2(tileElement.GetClearanceZ() + 15, 16); if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) { @@ -221,19 +221,19 @@ static constexpr const boundbox s98E3C4[] = { * * rct2: 0x006B7F0C */ -void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement) +void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement) { if (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) { return; } session->InteractionType = ViewportInteractionItem::LargeScenery; - const uint32_t sequenceNum = tileElement->AsLargeScenery()->GetSequenceIndex(); - const LargeSceneryObject* object = tileElement->AsLargeScenery()->GetObject(); + const uint32_t sequenceNum = tileElement.GetSequenceIndex(); + const LargeSceneryObject* object = tileElement.GetObject(); if (object == nullptr) return; - const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); + const auto* sceneryEntry = tileElement.GetEntry(); if (sceneryEntry == nullptr) return; @@ -243,27 +243,26 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei return; uint32_t dword_F4387C = 0; - image_id |= SPRITE_ID_PALETTE_COLOUR_2( - tileElement->AsLargeScenery()->GetPrimaryColour(), tileElement->AsLargeScenery()->GetSecondaryColour()); + image_id |= SPRITE_ID_PALETTE_COLOUR_2(tileElement.GetPrimaryColour(), tileElement.GetSecondaryColour()); CoordsXYZ boxlength; CoordsXYZ boxoffset; if (gTrackDesignSaveMode) { - if (!track_design_save_contains_tile_element(tileElement)) + if (!track_design_save_contains_tile_element(reinterpret_cast(&tileElement))) { image_id &= 0x7FFFF; dword_F4387C = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); image_id |= dword_F4387C; } } - if (tileElement->IsGhost()) + if (tileElement.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; image_id &= 0x7FFFF; dword_F4387C = CONSTRUCTION_MARKER; image_id |= dword_F4387C; } - else if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&tileElement))) { image_id &= 0x7FFFF; dword_F4387C = CONSTRUCTION_MARKER; @@ -301,7 +300,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei { if (sceneryEntry->tiles[1].x_offset != static_cast(static_cast(0xFFFF))) { - int32_t sequenceDirection = (tileElement->AsLargeScenery()->GetSequenceIndex() - 1) & 3; + int32_t sequenceDirection = (tileElement.GetSequenceIndex() - 1) & 3; if (sequenceDirection != direction) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); @@ -316,13 +315,13 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei } // 6B8331: // Draw sign text: - int32_t textColour = tileElement->AsLargeScenery()->GetSecondaryColour(); + int32_t textColour = tileElement.GetSecondaryColour(); if (dword_F4387C) { textColour = COLOUR_GREY; } textColour = (textColour << 19) | IMAGE_TYPE_REMAP; - auto banner = tileElement->AsLargeScenery()->GetBanner(); + auto banner = tileElement.GetBanner(); if (banner != nullptr) { auto ft = Formatter(); @@ -414,14 +413,14 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); return; } - uint8_t sequenceDirection2 = (tileElement->AsLargeScenery()->GetSequenceIndex() - 1) & 3; + uint8_t sequenceDirection2 = (tileElement.GetSequenceIndex() - 1) & 3; if (sequenceDirection2 != direction) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); return; } // Draw scrolling text: - uint8_t textColour = tileElement->AsLargeScenery()->GetSecondaryColour(); + uint8_t textColour = tileElement.GetSecondaryColour(); if (dword_F4387C) { textColour = COLOUR_GREY; @@ -436,7 +435,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei } // 6B809A: uint16_t scrollMode = sceneryEntry->scrolling_mode + ((direction + 1) & 0x3); - auto banner = tileElement->AsLargeScenery()->GetBanner(); + auto banner = tileElement.GetBanner(); if (banner != nullptr) { auto ft = Formatter(); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 5437e4ccfc..1ce3286ba4 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -86,18 +86,18 @@ static constexpr const uint8_t byte_98D8A4[] = { // clang-format on void path_paint_box_support( - paint_session* session, const TileElement* tileElement, int32_t height, PathSurfaceEntry* footpathEntry, + paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceEntry* footpathEntry, PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); void path_paint_pole_support( - paint_session* session, const TileElement* tileElement, int16_t height, PathSurfaceEntry* footpathEntry, + paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceEntry* footpathEntry, PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); /* rct2: 0x006A5AE5 */ static void path_bit_lights_paint( - paint_session* session, PathBitEntry* pathBitEntry, const TileElement* tileElement, int32_t height, uint8_t edges, + paint_session* session, PathBitEntry* pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, uint32_t pathBitImageFlags) { - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) height += 8; uint32_t imageId; @@ -106,7 +106,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 1; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -117,7 +117,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 2; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -129,7 +129,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 3; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -141,7 +141,7 @@ static void path_bit_lights_paint( { imageId = pathBitEntry->image + 4; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -152,14 +152,14 @@ static void path_bit_lights_paint( /* rct2: 0x006A5C94 */ static void path_bit_bins_paint( - paint_session* session, PathBitEntry* pathBitEntry, const TileElement* tileElement, int32_t height, uint8_t edges, + paint_session* session, PathBitEntry* pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, uint32_t pathBitImageFlags) { - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) height += 8; uint32_t imageId; - bool binsAreVandalised = tileElement->AsPath()->IsBroken(); + bool binsAreVandalised = pathElement.IsBroken(); if (!(edges & EDGE_NE)) { @@ -174,7 +174,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(tileElement->AsPath()->GetAdditionStatus() & ror8(0x3, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & ror8(0x3, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -195,7 +195,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(tileElement->AsPath()->GetAdditionStatus() & ror8(0xC, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & ror8(0xC, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -217,7 +217,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(tileElement->AsPath()->GetAdditionStatus() & ror8(0x30, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & ror8(0x30, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -239,7 +239,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(tileElement->AsPath()->GetAdditionStatus() & ror8(0xC0, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & ror8(0xC0, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -251,7 +251,7 @@ static void path_bit_bins_paint( /* rct2: 0x006A5E81 */ static void path_bit_benches_paint( - paint_session* session, PathBitEntry* pathBitEntry, const TileElement* tileElement, int32_t height, uint8_t edges, + paint_session* session, PathBitEntry* pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, uint32_t pathBitImageFlags) { uint32_t imageId; @@ -260,7 +260,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 1; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -271,7 +271,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 2; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -283,7 +283,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 3; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -295,7 +295,7 @@ static void path_bit_benches_paint( { imageId = pathBitEntry->image + 4; - if (tileElement->AsPath()->IsBroken()) + if (pathElement.IsBroken()) imageId += 4; imageId |= pathBitImageFlags; @@ -325,18 +325,17 @@ static void path_bit_jumping_fountains_paint( * @param tile_element (esi) */ static void sub_6A4101( - paint_session* session, const TileElement* tile_element, uint16_t height, uint32_t connectedEdges, bool word_F3F038, + paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool word_F3F038, PathRailingsEntry* railingEntry, uint32_t imageFlags) { uint32_t base_image_id = railingEntry->railings_image | imageFlags; - if (tile_element->AsPath()->IsQueue()) + if (pathElement.IsQueue()) { uint8_t local_ebp = connectedEdges & 0x0F; - if (tile_element->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - switch ((tile_element->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + switch ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) { case 0: PaintAddImageAsParent(session, 22 + base_image_id, { 0, 4, height }, { 32, 1, 23 }, { 0, 4, height + 2 }); @@ -414,17 +413,17 @@ static void sub_6A4101( } } - if (!tile_element->AsPath()->HasQueueBanner()) + if (!pathElement.HasQueueBanner()) { return; } - uint8_t direction = tile_element->AsPath()->GetQueueBannerDirection(); + uint8_t direction = pathElement.GetQueueBannerDirection(); // Draw ride sign session->InteractionType = ViewportInteractionItem::Ride; - if (tile_element->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - if (tile_element->AsPath()->GetSlopeDirection() == direction) + if (pathElement.GetSlopeDirection() == direction) height += 16; } direction += session->CurrentRotation; @@ -447,7 +446,7 @@ static void sub_6A4101( direction--; // If text shown - auto ride = get_ride(tile_element->AsPath()->GetRideIndex()); + auto ride = get_ride(pathElement.GetRideIndex()); if (direction < 2 && ride != nullptr && imageFlags == 0) { uint16_t scrollingMode = railingEntry->scrolling_mode; @@ -493,15 +492,14 @@ static void sub_6A4101( uint32_t drawnCorners = 0; // If the path is not drawn over the supports, then no corner sprites will be drawn (making double-width paths // look like connected series of intersections). - if (tile_element->AsPath()->ShouldDrawPathOverSupports()) + if (pathElement.ShouldDrawPathOverSupports()) { drawnCorners = (connectedEdges & FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK) >> 4; } - if (tile_element->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - switch ((tile_element->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + switch ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) { case 0: PaintAddImageAsParent(session, 8 + base_image_id, { 0, 4, height }, { 32, 1, 23 }, { 0, 4, height + 2 }); @@ -664,7 +662,7 @@ static void sub_6A4101( /** * rct2: 0x006A3F61 - * @param tile_element (esp[0]) + * @param pathElement (esp[0]) * @param connectedEdges (bp) (relative to the camera's rotation) * @param height (dx) * @param railingEntry (0x00F3EF6C) @@ -672,7 +670,7 @@ static void sub_6A4101( * @param sceneryImageFlags (0x00F3EF74) */ static void sub_6A3F61( - paint_session* session, const TileElement* tile_element, uint16_t connectedEdges, uint16_t height, + paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, PathRailingsEntry* railingEntry, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) { // eax -- @@ -694,7 +692,7 @@ static void sub_6A3F61( if (!gTrackDesignSaveMode) { - if (tile_element->AsPath()->HasAddition()) + if (pathElement.HasAddition()) { session->InteractionType = ViewportInteractionItem::FootpathItem; if (sceneryImageFlags != 0) @@ -703,7 +701,7 @@ static void sub_6A3F61( } // Draw additional path bits (bins, benches, lamps, queue screens) - auto* pathAddEntry = tile_element->AsPath()->GetAdditionEntry(); + auto* pathAddEntry = pathElement.GetAdditionEntry(); // Can be null if the object is not loaded. if (pathAddEntry == nullptr) @@ -711,7 +709,7 @@ static void sub_6A3F61( paintScenery = false; } else if ( - (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(tile_element->AsPath()->IsBroken()) + (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(pathElement.IsBroken()) && pathAddEntry->draw_type != PathBitDrawType::Bin) { paintScenery = false; @@ -722,17 +720,17 @@ static void sub_6A3F61( { case PathBitDrawType::Light: path_bit_lights_paint( - session, pathAddEntry, tile_element, height, static_cast(connectedEdges), + session, pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageFlags); break; case PathBitDrawType::Bin: path_bit_bins_paint( - session, pathAddEntry, tile_element, height, static_cast(connectedEdges), + session, pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageFlags); break; case PathBitDrawType::Bench: path_bit_benches_paint( - session, pathAddEntry, tile_element, height, static_cast(connectedEdges), + session, pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageFlags); break; case PathBitDrawType::JumpingFountain: @@ -753,13 +751,12 @@ static void sub_6A3F61( // Redundant zoom-level check removed if (paintScenery) - sub_6A4101(session, tile_element, height, connectedEdges, word_F3F038, railingEntry, imageFlags); + sub_6A4101(session, pathElement, height, connectedEdges, word_F3F038, railingEntry, imageFlags); } // This is about tunnel drawing - uint8_t direction = (tile_element->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; - bool sloped = tile_element->AsPath()->IsSloped(); + uint8_t direction = (pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; + bool sloped = pathElement.IsSloped(); if (connectedEdges & EDGE_SE) { @@ -807,7 +804,7 @@ static void sub_6A3F61( /** * rct2: 0x0006A3590 */ -void path_paint(paint_session* session, uint16_t height, const TileElement* tile_element) +void PaintPath(paint_session* session, uint16_t height, const PathElement& tileElement) { session->InteractionType = ViewportInteractionItem::Footpath; @@ -818,15 +815,15 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (gTrackDesignSaveMode) { - if (tile_element->AsPath()->IsQueue()) + if (tileElement.IsQueue()) { - if (tile_element->AsPath()->GetRideIndex() != gTrackDesignSaveRideIndex) + if (tileElement.GetRideIndex() != gTrackDesignSaveRideIndex) { return; } } - if (!track_design_save_contains_tile_element(tile_element)) + if (!track_design_save_contains_tile_element(reinterpret_cast(&tileElement))) { imageFlags = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); } @@ -837,30 +834,30 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile imageFlags = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); } - if (tile_element->AsPath()->AdditionIsGhost()) + if (tileElement.AdditionIsGhost()) { sceneryImageFlags = CONSTRUCTION_MARKER; } - if (tile_element->IsGhost()) + if (tileElement.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; imageFlags = CONSTRUCTION_MARKER; } - else if (TileInspector::IsElementSelected(tile_element)) + else if (TileInspector::IsElementSelected(reinterpret_cast(&tileElement))) { imageFlags |= CONSTRUCTION_MARKER; sceneryImageFlags = CONSTRUCTION_MARKER; } // For debugging purpose, show blocked tiles with a colour - if (gPaintBlockedTiles && tile_element->AsPath()->IsBlockedByVehicle()) + if (gPaintBlockedTiles && tileElement.IsBlockedByVehicle()) { imageFlags = COLOUR_BRIGHT_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_REMAP; } // Draw wide flags as ghosts, leaving only the "walkable" paths to be drawn normally - if (gPaintWidePathsAsGhost && tile_element->AsPath()->IsWide()) + if (gPaintWidePathsAsGhost && tileElement.IsWide()) { imageFlags &= 0x7FFFF; imageFlags |= CONSTRUCTION_MARKER; @@ -878,11 +875,11 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile } else { - if (tile_element->AsPath()->IsSloped()) + if (tileElement.IsSloped()) { // Diagonal path - if (surface->GetSlope() != PathSlopeToLandSlope[tile_element->AsPath()->GetSlopeDirection()]) + if (surface->GetSlope() != PathSlopeToLandSlope[tileElement.GetSlopeDirection()]) { hasSupports = true; } @@ -923,10 +920,10 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (staff_is_patrol_area_set_for_type(static_cast(staffType), session->MapPosition)) { uint32_t imageId = 2618; - int32_t patrolAreaBaseZ = tile_element->GetBaseZ(); - if (tile_element->AsPath()->IsSloped()) + int32_t patrolAreaBaseZ = tileElement.GetBaseZ(); + if (tileElement.IsSloped()) { - imageId = 2619 + ((tile_element->AsPath()->GetSlopeDirection() + session->CurrentRotation) & 3); + imageId = 2619 + ((tileElement.GetSlopeDirection() + session->CurrentRotation) & 3); patrolAreaBaseZ += 16; } @@ -937,8 +934,8 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_PATH_HEIGHTS)) { - uint16_t heightMarkerBaseZ = tile_element->GetBaseZ() + 3; - if (tile_element->AsPath()->IsSloped()) + uint16_t heightMarkerBaseZ = tileElement.GetBaseZ() + 3; + if (tileElement.IsSloped()) { heightMarkerBaseZ += 8; } @@ -948,45 +945,45 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile PaintAddImageAsParent(session, imageId, { 16, 16, heightMarkerBaseZ }, { 1, 1, 0 }); } - PathSurfaceEntry* footpathEntry = tile_element->AsPath()->GetSurfaceEntry(); - PathRailingsEntry* railingEntry = tile_element->AsPath()->GetRailingEntry(); + PathSurfaceEntry* footpathEntry = tileElement.GetSurfaceEntry(); + PathRailingsEntry* railingEntry = tileElement.GetRailingEntry(); if (footpathEntry != nullptr && railingEntry != nullptr) { if (railingEntry->support_type == RailingEntrySupportType::Pole) { path_paint_pole_support( - session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); + session, tileElement, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); } else { path_paint_box_support( - session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); + session, tileElement, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); } } #ifdef __ENABLE_LIGHTFX__ if (lightfx_is_available()) { - if (tile_element->AsPath()->HasAddition() && !(tile_element->AsPath()->IsBroken())) + if (tileElement.HasAddition() && !(tileElement.IsBroken())) { - auto* pathAddEntry = tile_element->AsPath()->GetAdditionEntry(); + auto* pathAddEntry = tileElement.GetAdditionEntry(); if (pathAddEntry != nullptr && pathAddEntry->flags & PATH_BIT_FLAG_LAMP) { - if (!(tile_element->AsPath()->GetEdges() & EDGE_NE)) + if (!(tileElement.GetEdges() & EDGE_NE)) { lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, -16, 0, height + 23, LightType::Lantern3); } - if (!(tile_element->AsPath()->GetEdges() & EDGE_SE)) + if (!(tileElement.GetEdges() & EDGE_SE)) { lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, 16, height + 23, LightType::Lantern3); } - if (!(tile_element->AsPath()->GetEdges() & EDGE_SW)) + if (!(tileElement.GetEdges() & EDGE_SW)) { lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 16, 0, height + 23, LightType::Lantern3); } - if (!(tile_element->AsPath()->GetEdges() & EDGE_NW)) + if (!(tileElement.GetEdges() & EDGE_NW)) { lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, 0, -16, height + 23, LightType::Lantern3); @@ -998,17 +995,15 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile } void path_paint_box_support( - paint_session* session, const TileElement* tileElement, int32_t height, PathSurfaceEntry* footpathEntry, + paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceEntry* footpathEntry, PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { - const PathElement* pathElement = tileElement->AsPath(); - // Rol edges around rotation - uint8_t edges = ((tileElement->AsPath()->GetEdges() << session->CurrentRotation) & 0xF) - | (((tileElement->AsPath()->GetEdges()) << session->CurrentRotation) >> 4); + uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) + | (((pathElement.GetEdges()) << session->CurrentRotation) >> 4); - uint8_t corners = (((tileElement->AsPath()->GetCorners()) << session->CurrentRotation) & 0xF) - | (((tileElement->AsPath()->GetCorners()) << session->CurrentRotation) >> 4); + uint8_t corners = (((pathElement.GetCorners()) << session->CurrentRotation) & 0xF) + | (((pathElement.GetCorners()) << session->CurrentRotation) >> 4); CoordsXY boundBoxOffset = { stru_98D804[edges][0], stru_98D804[edges][1] }; CoordsXY boundBoxSize = { stru_98D804[edges][2], stru_98D804[edges][3] }; @@ -1016,10 +1011,9 @@ void path_paint_box_support( uint16_t edi = edges | (corners << 4); uint32_t imageId; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - imageId = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + imageId = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + 16; } else @@ -1059,10 +1053,9 @@ void path_paint_box_support( else { uint32_t image_id; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - image_id = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) - & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + image_id = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + railingEntry->bridge_image + 51; } else @@ -1075,7 +1068,7 @@ void path_paint_box_support( height + boundingBoxZOffset); // TODO: Revert this when path import works correctly. - if (!pathElement->IsQueue() && !pathElement->ShouldDrawPathOverSupports()) + if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) { // don't draw } @@ -1087,12 +1080,12 @@ void path_paint_box_support( } } - sub_6A3F61(session, tileElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); + sub_6A3F61(session, pathElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); uint16_t ax = 0; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - ax = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) & 0x3) + 1; + ax = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 0x3) + 1; } if (byte_98D8A4[edges] == 0) @@ -1105,20 +1098,20 @@ void path_paint_box_support( } height += 32; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { height += 16; } paint_util_set_general_support_height(session, height, 0x20); - if (pathElement->IsQueue() || (tileElement->AsPath()->GetEdgesAndCorners() != 0xFF && hasSupports)) + if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports)) { paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); return; } - if (tileElement->AsPath()->GetEdgesAndCorners() == 0xFF) + if (pathElement.GetEdgesAndCorners() == 0xFF) { paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); return; @@ -1148,28 +1141,26 @@ void path_paint_box_support( } void path_paint_pole_support( - paint_session* session, const TileElement* tileElement, int16_t height, PathSurfaceEntry* footpathEntry, + paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceEntry* footpathEntry, PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { - const PathElement* pathElement = tileElement->AsPath(); - // Rol edges around rotation - uint8_t edges = ((tileElement->AsPath()->GetEdges() << session->CurrentRotation) & 0xF) - | (((tileElement->AsPath()->GetEdges()) << session->CurrentRotation) >> 4); + uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) + | (((pathElement.GetEdges()) << session->CurrentRotation) >> 4); CoordsXY boundBoxOffset = { stru_98D804[edges][0], stru_98D804[edges][1] }; CoordsXY boundBoxSize = { stru_98D804[edges][2], stru_98D804[edges][3] }; - uint8_t corners = (((tileElement->AsPath()->GetCorners()) << session->CurrentRotation) & 0xF) - | (((tileElement->AsPath()->GetCorners()) << session->CurrentRotation) >> 4); + uint8_t corners = (((pathElement.GetCorners()) << session->CurrentRotation) & 0xF) + | (((pathElement.GetCorners()) << session->CurrentRotation) >> 4); uint16_t edi = edges | (corners << 4); uint32_t imageId; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - imageId = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) & 3) + 16; + imageId = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 3) + 16; } else { @@ -1209,9 +1200,9 @@ void path_paint_pole_support( else { uint32_t bridgeImage; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { - bridgeImage = ((tileElement->AsPath()->GetSlopeDirection() + session->CurrentRotation) + bridgeImage = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + railingEntry->bridge_image + 16; } @@ -1226,7 +1217,7 @@ void path_paint_pole_support( boundBoxOffset.y, height + boundingBoxZOffset); // TODO: Revert this when path import works correctly. - if (pathElement->IsQueue() || pathElement->ShouldDrawPathOverSupports()) + if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) { PaintAddImageAsChild( session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, @@ -1234,10 +1225,10 @@ void path_paint_pole_support( } } - sub_6A3F61(session, tileElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments + sub_6A3F61(session, pathElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments uint16_t ax = 0; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { ax = 8; } @@ -1258,20 +1249,20 @@ void path_paint_pole_support( } height += 32; - if (tileElement->AsPath()->IsSloped()) + if (pathElement.IsSloped()) { height += 16; } paint_util_set_general_support_height(session, height, 0x20); - if (pathElement->IsQueue() || (tileElement->AsPath()->GetEdgesAndCorners() != 0xFF && hasSupports)) + if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports)) { paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); return; } - if (tileElement->AsPath()->GetEdgesAndCorners() == 0xFF) + if (pathElement.GetEdgesAndCorners() == 0xFF) { paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); return; diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 31a3755871..7deaac180d 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -32,13 +32,12 @@ static constexpr const CoordsXY lengths[] = { * * rct2: 0x006DFF47 */ -void scenery_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tileElement) +void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement) { if (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) { return; } - const SmallSceneryElement* sceneryElement = tileElement->AsSmallScenery(); session->InteractionType = ViewportInteractionItem::Scenery; CoordsXYZ boxlength; CoordsXYZ boxoffset; @@ -49,22 +48,22 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co const int32_t rotation = session->CurrentRotation; if (gTrackDesignSaveMode) { - if (!track_design_save_contains_tile_element(tileElement)) + if (!track_design_save_contains_tile_element(reinterpret_cast(&sceneryElement))) { marker = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); } } - if (tileElement->IsGhost()) + if (sceneryElement.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; marker = CONSTRUCTION_MARKER; } - else if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&sceneryElement))) { marker = CONSTRUCTION_MARKER; } - auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); + auto* sceneryEntry = sceneryElement.GetEntry(); if (sceneryEntry == nullptr) { @@ -119,7 +118,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co else { // 6DFFC2: - uint8_t quadrant = (tileElement->AsSmallScenery()->GetSceneryQuadrant() + rotation) & 3; + uint8_t quadrant = (sceneryElement.GetSceneryQuadrant() + rotation) & 3; x_offset = SceneryQuadrantOffsets[quadrant].x; y_offset = SceneryQuadrantOffsets[quadrant].y; boxoffset.x = x_offset; @@ -133,11 +132,11 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_WITHER)) { - if (tileElement->AsSmallScenery()->GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_1) + if (sceneryElement.GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_1) { baseImageid += 4; } - if (tileElement->AsSmallScenery()->GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_2) + if (sceneryElement.GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_2) { baseImageid += 4; } @@ -146,11 +145,11 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co { if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { - baseImageid |= SPRITE_ID_PALETTE_COLOUR_2(sceneryElement->GetPrimaryColour(), sceneryElement->GetSecondaryColour()); + baseImageid |= SPRITE_ID_PALETTE_COLOUR_2(sceneryElement.GetPrimaryColour(), sceneryElement.GetSecondaryColour()); } else { - baseImageid |= SPRITE_ID_PALETTE_COLOUR_1(sceneryElement->GetPrimaryColour()); + baseImageid |= SPRITE_ID_PALETTE_COLOUR_1(sceneryElement.GetPrimaryColour()); } } if (marker != 0) @@ -170,7 +169,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co { // Draw translucent overlay: // TODO: Name palette entries - int32_t image_id = (baseImageid & 0x7FFFF) + (EnumValue(GlassPaletteIds[sceneryElement->GetPrimaryColour()]) << 19) + int32_t image_id = (baseImageid & 0x7FFFF) + (EnumValue(GlassPaletteIds[sceneryElement.GetPrimaryColour()]) << 19) + 0x40000004; PaintAddImageAsChild( session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, @@ -292,7 +291,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co { // 6E01F8: frame += ((session->SpritePosition.x / 4) + (session->SpritePosition.y / 4)); - frame += tileElement->AsSmallScenery()->GetSceneryQuadrant() << 2; + frame += sceneryElement.GetSceneryQuadrant() << 2; } // 6E0222: uint16_t delay = sceneryEntry->animation_delay & 0xFF; @@ -313,11 +312,11 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { image_id |= SPRITE_ID_PALETTE_COLOUR_2( - sceneryElement->GetPrimaryColour(), sceneryElement->GetSecondaryColour()); + sceneryElement.GetPrimaryColour(), sceneryElement.GetSecondaryColour()); } else { - image_id |= SPRITE_ID_PALETTE_COLOUR_1(sceneryElement->GetPrimaryColour()); + image_id |= SPRITE_ID_PALETTE_COLOUR_1(sceneryElement.GetPrimaryColour()); } } if (marker != 0) @@ -340,7 +339,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co } } // 6E0556: Draw supports: - if (sceneryElement->NeedsSupports()) + if (sceneryElement.NeedsSupports()) { if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_SUPPORTS))) { @@ -354,7 +353,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co uint32_t supportImageColourFlags = IMAGE_TYPE_REMAP; if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_PAINT_SUPPORTS)) { - supportImageColourFlags = SPRITE_ID_PALETTE_COLOUR_1(sceneryElement->GetPrimaryColour()); + supportImageColourFlags = SPRITE_ID_PALETTE_COLOUR_1(sceneryElement.GetPrimaryColour()); } if (marker != 0) { @@ -390,7 +389,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { // 6E075C: - direction = (tileElement->AsSmallScenery()->GetSceneryQuadrant() + rotation) % 4; + direction = (sceneryElement.GetSceneryQuadrant() + rotation) % 4; paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), height, 0x20); return; @@ -408,7 +407,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - direction = (tileElement->AsSmallScenery()->GetSceneryQuadrant() + rotation) % 4; + direction = (sceneryElement.GetSceneryQuadrant() + rotation) % 4; paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); return; diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 771215b680..ee89107d53 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -422,9 +422,9 @@ static uint32_t get_tunnel_image(ObjectEntryIndex index, uint8_t type) return result; } -static uint8_t viewport_surface_paint_setup_get_relative_slope(const TileElement* tileElement, int32_t rotation) +static uint8_t viewport_surface_paint_setup_get_relative_slope(const SurfaceElement& surfaceElement, int32_t rotation) { - const uint8_t slope = tileElement->AsSurface()->GetSlope(); + const uint8_t slope = surfaceElement.GetSlope(); const uint8_t slopeHeight = slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT; uint16_t slopeCorners = (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) << rotation; slopeCorners = ((slopeCorners >> 4) | slopeCorners) & 0x0F; @@ -961,23 +961,24 @@ static std::pair surface_get_height_above_water( /** * rct2: 0x0066062C */ -void surface_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement) +void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, const SurfaceElement& tileElement) { rct_drawpixelinfo* dpi = &session->DPI; session->InteractionType = ViewportInteractionItem::Terrain; session->DidPassSurface = true; - session->SurfaceElement = tileElement; + session->SurfaceElement = reinterpret_cast(&tileElement); const auto zoomLevel = dpi->zoom_level; const uint8_t rotation = session->CurrentRotation; - const auto terrain_type = tileElement->AsSurface()->GetSurfaceStyle(); + const auto terrain_type = tileElement.GetSurfaceStyle(); const uint8_t surfaceShape = viewport_surface_paint_setup_get_relative_slope(tileElement, rotation); const CoordsXY& base = session->SpritePosition; const corner_height& cornerHeights = corner_heights[surfaceShape]; + const TileElement* elementPtr = &reinterpret_cast(tileElement); tile_descriptor selfDescriptor = { TileCoordsXY(base), - tileElement, + elementPtr, static_cast(terrain_type), surfaceShape, { @@ -1010,8 +1011,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c continue; } - const uint32_t surfaceSlope = viewport_surface_paint_setup_get_relative_slope( - reinterpret_cast(surfaceElement), rotation); + const uint32_t surfaceSlope = viewport_surface_paint_setup_get_relative_slope(*surfaceElement, rotation); const uint8_t baseHeight = surfaceElement->GetBaseZ() / 16; const corner_height& ch = corner_heights[surfaceSlope]; @@ -1058,7 +1058,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c { if ((session->ViewFlags & (VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_UNDERGROUND_INSIDE)) == 0) { - grassLength = tileElement->AsSurface()->GetGrassLength() & 0x7; + grassLength = tileElement.GetGrassLength() & 0x7; } } @@ -1076,7 +1076,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c imageId |= 0x41880000; } - if (OpenRCT2::TileInspector::IsElementSelected(tileElement)) + if (OpenRCT2::TileInspector::IsElementSelected(elementPtr)) { imageId |= CONSTRUCTION_MARKER; } @@ -1118,8 +1118,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c { assert(surfaceShape < std::size(byte_97B444)); - auto [local_height, local_surfaceShape] = surface_get_height_above_water( - *tileElement->AsSurface(), height, surfaceShape); + auto [local_height, local_surfaceShape] = surface_get_height_above_water(tileElement, height, surfaceShape); image_id |= SPR_TERRAIN_SELECTION_PATROL_AREA + byte_97B444[local_surfaceShape]; image_id |= patrolColour << 19; @@ -1150,12 +1149,12 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c if (session->ViewFlags & VIEWPORT_FLAG_LAND_OWNERSHIP) { // loc_660E9A: - if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED) + if (tileElement.GetOwnership() & OWNERSHIP_OWNED) { assert(surfaceShape < std::size(byte_97B444)); PaintAttachToPreviousPS(session, SPR_TERRAIN_SELECTION_SQUARE + byte_97B444[surfaceShape], 0, 0); } - else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_AVAILABLE) + else if (tileElement.GetOwnership() & OWNERSHIP_AVAILABLE) { const CoordsXY& pos = session->MapPosition; const int32_t height2 = (tile_element_height({ pos.x + 16, pos.y + 16 })) + 3; @@ -1165,14 +1164,14 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c } } - if (session->ViewFlags & VIEWPORT_FLAG_CONSTRUCTION_RIGHTS && !(tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED)) + if (session->ViewFlags & VIEWPORT_FLAG_CONSTRUCTION_RIGHTS && !(tileElement.GetOwnership() & OWNERSHIP_OWNED)) { - if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) + if (tileElement.GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) { assert(surfaceShape < std::size(byte_97B444)); PaintAttachToPreviousPS(session, SPR_TERRAIN_SELECTION_DOTTED + byte_97B444[surfaceShape], 0, 0); } - else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) + else if (tileElement.GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) { const CoordsXY& pos = session->MapPosition; const int32_t height2 = tile_element_height({ pos.x + 16, pos.y + 16 }); @@ -1226,8 +1225,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c else { // The water tool should draw its grid _on_ the water, rather than on the surface under water. - auto [local_height, local_surfaceShape] = surface_get_height_above_water( - *tileElement->AsSurface(), height, surfaceShape); + auto [local_height, local_surfaceShape] = surface_get_height_above_water(tileElement, height, surfaceShape); const int32_t image_id = (SPR_TERRAIN_SELECTION_CORNER + byte_97B444[local_surfaceShape]) | 0x21300000; @@ -1280,7 +1278,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c if (!(session->ViewFlags & VIEWPORT_FLAG_HIDE_VERTICAL)) { - const auto edgeStyle = tileElement->AsSurface()->GetEdgeStyle(); + const auto edgeStyle = tileElement.GetEdgeStyle(); if (static_cast(edgeStyle) >= object_entry_group_counts[EnumValue(ObjectType::TerrainEdge)]) { log_verbose("edgeStyle: %d", edgeStyle); @@ -1294,7 +1292,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c session, EDGE_BOTTOMRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[2]); } - const uint16_t waterHeight = tileElement->AsSurface()->GetWaterHeight(); + const uint16_t waterHeight = tileElement.GetWaterHeight(); const bool waterGetsClipped = (session->ViewFlags & VIEWPORT_FLAG_CLIP_VIEW) && (waterHeight > gClipHeight * COORDS_Z_STEP); if (waterHeight > 0 && !gTrackDesignSaveMode && !waterGetsClipped) @@ -1323,7 +1321,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c if (!(session->ViewFlags & VIEWPORT_FLAG_HIDE_VERTICAL)) { // This wasn't in the original, but the code depended on globals that were only set in a different conditional - const uint32_t edgeStyle = tileElement->AsSurface()->GetEdgeStyle(); + const uint32_t edgeStyle = tileElement.GetEdgeStyle(); // end new code viewport_surface_draw_water_side_bottom( @@ -1337,12 +1335,12 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c } } - if ((tileElement->AsSurface()->GetParkFences()) && !gTrackDesignSaveMode) + if ((tileElement.GetParkFences()) && !gTrackDesignSaveMode) { // Owned land boundary fences session->InteractionType = ViewportInteractionItem::ParkEntrance; - uint8_t rotatedFences = rol4(tileElement->AsSurface()->GetParkFences(), rotation); + uint8_t rotatedFences = rol4(tileElement.GetParkFences(), rotation); for (const auto& fenceData : _tileSurfaceBoundaries) { diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index cd7626c086..98eb889f2b 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -132,7 +132,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) session->MapPosition.x = x; session->MapPosition.y = y; - TileElement* tile_element = map_get_first_element_at(session->MapPosition); + const TileElement* tile_element = map_get_first_element_at(session->MapPosition); if (tile_element == nullptr) return; uint8_t rotation = session->CurrentRotation; @@ -236,7 +236,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) previousBaseZ = baseZ; session->PathElementOnSameHeight = nullptr; session->TrackElementOnSameHeight = nullptr; - TileElement* tile_element_sub_iterator = tile_element; + const TileElement* tile_element_sub_iterator = tile_element; while (!(tile_element_sub_iterator++)->IsLastForTile()) { if (tile_element_sub_iterator->GetBaseZ() != tile_element->GetBaseZ()) @@ -270,28 +270,28 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) switch (tile_element->GetType()) { case TILE_ELEMENT_TYPE_SURFACE: - surface_paint(session, direction, baseZ, tile_element); + PaintSurface(session, direction, baseZ, *(tile_element->AsSurface())); break; case TILE_ELEMENT_TYPE_PATH: - path_paint(session, baseZ, tile_element); + PaintPath(session, baseZ, *(tile_element->AsPath())); break; case TILE_ELEMENT_TYPE_TRACK: - track_paint(session, direction, baseZ, tile_element); + PaintTrack(session, direction, baseZ, *(tile_element->AsTrack())); break; case TILE_ELEMENT_TYPE_SMALL_SCENERY: - scenery_paint(session, direction, baseZ, tile_element); + PaintSmallScenery(session, direction, baseZ, *(tile_element->AsSmallScenery())); break; case TILE_ELEMENT_TYPE_ENTRANCE: - entrance_paint(session, direction, baseZ, tile_element); + PaintEntrance(session, direction, baseZ, *(tile_element->AsEntrance())); break; case TILE_ELEMENT_TYPE_WALL: - fence_paint(session, direction, baseZ, tile_element); + PaintWall(session, direction, baseZ, *(tile_element->AsWall())); break; case TILE_ELEMENT_TYPE_LARGE_SCENERY: - large_scenery_paint(session, direction, baseZ, tile_element); + PaintLargeScenery(session, direction, baseZ, *(tile_element->AsLargeScenery())); break; case TILE_ELEMENT_TYPE_BANNER: - banner_paint(session, direction, baseZ, tile_element); + PaintBanner(session, direction, baseZ, *(tile_element->AsBanner())); break; // A corrupt element inserted by OpenRCT2 itself, which skips the drawing of the next element only. case TILE_ELEMENT_TYPE_CORRUPT: diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 3de26c34d4..a30de42269 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -103,14 +103,14 @@ uint16_t paint_util_rotate_segments(uint16_t segments, uint8_t rotation); void tile_element_paint_setup(paint_session* session, const CoordsXY& mapCoords, bool isTrackPiecePreview = false); -void entrance_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element); -void banner_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element); -void surface_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement); -void path_paint(paint_session* session, uint16_t height, const TileElement* tileElement); -void scenery_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tileElement); -void fence_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tileElement); -void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t height, const TileElement* tileElement); -void track_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tileElement); +void PaintEntrance(paint_session* session, uint8_t direction, int32_t height, const EntranceElement& entranceElement); +void PaintBanner(paint_session* session, uint8_t direction, int32_t height, const BannerElement& bannerElement); +void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, const SurfaceElement& tileElement); +void PaintPath(paint_session* session, uint16_t height, const PathElement& tileElement); +void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement); +void PaintWall(paint_session* session, uint8_t direction, int32_t height, const WallElement& tileElement); +void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement); +void PaintTrack(paint_session* session, uint8_t direction, int32_t height, const TrackElement& tileElement); bool PaintShouldShowHeightMarkers(const paint_session* session, const uint32_t viewportFlag); diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 1792186556..49ab6dcc09 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -40,7 +40,7 @@ static constexpr const uint8_t byte_9A40CC[] = { 0, 0, 20, 24, 28, 32, 32, 32, 32, 32, 28, 24, 20, 0, 4, 0, 0, 0, 4, 8, 12, 16, 16, 16, 16, 16, 12, 8, 4, 0, 20, 0, }; -static void fence_paint_door( +static void PaintWallDoor( paint_session* session, uint32_t imageId, WallSceneryEntry* wallEntry, uint32_t imageColourFlags, uint32_t tertiaryColour, uint32_t dword_141F710, CoordsXYZ offset, CoordsXYZ boundsR1, CoordsXYZ boundsR1_, CoordsXYZ boundsR2, CoordsXYZ boundsR2_, CoordsXYZ boundsL1, CoordsXYZ boundsL1_) @@ -97,7 +97,7 @@ static void fence_paint_door( } } -static void fence_paint_wall( +static void PaintWallWall( paint_session* session, uint32_t frameNum, const WallSceneryEntry* wallEntry, uint32_t dword_141F710, uint32_t imageColourFlags, uint32_t dword_141F718, uint32_t tertiaryColour, uint32_t imageOffset, CoordsXYZ offset, CoordsXYZ bounds, CoordsXYZ boundsOffset) @@ -155,11 +155,11 @@ static void fence_paint_wall( * @param height (dx) * @param tile_element (esi) */ -void fence_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) +void PaintWall(paint_session* session, uint8_t direction, int32_t height, const WallElement& wallElement) { session->InteractionType = ViewportInteractionItem::Wall; - auto* wallEntry = tile_element->AsWall()->GetEntry(); + auto* wallEntry = wallElement.GetEntry(); if (wallEntry == nullptr) { return; @@ -171,40 +171,40 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons frameNum = (gCurrentTicks & 7) * 2; } - int32_t primaryColour = tile_element->AsWall()->GetPrimaryColour(); + int32_t primaryColour = wallElement.GetPrimaryColour(); uint32_t imageColourFlags = SPRITE_ID_PALETTE_COLOUR_1(primaryColour); uint32_t dword_141F718 = imageColourFlags + 0x23800006; if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) { - uint8_t secondaryColour = tile_element->AsWall()->GetSecondaryColour(); + uint8_t secondaryColour = wallElement.GetSecondaryColour(); imageColourFlags |= secondaryColour << 24 | IMAGE_TYPE_REMAP_2_PLUS; } uint32_t tertiaryColour = 0; if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) { - tertiaryColour = tile_element->AsWall()->GetTertiaryColour(); + tertiaryColour = wallElement.GetTertiaryColour(); imageColourFlags &= 0x0DFFFFFFF; } - paint_util_set_general_support_height(session, 8 * tile_element->clearance_height, 0x20); + paint_util_set_general_support_height(session, 8 * wallElement.clearance_height, 0x20); uint32_t dword_141F710 = 0; if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { - if (!track_design_save_contains_tile_element(tile_element)) + if (!track_design_save_contains_tile_element(reinterpret_cast(&wallElement))) { dword_141F710 = SPRITE_ID_PALETTE_COLOUR_1(EnumValue(FilterPaletteID::Palette46)); } } - if (tile_element->IsGhost()) + if (wallElement.IsGhost()) { session->InteractionType = ViewportInteractionItem::None; dword_141F710 = CONSTRUCTION_MARKER; } - else if (OpenRCT2::TileInspector::IsElementSelected(tile_element)) + else if (OpenRCT2::TileInspector::IsElementSelected(reinterpret_cast(&wallElement))) { dword_141F710 = CONSTRUCTION_MARKER; } @@ -217,9 +217,9 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons { CoordsXYZ offset; CoordsXYZ boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_; - uint8_t animationFrame = tile_element->AsWall()->GetAnimationFrame(); + uint8_t animationFrame = wallElement.GetAnimationFrame(); // Add the direction as well - if (tile_element->AsWall()->AnimationIsBackwards()) + if (wallElement.AnimationIsBackwards()) animationFrame |= (1 << 4); uint32_t imageId; switch (direction) @@ -237,7 +237,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons offset = { 0, 0, static_cast(height) }; - fence_paint_door( + PaintWallDoor( session, imageId, wallEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -255,7 +255,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons offset = { 1, 31, static_cast(height) }; - fence_paint_door( + PaintWallDoor( session, imageId, wallEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -273,7 +273,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons offset = { 31, 0, static_cast(height) }; - fence_paint_door( + PaintWallDoor( session, imageId, wallEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -291,7 +291,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons offset = { 2, 1, static_cast(height) }; - fence_paint_door( + PaintWallDoor( session, imageId, wallEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -306,11 +306,11 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons switch (direction) { case 0: - if (tile_element->AsWall()->GetSlope() == 2) + if (wallElement.GetSlope() == 2) { imageOffset = 3; } - else if (tile_element->AsWall()->GetSlope() == 1) + else if (wallElement.GetSlope() == 1) { imageOffset = 5; } @@ -325,11 +325,11 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons break; case 1: - if (tile_element->AsWall()->GetSlope() == 2) + if (wallElement.GetSlope() == 2) { imageOffset = 2; } - else if (tile_element->AsWall()->GetSlope() == 1) + else if (wallElement.GetSlope() == 1) { imageOffset = 4; } @@ -359,11 +359,11 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons break; case 2: - if (tile_element->AsWall()->GetSlope() == 2) + if (wallElement.GetSlope() == 2) { imageOffset = 5; } - else if (tile_element->AsWall()->GetSlope() == 1) + else if (wallElement.GetSlope() == 1) { imageOffset = 3; } @@ -383,11 +383,11 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons break; case 3: - if (tile_element->AsWall()->GetSlope() == 2) + if (wallElement.GetSlope() == 2) { imageOffset = 4; } - else if (tile_element->AsWall()->GetSlope() == 1) + else if (wallElement.GetSlope() == 1) { imageOffset = 2; } @@ -402,7 +402,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons break; } - fence_paint_wall( + PaintWallWall( session, frameNum, wallEntry, dword_141F710, imageColourFlags, dword_141F718, tertiaryColour, imageOffset, offset, bounds, boundsOffset); @@ -416,7 +416,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons return; } - auto secondaryColour = tile_element->AsWall()->GetSecondaryColour(); + auto secondaryColour = wallElement.GetSecondaryColour(); if (dword_141F710 != 0) { secondaryColour = COLOUR_GREY; @@ -436,7 +436,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons return; } - auto banner = tile_element->AsWall()->GetBanner(); + auto banner = wallElement.GetBanner(); if (banner != nullptr) { auto ft = Formatter(); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 0da5fbfdbd..bde96b1845 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -202,7 +202,7 @@ enum // clang-format on bool track_paint_util_has_fence( - enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint8_t rotation) + enum edge_t edge, const CoordsXY& position, const TrackElement& trackElement, const Ride* ride, uint8_t rotation) { const auto* stationObject = ride_get_station_object(ride); if (stationObject != nullptr && stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -227,7 +227,7 @@ bool track_paint_util_has_fence( auto entranceLoc = TileCoordsXY(position) + offset; - int32_t entranceId = tileElement->AsTrack()->GetStationIndex(); + int32_t entranceId = trackElement.GetStationIndex(); const TileCoordsXYZD entrance = ride_get_entrance_location(ride, entranceId); const TileCoordsXYZD exit = ride_get_exit_location(ride, entranceId); @@ -264,27 +264,27 @@ void track_paint_util_paint_floor( } void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, + paint_session* session, uint8_t edges, const CoordsXY& position, const TrackElement& trackElement, const Ride* ride, uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) { uint32_t imageId; - if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, rotation)) + if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, rotation)) { imageId = fenceSprites[3] | colourFlags; PaintAddImageAsChild(session, imageId, 0, 0, 32, 1, 7, height, 0, 2, height + 2); } - if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, rotation)) + if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, rotation)) { imageId = fenceSprites[0] | colourFlags; PaintAddImageAsChild(session, imageId, 0, 0, 1, 32, 7, height, 2, 0, height + 2); } - if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, rotation)) + if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, rotation)) { imageId = fenceSprites[1] | colourFlags; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 7 }, { 0, 30, height + 2 }); } - if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, rotation)) + if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, rotation)) { imageId = fenceSprites[2] | colourFlags; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 30, 0, height + 2 }); @@ -305,38 +305,38 @@ bool track_paint_util_should_paint_supports(const CoordsXY& position) static void track_paint_util_draw_station_impl( paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, - const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB); + const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB); void track_paint_util_draw_station( - paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement) + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TrackElement& trackElement) { - track_paint_util_draw_station_impl(session, ride, direction, height, height, tileElement, 5, 7); + track_paint_util_draw_station_impl(session, ride, direction, height, height, trackElement, 5, 7); } void track_paint_util_draw_station_2( - paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { - track_paint_util_draw_station_impl(session, ride, direction, height, height, tileElement, fenceOffsetA, fenceOffsetB); + track_paint_util_draw_station_impl(session, ride, direction, height, height, trackElement, fenceOffsetA, fenceOffsetB); } void track_paint_util_draw_station_3( paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, - const TileElement* tileElement) + const TrackElement& trackElement) { - track_paint_util_draw_station_impl(session, ride, direction, height, coverHeight, tileElement, 5, 7); + track_paint_util_draw_station_impl(session, ride, direction, height, coverHeight, trackElement, 5, 7); } static void track_paint_util_draw_station_impl( paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, - const TileElement* tileElement, int32_t fenceOffsetA, int32_t fenceOffsetB) + const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { if (ride == nullptr) return; CoordsXY position = session->MapPosition; auto stationObj = ride_get_station_object(ride); - const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight(); + const bool hasGreenLight = trackElement.HasGreenLight(); if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) return; @@ -347,9 +347,9 @@ static void track_paint_util_draw_station_impl( if (direction == 0 || direction == 2) { // height += 5 (height + 5); - hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, session->CurrentRotation); - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 0) { if (hasGreenLight) { @@ -364,7 +364,7 @@ static void track_paint_util_draw_station_impl( | session->TrackColours[SCHEME_SUPPORTS]; } } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 2) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) | session->TrackColours[SCHEME_SUPPORTS]; @@ -379,12 +379,12 @@ static void track_paint_util_draw_station_impl( track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, coverHeight); // height += 5 (height + 5) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 0) { imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_SW_NE : SPR_STATION_PLATFORM_END_RED_LIGHT_SW_NE) | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 2) { imageId = SPR_STATION_PLATFORM_BEGIN_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -395,14 +395,14 @@ static void track_paint_util_draw_station_impl( PaintAddImageAsParent(session, imageId, { 0, 24, height + fenceOffsetA }, { 32, 8, 1 }); // height += 2 (height + 7) - hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation); if (hasFence) { - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { imageId = SPR_STATION_LIGHT_BACK_ANGLE_FENCED_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; } @@ -412,13 +412,13 @@ static void track_paint_util_draw_station_impl( } PaintAddImageAsParent(session, imageId, { 0, 31, height + fenceOffsetB }, { 32, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 23, height + fenceOffsetB }, { 1, 8, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; @@ -428,12 +428,12 @@ static void track_paint_util_draw_station_impl( track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, coverHeight); // height += 7 (height + 7) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 0, height + fenceOffsetB }, { 1, 8, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { imageId = SPR_STATION_LIGHT_BACK_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 0, height + fenceOffsetB }, { 1, 8, 7 }); @@ -442,9 +442,9 @@ static void track_paint_util_draw_station_impl( else if (direction == 1 || direction == 3) { // height += 5 (height + 5); - hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, session->CurrentRotation); - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 3) { if (hasGreenLight) { @@ -459,7 +459,7 @@ static void track_paint_util_draw_station_impl( | session->TrackColours[SCHEME_SUPPORTS]; } } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 1) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) | session->TrackColours[SCHEME_SUPPORTS]; @@ -474,12 +474,12 @@ static void track_paint_util_draw_station_impl( track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, coverHeight); // height += 5 (height + 5) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 3) { imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_NW_SE : SPR_STATION_PLATFORM_END_RED_LIGHT_NW_SE) | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 1) { imageId = SPR_STATION_PLATFORM_BEGIN_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -490,14 +490,14 @@ static void track_paint_util_draw_station_impl( PaintAddImageAsParent(session, imageId, { 24, 0, height + fenceOffsetA }, { 8, 32, 1 }); // height += 2 (height + 7) - hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation); if (hasFence) { - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { imageId = SPR_STATION_LIGHT_BACK_ANGLE_FENCED_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -507,13 +507,13 @@ static void track_paint_util_draw_station_impl( } PaintAddImageAsParent(session, imageId, { 31, 0, height + fenceOffsetB }, { 1, 32, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 23, 31, height + fenceOffsetB }, { 8, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; @@ -524,12 +524,12 @@ static void track_paint_util_draw_station_impl( track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, coverHeight); // height += 7 (height + 7) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 31, height + fenceOffsetB }, { 8, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { imageId = SPR_STATION_LIGHT_BACK_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 31, height + fenceOffsetB }, { 8, 1, 7 }); @@ -538,7 +538,7 @@ static void track_paint_util_draw_station_impl( } void track_paint_util_draw_station_inverted( - paint_session* session, const Ride* ride, Direction direction, int32_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t stationVariant) { if (ride == nullptr) @@ -546,7 +546,7 @@ void track_paint_util_draw_station_inverted( CoordsXY position = session->MapPosition; auto stationObj = ride_get_station_object(ride); - const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight(); + const bool hasGreenLight = trackElement.HasGreenLight(); if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) return; @@ -557,9 +557,9 @@ void track_paint_util_draw_station_inverted( if (direction == 0 || direction == 2) { // height += 5 (height + 5); - hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, session->CurrentRotation); - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 0) { if (hasGreenLight) { @@ -574,7 +574,7 @@ void track_paint_util_draw_station_inverted( | session->TrackColours[SCHEME_SUPPORTS]; } } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 2) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) | session->TrackColours[SCHEME_SUPPORTS]; @@ -589,12 +589,12 @@ void track_paint_util_draw_station_inverted( track_paint_util_draw_station_covers_2(session, EDGE_NW, hasFence, stationObj, height, stationVariant); // height += 5 (height + 5) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 0) { imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_SW_NE : SPR_STATION_PLATFORM_END_RED_LIGHT_SW_NE) | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 2) { imageId = SPR_STATION_PLATFORM_BEGIN_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -605,14 +605,14 @@ void track_paint_util_draw_station_inverted( PaintAddImageAsParent(session, imageId, { 0, 24, height + 6 }, { 32, 8, 1 }); // height += 2 (height + 7) - hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation); if (hasFence) { - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { imageId = SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { imageId = SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; } @@ -622,13 +622,13 @@ void track_paint_util_draw_station_inverted( } PaintAddImageAsParent(session, imageId, { 0, 31, height + 8 }, { 32, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 23, height + 8 }, { 1, 8, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; @@ -638,12 +638,12 @@ void track_paint_util_draw_station_inverted( track_paint_util_draw_station_covers_2(session, EDGE_SE, hasFence, stationObj, height, stationVariant); // height += 7 (height + 7) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 0) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 0) { imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 0, height + 8 }, { 1, 8, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 2) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 2) { imageId = SPR_STATION_LIGHT_BACK_NE_SW | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 31, 0, height + 8 }, { 1, 8, 7 }); @@ -652,9 +652,9 @@ void track_paint_util_draw_station_inverted( else if (direction == 1 || direction == 3) { // height += 5 (height + 5); - hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, session->CurrentRotation); - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 3) { if (hasGreenLight) { @@ -669,7 +669,7 @@ void track_paint_util_draw_station_inverted( | session->TrackColours[SCHEME_SUPPORTS]; } } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 1) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) | session->TrackColours[SCHEME_SUPPORTS]; @@ -684,12 +684,12 @@ void track_paint_util_draw_station_inverted( track_paint_util_draw_station_covers_2(session, EDGE_NE, hasFence, stationObj, height, stationVariant); // height += 5 (height + 5) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 3) { imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_NW_SE : SPR_STATION_PLATFORM_END_RED_LIGHT_NW_SE) | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 1) { imageId = SPR_STATION_PLATFORM_BEGIN_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -700,14 +700,14 @@ void track_paint_util_draw_station_inverted( PaintAddImageAsParent(session, imageId, { 24, 0, height + 6 }, { 8, 32, 1 }); // height += 2 (height + 7) - hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation); if (hasFence) { - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { imageId = SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { imageId = SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; } @@ -717,13 +717,13 @@ void track_paint_util_draw_station_inverted( } PaintAddImageAsParent(session, imageId, { 31, 0, height + 8 }, { 1, 32, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + else if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 23, 31, height + 8 }, { 8, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; @@ -734,12 +734,12 @@ void track_paint_util_draw_station_inverted( track_paint_util_draw_station_covers_2(session, EDGE_SW, hasFence, stationObj, height, stationVariant); // height += 7 (height + 7) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::BeginStation && direction == 3) + if (trackElement.GetTrackType() == TrackElemType::BeginStation && direction == 3) { imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 31, height + 8 }, { 8, 1, 7 }); } - else if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && direction == 1) + else if (trackElement.GetTrackType() == TrackElemType::EndStation && direction == 1) { imageId = SPR_STATION_LIGHT_BACK_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 31, height + 8 }, { 8, 1, 7 }); @@ -852,7 +852,7 @@ bool track_paint_util_draw_station_covers_2( void track_paint_util_draw_narrow_station_platform( paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, - const TileElement* tileElement) + const TrackElement& trackElement) { CoordsXY position = session->MapPosition; auto stationObj = ride_get_station_object(ride); @@ -861,7 +861,7 @@ void track_paint_util_draw_narrow_station_platform( if (direction & 1) { - bool hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation); + bool hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, session->CurrentRotation); uint32_t imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NE : SPR_STATION_NARROW_EDGE_NE) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height + zOffset }, { 8, 32, 1 }); @@ -870,7 +870,7 @@ void track_paint_util_draw_narrow_station_platform( imageId = SPR_STATION_NARROW_EDGE_SW | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 24, 0, height + zOffset }, { 8, 32, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; @@ -880,7 +880,7 @@ void track_paint_util_draw_narrow_station_platform( } else { - bool hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, session->CurrentRotation); + bool hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, session->CurrentRotation); uint32_t imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NW : SPR_STATION_NARROW_EDGE_NW) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height + zOffset }, { 32, 8, 1 }); @@ -889,7 +889,7 @@ void track_paint_util_draw_narrow_station_platform( imageId = SPR_STATION_NARROW_EDGE_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 24, height + zOffset }, { 32, 8, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; @@ -901,7 +901,7 @@ void track_paint_util_draw_narrow_station_platform( void track_paint_util_draw_pier( paint_session* session, const Ride* ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, - int32_t height, const TileElement* tileElement, uint8_t rotation) + int32_t height, const TrackElement& trackElement, uint8_t rotation) { if (stationObj != nullptr && stationObj->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) return; @@ -911,7 +911,7 @@ void track_paint_util_draw_pier( if (direction & 1) { - hasFence = track_paint_util_has_fence(EDGE_NE, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, session->CurrentRotation); imageId = (hasFence ? SPR_STATION_PIER_EDGE_NE_FENCED : SPR_STATION_PIER_EDGE_NE) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 1 }, { 2, 0, height }); @@ -920,7 +920,7 @@ void track_paint_util_draw_pier( imageId = SPR_STATION_PIER_EDGE_SW | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 24, 0, height }, { 8, 32, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_STATION_PIER_FENCE_SW | session->TrackColours[SCHEME_SUPPORTS]; @@ -930,7 +930,7 @@ void track_paint_util_draw_pier( } else { - hasFence = track_paint_util_has_fence(EDGE_NW, position, tileElement, ride, rotation); + hasFence = track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, rotation); imageId = (hasFence ? SPR_STATION_PIER_EDGE_NW_FENCED : SPR_STATION_PIER_EDGE_NW) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 1 }, { 0, 2, height }); @@ -939,7 +939,7 @@ void track_paint_util_draw_pier( imageId = SPR_STATION_PIER_EDGE_SE | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 24, height }, { 32, 8, 1 }); - hasFence = track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, rotation); + hasFence = track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, rotation); if (hasFence) { imageId = SPR_STATION_PIER_FENCE_SE | session->TrackColours[SCHEME_SUPPORTS]; @@ -2060,7 +2060,7 @@ void track_paint_util_spinning_tunnel_paint(paint_session* session, int8_t thick } void track_paint_util_onride_photo_small_paint( - paint_session* session, Direction direction, int32_t height, const TileElement* tileElement) + paint_session* session, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_ON_RIDE_PHOTO_SIGN_SMALL_SW_NE, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_S, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_SMALL_S }, @@ -2069,7 +2069,7 @@ void track_paint_util_onride_photo_small_paint( { SPR_ON_RIDE_PHOTO_SIGN_SMALL_SE_NW, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_E, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_SMALL_E }, }; - bool takingPhoto = tileElement->AsTrack()->IsTakingPhoto(); + bool takingPhoto = trackElement.IsTakingPhoto(); uint32_t imageId = imageIds[direction][0] | session->TrackColours[SCHEME_MISC]; uint32_t flashImageId = imageIds[direction][takingPhoto ? 2 : 1] | session->TrackColours[SCHEME_MISC]; switch (direction) @@ -2098,7 +2098,7 @@ void track_paint_util_onride_photo_small_paint( } void track_paint_util_onride_photo_paint( - paint_session* session, Direction direction, int32_t height, const TileElement* tileElement) + paint_session* session, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_ON_RIDE_PHOTO_SIGN_SW_NE, SPR_ON_RIDE_PHOTO_CAMERA_S, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_S }, @@ -2107,7 +2107,7 @@ void track_paint_util_onride_photo_paint( { SPR_ON_RIDE_PHOTO_SIGN_SE_NW, SPR_ON_RIDE_PHOTO_CAMERA_E, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_E }, }; - bool takingPhoto = tileElement->AsTrack()->IsTakingPhoto(); + bool takingPhoto = trackElement.IsTakingPhoto(); uint32_t imageId = imageIds[direction][0] | session->TrackColours[SCHEME_MISC]; uint32_t flashImageId = imageIds[direction][takingPhoto ? 2 : 1] | session->TrackColours[SCHEME_MISC]; switch (direction) @@ -2182,9 +2182,9 @@ void track_paint_util_left_corkscrew_up_supports(paint_session* session, Directi * * rct2: 0x006C4794 */ -void track_paint(paint_session* session, Direction direction, int32_t height, const TileElement* tileElement) +void PaintTrack(paint_session* session, Direction direction, int32_t height, const TrackElement& trackElement) { - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + ride_id_t rideIndex = trackElement.GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) { @@ -2195,9 +2195,9 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co if ((!gTrackDesignSaveMode || rideIndex == gTrackDesignSaveRideIndex) && !(session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { - auto trackType = tileElement->AsTrack()->GetTrackType(); - int32_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); - int32_t trackColourScheme = tileElement->AsTrack()->GetColourScheme(); + auto trackType = trackElement.GetTrackType(); + int32_t trackSequence = trackElement.GetSequenceIndex(); + int32_t trackColourScheme = trackElement.GetColourScheme(); if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_TRACK_HEIGHTS)) { @@ -2225,7 +2225,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co if (ride->type == RIDE_TYPE_INFORMATION_KIOSK) LightFxAddKioskLights(session->MapPosition, height, zOffset); else if (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) - LightFxAddShopLights(session->MapPosition, tileElement->GetDirection(), height, zOffset); + LightFxAddShopLights(session->MapPosition, trackElement.GetDirection(), height, zOffset); } #endif @@ -2235,14 +2235,14 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co session->TrackColours[SCHEME_SUPPORTS] = SPRITE_ID_PALETTE_COLOUR_1(ride->track_colour[trackColourScheme].supports); session->TrackColours[SCHEME_MISC] = IMAGE_TYPE_REMAP; session->TrackColours[SCHEME_3] = 0x20C00000; - if (tileElement->AsTrack()->IsHighlighted()) + if (trackElement.IsHighlighted()) { session->TrackColours[SCHEME_TRACK] = 0x21600000; session->TrackColours[SCHEME_SUPPORTS] = 0x21600000; session->TrackColours[SCHEME_MISC] = 0x21600000; session->TrackColours[SCHEME_3] = 0x21600000; } - if (tileElement->IsGhost()) + if (trackElement.IsGhost()) { uint32_t ghost_id = CONSTRUCTION_MARKER; session->InteractionType = ViewportInteractionItem::None; @@ -2262,7 +2262,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType); if (paintFunction != nullptr) { - paintFunction(session, ride, trackSequence, direction, height, tileElement); + paintFunction(session, ride, trackSequence, direction, height, trackElement); } } } diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index f6867d0123..2aaf550a18 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -278,12 +278,12 @@ extern const uint8_t mapLeftEighthTurnToOrthogonal[5]; extern const size_t mini_golf_peep_animation_lengths[]; bool track_paint_util_has_fence( - enum edge_t edge, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, uint8_t rotation); + enum edge_t edge, const CoordsXY& position, const TrackElement& trackElement, const Ride* ride, uint8_t rotation); void track_paint_util_paint_floor( paint_session* session, uint8_t edges, uint32_t colourFlags, uint16_t height, const uint32_t floorSprites[4], const StationObject* stationStyle); void track_paint_util_paint_fences( - paint_session* session, uint8_t edges, const CoordsXY& position, const TileElement* tileElement, const Ride* ride, + paint_session* session, uint8_t edges, const CoordsXY& position, const TrackElement& trackElement, const Ride* ride, uint32_t colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); bool track_paint_util_draw_station_covers( paint_session* session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height); @@ -292,22 +292,22 @@ bool track_paint_util_draw_station_covers_2( uint8_t stationVariant); void track_paint_util_draw_narrow_station_platform( paint_session* session, const Ride* ride, Direction direction, int32_t height, int32_t zOffset, - const TileElement* tileElement); + const TrackElement& trackElement); void track_paint_util_draw_station( - paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement); + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TrackElement& trackElement); void track_paint_util_draw_station_2( - paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, uint16_t height, const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB); void track_paint_util_draw_station_3( paint_session* session, const Ride* ride, Direction direction, uint16_t height, uint16_t coverHeight, - const TileElement* tileElement); + const TrackElement& trackElement); void track_paint_util_draw_station_inverted( - paint_session* session, const Ride* ride, Direction direction, int32_t height, const TileElement* tileElement, + paint_session* session, const Ride* ride, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t stationVariant); bool track_paint_util_should_paint_supports(const CoordsXY& position); void track_paint_util_draw_pier( paint_session* session, const Ride* ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, - int32_t height, const TileElement* tileElement, uint8_t rotation); + int32_t height, const TrackElement& trackElement, uint8_t rotation); void track_paint_util_draw_station_metal_supports( paint_session* session, Direction direction, uint16_t height, uint32_t colour); void track_paint_util_draw_station_metal_supports_2( @@ -364,9 +364,9 @@ void track_paint_util_left_quarter_turn_1_tile_paint( uint32_t colourFlags, const uint32_t* sprites); void track_paint_util_spinning_tunnel_paint(paint_session* session, int8_t thickness, int16_t height, Direction direction); void track_paint_util_onride_photo_small_paint( - paint_session* session, Direction direction, int32_t height, const TileElement* tileElement); + paint_session* session, Direction direction, int32_t height, const TrackElement& trackElement); void track_paint_util_onride_photo_paint( - paint_session* session, Direction direction, int32_t height, const TileElement* tileElement); + paint_session* session, Direction direction, int32_t height, const TrackElement& trackElement); void track_paint_util_right_helix_up_small_quarter_tiles_paint( paint_session* session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, uint32_t colourFlags, const uint32_t sprites[4][3][2], const CoordsXY offsets[4][3][2], @@ -396,7 +396,7 @@ void track_paint_util_left_corkscrew_up_supports(paint_session* session, Directi using TRACK_PAINT_FUNCTION = void (*)( paint_session* session, const Ride* ride, uint8_t trackSequence, Direction direction, int32_t height, - const TileElement* tileElement); + const TrackElement& trackElement); using TRACK_PAINT_FUNCTION_GETTER = TRACK_PAINT_FUNCTION (*)(int32_t trackType); TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int32_t trackType); diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 652dbef785..8fa2a2c333 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -178,7 +178,7 @@ static uint32_t air_powered_vertical_rc_get_support_colour(paint_session* sessio /** rct2: 0x008AFAD4 */ static void air_powered_vertical_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -200,7 +200,7 @@ static void air_powered_vertical_rc_track_flat( static void air_powered_vertical_rc_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_AIR_POWERED_VERTICAL_RC_STATION_SW_NE, SPR_STATION_BASE_B_SW_NE }, @@ -219,7 +219,7 @@ static void air_powered_vertical_rc_track_station( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -229,7 +229,7 @@ static void air_powered_vertical_rc_track_station( static void air_powered_vertical_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -312,16 +312,16 @@ static void air_powered_vertical_rc_track_right_quarter_turn_5( static void air_powered_vertical_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - air_powered_vertical_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + air_powered_vertical_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AFB74 */ static void air_powered_vertical_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_AIR_POWERED_VERTICAL_RC_FLAT_TO_LEFT_BANK_SW_NE, SPR_AIR_POWERED_VERTICAL_RC_FLAT_TO_LEFT_BANK_FRONT_SW_NE }, @@ -350,7 +350,7 @@ static void air_powered_vertical_rc_track_flat_to_left_bank( /** rct2: 0x008AFB84 */ static void air_powered_vertical_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_AIR_POWERED_VERTICAL_RC_FLAT_TO_RIGHT_BANK_SW_NE, SPR_AIR_POWERED_VERTICAL_RC_FLAT_TO_LEFT_BANK_FRONT_SW_NE }, @@ -378,22 +378,22 @@ static void air_powered_vertical_rc_track_flat_to_right_bank( static void air_powered_vertical_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - air_powered_vertical_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AFBA4 */ static void air_powered_vertical_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - air_powered_vertical_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -490,17 +490,17 @@ static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( static void air_powered_vertical_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; air_powered_vertical_rc_track_banked_right_quarter_turn_5( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AFBD4 */ static void air_powered_vertical_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_LEFT_BANK_SW_NE, @@ -529,14 +529,14 @@ static void air_powered_vertical_rc_track_left_bank( static void air_powered_vertical_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - air_powered_vertical_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_BRAKES_NW_SE, @@ -558,7 +558,7 @@ static void air_powered_vertical_rc_track_brakes( static void air_powered_vertical_rc_track_vertical_slope_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t trackImageIds[7][4] = { { @@ -758,7 +758,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( static void air_powered_vertical_rc_track_vertical_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_UP_SW_NE_SEQ_0, SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_UP_SW_NE_SEQ_1 }, @@ -795,11 +795,11 @@ static void air_powered_vertical_rc_track_vertical_up( static void air_powered_vertical_rc_track_vertical_top( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { - air_powered_vertical_rc_track_vertical_top(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_top(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); return; } @@ -877,26 +877,27 @@ static void air_powered_vertical_rc_track_vertical_top( static void air_powered_vertical_rc_track_vertical_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - air_powered_vertical_rc_track_vertical_up(session, ride, trackSequence ^ 1, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_up(session, ride, trackSequence ^ 1, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_vertical_slope_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - air_powered_vertical_rc_track_vertical_slope_up(session, ride, 6 - trackSequence, (direction + 2) & 3, height, tileElement); + air_powered_vertical_rc_track_vertical_slope_up( + session, ride, 6 - trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { // The booster piece is borrowed from the Reverse Freefall Colour. // It has two track colours, instead of the one that the APVC has. uint32_t colour = session->TrackColours[SCHEME_TRACK]; - if (!tileElement->IsGhost() && !tileElement->AsTrack()->IsHighlighted()) + if (!trackElement.IsGhost() && !trackElement.IsHighlighted()) { // Replace remap colour 2 (bits 24-28) with a copy of remap colour 1 (bits 19-23). colour_t colour1 = (colour >> 19) & 31; @@ -924,7 +925,7 @@ static void air_powered_vertical_rc_track_booster( static void air_powered_vertical_rc_track_onride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -938,7 +939,7 @@ static void air_powered_vertical_rc_track_onride_photo( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index 5c3c599596..0c1961b44a 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -33,9 +33,9 @@ static constexpr const uint32_t _BobsleighBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x006FE5B4 */ static void bobsleigh_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -91,7 +91,7 @@ static void bobsleigh_rc_track_flat( static void bobsleigh_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 14580, SPR_STATION_BASE_B_SW_NE }, @@ -106,7 +106,7 @@ static void bobsleigh_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -115,9 +115,9 @@ static void bobsleigh_rc_track_station( /** rct2: 0x006FE5C4 */ static void bobsleigh_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -201,9 +201,9 @@ static void bobsleigh_rc_track_25_deg_up( /** rct2: 0x006FE5D4 */ static void bobsleigh_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -287,9 +287,9 @@ static void bobsleigh_rc_track_flat_to_25_deg_up( /** rct2: 0x006FE5E4 */ static void bobsleigh_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -373,31 +373,31 @@ static void bobsleigh_rc_track_25_deg_up_to_flat( /** rct2: 0x006FE5F4 */ static void bobsleigh_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE604 */ static void bobsleigh_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE614 */ static void bobsleigh_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE624 */ static void bobsleigh_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -621,16 +621,16 @@ static void bobsleigh_rc_track_left_quarter_turn_5( /** rct2: 0x006FE634 */ static void bobsleigh_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE644 */ static void bobsleigh_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -672,7 +672,7 @@ static void bobsleigh_rc_track_flat_to_left_bank( /** rct2: 0x006FE654 */ static void bobsleigh_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -714,7 +714,7 @@ static void bobsleigh_rc_track_flat_to_right_bank( /** rct2: 0x006FE664 */ static void bobsleigh_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -756,7 +756,7 @@ static void bobsleigh_rc_track_left_bank_to_flat( /** rct2: 0x006FE674 */ static void bobsleigh_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -798,7 +798,7 @@ static void bobsleigh_rc_track_right_bank_to_flat( /** rct2: 0x006FE684 */ static void bobsleigh_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1022,16 +1022,16 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( /** rct2: 0x006FE694 */ static void bobsleigh_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE6A4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1080,7 +1080,7 @@ static void bobsleigh_rc_track_left_bank_to_25_deg_up( /** rct2: 0x006FE6B4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1129,7 +1129,7 @@ static void bobsleigh_rc_track_right_bank_to_25_deg_up( /** rct2: 0x006FE6C4 */ static void bobsleigh_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1178,7 +1178,7 @@ static void bobsleigh_rc_track_25_deg_up_to_left_bank( /** rct2: 0x006FE6D4 */ static void bobsleigh_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1227,39 +1227,39 @@ static void bobsleigh_rc_track_25_deg_up_to_right_bank( /** rct2: 0x006FE6E4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE6F4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE704 */ static void bobsleigh_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE714 */ static void bobsleigh_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE724 */ static void bobsleigh_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1301,15 +1301,15 @@ static void bobsleigh_rc_track_left_bank( /** rct2: 0x006FE734 */ static void bobsleigh_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bobsleigh_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + bobsleigh_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x006FE744 */ static void bobsleigh_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1492,7 +1492,7 @@ static void bobsleigh_rc_track_s_bend_left( /** rct2: 0x006FE754 */ static void bobsleigh_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1675,7 +1675,7 @@ static void bobsleigh_rc_track_s_bend_right( /** rct2: 0x006FE794 */ static void bobsleigh_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1814,16 +1814,16 @@ static void bobsleigh_rc_track_left_quarter_turn_3( /** rct2: 0x006FE7A4 */ static void bobsleigh_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE7B4 */ static void bobsleigh_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1962,16 +1962,16 @@ static void bobsleigh_rc_track_left_quarter_turn_3_bank( /** rct2: 0x006FE7C4 */ static void bobsleigh_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE7D4 */ static void bobsleigh_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2243,7 +2243,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( /** rct2: 0x006FE7E4 */ static void bobsleigh_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2515,7 +2515,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( /** rct2: 0x006FE7F4 */ static void bobsleigh_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2523,13 +2523,14 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + bobsleigh_rc_track_right_half_banked_helix_up_small( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x006FE804 */ static void bobsleigh_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2537,13 +2538,13 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - bobsleigh_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE814 */ static void bobsleigh_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2985,7 +2986,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( /** rct2: 0x006FE824 */ static void bobsleigh_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3427,7 +3428,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( /** rct2: 0x006FE834 */ static void bobsleigh_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3435,13 +3436,14 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + bobsleigh_rc_track_right_half_banked_helix_up_large( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x006FE844 */ static void bobsleigh_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3449,13 +3451,13 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - bobsleigh_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + bobsleigh_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x006FE854 */ static void bobsleigh_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3487,9 +3489,9 @@ static void bobsleigh_rc_track_brakes( /** rct2: 0x006FE864 */ static void bobsleigh_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); switch (direction) { case 0: @@ -3521,7 +3523,7 @@ static void bobsleigh_rc_track_block_brakes( static void bobsleigh_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3564,7 +3566,7 @@ static void bobsleigh_rc_track_on_ride_photo( break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp index cbfeae0648..b7e829fcfa 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp @@ -34,9 +34,9 @@ static constexpr const uint32_t _BolligerMabillardBlockBrakeImages[NumOrthogonal void bolliger_mabillard_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { uint32_t imageIds[] = { 17486, 17487, 17488, 17489 }; PaintAddImageAsParentRotated( @@ -69,7 +69,7 @@ void bolliger_mabillard_track_flat( void bolliger_mabillard_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { static constexpr const uint32_t imageIds[4][2] = { { 17154, SPR_STATION_BASE_A_SW_NE }, @@ -78,9 +78,9 @@ void bolliger_mabillard_track_station( { 17155, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _BolligerMabillardBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -97,7 +97,7 @@ void bolliger_mabillard_track_station( session, direction, height, session->TrackColours[SCHEME_SUPPORTS], supportType); if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 9, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 9, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -106,9 +106,9 @@ void bolliger_mabillard_track_station( void bolliger_mabillard_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -175,9 +175,9 @@ void bolliger_mabillard_track_25_deg_up( void bolliger_mabillard_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -244,9 +244,9 @@ void bolliger_mabillard_track_60_deg_up( void bolliger_mabillard_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -313,9 +313,9 @@ void bolliger_mabillard_track_flat_to_25_deg_up( void bolliger_mabillard_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -390,9 +390,9 @@ void bolliger_mabillard_track_25_deg_up_to_60_deg_up( void bolliger_mabillard_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -467,9 +467,9 @@ void bolliger_mabillard_track_60_deg_up_to_25_deg_up( void bolliger_mabillard_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -536,53 +536,53 @@ void bolliger_mabillard_track_25_deg_up_to_flat( void bolliger_mabillard_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_flat_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -745,16 +745,16 @@ void bolliger_mabillard_track_left_quarter_turn_5( void bolliger_mabillard_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_5( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -791,7 +791,7 @@ void bolliger_mabillard_track_flat_to_left_bank( void bolliger_mabillard_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -828,7 +828,7 @@ void bolliger_mabillard_track_flat_to_right_bank( void bolliger_mabillard_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -865,7 +865,7 @@ void bolliger_mabillard_track_left_bank_to_flat( void bolliger_mabillard_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -902,7 +902,7 @@ void bolliger_mabillard_track_right_bank_to_flat( void bolliger_mabillard_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1078,16 +1078,16 @@ void bolliger_mabillard_track_banked_left_quarter_turn_5( void bolliger_mabillard_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_banked_left_quarter_turn_5( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1131,7 +1131,7 @@ void bolliger_mabillard_track_left_bank_to_25_deg_up( void bolliger_mabillard_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1175,7 +1175,7 @@ void bolliger_mabillard_track_right_bank_to_25_deg_up( void bolliger_mabillard_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1219,7 +1219,7 @@ void bolliger_mabillard_track_25_deg_up_to_left_bank( void bolliger_mabillard_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1263,39 +1263,39 @@ void bolliger_mabillard_track_25_deg_up_to_right_bank( void bolliger_mabillard_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -1328,14 +1328,14 @@ void bolliger_mabillard_track_left_bank( void bolliger_mabillard_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bolliger_mabillard_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1498,7 +1498,7 @@ void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1661,25 +1661,25 @@ void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1809,7 +1809,7 @@ void bolliger_mabillard_track_s_bend_left( void bolliger_mabillard_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -1939,7 +1939,7 @@ void bolliger_mabillard_track_s_bend_right( void bolliger_mabillard_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2201,7 +2201,7 @@ void bolliger_mabillard_track_left_vertical_loop( void bolliger_mabillard_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2425,7 +2425,7 @@ void bolliger_mabillard_track_right_vertical_loop( void bolliger_mabillard_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2527,16 +2527,16 @@ void bolliger_mabillard_track_left_quarter_turn_3( void bolliger_mabillard_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2647,16 +2647,16 @@ void bolliger_mabillard_track_left_quarter_turn_3_bank( void bolliger_mabillard_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3_bank( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2734,7 +2734,7 @@ void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -2815,25 +2815,25 @@ void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3050,7 +3050,7 @@ void bolliger_mabillard_track_left_half_banked_helix_up_small( void bolliger_mabillard_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3267,7 +3267,7 @@ void bolliger_mabillard_track_right_half_banked_helix_up_small( void bolliger_mabillard_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 4) { @@ -3276,12 +3276,12 @@ void bolliger_mabillard_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_half_banked_helix_up_small( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 4) { @@ -3290,12 +3290,12 @@ void bolliger_mabillard_track_right_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_half_banked_helix_up_small( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3636,7 +3636,7 @@ void bolliger_mabillard_track_left_half_banked_helix_up_large( void bolliger_mabillard_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -3983,7 +3983,7 @@ void bolliger_mabillard_track_right_half_banked_helix_up_large( void bolliger_mabillard_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 7) { @@ -3992,12 +3992,12 @@ void bolliger_mabillard_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_half_banked_helix_up_large( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { if (trackSequence >= 7) { @@ -4006,12 +4006,12 @@ void bolliger_mabillard_track_right_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_half_banked_helix_up_large( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4047,7 +4047,7 @@ void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4083,23 +4083,23 @@ void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4126,7 +4126,7 @@ void bolliger_mabillard_track_brakes( void bolliger_mabillard_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4166,7 +4166,7 @@ void bolliger_mabillard_track_25_deg_up_left_banked( void bolliger_mabillard_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4206,7 +4206,7 @@ void bolliger_mabillard_track_25_deg_up_right_banked( void bolliger_mabillard_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4239,7 +4239,7 @@ void bolliger_mabillard_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 17147, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -4247,23 +4247,23 @@ void bolliger_mabillard_track_on_ride_photo( void bolliger_mabillard_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_right_banked( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_left_banked( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4303,14 +4303,14 @@ void bolliger_mabillard_track_90_deg_up( void bolliger_mabillard_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4352,15 +4352,15 @@ void bolliger_mabillard_track_60_deg_up_to_90_deg_up( void bolliger_mabillard_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -4397,7 +4397,7 @@ void bolliger_mabillard_track_90_deg_up_to_60_deg_up( void bolliger_mabillard_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4440,7 +4440,7 @@ void bolliger_mabillard_track_60_deg_down_to_90_deg_down( void bolliger_mabillard_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4574,7 +4574,7 @@ void bolliger_mabillard_track_left_eighth_to_diag( void bolliger_mabillard_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4707,25 +4707,25 @@ void bolliger_mabillard_track_right_eighth_to_diag( void bolliger_mabillard_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_right_eighth_to_diag( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_left_eighth_to_diag( - session, ride, trackSequence, (direction + 3) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 3) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4862,7 +4862,7 @@ void bolliger_mabillard_track_left_eighth_bank_to_diag( void bolliger_mabillard_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -4999,30 +4999,30 @@ void bolliger_mabillard_track_right_eighth_bank_to_diag( void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_right_eighth_bank_to_diag( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; bolliger_mabillard_track_left_eighth_bank_to_diag( - session, ride, trackSequence, (direction + 3) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 3) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5049,7 +5049,7 @@ void bolliger_mabillard_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5076,7 +5076,7 @@ void bolliger_mabillard_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5103,7 +5103,7 @@ void bolliger_mabillard_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5162,12 +5162,12 @@ void bolliger_mabillard_track_diag_flat( void bolliger_mabillard_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5194,7 +5194,7 @@ void bolliger_mabillard_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5221,7 +5221,7 @@ void bolliger_mabillard_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5248,7 +5248,7 @@ void bolliger_mabillard_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5307,12 +5307,12 @@ void bolliger_mabillard_track_diag_25_deg_up( void bolliger_mabillard_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5339,7 +5339,7 @@ void bolliger_mabillard_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5366,7 +5366,7 @@ void bolliger_mabillard_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5393,7 +5393,7 @@ void bolliger_mabillard_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5452,12 +5452,12 @@ void bolliger_mabillard_track_diag_60_deg_up( void bolliger_mabillard_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5484,7 +5484,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5511,7 +5511,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5538,7 +5538,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5597,12 +5597,12 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_up( void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5629,7 +5629,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5656,7 +5656,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5683,7 +5683,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5742,12 +5742,12 @@ void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5774,7 +5774,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5801,7 +5801,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5828,7 +5828,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5887,12 +5887,12 @@ void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( void bolliger_mabillard_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5919,7 +5919,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5946,7 +5946,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5973,7 +5973,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6032,12 +6032,12 @@ void bolliger_mabillard_track_diag_25_deg_up_to_flat( void bolliger_mabillard_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6064,7 +6064,7 @@ void bolliger_mabillard_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6091,7 +6091,7 @@ void bolliger_mabillard_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6118,7 +6118,7 @@ void bolliger_mabillard_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6177,12 +6177,12 @@ void bolliger_mabillard_track_diag_25_deg_down( void bolliger_mabillard_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6209,7 +6209,7 @@ void bolliger_mabillard_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6236,7 +6236,7 @@ void bolliger_mabillard_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6263,7 +6263,7 @@ void bolliger_mabillard_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6322,12 +6322,12 @@ void bolliger_mabillard_track_diag_60_deg_down( void bolliger_mabillard_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6353,7 +6353,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6379,7 +6379,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6405,7 +6405,7 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6465,12 +6465,12 @@ void bolliger_mabillard_track_diag_flat_to_25_deg_down( void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6497,7 +6497,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6524,7 +6524,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6551,7 +6551,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6610,12 +6610,12 @@ void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6642,7 +6642,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6669,7 +6669,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6696,7 +6696,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6755,12 +6755,12 @@ void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( void bolliger_mabillard_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6787,7 +6787,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6814,7 +6814,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6841,7 +6841,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6900,12 +6900,12 @@ void bolliger_mabillard_track_diag_25_deg_down_to_flat( void bolliger_mabillard_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6932,7 +6932,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6959,7 +6959,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6986,7 +6986,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7045,12 +7045,12 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_up( void bolliger_mabillard_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7077,7 +7077,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7104,7 +7104,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7131,7 +7131,7 @@ void bolliger_mabillard_track_diag_60_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7190,12 +7190,12 @@ void bolliger_mabillard_track_diag_60_deg_up_to_flat( void bolliger_mabillard_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7222,7 +7222,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7249,7 +7249,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7276,7 +7276,7 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7335,12 +7335,12 @@ void bolliger_mabillard_track_diag_flat_to_60_deg_down( void bolliger_mabillard_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7367,7 +7367,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7394,7 +7394,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7421,7 +7421,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7480,7 +7480,7 @@ void bolliger_mabillard_track_diag_60_deg_down_to_flat( void bolliger_mabillard_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7554,7 +7554,7 @@ void bolliger_mabillard_track_diag_flat_to_left_bank( void bolliger_mabillard_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7628,7 +7628,7 @@ void bolliger_mabillard_track_diag_flat_to_right_bank( void bolliger_mabillard_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7702,7 +7702,7 @@ void bolliger_mabillard_track_diag_left_bank_to_flat( void bolliger_mabillard_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7776,7 +7776,7 @@ void bolliger_mabillard_track_diag_right_bank_to_flat( void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7850,7 +7850,7 @@ void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7924,7 +7924,7 @@ void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -7998,7 +7998,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8072,7 +8072,7 @@ void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8144,7 +8144,7 @@ void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8216,7 +8216,7 @@ void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8290,7 +8290,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8364,7 +8364,7 @@ void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( void bolliger_mabillard_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8435,7 +8435,7 @@ void bolliger_mabillard_track_diag_left_bank( void bolliger_mabillard_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8506,7 +8506,7 @@ void bolliger_mabillard_track_diag_right_bank( void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8587,7 +8587,7 @@ void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8671,7 +8671,7 @@ void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8755,7 +8755,7 @@ void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8836,9 +8836,9 @@ void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( void bolliger_mabillard_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); switch (direction) { case 0: @@ -8868,7 +8868,7 @@ void bolliger_mabillard_track_block_brakes( void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -8949,7 +8949,7 @@ void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9033,25 +9033,25 @@ void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9220,7 +9220,7 @@ void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -9389,25 +9389,25 @@ void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9449,7 +9449,7 @@ void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9491,7 +9491,7 @@ void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9533,7 +9533,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9575,39 +9575,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9647,7 +9647,7 @@ void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9687,7 +9687,7 @@ void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9727,7 +9727,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9767,39 +9767,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9841,7 +9841,7 @@ void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9883,7 +9883,7 @@ void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9925,7 +9925,7 @@ void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -9967,39 +9967,39 @@ void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10045,7 +10045,7 @@ void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10091,26 +10091,26 @@ void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement, supportType); } /* The following track elements used to be specific to the Vertical Roller Coaster */ void bolliger_mabillard_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10183,9 +10183,9 @@ void bolliger_mabillard_track_flat_to_60_deg_up( void bolliger_mabillard_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10258,23 +10258,23 @@ void bolliger_mabillard_track_60_deg_up_to_flat( void bolliger_mabillard_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_flat_to_60_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_brake_for_drop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -10316,7 +10316,7 @@ void bolliger_mabillard_track_brake_for_drop( /* The following track elements used to be specific to the Steel Twister */ void bolliger_mabillard_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10440,14 +10440,14 @@ void bolliger_mabillard_track_half_loop_up( void bolliger_mabillard_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { - bolliger_mabillard_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement, supportType); + bolliger_mabillard_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement, supportType); } void bolliger_mabillard_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10557,7 +10557,7 @@ void bolliger_mabillard_track_left_corkscrew_up( void bolliger_mabillard_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10668,23 +10668,23 @@ void bolliger_mabillard_track_right_corkscrew_up( void bolliger_mabillard_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_corkscrew_up( - session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_corkscrew_up( - session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10821,7 +10821,7 @@ void bolliger_mabillard_track_flat_to_60_deg_up_long_base( /** rct2: 0x008AC104 */ void bolliger_mabillard_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -10957,23 +10957,23 @@ void bolliger_mabillard_track_60_deg_up_to_flat_long_base( void bolliger_mabillard_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_60_deg_up_to_flat_long_base122( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_left_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11112,7 +11112,7 @@ void bolliger_mabillard_track_left_barrel_roll_up_to_down( void bolliger_mabillard_track_right_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11251,23 +11251,23 @@ void bolliger_mabillard_track_right_barrel_roll_up_to_down( void bolliger_mabillard_track_left_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_right_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement, supportType); + session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement, supportType); } void bolliger_mabillard_track_powered_lift( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (direction) { @@ -11304,7 +11304,7 @@ void bolliger_mabillard_track_powered_lift( void bolliger_mabillard_track_left_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11524,7 +11524,7 @@ void bolliger_mabillard_track_left_large_half_loop_up( void bolliger_mabillard_track_right_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11744,23 +11744,23 @@ void bolliger_mabillard_track_right_large_half_loop_up( void bolliger_mabillard_track_right_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_right_large_half_loop_up( - session, ride, 6 - trackSequence, direction, height, tileElement, supportType); + session, ride, 6 - trackSequence, direction, height, trackElement, supportType); } void bolliger_mabillard_track_left_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_left_large_half_loop_up( - session, ride, 6 - trackSequence, direction, height, tileElement, supportType); + session, ride, 6 - trackSequence, direction, height, trackElement, supportType); } void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { switch (trackSequence) { @@ -11857,15 +11857,15 @@ void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, ride, 2 - trackSequence, direction, height, tileElement, supportType); + session, ride, 2 - trackSequence, direction, height, trackElement, supportType); } void bolliger_mabillard_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType) + const TrackElement& trackElement, int32_t supportType) { // These offsets could be moved to the g2.dat file when that supports offsets. int8_t ne_sw_offsetX = 8; diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.h b/src/openrct2/ride/coaster/BolligerMabillardTrack.h index e156c522fc..4f91d42271 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.h +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.h @@ -13,547 +13,547 @@ #include "../RideTypes.h" struct paint_session; -struct TileElement; +struct TrackElement; void bolliger_mabillard_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); /* Previously specific to the Vertical RC */ void bolliger_mabillard_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_brake_for_drop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); /* Previously specific to the Steel Twister */ void bolliger_mabillard_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_60_deg_up_to_flat_long_base122( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_powered_lift( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_right_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_left_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); void bolliger_mabillard_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement, int32_t supportType); + const TrackElement& trackElement, int32_t supportType); diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index cfe826b7b5..19923553d0 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x008AE6E0 */ static void compact_inverted_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -75,7 +75,7 @@ static void compact_inverted_rc_track_flat( /** rct2: 0x008AE950, 0x008AE960, 0x008AE970 */ static void compact_inverted_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 26557, SPR_STATION_INVERTED_BAR_A_SW_NE }, @@ -93,7 +93,7 @@ static void compact_inverted_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -102,9 +102,9 @@ static void compact_inverted_rc_track_station( /** rct2: 0x008AE6F0 */ static void compact_inverted_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -196,9 +196,9 @@ static void compact_inverted_rc_track_25_deg_up( /** rct2: 0x008AE700 */ static void compact_inverted_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -266,9 +266,9 @@ static void compact_inverted_rc_track_60_deg_up( /** rct2: 0x008AE710 */ static void compact_inverted_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -360,9 +360,9 @@ static void compact_inverted_rc_track_flat_to_25_deg_up( /** rct2: 0x008AE720 */ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -442,9 +442,9 @@ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AE730 */ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -548,9 +548,9 @@ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AE740 */ static void compact_inverted_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -642,55 +642,55 @@ static void compact_inverted_rc_track_25_deg_up_to_flat( /** rct2: 0x008AE750 */ static void compact_inverted_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE760 */ static void compact_inverted_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE770 */ static void compact_inverted_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE780 */ static void compact_inverted_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE790 */ static void compact_inverted_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE7A0 */ static void compact_inverted_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE7B0 */ static void compact_inverted_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -870,16 +870,16 @@ static void compact_inverted_rc_track_left_quarter_turn_5( /** rct2: 0x008AE7C0 */ static void compact_inverted_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AE7D0 */ static void compact_inverted_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -922,7 +922,7 @@ static void compact_inverted_rc_track_flat_to_left_bank( /** rct2: 0x008AE7E0 */ static void compact_inverted_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -965,7 +965,7 @@ static void compact_inverted_rc_track_flat_to_right_bank( /** rct2: 0x008AE7F0 */ static void compact_inverted_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1008,7 +1008,7 @@ static void compact_inverted_rc_track_left_bank_to_flat( /** rct2: 0x008AE800 */ static void compact_inverted_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1051,7 +1051,7 @@ static void compact_inverted_rc_track_right_bank_to_flat( /** rct2: 0x008AE810 */ static void compact_inverted_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1231,17 +1231,17 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AE820 */ static void compact_inverted_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_banked_left_quarter_turn_5( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AE830 */ static void compact_inverted_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1308,7 +1308,7 @@ static void compact_inverted_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AE840 */ static void compact_inverted_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1375,7 +1375,7 @@ static void compact_inverted_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AE850 */ static void compact_inverted_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1442,7 +1442,7 @@ static void compact_inverted_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AE860 */ static void compact_inverted_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1509,39 +1509,39 @@ static void compact_inverted_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AE870 */ static void compact_inverted_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE880 */ static void compact_inverted_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE890 */ static void compact_inverted_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE8A0 */ static void compact_inverted_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE8B0 */ static void compact_inverted_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1584,15 +1584,15 @@ static void compact_inverted_rc_track_left_bank( /** rct2: 0x008AE8C0 */ static void compact_inverted_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AE8D0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1757,7 +1757,7 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AE8E0 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1922,27 +1922,27 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AE8F0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AE900 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AE910 */ static void compact_inverted_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2113,7 +2113,7 @@ static void compact_inverted_rc_track_s_bend_left( /** rct2: 0x008AE920 */ static void compact_inverted_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2284,7 +2284,7 @@ static void compact_inverted_rc_track_s_bend_right( /** rct2: 0x008AE930 */ static void compact_inverted_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2591,7 +2591,7 @@ static void compact_inverted_rc_track_left_vertical_loop( /** rct2: 0x008AE940 */ static void compact_inverted_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2898,7 +2898,7 @@ static void compact_inverted_rc_track_right_vertical_loop( /** rct2: 0x008AE980 */ static void compact_inverted_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3017,16 +3017,16 @@ static void compact_inverted_rc_track_left_quarter_turn_3( /** rct2: 0x008AE990 */ static void compact_inverted_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AE9A0 */ static void compact_inverted_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3146,16 +3146,16 @@ static void compact_inverted_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AE9B0 */ static void compact_inverted_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - compact_inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AE9C0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3242,7 +3242,7 @@ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AE9D0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3329,27 +3329,27 @@ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AE9E0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AE9F0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AEA00 */ static void compact_inverted_rc_track_left_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3459,7 +3459,7 @@ static void compact_inverted_rc_track_left_twist_down_to_up( /** rct2: 0x008AEA10 */ static void compact_inverted_rc_track_right_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3569,7 +3569,7 @@ static void compact_inverted_rc_track_right_twist_down_to_up( /** rct2: 0x008AEA20 */ static void compact_inverted_rc_track_left_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3679,7 +3679,7 @@ static void compact_inverted_rc_track_left_twist_up_to_down( /** rct2: 0x008AEA30 */ static void compact_inverted_rc_track_right_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3789,7 +3789,7 @@ static void compact_inverted_rc_track_right_twist_up_to_down( /** rct2: 0x008AEA40 */ static void compact_inverted_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3942,15 +3942,15 @@ static void compact_inverted_rc_track_half_loop_up( /** rct2: 0x008AEA50 */ static void compact_inverted_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); + compact_inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); } /** rct2: 0x008AEA60 */ static void compact_inverted_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4068,7 +4068,7 @@ static void compact_inverted_rc_track_left_corkscrew_up( /** rct2: 0x008AEA70 */ static void compact_inverted_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4186,23 +4186,23 @@ static void compact_inverted_rc_track_right_corkscrew_up( /** rct2: 0x008AEA80 */ static void compact_inverted_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + compact_inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AEA90 */ static void compact_inverted_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + compact_inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AEAD0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4243,7 +4243,7 @@ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008AEAB0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4285,25 +4285,25 @@ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008AEAC0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AEAE0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4336,7 +4336,7 @@ static void compact_inverted_rc_track_brakes( /** rct2: 0x008AEAF0 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4521,7 +4521,7 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x008AEB00 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4706,7 +4706,7 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x008AEB10 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4891,7 +4891,7 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x008AEB20 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5076,7 +5076,7 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x008AEB30 */ static void compact_inverted_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5121,7 +5121,7 @@ static void compact_inverted_rc_track_on_ride_photo( height + 29); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); @@ -5130,12 +5130,12 @@ static void compact_inverted_rc_track_on_ride_photo( /** rct2: 0x008AEDB0 */ static void compact_inverted_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5200,20 +5200,20 @@ static void compact_inverted_rc_track_90_deg_up( /** rct2: 0x008AEDC0 */ static void compact_inverted_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AED70 */ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5282,17 +5282,17 @@ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008AED80 */ static void compact_inverted_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - compact_inverted_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AED90 */ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5361,12 +5361,12 @@ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008AEDA0 */ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5434,7 +5434,7 @@ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008AEB40 */ static void compact_inverted_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5597,7 +5597,7 @@ static void compact_inverted_rc_track_left_eighth_to_diag( /** rct2: 0x008AEB50 */ static void compact_inverted_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5760,25 +5760,25 @@ static void compact_inverted_rc_track_right_eighth_to_diag( /** rct2: 0x008AEB60 */ static void compact_inverted_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AEB70 */ static void compact_inverted_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + compact_inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008AED30 */ static void compact_inverted_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5941,7 +5941,7 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008AED40 */ static void compact_inverted_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6104,30 +6104,31 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008AED50 */ static void compact_inverted_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + compact_inverted_rc_track_right_eighth_bank_to_diag( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AED60 */ static void compact_inverted_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - compact_inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + compact_inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008AEB80 */ static void compact_inverted_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6154,7 +6155,7 @@ static void compact_inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6181,7 +6182,7 @@ static void compact_inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6208,7 +6209,7 @@ static void compact_inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6261,12 +6262,12 @@ static void compact_inverted_rc_track_diag_flat( /** rct2: 0x008AEBB0 */ static void compact_inverted_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6293,7 +6294,7 @@ static void compact_inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6320,7 +6321,7 @@ static void compact_inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6347,7 +6348,7 @@ static void compact_inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6400,7 +6401,7 @@ static void compact_inverted_rc_track_diag_25_deg_up( /** rct2: 0x008AEC10 */ static void compact_inverted_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6483,12 +6484,12 @@ static void compact_inverted_rc_track_diag_60_deg_up( /** rct2: 0x008AEB90 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6515,7 +6516,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6542,7 +6543,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6569,7 +6570,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6622,7 +6623,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AEBF0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6705,7 +6706,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008AEC00 */ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6788,12 +6789,12 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008AEBA0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6820,7 +6821,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6847,7 +6848,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6874,7 +6875,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6927,12 +6928,12 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008AEBE0 */ static void compact_inverted_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6959,7 +6960,7 @@ static void compact_inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6986,7 +6987,7 @@ static void compact_inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7013,7 +7014,7 @@ static void compact_inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7066,7 +7067,7 @@ static void compact_inverted_rc_track_diag_25_deg_down( /** rct2: 0x008AEC40 */ static void compact_inverted_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7149,12 +7150,12 @@ static void compact_inverted_rc_track_diag_60_deg_down( /** rct2: 0x008AEBC0 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7180,7 +7181,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7206,7 +7207,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7232,7 +7233,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7285,7 +7286,7 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008AEC20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7368,7 +7369,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008AEC30 */ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7451,12 +7452,12 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008AEBD0 */ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7483,7 +7484,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7510,7 +7511,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7537,7 +7538,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7590,7 +7591,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008AEC70 */ static void compact_inverted_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7674,7 +7675,7 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( /** rct2: 0x008AEC80 */ static void compact_inverted_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7758,7 +7759,7 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( /** rct2: 0x008AEC90 */ static void compact_inverted_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7842,7 +7843,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( /** rct2: 0x008AECA0 */ static void compact_inverted_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7926,7 +7927,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( /** rct2: 0x008AECD0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8009,7 +8010,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008AECE0 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8092,7 +8093,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008AECB0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8175,7 +8176,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008AECC0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8258,7 +8259,7 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008AECF0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8338,7 +8339,7 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008AED00 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8418,7 +8419,7 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008AED10 */ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8501,7 +8502,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008AED20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8584,7 +8585,7 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008AEC50 */ static void compact_inverted_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8668,7 +8669,7 @@ static void compact_inverted_rc_track_diag_left_bank( /** rct2: 0x008AEC60 */ static void compact_inverted_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8752,7 +8753,7 @@ static void compact_inverted_rc_track_diag_right_bank( /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index 050bb39fc0..ce745ef622 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -33,9 +33,9 @@ static constexpr const uint32_t _CorkscrewRCBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A7AF8 */ static void corkscrew_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -90,7 +90,7 @@ static void corkscrew_rc_track_flat( /** rct2: 0x008A7D68, 0x008A7D78, 0x008A7D88 */ static void corkscrew_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 16236, SPR_STATION_BASE_A_SW_NE }, @@ -99,9 +99,9 @@ static void corkscrew_rc_track_station( { 16237, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _CorkscrewRCBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -115,7 +115,7 @@ static void corkscrew_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -124,9 +124,9 @@ static void corkscrew_rc_track_station( /** rct2: 0x008A7B08 */ static void corkscrew_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -194,9 +194,9 @@ static void corkscrew_rc_track_25_deg_up( /** rct2: 0x008A7B18 */ static void corkscrew_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -264,9 +264,9 @@ static void corkscrew_rc_track_60_deg_up( /** rct2: 0x008A7B28 */ static void corkscrew_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -334,9 +334,9 @@ static void corkscrew_rc_track_flat_to_25_deg_up( /** rct2: 0x008A7B38 */ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -412,9 +412,9 @@ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A7B48 */ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -490,9 +490,9 @@ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A7B58 */ static void corkscrew_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -560,55 +560,55 @@ static void corkscrew_rc_track_25_deg_up_to_flat( /** rct2: 0x008A7B68 */ static void corkscrew_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7B78 */ static void corkscrew_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7B88 */ static void corkscrew_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7B98 */ static void corkscrew_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7BA8 */ static void corkscrew_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7BB8 */ static void corkscrew_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7BC8 */ static void corkscrew_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -772,16 +772,16 @@ static void corkscrew_rc_track_left_quarter_turn_5( /** rct2: 0x008A7BD8 */ static void corkscrew_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7BE8 */ static void corkscrew_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -819,7 +819,7 @@ static void corkscrew_rc_track_flat_to_left_bank( /** rct2: 0x008A7BF8 */ static void corkscrew_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -857,7 +857,7 @@ static void corkscrew_rc_track_flat_to_right_bank( /** rct2: 0x008A7C08 */ static void corkscrew_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -895,7 +895,7 @@ static void corkscrew_rc_track_left_bank_to_flat( /** rct2: 0x008A7C18 */ static void corkscrew_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -933,7 +933,7 @@ static void corkscrew_rc_track_right_bank_to_flat( /** rct2: 0x008A7C28 */ static void corkscrew_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1107,16 +1107,16 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A7C38 */ static void corkscrew_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7C48 */ static void corkscrew_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1161,7 +1161,7 @@ static void corkscrew_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A7C58 */ static void corkscrew_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1206,7 +1206,7 @@ static void corkscrew_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A7C68 */ static void corkscrew_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1251,7 +1251,7 @@ static void corkscrew_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A7C78 */ static void corkscrew_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1296,39 +1296,39 @@ static void corkscrew_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A7C88 */ static void corkscrew_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7C98 */ static void corkscrew_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7CA8 */ static void corkscrew_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7CB8 */ static void corkscrew_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7CC8 */ static void corkscrew_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1362,15 +1362,15 @@ static void corkscrew_rc_track_left_bank( /** rct2: 0x008A7CD8 */ static void corkscrew_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7CE8 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1534,7 +1534,7 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A7CF8 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1698,25 +1698,25 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A7D08 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7D18 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7D28 */ static void corkscrew_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1851,7 +1851,7 @@ static void corkscrew_rc_track_s_bend_left( /** rct2: 0x008A7D38 */ static void corkscrew_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1986,7 +1986,7 @@ static void corkscrew_rc_track_s_bend_right( /** rct2: 0x008A7D48 */ static void corkscrew_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2265,7 +2265,7 @@ static void corkscrew_rc_track_left_vertical_loop( /** rct2: 0x008A7D58 */ static void corkscrew_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2498,7 +2498,7 @@ static void corkscrew_rc_track_right_vertical_loop( /** rct2: 0x008A7D98 */ static void corkscrew_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2601,16 +2601,16 @@ static void corkscrew_rc_track_left_quarter_turn_3( /** rct2: 0x008A7DA8 */ static void corkscrew_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7DB8 */ static void corkscrew_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2722,16 +2722,16 @@ static void corkscrew_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A7DC8 */ static void corkscrew_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7DD8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2810,7 +2810,7 @@ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A7DE8 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2896,25 +2896,25 @@ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A7DF8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7E08 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7E18 */ static void corkscrew_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3043,15 +3043,15 @@ static void corkscrew_rc_track_half_loop_up( /** rct2: 0x008A7E28 */ static void corkscrew_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); + corkscrew_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A7E38 */ static void corkscrew_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3163,7 +3163,7 @@ static void corkscrew_rc_track_left_corkscrew_up( /** rct2: 0x008A7E48 */ static void corkscrew_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3276,23 +3276,23 @@ static void corkscrew_rc_track_right_corkscrew_up( /** rct2: 0x008A7E58 */ static void corkscrew_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7E68 */ static void corkscrew_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7E78 */ static void corkscrew_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3510,7 +3510,7 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A7E88 */ static void corkscrew_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3728,7 +3728,7 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A7E98 */ static void corkscrew_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3736,13 +3736,14 @@ static void corkscrew_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_half_banked_helix_up_small( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7EA8 */ static void corkscrew_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3750,13 +3751,13 @@ static void corkscrew_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - corkscrew_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7EB8 */ static void corkscrew_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4098,7 +4099,7 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A7EC8 */ static void corkscrew_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4440,7 +4441,7 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A7ED8 */ static void corkscrew_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4448,13 +4449,14 @@ static void corkscrew_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_half_banked_helix_up_large( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7EE8 */ static void corkscrew_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4462,13 +4464,13 @@ static void corkscrew_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - corkscrew_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7F18 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4505,7 +4507,7 @@ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A7EF8 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4542,23 +4544,23 @@ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A7F08 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + corkscrew_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7F28 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + corkscrew_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7F38 */ static void corkscrew_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4586,7 +4588,7 @@ static void corkscrew_rc_track_brakes( /** rct2: 0x008A7F48 */ static void corkscrew_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4619,7 +4621,7 @@ static void corkscrew_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 16225, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -4628,7 +4630,7 @@ static void corkscrew_rc_track_on_ride_photo( /** rct2: 0x008A8198 */ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4769,7 +4771,7 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( /** rct2: 0x008A81A8 */ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4910,23 +4912,23 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( /** rct2: 0x008A81B8 */ static void corkscrew_rc_track_60_deg_down_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A81C8 */ static void corkscrew_rc_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - corkscrew_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7F68 */ static void corkscrew_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5065,7 +5067,7 @@ static void corkscrew_rc_track_left_eighth_to_diag( /** rct2: 0x008A7F78 */ static void corkscrew_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5203,25 +5205,25 @@ static void corkscrew_rc_track_right_eighth_to_diag( /** rct2: 0x008A7F88 */ static void corkscrew_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7F98 */ static void corkscrew_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + corkscrew_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A7FA8 */ static void corkscrew_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5363,7 +5365,7 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A7FB8 */ static void corkscrew_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5504,30 +5506,30 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A7FC8 */ static void corkscrew_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + corkscrew_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7FD8 */ static void corkscrew_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - corkscrew_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + corkscrew_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A7F58 */ static void corkscrew_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5554,7 +5556,7 @@ static void corkscrew_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5581,7 +5583,7 @@ static void corkscrew_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5608,7 +5610,7 @@ static void corkscrew_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5668,12 +5670,12 @@ static void corkscrew_rc_track_diag_flat( /** rct2: 0x008A8008 */ static void corkscrew_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5700,7 +5702,7 @@ static void corkscrew_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5727,7 +5729,7 @@ static void corkscrew_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5754,7 +5756,7 @@ static void corkscrew_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5814,12 +5816,12 @@ static void corkscrew_rc_track_diag_25_deg_up( /** rct2: 0x008A8068 */ static void corkscrew_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5846,7 +5848,7 @@ static void corkscrew_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5873,7 +5875,7 @@ static void corkscrew_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5900,7 +5902,7 @@ static void corkscrew_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5960,12 +5962,12 @@ static void corkscrew_rc_track_diag_60_deg_up( /** rct2: 0x008A7FE8 */ static void corkscrew_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5992,7 +5994,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6019,7 +6021,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6046,7 +6048,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6106,12 +6108,12 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A8048 */ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6138,7 +6140,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6165,7 +6167,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6192,7 +6194,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6252,12 +6254,12 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A8058 */ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6284,7 +6286,7 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6311,7 +6313,7 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6338,7 +6340,7 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6398,12 +6400,12 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A7FF8 */ static void corkscrew_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6430,7 +6432,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6457,7 +6459,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6484,7 +6486,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6544,12 +6546,12 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A8038 */ static void corkscrew_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6576,7 +6578,7 @@ static void corkscrew_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6603,7 +6605,7 @@ static void corkscrew_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6630,7 +6632,7 @@ static void corkscrew_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6690,12 +6692,12 @@ static void corkscrew_rc_track_diag_25_deg_down( /** rct2: 0x008A8098 */ static void corkscrew_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6722,7 +6724,7 @@ static void corkscrew_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6749,7 +6751,7 @@ static void corkscrew_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6776,7 +6778,7 @@ static void corkscrew_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6836,12 +6838,12 @@ static void corkscrew_rc_track_diag_60_deg_down( /** rct2: 0x008A8018 */ static void corkscrew_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6867,7 +6869,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6893,7 +6895,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6919,7 +6921,7 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6980,12 +6982,12 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A8078 */ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7012,7 +7014,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7039,7 +7041,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7066,7 +7068,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7126,12 +7128,12 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A8088 */ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7158,7 +7160,7 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7185,7 +7187,7 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7212,7 +7214,7 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7272,12 +7274,12 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A8028 */ static void corkscrew_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7304,7 +7306,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7331,7 +7333,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7358,7 +7360,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7418,7 +7420,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A80C8 */ static void corkscrew_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7497,7 +7499,7 @@ static void corkscrew_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A80D8 */ static void corkscrew_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7576,7 +7578,7 @@ static void corkscrew_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A80E8 */ static void corkscrew_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7655,7 +7657,7 @@ static void corkscrew_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A80F8 */ static void corkscrew_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7734,7 +7736,7 @@ static void corkscrew_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A8128 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7813,7 +7815,7 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A8138 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7892,7 +7894,7 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A8108 */ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7971,7 +7973,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A8118 */ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8050,7 +8052,7 @@ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A8148 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8127,7 +8129,7 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A8158 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8204,7 +8206,7 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A8168 */ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8283,7 +8285,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A8178 */ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8362,7 +8364,7 @@ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A80A8 */ static void corkscrew_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8438,7 +8440,7 @@ static void corkscrew_rc_track_diag_left_bank( /** rct2: 0x008A80B8 */ static void corkscrew_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8514,9 +8516,9 @@ static void corkscrew_rc_track_diag_right_bank( /** rct2: 0x008A8188 */ static void corkscrew_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _CorkscrewRCBlockBrakeImages[direction][isClosed], 0, 0, 32, 20, 3, height, 0, 6, height); @@ -8529,11 +8531,11 @@ static void corkscrew_rc_track_block_brakes( static void corkscrew_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (!is_csg_loaded()) { - corkscrew_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); + corkscrew_rc_track_brakes(session, ride, trackSequence, direction, height, trackElement); return; } diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index b54458356d..4beab24b3c 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -22,11 +22,11 @@ /** rct2: 0x007C6FF4 */ static void flying_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -81,7 +81,7 @@ static void flying_rc_track_flat( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -134,9 +134,9 @@ static void flying_rc_track_flat( /** rct2: 0x007C7244, 0x007C7254, 0x007C7264 */ static void flying_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->IsInverted()) + if (trackElement.IsInverted()) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 27131, SPR_STATION_INVERTED_BAR_C_SW_NE }, @@ -154,7 +154,7 @@ static void flying_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); } else { @@ -165,7 +165,7 @@ static void flying_rc_track_station( { 17155, 17151, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, @@ -180,7 +180,7 @@ static void flying_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -191,11 +191,11 @@ static void flying_rc_track_station( /** rct2: 0x007C7004 */ static void flying_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -258,7 +258,7 @@ static void flying_rc_track_25_deg_up( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -351,9 +351,9 @@ static void flying_rc_track_25_deg_up( /** rct2: 0x007C7014 */ static void flying_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -433,11 +433,11 @@ static void flying_rc_track_60_deg_up( /** rct2: 0x007C7024 */ static void flying_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -500,7 +500,7 @@ static void flying_rc_track_flat_to_25_deg_up( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -593,9 +593,9 @@ static void flying_rc_track_flat_to_25_deg_up( /** rct2: 0x007C7034 */ static void flying_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -685,9 +685,9 @@ static void flying_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x007C7044 */ static void flying_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -801,11 +801,11 @@ static void flying_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x007C7054 */ static void flying_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -868,7 +868,7 @@ static void flying_rc_track_25_deg_up_to_flat( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -961,57 +961,57 @@ static void flying_rc_track_25_deg_up_to_flat( /** rct2: 0x007C7064 */ static void flying_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7074 */ static void flying_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7084 */ static void flying_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7094 */ static void flying_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C70A4 */ static void flying_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C70B4 */ static void flying_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C70C4 */ static void flying_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1378,18 +1378,18 @@ static void flying_rc_track_left_quarter_turn_5( /** rct2: 0x007C70D4 */ static void flying_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C70E4 */ static void flying_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1468,9 +1468,9 @@ static void flying_rc_track_flat_to_left_bank( /** rct2: 0x007C70F4 */ static void flying_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1549,9 +1549,9 @@ static void flying_rc_track_flat_to_right_bank( /** rct2: 0x007C7104 */ static void flying_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1630,9 +1630,9 @@ static void flying_rc_track_left_bank_to_flat( /** rct2: 0x007C7114 */ static void flying_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1711,9 +1711,9 @@ static void flying_rc_track_right_bank_to_flat( /** rct2: 0x007C7124 */ static void flying_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2081,18 +2081,18 @@ static void flying_rc_track_banked_left_quarter_turn_5( /** rct2: 0x007C7134 */ static void flying_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7144 */ static void flying_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2202,9 +2202,9 @@ static void flying_rc_track_left_bank_to_25_deg_up( /** rct2: 0x007C7154 */ static void flying_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2314,9 +2314,9 @@ static void flying_rc_track_right_bank_to_25_deg_up( /** rct2: 0x007C7164 */ static void flying_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2426,9 +2426,9 @@ static void flying_rc_track_25_deg_up_to_left_bank( /** rct2: 0x007C7174 */ static void flying_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2538,41 +2538,41 @@ static void flying_rc_track_25_deg_up_to_right_bank( /** rct2: 0x007C7184 */ static void flying_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7194 */ static void flying_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C71A4 */ static void flying_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C71B4 */ static void flying_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C71C4 */ static void flying_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2647,17 +2647,17 @@ static void flying_rc_track_left_bank( /** rct2: 0x007C71D4 */ static void flying_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C71E4 */ static void flying_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2999,9 +2999,9 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x007C71F4 */ static void flying_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3343,27 +3343,27 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x007C7204 */ static void flying_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C7214 */ static void flying_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7224 */ static void flying_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3688,9 +3688,9 @@ static void flying_rc_track_s_bend_left( /** rct2: 0x007C7234 */ static void flying_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4015,9 +4015,9 @@ static void flying_rc_track_s_bend_right( /** rct2: 0x007C7274 */ static void flying_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4254,18 +4254,18 @@ static void flying_rc_track_left_quarter_turn_3( /** rct2: 0x007C7284 */ static void flying_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7294 */ static void flying_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4508,18 +4508,18 @@ static void flying_rc_track_left_quarter_turn_3_bank( /** rct2: 0x007C72A4 */ static void flying_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C72B4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4688,9 +4688,9 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x007C72C4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4865,25 +4865,25 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x007C72D4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C72E4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7314 */ static void flying_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5105,7 +5105,7 @@ static void flying_rc_track_left_half_banked_helix_up_small( /** rct2: 0x007C7324 */ static void flying_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5327,7 +5327,7 @@ static void flying_rc_track_right_half_banked_helix_up_small( /** rct2: 0x007C7334 */ static void flying_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5335,13 +5335,13 @@ static void flying_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C7344 */ static void flying_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5349,13 +5349,13 @@ static void flying_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - flying_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7354 */ static void flying_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5701,7 +5701,7 @@ static void flying_rc_track_left_half_banked_helix_up_large( /** rct2: 0x007C7364 */ static void flying_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6047,7 +6047,7 @@ static void flying_rc_track_right_half_banked_helix_up_large( /** rct2: 0x007C7374 */ static void flying_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6055,13 +6055,13 @@ static void flying_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C7384 */ static void flying_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6069,15 +6069,15 @@ static void flying_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - flying_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C73B4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6158,9 +6158,9 @@ static void flying_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x007C7394 */ static void flying_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6240,25 +6240,25 @@ static void flying_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x007C73A4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + flying_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C73C4 */ static void flying_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + flying_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C73D4 */ static void flying_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6316,24 +6316,24 @@ static void flying_rc_track_brakes( static void flying_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { bolliger_mabillard_track_booster( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES_INVERTED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES_INVERTED); } else { // Should not occur, except when converting from other coaster types. - flying_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); + flying_rc_track_brakes(session, ride, trackSequence, direction, height, trackElement); } } /** rct2: 0x007C7674 */ static void flying_rc_track_left_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6518,7 +6518,7 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x007C7684 */ static void flying_rc_track_right_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6703,7 +6703,7 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x007C7694 */ static void flying_rc_track_left_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6888,7 +6888,7 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x007C76A4 */ static void flying_rc_track_right_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7073,9 +7073,9 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x007C78B4 */ static void flying_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7179,9 +7179,9 @@ static void flying_rc_track_25_deg_up_left_banked( /** rct2: 0x007C78C4 */ static void flying_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7285,9 +7285,9 @@ static void flying_rc_track_25_deg_up_right_banked( /** rct2: 0x007C73E4 */ static void flying_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -7332,7 +7332,7 @@ static void flying_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 17147, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -7386,7 +7386,7 @@ static void flying_rc_track_on_ride_photo( height + 24); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); @@ -7396,25 +7396,25 @@ static void flying_rc_track_on_ride_photo( /** rct2: 0x007C78D4 */ static void flying_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C78E4 */ static void flying_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7404 */ static void flying_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7726,9 +7726,9 @@ static void flying_rc_track_left_eighth_to_diag( /** rct2: 0x007C7414 */ static void flying_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8040,27 +8040,27 @@ static void flying_rc_track_right_eighth_to_diag( /** rct2: 0x007C7424 */ static void flying_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7434 */ static void flying_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + flying_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x007C7444 */ static void flying_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8373,9 +8373,9 @@ static void flying_rc_track_left_eighth_bank_to_diag( /** rct2: 0x007C7454 */ static void flying_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8688,32 +8688,32 @@ static void flying_rc_track_right_eighth_bank_to_diag( /** rct2: 0x007C7464 */ static void flying_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7474 */ static void flying_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - flying_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + flying_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x007C73F4 */ static void flying_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8741,7 +8741,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8769,7 +8769,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8797,7 +8797,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8859,7 +8859,7 @@ static void flying_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8887,7 +8887,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8915,7 +8915,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8943,7 +8943,7 @@ static void flying_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8998,14 +8998,14 @@ static void flying_rc_track_diag_flat( /** rct2: 0x007C74A4 */ static void flying_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9033,7 +9033,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9061,7 +9061,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9089,7 +9089,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9151,7 +9151,7 @@ static void flying_rc_track_diag_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9179,7 +9179,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9207,7 +9207,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9235,7 +9235,7 @@ static void flying_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9290,14 +9290,14 @@ static void flying_rc_track_diag_25_deg_up( /** rct2: 0x007C7504 */ static void flying_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9325,7 +9325,7 @@ static void flying_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9353,7 +9353,7 @@ static void flying_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9381,7 +9381,7 @@ static void flying_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9526,14 +9526,14 @@ static void flying_rc_track_diag_60_deg_up( /** rct2: 0x007C7484 */ static void flying_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9561,7 +9561,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9589,7 +9589,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9617,7 +9617,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9679,7 +9679,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9707,7 +9707,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9735,7 +9735,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9763,7 +9763,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9818,14 +9818,14 @@ static void flying_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x007C74E4 */ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9853,7 +9853,7 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9881,7 +9881,7 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9909,7 +9909,7 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10054,14 +10054,14 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007C74F4 */ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10089,7 +10089,7 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10117,7 +10117,7 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10145,7 +10145,7 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10290,14 +10290,14 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x007C7494 */ static void flying_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10325,7 +10325,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10353,7 +10353,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10381,7 +10381,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10443,7 +10443,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10471,7 +10471,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10499,7 +10499,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10527,7 +10527,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10582,14 +10582,14 @@ static void flying_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x007C74D4 */ static void flying_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10617,7 +10617,7 @@ static void flying_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10645,7 +10645,7 @@ static void flying_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10673,7 +10673,7 @@ static void flying_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10818,14 +10818,14 @@ static void flying_rc_track_diag_25_deg_down( /** rct2: 0x007C7534 */ static void flying_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10853,7 +10853,7 @@ static void flying_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10881,7 +10881,7 @@ static void flying_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10909,7 +10909,7 @@ static void flying_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11054,14 +11054,14 @@ static void flying_rc_track_diag_60_deg_down( /** rct2: 0x007C74B4 */ static void flying_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11088,7 +11088,7 @@ static void flying_rc_track_diag_flat_to_25_deg_down( 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11115,7 +11115,7 @@ static void flying_rc_track_diag_flat_to_25_deg_down( 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11142,7 +11142,7 @@ static void flying_rc_track_diag_flat_to_25_deg_down( 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11283,14 +11283,14 @@ static void flying_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x007C7514 */ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11318,7 +11318,7 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11346,7 +11346,7 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11374,7 +11374,7 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11519,14 +11519,14 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007C7524 */ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11554,7 +11554,7 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11582,7 +11582,7 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11610,7 +11610,7 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11755,14 +11755,14 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x007C74C4 */ static void flying_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11790,7 +11790,7 @@ static void flying_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11818,7 +11818,7 @@ static void flying_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11846,7 +11846,7 @@ static void flying_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11991,9 +11991,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x007C7564 */ static void flying_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12161,9 +12161,9 @@ static void flying_rc_track_diag_flat_to_left_bank( /** rct2: 0x007C7574 */ static void flying_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12331,9 +12331,9 @@ static void flying_rc_track_diag_flat_to_right_bank( /** rct2: 0x007C7584 */ static void flying_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12501,9 +12501,9 @@ static void flying_rc_track_diag_left_bank_to_flat( /** rct2: 0x007C7594 */ static void flying_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12671,9 +12671,9 @@ static void flying_rc_track_diag_right_bank_to_flat( /** rct2: 0x007C75C4 */ static void flying_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12840,9 +12840,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x007C75D4 */ static void flying_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13009,9 +13009,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x007C75A4 */ static void flying_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13178,9 +13178,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x007C75B4 */ static void flying_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13347,9 +13347,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x007C75E4 */ static void flying_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13509,9 +13509,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x007C75F4 */ static void flying_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13671,9 +13671,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x007C7604 */ static void flying_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13840,9 +13840,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007C7614 */ static void flying_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14009,9 +14009,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007C7544 */ static void flying_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14176,9 +14176,9 @@ static void flying_rc_track_diag_left_bank( /** rct2: 0x007C7554 */ static void flying_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -14343,7 +14343,7 @@ static void flying_rc_track_diag_right_bank( /** rct2: 0x007C7624 */ static void flying_rc_track_left_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14455,7 +14455,7 @@ static void flying_rc_track_left_flyer_twist_up( /** rct2: 0x007C7634 */ static void flying_rc_track_right_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14565,7 +14565,7 @@ static void flying_rc_track_right_flyer_twist_up( /** rct2: 0x007C7644 */ static void flying_rc_track_left_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14677,7 +14677,7 @@ static void flying_rc_track_left_flyer_twist_down( /** rct2: 0x007C7654 */ static void flying_rc_track_right_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14787,7 +14787,7 @@ static void flying_rc_track_right_flyer_twist_down( /** rct2: 0x007C72F4 */ static void flying_rc_track_flyer_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14917,7 +14917,7 @@ static void flying_rc_track_flyer_half_loop_up( /** rct2: 0x007C7304 */ static void flying_rc_track_flyer_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -15047,9 +15047,9 @@ static void flying_rc_track_flyer_half_loop_down( /** rct2: 0x007C7664 */ static void flying_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -15105,9 +15105,9 @@ static void flying_rc_track_block_brakes( /** rct2: 0x007C76B4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15279,9 +15279,9 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76C4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15459,29 +15459,29 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76D4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; flying_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C76E4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; flying_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C76F4 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -15826,9 +15826,9 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7704 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -16173,29 +16173,29 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7714 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; flying_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x007C7724 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; flying_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007C7734 */ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16301,9 +16301,9 @@ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x007C7744 */ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16409,9 +16409,9 @@ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x007C7754 */ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16517,9 +16517,9 @@ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x007C7764 */ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16625,41 +16625,43 @@ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x007C7774 */ static void flying_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_banked_25_deg_up_to_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7784 */ static void flying_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7794 */ static void flying_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_right_banked_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C77A4 */ static void flying_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C77B4 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16763,9 +16765,9 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x007C77C4 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16869,9 +16871,9 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x007C77F4 */ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -16975,9 +16977,9 @@ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x007C7804 */ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17081,45 +17083,45 @@ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x007C7814 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7824 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C77D4 */ static void flying_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C77E4 */ static void flying_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7834 */ static void flying_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17225,9 +17227,9 @@ static void flying_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x007C7844 */ static void flying_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17333,9 +17335,9 @@ static void flying_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x007C7854 */ static void flying_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17441,9 +17443,9 @@ static void flying_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x007C7864 */ static void flying_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -17549,33 +17551,33 @@ static void flying_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x007C7874 */ static void flying_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7884 */ static void flying_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C7894 */ static void flying_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007C78A4 */ static void flying_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - flying_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + flying_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index 38a2db9a58..e58b2c4d97 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -42,9 +42,9 @@ static constexpr const uint32_t _GigaCoasterBrakeImages[NumOrthogonalDirections] /** rct2: 0x008AD674 */ static void giga_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -64,7 +64,7 @@ static void giga_rc_track_flat( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } } - else if (tileElement->AsTrack()->HasChain()) + else if (trackElement.HasChain()) { switch (direction) { @@ -118,7 +118,7 @@ static void giga_rc_track_flat( static void giga_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 18084, SPR_STATION_BASE_A_SW_NE }, @@ -127,9 +127,9 @@ static void giga_rc_track_station( { 18085, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _GigaCoasterBrakeImages[direction][isClosed][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -143,7 +143,7 @@ static void giga_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -152,9 +152,9 @@ static void giga_rc_track_station( /** rct2: 0x008AD684 */ static void giga_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -180,7 +180,7 @@ static void giga_rc_track_25_deg_up( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]); } } - else if (tileElement->AsTrack()->HasChain()) + else if (trackElement.HasChain()) { switch (direction) { @@ -248,9 +248,9 @@ static void giga_rc_track_25_deg_up( /** rct2: 0x008AD694 */ static void giga_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -318,9 +318,9 @@ static void giga_rc_track_60_deg_up( /** rct2: 0x008AD6A4 */ static void giga_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -346,7 +346,7 @@ static void giga_rc_track_flat_to_25_deg_up( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]); } } - else if (tileElement->AsTrack()->HasChain()) + else if (trackElement.HasChain()) { switch (direction) { @@ -414,9 +414,9 @@ static void giga_rc_track_flat_to_25_deg_up( /** rct2: 0x008AD6B4 */ static void giga_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -492,9 +492,9 @@ static void giga_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AD6C4 */ static void giga_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -570,9 +570,9 @@ static void giga_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AD6D4 */ static void giga_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -598,7 +598,7 @@ static void giga_rc_track_25_deg_up_to_flat( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]); } } - else if (tileElement->AsTrack()->HasChain()) + else if (trackElement.HasChain()) { switch (direction) { @@ -666,55 +666,55 @@ static void giga_rc_track_25_deg_up_to_flat( /** rct2: 0x008AD6E4 */ static void giga_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD6F4 */ static void giga_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD704 */ static void giga_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD714 */ static void giga_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD724 */ static void giga_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD734 */ static void giga_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD744 */ static void giga_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -878,16 +878,16 @@ static void giga_rc_track_left_quarter_turn_5( /** rct2: 0x008AD754 */ static void giga_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD764 */ static void giga_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -925,7 +925,7 @@ static void giga_rc_track_flat_to_left_bank( /** rct2: 0x008AD774 */ static void giga_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -963,7 +963,7 @@ static void giga_rc_track_flat_to_right_bank( /** rct2: 0x008AD784 */ static void giga_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1001,7 +1001,7 @@ static void giga_rc_track_left_bank_to_flat( /** rct2: 0x008AD794 */ static void giga_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1039,7 +1039,7 @@ static void giga_rc_track_right_bank_to_flat( /** rct2: 0x008AD7A4 */ static void giga_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1213,16 +1213,16 @@ static void giga_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AD7B4 */ static void giga_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD7C4 */ static void giga_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1267,7 +1267,7 @@ static void giga_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AD7D4 */ static void giga_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1312,7 +1312,7 @@ static void giga_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AD7E4 */ static void giga_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1357,7 +1357,7 @@ static void giga_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AD7F4 */ static void giga_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1402,39 +1402,39 @@ static void giga_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AD804 */ static void giga_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD814 */ static void giga_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD824 */ static void giga_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD834 */ static void giga_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD844 */ static void giga_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1468,15 +1468,15 @@ static void giga_rc_track_left_bank( /** rct2: 0x008AD854 */ static void giga_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AD864 */ static void giga_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1640,7 +1640,7 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AD874 */ static void giga_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1804,25 +1804,25 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AD884 */ static void giga_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AD894 */ static void giga_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD8A4 */ static void giga_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1957,7 +1957,7 @@ static void giga_rc_track_s_bend_left( /** rct2: 0x008AD8B4 */ static void giga_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2092,7 +2092,7 @@ static void giga_rc_track_s_bend_right( /** rct2: 0x008AD8F4 */ static void giga_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2195,16 +2195,16 @@ static void giga_rc_track_left_quarter_turn_3( /** rct2: 0x008AD904 */ static void giga_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD914 */ static void giga_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2316,16 +2316,16 @@ static void giga_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AD924 */ static void giga_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD934 */ static void giga_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2404,7 +2404,7 @@ static void giga_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AD944 */ static void giga_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2490,25 +2490,25 @@ static void giga_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AD954 */ static void giga_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AD964 */ static void giga_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD974 */ static void giga_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2726,7 +2726,7 @@ static void giga_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008AD984 */ static void giga_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2944,7 +2944,7 @@ static void giga_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008AD994 */ static void giga_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2952,13 +2952,13 @@ static void giga_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AD9A4 */ static void giga_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2966,13 +2966,13 @@ static void giga_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AD9B4 */ static void giga_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3314,7 +3314,7 @@ static void giga_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008AD9C4 */ static void giga_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3670,7 +3670,7 @@ static void giga_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008AD9D4 */ static void giga_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3678,13 +3678,13 @@ static void giga_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AD9E4 */ static void giga_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3692,13 +3692,13 @@ static void giga_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ADA14 */ static void giga_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3735,7 +3735,7 @@ static void giga_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008AD9F4 */ static void giga_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3772,23 +3772,23 @@ static void giga_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008ADA04 */ static void giga_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ADA24 */ static void giga_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ADA34 */ static void giga_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3824,7 +3824,7 @@ static void giga_rc_track_brakes( /** rct2: 0x008ADC84 */ static void giga_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3865,7 +3865,7 @@ static void giga_rc_track_25_deg_up_left_banked( /** rct2: 0x008ADC94 */ static void giga_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3906,7 +3906,7 @@ static void giga_rc_track_25_deg_up_right_banked( /** rct2: 0x008ADA44 */ static void giga_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3939,7 +3939,7 @@ static void giga_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 18075, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -3948,28 +3948,28 @@ static void giga_rc_track_on_ride_photo( /** rct2: 0x008ADCA4 */ static void giga_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADCB4 */ static void giga_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADED4 */ static void giga_rc_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -4040,7 +4040,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -4107,7 +4107,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -4174,7 +4174,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasCableLift()) + if (trackElement.HasCableLift()) { switch (direction) { @@ -4255,7 +4255,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( /** rct2: 0x008ADEE4 */ static void giga_rc_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4396,23 +4396,23 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( /** rct2: 0x008ADEF4 */ static void giga_rc_track_60_deg_down_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_60_deg_up_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADF04 */ static void giga_rc_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_60_deg_up_to_flat_long_base(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADF14 */ static void giga_rc_track_cable_lift_hill( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4578,7 +4578,7 @@ static void giga_rc_track_cable_lift_hill( /** rct2: 0x008ADA64 */ static void giga_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4717,7 +4717,7 @@ static void giga_rc_track_left_eighth_to_diag( /** rct2: 0x008ADA74 */ static void giga_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4855,25 +4855,25 @@ static void giga_rc_track_right_eighth_to_diag( /** rct2: 0x008ADA84 */ static void giga_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADA94 */ static void giga_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + giga_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008ADAA4 */ static void giga_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5015,7 +5015,7 @@ static void giga_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008ADAB4 */ static void giga_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5157,30 +5157,30 @@ static void giga_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008ADAC4 */ static void giga_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADAD4 */ static void giga_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - giga_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + giga_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008ADA54 */ static void giga_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5207,7 +5207,7 @@ static void giga_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5234,7 +5234,7 @@ static void giga_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5261,7 +5261,7 @@ static void giga_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5321,12 +5321,12 @@ static void giga_rc_track_diag_flat( /** rct2: 0x008ADB04 */ static void giga_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5353,7 +5353,7 @@ static void giga_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5380,7 +5380,7 @@ static void giga_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5407,7 +5407,7 @@ static void giga_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5467,7 +5467,7 @@ static void giga_rc_track_diag_25_deg_up( /** rct2: 0x008ADB64 */ static void giga_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5543,12 +5543,12 @@ static void giga_rc_track_diag_60_deg_up( /** rct2: 0x008ADAE4 */ static void giga_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5575,7 +5575,7 @@ static void giga_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5602,7 +5602,7 @@ static void giga_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5629,7 +5629,7 @@ static void giga_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5689,7 +5689,7 @@ static void giga_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008ADB44 */ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5765,7 +5765,7 @@ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008ADB54 */ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5841,12 +5841,12 @@ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008ADAF4 */ static void giga_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5873,7 +5873,7 @@ static void giga_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5900,7 +5900,7 @@ static void giga_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5927,7 +5927,7 @@ static void giga_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5987,12 +5987,12 @@ static void giga_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008ADB34 */ static void giga_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6019,7 +6019,7 @@ static void giga_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6046,7 +6046,7 @@ static void giga_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6073,7 +6073,7 @@ static void giga_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6133,7 +6133,7 @@ static void giga_rc_track_diag_25_deg_down( /** rct2: 0x008ADB94 */ static void giga_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6209,12 +6209,12 @@ static void giga_rc_track_diag_60_deg_down( /** rct2: 0x008ADB14 */ static void giga_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6240,7 +6240,7 @@ static void giga_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6266,7 +6266,7 @@ static void giga_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6292,7 +6292,7 @@ static void giga_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6353,7 +6353,7 @@ static void giga_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008ADB74 */ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6429,7 +6429,7 @@ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008ADB84 */ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6505,12 +6505,12 @@ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008ADB24 */ static void giga_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6537,7 +6537,7 @@ static void giga_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6564,7 +6564,7 @@ static void giga_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6591,7 +6591,7 @@ static void giga_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6651,7 +6651,7 @@ static void giga_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008ADBC4 */ static void giga_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6730,7 +6730,7 @@ static void giga_rc_track_diag_flat_to_left_bank( /** rct2: 0x008ADBD4 */ static void giga_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6809,7 +6809,7 @@ static void giga_rc_track_diag_flat_to_right_bank( /** rct2: 0x008ADBE4 */ static void giga_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6888,7 +6888,7 @@ static void giga_rc_track_diag_left_bank_to_flat( /** rct2: 0x008ADBF4 */ static void giga_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6967,7 +6967,7 @@ static void giga_rc_track_diag_right_bank_to_flat( /** rct2: 0x008ADC24 */ static void giga_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7046,7 +7046,7 @@ static void giga_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008ADC34 */ static void giga_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7125,7 +7125,7 @@ static void giga_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008ADC04 */ static void giga_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7204,7 +7204,7 @@ static void giga_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008ADC14 */ static void giga_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7283,7 +7283,7 @@ static void giga_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008ADC44 */ static void giga_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7360,7 +7360,7 @@ static void giga_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008ADC54 */ static void giga_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7437,7 +7437,7 @@ static void giga_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008ADC64 */ static void giga_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7516,7 +7516,7 @@ static void giga_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008ADC74 */ static void giga_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7595,7 +7595,7 @@ static void giga_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008ADBA4 */ static void giga_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7671,7 +7671,7 @@ static void giga_rc_track_diag_left_bank( /** rct2: 0x008ADBB4 */ static void giga_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7747,9 +7747,9 @@ static void giga_rc_track_diag_right_bank( /** rct2: 0x008ADEC4 */ static void giga_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _GigaCoasterBrakeImages[direction][isClosed][0], 0, 0, 32, 20, 3, height, 0, 6, height); @@ -7770,7 +7770,7 @@ static void giga_rc_track_block_brakes( /** rct2: 0x008ADCC4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7852,7 +7852,7 @@ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ADCD4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7941,25 +7941,26 @@ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ADCE4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_right_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_banked_quarter_turn_3_25_deg_up( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ADCF4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - giga_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ADD04 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8129,7 +8130,7 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ADD14 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8299,25 +8300,26 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ADD24 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_right_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + giga_rc_track_right_banked_quarter_turn_5_25_deg_up( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ADD34 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - giga_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + giga_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ADD44 */ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8360,7 +8362,7 @@ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008ADD54 */ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8403,7 +8405,7 @@ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008ADD64 */ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8446,7 +8448,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ADD74 */ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8489,39 +8491,39 @@ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ADD84 */ static void giga_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADD94 */ static void giga_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADDA4 */ static void giga_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADDB4 */ static void giga_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADDC4 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8562,7 +8564,7 @@ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008ADDD4 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8603,7 +8605,7 @@ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008ADE04 */ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8644,7 +8646,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008ADE14 */ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8685,43 +8687,43 @@ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008ADE24 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADE34 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADDE4 */ static void giga_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADDF4 */ static void giga_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADE44 */ static void giga_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8764,7 +8766,7 @@ static void giga_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008ADE54 */ static void giga_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8807,7 +8809,7 @@ static void giga_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008ADE64 */ static void giga_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8850,7 +8852,7 @@ static void giga_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008ADE74 */ static void giga_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8893,38 +8895,38 @@ static void giga_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008ADE84 */ static void giga_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADE94 */ static void giga_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADEA4 */ static void giga_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ADEB4 */ static void giga_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - giga_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + giga_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void giga_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { // These offsets could be moved to the g2.dat file when that supports offsets. int8_t ne_sw_offsetX = 7; diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index 9aae679082..c6e2e0cbae 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x0087694C */ static void heartline_twister_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -86,7 +86,7 @@ static void heartline_twister_rc_track_flat( static void heartline_twister_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { 19732, SPR_STATION_BASE_B_SW_NE }, @@ -101,7 +101,7 @@ static void heartline_twister_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -110,9 +110,9 @@ static void heartline_twister_rc_track_station( /** rct2: 0x0087695C */ static void heartline_twister_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -195,9 +195,9 @@ static void heartline_twister_rc_track_25_deg_up( /** rct2: 0x008769FC */ static void heartline_twister_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -280,9 +280,9 @@ static void heartline_twister_rc_track_60_deg_up( /** rct2: 0x0087696C */ static void heartline_twister_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -365,9 +365,9 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( /** rct2: 0x008769BC */ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -450,9 +450,9 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008769CC */ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -535,9 +535,9 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0087697C */ static void heartline_twister_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -620,55 +620,55 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( /** rct2: 0x0087698C */ static void heartline_twister_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00876A0C */ static void heartline_twister_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0087699C */ static void heartline_twister_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008769DC */ static void heartline_twister_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008769EC */ static void heartline_twister_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008769AC */ static void heartline_twister_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - heartline_twister_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + heartline_twister_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00876A6C */ static void heartline_twister_rc_track_heartline_transfer_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -878,7 +878,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( /** rct2: 0x00876A7C */ static void heartline_twister_rc_track_heartline_transfer_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1088,7 +1088,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( /** rct2: 0x00876A4C */ static void heartline_twister_rc_track_left_heartline_roll( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1334,7 +1334,7 @@ static void heartline_twister_rc_track_left_heartline_roll( /** rct2: 0x00876A5C */ static void heartline_twister_rc_track_right_heartline_roll( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index ec54a8bb5b..434343faa8 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -37,9 +37,9 @@ namespace HybridRC static void TrackFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_LIFT_TRACK_FLAT + direction), 0, 0, 32, 20, 3, @@ -59,7 +59,7 @@ namespace HybridRC static void TrackStation( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { (SPR_G2_HYBRID_TRACK_BRAKE + 0), (SPR_G2_HYBRID_TRACK_BLOCK_BRAKE + 0), SPR_STATION_BASE_A_SW_NE }, @@ -68,7 +68,7 @@ namespace HybridRC { (SPR_G2_HYBRID_TRACK_BRAKE + 1), (SPR_G2_HYBRID_TRACK_BLOCK_BRAKE + 1), SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | GetTrackColour(session), 0, 0, 32, 20, 1, height, 0, 6, @@ -84,7 +84,7 @@ namespace HybridRC wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -93,9 +93,9 @@ namespace HybridRC static void Track25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_LIFT_TRACK_GENTLE + direction + 8), 0, 0, 32, 20, @@ -123,7 +123,7 @@ namespace HybridRC static void Track60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height }, @@ -153,7 +153,7 @@ namespace HybridRC }; auto* ps = PaintAddImageAsParentRotated( - session, direction, GetTrackColour(session) | imageIds[tileElement->AsTrack()->HasChain() ? 0 : 1][direction], 0, 0, + session, direction, GetTrackColour(session) | imageIds[trackElement.HasChain() ? 0 : 1][direction], 0, 0, boundBoxLengths[direction].x, boundBoxLengths[direction].y, boundBoxLengths[direction].z, height, boundBoxOffsets[direction].x, boundBoxOffsets[direction].y, boundBoxOffsets[direction].z); @@ -178,9 +178,9 @@ namespace HybridRC static void TrackFlatTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_LIFT_TRACK_GENTLE + direction), 0, 0, 32, 20, 3, @@ -208,9 +208,9 @@ namespace HybridRC static void Track25DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -290,9 +290,9 @@ namespace HybridRC static void Track60DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -373,9 +373,9 @@ namespace HybridRC static void Track25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_LIFT_TRACK_GENTLE + direction + 4), 0, 0, 32, 20, @@ -403,49 +403,49 @@ namespace HybridRC static void Track25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 4, 6, height + 8 }, @@ -483,14 +483,14 @@ namespace HybridRC static void Track90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height }, @@ -535,14 +535,14 @@ namespace HybridRC static void Track90DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { { 0, 6, height + 8 }, @@ -582,7 +582,7 @@ namespace HybridRC static void Track60DegDownTo90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -624,7 +624,7 @@ namespace HybridRC static void TrackLeftQuarterTurn3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -744,15 +744,15 @@ namespace HybridRC static void TrackRightQuarterTurn3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -952,15 +952,15 @@ namespace HybridRC static void TrackRightQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1112,7 +1112,7 @@ namespace HybridRC static void TrackRightEighthToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1264,28 +1264,28 @@ namespace HybridRC static void TrackLeftEighthToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackDiagFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1313,7 +1313,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1356,7 +1356,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1397,7 +1397,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1427,12 +1427,12 @@ namespace HybridRC static void TrackDiag25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1458,7 +1458,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1503,7 +1503,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1548,7 +1548,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1578,12 +1578,12 @@ namespace HybridRC static void TrackDiag25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1609,7 +1609,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1654,7 +1654,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1699,7 +1699,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1729,12 +1729,12 @@ namespace HybridRC static void TrackDiagFlatTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1760,7 +1760,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1801,7 +1801,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1842,7 +1842,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1872,12 +1872,12 @@ namespace HybridRC static void TrackDiag25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1903,7 +1903,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1948,7 +1948,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1993,7 +1993,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2023,12 +2023,12 @@ namespace HybridRC static void TrackDiagFlatTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2053,7 +2053,7 @@ namespace HybridRC paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2097,7 +2097,7 @@ namespace HybridRC paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2141,7 +2141,7 @@ namespace HybridRC paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2172,12 +2172,12 @@ namespace HybridRC static void TrackDiag25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2203,7 +2203,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2244,7 +2244,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2285,7 +2285,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2315,12 +2315,12 @@ namespace HybridRC static void TrackDiag60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2346,7 +2346,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2391,7 +2391,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2436,7 +2436,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2466,12 +2466,12 @@ namespace HybridRC static void TrackDiag25DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2497,7 +2497,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2542,7 +2542,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2587,7 +2587,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2617,12 +2617,12 @@ namespace HybridRC static void TrackDiag60DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2648,7 +2648,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2693,7 +2693,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2738,7 +2738,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2768,12 +2768,12 @@ namespace HybridRC static void TrackDiag60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2799,7 +2799,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2844,7 +2844,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2889,7 +2889,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2919,12 +2919,12 @@ namespace HybridRC static void TrackDiag25DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2950,7 +2950,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2995,7 +2995,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3040,7 +3040,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3070,12 +3070,12 @@ namespace HybridRC static void TrackDiag60DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3101,7 +3101,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3146,7 +3146,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3191,7 +3191,7 @@ namespace HybridRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3221,7 +3221,7 @@ namespace HybridRC static void TrackFlatToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3260,7 +3260,7 @@ namespace HybridRC static void TrackFlatToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3299,21 +3299,21 @@ namespace HybridRC static void TrackLeftBankToflat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToflat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3360,7 +3360,7 @@ namespace HybridRC static void TrackRightBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3407,7 +3407,7 @@ namespace HybridRC static void Track25DegUpToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3454,7 +3454,7 @@ namespace HybridRC static void Track25DegUpToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3501,35 +3501,35 @@ namespace HybridRC static void TrackLeftBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftbank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3568,14 +3568,14 @@ namespace HybridRC static void TrackRightbank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftbank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftbank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3665,7 +3665,7 @@ namespace HybridRC static void TrackDiagFlatToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3755,7 +3755,7 @@ namespace HybridRC static void TrackDiagLeftBankToflat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3845,7 +3845,7 @@ namespace HybridRC static void TrackDiagRightBankToflat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3935,7 +3935,7 @@ namespace HybridRC static void TrackDiagLeftBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4025,7 +4025,7 @@ namespace HybridRC static void TrackDiagRightBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4115,7 +4115,7 @@ namespace HybridRC static void TrackDiag25DegUpToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4213,7 +4213,7 @@ namespace HybridRC static void TrackDiag25DegUpToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4311,7 +4311,7 @@ namespace HybridRC static void TrackDiagLeftBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4407,7 +4407,7 @@ namespace HybridRC static void TrackDiagRightBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4503,7 +4503,7 @@ namespace HybridRC static void TrackDiag25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4593,7 +4593,7 @@ namespace HybridRC static void TrackDiag25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4683,7 +4683,7 @@ namespace HybridRC static void TrackDiagLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4773,7 +4773,7 @@ namespace HybridRC static void TrackDiagRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4863,7 +4863,7 @@ namespace HybridRC static void TrackLeftQuarterTurn3Bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4995,15 +4995,15 @@ namespace HybridRC static void TrackRightQuarterTurn3Bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackBankedLeftQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5218,15 +5218,15 @@ namespace HybridRC static void TrackBankedRightQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthBankToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5390,7 +5390,7 @@ namespace HybridRC static void TrackRightEighthBankToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5555,23 +5555,23 @@ namespace HybridRC static void TrackLeftEighthBankToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthBankToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackLeftQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5679,7 +5679,7 @@ namespace HybridRC static void TrackRightQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5787,23 +5787,23 @@ namespace HybridRC static void TrackLeftQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6003,7 +6003,7 @@ namespace HybridRC static void TrackRightQuarterTurn5Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6203,23 +6203,23 @@ namespace HybridRC static void TrackLeftQuarterTurn5Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn5Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn1Tile60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6267,7 +6267,7 @@ namespace HybridRC static void TrackRightQuarterTurn1Tile60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6316,21 +6316,21 @@ namespace HybridRC static void TrackLeftQuarterTurn1Tile60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn1Tile90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6375,7 +6375,7 @@ namespace HybridRC static void TrackRightQuarterTurn1Tile90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6420,21 +6420,21 @@ namespace HybridRC static void TrackLeftQuarterTurn1Tile90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6478,7 +6478,7 @@ namespace HybridRC static void Track25DegUpToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6522,7 +6522,7 @@ namespace HybridRC static void TrackLeftBanked25DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6566,7 +6566,7 @@ namespace HybridRC static void TrackRightBanked25DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6610,35 +6610,35 @@ namespace HybridRC static void TrackLeftBanked25DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6685,7 +6685,7 @@ namespace HybridRC static void TrackRightBankedFlatToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6732,7 +6732,7 @@ namespace HybridRC static void TrackLeftBanked25DegUpToLeftBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6779,7 +6779,7 @@ namespace HybridRC static void TrackRightBanked25DegUpToRightBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6826,35 +6826,35 @@ namespace HybridRC static void TrackLeftBankedFlatToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6895,7 +6895,7 @@ namespace HybridRC static void Track25DegUpRightBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6936,21 +6936,21 @@ namespace HybridRC static void Track25DegDownLeftBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6994,7 +6994,7 @@ namespace HybridRC static void TrackFlatToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7038,7 +7038,7 @@ namespace HybridRC static void TrackLeftBanked25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7082,7 +7082,7 @@ namespace HybridRC static void TrackRightBanked25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7126,35 +7126,35 @@ namespace HybridRC static void TrackFlatToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7271,7 +7271,7 @@ namespace HybridRC static void TrackRightBankedQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7388,23 +7388,23 @@ namespace HybridRC static void TrackLeftBankedQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn5Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7622,7 +7622,7 @@ namespace HybridRC static void TrackRightBankedQuarterTurn5Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7840,23 +7840,23 @@ namespace HybridRC static void TrackLeftBankedQuarterTurn5Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn5Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn5Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackSBendLeft( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8010,7 +8010,7 @@ namespace HybridRC static void TrackSBendRight( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8164,7 +8164,7 @@ namespace HybridRC static void TrackLeftHalfBankedHelixUpSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8449,7 +8449,7 @@ namespace HybridRC static void TrackRightHalfBankedHelixUpSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8734,7 +8734,7 @@ namespace HybridRC static void TrackLeftHalfBankedHelixDownSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -8742,12 +8742,12 @@ namespace HybridRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightHalfBankedHelixDownSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -8755,12 +8755,12 @@ namespace HybridRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftHalfBankedHelixUpLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9181,7 +9181,7 @@ namespace HybridRC static void TrackRightHalfBankedHelixUpLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9602,7 +9602,7 @@ namespace HybridRC static void TrackLeftHalfBankedHelixDownLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9610,12 +9610,12 @@ namespace HybridRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightHalfBankedHelixDownLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9623,12 +9623,12 @@ namespace HybridRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBarrelRollUpToDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9773,7 +9773,7 @@ namespace HybridRC static void TrackRightBarrelRollUpToDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9918,21 +9918,21 @@ namespace HybridRC static void TrackLeftBarrelRollDownToUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10066,14 +10066,14 @@ namespace HybridRC static void TrackInvertedFlatTo90DegQuarterLoopDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void Trackbrakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BRAKE + (direction & 1)), 0, 0, 32, 20, 3, @@ -10086,13 +10086,13 @@ namespace HybridRC static void TrackOnRidePhoto( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { PaintAddImageAsParentRotated(session, direction, IMAGE_TYPE_REMAP | SPR_STATION_BASE_D, 0, 0, 32, 32, 1, height); PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_FLAT + (direction & 1)), 0, 0, 32, 20, 0, height, 0, 6, height + 3); - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10101,7 +10101,7 @@ namespace HybridRC static void TrackFlatTo60DegUpLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10239,7 +10239,7 @@ namespace HybridRC static void Track60DegUpToFlatLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10377,21 +10377,21 @@ namespace HybridRC static void TrackFlatTo60DegDownLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BLOCK_BRAKE + (direction & 1)), 0, 0, 32, 20, 3, @@ -10404,7 +10404,7 @@ namespace HybridRC static void Trackbooster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BOOSTER + (direction & 1)), 0, 0, 32, 20, 3, @@ -10417,7 +10417,7 @@ namespace HybridRC static void Trackpowered_lift( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_POWERED_LIFT + direction), 0, 0, 32, 20, 3, @@ -10438,7 +10438,7 @@ namespace HybridRC static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10549,7 +10549,7 @@ namespace HybridRC static void TrackRightBankToRightQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10660,7 +10660,7 @@ namespace HybridRC static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10771,7 +10771,7 @@ namespace HybridRC static void TrackRightQuarterTurn3Tile25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 2343800381..3dbe6231db 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x00890CB4 */ static void inverted_hairpin_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -83,7 +83,7 @@ static void inverted_hairpin_rc_track_flat( /** rct2: 0x00890D84, 0x00890D94, 0x00890DA4 */ static void inverted_hairpin_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 17028, SPR_STATION_INVERTED_BAR_0_SW_NE }, @@ -101,7 +101,7 @@ static void inverted_hairpin_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -110,9 +110,9 @@ static void inverted_hairpin_rc_track_station( /** rct2: 0x00890CC4 */ static void inverted_hairpin_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -204,9 +204,9 @@ static void inverted_hairpin_rc_track_25_deg_up( /** rct2: 0x00890CD4 */ static void inverted_hairpin_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -274,9 +274,9 @@ static void inverted_hairpin_rc_track_60_deg_up( /** rct2: 0x00890CE4 */ static void inverted_hairpin_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -368,9 +368,9 @@ static void inverted_hairpin_rc_track_flat_to_25_deg_up( /** rct2: 0x00890CF4 */ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -450,9 +450,9 @@ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x00890D04 */ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -556,9 +556,9 @@ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x00890D14 */ static void inverted_hairpin_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -650,55 +650,55 @@ static void inverted_hairpin_rc_track_25_deg_up_to_flat( /** rct2: 0x00890D24 */ static void inverted_hairpin_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890D34 */ static void inverted_hairpin_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890D44 */ static void inverted_hairpin_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890D54 */ static void inverted_hairpin_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890D64 */ static void inverted_hairpin_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890D74 */ static void inverted_hairpin_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890DB4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -818,16 +818,16 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3( /** rct2: 0x00890DC4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_hairpin_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_hairpin_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00890DD4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -914,7 +914,7 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x00890DE4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1001,27 +1001,27 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x00890DF4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00890E04 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00890E64 */ static void inverted_hairpin_rc_track_left_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1071,17 +1071,17 @@ static void inverted_hairpin_rc_track_left_quarter_turn_1( /** rct2: 0x00890E74 */ static void inverted_hairpin_rc_track_right_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_hairpin_rc_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00890E24 */ static void inverted_hairpin_rc_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1161,9 +1161,9 @@ static void inverted_hairpin_rc_track_flat_to_60_deg_up( /** rct2: 0x00890E34 */ static void inverted_hairpin_rc_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1264,23 +1264,23 @@ static void inverted_hairpin_rc_track_60_deg_up_to_flat( /** rct2: 0x00890E44 */ static void inverted_hairpin_rc_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890E54 */ static void inverted_hairpin_rc_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_hairpin_rc_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_hairpin_rc_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00890E14 */ static void inverted_hairpin_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1313,7 +1313,7 @@ static void inverted_hairpin_rc_track_brakes( /** rct2: 0x00890E84 */ static void inverted_hairpin_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index accdbcfc97..73ca2071de 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -21,7 +21,7 @@ /** rct2: 0x008B0460 */ static void inverted_impulse_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -54,7 +54,7 @@ static void inverted_impulse_rc_track_flat( /** rct2: 0x008B0470, 0x008B0480, 0x008B0490 */ static void inverted_impulse_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 19662, SPR_STATION_INVERTED_BAR_B_SW_NE }, @@ -72,7 +72,7 @@ static void inverted_impulse_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -81,7 +81,7 @@ static void inverted_impulse_rc_track_station( /** rct2: 0x008B04A0 */ static void inverted_impulse_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -146,7 +146,7 @@ static void inverted_impulse_rc_track_25_deg_up( /** rct2: 0x008B04B0 */ static void inverted_impulse_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -187,7 +187,7 @@ static void inverted_impulse_rc_track_60_deg_up( /** rct2: 0x008B04C0 */ static void inverted_impulse_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -249,7 +249,7 @@ static void inverted_impulse_rc_track_flat_to_25_deg_up( /** rct2: 0x008B04D0 */ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -296,7 +296,7 @@ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008B04E0 */ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -343,7 +343,7 @@ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008B04F0 */ static void inverted_impulse_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -405,55 +405,55 @@ static void inverted_impulse_rc_track_25_deg_up_to_flat( /** rct2: 0x008B0500 */ static void inverted_impulse_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0510 */ static void inverted_impulse_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0520 */ static void inverted_impulse_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0530 */ static void inverted_impulse_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0540 */ static void inverted_impulse_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0550 */ static void inverted_impulse_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B05A0 */ static void inverted_impulse_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -494,15 +494,15 @@ static void inverted_impulse_rc_track_90_deg_up( /** rct2: 0x008B05B0 */ static void inverted_impulse_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0560 */ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -547,15 +547,15 @@ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008B0570 */ static void inverted_impulse_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_impulse_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_impulse_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0580 */ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -597,7 +597,7 @@ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008B0590 */ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -641,7 +641,7 @@ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008B05C0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -691,7 +691,7 @@ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008B05D0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -741,19 +741,19 @@ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008B05E0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008B05F0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index ba50a35c7c..dd726c7b9f 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x008A92E8 */ static void inverted_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -74,7 +74,7 @@ static void inverted_rc_track_flat( /** rct2: 0x008A9558, 0x008A9568, 0x008A9578 */ static void inverted_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 27131, SPR_STATION_INVERTED_BAR_C_SW_NE }, @@ -92,7 +92,7 @@ static void inverted_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -101,9 +101,9 @@ static void inverted_rc_track_station( /** rct2: 0x008A92F8 */ static void inverted_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -195,7 +195,7 @@ static void inverted_rc_track_25_deg_up( /** rct2: 0x008A9308 */ static void inverted_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -236,9 +236,9 @@ static void inverted_rc_track_60_deg_up( /** rct2: 0x008A9318 */ static void inverted_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -330,7 +330,7 @@ static void inverted_rc_track_flat_to_25_deg_up( /** rct2: 0x008A9328 */ static void inverted_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -377,7 +377,7 @@ static void inverted_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A9338 */ static void inverted_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -448,9 +448,9 @@ static void inverted_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A9348 */ static void inverted_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -542,55 +542,55 @@ static void inverted_rc_track_25_deg_up_to_flat( /** rct2: 0x008A9358 */ static void inverted_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9368 */ static void inverted_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9378 */ static void inverted_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9388 */ static void inverted_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9398 */ static void inverted_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A93A8 */ static void inverted_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A93B8 */ static void inverted_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -770,16 +770,16 @@ static void inverted_rc_track_left_quarter_turn_5( /** rct2: 0x008A93C8 */ static void inverted_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A93D8 */ static void inverted_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -821,7 +821,7 @@ static void inverted_rc_track_flat_to_left_bank( /** rct2: 0x008A93E8 */ static void inverted_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -863,7 +863,7 @@ static void inverted_rc_track_flat_to_right_bank( /** rct2: 0x008A93F8 */ static void inverted_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -905,7 +905,7 @@ static void inverted_rc_track_left_bank_to_flat( /** rct2: 0x008A9408 */ static void inverted_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -947,7 +947,7 @@ static void inverted_rc_track_right_bank_to_flat( /** rct2: 0x008A9418 */ static void inverted_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1127,16 +1127,16 @@ static void inverted_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A9428 */ static void inverted_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A9438 */ static void inverted_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1203,7 +1203,7 @@ static void inverted_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A9448 */ static void inverted_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1270,7 +1270,7 @@ static void inverted_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A9458 */ static void inverted_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1337,7 +1337,7 @@ static void inverted_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A9468 */ static void inverted_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1404,39 +1404,39 @@ static void inverted_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A9478 */ static void inverted_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9488 */ static void inverted_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9498 */ static void inverted_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A94A8 */ static void inverted_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A94B8 */ static void inverted_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1478,15 +1478,15 @@ static void inverted_rc_track_left_bank( /** rct2: 0x008A94C8 */ static void inverted_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A94D8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1651,7 +1651,7 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A94E8 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1816,25 +1816,25 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A94F8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A9508 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A9518 */ static void inverted_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2005,7 +2005,7 @@ static void inverted_rc_track_s_bend_left( /** rct2: 0x008A9528 */ static void inverted_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2176,7 +2176,7 @@ static void inverted_rc_track_s_bend_right( /** rct2: 0x008A9538 */ static void inverted_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2483,7 +2483,7 @@ static void inverted_rc_track_left_vertical_loop( /** rct2: 0x008A9548 */ static void inverted_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2790,7 +2790,7 @@ static void inverted_rc_track_right_vertical_loop( /** rct2: 0x008A9588 */ static void inverted_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2909,16 +2909,16 @@ static void inverted_rc_track_left_quarter_turn_3( /** rct2: 0x008A9598 */ static void inverted_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A95A8 */ static void inverted_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3038,16 +3038,16 @@ static void inverted_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A95B8 */ static void inverted_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A95C8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3134,7 +3134,7 @@ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A95D8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3221,25 +3221,25 @@ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A95E8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A95F8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - inverted_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A9608 */ static void inverted_rc_track_left_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3348,7 +3348,7 @@ static void inverted_rc_track_left_twist_down_to_up( /** rct2: 0x008A9618 */ static void inverted_rc_track_right_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3457,7 +3457,7 @@ static void inverted_rc_track_right_twist_down_to_up( /** rct2: 0x008A9628 */ static void inverted_rc_track_left_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3566,7 +3566,7 @@ static void inverted_rc_track_left_twist_up_to_down( /** rct2: 0x008A9638 */ static void inverted_rc_track_right_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3675,7 +3675,7 @@ static void inverted_rc_track_right_twist_up_to_down( /** rct2: 0x008A9648 */ static void inverted_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3828,15 +3828,15 @@ static void inverted_rc_track_half_loop_up( /** rct2: 0x008A9658 */ static void inverted_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); + inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A9668 */ static void inverted_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3954,7 +3954,7 @@ static void inverted_rc_track_left_corkscrew_up( /** rct2: 0x008A9678 */ static void inverted_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4072,23 +4072,23 @@ static void inverted_rc_track_right_corkscrew_up( /** rct2: 0x008A9688 */ static void inverted_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A9698 */ static void inverted_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A96D8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4125,7 +4125,7 @@ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A96B8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4163,23 +4163,23 @@ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A96C8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + inverted_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A96E8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + inverted_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A96A8 */ static void inverted_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4211,7 +4211,7 @@ static void inverted_rc_track_brakes( /** rct2: 0x008A96F8 */ static void inverted_rc_track_left_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4396,7 +4396,7 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( /** rct2: 0x008A9708 */ static void inverted_rc_track_right_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4581,7 +4581,7 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( /** rct2: 0x008A9718 */ static void inverted_rc_track_left_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4766,7 +4766,7 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( /** rct2: 0x008A9728 */ static void inverted_rc_track_right_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4951,7 +4951,7 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( /** rct2: 0x008A9A38 */ static void inverted_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5016,7 +5016,7 @@ static void inverted_rc_track_25_deg_up_left_banked( /** rct2: 0x008A9A48 */ static void inverted_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5081,7 +5081,7 @@ static void inverted_rc_track_25_deg_up_right_banked( /** rct2: 0x008A9738 */ static void inverted_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5118,7 +5118,7 @@ static void inverted_rc_track_on_ride_photo( height + 29); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); @@ -5127,23 +5127,23 @@ static void inverted_rc_track_on_ride_photo( /** rct2: 0x008A9A58 */ static void inverted_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9A68 */ static void inverted_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9748 */ static void inverted_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5306,7 +5306,7 @@ static void inverted_rc_track_left_eighth_to_diag( /** rct2: 0x008A9758 */ static void inverted_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5469,25 +5469,25 @@ static void inverted_rc_track_right_eighth_to_diag( /** rct2: 0x008A9768 */ static void inverted_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9778 */ static void inverted_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + inverted_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A9938 */ static void inverted_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5650,7 +5650,7 @@ static void inverted_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A9948 */ static void inverted_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5813,30 +5813,30 @@ static void inverted_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A9958 */ static void inverted_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9968 */ static void inverted_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + inverted_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A9788 */ static void inverted_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5863,7 +5863,7 @@ static void inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5890,7 +5890,7 @@ static void inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5917,7 +5917,7 @@ static void inverted_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5970,12 +5970,12 @@ static void inverted_rc_track_diag_flat( /** rct2: 0x008A97B8 */ static void inverted_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6002,7 +6002,7 @@ static void inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6029,7 +6029,7 @@ static void inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6056,7 +6056,7 @@ static void inverted_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6109,7 +6109,7 @@ static void inverted_rc_track_diag_25_deg_up( /** rct2: 0x008A9818 */ static void inverted_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6192,12 +6192,12 @@ static void inverted_rc_track_diag_60_deg_up( /** rct2: 0x008A9798 */ static void inverted_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6224,7 +6224,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6251,7 +6251,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6278,7 +6278,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6331,7 +6331,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A97F8 */ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6414,7 +6414,7 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A9808 */ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6497,12 +6497,12 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A97A8 */ static void inverted_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6529,7 +6529,7 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6556,7 +6556,7 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6583,7 +6583,7 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6636,12 +6636,12 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A97E8 */ static void inverted_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6668,7 +6668,7 @@ static void inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6695,7 +6695,7 @@ static void inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6722,7 +6722,7 @@ static void inverted_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6775,7 +6775,7 @@ static void inverted_rc_track_diag_25_deg_down( /** rct2: 0x008A9848 */ static void inverted_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6858,12 +6858,12 @@ static void inverted_rc_track_diag_60_deg_down( /** rct2: 0x008A97C8 */ static void inverted_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6889,7 +6889,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6915,7 +6915,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6941,7 +6941,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6994,7 +6994,7 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A9828 */ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7077,7 +7077,7 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A9838 */ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7160,12 +7160,12 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A97D8 */ static void inverted_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7192,7 +7192,7 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7219,7 +7219,7 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7246,7 +7246,7 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7299,7 +7299,7 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A9878 */ static void inverted_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7383,7 +7383,7 @@ static void inverted_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A9888 */ static void inverted_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7467,7 +7467,7 @@ static void inverted_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A9898 */ static void inverted_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7551,7 +7551,7 @@ static void inverted_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A98A8 */ static void inverted_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7635,7 +7635,7 @@ static void inverted_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A98D8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7718,7 +7718,7 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A98E8 */ static void inverted_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7801,7 +7801,7 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A98B8 */ static void inverted_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7884,7 +7884,7 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A98C8 */ static void inverted_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7967,7 +7967,7 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A98F8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8047,7 +8047,7 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A9908 */ static void inverted_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8127,7 +8127,7 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A9918 */ static void inverted_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8210,7 +8210,7 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A9928 */ static void inverted_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8293,7 +8293,7 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A9858 */ static void inverted_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8377,7 +8377,7 @@ static void inverted_rc_track_diag_left_bank( /** rct2: 0x008A9868 */ static void inverted_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8461,7 +8461,7 @@ static void inverted_rc_track_diag_right_bank( /** rct2: 0x008A9978 */ static void inverted_rc_track_left_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8690,7 +8690,7 @@ static void inverted_rc_track_left_large_half_loop_up( /** rct2: 0x008A9988 */ static void inverted_rc_track_right_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8919,23 +8919,23 @@ static void inverted_rc_track_right_large_half_loop_up( /** rct2: 0x008A9998 */ static void inverted_rc_track_right_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_right_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, tileElement); + inverted_rc_track_right_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A99A8 */ static void inverted_rc_track_left_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, tileElement); + inverted_rc_track_left_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A96A8 */ static void inverted_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8967,7 +8967,7 @@ static void inverted_rc_track_block_brakes( /** rct2: 0x008A9A78 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9054,7 +9054,7 @@ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A9A88 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9141,27 +9141,27 @@ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A9A98 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A9AA8 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A9BB8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9326,7 +9326,7 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A9BC8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9491,27 +9491,27 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A9BD8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A9BE8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A9AB8 */ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9576,7 +9576,7 @@ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A9AC8 */ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9641,7 +9641,7 @@ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A9AD8 */ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9706,7 +9706,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A9AE8 */ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9771,43 +9771,43 @@ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A9AF8 */ static void inverted_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B08 */ static void inverted_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B18 */ static void inverted_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B28 */ static void inverted_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B38 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9872,7 +9872,7 @@ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A9B48 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9937,7 +9937,7 @@ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A9B58 */ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10002,7 +10002,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A9B68 */ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10067,43 +10067,43 @@ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A9B78 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B88 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9B98 */ static void inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9BA8 */ static void inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A99B8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10168,7 +10168,7 @@ static void inverted_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A99C8 */ static void inverted_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10233,7 +10233,7 @@ static void inverted_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A99D8 */ static void inverted_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10298,7 +10298,7 @@ static void inverted_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A99E8 */ static void inverted_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10363,33 +10363,33 @@ static void inverted_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A99F8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9A08 */ static void inverted_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9A18 */ static void inverted_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A9A28 */ static void inverted_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - inverted_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + inverted_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 2b1076ad99..9f86c51f2d 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -1621,7 +1621,7 @@ static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down_to_25_de void junior_rc_paint_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_flat[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 20, 1, height); @@ -1641,11 +1641,11 @@ void junior_rc_paint_track_flat( void junior_rc_paint_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, uint8_t rideType) + const TrackElement& trackElement, uint8_t rideType) { uint32_t imageId; - bool isBraked = tileElement->AsTrack()->BlockBrakeClosed(); + bool isBraked = trackElement.BlockBrakeClosed(); if (direction == 0 || direction == 2) { @@ -1654,7 +1654,7 @@ void junior_rc_paint_station( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); // height += 2 (height) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) + if (trackElement.GetTrackType() == TrackElemType::EndStation && rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) { imageId = junior_rc_track_pieces_block_brake[isBraked][direction] | session->TrackColours[SCHEME_TRACK]; } @@ -1676,7 +1676,7 @@ void junior_rc_paint_station( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); // height += 2 (height) - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation && rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) + if (trackElement.GetTrackType() == TrackElemType::EndStation && rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) { imageId = junior_rc_track_pieces_block_brake[isBraked][direction] | session->TrackColours[SCHEME_TRACK]; } @@ -1691,7 +1691,7 @@ void junior_rc_paint_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -1699,7 +1699,7 @@ void junior_rc_paint_station( void junior_rc_paint_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 20, 1, height); @@ -1721,7 +1721,7 @@ void junior_rc_paint_track_25_deg_up( void junior_rc_paint_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_flat_to_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1750,7 +1750,7 @@ void junior_rc_paint_track_flat_to_25_deg_up( void junior_rc_paint_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = junior_rc_track_pieces_25_deg_up_to_flat[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK]; @@ -1798,7 +1798,7 @@ static constexpr const int8_t junior_rc_track_right_quarter_turn_5_tiles_support static void junior_rc_right_quarter_turn_5_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -1878,10 +1878,10 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn /* rct2: 0x0051917A */ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; - junior_rc_right_quarter_turn_5_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + junior_rc_right_quarter_turn_5_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** @@ -1889,7 +1889,7 @@ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( */ static void junior_rc_flat_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -1937,7 +1937,7 @@ static void junior_rc_flat_to_left_bank_paint_setup( */ static void junior_rc_flat_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -1982,16 +1982,16 @@ static void junior_rc_flat_to_right_bank_paint_setup( static void junior_rc_left_bank_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_flat_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_flat_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void junior_rc_right_bank_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_flat_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_flat_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static constexpr const CoordsXY junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { @@ -2059,7 +2059,7 @@ static constexpr const CoordsXYZ junior_rc_banked_right_quarter_turn_5_tiles_bou /* rct2: 0x008AB010, 0x0052304C */ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t thickness = 1; if (direction == 2 && (trackSequence == 0 || trackSequence == 6)) @@ -2153,11 +2153,11 @@ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( /* rct2: 0x008AB000 */ static void junior_rc_banked_left_quarter_turn_5_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** @@ -2165,7 +2165,7 @@ static void junior_rc_banked_left_quarter_turn_5_tiles_paint_setup( */ static void junior_rc_left_bank_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -2225,7 +2225,7 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup( */ static void junior_rc_right_bank_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -2285,7 +2285,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup( */ static void junior_rc_25_deg_up_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -2346,7 +2346,7 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup( */ static void junior_rc_25_deg_up_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -2407,9 +2407,9 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup( */ static void junior_rc_left_bank_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_25_deg_up_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_right_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** @@ -2417,9 +2417,9 @@ static void junior_rc_left_bank_to_25_deg_down_paint_setup( */ static void junior_rc_right_bank_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_25_deg_up_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** @@ -2427,9 +2427,9 @@ static void junior_rc_right_bank_to_25_deg_down_paint_setup( */ static void junior_rc_25_deg_down_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_right_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** @@ -2437,9 +2437,9 @@ static void junior_rc_25_deg_down_to_left_bank_paint_setup( */ static void junior_rc_25_deg_down_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_left_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_left_bank_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static constexpr const CoordsXYZ junior_rc_left_bank_bound_lengths[4] = { @@ -2461,7 +2461,7 @@ static constexpr const CoordsXY junior_rc_left_bank_bound_offsets[4] = { */ static void junior_rc_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -2496,14 +2496,14 @@ static void junior_rc_left_bank_paint_setup( */ static void junior_rc_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -2583,7 +2583,7 @@ void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -2664,49 +2664,49 @@ void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( /* rct2: 0x008AAE10, 0x00519D88, 0x00519DAC, 0x00519DD0, 0x00519DF4 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x008AAE20, 0x00519E18, 0x0051A148, 0x0051A452, 0x0051A738 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x008AAE30, 0x0051AA42, 0x0051AA68, 0x0051AA8C, 0x0051AAB0 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) & 3, height, - tileElement); + trackElement); } /* rct2: 0x008AAE40, 0x0051AAD4, 0x0051AE04, 0x0051B10E, 0x0051B3F4 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( session, ride, junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction - 1) & 3, height, - tileElement); + trackElement); } /* rct2: 0x008AAE50, 0x0051B6FE, 0x0051B946, 0x0051BB8E, 0x0051BBA8 */ static void junior_rc_s_bend_left_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -2812,7 +2812,7 @@ static void junior_rc_s_bend_left_paint_setup( /* rct2: 0x008AAE60, 0x0051BBC0, 0x0051BE06, 0x0051C04E, 0x0051C068 */ static void junior_rc_s_bend_right_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -2918,7 +2918,7 @@ static void junior_rc_s_bend_right_paint_setup( /** rct2: 0x008AAEB0, 0x0051C0E0, 0x0051C2C1, 0x0051C47F, 0x0051C61D */ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -2957,10 +2957,10 @@ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( /** rct2: 0x008AAEA0 */ static void junior_rc_left_quarter_turn_3_tiles_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - junior_rc_right_quarter_turn_3_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + junior_rc_right_quarter_turn_3_tiles_paint_setup(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static constexpr const CoordsXY junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { @@ -3012,7 +3012,7 @@ static constexpr const CoordsXYZ junior_rc_right_quarter_turn_3_tiles_bank_offse /** rct2: 0x008AA0D0, 0x00523EA0, 0x005240CC, 0x0052430F, 0x00524500*/ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t thickness[4][4] = { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 26, 1, 1, 26 }, { 1, 1, 1, 1 } }; @@ -3063,7 +3063,7 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = 0; CoordsXY offset; @@ -3142,7 +3142,7 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t imageId = 0; CoordsXY offset; @@ -3222,32 +3222,32 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( /** rct2: 0x008AA0C0 */ static void junior_rc_left_quarter_turn_3_tiles_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AAED0, 0x0051C83C, 0x0051C9EC, 0x0051CB76, 0x0051CCDC*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAEF0, 0x0051CEC8, 0x0051D078, 0x0051D202, 0x0051D368*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } @@ -3256,27 +3256,27 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_3_tiles_to_right_turn /** rct2: 0x008AAEC0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AAEE0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AB0F0, 0x0052B3A4, 0x0052B5F8, 0x0052B863, 0x0052BA78 */ static void junior_rc_right_half_banked_helix_up_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3344,7 +3344,7 @@ static void junior_rc_right_half_banked_helix_up_small_paint_setup( /** rct2: 0x008AB110, 0x0052BD80, 0x0052BFD4, 0x0052C23B, 0x0052C450 */ static void junior_rc_right_half_banked_helix_down_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3412,7 +3412,7 @@ static void junior_rc_right_half_banked_helix_down_small_paint_setup( /** rct2: 0x008AB0E0 */ static void junior_rc_left_half_banked_helix_up_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence > 3) { @@ -3422,13 +3422,13 @@ static void junior_rc_left_half_banked_helix_up_small_paint_setup( } trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_down_small_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AB100 */ static void junior_rc_left_half_banked_helix_down_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence > 3) { @@ -3438,13 +3438,13 @@ static void junior_rc_left_half_banked_helix_down_small_paint_setup( } trackSequence = junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_up_small_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AB130, 0x0052C7BC, 0x0052CB6B, 0x0052CF32, 0x0052D2B3 */ static void junior_rc_right_half_banked_helix_up_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3530,7 +3530,7 @@ static void junior_rc_right_half_banked_helix_up_large_paint_setup( /** rct2: 0x008AB150, 0x0052D778, 0x0052DB27, 0x0052DEEA, 0x0052E26B */ static void junior_rc_right_half_banked_helix_down_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t thickness[2] = { 1, 26 }; @@ -3616,7 +3616,7 @@ static void junior_rc_right_half_banked_helix_down_large_paint_setup( /** rct2: 0x008AB120 */ static void junior_rc_left_half_banked_helix_up_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence > 6) { @@ -3626,13 +3626,13 @@ static void junior_rc_left_half_banked_helix_up_large_paint_setup( } trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_down_large_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x008AB140 */ static void junior_rc_left_half_banked_helix_down_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence > 6) { @@ -3642,7 +3642,7 @@ static void junior_rc_left_half_banked_helix_down_large_paint_setup( } trackSequence = junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence]; junior_rc_right_half_banked_helix_up_large_paint_setup( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** @@ -3650,7 +3650,7 @@ static void junior_rc_left_half_banked_helix_down_large_paint_setup( */ static void junior_rc_brake_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; @@ -3684,11 +3684,11 @@ static void junior_rc_brake_paint_setup( */ static void junior_rc_block_brake_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id; - bool isBraked = tileElement->AsTrack()->BlockBrakeClosed(); + bool isBraked = trackElement.BlockBrakeClosed(); image_id = junior_rc_track_pieces_block_brake[isBraked][direction] | session->TrackColours[SCHEME_TRACK]; if (direction & 1) @@ -3718,7 +3718,7 @@ static void junior_rc_block_brake_paint_setup( /** rct2: 0x008AAF80 */ static void junior_rc_left_eighth_to_diag_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, defaultEighthToDiagThickness, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -3784,7 +3784,7 @@ static void junior_rc_left_eighth_to_diag_paint_setup( /** rct2: 0x008AAF90 */ static void junior_rc_right_eighth_to_diag_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, defaultEighthToDiagThickness, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -3850,21 +3850,21 @@ static void junior_rc_right_eighth_to_diag_paint_setup( /** rct2: 0x008AAFA0 */ static void junior_rc_left_eighth_to_orthogonal_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_right_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AAFB0 */ static void junior_rc_right_eighth_to_orthogonal_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_left_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + junior_rc_left_eighth_to_diag_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static constexpr const CoordsXY junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { @@ -3951,7 +3951,7 @@ static constexpr const int8_t junior_rc_left_eighth_to_diag_bank_thickness[4][4] /** rct2: 0x008AB160 */ static void junior_rc_left_eighth_to_diag_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, junior_rc_left_eighth_to_diag_bank_thickness, height, direction, trackSequence, @@ -4098,7 +4098,7 @@ static constexpr const int8_t junior_rc_right_eighth_to_diag_bank_thickness[4][4 /** rct2: 0x008AB170 */ static void junior_rc_right_eighth_to_diag_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( session, junior_rc_right_eighth_to_diag_bank_thickness, height, direction, trackSequence, @@ -4164,21 +4164,21 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup( /** rct2: 0x008AB180 */ static void junior_rc_left_eighth_to_orthogonal_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_right_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_right_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AB190 */ static void junior_rc_right_eighth_to_orthogonal_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - junior_rc_left_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + junior_rc_left_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static constexpr const int32_t junior_rc_diag_blocked_segments[] = { SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, @@ -4190,7 +4190,7 @@ static constexpr const uint8_t junior_rc_diag_support_segment[] = { 1, 0, 2, 3 } void junior_rc_paint_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4210,7 +4210,7 @@ void junior_rc_paint_track_diag_flat( void junior_rc_paint_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4230,7 +4230,7 @@ void junior_rc_paint_track_diag_25_deg_up( void junior_rc_paint_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4251,7 +4251,7 @@ void junior_rc_paint_track_diag_flat_to_25_deg_up( void junior_rc_paint_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead chainType = std::min(JuniorRcChainType::FrictionWheels, chainType); @@ -4275,7 +4275,7 @@ void junior_rc_paint_track_diag_flat_to_60_deg_up( void junior_rc_paint_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4296,7 +4296,7 @@ void junior_rc_paint_track_diag_25_deg_up_to_flat( void junior_rc_paint_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead chainType = std::min(JuniorRcChainType::FrictionWheels, chainType); @@ -4320,7 +4320,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_flat( void junior_rc_paint_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4341,7 +4341,7 @@ void junior_rc_paint_track_diag_25_deg_down( void junior_rc_paint_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4362,7 +4362,7 @@ void junior_rc_paint_track_diag_flat_to_25_deg_down( void junior_rc_paint_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead chainType = std::min(JuniorRcChainType::FrictionWheels, chainType); @@ -4386,7 +4386,7 @@ void junior_rc_paint_track_diag_flat_to_60_deg_down( void junior_rc_paint_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4407,7 +4407,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_flat( void junior_rc_paint_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { // There is no specific chain for the Water Coaster, use the Junior RC chain instead chainType = std::min(JuniorRcChainType::FrictionWheels, chainType); @@ -4432,124 +4432,124 @@ void junior_rc_paint_track_diag_60_deg_down_to_flat( /** rct2: 0x008AAF10 */ static void junior_rc_diag_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF40 */ static void junior_rc_diag_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF20 */ static void junior_rc_diag_flat_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_flat_to_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF30 */ static void junior_rc_diag_25_deg_up_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_up_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF70 */ static void junior_rc_diag_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF50 */ static void junior_rc_diag_flat_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_flat_to_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AAF60 */ static void junior_rc_diag_25_deg_down_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /** rct2: 0x008AB1C0 */ static void junior_rc_diag_flat_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4576,7 +4576,7 @@ static void junior_rc_diag_flat_to_left_bank_paint_setup( /** rct2: 0x008AB1D0 */ static void junior_rc_diag_flat_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4603,7 +4603,7 @@ static void junior_rc_diag_flat_to_right_bank_paint_setup( /** rct2: 0x008AB1E0 */ static void junior_rc_diag_left_bank_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4630,7 +4630,7 @@ static void junior_rc_diag_left_bank_to_flat_paint_setup( /** rct2: 0x008AB1F0 */ static void junior_rc_diag_right_bank_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4657,7 +4657,7 @@ static void junior_rc_diag_right_bank_to_flat_paint_setup( /** rct2: 0x008AB220 */ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4684,7 +4684,7 @@ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( /** rct2: 0x008AB230 */ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4711,7 +4711,7 @@ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( /** rct2: 0x008AB200 */ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4738,7 +4738,7 @@ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( /** rct2: 0x008AB210 */ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4765,7 +4765,7 @@ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( /** rct2: 0x008AB200 */ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4792,7 +4792,7 @@ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( /** rct2: 0x008AB210 */ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4819,7 +4819,7 @@ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( /** rct2: 0x008AB220 */ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4846,7 +4846,7 @@ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( /** rct2: 0x008AB230 */ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -4887,7 +4887,7 @@ static constexpr const CoordsXYZ junior_rc_diag_right_bank_bound_offsets[4] = { /** rct2: 0x008AB1A0 */ static void junior_rc_diag_left_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t thickness = direction == 0 ? 0 : 1; track_paint_util_diag_tiles_paint( @@ -4910,7 +4910,7 @@ static void junior_rc_diag_left_bank_paint_setup( /** rct2: 0x008AB1B0 */ static void junior_rc_diag_right_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t thickness = direction == 2 ? 0 : 1; track_paint_util_diag_tiles_paint( @@ -4955,7 +4955,7 @@ static constexpr const CoordsXY junior_rc_60_deg_up_bound_lengths[4] = { void junior_rc_paint_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -4998,19 +4998,19 @@ void junior_rc_paint_track_60_deg_up( static void junior_rc_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { @@ -5031,7 +5031,7 @@ static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4 void junior_rc_paint_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5093,24 +5093,24 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( static void junior_rc_25_deg_up_to_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_60_deg_down_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_25_deg_up_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_25_deg_up_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; @@ -5171,24 +5171,24 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( static void junior_rc_60_deg_up_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_25_deg_down_to_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_60_deg_up_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + junior_rc_60_deg_up_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5208,7 +5208,7 @@ void junior_rc_paint_track_diag_60_deg_up( void junior_rc_paint_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5229,7 +5229,7 @@ void junior_rc_paint_track_diag_60_deg_down( void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5250,7 +5250,7 @@ void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 1 && trackSequence == 3) { @@ -5282,7 +5282,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 3 && trackSequence == 0) { @@ -5314,7 +5314,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType) + const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -5335,61 +5335,61 @@ void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( static void junior_rc_diag_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_25_deg_up_to_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_up_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_25_deg_down_to_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } static void junior_rc_diag_60_deg_down_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } @@ -5425,11 +5425,11 @@ static constexpr const CoordsXY junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = static void junior_rc_flat_to_60_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0]; @@ -5487,18 +5487,18 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( static void junior_rc_60_deg_down_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_flat_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_flat_to_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void junior_rc_60_deg_up_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id = session->TrackColours[SCHEME_TRACK]; - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][0]; @@ -5555,90 +5555,90 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( static void junior_rc_flat_to_60_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_60_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_60_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /* rct2: 0x00518394 */ static void junior_rc_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00515629, 0x00514D22, 0x005151B9 */ static void paint_junior_rc_station_track( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_paint_station(session, ride, trackSequence, direction, height, tileElement, RIDE_TYPE_JUNIOR_ROLLER_COASTER); + junior_rc_paint_station(session, ride, trackSequence, direction, height, trackElement, RIDE_TYPE_JUNIOR_ROLLER_COASTER); } /* rct2: 0x0051881E */ static void junior_rc_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00518B42 */ static void junior_rc_flat_to_25_deg_up_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x00518E56 */ static void junior_rc_25_deg_up_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } /* rct2: 0x005189B0 */ static void junior_rc_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /* rct2: 0x00518FE8 */ static void junior_rc_flat_to_25_deg_down_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_25_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_25_deg_up_to_flat_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /* rct2: 0x00518CCC */ static void junior_rc_25_deg_down_to_flat_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_flat_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + junior_rc_flat_to_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void junior_rc_booster_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction & 1) { @@ -5668,7 +5668,7 @@ static void junior_rc_booster_paint_setup( static void junior_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = junior_rc_track_pieces_flat[0][direction] | session->TrackColours[SCHEME_TRACK]; constexpr const int8_t photoCameraOffset = -1; @@ -5712,7 +5712,7 @@ static void junior_rc_track_on_ride_photo( PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 20, 1, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3 + photoCameraOffset, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3 + photoCameraOffset, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48 + photoCameraOffset, 0x20); diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/JuniorRollerCoaster.h index 8da0ddbddf..d9bbcaaf66 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.h @@ -11,7 +11,6 @@ #define _JUNIOR_ROLLER_COASTER_H #include "../../common.h" -#include "../../paint/tile_element/Paint.TileElement.h" enum class JuniorRcChainType : uint8_t { @@ -21,97 +20,99 @@ enum class JuniorRcChainType : uint8_t }; struct Ride; +struct paint_session; +struct TrackElement; void junior_rc_paint_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, uint8_t rideType); + const TrackElement& trackElement, uint8_t rideType); void junior_rc_paint_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); void junior_rc_paint_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, - const TileElement* tileElement, JuniorRcChainType chainType); + const TrackElement& trackElement, JuniorRcChainType chainType); #endif // _JUNIOR_ROLLER_COASTER_H diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index 49bb2fc4ef..ff10ded6d7 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -21,11 +21,11 @@ /** rct2: 0x0082491C */ static void lay_down_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -80,7 +80,7 @@ static void lay_down_rc_track_flat( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -133,9 +133,9 @@ static void lay_down_rc_track_flat( /** rct2: 0x00824B8C, 0x00824B9C, 0x00824BAC */ static void lay_down_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->IsInverted()) + if (trackElement.IsInverted()) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 26557, SPR_STATION_INVERTED_BAR_A_SW_NE }, @@ -154,7 +154,7 @@ static void lay_down_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } else @@ -166,7 +166,7 @@ static void lay_down_rc_track_station( { 16237, 16233, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, @@ -181,7 +181,7 @@ static void lay_down_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 11); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -191,11 +191,11 @@ static void lay_down_rc_track_station( /** rct2: 0x0082492C */ static void lay_down_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -263,7 +263,7 @@ static void lay_down_rc_track_25_deg_up( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -356,11 +356,11 @@ static void lay_down_rc_track_25_deg_up( /** rct2: 0x0082493C */ static void lay_down_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -472,11 +472,11 @@ static void lay_down_rc_track_60_deg_up( /** rct2: 0x0082494C */ static void lay_down_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -544,7 +544,7 @@ static void lay_down_rc_track_flat_to_25_deg_up( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -637,11 +637,11 @@ static void lay_down_rc_track_flat_to_25_deg_up( /** rct2: 0x0082495C */ static void lay_down_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -767,11 +767,11 @@ static void lay_down_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x0082496C */ static void lay_down_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -921,11 +921,11 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0082497C */ static void lay_down_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -993,7 +993,7 @@ static void lay_down_rc_track_25_deg_up_to_flat( } else { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1086,57 +1086,57 @@ static void lay_down_rc_track_25_deg_up_to_flat( /** rct2: 0x0082498C */ static void lay_down_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0082499C */ static void lay_down_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008249AC */ static void lay_down_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008249BC */ static void lay_down_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008249CC */ static void lay_down_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008249DC */ static void lay_down_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008249EC */ static void lay_down_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1503,18 +1503,18 @@ static void lay_down_rc_track_left_quarter_turn_5( /** rct2: 0x008249FC */ static void lay_down_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824A0C */ static void lay_down_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1593,9 +1593,9 @@ static void lay_down_rc_track_flat_to_left_bank( /** rct2: 0x00824A1C */ static void lay_down_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1674,9 +1674,9 @@ static void lay_down_rc_track_flat_to_right_bank( /** rct2: 0x00824A2C */ static void lay_down_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1755,9 +1755,9 @@ static void lay_down_rc_track_left_bank_to_flat( /** rct2: 0x00824A3C */ static void lay_down_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1836,9 +1836,9 @@ static void lay_down_rc_track_right_bank_to_flat( /** rct2: 0x00824A4C */ static void lay_down_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2206,18 +2206,18 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00824A5C */ static void lay_down_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824A6C */ static void lay_down_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2327,9 +2327,9 @@ static void lay_down_rc_track_left_bank_to_25_deg_up( /** rct2: 0x00824A7C */ static void lay_down_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2439,9 +2439,9 @@ static void lay_down_rc_track_right_bank_to_25_deg_up( /** rct2: 0x00824A8C */ static void lay_down_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2551,9 +2551,9 @@ static void lay_down_rc_track_25_deg_up_to_left_bank( /** rct2: 0x00824A9C */ static void lay_down_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2663,41 +2663,41 @@ static void lay_down_rc_track_25_deg_up_to_right_bank( /** rct2: 0x00824AAC */ static void lay_down_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824ABC */ static void lay_down_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824ACC */ static void lay_down_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824ADC */ static void lay_down_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824AEC */ static void lay_down_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2772,17 +2772,17 @@ static void lay_down_rc_track_left_bank( /** rct2: 0x00824AFC */ static void lay_down_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824B0C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3124,9 +3124,9 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x00824B1C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3468,27 +3468,27 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x00824B2C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00824B3C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824B4C */ static void lay_down_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3813,9 +3813,9 @@ static void lay_down_rc_track_s_bend_left( /** rct2: 0x00824B5C */ static void lay_down_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4140,7 +4140,7 @@ static void lay_down_rc_track_s_bend_right( /** rct2: 0x00824B6C */ static void lay_down_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4419,7 +4419,7 @@ static void lay_down_rc_track_left_vertical_loop( /** rct2: 0x00824B7C */ static void lay_down_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4654,9 +4654,9 @@ static void lay_down_rc_track_right_vertical_loop( /** rct2: 0x00824BBC */ static void lay_down_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -4893,18 +4893,18 @@ static void lay_down_rc_track_left_quarter_turn_3( /** rct2: 0x00824BCC */ static void lay_down_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824BDC */ static void lay_down_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5147,18 +5147,18 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00824BEC */ static void lay_down_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824BFC */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5327,9 +5327,9 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x00824C0C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5504,25 +5504,25 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x00824C1C */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00824C2C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824C9C */ static void lay_down_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5744,7 +5744,7 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( /** rct2: 0x00824CAC */ static void lay_down_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5966,7 +5966,7 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( /** rct2: 0x00824CBC */ static void lay_down_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5974,13 +5974,13 @@ static void lay_down_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00824CCC */ static void lay_down_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -5988,13 +5988,13 @@ static void lay_down_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lay_down_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824CDC */ static void lay_down_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6340,7 +6340,7 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( /** rct2: 0x00824CEC */ static void lay_down_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6686,7 +6686,7 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( /** rct2: 0x00824CFC */ static void lay_down_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6694,13 +6694,13 @@ static void lay_down_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00824D0C */ static void lay_down_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -6708,15 +6708,15 @@ static void lay_down_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lay_down_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824D3C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6792,9 +6792,9 @@ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x00824D1C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6871,25 +6871,25 @@ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x00824D2C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + lay_down_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00824D4C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lay_down_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00824D5C */ static void lay_down_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6948,9 +6948,9 @@ static void lay_down_rc_track_brakes( /** rct2: 0x00824D6C */ static void lay_down_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -6995,7 +6995,7 @@ static void lay_down_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 16225, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -7049,7 +7049,7 @@ static void lay_down_rc_track_on_ride_photo( height + 24); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); @@ -7059,9 +7059,9 @@ static void lay_down_rc_track_on_ride_photo( /** rct2: 0x00824D8C */ static void lay_down_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7373,9 +7373,9 @@ static void lay_down_rc_track_left_eighth_to_diag( /** rct2: 0x00824D9C */ static void lay_down_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7687,27 +7687,27 @@ static void lay_down_rc_track_right_eighth_to_diag( /** rct2: 0x00824DAC */ static void lay_down_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824DBC */ static void lay_down_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + lay_down_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x00824DCC */ static void lay_down_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8020,9 +8020,9 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00824DDC */ static void lay_down_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8335,32 +8335,32 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00824DEC */ static void lay_down_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lay_down_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00824DFC */ static void lay_down_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lay_down_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + lay_down_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x00824D7C */ static void lay_down_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8388,7 +8388,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8416,7 +8416,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8444,7 +8444,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8506,7 +8506,7 @@ static void lay_down_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8534,7 +8534,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8562,7 +8562,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8590,7 +8590,7 @@ static void lay_down_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8645,14 +8645,14 @@ static void lay_down_rc_track_diag_flat( /** rct2: 0x00824E2C */ static void lay_down_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8680,7 +8680,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8708,7 +8708,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8736,7 +8736,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8798,7 +8798,7 @@ static void lay_down_rc_track_diag_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8826,7 +8826,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8854,7 +8854,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8882,7 +8882,7 @@ static void lay_down_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8937,14 +8937,14 @@ static void lay_down_rc_track_diag_25_deg_up( /** rct2: 0x00824E8C */ static void lay_down_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8972,7 +8972,7 @@ static void lay_down_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9000,7 +9000,7 @@ static void lay_down_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9028,7 +9028,7 @@ static void lay_down_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9173,14 +9173,14 @@ static void lay_down_rc_track_diag_60_deg_up( /** rct2: 0x00824E0C */ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9208,7 +9208,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9236,7 +9236,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9264,7 +9264,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9326,7 +9326,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9354,7 +9354,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9382,7 +9382,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9410,7 +9410,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9465,14 +9465,14 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00824E6C */ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9500,7 +9500,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9528,7 +9528,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9556,7 +9556,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9701,14 +9701,14 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x00824E7C */ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9736,7 +9736,7 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9764,7 +9764,7 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9792,7 +9792,7 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9937,14 +9937,14 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00824E1C */ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9972,7 +9972,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10000,7 +10000,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10028,7 +10028,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10090,7 +10090,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10118,7 +10118,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10146,7 +10146,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10174,7 +10174,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10229,14 +10229,14 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00824E5C */ static void lay_down_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10264,7 +10264,7 @@ static void lay_down_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10292,7 +10292,7 @@ static void lay_down_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10320,7 +10320,7 @@ static void lay_down_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10465,14 +10465,14 @@ static void lay_down_rc_track_diag_25_deg_down( /** rct2: 0x00824EBC */ static void lay_down_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10500,7 +10500,7 @@ static void lay_down_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10528,7 +10528,7 @@ static void lay_down_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10556,7 +10556,7 @@ static void lay_down_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10701,14 +10701,14 @@ static void lay_down_rc_track_diag_60_deg_down( /** rct2: 0x00824E3C */ static void lay_down_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10735,7 +10735,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10762,7 +10762,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10789,7 +10789,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10930,14 +10930,14 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x00824E9C */ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10965,7 +10965,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -10993,7 +10993,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11021,7 +11021,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11166,14 +11166,14 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x00824EAC */ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11201,7 +11201,7 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11229,7 +11229,7 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11257,7 +11257,7 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11402,14 +11402,14 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00824E4C */ static void lay_down_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11437,7 +11437,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11465,7 +11465,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11493,7 +11493,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -11638,9 +11638,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00824EEC */ static void lay_down_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11808,9 +11808,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( /** rct2: 0x00824EFC */ static void lay_down_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11978,9 +11978,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( /** rct2: 0x00824F0C */ static void lay_down_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12148,9 +12148,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( /** rct2: 0x00824F1C */ static void lay_down_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12318,9 +12318,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( /** rct2: 0x00824F4C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12487,9 +12487,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00824F5C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12656,9 +12656,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00824F2C */ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12825,9 +12825,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00824F3C */ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12994,9 +12994,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00824F6C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13156,9 +13156,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x00824F7C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13318,9 +13318,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x00824F8C */ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13487,9 +13487,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x00824F9C */ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13656,9 +13656,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x00824ECC */ static void lay_down_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13823,9 +13823,9 @@ static void lay_down_rc_track_diag_left_bank( /** rct2: 0x00824EDC */ static void lay_down_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -13990,7 +13990,7 @@ static void lay_down_rc_track_diag_right_bank( /** rct2: 0x00824FAC */ static void lay_down_rc_track_left_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14102,7 +14102,7 @@ static void lay_down_rc_track_left_flyer_twist_up( /** rct2: 0x00824FBC */ static void lay_down_rc_track_right_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14212,7 +14212,7 @@ static void lay_down_rc_track_right_flyer_twist_up( /** rct2: 0x00824FCC */ static void lay_down_rc_track_left_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14324,7 +14324,7 @@ static void lay_down_rc_track_left_flyer_twist_down( /** rct2: 0x00824FDC */ static void lay_down_rc_track_right_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14434,7 +14434,7 @@ static void lay_down_rc_track_right_flyer_twist_down( /** rct2: 0x00824C3C */ static void lay_down_rc_track_flyer_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14564,7 +14564,7 @@ static void lay_down_rc_track_flyer_half_loop_up( /** rct2: 0x00824C4C */ static void lay_down_rc_track_flyer_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14694,7 +14694,7 @@ static void lay_down_rc_track_flyer_half_loop_down( /** rct2: 0x00824C5C */ static void lay_down_rc_track_left_flyer_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14821,7 +14821,7 @@ static void lay_down_rc_track_left_flyer_corkscrew_up( /** rct2: 0x00824C6C */ static void lay_down_rc_track_right_flyer_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -14935,7 +14935,7 @@ static void lay_down_rc_track_right_flyer_corkscrew_up( /** rct2: 0x00824C7C */ static void lay_down_rc_track_left_flyer_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -15049,17 +15049,17 @@ static void lay_down_rc_track_left_flyer_corkscrew_down( /** rct2: 0x00824C8C */ static void lay_down_rc_track_right_flyer_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lay_down_rc_track_left_flyer_corkscrew_up(session, ride, 2 - trackSequence, (direction + 3) % 4, height, tileElement); + lay_down_rc_track_left_flyer_corkscrew_up(session, ride, 2 - trackSequence, (direction + 3) % 4, height, trackElement); } /** rct2: 0x00824FEC */ static void lay_down_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -15114,7 +15114,7 @@ static void lay_down_rc_track_block_brakes( static void lay_down_rc_track_left_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -15298,7 +15298,7 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( static void lay_down_rc_track_right_quarter_banked_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -15482,7 +15482,7 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( static void lay_down_rc_track_left_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -15666,7 +15666,7 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( static void lay_down_rc_track_right_quarter_banked_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index 9ce8f01ec5..dd12054889 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -33,7 +33,7 @@ static constexpr const uint32_t _LimLauncherBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A6D50, 0x008A6D60, 0x008A6D70 */ static void lim_launched_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 15018, SPR_STATION_BASE_B_SW_NE }, @@ -42,9 +42,9 @@ static void lim_launched_rc_track_station( { 15019, SPR_STATION_BASE_B_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _LimLauncherBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -58,7 +58,7 @@ static void lim_launched_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -67,7 +67,7 @@ static void lim_launched_rc_track_station( /** rct2: 0x008A65E0 */ static void lim_launched_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -330,7 +330,7 @@ static void lim_launched_rc_track_left_vertical_loop( /** rct2: 0x008A65F0 */ static void lim_launched_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -547,7 +547,7 @@ static void lim_launched_rc_track_right_vertical_loop( /** rct2: 0x008A6D10 */ static void lim_launched_rc_track_left_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -684,7 +684,7 @@ static void lim_launched_rc_track_left_twist_down_to_up( /** rct2: 0x008A6D20 */ static void lim_launched_rc_track_right_twist_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -821,7 +821,7 @@ static void lim_launched_rc_track_right_twist_down_to_up( /** rct2: 0x008A6D30 */ static void lim_launched_rc_track_left_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -958,7 +958,7 @@ static void lim_launched_rc_track_left_twist_up_to_down( /** rct2: 0x008A6D40 */ static void lim_launched_rc_track_right_twist_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1095,7 +1095,7 @@ static void lim_launched_rc_track_right_twist_up_to_down( /** rct2: 0x008A6CD0 */ static void lim_launched_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1207,7 +1207,7 @@ static void lim_launched_rc_track_left_corkscrew_up( /** rct2: 0x008A6CE0 */ static void lim_launched_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1320,23 +1320,23 @@ static void lim_launched_rc_track_right_corkscrew_up( /** rct2: 0x008A6CF0 */ static void lim_launched_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lim_launched_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + lim_launched_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6D00 */ static void lim_launched_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lim_launched_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + lim_launched_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6D80 */ static void lim_launched_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1364,7 +1364,7 @@ static void lim_launched_rc_track_brakes( /** rct2: 0x008A6C10 */ static void lim_launched_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1405,15 +1405,15 @@ static void lim_launched_rc_track_90_deg_up( /** rct2: 0x008A6C20 */ static void lim_launched_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lim_launched_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lim_launched_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6C30 */ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1456,15 +1456,15 @@ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008A6C40 */ static void lim_launched_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lim_launched_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + lim_launched_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6C50 */ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1502,7 +1502,7 @@ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x008A6C60 */ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1546,7 +1546,7 @@ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008A6C70 */ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1644,18 +1644,18 @@ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( /** rct2: 0x008A6C80 */ static void lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - session, ride, 2 - trackSequence, direction, height, tileElement); + session, ride, 2 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A6D90 */ static void lim_launched_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _LimLauncherBlockBrakeImages[direction][isClosed], 0, 0, 32, 20, 3, height, 0, 6, height); @@ -1672,7 +1672,7 @@ static void lim_launched_rc_track_block_brakes( static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1719,7 +1719,7 @@ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CA0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1766,18 +1766,19 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CB0 */ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { lim_launched_rc_track_right_quarter_turn_1_90_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6CC0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - lim_launched_rc_track_left_quarter_turn_1_90_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + lim_launched_rc_track_left_quarter_turn_1_90_deg_up( + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index eaa0da5603..0df9ecab8a 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -24,9 +24,9 @@ /** rct2: 0x008A6370 */ static void looping_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -80,7 +80,7 @@ static void looping_rc_track_flat( static void looping_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint32_t stationTrackNESW = is_csg_loaded() ? LOOPING_RC_BOOSTER_NE_SW : 15016; const uint32_t stationTrackNWSE = is_csg_loaded() ? LOOPING_RC_BOOSTER_NW_SE : 15017; @@ -98,7 +98,7 @@ static void looping_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -107,9 +107,9 @@ static void looping_rc_track_station( /** rct2: 0x008A6380 */ static void looping_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -177,9 +177,9 @@ static void looping_rc_track_25_deg_up( /** rct2: 0x008A6390 */ static void looping_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -247,9 +247,9 @@ static void looping_rc_track_60_deg_up( /** rct2: 0x008A63A0 */ static void looping_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -317,9 +317,9 @@ static void looping_rc_track_flat_to_25_deg_up( /** rct2: 0x008A63B0 */ static void looping_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -395,9 +395,9 @@ static void looping_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A63C0 */ static void looping_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -473,9 +473,9 @@ static void looping_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A63D0 */ static void looping_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -543,55 +543,55 @@ static void looping_rc_track_25_deg_up_to_flat( /** rct2: 0x008A63E0 */ static void looping_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A63F0 */ static void looping_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6400 */ static void looping_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6410 */ static void looping_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6420 */ static void looping_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6430 */ static void looping_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6440 */ static void looping_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -755,16 +755,16 @@ static void looping_rc_track_left_quarter_turn_5( /** rct2: 0x008A6450 */ static void looping_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6460 */ static void looping_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -802,7 +802,7 @@ static void looping_rc_track_flat_to_left_bank( /** rct2: 0x008A6470 */ static void looping_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -840,7 +840,7 @@ static void looping_rc_track_flat_to_right_bank( /** rct2: 0x008A6480 */ static void looping_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -878,7 +878,7 @@ static void looping_rc_track_left_bank_to_flat( /** rct2: 0x008A6490 */ static void looping_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -916,7 +916,7 @@ static void looping_rc_track_right_bank_to_flat( /** rct2: 0x008A64A0 */ static void looping_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1090,16 +1090,16 @@ static void looping_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A64B0 */ static void looping_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A64C0 */ static void looping_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1144,7 +1144,7 @@ static void looping_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A64D0 */ static void looping_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1189,7 +1189,7 @@ static void looping_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A64E0 */ static void looping_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1234,7 +1234,7 @@ static void looping_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A64F0 */ static void looping_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1279,39 +1279,39 @@ static void looping_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A6500 */ static void looping_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6510 */ static void looping_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6520 */ static void looping_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6530 */ static void looping_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6540 */ static void looping_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1345,15 +1345,15 @@ static void looping_rc_track_left_bank( /** rct2: 0x008A6550 */ static void looping_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6560 */ static void looping_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1517,7 +1517,7 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A6570 */ static void looping_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1681,25 +1681,25 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A6580 */ static void looping_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6590 */ static void looping_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A65A0 */ static void looping_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1834,7 +1834,7 @@ static void looping_rc_track_s_bend_left( /** rct2: 0x008A65B0 */ static void looping_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1969,7 +1969,7 @@ static void looping_rc_track_s_bend_right( /** rct2: 0x008A65C0 */ static void looping_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2256,7 +2256,7 @@ static void looping_rc_track_left_vertical_loop( /** rct2: 0x008A65D0 */ static void looping_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2511,7 +2511,7 @@ static void looping_rc_track_right_vertical_loop( /** rct2: 0x008A6630 */ static void looping_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2614,16 +2614,16 @@ static void looping_rc_track_left_quarter_turn_3( /** rct2: 0x008A6640 */ static void looping_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6650 */ static void looping_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2735,16 +2735,16 @@ static void looping_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A6660 */ static void looping_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6670 */ static void looping_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2823,7 +2823,7 @@ static void looping_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A6680 */ static void looping_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2909,25 +2909,25 @@ static void looping_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A6690 */ static void looping_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A66A0 */ static void looping_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A66B0 */ static void looping_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3145,7 +3145,7 @@ static void looping_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A66C0 */ static void looping_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3363,7 +3363,7 @@ static void looping_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A66D0 */ static void looping_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3371,13 +3371,13 @@ static void looping_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A66E0 */ static void looping_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3385,13 +3385,13 @@ static void looping_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - looping_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A66F0 */ static void looping_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3733,7 +3733,7 @@ static void looping_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A6700 */ static void looping_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4075,7 +4075,7 @@ static void looping_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A6710 */ static void looping_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4083,13 +4083,13 @@ static void looping_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6720 */ static void looping_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4097,13 +4097,13 @@ static void looping_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - looping_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6750 */ static void looping_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4140,7 +4140,7 @@ static void looping_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A6730 */ static void looping_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4177,23 +4177,23 @@ static void looping_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A6740 */ static void looping_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + looping_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6760 */ static void looping_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + looping_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6770 */ static void looping_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4225,7 +4225,7 @@ static void looping_rc_track_brakes( /** rct2: 0x008A6A40 */ static void looping_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4266,7 +4266,7 @@ static void looping_rc_track_25_deg_up_left_banked( /** rct2: 0x008A6A50 */ static void looping_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4307,7 +4307,7 @@ static void looping_rc_track_25_deg_up_right_banked( /** rct2: 0x008A6780 */ static void looping_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4344,7 +4344,7 @@ static void looping_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -4353,23 +4353,23 @@ static void looping_rc_track_on_ride_photo( /** rct2: 0x008A6A60 */ static void looping_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6A70 */ static void looping_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6860 */ static void looping_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4508,7 +4508,7 @@ static void looping_rc_track_left_eighth_to_diag( /** rct2: 0x008A6870 */ static void looping_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4646,25 +4646,25 @@ static void looping_rc_track_right_eighth_to_diag( /** rct2: 0x008A6880 */ static void looping_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6890 */ static void looping_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + looping_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A68A0 */ static void looping_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4806,7 +4806,7 @@ static void looping_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A68B0 */ static void looping_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4948,30 +4948,30 @@ static void looping_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A68C0 */ static void looping_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A68D0 */ static void looping_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - looping_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + looping_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A6790 */ static void looping_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4998,7 +4998,7 @@ static void looping_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5025,7 +5025,7 @@ static void looping_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5052,7 +5052,7 @@ static void looping_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5112,12 +5112,12 @@ static void looping_rc_track_diag_flat( /** rct2: 0x008A67C0 */ static void looping_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5144,7 +5144,7 @@ static void looping_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5171,7 +5171,7 @@ static void looping_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5198,7 +5198,7 @@ static void looping_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5258,12 +5258,12 @@ static void looping_rc_track_diag_25_deg_up( /** rct2: 0x008A67F0 */ static void looping_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5290,7 +5290,7 @@ static void looping_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5317,7 +5317,7 @@ static void looping_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5344,7 +5344,7 @@ static void looping_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5404,12 +5404,12 @@ static void looping_rc_track_diag_60_deg_up( /** rct2: 0x008A67A0 */ static void looping_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5436,7 +5436,7 @@ static void looping_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5463,7 +5463,7 @@ static void looping_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5490,7 +5490,7 @@ static void looping_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5550,12 +5550,12 @@ static void looping_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A67D0 */ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5582,7 +5582,7 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5609,7 +5609,7 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5636,7 +5636,7 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5696,12 +5696,12 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A67E0 */ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5728,7 +5728,7 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5755,7 +5755,7 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5782,7 +5782,7 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5842,12 +5842,12 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A67B0 */ static void looping_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5874,7 +5874,7 @@ static void looping_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5901,7 +5901,7 @@ static void looping_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5928,7 +5928,7 @@ static void looping_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5988,12 +5988,12 @@ static void looping_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A6820 */ static void looping_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6020,7 +6020,7 @@ static void looping_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6047,7 +6047,7 @@ static void looping_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6074,7 +6074,7 @@ static void looping_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6134,12 +6134,12 @@ static void looping_rc_track_diag_25_deg_down( /** rct2: 0x008A6850 */ static void looping_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6166,7 +6166,7 @@ static void looping_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6193,7 +6193,7 @@ static void looping_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6220,7 +6220,7 @@ static void looping_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6280,12 +6280,12 @@ static void looping_rc_track_diag_60_deg_down( /** rct2: 0x008A6800 */ static void looping_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6311,7 +6311,7 @@ static void looping_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6337,7 +6337,7 @@ static void looping_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6363,7 +6363,7 @@ static void looping_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6424,12 +6424,12 @@ static void looping_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A6830 */ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6456,7 +6456,7 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6483,7 +6483,7 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6510,7 +6510,7 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6570,12 +6570,12 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A6840 */ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6602,7 +6602,7 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6629,7 +6629,7 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6656,7 +6656,7 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6716,12 +6716,12 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A6810 */ static void looping_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6748,7 +6748,7 @@ static void looping_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6775,7 +6775,7 @@ static void looping_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6802,7 +6802,7 @@ static void looping_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6862,7 +6862,7 @@ static void looping_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A6900 */ static void looping_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6941,7 +6941,7 @@ static void looping_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A6910 */ static void looping_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7020,7 +7020,7 @@ static void looping_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A6920 */ static void looping_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7099,7 +7099,7 @@ static void looping_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A6930 */ static void looping_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7178,7 +7178,7 @@ static void looping_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A6960 */ static void looping_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7257,7 +7257,7 @@ static void looping_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A6970 */ static void looping_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7336,7 +7336,7 @@ static void looping_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A6940 */ static void looping_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7415,7 +7415,7 @@ static void looping_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A6950 */ static void looping_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7494,7 +7494,7 @@ static void looping_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A6980 */ static void looping_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7571,7 +7571,7 @@ static void looping_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A6990 */ static void looping_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7648,7 +7648,7 @@ static void looping_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A69A0 */ static void looping_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7727,7 +7727,7 @@ static void looping_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A69B0 */ static void looping_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7806,7 +7806,7 @@ static void looping_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A68E0 */ static void looping_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7882,7 +7882,7 @@ static void looping_rc_track_diag_left_bank( /** rct2: 0x008A68F0 */ static void looping_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7958,7 +7958,7 @@ static void looping_rc_track_diag_right_bank( /** rct2: 0x008A6C00 */ static void looping_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7990,7 +7990,7 @@ static void looping_rc_track_block_brakes( /** rct2: 0x008A6BC0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8072,7 +8072,7 @@ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A6BD0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8161,27 +8161,27 @@ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A6BE0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; looping_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6BF0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; looping_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6B80 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8351,7 +8351,7 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A6B90 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8521,27 +8521,27 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A6BA0 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; looping_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A6BB0 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; looping_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A6A80 */ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8584,7 +8584,7 @@ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A6A90 */ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8627,7 +8627,7 @@ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A6AA0 */ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8670,7 +8670,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A6AB0 */ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8713,41 +8713,43 @@ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A6AC0 */ static void looping_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_right_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6AD0 */ static void looping_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_banked_25_deg_up_to_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6AE0 */ static void looping_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_25_deg_up_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6AF0 */ static void looping_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_25_deg_up_to_left_banked_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6B00 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8788,7 +8790,7 @@ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A6B10 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8829,7 +8831,7 @@ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A6B40 */ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8870,7 +8872,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A6B50 */ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8911,43 +8913,43 @@ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A6B60 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6B70 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6B20 */ static void looping_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6B30 */ static void looping_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A69C0 */ static void looping_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8990,7 +8992,7 @@ static void looping_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A69D0 */ static void looping_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9033,7 +9035,7 @@ static void looping_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A69E0 */ static void looping_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9076,7 +9078,7 @@ static void looping_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A69F0 */ static void looping_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -9119,42 +9121,42 @@ static void looping_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A6A00 */ static void looping_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6A10 */ static void looping_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6A20 */ static void looping_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A6A30 */ static void looping_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - looping_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + looping_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void looping_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (!is_csg_loaded()) { - looping_rc_track_brakes(session, ride, trackSequence, direction, height, tileElement); + looping_rc_track_brakes(session, ride, trackSequence, direction, height, trackElement); return; } diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index 013135ab15..8bcb786a83 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -21,7 +21,7 @@ /** rct2: 0x008B08D0 */ static void mine_ride_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -54,7 +54,7 @@ static void mine_ride_track_flat( static void mine_ride_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { 19338, SPR_STATION_BASE_A_SW_NE }, @@ -69,7 +69,7 @@ static void mine_ride_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -78,7 +78,7 @@ static void mine_ride_track_station( /** rct2: 0x008B08E0 */ static void mine_ride_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -135,7 +135,7 @@ static void mine_ride_track_25_deg_up( /** rct2: 0x008B08F0 */ static void mine_ride_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -192,7 +192,7 @@ static void mine_ride_track_flat_to_25_deg_up( /** rct2: 0x008B0900 */ static void mine_ride_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -249,31 +249,31 @@ static void mine_ride_track_25_deg_up_to_flat( /** rct2: 0x008B0910 */ static void mine_ride_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0920 */ static void mine_ride_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0930 */ static void mine_ride_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0940 */ static void mine_ride_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -451,16 +451,16 @@ static void mine_ride_track_left_quarter_turn_5( /** rct2: 0x008B0950 */ static void mine_ride_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B0960 */ static void mine_ride_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -514,7 +514,7 @@ static void mine_ride_track_flat_to_left_bank( /** rct2: 0x008B0970 */ static void mine_ride_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -568,7 +568,7 @@ static void mine_ride_track_flat_to_right_bank( /** rct2: 0x008B0980 */ static void mine_ride_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -622,7 +622,7 @@ static void mine_ride_track_left_bank_to_flat( /** rct2: 0x008B0990 */ static void mine_ride_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -676,7 +676,7 @@ static void mine_ride_track_right_bank_to_flat( /** rct2: 0x008B09A0 */ static void mine_ride_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -864,16 +864,16 @@ static void mine_ride_track_banked_left_quarter_turn_5( /** rct2: 0x008B09B0 */ static void mine_ride_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B09C0 */ static void mine_ride_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -934,7 +934,7 @@ static void mine_ride_track_left_bank_to_25_deg_up( /** rct2: 0x008B09D0 */ static void mine_ride_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -995,7 +995,7 @@ static void mine_ride_track_right_bank_to_25_deg_up( /** rct2: 0x008B09E0 */ static void mine_ride_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1056,7 +1056,7 @@ static void mine_ride_track_25_deg_up_to_left_bank( /** rct2: 0x008B09F0 */ static void mine_ride_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1117,39 +1117,39 @@ static void mine_ride_track_25_deg_up_to_right_bank( /** rct2: 0x008B0A00 */ static void mine_ride_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0A10 */ static void mine_ride_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0A20 */ static void mine_ride_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0A30 */ static void mine_ride_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0A40 */ static void mine_ride_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1199,15 +1199,15 @@ static void mine_ride_track_left_bank( /** rct2: 0x008B0A50 */ static void mine_ride_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_ride_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0A60 */ static void mine_ride_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1356,7 +1356,7 @@ static void mine_ride_track_s_bend_left( /** rct2: 0x008B0A70 */ static void mine_ride_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1505,7 +1505,7 @@ static void mine_ride_track_s_bend_right( /** rct2: 0x008B0AB0 */ static void mine_ride_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1622,16 +1622,16 @@ static void mine_ride_track_left_quarter_turn_3( /** rct2: 0x008B0AC0 */ static void mine_ride_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B0AD0 */ static void mine_ride_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1757,16 +1757,16 @@ static void mine_ride_track_left_quarter_turn_3_bank( /** rct2: 0x008B0AE0 */ static void mine_ride_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B0AF0 */ static void mine_ride_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2012,7 +2012,7 @@ static void mine_ride_track_left_half_banked_helix_up_small( /** rct2: 0x008B0B00 */ static void mine_ride_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2258,7 +2258,7 @@ static void mine_ride_track_right_half_banked_helix_up_small( /** rct2: 0x008B0B10 */ static void mine_ride_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2266,13 +2266,13 @@ static void mine_ride_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mine_ride_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008B0B20 */ static void mine_ride_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -2280,13 +2280,13 @@ static void mine_ride_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_ride_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B0B30 */ static void mine_ride_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2656,7 +2656,7 @@ static void mine_ride_track_left_half_banked_helix_up_large( /** rct2: 0x008B0B40 */ static void mine_ride_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3026,7 +3026,7 @@ static void mine_ride_track_right_half_banked_helix_up_large( /** rct2: 0x008B0B50 */ static void mine_ride_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3034,13 +3034,13 @@ static void mine_ride_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mine_ride_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008B0B60 */ static void mine_ride_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3048,13 +3048,13 @@ static void mine_ride_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_ride_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_ride_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008B0B70 */ static void mine_ride_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3091,7 +3091,7 @@ static void mine_ride_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 19339, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -3100,7 +3100,7 @@ static void mine_ride_track_on_ride_photo( /** rct2: 0x008B0B90 */ static void mine_ride_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3246,7 +3246,7 @@ static void mine_ride_track_left_eighth_to_diag( /** rct2: 0x008B0BA0 */ static void mine_ride_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3391,25 +3391,25 @@ static void mine_ride_track_right_eighth_to_diag( /** rct2: 0x008B0BB0 */ static void mine_ride_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0BC0 */ static void mine_ride_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mine_ride_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008B0BD0 */ static void mine_ride_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3558,7 +3558,7 @@ static void mine_ride_track_left_eighth_bank_to_diag( /** rct2: 0x008B0BE0 */ static void mine_ride_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3707,25 +3707,25 @@ static void mine_ride_track_right_eighth_bank_to_diag( /** rct2: 0x008B0BF0 */ static void mine_ride_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_ride_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008B0C00 */ static void mine_ride_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_ride_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mine_ride_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008B0B80 */ static void mine_ride_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3801,7 +3801,7 @@ static void mine_ride_track_diag_flat( /** rct2: 0x008B0C30 */ static void mine_ride_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3877,7 +3877,7 @@ static void mine_ride_track_diag_25_deg_up( /** rct2: 0x008B0C10 */ static void mine_ride_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3953,7 +3953,7 @@ static void mine_ride_track_diag_flat_to_25_deg_up( /** rct2: 0x008B0C20 */ static void mine_ride_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4029,7 +4029,7 @@ static void mine_ride_track_diag_25_deg_up_to_flat( /** rct2: 0x008B0C60 */ static void mine_ride_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4105,7 +4105,7 @@ static void mine_ride_track_diag_25_deg_down( /** rct2: 0x008B0C40 */ static void mine_ride_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4179,7 +4179,7 @@ static void mine_ride_track_diag_flat_to_25_deg_down( /** rct2: 0x008B0C50 */ static void mine_ride_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4255,7 +4255,7 @@ static void mine_ride_track_diag_25_deg_down_to_flat( /** rct2: 0x008B0C90 */ static void mine_ride_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4334,7 +4334,7 @@ static void mine_ride_track_diag_flat_to_left_bank( /** rct2: 0x008B0CA0 */ static void mine_ride_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4413,7 +4413,7 @@ static void mine_ride_track_diag_flat_to_right_bank( /** rct2: 0x008B0CB0 */ static void mine_ride_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4492,7 +4492,7 @@ static void mine_ride_track_diag_left_bank_to_flat( /** rct2: 0x008B0CC0 */ static void mine_ride_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4571,7 +4571,7 @@ static void mine_ride_track_diag_right_bank_to_flat( /** rct2: 0x008B0CF0 */ static void mine_ride_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4650,7 +4650,7 @@ static void mine_ride_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008B0D00 */ static void mine_ride_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4729,7 +4729,7 @@ static void mine_ride_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008B0CD0 */ static void mine_ride_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4808,7 +4808,7 @@ static void mine_ride_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008B0CE0 */ static void mine_ride_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4887,7 +4887,7 @@ static void mine_ride_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008B0D10 */ static void mine_ride_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4964,7 +4964,7 @@ static void mine_ride_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008B0D20 */ static void mine_ride_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5041,7 +5041,7 @@ static void mine_ride_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008B0D30 */ static void mine_ride_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5120,7 +5120,7 @@ static void mine_ride_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008B0D40 */ static void mine_ride_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5199,7 +5199,7 @@ static void mine_ride_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008B0C70 */ static void mine_ride_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5275,7 +5275,7 @@ static void mine_ride_track_diag_left_bank( /** rct2: 0x008B0C80 */ static void mine_ride_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index 00d9d4be91..104dbbc076 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -33,9 +33,9 @@ static constexpr const uint32_t _MineTrainBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x0071BFA4 */ static void mine_train_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -87,7 +87,7 @@ static void mine_train_rc_track_flat( /** rct2: 0x0071C154, 0x0071C164, 0x0071C174 */ static void mine_train_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 20064, SPR_STATION_BASE_B_SW_NE }, @@ -99,9 +99,9 @@ static void mine_train_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height - 2, 0, 2, height); - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsChildRotated( session, direction, _MineTrainBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 0, height); @@ -113,7 +113,7 @@ static void mine_train_rc_track_station( height); } track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -122,9 +122,9 @@ static void mine_train_rc_track_station( /** rct2: 0x0071BFB4 */ static void mine_train_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -191,7 +191,7 @@ static void mine_train_rc_track_25_deg_up( /** rct2: 0x0071BFC4 */ static void mine_train_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -231,9 +231,9 @@ static void mine_train_rc_track_60_deg_up( /** rct2: 0x0071BFD4 */ static void mine_train_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -300,7 +300,7 @@ static void mine_train_rc_track_flat_to_25_deg_up( /** rct2: 0x0071BFE4 */ static void mine_train_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -344,7 +344,7 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x0071BFF4 */ static void mine_train_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -388,9 +388,9 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x0071C004 */ static void mine_train_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -457,55 +457,55 @@ static void mine_train_rc_track_25_deg_up_to_flat( /** rct2: 0x0071C014 */ static void mine_train_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C024 */ static void mine_train_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C034 */ static void mine_train_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C044 */ static void mine_train_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C054 */ static void mine_train_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C064 */ static void mine_train_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C0B4 */ static void mine_train_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -693,16 +693,16 @@ static void mine_train_rc_track_left_quarter_turn_5( /** rct2: 0x0071C0C4 */ static void mine_train_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C074 */ static void mine_train_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -739,7 +739,7 @@ static void mine_train_rc_track_flat_to_left_bank( /** rct2: 0x0071C084 */ static void mine_train_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -776,7 +776,7 @@ static void mine_train_rc_track_flat_to_right_bank( /** rct2: 0x0071C094 */ static void mine_train_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -813,7 +813,7 @@ static void mine_train_rc_track_left_bank_to_flat( /** rct2: 0x0071C0A4 */ static void mine_train_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -850,7 +850,7 @@ static void mine_train_rc_track_right_bank_to_flat( /** rct2: 0x0071C0D4 */ static void mine_train_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1048,16 +1048,16 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( /** rct2: 0x0071C0E4 */ static void mine_train_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C204 */ static void mine_train_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1101,7 +1101,7 @@ static void mine_train_rc_track_left_bank_to_25_deg_up( /** rct2: 0x0071C214 */ static void mine_train_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1145,7 +1145,7 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( /** rct2: 0x0071C224 */ static void mine_train_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1189,7 +1189,7 @@ static void mine_train_rc_track_25_deg_up_to_left_bank( /** rct2: 0x0071C234 */ static void mine_train_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1233,39 +1233,39 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( /** rct2: 0x0071C244 */ static void mine_train_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C254 */ static void mine_train_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C264 */ static void mine_train_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C274 */ static void mine_train_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C304 */ static void mine_train_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1298,15 +1298,15 @@ static void mine_train_rc_track_left_bank( /** rct2: 0x0071C314 */ static void mine_train_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mine_train_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C0F4 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1494,7 +1494,7 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x0071C104 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1682,25 +1682,25 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x0071C114 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mine_train_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x0071C124 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C134 */ static void mine_train_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1839,7 +1839,7 @@ static void mine_train_rc_track_s_bend_left( /** rct2: 0x0071C144 */ static void mine_train_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1978,7 +1978,7 @@ static void mine_train_rc_track_s_bend_right( /** rct2: 0x0071C184 */ static void mine_train_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2100,16 +2100,16 @@ static void mine_train_rc_track_left_quarter_turn_3( /** rct2: 0x0071C194 */ static void mine_train_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C1A4 */ static void mine_train_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2240,16 +2240,16 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( /** rct2: 0x0071C1B4 */ static void mine_train_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C1C4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2349,7 +2349,7 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x0071C1D4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2449,25 +2449,25 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x0071C1E4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mine_train_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x0071C1F4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C284 */ static void mine_train_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2735,7 +2735,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( /** rct2: 0x0071C294 */ static void mine_train_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3003,7 +3003,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( /** rct2: 0x0071C2A4 */ static void mine_train_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3012,13 +3012,13 @@ static void mine_train_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; mine_train_rc_track_right_half_banked_helix_up_small( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x0071C2B4 */ static void mine_train_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3026,13 +3026,14 @@ static void mine_train_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mine_train_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_half_banked_helix_up_small( + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C2C4 */ static void mine_train_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3442,7 +3443,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( /** rct2: 0x0071C2D4 */ static void mine_train_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3840,7 +3841,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( /** rct2: 0x0071C2E4 */ static void mine_train_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3849,13 +3850,13 @@ static void mine_train_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; mine_train_rc_track_right_half_banked_helix_up_large( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x0071C2F4 */ static void mine_train_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -3863,13 +3864,14 @@ static void mine_train_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mine_train_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mine_train_rc_track_left_half_banked_helix_up_large( + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0071C324 */ static void mine_train_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3894,7 +3896,7 @@ static void mine_train_rc_track_brakes( /** rct2: 0x0071C334 */ static void mine_train_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3919,7 +3921,7 @@ static void mine_train_rc_track_on_ride_photo( wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); break; } - track_paint_util_onride_photo_paint(session, direction, height + 2, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 2, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -3928,7 +3930,7 @@ static void mine_train_rc_track_on_ride_photo( /** rct2: 0x0071C354 */ static void mine_train_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4073,7 +4075,7 @@ static void mine_train_rc_track_left_eighth_to_diag( /** rct2: 0x0071C364 */ static void mine_train_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4217,25 +4219,25 @@ static void mine_train_rc_track_right_eighth_to_diag( /** rct2: 0x0071C374 */ static void mine_train_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C384 */ static void mine_train_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mine_train_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x0071C394 */ static void mine_train_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4383,7 +4385,7 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( /** rct2: 0x0071C3A4 */ static void mine_train_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4531,30 +4533,30 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( /** rct2: 0x0071C3B4 */ static void mine_train_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mine_train_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0071C3C4 */ static void mine_train_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mine_train_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mine_train_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x0071C344 */ static void mine_train_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4580,7 +4582,7 @@ static void mine_train_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4626,7 +4628,7 @@ static void mine_train_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4672,7 +4674,7 @@ static void mine_train_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4703,12 +4705,12 @@ static void mine_train_rc_track_diag_flat( /** rct2: 0x0071C414 */ static void mine_train_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4734,7 +4736,7 @@ static void mine_train_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4788,7 +4790,7 @@ static void mine_train_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4842,7 +4844,7 @@ static void mine_train_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4873,7 +4875,7 @@ static void mine_train_rc_track_diag_25_deg_up( /** rct2: 0x0071C474 */ static void mine_train_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4951,12 +4953,12 @@ static void mine_train_rc_track_diag_60_deg_up( /** rct2: 0x0071C3F4 */ static void mine_train_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4982,7 +4984,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5028,7 +5030,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5074,7 +5076,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5105,7 +5107,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x0071C454 */ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5183,7 +5185,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x0071C464 */ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5261,12 +5263,12 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x0071C404 */ static void mine_train_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5292,7 +5294,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5346,7 +5348,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5400,7 +5402,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5431,12 +5433,12 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x0071C444 */ static void mine_train_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5462,7 +5464,7 @@ static void mine_train_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5516,7 +5518,7 @@ static void mine_train_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5570,7 +5572,7 @@ static void mine_train_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5601,7 +5603,7 @@ static void mine_train_rc_track_diag_25_deg_down( /** rct2: 0x0071C4A4 */ static void mine_train_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5679,12 +5681,12 @@ static void mine_train_rc_track_diag_60_deg_down( /** rct2: 0x0071C424 */ static void mine_train_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5709,7 +5711,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5762,7 +5764,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5815,7 +5817,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5847,7 +5849,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x0071C484 */ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5925,7 +5927,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x0071C494 */ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6003,12 +6005,12 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x0071C434 */ static void mine_train_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6034,7 +6036,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6080,7 +6082,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6126,7 +6128,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6157,7 +6159,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x0071C4D4 */ static void mine_train_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6238,7 +6240,7 @@ static void mine_train_rc_track_diag_flat_to_left_bank( /** rct2: 0x0071C4B4 */ static void mine_train_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6319,7 +6321,7 @@ static void mine_train_rc_track_diag_flat_to_right_bank( /** rct2: 0x0071C4C4 */ static void mine_train_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6400,7 +6402,7 @@ static void mine_train_rc_track_diag_left_bank_to_flat( /** rct2: 0x0071C4E4 */ static void mine_train_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6481,7 +6483,7 @@ static void mine_train_rc_track_diag_right_bank_to_flat( /** rct2: 0x0071C514 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6562,7 +6564,7 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x0071C524 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6643,7 +6645,7 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x0071C4F4 */ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6724,7 +6726,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x0071C504 */ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6805,7 +6807,7 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x0071C534 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6881,7 +6883,7 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x0071C544 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6957,7 +6959,7 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x0071C554 */ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7038,7 +7040,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x0071C564 */ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7119,7 +7121,7 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x0071C3D4 */ static void mine_train_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7201,7 +7203,7 @@ static void mine_train_rc_track_diag_left_bank( /** rct2: 0x0071C3E4 */ static void mine_train_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7283,9 +7285,9 @@ static void mine_train_rc_track_diag_right_bank( /** rct2: 0x0071C574 */ static void mine_train_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _MineTrainBlockBrakeImages[direction][isClosed], 0, 0, 32, 20, 1, height, 0, 6, height); diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 1db2f6c04e..1639501925 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -33,9 +33,9 @@ static constexpr const uint32_t _MiniRCBlockBrakeImages[NumOrthogonalDirections] /** rct2: 0x008A4ABC */ static void mini_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -111,7 +111,7 @@ static void mini_rc_track_flat( static void mini_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 18746, SPR_STATION_BASE_A_SW_NE }, @@ -120,9 +120,9 @@ static void mini_rc_track_station( { 18747, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _MiniRCBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -136,7 +136,7 @@ static void mini_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -145,9 +145,9 @@ static void mini_rc_track_station( /** rct2: 0x008A4ACC */ static void mini_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -247,7 +247,7 @@ static void mini_rc_track_25_deg_up( /** rct2: 0x008A4ADC */ static void mini_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -304,9 +304,9 @@ static void mini_rc_track_60_deg_up( /** rct2: 0x008A4AEC */ static void mini_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -406,7 +406,7 @@ static void mini_rc_track_flat_to_25_deg_up( /** rct2: 0x008A4AFC */ static void mini_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -467,7 +467,7 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A4B0C */ static void mini_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -528,9 +528,9 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A4B1C */ static void mini_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -630,55 +630,55 @@ static void mini_rc_track_25_deg_up_to_flat( /** rct2: 0x008A4B2C */ static void mini_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B3C */ static void mini_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B4C */ static void mini_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B5C */ static void mini_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B6C */ static void mini_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B7C */ static void mini_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4B8C */ static void mini_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -856,16 +856,16 @@ static void mini_rc_track_left_quarter_turn_5( /** rct2: 0x008A4B9C */ static void mini_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4BAC */ static void mini_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -919,7 +919,7 @@ static void mini_rc_track_flat_to_left_bank( /** rct2: 0x008A4BBC */ static void mini_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -973,7 +973,7 @@ static void mini_rc_track_flat_to_right_bank( /** rct2: 0x008A4BCC */ static void mini_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1027,7 +1027,7 @@ static void mini_rc_track_left_bank_to_flat( /** rct2: 0x008A4BDC */ static void mini_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1081,7 +1081,7 @@ static void mini_rc_track_right_bank_to_flat( /** rct2: 0x008A4BEC */ static void mini_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1269,16 +1269,16 @@ static void mini_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A4BFC */ static void mini_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4C0C */ static void mini_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1339,7 +1339,7 @@ static void mini_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A4C1C */ static void mini_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1400,7 +1400,7 @@ static void mini_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A4C2C */ static void mini_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1461,7 +1461,7 @@ static void mini_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A4C3C */ static void mini_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1522,39 +1522,39 @@ static void mini_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A4C4C */ static void mini_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4C5C */ static void mini_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4C6C */ static void mini_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4C7C */ static void mini_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4C8C */ static void mini_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1604,15 +1604,15 @@ static void mini_rc_track_left_bank( /** rct2: 0x008A4C9C */ static void mini_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4CAC */ static void mini_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1790,7 +1790,7 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A4CBC */ static void mini_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1968,25 +1968,25 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A4CCC */ static void mini_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A4CDC */ static void mini_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4CEC */ static void mini_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2135,7 +2135,7 @@ static void mini_rc_track_s_bend_left( /** rct2: 0x008A4CFC */ static void mini_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2284,7 +2284,7 @@ static void mini_rc_track_s_bend_right( /** rct2: 0x008A4D3C */ static void mini_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2401,16 +2401,16 @@ static void mini_rc_track_left_quarter_turn_3( /** rct2: 0x008A4D4C */ static void mini_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4D5C */ static void mini_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2536,16 +2536,16 @@ static void mini_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A4D6C */ static void mini_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4D7C */ static void mini_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2638,7 +2638,7 @@ static void mini_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A4D8C */ static void mini_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2731,25 +2731,25 @@ static void mini_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A4D9C */ static void mini_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A4DAC */ static void mini_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4DBC */ static void mini_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2995,7 +2995,7 @@ static void mini_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A4DCC */ static void mini_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3241,7 +3241,7 @@ static void mini_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A4DDC */ static void mini_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3249,13 +3249,13 @@ static void mini_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A4DEC */ static void mini_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -3263,13 +3263,13 @@ static void mini_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4DFC */ static void mini_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3639,7 +3639,7 @@ static void mini_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A4E0C */ static void mini_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4009,7 +4009,7 @@ static void mini_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A4E1C */ static void mini_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4017,13 +4017,13 @@ static void mini_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A4E2C */ static void mini_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4031,13 +4031,13 @@ static void mini_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4E5C */ static void mini_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4074,7 +4074,7 @@ static void mini_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008A4E3C */ static void mini_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4111,23 +4111,23 @@ static void mini_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008A4E4C */ static void mini_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A4E6C */ static void mini_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A4E7C */ static void mini_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4161,7 +4161,7 @@ static void mini_rc_track_brakes( /** rct2: 0x008A50CC */ static void mini_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4218,7 +4218,7 @@ static void mini_rc_track_25_deg_up_left_banked( /** rct2: 0x008A50DC */ static void mini_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4275,7 +4275,7 @@ static void mini_rc_track_25_deg_up_right_banked( /** rct2: 0x008A4E8C */ static void mini_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4312,7 +4312,7 @@ static void mini_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 18739, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -4321,23 +4321,23 @@ static void mini_rc_track_on_ride_photo( /** rct2: 0x008A50EC */ static void mini_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A50FC */ static void mini_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4EAC */ static void mini_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4483,7 +4483,7 @@ static void mini_rc_track_left_eighth_to_diag( /** rct2: 0x008A4EBC */ static void mini_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4628,25 +4628,25 @@ static void mini_rc_track_right_eighth_to_diag( /** rct2: 0x008A4ECC */ static void mini_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4EDC */ static void mini_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mini_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A4EEC */ static void mini_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4795,7 +4795,7 @@ static void mini_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A4EFC */ static void mini_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4944,30 +4944,30 @@ static void mini_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A4F0C */ static void mini_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A4F1C */ static void mini_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mini_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A4E9C */ static void mini_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4994,7 +4994,7 @@ static void mini_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5021,7 +5021,7 @@ static void mini_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5048,7 +5048,7 @@ static void mini_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5108,12 +5108,12 @@ static void mini_rc_track_diag_flat( /** rct2: 0x008A4F4C */ static void mini_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5140,7 +5140,7 @@ static void mini_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5167,7 +5167,7 @@ static void mini_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5194,7 +5194,7 @@ static void mini_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5254,7 +5254,7 @@ static void mini_rc_track_diag_25_deg_up( /** rct2: 0x008A4FAC */ static void mini_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5330,12 +5330,12 @@ static void mini_rc_track_diag_60_deg_up( /** rct2: 0x008A4F2C */ static void mini_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5362,7 +5362,7 @@ static void mini_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5389,7 +5389,7 @@ static void mini_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5416,7 +5416,7 @@ static void mini_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5476,7 +5476,7 @@ static void mini_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A4F8C */ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5552,7 +5552,7 @@ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A4F9C */ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5628,12 +5628,12 @@ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A4F3C */ static void mini_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5660,7 +5660,7 @@ static void mini_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5687,7 +5687,7 @@ static void mini_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5714,7 +5714,7 @@ static void mini_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5774,12 +5774,12 @@ static void mini_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A4F7C */ static void mini_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5806,7 +5806,7 @@ static void mini_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5833,7 +5833,7 @@ static void mini_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5860,7 +5860,7 @@ static void mini_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5920,7 +5920,7 @@ static void mini_rc_track_diag_25_deg_down( /** rct2: 0x008A4FDC */ static void mini_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5996,12 +5996,12 @@ static void mini_rc_track_diag_60_deg_down( /** rct2: 0x008A4F5C */ static void mini_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6027,7 +6027,7 @@ static void mini_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6053,7 +6053,7 @@ static void mini_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6079,7 +6079,7 @@ static void mini_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6140,7 +6140,7 @@ static void mini_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A4FBC */ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6216,7 +6216,7 @@ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A4FCC */ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6292,12 +6292,12 @@ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A4F6C */ static void mini_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6324,7 +6324,7 @@ static void mini_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6351,7 +6351,7 @@ static void mini_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6378,7 +6378,7 @@ static void mini_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6438,7 +6438,7 @@ static void mini_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A500C */ static void mini_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6517,7 +6517,7 @@ static void mini_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A501C */ static void mini_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6596,7 +6596,7 @@ static void mini_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A502C */ static void mini_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6675,7 +6675,7 @@ static void mini_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A503C */ static void mini_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6754,7 +6754,7 @@ static void mini_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A506C */ static void mini_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6833,7 +6833,7 @@ static void mini_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A507C */ static void mini_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6912,7 +6912,7 @@ static void mini_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A504C */ static void mini_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6991,7 +6991,7 @@ static void mini_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A505C */ static void mini_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7070,7 +7070,7 @@ static void mini_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A508C */ static void mini_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7147,7 +7147,7 @@ static void mini_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A509C */ static void mini_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7224,7 +7224,7 @@ static void mini_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A50AC */ static void mini_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7303,7 +7303,7 @@ static void mini_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A50BC */ static void mini_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7382,7 +7382,7 @@ static void mini_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A4FEC */ static void mini_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7458,7 +7458,7 @@ static void mini_rc_track_diag_left_bank( /** rct2: 0x008A4FFC */ static void mini_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7534,9 +7534,9 @@ static void mini_rc_track_diag_right_bank( /** rct2: 0x008A530C */ static void mini_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _MiniRCBlockBrakeImages[direction][isClosed], 0, 0, 32, 20, 3, height, 0, 6, height); @@ -7568,7 +7568,7 @@ static void mini_rc_track_block_brakes( /** rct2: 0x008A510C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7664,7 +7664,7 @@ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A511C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7760,25 +7760,26 @@ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008A512C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_right_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_banked_quarter_turn_3_25_deg_up( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A513C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_banked_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A514C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7962,7 +7963,7 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A515C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8146,25 +8147,26 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008A516C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_right_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + mini_rc_track_right_banked_quarter_turn_5_25_deg_up( + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A517C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_rc_track_left_banked_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A518C */ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8223,7 +8225,7 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008A519C */ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8282,7 +8284,7 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008A51AC */ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8341,7 +8343,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A51BC */ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8400,39 +8402,39 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008A51CC */ static void mini_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A51DC */ static void mini_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A51EC */ static void mini_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A51FC */ static void mini_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A520C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8489,7 +8491,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008A521C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8546,7 +8548,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008A524C */ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8603,7 +8605,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008A525C */ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8660,43 +8662,43 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008A526C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A527C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A522C */ static void mini_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A523C */ static void mini_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A528C */ static void mini_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8755,7 +8757,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008A529C */ static void mini_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8814,7 +8816,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008A52AC */ static void mini_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8873,7 +8875,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008A52BC */ static void mini_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -8932,38 +8934,38 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008A52CC */ static void mini_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A52DC */ static void mini_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A52EC */ static void mini_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A52FC */ static void mini_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void mini_rc_track_left_curved_lift_hill( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9055,7 +9057,7 @@ static void mini_rc_track_left_curved_lift_hill( static void mini_rc_track_right_curved_lift_hill( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9147,7 +9149,7 @@ static void mini_rc_track_right_curved_lift_hill( static void mini_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { // These offsets could be moved to the g2.dat file when that supports offsets. int8_t ne_sw_offsetX = 7; diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index d860e8cd37..7fef440841 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x008AFE9C */ static void mini_suspended_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -82,7 +82,7 @@ static void mini_suspended_rc_track_flat( /** rct2: 0x008AFF4C, 0x008AFF5C, 0x008AFF6C */ static void mini_suspended_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 28433, SPR_STATION_INVERTED_BAR_E_SW_NE }, @@ -99,7 +99,7 @@ static void mini_suspended_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 2, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_1); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -108,9 +108,9 @@ static void mini_suspended_rc_track_station( /** rct2: 0x008AFEAC */ static void mini_suspended_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -202,9 +202,9 @@ static void mini_suspended_rc_track_25_deg_up( /** rct2: 0x008AFEBC */ static void mini_suspended_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -296,9 +296,9 @@ static void mini_suspended_rc_track_flat_to_25_deg_up( /** rct2: 0x008AFECC */ static void mini_suspended_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -390,31 +390,31 @@ static void mini_suspended_rc_track_25_deg_up_to_flat( /** rct2: 0x008AFEDC */ static void mini_suspended_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_suspended_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AFEEC */ static void mini_suspended_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_suspended_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AFEFC */ static void mini_suspended_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - mini_suspended_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AFF0C */ static void mini_suspended_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -601,16 +601,16 @@ static void mini_suspended_rc_track_left_quarter_turn_5( /** rct2: 0x008AFF1C */ static void mini_suspended_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - mini_suspended_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_suspended_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AFF2C */ static void mini_suspended_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -791,7 +791,7 @@ static void mini_suspended_rc_track_s_bend_left( /** rct2: 0x008AFF3C */ static void mini_suspended_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -972,7 +972,7 @@ static void mini_suspended_rc_track_s_bend_right( /** rct2: 0x008AFF7C */ static void mini_suspended_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1102,16 +1102,16 @@ static void mini_suspended_rc_track_left_quarter_turn_3( /** rct2: 0x008AFF8C */ static void mini_suspended_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - mini_suspended_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + mini_suspended_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AFFAC */ static void mini_suspended_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1285,7 +1285,7 @@ static void mini_suspended_rc_track_left_eighth_to_diag( /** rct2: 0x008AFFBC */ static void mini_suspended_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1459,30 +1459,30 @@ static void mini_suspended_rc_track_right_eighth_to_diag( /** rct2: 0x008AFFCC */ static void mini_suspended_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_suspended_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + mini_suspended_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AFFDC */ static void mini_suspended_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - mini_suspended_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + mini_suspended_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008AFF9C */ static void mini_suspended_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1509,7 +1509,7 @@ static void mini_suspended_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1536,7 +1536,7 @@ static void mini_suspended_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1563,7 +1563,7 @@ static void mini_suspended_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1616,12 +1616,12 @@ static void mini_suspended_rc_track_diag_flat( /** rct2: 0x008B000C */ static void mini_suspended_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1648,7 +1648,7 @@ static void mini_suspended_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1675,7 +1675,7 @@ static void mini_suspended_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1702,7 +1702,7 @@ static void mini_suspended_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1755,12 +1755,12 @@ static void mini_suspended_rc_track_diag_25_deg_up( /** rct2: 0x008AFFEC */ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1787,7 +1787,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1814,7 +1814,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1841,7 +1841,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1894,12 +1894,12 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AFFFC */ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1926,7 +1926,7 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1953,7 +1953,7 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1980,7 +1980,7 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2033,12 +2033,12 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008B003C */ static void mini_suspended_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2065,7 +2065,7 @@ static void mini_suspended_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2092,7 +2092,7 @@ static void mini_suspended_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2119,7 +2119,7 @@ static void mini_suspended_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2172,12 +2172,12 @@ static void mini_suspended_rc_track_diag_25_deg_down( /** rct2: 0x008B001C */ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2203,7 +2203,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2229,7 +2229,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2255,7 +2255,7 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2308,12 +2308,12 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008B002C */ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2340,7 +2340,7 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2367,7 +2367,7 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2394,7 +2394,7 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index b0e71241ae..c20a381911 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -36,11 +36,11 @@ static constexpr const uint32_t MULTI_DIM_INVERTED_BLOCK_BRAKE_NW_SE_CLOSED = 26 /** rct2: 0x00792D88 */ static void multi_dimension_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -120,7 +120,7 @@ static void multi_dimension_rc_track_flat( /** rct2: 0x00792F98, 0x00792FA8, 0x00792FB8 */ static void multi_dimension_rc_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[NumOrthogonalDirections][3] = { { 15810, MULTI_DIM_STATION_BLOCK_BRAKE_SW_NE_OPEN, MULTI_DIM_STATION_BLOCK_BRAKE_SW_NE_CLOSED }, @@ -129,9 +129,9 @@ static void multi_dimension_rc_track_station( { 15811, MULTI_DIM_STATION_BLOCK_BRAKE_NW_SE_OPEN, MULTI_DIM_STATION_BLOCK_BRAKE_NW_SE_CLOSED }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); uint8_t offset = isClosed ? 2 : 1; PaintAddImageAsParentRotated( session, direction, imageIds[direction][offset] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 26, 1, height, 0, @@ -151,23 +151,23 @@ static void multi_dimension_rc_track_station( bool hasFence; if (direction == 0 || direction == 2) { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height); } else { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, height); } if (direction == 0 || direction == 2) { - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, height); } else { - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height); } } @@ -180,11 +180,11 @@ static void multi_dimension_rc_track_station( /** rct2: 0x00792D98 */ static void multi_dimension_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -315,9 +315,9 @@ static void multi_dimension_rc_track_25_deg_up( /** rct2: 0x00792DA8 */ static void multi_dimension_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -396,11 +396,11 @@ static void multi_dimension_rc_track_60_deg_up( /** rct2: 0x00792DB8 */ static void multi_dimension_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -531,9 +531,9 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( /** rct2: 0x00792DC8 */ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -622,9 +622,9 @@ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x00792DD8 */ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -737,11 +737,11 @@ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x00792DE8 */ static void multi_dimension_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -872,57 +872,57 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( /** rct2: 0x00792DF8 */ static void multi_dimension_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E08 */ static void multi_dimension_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E18 */ static void multi_dimension_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E28 */ static void multi_dimension_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E38 */ static void multi_dimension_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E48 */ static void multi_dimension_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792E58 */ static void multi_dimension_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1287,18 +1287,18 @@ static void multi_dimension_rc_track_left_quarter_turn_5( /** rct2: 0x00792E68 */ static void multi_dimension_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00792E78 */ static void multi_dimension_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1376,9 +1376,9 @@ static void multi_dimension_rc_track_flat_to_left_bank( /** rct2: 0x00792E88 */ static void multi_dimension_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1456,9 +1456,9 @@ static void multi_dimension_rc_track_flat_to_right_bank( /** rct2: 0x00792E98 */ static void multi_dimension_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1536,9 +1536,9 @@ static void multi_dimension_rc_track_left_bank_to_flat( /** rct2: 0x00792EA8 */ static void multi_dimension_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -1616,9 +1616,9 @@ static void multi_dimension_rc_track_right_bank_to_flat( /** rct2: 0x00792EB8 */ static void multi_dimension_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -1984,18 +1984,19 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00792EC8 */ static void multi_dimension_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - multi_dimension_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_banked_left_quarter_turn_5( + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00792ED8 */ static void multi_dimension_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2104,9 +2105,9 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_up( /** rct2: 0x00792EE8 */ static void multi_dimension_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2215,9 +2216,9 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_up( /** rct2: 0x00792EF8 */ static void multi_dimension_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2326,9 +2327,9 @@ static void multi_dimension_rc_track_25_deg_up_to_left_bank( /** rct2: 0x00792F08 */ static void multi_dimension_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2437,41 +2438,41 @@ static void multi_dimension_rc_track_25_deg_up_to_right_bank( /** rct2: 0x00792F18 */ static void multi_dimension_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792F28 */ static void multi_dimension_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792F38 */ static void multi_dimension_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792F48 */ static void multi_dimension_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792F58 */ static void multi_dimension_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -2545,17 +2546,17 @@ static void multi_dimension_rc_track_left_bank( /** rct2: 0x00792F68 */ static void multi_dimension_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00792F78 */ static void multi_dimension_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -2868,9 +2869,9 @@ static void multi_dimension_rc_track_s_bend_left( /** rct2: 0x00792F88 */ static void multi_dimension_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3183,9 +3184,9 @@ static void multi_dimension_rc_track_s_bend_right( /** rct2: 0x00792FC8 */ static void multi_dimension_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3420,18 +3421,18 @@ static void multi_dimension_rc_track_left_quarter_turn_3( /** rct2: 0x00792FD8 */ static void multi_dimension_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00792FE8 */ static void multi_dimension_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -3672,16 +3673,16 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00792FF8 */ static void multi_dimension_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - multi_dimension_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + multi_dimension_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00793008 */ static void multi_dimension_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3897,7 +3898,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( /** rct2: 0x00793018 */ static void multi_dimension_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4113,7 +4114,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( /** rct2: 0x00793028 */ static void multi_dimension_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4122,13 +4123,13 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; multi_dimension_rc_track_right_half_banked_helix_up_small( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00793038 */ static void multi_dimension_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4137,13 +4138,13 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_small( } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; multi_dimension_rc_track_left_half_banked_helix_up_small( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00793048 */ static void multi_dimension_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4483,7 +4484,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( /** rct2: 0x00793058 */ static void multi_dimension_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4823,7 +4824,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( /** rct2: 0x00793068 */ static void multi_dimension_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4832,13 +4833,13 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; multi_dimension_rc_track_right_half_banked_helix_up_large( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x00793078 */ static void multi_dimension_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4847,15 +4848,15 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_large( } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; multi_dimension_rc_track_left_half_banked_helix_up_large( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00793088 */ static void multi_dimension_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -4913,9 +4914,9 @@ static void multi_dimension_rc_track_brakes( /** rct2: 0x00793098 */ static void multi_dimension_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -4960,7 +4961,7 @@ static void multi_dimension_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 15807, 0, 0, 32, 20, 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -5014,7 +5015,7 @@ static void multi_dimension_rc_track_on_ride_photo( height + 24); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); @@ -5024,9 +5025,9 @@ static void multi_dimension_rc_track_on_ride_photo( /** rct2: 0x00793328 */ static void multi_dimension_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5105,17 +5106,17 @@ static void multi_dimension_rc_track_90_deg_up( /** rct2: 0x00793338 */ static void multi_dimension_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00793348 */ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5202,17 +5203,17 @@ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x00793358 */ static void multi_dimension_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - multi_dimension_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00793368 */ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (direction) { @@ -5291,9 +5292,9 @@ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( /** rct2: 0x00793378 */ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5378,9 +5379,9 @@ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x007930B8 */ static void multi_dimension_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5683,9 +5684,9 @@ static void multi_dimension_rc_track_left_eighth_to_diag( /** rct2: 0x007930C8 */ static void multi_dimension_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -5988,27 +5989,27 @@ static void multi_dimension_rc_track_right_eighth_to_diag( /** rct2: 0x007930D8 */ static void multi_dimension_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x007930E8 */ static void multi_dimension_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + multi_dimension_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x007930F8 */ static void multi_dimension_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -6312,9 +6313,9 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00793108 */ static void multi_dimension_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -6618,32 +6619,32 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00793118 */ static void multi_dimension_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + multi_dimension_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00793128 */ static void multi_dimension_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - multi_dimension_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + multi_dimension_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x007930A8 */ static void multi_dimension_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6671,7 +6672,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6699,7 +6700,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6727,7 +6728,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6789,7 +6790,7 @@ static void multi_dimension_rc_track_diag_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6817,7 +6818,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6845,7 +6846,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6873,7 +6874,7 @@ static void multi_dimension_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6928,14 +6929,14 @@ static void multi_dimension_rc_track_diag_flat( /** rct2: 0x00793158 */ static void multi_dimension_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6963,7 +6964,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6991,7 +6992,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7019,7 +7020,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7081,7 +7082,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7109,7 +7110,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7137,7 +7138,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7165,7 +7166,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7220,9 +7221,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( /** rct2: 0x007931B8 */ static void multi_dimension_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7386,14 +7387,14 @@ static void multi_dimension_rc_track_diag_60_deg_up( /** rct2: 0x00793138 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7421,7 +7422,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7449,7 +7450,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7477,7 +7478,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7539,7 +7540,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7567,7 +7568,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7595,7 +7596,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7623,7 +7624,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7678,9 +7679,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00793198 */ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -7844,9 +7845,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007931A8 */ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8010,14 +8011,14 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00793148 */ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8045,7 +8046,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8073,7 +8074,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8101,7 +8102,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8163,7 +8164,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8191,7 +8192,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8219,7 +8220,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8247,7 +8248,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8302,14 +8303,14 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00793188 */ static void multi_dimension_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8337,7 +8338,7 @@ static void multi_dimension_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8365,7 +8366,7 @@ static void multi_dimension_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8393,7 +8394,7 @@ static void multi_dimension_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8538,9 +8539,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( /** rct2: 0x007931E8 */ static void multi_dimension_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -8704,14 +8705,14 @@ static void multi_dimension_rc_track_diag_60_deg_down( /** rct2: 0x00793168 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8738,7 +8739,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8765,7 +8766,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8792,7 +8793,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8936,9 +8937,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x007931C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9102,9 +9103,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007931D8 */ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9268,14 +9269,14 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00793178 */ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9303,7 +9304,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9331,7 +9332,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9359,7 +9360,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9504,9 +9505,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00793218 */ static void multi_dimension_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9674,9 +9675,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( /** rct2: 0x00793228 */ static void multi_dimension_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -9844,9 +9845,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( /** rct2: 0x00793238 */ static void multi_dimension_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10014,9 +10015,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( /** rct2: 0x00793248 */ static void multi_dimension_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10184,9 +10185,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( /** rct2: 0x00793278 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10353,9 +10354,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00793288 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10522,9 +10523,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00793258 */ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10691,9 +10692,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00793268 */ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -10860,9 +10861,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00793298 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11022,9 +11023,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x007932A8 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11184,9 +11185,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x007932B8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11353,9 +11354,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007932C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11522,9 +11523,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007931F8 */ static void multi_dimension_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11689,9 +11690,9 @@ static void multi_dimension_rc_track_diag_left_bank( /** rct2: 0x00793208 */ static void multi_dimension_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -11856,7 +11857,7 @@ static void multi_dimension_rc_track_diag_right_bank( /** rct2: 0x007932D8 */ static void multi_dimension_rc_track_left_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11968,7 +11969,7 @@ static void multi_dimension_rc_track_left_flyer_twist_up( /** rct2: 0x007932E8 */ static void multi_dimension_rc_track_right_flyer_twist_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12078,7 +12079,7 @@ static void multi_dimension_rc_track_right_flyer_twist_up( /** rct2: 0x007932F8 */ static void multi_dimension_rc_track_left_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12190,7 +12191,7 @@ static void multi_dimension_rc_track_left_flyer_twist_down( /** rct2: 0x00793308 */ static void multi_dimension_rc_track_right_flyer_twist_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12300,9 +12301,9 @@ static void multi_dimension_rc_track_right_flyer_twist_down( /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12499,11 +12500,11 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo /** rct2: 0x00793318 */ static void multi_dimension_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { static constexpr const uint32_t imageIds[NumOrthogonalDirections][2] = { { MULTI_DIM_NON_INVERTED_BLOCK_BRAKE_SW_NE_OPEN, MULTI_DIM_NON_INVERTED_BLOCK_BRAKE_SW_NE_CLOSED }, @@ -12550,9 +12551,9 @@ static void multi_dimension_rc_track_block_brakes( /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12745,9 +12746,9 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { @@ -12944,9 +12945,9 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (!tileElement->AsTrack()->IsInverted()) + if (!trackElement.IsInverted()) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 1ee452a3b5..91595189b6 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -197,7 +197,7 @@ static constexpr const uint32_t reverse_freefall_rc_track_pieces_vertical_suppor static void paint_reverse_freefall_rc_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction & 1) { @@ -219,7 +219,7 @@ static void paint_reverse_freefall_rc_flat( static void paint_reverse_freefall_rc_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -253,7 +253,7 @@ static void paint_reverse_freefall_rc_station( } if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -261,7 +261,7 @@ static void paint_reverse_freefall_rc_station( static void paint_reverse_freefall_rc_slope( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { TESTPAINT_IGNORE_ALL(); @@ -357,7 +357,7 @@ static void paint_reverse_freefall_rc_slope( static void paint_reverse_freefall_rc_vertical( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t supportsImageId, trackImageId; switch (trackSequence) @@ -388,7 +388,7 @@ static void paint_reverse_freefall_rc_vertical( static void paint_reverse_freefall_rc_onride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_AIR_POWERED_VERTICAL_RC_FLAT_SW_NE, @@ -400,7 +400,7 @@ static void paint_reverse_freefall_rc_onride_photo( // The straight track without booster is borrowed from the APVC. // It has one track colour, instead of the two that the Reverse Freefall Colour has. uint32_t colour = session->TrackColours[SCHEME_TRACK]; - if (!tileElement->IsGhost() && !tileElement->AsTrack()->IsHighlighted()) + if (!trackElement.IsGhost() && !trackElement.IsHighlighted()) { // Replace remap colour 1 (bits 19-23) with a copy of remap colour 2 (bits 24-28). colour_t colour2 = (colour >> 24) & 31; @@ -413,7 +413,7 @@ static void paint_reverse_freefall_rc_onride_photo( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index 5981fe93a0..f601ccba74 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -48,9 +48,9 @@ void vehicle_visual_reverser( /** rct2: 0x0086E65C */ static void reverser_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -93,7 +93,7 @@ static void reverser_rc_track_flat( static void reverser_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { 21506, SPR_STATION_BASE_A_SW_NE }, @@ -108,7 +108,7 @@ static void reverser_rc_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -117,9 +117,9 @@ static void reverser_rc_track_station( /** rct2: 0x0086E66C */ static void reverser_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -186,9 +186,9 @@ static void reverser_rc_track_25_deg_up( /** rct2: 0x0086E67C */ static void reverser_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -255,9 +255,9 @@ static void reverser_rc_track_flat_to_25_deg_up( /** rct2: 0x0086E68C */ static void reverser_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -324,31 +324,31 @@ static void reverser_rc_track_25_deg_up_to_flat( /** rct2: 0x0086E69C */ static void reverser_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - reverser_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0086E6AC */ static void reverser_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - reverser_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0086E6BC */ static void reverser_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - reverser_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + reverser_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0086E6CC */ static void reverser_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -529,16 +529,16 @@ static void reverser_rc_track_left_quarter_turn_5( /** rct2: 0x0086E6DC */ static void reverser_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - reverser_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + reverser_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0086E6EC */ static void reverser_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -677,7 +677,7 @@ static void reverser_rc_track_s_bend_left( /** rct2: 0x0086E6FC */ static void reverser_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -816,7 +816,7 @@ static void reverser_rc_track_s_bend_right( /** rct2: 0x0086E73C */ static void reverser_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -923,16 +923,16 @@ static void reverser_rc_track_left_quarter_turn_3( /** rct2: 0x0086E74C */ static void reverser_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - reverser_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + reverser_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0086E75C */ static void reverser_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -957,7 +957,7 @@ static void reverser_rc_track_brakes( /** rct2: 0x0086E76C */ static void reverser_rc_track_left_reverser( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1142,7 +1142,7 @@ static void reverser_rc_track_left_reverser( /** rct2: 0x0086E77C */ static void reverser_rc_track_right_reverser( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index c9cc7362ab..9cf64bdcf9 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -68,9 +68,9 @@ constexpr int32_t SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_3_A = 21879; /** rct2: 0x0077839C */ static void side_friction_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -140,7 +140,7 @@ static void side_friction_rc_track_flat( /** rct2: 0x007784AC, 0x007784BC, 0x007784CC */ static void side_friction_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { 21610, @@ -152,7 +152,7 @@ static void side_friction_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -161,9 +161,9 @@ static void side_friction_rc_track_station( /** rct2: 0x007783AC */ static void side_friction_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -246,9 +246,9 @@ static void side_friction_rc_track_25_deg_up( /** rct2: 0x007783CC */ static void side_friction_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -331,9 +331,9 @@ static void side_friction_rc_track_flat_to_25_deg_up( /** rct2: 0x007783FC */ static void side_friction_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -416,31 +416,31 @@ static void side_friction_rc_track_25_deg_up_to_flat( /** rct2: 0x0077840C */ static void side_friction_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0077842C */ static void side_friction_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0077845C */ static void side_friction_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0077846C */ static void side_friction_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -681,16 +681,16 @@ static void side_friction_rc_track_left_quarter_turn_5( /** rct2: 0x0077847C */ static void side_friction_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - side_friction_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + side_friction_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0077848C */ static void side_friction_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -877,7 +877,7 @@ static void side_friction_rc_track_s_bend_left( /** rct2: 0x0077849C */ static void side_friction_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1064,7 +1064,7 @@ static void side_friction_rc_track_s_bend_right( /** rct2: 0x007784DC */ static void side_friction_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1207,16 +1207,16 @@ static void side_friction_rc_track_left_quarter_turn_3( /** rct2: 0x007784EC */ static void side_friction_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - side_friction_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + side_friction_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x007784FC */ static void side_friction_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1245,7 +1245,7 @@ static void side_friction_rc_track_brakes( /** rct2: 0x007785DC */ static void side_friction_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1438,7 +1438,7 @@ static void side_friction_rc_track_left_eighth_to_diag( /** rct2: 0x007785EC */ static void side_friction_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1630,30 +1630,30 @@ static void side_friction_rc_track_right_eighth_to_diag( /** rct2: 0x007785FC */ static void side_friction_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - side_friction_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + side_friction_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0077860C */ static void side_friction_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - side_friction_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + side_friction_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x0077850C */ static void side_friction_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1679,7 +1679,7 @@ static void side_friction_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1731,7 +1731,7 @@ static void side_friction_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1783,7 +1783,7 @@ static void side_friction_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1814,12 +1814,12 @@ static void side_friction_rc_track_diag_flat( /** rct2: 0x0077853C */ static void side_friction_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1845,7 +1845,7 @@ static void side_friction_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1905,7 +1905,7 @@ static void side_friction_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1965,7 +1965,7 @@ static void side_friction_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1996,12 +1996,12 @@ static void side_friction_rc_track_diag_25_deg_up( /** rct2: 0x0077851C */ static void side_friction_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2027,7 +2027,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2079,7 +2079,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2131,7 +2131,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2162,12 +2162,12 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x0077852C */ static void side_friction_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2193,7 +2193,7 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2253,7 +2253,7 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2313,7 +2313,7 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2344,12 +2344,12 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x0077859C */ static void side_friction_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2375,7 +2375,7 @@ static void side_friction_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2435,7 +2435,7 @@ static void side_friction_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2495,7 +2495,7 @@ static void side_friction_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2526,12 +2526,12 @@ static void side_friction_rc_track_diag_25_deg_down( /** rct2: 0x0077857C */ static void side_friction_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2555,7 +2555,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( } break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2613,7 +2613,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( } break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2671,7 +2671,7 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( } break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2703,12 +2703,12 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x0077858C */ static void side_friction_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2734,7 +2734,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2786,7 +2786,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2838,7 +2838,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2868,7 +2868,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( static void side_friction_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -2927,14 +2927,14 @@ static void side_friction_rc_track_60_deg_up( static void side_friction_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -2990,14 +2990,14 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( static void side_friction_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3053,14 +3053,14 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( static void side_friction_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3145,14 +3145,14 @@ static void side_friction_rc_track_diag_60_deg_up( static void side_friction_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - side_friction_rc_track_diag_60_deg_up(session, ride, 3 - trackSequence, (direction + 2) % 4, height, tileElement); + side_friction_rc_track_diag_60_deg_up(session, ride, 3 - trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3241,15 +3241,15 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( static void side_friction_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { side_friction_rc_track_diag_60_deg_up_to_25_deg_up( - session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); }; static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3336,10 +3336,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( static void side_friction_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { side_friction_rc_track_diag_25_deg_up_to_60_deg_up( - session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); }; TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 8efc32d929..b846c6f979 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -28,9 +28,9 @@ namespace SingleRailRC { static void TrackFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -92,7 +92,7 @@ namespace SingleRailRC static void TrackStation( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { (SPR_G2_SINGLE_RAIL_TRACK_BRAKE + 0), (SPR_G2_SINGLE_RAIL_TRACK_BLOCK_BRAKE + 0), SPR_STATION_BASE_B_SW_NE }, @@ -101,7 +101,7 @@ namespace SingleRailRC { (SPR_G2_SINGLE_RAIL_TRACK_BRAKE + 1), (SPR_G2_SINGLE_RAIL_TRACK_BLOCK_BRAKE + 1), SPR_STATION_BASE_B_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, @@ -117,7 +117,7 @@ namespace SingleRailRC session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 2, height - 2, 0, 2, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 4, 7); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 4, 7); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -125,9 +125,9 @@ namespace SingleRailRC static void Track25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -204,9 +204,9 @@ namespace SingleRailRC static void Track60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -283,9 +283,9 @@ namespace SingleRailRC static void TrackFlatTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -362,9 +362,9 @@ namespace SingleRailRC static void Track25DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -453,9 +453,9 @@ namespace SingleRailRC static void Track60DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -544,9 +544,9 @@ namespace SingleRailRC static void Track25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -623,49 +623,49 @@ namespace SingleRailRC static void Track25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -705,14 +705,14 @@ namespace SingleRailRC static void Track90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -761,14 +761,14 @@ namespace SingleRailRC static void Track90DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -809,7 +809,7 @@ namespace SingleRailRC static void Track60DegDownTo90DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -852,7 +852,7 @@ namespace SingleRailRC static void TrackLeftQuarterTurn3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -980,15 +980,15 @@ namespace SingleRailRC static void TrackRightQuarterTurn3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1189,15 +1189,15 @@ namespace SingleRailRC static void TrackRightQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1362,7 +1362,7 @@ namespace SingleRailRC static void TrackRightEighthToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1527,28 +1527,28 @@ namespace SingleRailRC static void TrackLeftEighthToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackDiagFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1578,7 +1578,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1608,7 +1608,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1638,7 +1638,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1700,12 +1700,12 @@ namespace SingleRailRC static void TrackDiag25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1735,7 +1735,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1765,7 +1765,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1795,7 +1795,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1857,12 +1857,12 @@ namespace SingleRailRC static void TrackDiag25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1892,7 +1892,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1922,7 +1922,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1952,7 +1952,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2014,12 +2014,12 @@ namespace SingleRailRC static void TrackDiagFlatTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2049,7 +2049,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2079,7 +2079,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2109,7 +2109,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2171,12 +2171,12 @@ namespace SingleRailRC static void TrackDiag25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2206,7 +2206,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2236,7 +2236,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2266,7 +2266,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2328,12 +2328,12 @@ namespace SingleRailRC static void TrackDiagFlatTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2362,7 +2362,7 @@ namespace SingleRailRC 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2391,7 +2391,7 @@ namespace SingleRailRC 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2420,7 +2420,7 @@ namespace SingleRailRC 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2483,12 +2483,12 @@ namespace SingleRailRC static void TrackDiag25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2518,7 +2518,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2548,7 +2548,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2578,7 +2578,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2640,12 +2640,12 @@ namespace SingleRailRC static void TrackDiag60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2675,7 +2675,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2705,7 +2705,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2735,7 +2735,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2797,12 +2797,12 @@ namespace SingleRailRC static void TrackDiag25DegUpTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2832,7 +2832,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2862,7 +2862,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2892,7 +2892,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2954,12 +2954,12 @@ namespace SingleRailRC static void TrackDiag60DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2989,7 +2989,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3019,7 +3019,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3049,7 +3049,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3111,12 +3111,12 @@ namespace SingleRailRC static void TrackDiag60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3146,7 +3146,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3176,7 +3176,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3206,7 +3206,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3268,12 +3268,12 @@ namespace SingleRailRC static void TrackDiag25DegDownTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3303,7 +3303,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3333,7 +3333,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3363,7 +3363,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3425,12 +3425,12 @@ namespace SingleRailRC static void TrackDiag60DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3460,7 +3460,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3490,7 +3490,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3520,7 +3520,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3582,7 +3582,7 @@ namespace SingleRailRC static void TrackFlatToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3625,7 +3625,7 @@ namespace SingleRailRC static void TrackFlatToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3668,21 +3668,21 @@ namespace SingleRailRC static void TrackLeftBankToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3732,7 +3732,7 @@ namespace SingleRailRC static void TrackRightBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3782,7 +3782,7 @@ namespace SingleRailRC static void Track25DegUpToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3832,7 +3832,7 @@ namespace SingleRailRC static void Track25DegUpToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3882,35 +3882,35 @@ namespace SingleRailRC static void TrackLeftBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -3947,14 +3947,14 @@ namespace SingleRailRC static void TrackRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4041,7 +4041,7 @@ namespace SingleRailRC static void TrackDiagFlatToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4128,7 +4128,7 @@ namespace SingleRailRC static void TrackDiagLeftBankToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4215,7 +4215,7 @@ namespace SingleRailRC static void TrackDiagRightBankToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4302,7 +4302,7 @@ namespace SingleRailRC static void TrackDiagLeftBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4389,7 +4389,7 @@ namespace SingleRailRC static void TrackDiagRightBankTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4476,7 +4476,7 @@ namespace SingleRailRC static void TrackDiag25DegUpToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4563,7 +4563,7 @@ namespace SingleRailRC static void TrackDiag25DegUpToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4650,7 +4650,7 @@ namespace SingleRailRC static void TrackDiagLeftBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4735,7 +4735,7 @@ namespace SingleRailRC static void TrackDiagRightBankTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4820,7 +4820,7 @@ namespace SingleRailRC static void TrackDiag25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4907,7 +4907,7 @@ namespace SingleRailRC static void TrackDiag25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4994,7 +4994,7 @@ namespace SingleRailRC static void TrackDiagLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5077,7 +5077,7 @@ namespace SingleRailRC static void TrackDiagRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5160,7 +5160,7 @@ namespace SingleRailRC static void TrackLeftQuarterTurn3Bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5296,15 +5296,15 @@ namespace SingleRailRC static void TrackRightQuarterTurn3Bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackBankedLeftQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5513,15 +5513,15 @@ namespace SingleRailRC static void TrackBankedRightQuarterTurn5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackBankedLeftQuarterTurn5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftEighthBankToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5686,7 +5686,7 @@ namespace SingleRailRC static void TrackRightEighthBankToDiag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5851,23 +5851,23 @@ namespace SingleRailRC static void TrackLeftEighthBankToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightEighthBankToDiag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightEighthBankToOrthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + TrackLeftEighthBankToDiag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } static void TrackLeftQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5965,7 +5965,7 @@ namespace SingleRailRC static void TrackRightQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6069,23 +6069,23 @@ namespace SingleRailRC static void TrackLeftQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn525DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6286,7 +6286,7 @@ namespace SingleRailRC static void TrackRightQuarterTurn525DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6487,23 +6487,23 @@ namespace SingleRailRC static void TrackLeftQuarterTurn525DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn525DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn160DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6547,7 +6547,7 @@ namespace SingleRailRC static void TrackRightQuarterTurn160DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6591,21 +6591,21 @@ namespace SingleRailRC static void TrackLeftQuarterTurn160DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightQuarterTurn160DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn160DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn160DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftQuarterTurn160DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn160DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn190DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6657,7 +6657,7 @@ namespace SingleRailRC static void TrackRightQuarterTurn190DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6709,21 +6709,21 @@ namespace SingleRailRC static void TrackLeftQuarterTurn190DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightQuarterTurn190DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightQuarterTurn190DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn190DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftQuarterTurn190DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftQuarterTurn190DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6775,7 +6775,7 @@ namespace SingleRailRC static void Track25DegUpToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6827,7 +6827,7 @@ namespace SingleRailRC static void TrackLeftBanked25DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6879,7 +6879,7 @@ namespace SingleRailRC static void TrackRightBanked25DegUpTo25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6931,35 +6931,35 @@ namespace SingleRailRC static void TrackLeftBanked25DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7007,7 +7007,7 @@ namespace SingleRailRC static void TrackRightBankedFlatToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7055,7 +7055,7 @@ namespace SingleRailRC static void TrackLeftBanked25DegUpToLeftBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7103,7 +7103,7 @@ namespace SingleRailRC static void TrackRightBanked25DegUpToRightBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7151,35 +7151,35 @@ namespace SingleRailRC static void TrackLeftBankedFlatToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7227,7 +7227,7 @@ namespace SingleRailRC static void Track25DegUpRightBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7275,21 +7275,21 @@ namespace SingleRailRC static void Track25DegDownLeftBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7341,7 +7341,7 @@ namespace SingleRailRC static void TrackFlatToRightBanked25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7393,7 +7393,7 @@ namespace SingleRailRC static void TrackLeftBanked25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7445,7 +7445,7 @@ namespace SingleRailRC static void TrackRightBanked25DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -7497,35 +7497,35 @@ namespace SingleRailRC static void TrackFlatToLeftBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7623,7 +7623,7 @@ namespace SingleRailRC static void TrackRightBankedQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7727,23 +7727,23 @@ namespace SingleRailRC static void TrackLeftBankedQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn3Tile25DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn3Tile25DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn525DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7944,7 +7944,7 @@ namespace SingleRailRC static void TrackRightBankedQuarterTurn525DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8145,23 +8145,23 @@ namespace SingleRailRC static void TrackLeftBankedQuarterTurn525DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightBankedQuarterTurn525DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftBankedQuarterTurn525DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackSBendLeft( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8315,7 +8315,7 @@ namespace SingleRailRC static void TrackSBendRight( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8469,7 +8469,7 @@ namespace SingleRailRC static void TrackLeftHalfBankedHelixUpSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8736,7 +8736,7 @@ namespace SingleRailRC static void TrackRightHalfBankedHelixUpSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9003,7 +9003,7 @@ namespace SingleRailRC static void TrackLeftHalfBankedHelixDownSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -9011,12 +9011,12 @@ namespace SingleRailRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightHalfBankedHelixDownSmall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -9024,12 +9024,12 @@ namespace SingleRailRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftHalfBankedHelixUpLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9441,7 +9441,7 @@ namespace SingleRailRC } static void TrackRightHalfBankedHelixUpLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9866,7 +9866,7 @@ namespace SingleRailRC static void TrackLeftHalfBankedHelixDownLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9874,12 +9874,12 @@ namespace SingleRailRC direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightHalfBankedHelixDownLarge( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -9887,12 +9887,12 @@ namespace SingleRailRC direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftBarrelRollUpToDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10073,7 +10073,7 @@ namespace SingleRailRC static void TrackRightBarrelRollUpToDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10254,21 +10254,21 @@ namespace SingleRailRC static void TrackLeftBarrelRollDownToUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackHalfLoopUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10409,14 +10409,14 @@ namespace SingleRailRC static void TrackHalfLoopDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackHalfLoopUp(session, ride, 3 - trackSequence, direction, height, tileElement); + TrackHalfLoopUp(session, ride, 3 - trackSequence, direction, height, trackElement); } static void TrackBrakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10445,7 +10445,7 @@ namespace SingleRailRC static void TrackOnRidePhoto( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10494,7 +10494,7 @@ namespace SingleRailRC 0, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -10502,7 +10502,7 @@ namespace SingleRailRC static void TrackFlatTo60DegUpLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10671,7 +10671,7 @@ namespace SingleRailRC } static void Track60DegUpToFlatLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10841,21 +10841,21 @@ namespace SingleRailRC static void TrackFlatTo60DegDownLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -10884,7 +10884,7 @@ namespace SingleRailRC static void TrackLeftCorkscrewUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11001,7 +11001,7 @@ namespace SingleRailRC static void TrackRightCorkscrewUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11116,21 +11116,21 @@ namespace SingleRailRC static void TrackLeftCorkscrewDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightCorkscrewUp(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + TrackRightCorkscrewUp(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightCorkscrewDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftCorkscrewUp(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + TrackLeftCorkscrewUp(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11239,14 +11239,14 @@ namespace SingleRailRC static void TrackInvertedFlatTo90DegQuarterLoopDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, tileElement); + Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11348,7 +11348,7 @@ namespace SingleRailRC static void TrackRightBankToRightQuarterTurn3Tile25DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11450,7 +11450,7 @@ namespace SingleRailRC static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11552,7 +11552,7 @@ namespace SingleRailRC static void TrackRightQuarterTurn3Tile25DegDownToRightBank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11654,7 +11654,7 @@ namespace SingleRailRC static void TrackLeftLargeHalfLoopUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11926,7 +11926,7 @@ namespace SingleRailRC static void TrackRightLargeHalfLoopUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12198,23 +12198,23 @@ namespace SingleRailRC static void TrackRightLargeHalfLoopDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackRightLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, tileElement); + TrackRightLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackLeftLargeHalfLoopDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackLeftLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, tileElement); + TrackLeftLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackFlatTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12321,9 +12321,9 @@ namespace SingleRailRC static void Track60DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12416,26 +12416,26 @@ namespace SingleRailRC static void TrackFlatTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - Track60DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + Track60DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - TrackFlatTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + TrackFlatTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatTo60DegUp( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12465,7 +12465,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12495,7 +12495,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12525,7 +12525,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12587,12 +12587,12 @@ namespace SingleRailRC static void TrackDiag60DegUpToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12622,7 +12622,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12652,7 +12652,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12682,7 +12682,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12744,12 +12744,12 @@ namespace SingleRailRC static void TrackDiagFlatTo60DegDown( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12779,7 +12779,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12809,7 +12809,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12839,7 +12839,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12901,12 +12901,12 @@ namespace SingleRailRC static void TrackDiag60DegDownToFlat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12936,7 +12936,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12966,7 +12966,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -12996,7 +12996,7 @@ namespace SingleRailRC paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index 46b5e5d675..b1dad02567 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -33,9 +33,9 @@ static constexpr const uint32_t _StandUpBlockBrakeImages[NumOrthogonalDirections /** rct2: 0x008A7114 */ static void stand_up_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -90,7 +90,7 @@ static void stand_up_rc_track_flat( /** rct2: 0x008A7384, 0x008A7394, 0x008A73A4 */ static void stand_up_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { 25567, SPR_STATION_BASE_A_SW_NE }, @@ -99,9 +99,9 @@ static void stand_up_rc_track_station( { 25568, SPR_STATION_BASE_A_NW_SE }, }; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, _StandUpBlockBrakeImages[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 6, height + 3); @@ -115,7 +115,7 @@ static void stand_up_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -124,9 +124,9 @@ static void stand_up_rc_track_station( /** rct2: 0x008A7124 */ static void stand_up_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -194,9 +194,9 @@ static void stand_up_rc_track_25_deg_up( /** rct2: 0x008A7134 */ static void stand_up_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -264,9 +264,9 @@ static void stand_up_rc_track_60_deg_up( /** rct2: 0x008A7144 */ static void stand_up_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -334,9 +334,9 @@ static void stand_up_rc_track_flat_to_25_deg_up( /** rct2: 0x008A7154 */ static void stand_up_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -412,9 +412,9 @@ static void stand_up_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A7164 */ static void stand_up_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -490,9 +490,9 @@ static void stand_up_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A7174 */ static void stand_up_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -560,55 +560,55 @@ static void stand_up_rc_track_25_deg_up_to_flat( /** rct2: 0x008A7184 */ static void stand_up_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7194 */ static void stand_up_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A71A4 */ static void stand_up_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A71B4 */ static void stand_up_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A71C4 */ static void stand_up_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A71D4 */ static void stand_up_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A71E4 */ static void stand_up_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -765,16 +765,16 @@ static void stand_up_rc_track_left_quarter_turn_5( /** rct2: 0x008A71F4 */ static void stand_up_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7204 */ static void stand_up_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -808,7 +808,7 @@ static void stand_up_rc_track_flat_to_left_bank( /** rct2: 0x008A7214 */ static void stand_up_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -842,7 +842,7 @@ static void stand_up_rc_track_flat_to_right_bank( /** rct2: 0x008A7224 */ static void stand_up_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -876,7 +876,7 @@ static void stand_up_rc_track_left_bank_to_flat( /** rct2: 0x008A7234 */ static void stand_up_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -910,7 +910,7 @@ static void stand_up_rc_track_right_bank_to_flat( /** rct2: 0x008A7244 */ static void stand_up_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1084,16 +1084,16 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008A7254 */ static void stand_up_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_banked_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7264 */ static void stand_up_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1134,7 +1134,7 @@ static void stand_up_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008A7274 */ static void stand_up_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1175,7 +1175,7 @@ static void stand_up_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008A7284 */ static void stand_up_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1216,7 +1216,7 @@ static void stand_up_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008A7294 */ static void stand_up_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1257,39 +1257,39 @@ static void stand_up_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008A72A4 */ static void stand_up_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A72B4 */ static void stand_up_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A72C4 */ static void stand_up_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A72D4 */ static void stand_up_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A72E4 */ static void stand_up_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1323,20 +1323,20 @@ static void stand_up_rc_track_left_bank( /** rct2: 0x008A72F4 */ static void stand_up_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A7304 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1396,7 +1396,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1448,7 +1448,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1500,7 +1500,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 5: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1552,7 +1552,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 6: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1619,12 +1619,12 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A7314 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1684,7 +1684,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1736,7 +1736,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1788,7 +1788,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 5: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1840,7 +1840,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 6: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1907,25 +1907,25 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A7324 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7334 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7344 */ static void stand_up_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2060,7 +2060,7 @@ static void stand_up_rc_track_s_bend_left( /** rct2: 0x008A7354 */ static void stand_up_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2195,7 +2195,7 @@ static void stand_up_rc_track_s_bend_right( /** rct2: 0x008A7364 */ static void stand_up_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2452,7 +2452,7 @@ static void stand_up_rc_track_left_vertical_loop( /** rct2: 0x008A7374 */ static void stand_up_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2677,7 +2677,7 @@ static void stand_up_rc_track_right_vertical_loop( /** rct2: 0x008A73B4 */ static void stand_up_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2777,16 +2777,16 @@ static void stand_up_rc_track_left_quarter_turn_3( /** rct2: 0x008A73C4 */ static void stand_up_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A73D4 */ static void stand_up_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2898,21 +2898,21 @@ static void stand_up_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008A73E4 */ static void stand_up_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A73F4 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2975,7 +2975,7 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3042,12 +3042,12 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A7404 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3110,7 +3110,7 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3189,25 +3189,25 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A7414 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7424 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7434 */ static void stand_up_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3333,15 +3333,15 @@ static void stand_up_rc_track_half_loop_up( /** rct2: 0x008A7444 */ static void stand_up_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, tileElement); + stand_up_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); } /** rct2: 0x008A7454 */ static void stand_up_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3453,7 +3453,7 @@ static void stand_up_rc_track_left_corkscrew_up( /** rct2: 0x008A7464 */ static void stand_up_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3566,23 +3566,23 @@ static void stand_up_rc_track_right_corkscrew_up( /** rct2: 0x008A7474 */ static void stand_up_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7484 */ static void stand_up_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - stand_up_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7734 */ static void stand_up_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3800,7 +3800,7 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008A7744 */ static void stand_up_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4018,7 +4018,7 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008A7754 */ static void stand_up_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4026,13 +4026,13 @@ static void stand_up_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7764 */ static void stand_up_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4040,13 +4040,13 @@ static void stand_up_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - stand_up_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A76F4 */ static void stand_up_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4388,7 +4388,7 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008A7704 */ static void stand_up_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4730,7 +4730,7 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008A7714 */ static void stand_up_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4738,13 +4738,13 @@ static void stand_up_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + stand_up_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A7724 */ static void stand_up_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -4752,13 +4752,13 @@ static void stand_up_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - stand_up_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + stand_up_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A7494 */ static void stand_up_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4786,7 +4786,7 @@ static void stand_up_rc_track_brakes( /** rct2: 0x008A74A4 */ static void stand_up_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -4819,7 +4819,7 @@ static void stand_up_rc_track_on_ride_photo( session, direction, session->TrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 1, height, 0, 6, height + 3); break; } - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -4828,7 +4828,7 @@ static void stand_up_rc_track_on_ride_photo( /** rct2: 0x008A74B4 */ static void stand_up_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4967,7 +4967,7 @@ static void stand_up_rc_track_left_eighth_to_diag( /** rct2: 0x008A74C4 */ static void stand_up_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5105,25 +5105,25 @@ static void stand_up_rc_track_right_eighth_to_diag( /** rct2: 0x008A74D4 */ static void stand_up_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A74E4 */ static void stand_up_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + stand_up_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A76A4 */ static void stand_up_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5265,7 +5265,7 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008A76B4 */ static void stand_up_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5406,30 +5406,30 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008A76C4 */ static void stand_up_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + stand_up_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A76D4 */ static void stand_up_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - stand_up_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + stand_up_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A74F4 */ static void stand_up_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5456,7 +5456,7 @@ static void stand_up_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5483,7 +5483,7 @@ static void stand_up_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5510,7 +5510,7 @@ static void stand_up_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5570,12 +5570,12 @@ static void stand_up_rc_track_diag_flat( /** rct2: 0x008A7524 */ static void stand_up_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5602,7 +5602,7 @@ static void stand_up_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5629,7 +5629,7 @@ static void stand_up_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5656,7 +5656,7 @@ static void stand_up_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5716,12 +5716,12 @@ static void stand_up_rc_track_diag_25_deg_up( /** rct2: 0x008A7584 */ static void stand_up_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5748,7 +5748,7 @@ static void stand_up_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5775,7 +5775,7 @@ static void stand_up_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5802,7 +5802,7 @@ static void stand_up_rc_track_diag_60_deg_up( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5862,12 +5862,12 @@ static void stand_up_rc_track_diag_60_deg_up( /** rct2: 0x008A7504 */ static void stand_up_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5894,7 +5894,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5921,7 +5921,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -5948,7 +5948,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6008,12 +6008,12 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A7564 */ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6040,7 +6040,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6067,7 +6067,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6094,7 +6094,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6154,12 +6154,12 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A7574 */ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6186,7 +6186,7 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6213,7 +6213,7 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6240,7 +6240,7 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6300,12 +6300,12 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A7514 */ static void stand_up_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6332,7 +6332,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6359,7 +6359,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6386,7 +6386,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6446,12 +6446,12 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A7554 */ static void stand_up_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6478,7 +6478,7 @@ static void stand_up_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6505,7 +6505,7 @@ static void stand_up_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6532,7 +6532,7 @@ static void stand_up_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6592,12 +6592,12 @@ static void stand_up_rc_track_diag_25_deg_down( /** rct2: 0x008A75B4 */ static void stand_up_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6624,7 +6624,7 @@ static void stand_up_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6651,7 +6651,7 @@ static void stand_up_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6678,7 +6678,7 @@ static void stand_up_rc_track_diag_60_deg_down( paint_util_set_general_support_height(session, height + 104, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6738,12 +6738,12 @@ static void stand_up_rc_track_diag_60_deg_down( /** rct2: 0x008A7534 */ static void stand_up_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6769,7 +6769,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6795,7 +6795,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6821,7 +6821,7 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6882,12 +6882,12 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A7594 */ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6914,7 +6914,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6941,7 +6941,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -6968,7 +6968,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7028,12 +7028,12 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A75A4 */ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7060,7 +7060,7 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7087,7 +7087,7 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7114,7 +7114,7 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7174,12 +7174,12 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A7544 */ static void stand_up_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7206,7 +7206,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7233,7 +7233,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7260,7 +7260,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7320,7 +7320,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A75E4 */ static void stand_up_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7399,7 +7399,7 @@ static void stand_up_rc_track_diag_flat_to_left_bank( /** rct2: 0x008A75F4 */ static void stand_up_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7478,7 +7478,7 @@ static void stand_up_rc_track_diag_flat_to_right_bank( /** rct2: 0x008A7604 */ static void stand_up_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7557,7 +7557,7 @@ static void stand_up_rc_track_diag_left_bank_to_flat( /** rct2: 0x008A7614 */ static void stand_up_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7636,7 +7636,7 @@ static void stand_up_rc_track_diag_right_bank_to_flat( /** rct2: 0x008A7644 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7715,7 +7715,7 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008A7654 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7794,7 +7794,7 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008A7624 */ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7873,7 +7873,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008A7634 */ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7952,7 +7952,7 @@ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008A7664 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8029,7 +8029,7 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008A7674 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8106,7 +8106,7 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008A7684 */ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8185,7 +8185,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008A7694 */ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8264,7 +8264,7 @@ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008A75C4 */ static void stand_up_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8340,7 +8340,7 @@ static void stand_up_rc_track_diag_left_bank( /** rct2: 0x008A75D4 */ static void stand_up_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8416,9 +8416,9 @@ static void stand_up_rc_track_diag_right_bank( /** rct2: 0x008A76E4 */ static void stand_up_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _StandUpBlockBrakeImages[direction][isClosed], 0, 6, 32, 20, 3, height); diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index 03d3549b5d..5c687cc0da 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -21,9 +21,9 @@ /** rct2: 0x008A59A8 */ static void steeplechase_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -71,7 +71,7 @@ static void steeplechase_track_flat( static void steeplechase_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { 28635, SPR_STATION_BASE_B_SW_NE }, @@ -87,7 +87,7 @@ static void steeplechase_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 3, height, 0, 0, height); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -96,9 +96,9 @@ static void steeplechase_track_station( /** rct2: 0x008A59B8 */ static void steeplechase_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -174,9 +174,9 @@ static void steeplechase_track_25_deg_up( /** rct2: 0x008A59C8 */ static void steeplechase_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -252,9 +252,9 @@ static void steeplechase_track_flat_to_25_deg_up( /** rct2: 0x008A59D8 */ static void steeplechase_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -330,31 +330,31 @@ static void steeplechase_track_25_deg_up_to_flat( /** rct2: 0x008A59E8 */ static void steeplechase_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - steeplechase_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A59F8 */ static void steeplechase_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - steeplechase_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5A08 */ static void steeplechase_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - steeplechase_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5A18 */ static void steeplechase_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -525,16 +525,16 @@ static void steeplechase_track_left_quarter_turn_5( /** rct2: 0x008A5A28 */ static void steeplechase_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - steeplechase_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + steeplechase_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A5A38 */ static void steeplechase_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -683,7 +683,7 @@ static void steeplechase_track_s_bend_left( /** rct2: 0x008A5A48 */ static void steeplechase_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -832,7 +832,7 @@ static void steeplechase_track_s_bend_right( /** rct2: 0x008A5A88 */ static void steeplechase_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -946,16 +946,16 @@ static void steeplechase_track_left_quarter_turn_3( /** rct2: 0x008A5A98 */ static void steeplechase_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - steeplechase_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + steeplechase_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A5AA8 */ static void steeplechase_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -982,7 +982,7 @@ static void steeplechase_track_brakes( /** rct2: 0x008A5AD8 */ static void steeplechase_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1128,7 +1128,7 @@ static void steeplechase_track_left_eighth_to_diag( /** rct2: 0x008A5AE8 */ static void steeplechase_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1273,30 +1273,30 @@ static void steeplechase_track_right_eighth_to_diag( /** rct2: 0x008A5AF8 */ static void steeplechase_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - steeplechase_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + steeplechase_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5B08 */ static void steeplechase_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - steeplechase_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + steeplechase_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A5AC8 */ static void steeplechase_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1323,7 +1323,7 @@ static void steeplechase_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1350,7 +1350,7 @@ static void steeplechase_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1377,7 +1377,7 @@ static void steeplechase_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1437,12 +1437,12 @@ static void steeplechase_track_diag_flat( /** rct2: 0x008A5B38 */ static void steeplechase_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1469,7 +1469,7 @@ static void steeplechase_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1496,7 +1496,7 @@ static void steeplechase_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1523,7 +1523,7 @@ static void steeplechase_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1583,12 +1583,12 @@ static void steeplechase_track_diag_25_deg_up( /** rct2: 0x008A5B18 */ static void steeplechase_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1615,7 +1615,7 @@ static void steeplechase_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1642,7 +1642,7 @@ static void steeplechase_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1669,7 +1669,7 @@ static void steeplechase_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1729,12 +1729,12 @@ static void steeplechase_track_diag_flat_to_25_deg_up( /** rct2: 0x008A5B28 */ static void steeplechase_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1761,7 +1761,7 @@ static void steeplechase_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1788,7 +1788,7 @@ static void steeplechase_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1815,7 +1815,7 @@ static void steeplechase_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1875,12 +1875,12 @@ static void steeplechase_track_diag_25_deg_up_to_flat( /** rct2: 0x008A5B68 */ static void steeplechase_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1907,7 +1907,7 @@ static void steeplechase_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1934,7 +1934,7 @@ static void steeplechase_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -1961,7 +1961,7 @@ static void steeplechase_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2021,12 +2021,12 @@ static void steeplechase_track_diag_25_deg_down( /** rct2: 0x008A5B48 */ static void steeplechase_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2052,7 +2052,7 @@ static void steeplechase_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2078,7 +2078,7 @@ static void steeplechase_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2104,7 +2104,7 @@ static void steeplechase_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2165,12 +2165,12 @@ static void steeplechase_track_diag_flat_to_25_deg_down( /** rct2: 0x008A5B58 */ static void steeplechase_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2197,7 +2197,7 @@ static void steeplechase_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2224,7 +2224,7 @@ static void steeplechase_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2251,7 +2251,7 @@ static void steeplechase_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2311,7 +2311,7 @@ static void steeplechase_track_diag_25_deg_down_to_flat( /** rct2: 0x008A5AB8 */ static void steeplechase_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index d4ca4bcdcb..ac7f82eb50 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -21,9 +21,9 @@ /** rct2: 0x008A8958 */ static void suspended_swinging_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -74,7 +74,7 @@ static void suspended_swinging_rc_track_flat( /** rct2: 0x008A8AA8, 0x008A8AB8, 0x008A8AC8 */ static void suspended_swinging_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 25963, SPR_STATION_INVERTED_BAR_D_SW_NE }, @@ -92,7 +92,7 @@ static void suspended_swinging_rc_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -101,9 +101,9 @@ static void suspended_swinging_rc_track_station( /** rct2: 0x008A8968 */ static void suspended_swinging_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -195,7 +195,7 @@ static void suspended_swinging_rc_track_25_deg_up( /** rct2: 0x008A8978 */ static void suspended_swinging_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -236,9 +236,9 @@ static void suspended_swinging_rc_track_60_deg_up( /** rct2: 0x008A8988 */ static void suspended_swinging_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -330,7 +330,7 @@ static void suspended_swinging_rc_track_flat_to_25_deg_up( /** rct2: 0x008A8998 */ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -377,9 +377,9 @@ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008A89A8 */ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -483,9 +483,9 @@ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008A89B8 */ static void suspended_swinging_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -577,55 +577,55 @@ static void suspended_swinging_rc_track_25_deg_up_to_flat( /** rct2: 0x008A89C8 */ static void suspended_swinging_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A89D8 */ static void suspended_swinging_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A89E8 */ static void suspended_swinging_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A89F8 */ static void suspended_swinging_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A8A08 */ static void suspended_swinging_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A8A18 */ static void suspended_swinging_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_swinging_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A8A28 */ static void suspended_swinging_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -805,16 +805,16 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( /** rct2: 0x008A8A38 */ static void suspended_swinging_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - suspended_swinging_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_swinging_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A8A48 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -980,7 +980,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008A8A58 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1146,27 +1146,27 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008A8A68 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A8A78 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A8A88 */ static void suspended_swinging_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1325,7 +1325,7 @@ static void suspended_swinging_rc_track_s_bend_left( /** rct2: 0x008A8A98 */ static void suspended_swinging_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1484,7 +1484,7 @@ static void suspended_swinging_rc_track_s_bend_right( /** rct2: 0x008A8AD8 */ static void suspended_swinging_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1603,16 +1603,16 @@ static void suspended_swinging_rc_track_left_quarter_turn_3( /** rct2: 0x008A8AE8 */ static void suspended_swinging_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - suspended_swinging_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_swinging_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A8AF8 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1699,7 +1699,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008A8B08 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1786,27 +1786,27 @@ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008A8B18 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008A8B28 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1838,7 +1838,7 @@ static void suspended_swinging_rc_track_brakes( /** rct2: 0x008A8B48 */ static void suspended_swinging_rc_track_left_quarter_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2023,7 +2023,7 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( /** rct2: 0x008A8B58 */ static void suspended_swinging_rc_track_right_quarter_helix_large_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2208,7 +2208,7 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( /** rct2: 0x008A8B68 */ static void suspended_swinging_rc_track_left_quarter_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2393,7 +2393,7 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( /** rct2: 0x008A8B78 */ static void suspended_swinging_rc_track_right_quarter_helix_large_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2578,7 +2578,7 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( /** rct2: 0x008A8B88 */ static void suspended_swinging_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2741,7 +2741,7 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( /** rct2: 0x008A8B98 */ static void suspended_swinging_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2904,30 +2904,30 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( /** rct2: 0x008A8BA8 */ static void suspended_swinging_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_swinging_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_swinging_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A8BB8 */ static void suspended_swinging_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_swinging_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + suspended_swinging_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008A8BC8 */ static void suspended_swinging_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2954,7 +2954,7 @@ static void suspended_swinging_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -2981,7 +2981,7 @@ static void suspended_swinging_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3008,7 +3008,7 @@ static void suspended_swinging_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3061,12 +3061,12 @@ static void suspended_swinging_rc_track_diag_flat( /** rct2: 0x008A8BF8 */ static void suspended_swinging_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3093,7 +3093,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3120,7 +3120,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3147,7 +3147,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3200,7 +3200,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up( /** rct2: 0x008A8C58 */ static void suspended_swinging_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3283,12 +3283,12 @@ static void suspended_swinging_rc_track_diag_60_deg_up( /** rct2: 0x008A8BD8 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3315,7 +3315,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3342,7 +3342,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3369,7 +3369,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3422,7 +3422,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008A8C38 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3505,7 +3505,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008A8C48 */ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3588,12 +3588,12 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008A8BE8 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3620,7 +3620,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3647,7 +3647,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3674,7 +3674,7 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3727,12 +3727,12 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008A8C28 */ static void suspended_swinging_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3759,7 +3759,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3786,7 +3786,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3813,7 +3813,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 72, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3866,7 +3866,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down( /** rct2: 0x008A8C88 */ static void suspended_swinging_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3928,12 +3928,12 @@ static void suspended_swinging_rc_track_diag_60_deg_down( /** rct2: 0x008A8C08 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3959,7 +3959,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -3985,7 +3985,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4011,7 +4011,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4064,7 +4064,7 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008A8C68 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4147,7 +4147,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008A8C78 */ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4230,12 +4230,12 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008A8C18 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4262,7 +4262,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4289,7 +4289,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4316,7 +4316,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 64, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -4369,7 +4369,7 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { diff --git a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp index 5d95d7eb23..e3a9e51577 100644 --- a/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/TwisterRollerCoaster.cpp @@ -22,1580 +22,1585 @@ /** rct2: 0x008AB6A4 */ static void twister_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8F4, 0x008AB904, 0x008AB914 */ static void twister_rc_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6B4 */ static void twister_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6C4 */ static void twister_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6D4 */ static void twister_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6E4 */ static void twister_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB6F4 */ static void twister_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB704 */ static void twister_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB714 */ static void twister_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB724 */ static void twister_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB734 */ static void twister_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB744 */ static void twister_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB754 */ static void twister_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB764 */ static void twister_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB774 */ static void twister_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB784 */ static void twister_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB794 */ static void twister_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7A4 */ static void twister_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7B4 */ static void twister_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7C4 */ static void twister_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7D4 */ static void twister_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7E4 */ static void twister_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB7F4 */ static void twister_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB804 */ static void twister_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB814 */ static void twister_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB824 */ static void twister_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB834 */ static void twister_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB844 */ static void twister_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB854 */ static void twister_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB864 */ static void twister_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB874 */ static void twister_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB884 */ static void twister_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB894 */ static void twister_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8A4 */ static void twister_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8B4 */ static void twister_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8C4 */ static void twister_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8D4 */ static void twister_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB8E4 */ static void twister_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA84 */ static void twister_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_vertical_loop( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA94 */ static void twister_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_vertical_loop( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB924 */ static void twister_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB934 */ static void twister_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB944 */ static void twister_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB954 */ static void twister_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB964 */ static void twister_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB974 */ static void twister_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB984 */ static void twister_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB994 */ static void twister_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9A4 */ static void twister_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9B4 */ static void twister_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9C4 */ static void twister_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9D4 */ static void twister_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9E4 */ static void twister_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AB9F4 */ static void twister_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA04 */ static void twister_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA14 */ static void twister_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA44 */ static void twister_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA24 */ static void twister_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA34 */ static void twister_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA54 */ static void twister_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA64 */ static void twister_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE04 */ static void twister_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE14 */ static void twister_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABA74 */ static void twister_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE24 */ static void twister_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE34 */ static void twister_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE44 */ static void twister_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE54 */ static void twister_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE64 */ static void twister_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE74 */ static void twister_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE84 */ static void twister_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABE94 */ static void twister_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAB4 */ static void twister_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAC4 */ static void twister_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAD4 */ static void twister_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAE4 */ static void twister_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAF4 */ static void twister_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB04 */ static void twister_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB14 */ static void twister_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB24 */ static void twister_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABAA4 */ static void twister_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB54 */ static void twister_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_25_deg_up( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBB4 */ static void twister_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_60_deg_up( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB34 */ static void twister_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB94 */ static void twister_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBA4 */ static void twister_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB44 */ static void twister_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB84 */ static void twister_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBE4 */ static void twister_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB64 */ static void twister_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBC4 */ static void twister_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBD4 */ static void twister_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABB74 */ static void twister_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC14 */ static void twister_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC24 */ static void twister_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC34 */ static void twister_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC44 */ static void twister_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC74 */ static void twister_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC84 */ static void twister_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC54 */ static void twister_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC64 */ static void twister_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC94 */ static void twister_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCA4 */ static void twister_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCB4 */ static void twister_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCC4 */ static void twister_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABBF4 */ static void twister_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_diag_left_bank( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABC04 */ static void twister_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD74 */ static void twister_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD84 */ static void twister_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD94 */ static void twister_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDA4 */ static void twister_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0E4 */ static void twister_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEA4 */ static void twister_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEB4 */ static void twister_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEC4 */ static void twister_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABED4 */ static void twister_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEE4 */ static void twister_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABEF4 */ static void twister_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF04 */ static void twister_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF14 */ static void twister_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF24 */ static void twister_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF34 */ static void twister_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF44 */ static void twister_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF54 */ static void twister_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF64 */ static void twister_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF74 */ static void twister_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF84 */ static void twister_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABF94 */ static void twister_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFA4 */ static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFB4 */ static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFE4 */ static void twister_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFF4 */ static void twister_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC004 */ static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC014 */ static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFC4 */ static void twister_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABFD4 */ static void twister_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC024 */ static void twister_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC034 */ static void twister_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC044 */ static void twister_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC054 */ static void twister_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC064 */ static void twister_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC074 */ static void twister_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC084 */ static void twister_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC094 */ static void twister_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0A4 */ static void twister_rc_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0B4 */ static void twister_rc_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0C4 */ static void twister_rc_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0D4 */ static void twister_rc_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /* The following track elements used to be specific to the Vertical Roller Coaster */ static void twister_rc_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_brake_for_drop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_brake_for_drop(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_brake_for_drop( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /* The following track elements used to be specific to the Steel Twister */ /** rct2: 0x008ABCD4 */ static void twister_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCE4 */ static void twister_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_half_loop_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_half_loop_down( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD34 */ static void twister_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD44 */ static void twister_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD54 */ static void twister_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD64 */ static void twister_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC0F4 */ static void twister_rc_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC104 */ static void twister_rc_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC114 */ static void twister_rc_track_60_deg_down_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC124 */ static void twister_rc_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABCF4 */ static void twister_rc_track_left_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD04 */ static void twister_rc_track_right_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD14 */ static void twister_rc_track_left_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABD24 */ static void twister_rc_track_right_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDB4 */ static void twister_rc_track_powered_lift( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDC4 */ static void twister_rc_track_left_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDD4 */ static void twister_rc_track_right_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDE4 */ static void twister_rc_track_right_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008ABDF4 */ static void twister_rc_track_left_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC134 */ static void twister_rc_track_90_deg_to_inverted_flat_quarter_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } /** rct2: 0x008AC144 */ static void twister_rc_track_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } static void twister_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_TUBES); + bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_TUBES); } TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp b/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp index 6b8f4a7c91..5d6d1fa691 100644 --- a/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/VerticalDropRollerCoaster.cpp @@ -15,1567 +15,1572 @@ /** rct2: 0x008AA00C */ static void vertical_drop_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_flat(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_station(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA01C */ static void vertical_drop_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA02C */ static void vertical_drop_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA03C */ static void vertical_drop_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA04C */ static void vertical_drop_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA05C */ static void vertical_drop_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA06C */ static void vertical_drop_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA07C */ static void vertical_drop_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_25_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA08C */ static void vertical_drop_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_60_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA09C */ static void vertical_drop_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0AC */ static void vertical_drop_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0BC */ static void vertical_drop_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0CC */ static void vertical_drop_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0DC */ static void vertical_drop_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0EC */ static void vertical_drop_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA0FC */ static void vertical_drop_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA10C */ static void vertical_drop_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA11C */ static void vertical_drop_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA12C */ static void vertical_drop_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA13C */ static void vertical_drop_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_banked_left_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA14C */ static void vertical_drop_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_banked_right_quarter_turn_5( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA15C */ static void vertical_drop_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA16C */ static void vertical_drop_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA17C */ static void vertical_drop_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA18C */ static void vertical_drop_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA19C */ static void vertical_drop_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1AC */ static void vertical_drop_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1BC */ static void vertical_drop_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1CC */ static void vertical_drop_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1DC */ static void vertical_drop_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_left_bank(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1EC */ static void vertical_drop_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_right_bank(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA1FC */ static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA20C */ static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA21C */ static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA22C */ static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA23C */ static void vertical_drop_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_s_bend_left(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA24C */ static void vertical_drop_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_s_bend_right(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA49C */ static void vertical_drop_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_vertical_loop( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4AC */ static void vertical_drop_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_vertical_loop( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA28C */ static void vertical_drop_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA29C */ static void vertical_drop_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2AC */ static void vertical_drop_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2BC */ static void vertical_drop_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2CC */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2DC */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2EC */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA2FC */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA30C */ static void vertical_drop_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA31C */ static void vertical_drop_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA32C */ static void vertical_drop_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA33C */ static void vertical_drop_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_small( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA34C */ static void vertical_drop_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_up_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA35C */ static void vertical_drop_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_up_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA36C */ static void vertical_drop_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_half_banked_helix_down_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA37C */ static void vertical_drop_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_half_banked_helix_down_large( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3AC */ static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA38C */ static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA39C */ static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3BC */ static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA40C */ static void vertical_drop_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_brakes(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7EC */ static void vertical_drop_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_left_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7FC */ static void vertical_drop_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_right_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA41C */ static void vertical_drop_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_on_ride_photo(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA80C */ static void vertical_drop_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_left_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA81C */ static void vertical_drop_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_right_banked( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA42C */ static void vertical_drop_rc_track_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA43C */ static void vertical_drop_rc_track_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_90_deg_down(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA44C */ static void vertical_drop_rc_track_60_deg_up_to_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA45C */ static void vertical_drop_rc_track_90_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA46C */ static void vertical_drop_rc_track_90_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA47C */ static void vertical_drop_rc_track_60_deg_down_to_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4CC */ static void vertical_drop_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4DC */ static void vertical_drop_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4EC */ static void vertical_drop_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4FC */ static void vertical_drop_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA50C */ static void vertical_drop_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA51C */ static void vertical_drop_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_diag( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA52C */ static void vertical_drop_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA53C */ static void vertical_drop_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA4BC */ static void vertical_drop_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_flat(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA56C */ static void vertical_drop_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_25_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_25_deg_up( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5CC */ static void vertical_drop_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_60_deg_up( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA54C */ static void vertical_drop_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5AC */ static void vertical_drop_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5BC */ static void vertical_drop_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA55C */ static void vertical_drop_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA59C */ static void vertical_drop_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5FC */ static void vertical_drop_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA57C */ static void vertical_drop_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5DC */ static void vertical_drop_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA5EC */ static void vertical_drop_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA58C */ static void vertical_drop_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA62C */ static void vertical_drop_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA63C */ static void vertical_drop_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA64C */ static void vertical_drop_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA65C */ static void vertical_drop_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA68C */ static void vertical_drop_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA69C */ static void vertical_drop_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA66C */ static void vertical_drop_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA67C */ static void vertical_drop_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6AC */ static void vertical_drop_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6BC */ static void vertical_drop_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6CC */ static void vertical_drop_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6DC */ static void vertical_drop_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA60C */ static void vertical_drop_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_diag_left_bank(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_diag_left_bank( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA61C */ static void vertical_drop_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA72C */ static void vertical_drop_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA73C */ static void vertical_drop_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA74C */ static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA75C */ static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9EC */ static void vertical_drop_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_block_brakes(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA96C */ static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA97C */ static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA98C */ static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA99C */ static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8AC */ static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8BC */ static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8CC */ static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8DC */ static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA82C */ static void vertical_drop_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA83C */ static void vertical_drop_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA84C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA85C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA86C */ static void vertical_drop_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA87C */ static void vertical_drop_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA88C */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA89C */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8EC */ static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA8FC */ static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA92C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA93C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA94C */ static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA95C */ static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA90C */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA91C */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA76C */ static void vertical_drop_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA77C */ static void vertical_drop_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA78C */ static void vertical_drop_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA79C */ static void vertical_drop_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7AC */ static void vertical_drop_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7BC */ static void vertical_drop_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7CC */ static void vertical_drop_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA7DC */ static void vertical_drop_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9AC */ static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9BC */ static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9CC */ static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA9DC */ static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /* The following elements used to be specific to the vertical_drop RC */ /** rct2: 0x008AA3CC */ static void vertical_drop_rc_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3DC */ static void vertical_drop_rc_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3EC */ static void vertical_drop_rc_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA3FC */ static void vertical_drop_rc_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA48C */ static void vertical_drop_rc_track_brake_for_drop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_brake_for_drop(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_brake_for_drop( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6EC */ static void vertical_drop_rc_track_diag_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA6FC */ static void vertical_drop_rc_track_diag_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA70C */ static void vertical_drop_rc_track_diag_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_flat_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /** rct2: 0x008AA71C */ static void vertical_drop_rc_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_diag_60_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } /* The following elements used to be specific to the steel twister RC */ static void vertical_drop_rc_track_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_half_loop_up(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_half_loop_down(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_half_loop_down( + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_corkscrew_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_corkscrew_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_flat_to_60_deg_up_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_60_deg_up_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_60_deg_down_to_flat_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_down_long_base( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_flat_to_60_deg_down_long_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat_long_base122( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_up_to_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_barrel_roll_up_to_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_up_to_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_barrel_roll_down_to_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_barrel_roll_down_to_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_barrel_roll_down_to_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_powered_lift( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_powered_lift(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_large_half_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_right_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_left_large_half_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_90_deg_to_inverted_flat_quarter_loop_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_inverted_flat_to_90_deg_quarter_loop_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } static void vertical_drop_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, tileElement, METAL_SUPPORTS_BOXED); + bolliger_mabillard_track_booster(session, ride, trackSequence, direction, height, trackElement, METAL_SUPPORTS_BOXED); } TRACK_PAINT_FUNCTION get_track_paint_function_vertical_drop_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index d819d7ce8e..a503b317d6 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -210,10 +210,10 @@ void vehicle_visual_virginia_reel( /** rct2: 0x00811264 */ static void paint_virginia_reel_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint32_t* sprites = virginia_reel_track_pieces_flat; - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { sprites = virginia_reel_track_pieces_flat_lift_hill; } @@ -239,10 +239,10 @@ static void paint_virginia_reel_track_flat( /** rct2: 0x00811274 */ static void paint_virginia_reel_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint32_t* sprites = virginia_reel_track_pieces_25_deg_up; - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { sprites = virginia_reel_track_pieces_25_deg_up_lift_hill; } @@ -291,10 +291,10 @@ static void paint_virginia_reel_track_25_deg_up( /** rct2: 0x00811294 */ static void paint_virginia_reel_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint32_t* sprites = virginia_reel_track_pieces_flat_to_25_deg_up; - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { sprites = virginia_reel_track_pieces_flat_to_25_deg_up_lift_hill; } @@ -338,10 +338,10 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( /** rct2: 0x00811294 */ static void paint_virginia_reel_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint32_t* sprites = virginia_reel_track_pieces_25_deg_up_to_flat; - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { sprites = virginia_reel_track_pieces_25_deg_up_to_flat_lift_hill; } @@ -390,31 +390,31 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( /** rct2: 0x008112A4 */ static void paint_virginia_reel_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_virginia_reel_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008112B4 */ static void paint_virginia_reel_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_virginia_reel_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008112C4 */ static void paint_virginia_reel_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_virginia_reel_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_virginia_reel_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008112D4, 0x008112E4, 0x008112F4 */ static void paint_virginia_reel_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -440,7 +440,7 @@ static void paint_virginia_reel_station( } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -451,7 +451,7 @@ static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { 5, /** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 2, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -481,16 +481,17 @@ static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_ /** rct2: 0x00811314 */ static void paint_virginia_reel_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = virginia_reel_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; - paint_virginia_reel_track_left_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_virginia_reel_track_left_quarter_turn_3_tiles( + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** rct2: 0x00811324 */ static void paint_virginia_reel_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 2, height, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -523,9 +524,9 @@ static void paint_virginia_reel_track_left_quarter_turn_1_tile( /** rct2: 0x00811334 */ static void paint_virginia_reel_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_virginia_reel_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_virginia_reel_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 1f4a704fc6..2549271f94 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -166,7 +166,7 @@ static constexpr const uint32_t _wild_mouse_block_brakes_image_ids[NumOrthogonal /** rct2: 0x0078B1E4 */ static void wild_mouse_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_FLAT_SW_NE, SPR_WILD_MOUSE_FLAT_CHAIN_SW_NE }, @@ -175,7 +175,7 @@ static void wild_mouse_track_flat( { SPR_WILD_MOUSE_FLAT_NW_SE, SPR_WILD_MOUSE_FLAT_CHAIN_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); if (track_paint_util_should_paint_supports(session->MapPosition)) @@ -190,7 +190,7 @@ static void wild_mouse_track_flat( static void wild_mouse_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t baseImageIds[4] = { SPR_STATION_BASE_B_SW_NE, @@ -199,13 +199,13 @@ static void wild_mouse_track_station( SPR_STATION_BASE_B_NW_SE, }; - int32_t trackType = tileElement->AsTrack()->GetTrackType(); + int32_t trackType = trackElement.GetTrackType(); PaintAddImageAsParentRotated( session, direction, baseImageIds[direction] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 2, height - 2, 0, 2, height); if (trackType == TrackElemType::EndStation) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsChildRotated( session, direction, _wild_mouse_block_brakes_image_ids[direction][isClosed] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 2, height, 0, 0, height); @@ -217,7 +217,7 @@ static void wild_mouse_track_station( height, 0, 0, height); } track_paint_util_draw_station_metal_supports(session, direction, height, session->TrackColours[SCHEME_SUPPORTS]); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -226,7 +226,7 @@ static void wild_mouse_track_station( /** rct2: 0x0078B1F4 */ static void wild_mouse_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_25_DEG_SW_NE, SPR_WILD_MOUSE_25_DEG_CHAIN_SW_NE }, @@ -235,7 +235,7 @@ static void wild_mouse_track_25_deg_up( { SPR_WILD_MOUSE_25_DEG_SE_NW, SPR_WILD_MOUSE_25_DEG_CHAIN_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); if (track_paint_util_should_paint_supports(session->MapPosition)) @@ -258,7 +258,7 @@ static void wild_mouse_track_25_deg_up( /** rct2: 0x0078B204 */ static void wild_mouse_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_60_DEG_SW_NE, SPR_WILD_MOUSE_60_DEG_CHAIN_SW_NE }, @@ -267,7 +267,7 @@ static void wild_mouse_track_60_deg_up( { SPR_WILD_MOUSE_60_DEG_SE_NW, SPR_WILD_MOUSE_60_DEG_CHAIN_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) { @@ -304,7 +304,7 @@ static void wild_mouse_track_60_deg_up( /** rct2: 0x0078B214 */ static void wild_mouse_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_FLAT_TO_25_DEG_SW_NE, SPR_WILD_MOUSE_FLAT_TO_25_DEG_CHAIN_SW_NE }, @@ -313,7 +313,7 @@ static void wild_mouse_track_flat_to_25_deg_up( { SPR_WILD_MOUSE_FLAT_TO_25_DEG_SE_NW, SPR_WILD_MOUSE_FLAT_TO_25_DEG_CHAIN_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); if (track_paint_util_should_paint_supports(session->MapPosition)) @@ -336,7 +336,7 @@ static void wild_mouse_track_flat_to_25_deg_up( /** rct2: 0x0078B224 */ static void wild_mouse_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_25_DEG_TO_60_DEG_SW_NE, SPR_WILD_MOUSE_25_DEG_TO_60_DEG_CHAIN_SW_NE }, @@ -351,7 +351,7 @@ static void wild_mouse_track_25_deg_up_to_60_deg_up( { 0, 0 }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = frontImageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) @@ -383,7 +383,7 @@ static void wild_mouse_track_25_deg_up_to_60_deg_up( /** rct2: 0x0078B234 */ static void wild_mouse_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_60_DEG_TO_25_DEG_SW_NE, SPR_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_SW_NE }, @@ -398,7 +398,7 @@ static void wild_mouse_track_60_deg_up_to_25_deg_up( { 0, 0 }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = frontImageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) @@ -430,7 +430,7 @@ static void wild_mouse_track_60_deg_up_to_25_deg_up( /** rct2: 0x0078B244 */ static void wild_mouse_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_25_DEG_TO_FLAT_SW_NE, SPR_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_SW_NE }, @@ -439,7 +439,7 @@ static void wild_mouse_track_25_deg_up_to_flat( { SPR_WILD_MOUSE_25_DEG_TO_FLAT_SE_NW, SPR_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); if (track_paint_util_should_paint_supports(session->MapPosition)) @@ -462,54 +462,54 @@ static void wild_mouse_track_25_deg_up_to_flat( /** rct2: 0x0078B254 */ static void wild_mouse_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B264 */ static void wild_mouse_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B274 */ static void wild_mouse_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B284 */ static void wild_mouse_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B294 */ static void wild_mouse_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B2A4 */ static void wild_mouse_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wild_mouse_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -565,7 +565,7 @@ static void wild_mouse_track_right_quarter_turn_3( static void wild_mouse_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][2] = { { @@ -624,16 +624,16 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( static void wild_mouse_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3_25_deg_down(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3_25_deg_down(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x0078B314 */ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][2] = { { @@ -703,24 +703,24 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x0078B324 */ static void wild_mouse_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void wild_mouse_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x0078B394 */ static void wild_mouse_track_left_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WILD_MOUSE_QUARTER_TURN_1_SW_NE, @@ -755,15 +755,15 @@ static void wild_mouse_track_left_quarter_turn_1( /** rct2: 0x0078B3A4 */ static void wild_mouse_track_right_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x0078B354 */ static void wild_mouse_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_FLAT_TO_60_DEG_SW_NE, SPR_WILD_MOUSE_FLAT_TO_60_DEG_CHAIN_SW_NE }, @@ -778,7 +778,7 @@ static void wild_mouse_track_flat_to_60_deg_up( { 0, 0 }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = frontImageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) @@ -810,7 +810,7 @@ static void wild_mouse_track_flat_to_60_deg_up( /** rct2: 0x0078B364 */ static void wild_mouse_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WILD_MOUSE_60_DEG_TO_FLAT_SW_NE, SPR_WILD_MOUSE_60_DEG_TO_FLAT_CHAIN_SW_NE }, @@ -825,7 +825,7 @@ static void wild_mouse_track_60_deg_up_to_flat( { 0, 0 }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = frontImageIds[direction][isChained] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) @@ -864,23 +864,23 @@ static void wild_mouse_track_60_deg_up_to_flat( /** rct2: 0x0078B374 */ static void wild_mouse_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B384 */ static void wild_mouse_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x0078B344 */ static void wild_mouse_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = _wild_mouse_brakes_image_ids[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); @@ -897,7 +897,7 @@ static void wild_mouse_track_brakes( /** rct2: 0x0078B3C4 */ static void wild_mouse_track_rotation_control_toggle( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WILD_MOUSE_ROTATION_CONTROL_TOGGLE_SW_NE, @@ -921,9 +921,9 @@ static void wild_mouse_track_rotation_control_toggle( /** rct2: 0x0078B3B4 */ static void wild_mouse_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isClosed = tileElement->AsTrack()->BlockBrakeClosed(); + bool isClosed = trackElement.BlockBrakeClosed(); uint32_t imageId = _wild_mouse_block_brakes_image_ids[direction][isClosed] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); if (track_paint_util_should_paint_supports(session->MapPosition)) diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index d5cefbf621..e86761c50f 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -439,7 +439,7 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* /** rct2: 0x008AC568 */ static void wooden_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_RC_FLAT_SW_NE, SPR_WOODEN_RC_FLAT_CHAIN_SW_NE }, @@ -454,7 +454,7 @@ static void wooden_rc_track_flat( { SPR_WOODEN_RC_FLAT_RAILS_NW_SE, SPR_WOODEN_RC_FLAT_CHAIN_RAILS_SE_NW }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; wooden_rc_track_paint( session, imageIds[direction][isChained], railsImageIds[direction][isChained], direction, 0, 2, 32, 25, 2, height, 0, 3, height); @@ -466,7 +466,7 @@ static void wooden_rc_track_flat( static void wooden_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t stationImageIds[4][2] = { { SPR_WOODEN_RC_STATION_SW_NE, SPR_WOODEN_RC_STATION_RAILS_SW_NE }, @@ -475,11 +475,11 @@ static void wooden_rc_track_station( { SPR_WOODEN_RC_STATION_NW_SE, SPR_WOODEN_RC_STATION_RAILS_NW_SE }, }; - int32_t trackType = tileElement->AsTrack()->GetTrackType(); + int32_t trackType = trackElement.GetTrackType(); if (trackType == TrackElemType::EndStation) { - const auto brakeImg = tileElement->AsTrack()->BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1] - : _wooden_rc_block_brakes_image_ids[direction][0]; + const auto brakeImg = trackElement.BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1] + : _wooden_rc_block_brakes_image_ids[direction][0]; wooden_rc_track_paint( session, brakeImg, _wooden_rc_block_brakes_image_ids[direction][2], direction, 0, 2, 32, 27, 2, height, 0, 2, height); @@ -491,7 +491,7 @@ static void wooden_rc_track_station( height); } wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station_2(session, ride, direction, height, tileElement, 9, 11); + track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -500,7 +500,7 @@ static void wooden_rc_track_station( /** rct2: 0x008AC578 */ static void wooden_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][4] = { { @@ -521,7 +521,7 @@ static void wooden_rc_track_25_deg_up( } }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; wooden_rc_track_paint( session, imageIds[isChained][direction][0], imageIds[isChained][direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height); @@ -550,7 +550,7 @@ static void wooden_rc_track_25_deg_up( /** rct2: 0x008AC588 */ static void wooden_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_RC_60_DEG_SW_NE, SPR_WOODEN_RC_60_DEG_RAILS_SW_NE }, @@ -588,7 +588,7 @@ static void wooden_rc_track_60_deg_up( /** rct2: 0x008AC598 */ static void wooden_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][4] = { { @@ -609,7 +609,7 @@ static void wooden_rc_track_flat_to_25_deg_up( } }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; wooden_rc_track_paint( session, imageIds[isChained][direction][0], imageIds[isChained][direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height); @@ -638,7 +638,7 @@ static void wooden_rc_track_flat_to_25_deg_up( /** rct2: 0x008AC5A8 */ static void wooden_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_25_DEG_TO_60_DEG_SW_NE, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_SW_NE, 0, 0 }, @@ -680,7 +680,7 @@ static void wooden_rc_track_25_deg_up_to_60_deg_up( /** rct2: 0x008AC5B8 */ static void wooden_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_60_DEG_TO_25_DEG_SW_NE, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_SW_NE, 0, 0 }, @@ -722,7 +722,7 @@ static void wooden_rc_track_60_deg_up_to_25_deg_up( /** rct2: 0x008AC5C8 */ static void wooden_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][4] = { { @@ -743,7 +743,7 @@ static void wooden_rc_track_25_deg_up_to_flat( } }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; wooden_rc_track_paint( session, imageIds[isChained][direction][0], imageIds[isChained][direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height); @@ -772,54 +772,54 @@ static void wooden_rc_track_25_deg_up_to_flat( /** rct2: 0x008AC5D8 */ static void wooden_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC5E8 */ static void wooden_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC5F8 */ static void wooden_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC608 */ static void wooden_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC618 */ static void wooden_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC628 */ static void wooden_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wooden_rc_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { { { @@ -1065,16 +1065,16 @@ static void wooden_rc_track_right_quarter_turn_5( static void wooden_rc_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AC658 */ static void wooden_rc_track_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_SW_NE, SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_SW_NE, 0, 0 }, @@ -1101,7 +1101,7 @@ static void wooden_rc_track_flat_to_left_bank( /** rct2: 0x008AC668 */ static void wooden_rc_track_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_SW_NE, SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_SW_NE, @@ -1128,22 +1128,22 @@ static void wooden_rc_track_flat_to_right_bank( /** rct2: 0x008AC678 */ static void wooden_rc_track_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC688 */ static void wooden_rc_track_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wooden_rc_track_banked_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { { { @@ -1389,16 +1389,16 @@ static void wooden_rc_track_banked_right_quarter_turn_5( static void wooden_rc_track_banked_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_banked_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_banked_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AC6B8 */ static void wooden_rc_track_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_SW_NE, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_SW_NE, 0, 0 }, @@ -1433,7 +1433,7 @@ static void wooden_rc_track_left_bank_to_25_deg_up( /** rct2: 0x008AC6C8 */ static void wooden_rc_track_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_SW_NE, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_SW_NE, 0, 0 }, @@ -1468,7 +1468,7 @@ static void wooden_rc_track_right_bank_to_25_deg_up( /** rct2: 0x008AC6D8 */ static void wooden_rc_track_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_SW_NE, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_SW_NE, 0, 0 }, @@ -1503,7 +1503,7 @@ static void wooden_rc_track_25_deg_up_to_left_bank( /** rct2: 0x008AC6E8 */ static void wooden_rc_track_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { { SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_SW_NE, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_SW_NE, 0, 0 }, @@ -1538,39 +1538,39 @@ static void wooden_rc_track_25_deg_up_to_right_bank( /** rct2: 0x008AC6F8 */ static void wooden_rc_track_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC708 */ static void wooden_rc_track_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC718 */ static void wooden_rc_track_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC728 */ static void wooden_rc_track_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC738 */ static void wooden_rc_track_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_RC_LEFT_BANK_SW_NE, SPR_WOODEN_RC_LEFT_BANK_RAILS_SW_NE }, @@ -1590,15 +1590,15 @@ static void wooden_rc_track_left_bank( /** rct2: 0x008AC748 */ static void wooden_rc_track_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC758 */ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1899,7 +1899,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AC768 */ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2200,25 +2200,25 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AC778 */ static void wooden_rc_track_left_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AC788 */ static void wooden_rc_track_right_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_5_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AC798 */ static void wooden_rc_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2437,7 +2437,7 @@ static void wooden_rc_track_s_bend_left( /** rct2: 0x008AC7A8 */ static void wooden_rc_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2656,7 +2656,7 @@ static void wooden_rc_track_s_bend_right( /** rct2: 0x008ACE18 */ static void wooden_rc_track_left_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -2913,7 +2913,7 @@ static void wooden_rc_track_left_vertical_loop( /** rct2: 0x008ACE28 */ static void wooden_rc_track_right_vertical_loop( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3138,7 +3138,7 @@ static void wooden_rc_track_right_vertical_loop( /** rct2: 0x008AC7E8 */ static void wooden_rc_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3308,16 +3308,16 @@ static void wooden_rc_track_left_quarter_turn_3( /** rct2: 0x008AC7F8 */ static void wooden_rc_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AC808 */ static void wooden_rc_track_left_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3487,16 +3487,16 @@ static void wooden_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AC818 */ static void wooden_rc_track_right_quarter_turn_3_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3_bank(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AC828 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3627,7 +3627,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AC838 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -3758,25 +3758,25 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AC848 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008AC858 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_3_25_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ACAB8 */ static void wooden_rc_track_left_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4152,7 +4152,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008ACAC8 */ static void wooden_rc_track_right_half_banked_helix_up_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -4528,7 +4528,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008ACAD8 */ static void wooden_rc_track_left_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4536,13 +4536,13 @@ static void wooden_rc_track_left_half_banked_helix_down_small( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_half_banked_helix_up_small(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ACAE8 */ static void wooden_rc_track_right_half_banked_helix_down_small( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 4) { @@ -4550,13 +4550,13 @@ static void wooden_rc_track_right_half_banked_helix_down_small( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_half_banked_helix_up_small(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ACAF8 */ static void wooden_rc_track_left_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5148,7 +5148,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008ACB08 */ static void wooden_rc_track_right_half_banked_helix_up_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -5740,7 +5740,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008ACB18 */ static void wooden_rc_track_left_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -5748,13 +5748,13 @@ static void wooden_rc_track_left_half_banked_helix_down_large( direction = (direction - 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_half_banked_helix_up_large(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ACB28 */ static void wooden_rc_track_right_half_banked_helix_down_large( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence >= 7) { @@ -5762,13 +5762,13 @@ static void wooden_rc_track_right_half_banked_helix_down_large( direction = (direction + 1) & 3; } trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - wooden_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_half_banked_helix_up_large(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ACB98 */ static void wooden_rc_track_left_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5821,7 +5821,7 @@ static void wooden_rc_track_left_quarter_turn_1_60_deg_up( /** rct2: 0x008ACB78 */ static void wooden_rc_track_right_quarter_turn_1_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5874,23 +5874,23 @@ static void wooden_rc_track_right_quarter_turn_1_60_deg_up( /** rct2: 0x008ACB88 */ static void wooden_rc_track_left_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + wooden_rc_track_right_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ACBA8 */ static void wooden_rc_track_right_quarter_turn_1_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_rc_track_left_quarter_turn_1_60_deg_up(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008AC868 */ static void wooden_rc_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_RC_BRAKES_SW_NE, SPR_WOODEN_RC_BRAKES_RAILS_SW_NE }, @@ -5910,7 +5910,7 @@ static void wooden_rc_track_brakes( /** rct2: 0x008ACC78 */ static void wooden_rc_track_25_deg_up_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -5966,7 +5966,7 @@ static void wooden_rc_track_25_deg_up_left_banked( /** rct2: 0x008ACC88 */ static void wooden_rc_track_25_deg_up_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6022,7 +6022,7 @@ static void wooden_rc_track_25_deg_up_right_banked( /** rct2: 0x008AC878 */ static void wooden_rc_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -6052,7 +6052,7 @@ static void wooden_rc_track_on_ride_photo( break; } wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_onride_photo_small_paint(session, direction, height + 16, tileElement); + track_paint_util_onride_photo_small_paint(session, direction, height + 16, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -6061,23 +6061,23 @@ static void wooden_rc_track_on_ride_photo( /** rct2: 0x008ACC98 */ static void wooden_rc_track_25_deg_down_left_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_right_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACCA8 */ static void wooden_rc_track_25_deg_down_right_banked( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_left_banked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACE08 */ static void wooden_rc_track_water_splash( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const bool transparent = gConfigGeneral.transparent_water || (session->ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); const uint32_t waterOverlay = transparent ? SPR_WATER_OVERLAY : SPR_RCT1_WATER_OVERLAY; @@ -6494,7 +6494,7 @@ static void wooden_rc_track_water_splash( /** rct2: 0x008AC958 */ static void wooden_rc_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6727,7 +6727,7 @@ static void wooden_rc_track_left_eighth_to_diag( /** rct2: 0x008AC968 */ static void wooden_rc_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -6958,25 +6958,25 @@ static void wooden_rc_track_right_eighth_to_diag( /** rct2: 0x008AC978 */ static void wooden_rc_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC988 */ static void wooden_rc_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + wooden_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008AC998 */ static void wooden_rc_track_left_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7209,7 +7209,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008AC9A8 */ static void wooden_rc_track_right_eighth_bank_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7440,30 +7440,30 @@ static void wooden_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008AC9B8 */ static void wooden_rc_track_left_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_eighth_bank_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008AC9C8 */ static void wooden_rc_track_right_eighth_bank_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - wooden_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + wooden_rc_track_left_eighth_bank_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008AC888 */ static void wooden_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7495,7 +7495,7 @@ static void wooden_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7559,7 +7559,7 @@ static void wooden_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7623,7 +7623,7 @@ static void wooden_rc_track_diag_flat( paint_util_set_general_support_height(session, height + 32, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7660,12 +7660,12 @@ static void wooden_rc_track_diag_flat( /** rct2: 0x008AC8B8 */ static void wooden_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7697,7 +7697,7 @@ static void wooden_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7769,7 +7769,7 @@ static void wooden_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7841,7 +7841,7 @@ static void wooden_rc_track_diag_25_deg_up( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -7878,7 +7878,7 @@ static void wooden_rc_track_diag_25_deg_up( /** rct2: 0x008AC8E8 */ static void wooden_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -7980,12 +7980,12 @@ static void wooden_rc_track_diag_60_deg_up( /** rct2: 0x008AC898 */ static void wooden_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8017,7 +8017,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8081,7 +8081,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8145,7 +8145,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8182,7 +8182,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AC8C8 */ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8284,7 +8284,7 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008AC8D8 */ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8386,12 +8386,12 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008AC8A8 */ static void wooden_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8423,7 +8423,7 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8495,7 +8495,7 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8567,7 +8567,7 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8604,12 +8604,12 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008AC918 */ static void wooden_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8641,7 +8641,7 @@ static void wooden_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8713,7 +8713,7 @@ static void wooden_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8785,7 +8785,7 @@ static void wooden_rc_track_diag_25_deg_down( paint_util_set_general_support_height(session, height + 56, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8822,7 +8822,7 @@ static void wooden_rc_track_diag_25_deg_down( /** rct2: 0x008AC948 */ static void wooden_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -8924,12 +8924,12 @@ static void wooden_rc_track_diag_60_deg_down( /** rct2: 0x008AC8F8 */ static void wooden_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -8959,7 +8959,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( } break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9029,7 +9029,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( } break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9099,7 +9099,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( } break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9137,7 +9137,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( /** rct2: 0x008AC928 */ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9239,7 +9239,7 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008AC938 */ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9341,12 +9341,12 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008AC908 */ static void wooden_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { case 0: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9378,7 +9378,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 1: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9442,7 +9442,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 2: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9506,7 +9506,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( paint_util_set_general_support_height(session, height + 48, 0x20); break; case 3: - if (tileElement->AsTrack()->HasChain()) + if (trackElement.HasChain()) { switch (direction) { @@ -9543,7 +9543,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008ACA18 */ static void wooden_rc_track_diag_flat_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9645,7 +9645,7 @@ static void wooden_rc_track_diag_flat_to_left_bank( /** rct2: 0x008AC9F8 */ static void wooden_rc_track_diag_flat_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9747,7 +9747,7 @@ static void wooden_rc_track_diag_flat_to_right_bank( /** rct2: 0x008ACA08 */ static void wooden_rc_track_diag_left_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9849,7 +9849,7 @@ static void wooden_rc_track_diag_left_bank_to_flat( /** rct2: 0x008ACA28 */ static void wooden_rc_track_diag_right_bank_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -9951,7 +9951,7 @@ static void wooden_rc_track_diag_right_bank_to_flat( /** rct2: 0x008ACA58 */ static void wooden_rc_track_diag_left_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10053,7 +10053,7 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008ACA68 */ static void wooden_rc_track_diag_right_bank_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10155,7 +10155,7 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008ACA38 */ static void wooden_rc_track_diag_25_deg_up_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10257,7 +10257,7 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008ACA48 */ static void wooden_rc_track_diag_25_deg_up_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10359,7 +10359,7 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008ACA78 */ static void wooden_rc_track_diag_left_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10456,7 +10456,7 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( /** rct2: 0x008ACA88 */ static void wooden_rc_track_diag_right_bank_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10553,7 +10553,7 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( /** rct2: 0x008ACA98 */ static void wooden_rc_track_diag_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10655,7 +10655,7 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008ACAA8 */ static void wooden_rc_track_diag_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10757,7 +10757,7 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008AC9D8 */ static void wooden_rc_track_diag_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10859,7 +10859,7 @@ static void wooden_rc_track_diag_left_bank( /** rct2: 0x008AC9E8 */ static void wooden_rc_track_diag_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -10961,7 +10961,7 @@ static void wooden_rc_track_diag_right_bank( /** rct2: 0x008ACB38 */ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11092,7 +11092,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB48 */ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11223,7 +11223,7 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB58 */ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11354,7 +11354,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( /** rct2: 0x008ACB68 */ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11485,10 +11485,10 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( /** rct2: 0x008ACDF8 */ static void wooden_rc_track_block_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - const auto brakeImg = tileElement->AsTrack()->BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1] - : _wooden_rc_block_brakes_image_ids[direction][0]; + const auto brakeImg = trackElement.BlockBrakeClosed() ? _wooden_rc_block_brakes_image_ids[direction][1] + : _wooden_rc_block_brakes_image_ids[direction][0]; wooden_rc_track_paint( session, brakeImg, _wooden_rc_block_brakes_image_ids[direction][2], direction, 0, 2, 32, 25, 2, height, 0, 3, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); @@ -11500,7 +11500,7 @@ static void wooden_rc_track_block_brakes( /** rct2: 0x008ACCB8 */ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11631,7 +11631,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCC8 */ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -11762,27 +11762,27 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCD8 */ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ACCE8 */ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ACC38 */ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12083,7 +12083,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC48 */ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -12384,27 +12384,27 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC58 */ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction + 1) & 3, height, tileElement); + session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } /** rct2: 0x008ACC68 */ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( - session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008ACCF8 */ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12452,7 +12452,7 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( /** rct2: 0x008ACD08 */ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12500,7 +12500,7 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( /** rct2: 0x008ACD18 */ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12548,7 +12548,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ACD28 */ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12596,39 +12596,41 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( /** rct2: 0x008ACD38 */ static void wooden_rc_track_25_deg_down_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_right_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACD48 */ static void wooden_rc_track_25_deg_down_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_banked_25_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACD58 */ static void wooden_rc_track_left_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACD68 */ static void wooden_rc_track_right_banked_25_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_25_deg_up_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACD78 */ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12684,7 +12686,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( /** rct2: 0x008ACD88 */ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12740,7 +12742,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( /** rct2: 0x008ACD98 */ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12796,7 +12798,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( /** rct2: 0x008ACDA8 */ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12852,43 +12854,43 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( /** rct2: 0x008ACDB8 */ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACDC8 */ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACDD8 */ static void wooden_rc_track_left_banked_25_deg_down_to_left_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACDE8 */ static void wooden_rc_track_right_banked_25_deg_down_to_right_banked_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( - session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACBB8 */ static void wooden_rc_track_flat_to_left_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -12944,7 +12946,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( /** rct2: 0x008ACBC8 */ static void wooden_rc_track_flat_to_right_banked_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -13000,7 +13002,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( /** rct2: 0x008ACBD8 */ static void wooden_rc_track_left_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -13056,7 +13058,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( /** rct2: 0x008ACBE8 */ static void wooden_rc_track_right_banked_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -13112,38 +13114,38 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( /** rct2: 0x008ACBF8 */ static void wooden_rc_track_flat_to_left_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_right_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACC08 */ static void wooden_rc_track_flat_to_right_banked_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_left_banked_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACC18 */ static void wooden_rc_track_left_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_right_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008ACC28 */ static void wooden_rc_track_right_banked_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_rc_track_flat_to_left_banked_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wooden_rc_track_booster( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_G2_WOODEN_RC_BOOSTER_SW_NE, diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index 3dbe7e5007..dc54c46659 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -123,7 +123,7 @@ enum /** rct2: 0x008A5464 */ static void wooden_wild_mouse_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, @@ -147,7 +147,7 @@ static void wooden_wild_mouse_track_flat( static void wooden_wild_mouse_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_STATION_BASE_B_SW_NE }, @@ -163,7 +163,7 @@ static void wooden_wild_mouse_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 0, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -172,7 +172,7 @@ static void wooden_wild_mouse_track_station( /** rct2: 0x008A5474 */ static void wooden_wild_mouse_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -189,7 +189,7 @@ static void wooden_wild_mouse_track_25_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); @@ -212,7 +212,7 @@ static void wooden_wild_mouse_track_25_deg_up( /** rct2: 0x008A5484 */ static void wooden_wild_mouse_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -229,7 +229,7 @@ static void wooden_wild_mouse_track_60_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 3) { @@ -260,7 +260,7 @@ static void wooden_wild_mouse_track_60_deg_up( /** rct2: 0x008A5494 */ static void wooden_wild_mouse_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -277,7 +277,7 @@ static void wooden_wild_mouse_track_flat_to_25_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); @@ -300,7 +300,7 @@ static void wooden_wild_mouse_track_flat_to_25_deg_up( /** rct2: 0x008A54A4 */ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -317,7 +317,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId; if (direction == 0 || direction == 3) { @@ -351,7 +351,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( static void wooden_wild_mouse_track_60_deg_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -368,7 +368,7 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId; if (direction == 0 || direction == 3) { @@ -403,7 +403,7 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up( /** rct2: 0x008A54C4 */ static void wooden_wild_mouse_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { { @@ -420,7 +420,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_flat( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); @@ -443,54 +443,54 @@ static void wooden_wild_mouse_track_25_deg_up_to_flat( /** rct2: 0x008A54D4 */ static void wooden_wild_mouse_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A54E4 */ static void wooden_wild_mouse_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A54F4 */ static void wooden_wild_mouse_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5504 */ static void wooden_wild_mouse_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_60_deg_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5514 */ static void wooden_wild_mouse_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5524 */ static void wooden_wild_mouse_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wooden_wild_mouse_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -548,15 +548,15 @@ static void wooden_wild_mouse_track_right_quarter_turn_3( static void wooden_wild_mouse_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - wooden_wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + wooden_wild_mouse_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void wooden_wild_mouse_track_left_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_SW_NE, @@ -591,15 +591,15 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( /** rct2: 0x008A55D4 */ static void wooden_wild_mouse_track_right_quarter_turn_1( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + wooden_wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x008A55E4 */ static void wooden_wild_mouse_track_flat_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -616,7 +616,7 @@ static void wooden_wild_mouse_track_flat_to_60_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId; if (direction == 0 || direction == 3) { @@ -650,7 +650,7 @@ static void wooden_wild_mouse_track_flat_to_60_deg_up( /** rct2: 0x008A55F4 */ static void wooden_wild_mouse_track_60_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -667,7 +667,7 @@ static void wooden_wild_mouse_track_60_deg_up_to_flat( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId; if (direction == 0 || direction == 3) { @@ -701,17 +701,17 @@ static void wooden_wild_mouse_track_60_deg_up_to_flat( /** rct2: 0x008A5604 */ static void wooden_wild_mouse_track_flat_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x008A5614 */ static void wooden_wild_mouse_track_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - wooden_wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + wooden_wild_mouse_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int32_t trackType) diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 7dee3d261c..b036fe3fe1 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -146,7 +146,7 @@ static constexpr const uint32_t car_ride_track_pieces_quarter_turn_3_tiles[4][3] /** rct2: 0x006F72C8 */ static void paint_car_ride_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -177,7 +177,7 @@ static void paint_car_ride_track_flat( /** rct2: 0x006F72D8 */ static void paint_car_ride_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -215,7 +215,7 @@ static void paint_car_ride_track_25_deg_up( /** rct2: 0x006F72E8 */ static void paint_car_ride_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -253,7 +253,7 @@ static void paint_car_ride_track_flat_to_25_deg_up( /** rct2: 0x006F72F8 */ static void paint_car_ride_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -291,31 +291,31 @@ static void paint_car_ride_track_25_deg_up_to_flat( /** rct2: 0x006F7308 */ static void paint_car_ride_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F7318 */ static void paint_car_ride_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F7328 */ static void paint_car_ride_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F7338, 0x006F7348, 0x006F7358 */ static void paint_car_ride_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -360,7 +360,7 @@ static void paint_car_ride_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -369,7 +369,7 @@ static void paint_car_ride_station( /** rct2: 0x006F7378 */ static void paint_car_ride_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -406,16 +406,16 @@ static void paint_car_ride_track_right_quarter_turn_3_tiles( /** rct2: 0x006F7368 */ static void paint_car_ride_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_car_ride_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + paint_car_ride_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x006F7388 */ static void paint_car_ride_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_left_quarter_turn_1_tile[direction] | session->TrackColours[SCHEME_TRACK]; @@ -446,15 +446,15 @@ static void paint_car_ride_track_left_quarter_turn_1_tile( /** rct2: 0x006F7398 */ static void paint_car_ride_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_car_ride_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** rct2: 0x006F73A8 */ static void paint_car_ride_track_spinning_tunnel( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -487,7 +487,7 @@ static void paint_car_ride_track_spinning_tunnel( /** rct2: 0x006F73B8 */ static void paint_car_ride_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -536,7 +536,7 @@ static void paint_car_ride_track_60_deg_up( /** rct2: 0x006F73C8 */ static void paint_car_ride_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_25_deg_up_to_60_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -592,7 +592,7 @@ static void paint_car_ride_track_25_deg_up_to_60_deg_up( /** rct2: 0x006F73D8 */ static void paint_car_ride_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_60_deg_up_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -648,31 +648,31 @@ static void paint_car_ride_track_60_deg_up_to_25_deg_up( /** rct2: 0x006F73E8 */ static void paint_car_ride_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F73F8 */ static void paint_car_ride_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F7408 */ static void paint_car_ride_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_car_ride_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_car_ride_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x006F7418 */ static void paint_car_ride_track_log_bumps( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = car_ride_track_pieces_log_bumps[direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 1523208457..f0896c57c1 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -53,7 +53,7 @@ static void paint_circus_tent( */ static void paint_circus( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -70,7 +70,7 @@ static void paint_circus( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, fenceSpritesRope, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 8da8aac0ef..d61ed4ed51 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -64,7 +64,7 @@ static void paint_crooked_house_structure( static void paint_crooked_house( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -81,7 +81,7 @@ static void paint_crooked_house( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index fcd88ade23..1860010dbe 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -39,7 +39,7 @@ static void paint_dodgems_roof(paint_session* session, int32_t height, int32_t o static void paint_dodgems( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; @@ -53,7 +53,7 @@ static void paint_dodgems( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, dodgems_fence_sprites, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index fcbe3e7136..a52c950285 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -134,7 +134,7 @@ static void paint_ferris_wheel_structure( */ static void paint_ferris_wheel( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -161,23 +161,23 @@ static void paint_ferris_wheel( uint32_t colourFlags = session->TrackColours[SCHEME_MISC]; if (ride != nullptr) { - if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, rotation)) + if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, rotation)) { imageId = SPR_FENCE_ROPE_NW | colourFlags; PaintAddImageAsChild(session, imageId, 0, 0, 32, 1, 7, height, 0, 2, height + 2); } - if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, rotation)) + if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, rotation)) { imageId = SPR_FENCE_ROPE_NE | colourFlags; PaintAddImageAsChild(session, imageId, 0, 0, 1, 32, 7, height, 2, 0, height + 2); } - if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, rotation)) + if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, rotation)) { // Bound box is slightly different from track_paint_util_paint_fences imageId = SPR_FENCE_ROPE_SE | colourFlags; PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); } - if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, rotation)) + if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, rotation)) { imageId = SPR_FENCE_ROPE_SW | colourFlags; PaintAddImageAsParent(session, imageId, 0, 0, 1, 32, 7, height, 30, 0, height + 2); diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index 7cf8dea96f..eaf1f0fe52 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -34,7 +34,7 @@ static constexpr const uint32_t flying_saucers_fence_sprites[] = { */ static void paint_flying_saucers( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_4x4[direction][trackSequence]; @@ -48,7 +48,7 @@ static void paint_flying_saucers( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, flying_saucers_fence_sprites, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index e9f258d69f..2e5bb4d8b7 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -147,18 +147,18 @@ static constexpr const uint8_t doorOpeningInwardsToImage[] = { TUNNEL_DOORS_2, // Unused? }; -static uint8_t get_tunnel_doors_image_straight_flat(const TrackElement* trackElement, uint8_t direction) +static uint8_t get_tunnel_doors_image_straight_flat(const TrackElement& trackElement, uint8_t direction) { switch (direction) { case 0: - return doorOpeningInwardsToImage[trackElement->GetDoorAState()]; + return doorOpeningInwardsToImage[trackElement.GetDoorAState()]; case 1: - return doorOpeningOutwardsToImage[trackElement->GetDoorBState()]; + return doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; case 2: - return doorOpeningOutwardsToImage[trackElement->GetDoorBState()]; + return doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; case 3: - return doorOpeningInwardsToImage[trackElement->GetDoorAState()]; + return doorOpeningInwardsToImage[trackElement.GetDoorAState()]; } return TUNNEL_DOORS_2; } @@ -166,13 +166,13 @@ static uint8_t get_tunnel_doors_image_straight_flat(const TrackElement* trackEle /** rct2: 0x00770BEC */ static void paint_ghost_train_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); - auto tunnelImage = get_tunnel_doors_image_straight_flat(tileElement->AsTrack(), direction); + auto tunnelImage = get_tunnel_doors_image_straight_flat(trackElement, direction); paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); if (track_paint_util_should_paint_supports(session->MapPosition)) @@ -188,7 +188,7 @@ static void paint_ghost_train_track_flat( /** rct2: 0x00770BFC */ static void paint_ghost_train_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); @@ -225,17 +225,17 @@ static void paint_ghost_train_track_25_deg_up( /** rct2: 0x00770C0C */ static void paint_ghost_train_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isBackwards = tileElement->AsTrack()->GetTrackType() == TrackElemType::Down25ToFlat; + bool isBackwards = trackElement.GetTrackType() == TrackElemType::Down25ToFlat; uint8_t doorImage; if (!isBackwards) { - doorImage = doorOpeningInwardsToImage[tileElement->AsTrack()->GetDoorAState()]; + doorImage = doorOpeningInwardsToImage[trackElement.GetDoorAState()]; } else { - doorImage = doorOpeningOutwardsToImage[tileElement->AsTrack()->GetDoorBState()]; + doorImage = doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; } uint32_t imageId = ghost_train_track_pieces_flat_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -272,7 +272,7 @@ static void paint_ghost_train_track_flat_to_25_deg_up( static void paint_ghost_train_track_25_deg_up_to_flat_shared( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); @@ -293,9 +293,9 @@ static void paint_ghost_train_track_25_deg_up_to_flat_shared( /** rct2: 0x00770C1C */ static void paint_ghost_train_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, direction, height, tileElement); + paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, direction, height, trackElement); switch (direction) { @@ -303,12 +303,10 @@ static void paint_ghost_train_track_25_deg_up_to_flat( paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right( - session, height + 8, doorOpeningOutwardsToImage[tileElement->AsTrack()->GetDoorBState()]); + paint_util_push_tunnel_right(session, height + 8, doorOpeningOutwardsToImage[trackElement.GetDoorBState()]); break; case 2: - paint_util_push_tunnel_left( - session, height + 8, doorOpeningOutwardsToImage[tileElement->AsTrack()->GetDoorBState()]); + paint_util_push_tunnel_left(session, height + 8, doorOpeningOutwardsToImage[trackElement.GetDoorBState()]); break; case 3: paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); @@ -319,17 +317,17 @@ static void paint_ghost_train_track_25_deg_up_to_flat( /** rct2: 0x00770C2C */ static void paint_ghost_train_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_ghost_train_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x00770C3C */ static void paint_ghost_train_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_25_deg_up_to_flat_shared(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); switch ((direction + 2) % 4) { @@ -337,12 +335,10 @@ static void paint_ghost_train_track_flat_to_25_deg_down( paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right( - session, height + 8, doorOpeningInwardsToImage[tileElement->AsTrack()->GetDoorAState()]); + paint_util_push_tunnel_right(session, height + 8, doorOpeningInwardsToImage[trackElement.GetDoorAState()]); break; case 2: - paint_util_push_tunnel_left( - session, height + 8, doorOpeningInwardsToImage[tileElement->AsTrack()->GetDoorAState()]); + paint_util_push_tunnel_left(session, height + 8, doorOpeningInwardsToImage[trackElement.GetDoorAState()]); break; case 3: paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); @@ -353,15 +349,15 @@ static void paint_ghost_train_track_flat_to_25_deg_down( /** rct2: 0x00770C4C */ static void paint_ghost_train_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_ghost_train_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_ghost_train_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x00770C5C, 0x00770C6C, 0x00770C7C */ static void paint_ghost_train_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -391,7 +387,7 @@ static void paint_ghost_train_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -400,17 +396,16 @@ static void paint_ghost_train_station( /** rct2: 0x00770C9C */ static void paint_ghost_train_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], ghost_train_track_pieces_quarter_turn_3_tiles, nullptr, defaultRightQuarterTurn3TilesBoundLengths, defaultRightQuarterTurn3TilesBoundOffsets); - const auto* trackElement = tileElement->AsTrack(); - bool isBackwards = trackElement->GetTrackType() == TrackElemType::LeftQuarterTurn3Tiles; + bool isBackwards = trackElement.GetTrackType() == TrackElemType::LeftQuarterTurn3Tiles; bool isDoorA = (!isBackwards && trackSequence == 0) || (isBackwards && trackSequence == 3); - auto tunnelType = isDoorA ? doorOpeningInwardsToImage[trackElement->GetDoorAState()] - : doorOpeningOutwardsToImage[trackElement->GetDoorBState()]; + auto tunnelType = isDoorA ? doorOpeningInwardsToImage[trackElement.GetDoorAState()] + : doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; track_paint_util_right_quarter_turn_3_tiles_tunnel(session, height, direction, trackSequence, tunnelType); switch (trackSequence) @@ -442,28 +437,28 @@ static void paint_ghost_train_track_right_quarter_turn_3_tiles( /** rct2: 0x00770CAC */ static void paint_ghost_train_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_ghost_train_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + paint_ghost_train_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x00770CAC */ static void paint_ghost_train_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isBackwards = tileElement->AsTrack()->GetTrackType() == TrackElemType::RightQuarterTurn1Tile; + bool isBackwards = trackElement.GetTrackType() == TrackElemType::RightQuarterTurn1Tile; uint8_t tunnelStartImage, tunnelEndImage; if (!isBackwards) { - tunnelStartImage = doorOpeningInwardsToImage[tileElement->AsTrack()->GetDoorAState()]; - tunnelEndImage = doorOpeningOutwardsToImage[tileElement->AsTrack()->GetDoorBState()]; + tunnelStartImage = doorOpeningInwardsToImage[trackElement.GetDoorAState()]; + tunnelEndImage = doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; } else { - tunnelStartImage = doorOpeningOutwardsToImage[tileElement->AsTrack()->GetDoorBState()]; - tunnelEndImage = doorOpeningInwardsToImage[tileElement->AsTrack()->GetDoorAState()]; + tunnelStartImage = doorOpeningOutwardsToImage[trackElement.GetDoorBState()]; + tunnelEndImage = doorOpeningInwardsToImage[trackElement.GetDoorAState()]; } track_paint_util_left_quarter_turn_1_tile_paint( @@ -478,15 +473,15 @@ static void paint_ghost_train_track_left_quarter_turn_1_tile( /** rct2: 0x00770CBC */ static void paint_ghost_train_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_ghost_train_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_ghost_train_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** rct2: 0x00770CCC */ static void paint_ghost_train_track_spinning_tunnel( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_spinning_tunnel_track[direction] | session->TrackColours[SCHEME_TRACK]; @@ -494,7 +489,7 @@ static void paint_ghost_train_track_spinning_tunnel( track_paint_util_spinning_tunnel_paint(session, 3, height, direction); - auto tunnelImage = get_tunnel_doors_image_straight_flat(tileElement->AsTrack(), direction); + auto tunnelImage = get_tunnel_doors_image_straight_flat(trackElement, direction); paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); @@ -506,13 +501,13 @@ static void paint_ghost_train_track_spinning_tunnel( /** rct2: 0x00770CDC */ static void paint_ghost_train_track_brakes( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = ghost_train_track_pieces_brakes[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); - auto tunnelImage = get_tunnel_doors_image_straight_flat(tileElement->AsTrack(), direction); + auto tunnelImage = get_tunnel_doors_image_straight_flat(trackElement, direction); paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); if (track_paint_util_should_paint_supports(session->MapPosition)) diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index c1021b9aca..5a6d221340 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -94,7 +94,7 @@ static void paint_haunted_house_structure( */ static void paint_haunted_house( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -111,7 +111,7 @@ static void paint_haunted_house( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index d2c79986cf..1b349958e8 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -46,9 +46,9 @@ enum */ static void maze_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - uint16_t maze_entry = tileElement->AsTrack()->GetMazeEntry(); + uint16_t maze_entry = trackElement.GetMazeEntry(); maze_entry = rol16(maze_entry, direction * 4); uint32_t rotation = session->CurrentRotation; diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index e124836e99..a57086f37f 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -104,7 +104,7 @@ static void paint_merry_go_round_structure( */ static void paint_merry_go_round( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -121,7 +121,7 @@ static void paint_merry_go_round( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); } diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 6dbff88f6b..c11a967c34 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -460,7 +460,7 @@ static paint_struct* mini_golf_paint_util_7c( bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); } -static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const TileElement* tileElement) +static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const TrackElement& trackElement) { if (!session->DidPassSurface) { @@ -469,7 +469,7 @@ static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const } const TileElement* surfaceElement = session->SurfaceElement; - if (surfaceElement->base_height != tileElement->base_height) + if (surfaceElement->base_height != trackElement.base_height) { return true; } @@ -485,7 +485,7 @@ static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const /** rct2: 0x0087F10C */ static void paint_mini_golf_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -506,7 +506,7 @@ static void paint_mini_golf_track_flat( paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - if (mini_golf_paint_util_should_draw_fence(session, tileElement)) + if (mini_golf_paint_util_should_draw_fence(session, trackElement)) { if (direction & 1) { @@ -532,7 +532,7 @@ static void paint_mini_golf_track_flat( /** rct2: 0x0087F11C */ static void paint_mini_golf_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -571,7 +571,7 @@ static void paint_mini_golf_track_25_deg_up( /** rct2: 0x0087F12C */ static void paint_mini_golf_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -610,7 +610,7 @@ static void paint_mini_golf_track_flat_to_25_deg_up( /** rct2: 0x0087F13C */ static void paint_mini_golf_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -649,31 +649,31 @@ static void paint_mini_golf_track_25_deg_up_to_flat( /** rct2: 0x0087F14C */ static void paint_mini_golf_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_golf_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0087F15C */ static void paint_mini_golf_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_golf_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0087F16C */ static void paint_mini_golf_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_golf_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_golf_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0087F17C, 0x0087F18C, 0x0087F19C */ static void paint_mini_golf_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -687,7 +687,7 @@ static void paint_mini_golf_station( if (direction & 1) { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | session->TrackColours[SCHEME_MISC]; @@ -695,7 +695,7 @@ static void paint_mini_golf_station( } bool hasSWFence = track_paint_util_has_fence( - EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation); + EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_NW_SE | session->TrackColours[SCHEME_MISC]; @@ -710,7 +710,7 @@ static void paint_mini_golf_station( } else { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | session->TrackColours[SCHEME_MISC]; @@ -718,7 +718,7 @@ static void paint_mini_golf_station( } bool hasSEFence = track_paint_util_has_fence( - EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation); + EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_SW_NE | session->TrackColours[SCHEME_MISC]; @@ -740,7 +740,7 @@ static void paint_mini_golf_station( /** rct2: 0x0087F1AC */ static void paint_mini_golf_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -752,7 +752,7 @@ static void paint_mini_golf_track_left_quarter_turn_1_tile( paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - const bool shouldDrawFence = mini_golf_paint_util_should_draw_fence(session, tileElement); + const bool shouldDrawFence = mini_golf_paint_util_should_draw_fence(session, trackElement); switch (direction) { @@ -820,9 +820,9 @@ static void paint_mini_golf_track_left_quarter_turn_1_tile( /** rct2: 0x0087F1BC */ static void paint_mini_golf_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_golf_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_mini_golf_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static void paint_mini_golf_hole_ab( @@ -882,7 +882,7 @@ static void paint_mini_golf_hole_ab( /** rct2: 0x0087F1CC */ static void paint_mini_golf_hole_a( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_hole_a); } @@ -890,7 +890,7 @@ static void paint_mini_golf_hole_a( /** rct2: 0x0087F1DC */ static void paint_mini_golf_hole_b( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_mini_golf_hole_ab(session, trackSequence, direction, height, mini_golf_track_sprites_hole_b); } @@ -898,7 +898,7 @@ static void paint_mini_golf_hole_b( /** rct2: 0x0087F1EC */ static void paint_mini_golf_hole_c( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; CoordsXY boundBox, boundBoxOffset; @@ -968,7 +968,7 @@ static void paint_mini_golf_hole_c( /** rct2: 0x0087F1FC */ static void paint_mini_golf_hole_d( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; CoordsXY boundBox, boundBoxOffset; @@ -1061,7 +1061,7 @@ static void paint_mini_golf_hole_d( /** rct2: 0x0087F1FC */ static void paint_mini_golf_hole_e( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; CoordsXY boundBox, boundBoxOffset; diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 3805a0de45..6012898d68 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -19,7 +19,7 @@ /** rct2: 0x */ static void paint_mini_helicopters_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -48,7 +48,7 @@ static void paint_mini_helicopters_track_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -57,7 +57,7 @@ static void paint_mini_helicopters_track_station( /** rct2: 0x0081F348 */ static void paint_mini_helicopters_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -89,7 +89,7 @@ static void paint_mini_helicopters_track_flat( /** rct2: 0x0081F368 */ static void paint_mini_helicopters_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -130,7 +130,7 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up( /** rct2: 0x0081F358 */ static void paint_mini_helicopters_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -171,7 +171,7 @@ static void paint_mini_helicopters_track_25_deg_up( /** rct2: 0x0081F378 */ static void paint_mini_helicopters_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -212,31 +212,31 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat( /** rct2: 0x */ static void paint_mini_helicopters_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_helicopters_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0081F388 */ static void paint_mini_helicopters_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_helicopters_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0081F3A8 */ static void paint_mini_helicopters_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_mini_helicopters_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_mini_helicopters_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0081F3E8 */ static void paint_mini_helicopters_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -269,17 +269,17 @@ static constexpr const uint8_t mini_helicopters_right_quarter_turn_3_tiles_to_le /** rct2: 0x0081F3F8 */ static void paint_mini_helicopters_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mini_helicopters_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; paint_mini_helicopters_track_left_quarter_turn_3_tiles( - session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** rct2: 0x0081F408 */ static void paint_mini_helicopters_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 1, height, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -294,10 +294,10 @@ static void paint_mini_helicopters_track_left_quarter_turn_1_tile( /** rct2: 0x0081F418 */ static void paint_mini_helicopters_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_mini_helicopters_track_left_quarter_turn_1_tile( - session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index e5ad7350d3..6682ad9d8a 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -165,7 +165,7 @@ static paint_struct* paint_monorail_cycles_util_7c( /** rct2: 0x0088AD48 */ static void paint_monorail_cycles_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = monorail_cycles_track_pieces_flat[(direction & 1)] | session->TrackColours[SCHEME_TRACK]; paint_monorail_cycles_util_7c( @@ -192,7 +192,7 @@ static void paint_monorail_cycles_track_flat( /** rct2: 0x0088ADD8 */ static void paint_monorail_cycles_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -221,7 +221,7 @@ static void paint_monorail_cycles_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -230,7 +230,7 @@ static void paint_monorail_cycles_station( /** rct2: 0x0088AD88 */ static void paint_monorail_cycles_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -263,11 +263,11 @@ static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_lef /** rct2: 0x0088AD98 */ static void paint_monorail_cycles_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = monorail_cycles_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; paint_monorail_cycles_track_left_quarter_turn_3_tiles( - session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static constexpr const int8_t monorail_cycles_track_right_quarter_turn_5_tiles_support_height_offset[][7] = { @@ -287,7 +287,7 @@ static constexpr const int8_t monorail_cycles_track_right_quarter_turn_5_tiles_s /** rct2: 0x0088ADB8 */ static void paint_monorail_cycles_track_right_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 1, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -403,17 +403,17 @@ static void paint_monorail_cycles_track_right_quarter_turn_5_tiles( /** rct2: 0x0088ADA8 */ static void paint_monorail_cycles_track_left_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; paint_monorail_cycles_track_right_quarter_turn_5_tiles( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x0088ADC8 */ static void paint_monorail_cycles_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -522,7 +522,7 @@ static void paint_monorail_cycles_track_s_bend_left( /** rct2: 0x*/ static void paint_monorail_cycles_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index 6b324e4ae9..1c1a74da4a 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -85,7 +85,7 @@ void vehicle_visual_observation_tower( /** rct2: 0x0070DD6C */ static void paint_observation_tower_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -100,7 +100,7 @@ static void paint_observation_tower_base( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, + session, edges, position, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, session->CurrentRotation); } @@ -162,7 +162,7 @@ static void paint_observation_tower_base( /** rct2: 0x0070DD7C */ static void paint_observation_tower_section( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -172,8 +172,8 @@ static void paint_observation_tower_section( uint32_t imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); - const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) + const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; + if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 88c9ff44ee..5c1b6fc94c 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -88,7 +88,7 @@ static void paint_space_rings_structure( /** rct2: 0x00767C40 */ static void paint_space_rings( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -108,12 +108,12 @@ static void paint_space_rings( switch (trackSequence) { case 7: - if (track_paint_util_has_fence(EDGE_SW, position, tileElement, ride, session->CurrentRotation)) + if (track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SW | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 2); } - if (track_paint_util_has_fence(EDGE_SE, position, tileElement, ride, session->CurrentRotation)) + if (track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 2); @@ -121,7 +121,7 @@ static void paint_space_rings( break; default: track_paint_util_paint_fences( - session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, position, trackElement, ride, session->TrackColours[SCHEME_MISC], height, space_rings_fence_sprites, session->CurrentRotation); break; } diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index dea3ae8d92..7ee8c220be 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -47,7 +47,7 @@ enum static void spiral_slide_paint_tile_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id = 0; @@ -65,7 +65,7 @@ static void spiral_slide_paint_tile_right( static void spiral_slide_paint_tile_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id = 0; @@ -83,7 +83,7 @@ static void spiral_slide_paint_tile_left( static void spiral_slide_paint_tile_front( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t image_id = 0; @@ -192,7 +192,7 @@ static constexpr const uint32_t spiral_slide_fence_sprites[] = { */ static void paint_spiral_slide( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_2x2[direction][trackSequence]; @@ -207,20 +207,20 @@ static void paint_spiral_slide( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, spiral_slide_fence_sprites, session->CurrentRotation); } switch (trackSequence) { case 1: - spiral_slide_paint_tile_right(session, ride, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_right(session, ride, trackSequence, direction, height, trackElement); break; case 2: - spiral_slide_paint_tile_left(session, ride, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_left(session, ride, trackSequence, direction, height, trackElement); break; case 3: - spiral_slide_paint_tile_front(session, ride, trackSequence, direction, height, tileElement); + spiral_slide_paint_tile_front(session, ride, trackSequence, direction, height, trackElement); break; } diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 97dcbbcc6a..5c69526cb0 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -24,7 +24,7 @@ */ static void facility_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool hasSupports = wooden_a_supports_paint_setup( session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index 900487bd93..806e457420 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -24,7 +24,7 @@ */ static void shop_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool hasSupports = wooden_a_supports_paint_setup( session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 4c4bae4283..75782a45e9 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -53,7 +53,7 @@ static void paint_3d_cinema_structure( */ static void paint_3d_cinema( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -70,7 +70,7 @@ static void paint_3d_cinema( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); } diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 4e8267c945..a66a03451a 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -18,7 +18,7 @@ /** rct2: 0x008A2ABC */ static void paint_enterprise_structure( - paint_session* session, const Ride* ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TileElement* tileElement) + paint_session* session, const Ride* ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TrackElement& trackElement) { height += 7; @@ -40,7 +40,7 @@ static void paint_enterprise_structure( session->CurrentlyDrawnItem = vehicle; } - uint32_t imageOffset = tileElement->GetDirectionWithOffset(session->CurrentRotation); + uint32_t imageOffset = trackElement.GetDirectionWithOffset(session->CurrentRotation); if (vehicle != nullptr) { imageOffset = (vehicle->Pitch << 2) + (((vehicle->sprite_direction >> 3) + session->CurrentRotation) % 4); @@ -80,7 +80,7 @@ static void paint_enterprise_structure( /** rct2: 0x008A1584 */ static void paint_enterprise( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -95,48 +95,48 @@ static void paint_enterprise( track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesRope, session->CurrentRotation); switch (trackSequence) { case 5: - paint_enterprise_structure(session, ride, 16, 16, height, tileElement); + paint_enterprise_structure(session, ride, 16, 16, height, trackElement); break; case 6: - paint_enterprise_structure(session, ride, 16, -16, height, tileElement); + paint_enterprise_structure(session, ride, 16, -16, height, trackElement); break; case 10: - paint_enterprise_structure(session, ride, -16, -16, height, tileElement); + paint_enterprise_structure(session, ride, -16, -16, height, trackElement); break; case 9: - paint_enterprise_structure(session, ride, -16, 16, height, tileElement); + paint_enterprise_structure(session, ride, -16, 16, height, trackElement); break; case 0: - paint_enterprise_structure(session, ride, 48, 48, height, tileElement); + paint_enterprise_structure(session, ride, 48, 48, height, trackElement); break; case 3: - paint_enterprise_structure(session, ride, 48, -48, height, tileElement); + paint_enterprise_structure(session, ride, 48, -48, height, trackElement); break; case 15: - paint_enterprise_structure(session, ride, -48, -48, height, tileElement); + paint_enterprise_structure(session, ride, -48, -48, height, trackElement); break; case 12: - paint_enterprise_structure(session, ride, -48, 48, height, tileElement); + paint_enterprise_structure(session, ride, -48, 48, height, trackElement); break; case 7: - paint_enterprise_structure(session, ride, 16, -48, height, tileElement); + paint_enterprise_structure(session, ride, 16, -48, height, trackElement); break; case 11: - paint_enterprise_structure(session, ride, -16, -48, height, tileElement); + paint_enterprise_structure(session, ride, -16, -48, height, trackElement); break; case 14: - paint_enterprise_structure(session, ride, -48, -16, height, tileElement); + paint_enterprise_structure(session, ride, -48, -16, height, trackElement); break; case 13: - paint_enterprise_structure(session, ride, -48, 16, height, tileElement); + paint_enterprise_structure(session, ride, -48, 16, height, trackElement); break; } diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 48a498d988..427b1a55dd 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -126,7 +126,7 @@ static constexpr const uint32_t go_karts_track_pieces_25_deg_up_to_flat[4][2] = /** rct2: 0x0074A748 */ static void paint_go_karts_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; if (direction == 0 || direction == 2) @@ -159,7 +159,7 @@ static void paint_go_karts_track_flat( /** rct2: 0x0074A758 */ static void paint_go_karts_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -213,7 +213,7 @@ static void paint_go_karts_track_25_deg_up( /** rct2: 0x0074A768 */ static void paint_go_karts_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -267,7 +267,7 @@ static void paint_go_karts_track_flat_to_25_deg_up( /** rct2: 0x */ static void paint_go_karts_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; paint_struct* ps; @@ -321,31 +321,31 @@ static void paint_go_karts_track_25_deg_up_to_flat( /** rct2: 0x0074A788 */ static void paint_go_karts_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_go_karts_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0074A798 */ static void paint_go_karts_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_go_karts_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x0074A7A8 */ static void paint_go_karts_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_go_karts_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_go_karts_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x */ static void paint_go_karts_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -356,7 +356,7 @@ static void paint_go_karts_station( uint32_t imageId; const uint32_t(*sprites)[2] = go_karts_track_pieces_starting_grid; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { sprites = go_karts_track_pieces_starting_grid_end; } @@ -373,12 +373,12 @@ static void paint_go_karts_station( if (direction == 0 || direction == 2) { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height); } else { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, height); } @@ -398,18 +398,18 @@ static void paint_go_karts_station( if (direction == 0 || direction == 2) { - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, height); } else { - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height); } - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::EndStation) + if (trackElement.GetTrackType() == TrackElemType::EndStation) { - const bool hasGreenLight = tileElement->AsTrack()->HasGreenLight(); + const bool hasGreenLight = trackElement.HasGreenLight(); switch (direction) { @@ -457,7 +457,7 @@ static void paint_go_karts_station( /** rct2: 0x0074A7E8 */ static void paint_go_karts_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -527,9 +527,9 @@ static void paint_go_karts_track_left_quarter_turn_1_tile( /** rct2: 0x0074A7F8 */ static void paint_go_karts_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_go_karts_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_go_karts_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index a6b5cfa8c8..4632ab5441 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -88,7 +88,7 @@ void vehicle_visual_launched_freefall( /** rct2: 0x006FD1F8 */ static void paint_launched_freefall_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -102,7 +102,7 @@ static void paint_launched_freefall_base( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, launched_freefall_fence_sprites, session->CurrentRotation); } @@ -163,7 +163,7 @@ static void paint_launched_freefall_base( /** rct2: 0x006FD208 */ static void paint_launched_freefall_tower_section( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -173,8 +173,8 @@ static void paint_launched_freefall_tower_section( uint32_t imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); - const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) + const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; + if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 36c92409e8..3e717b963d 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -216,7 +216,7 @@ static void paint_magic_carpet_structure( /** rct2: 0x00898514 */ static void paint_magic_carpet( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 8bfbd40911..6c6471dfed 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -33,7 +33,7 @@ enum */ static void paint_motionsimulator_vehicle( paint_session* session, const Ride* ride, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -133,7 +133,7 @@ static void paint_motionsimulator_vehicle( /** rct2: 0x008A85C4 */ static void paint_motionsimulator( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_2x2[direction][trackSequence]; @@ -150,20 +150,20 @@ static void paint_motionsimulator( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, fenceSpritesRope, session->CurrentRotation); } switch (trackSequence) { case 1: - paint_motionsimulator_vehicle(session, ride, 16, -16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, 16, -16, direction, height, trackElement); break; case 2: - paint_motionsimulator_vehicle(session, ride, -16, 16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, -16, 16, direction, height, trackElement); break; case 3: - paint_motionsimulator_vehicle(session, ride, -16, -16, direction, height, tileElement); + paint_motionsimulator_vehicle(session, ride, -16, -16, direction, height, trackElement); break; } diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index f8ba7f635f..730c109e51 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -98,7 +98,7 @@ void vehicle_visual_roto_drop( /** rct2: 0x00886194 */ static void paint_roto_drop_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -112,7 +112,7 @@ static void paint_roto_drop_base( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, session->CurrentRotation); } @@ -178,7 +178,7 @@ static void paint_roto_drop_base( /** rct2: 0x008861A4 */ static void paint_roto_drop_tower_section( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence == 1) { @@ -188,8 +188,8 @@ static void paint_roto_drop_tower_section( uint32_t imageId = SPR_ROTO_DROP_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); - const TileElement* nextTileElement = tileElement + 1; - if (tileElement->IsLastForTile() || tileElement->GetClearanceZ() != nextTileElement->GetBaseZ()) + const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; + if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = SPR_ROTO_DROP_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 19517b7e09..7e543f57b0 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -124,7 +124,7 @@ static void paint_swinging_inverter_ship_structure( /** rct2: 0x00760260 */ static void paint_swinging_inverter_ship( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; uint32_t imageId; diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 3efb6fffbf..94d0a48909 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -174,7 +174,7 @@ static void paint_swinging_ship_structure( /** rct2: 0x008A85C4 */ static void paint_swinging_ship( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -211,7 +211,7 @@ static void paint_swinging_ship( { if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 2) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) @@ -228,7 +228,7 @@ static void paint_swinging_ship( | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, 24, 0, 8, 32, 1, height + 9); - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 3) { if (hasFence) @@ -256,7 +256,7 @@ static void paint_swinging_ship( { if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 2) { imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) @@ -273,7 +273,7 @@ static void paint_swinging_ship( | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, 0, 24, 32, 8, 1, height + 9); - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 3) { if (hasFence) diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 6a27e58152..2e63f3565c 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -44,13 +44,13 @@ static int8_t TopSpinSeatPositionOffset[] = { */ static void top_spin_paint_vehicle( paint_session* session, int8_t al, int8_t cl, const Ride* ride, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; uint16_t boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; - // As we will be drawing a vehicle we need to backup the tileElement that + // As we will be drawing a vehicle we need to backup the trackElement that // is assigned to the drawings. const TileElement* curTileElement = static_cast(session->CurrentlyDrawnItem); @@ -248,7 +248,7 @@ static void top_spin_paint_vehicle( */ static void paint_top_spin( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -265,29 +265,29 @@ static void paint_top_spin( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); } switch (trackSequence) { case 1: - top_spin_paint_vehicle(session, 32, 32, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, 32, ride, direction, height, trackElement); break; case 3: - top_spin_paint_vehicle(session, 32, -32, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, 32, -32, ride, direction, height, trackElement); break; case 5: - top_spin_paint_vehicle(session, 0, -32, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, 0, -32, ride, direction, height, trackElement); break; case 6: - top_spin_paint_vehicle(session, -32, 32, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, 32, ride, direction, height, trackElement); break; case 7: - top_spin_paint_vehicle(session, -32, -32, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, -32, ride, direction, height, trackElement); break; case 8: - top_spin_paint_vehicle(session, -32, 0, ride, direction, height, tileElement); + top_spin_paint_vehicle(session, -32, 0, ride, direction, height, trackElement); break; } diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index d914c97e12..66a6d0141a 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -80,7 +80,7 @@ static void paint_twist_structure( /** rct2: 0x0076D858 */ static void paint_twist( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -99,12 +99,12 @@ static void paint_twist( switch (trackSequence) { case 7: - if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, tileElement, ride, session->CurrentRotation)) + if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SW | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 3); } - if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, tileElement, ride, session->CurrentRotation)) + if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); @@ -112,7 +112,7 @@ static void paint_twist( break; default: track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_MISC], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); break; } diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index cb16628da2..eb853d1d7f 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -107,7 +107,7 @@ static void chairlift_paint_util_draw_supports(paint_session* session, int32_t s } } -static const TileElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( +static const TrackElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( int32_t x, int32_t y, int32_t z, const Ride* ride) { const TileElement* tileElement = map_get_first_element_at({ x, y }); @@ -120,70 +120,70 @@ static const TileElement* chairlift_paint_util_map_get_track_element_at_from_rid { if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (tileElement->AsTrack()->GetRideIndex() != ride->id) + if (tileElement->GetRideIndex() != ride->id) continue; if (tileElement->base_height != z && tileElement->base_height != z - 1) continue; - return tileElement; + return tileElement->AsTrack(); } while (!(tileElement++)->IsLastForTile()); return nullptr; }; static bool chairlift_paint_util_is_first_track( - const Ride* ride, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) + const Ride* ride, const TrackElement& trackElement, const CoordsXY& pos, track_type_t trackType) { - if (tileElement->AsTrack()->GetTrackType() != TrackElemType::BeginStation) + if (trackElement.GetTrackType() != TrackElemType::BeginStation) { return false; } - CoordsXY delta = CoordsDirectionDelta[tileElement->GetDirection()]; + CoordsXY delta = CoordsDirectionDelta[trackElement.GetDirection()]; CoordsXY newPos = { static_cast(pos.x - delta.x), static_cast(pos.y - delta.y), }; - const TileElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( - newPos.x, newPos.y, tileElement->base_height, ride); + const TrackElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( + newPos.x, newPos.y, trackElement.base_height, ride); return nextTrack == nullptr; } static bool chairlift_paint_util_is_last_track( - const Ride* ride, const TileElement* tileElement, const CoordsXY& pos, track_type_t trackType) + const Ride* ride, const TrackElement& trackElement, const CoordsXY& pos, track_type_t trackType) { - if (tileElement->AsTrack()->GetTrackType() != TrackElemType::EndStation) + if (trackElement.GetTrackType() != TrackElemType::EndStation) { return false; } - CoordsXY delta = CoordsDirectionDelta[tileElement->GetDirection()]; + CoordsXY delta = CoordsDirectionDelta[trackElement.GetDirection()]; CoordsXY newPos = { static_cast(pos.x + delta.x), static_cast(pos.y + delta.y), }; - const TileElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( - newPos.x, newPos.y, tileElement->base_height, ride); + const TrackElement* nextTrack = chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( + newPos.x, newPos.y, trackElement.base_height, ride); return nextTrack == nullptr; } static void chairlift_paint_station_ne_sw( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; const CoordsXY pos = session->MapPosition; - auto trackType = tileElement->AsTrack()->GetTrackType(); + auto trackType = trackElement.GetTrackType(); uint32_t imageId; - bool isStart = chairlift_paint_util_is_first_track(ride, tileElement, pos, trackType); - bool isEnd = chairlift_paint_util_is_last_track(ride, tileElement, pos, trackType); + bool isStart = chairlift_paint_util_is_first_track(ride, trackElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, trackElement, pos, trackType); auto stationObj = ride_get_station_object(ride); @@ -198,7 +198,7 @@ static void chairlift_paint_station_ne_sw( imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - bool hasFence = track_paint_util_has_fence(EDGE_NW, pos, tileElement, ride, session->CurrentRotation); + bool hasFence = track_paint_util_has_fence(EDGE_NW, pos, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_FENCE_METAL_NW | session->TrackColours[SCHEME_TRACK]; @@ -212,7 +212,7 @@ static void chairlift_paint_station_ne_sw( PaintAddImageAsChild(session, imageId, 0, 0, 1, 28, 7, height, 2, 2, height + 4); } - hasFence = track_paint_util_has_fence(EDGE_SE, pos, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SE, pos, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_FENCE_METAL_SE | session->TrackColours[SCHEME_TRACK]; @@ -266,17 +266,17 @@ static void chairlift_paint_station_ne_sw( static void chairlift_paint_station_se_nw( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; const CoordsXY pos = session->MapPosition; - auto trackType = tileElement->AsTrack()->GetTrackType(); + auto trackType = trackElement.GetTrackType(); uint32_t imageId; - bool isStart = chairlift_paint_util_is_first_track(ride, tileElement, pos, trackType); - bool isEnd = chairlift_paint_util_is_last_track(ride, tileElement, pos, trackType); + bool isStart = chairlift_paint_util_is_first_track(ride, trackElement, pos, trackType); + bool isEnd = chairlift_paint_util_is_last_track(ride, trackElement, pos, trackType); auto stationObj = ride_get_station_object(ride); @@ -291,7 +291,7 @@ static void chairlift_paint_station_se_nw( imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - bool hasFence = track_paint_util_has_fence(EDGE_NE, pos, tileElement, ride, session->CurrentRotation); + bool hasFence = track_paint_util_has_fence(EDGE_NE, pos, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_FENCE_METAL_NE | session->TrackColours[SCHEME_TRACK]; @@ -305,7 +305,7 @@ static void chairlift_paint_station_se_nw( PaintAddImageAsChild(session, imageId, 0, 0, 28, 1, 7, height, 2, 2, height + 4); } - hasFence = track_paint_util_has_fence(EDGE_SW, pos, tileElement, ride, session->CurrentRotation); + hasFence = track_paint_util_has_fence(EDGE_SW, pos, trackElement, ride, session->CurrentRotation); if (hasFence) { imageId = SPR_FENCE_METAL_SW | session->TrackColours[SCHEME_TRACK]; @@ -361,21 +361,21 @@ static void chairlift_paint_station_se_nw( /** rct2: 0x00744068 */ static void chairlift_paint_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction % 2) { - chairlift_paint_station_se_nw(session, ride, trackSequence, direction, height, tileElement); + chairlift_paint_station_se_nw(session, ride, trackSequence, direction, height, trackElement); } else { - chairlift_paint_station_ne_sw(session, ride, trackSequence, direction, height, tileElement); + chairlift_paint_station_ne_sw(session, ride, trackSequence, direction, height, trackElement); } } static void chairlift_paint_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; if (direction & 1) @@ -398,7 +398,7 @@ static void chairlift_paint_flat( /** rct2: 0x00743FD8 */ static void chairlift_paint_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -436,7 +436,7 @@ static void chairlift_paint_25_deg_up( /** rct2: 0x00743FD8 */ static void chairlift_paint_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -491,7 +491,7 @@ static void chairlift_paint_flat_to_25_deg_up( /** rct2: 0x00743FF8 */ static void chairlift_paint_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -546,31 +546,31 @@ static void chairlift_paint_25_deg_up_to_flat( /** rct2: 0x00744008 */ static void chairlift_paint_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - chairlift_paint_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x00744018 */ static void chairlift_paint_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - chairlift_paint_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x00744028 */ static void chairlift_paint_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - chairlift_paint_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + chairlift_paint_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x00744038 */ static void chairlift_paint_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -637,9 +637,9 @@ static void chairlift_paint_left_quarter_turn_1_tile( /** rct2: 0x00744048 */ static void chairlift_paint_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - chairlift_paint_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + chairlift_paint_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /* 0x008AAA0C */ diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index 79143297cc..b811949af0 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -48,7 +48,7 @@ static void paint_lift_cage(paint_session* session, int8_t index, uint32_t colou /** rct2: 0x0076C6CC */ static void paint_lift_base( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -80,7 +80,7 @@ static void paint_lift_base( if (ride != nullptr) { track_paint_util_paint_fences( - session, edges, session->MapPosition, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, session->CurrentRotation); } @@ -120,7 +120,7 @@ static void paint_lift_base( /** rct2: 0x0076C6DC */ static void paint_lift_tower_section( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (trackSequence == 1) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index b4b2147a95..b3d4cb4e50 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -589,7 +589,7 @@ static uint32_t miniature_railway_track_to_grooved_indent( /** rct2: 0x008AD0C0 */ static void paint_miniature_railway_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool paintAsGravel = false; bool paintGrooved = false; @@ -669,7 +669,7 @@ static void paint_miniature_railway_track_flat( /** rct2: 0x008AD170, 0x008AD180, 0x008AD190 */ static void paint_miniature_railway_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -683,7 +683,7 @@ static void paint_miniature_railway_station( paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - track_paint_util_draw_station_3(session, ride, direction, height + 2, height, tileElement); + track_paint_util_draw_station_3(session, ride, direction, height + 2, height, trackElement); // covers shouldn't be offset by +2 paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -693,7 +693,7 @@ static void paint_miniature_railway_station( /** rct2: 0x008AD0D0 */ static void paint_miniature_railway_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -725,7 +725,7 @@ static void paint_miniature_railway_track_25_deg_up( /** rct2: 0x008AD0E0 */ static void paint_miniature_railway_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -757,7 +757,7 @@ static void paint_miniature_railway_track_flat_to_25_deg_up( /** rct2: 0x008AD0F0 */ static void paint_miniature_railway_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = miniature_railway_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -789,25 +789,25 @@ static void paint_miniature_railway_track_25_deg_up_to_flat( /** rct2: 0x008AD100 */ static void paint_miniature_railway_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_miniature_railway_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AD110 */ static void paint_miniature_railway_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_miniature_railway_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AD120 */ static void paint_miniature_railway_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_miniature_railway_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } // clang-format off @@ -919,7 +919,7 @@ static constexpr const int8_t miniature_railway_right_quarter_turn_5_tiles_sprit /** rct2: 0x008AD140 */ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (right_quarter_turn_5_supports_type[direction][trackSequence] != -1) { @@ -1008,11 +1008,11 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( /** rct2: 0x008AD130 */ static void paint_miniature_railway_track_left_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; paint_miniature_railway_track_right_quarter_turn_5_tiles( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static constexpr const int8_t s_bend_left_supports_type[4][4] = { @@ -1032,7 +1032,7 @@ static constexpr const uint32_t miniature_railway_s_bend_left_tiles_track_floor[ /** rct2: 0x8AD150 */ static void paint_miniature_railway_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -1134,7 +1134,7 @@ static constexpr const uint32_t miniature_railway_s_bend_right_tiles_track_floor /** rct2: 0x008AD160 */ static void paint_miniature_railway_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -1266,7 +1266,7 @@ static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_3_tile_bou /** rct2: 0x008AD1B0 */ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool isSupported = false; if (trackSequence != 1 && trackSequence != 2) @@ -1332,11 +1332,11 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( /** rct2: 0x008AD1A0 */ static void paint_miniature_railway_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; paint_miniature_railway_track_right_quarter_turn_3_tiles( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static constexpr const int8_t paint_miniature_railway_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; @@ -1415,12 +1415,12 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_left_eight_ /** rct2: 0x008AD1C0 */ static void paint_miniature_railway_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t supportType[4][5] = { { 0, 0, 3, 5, 1 }, { 1, 1, 4, 2, 0 }, { 0, 0, 5, 3, 1 }, { 1, 1, 2, 4, 0 } }; bool isSupported = false; - bool isRightEighthToOrthog = tileElement->AsTrack()->GetTrackType() == TrackElemType::RightEighthToOrthogonal; + bool isRightEighthToOrthog = trackElement.GetTrackType() == TrackElemType::RightEighthToOrthogonal; // Right eighth to orthogonal calls this function but we do not want to have a support call for it // for track sequence 4 if (trackSequence != 4 || !isRightEighthToOrthog) @@ -1553,12 +1553,12 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_right_eight /** rct2: 0x008AD1D0 */ static void paint_miniature_railway_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t supportType[4][5] = { { 0, 0, 2, 4, 1 }, { 1, 1, 3, 5, 0 }, { 0, 0, 4, 2, 1 }, { 1, 1, 5, 3, 0 } }; bool isSupported = false; - bool isLeftEighthToOrthog = tileElement->AsTrack()->GetTrackType() == TrackElemType::LeftEighthToOrthogonal; + bool isLeftEighthToOrthog = trackElement.GetTrackType() == TrackElemType::LeftEighthToOrthogonal; // Right eighth to orthogonal calls this function but we do not want to have a support call for it // for track sequence 4 if (trackSequence != 4 || !isLeftEighthToOrthog) @@ -1622,19 +1622,19 @@ static void paint_miniature_railway_track_right_eighth_to_diag( /** rct2: 0x008AD1E0 */ static void paint_miniature_railway_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - paint_miniature_railway_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_miniature_railway_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AD1F0 */ static void paint_miniature_railway_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - paint_miniature_railway_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_miniature_railway_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static constexpr const bool miniature_railway_diag_image_segment[][4] = { @@ -1680,7 +1680,7 @@ static constexpr const floor_desc floors[] = { /** rct2: 0x008AD200 */ static void miniature_railway_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool isSupported = false; int16_t supportType = monorail_diag_support_types[direction][trackSequence]; @@ -1753,7 +1753,7 @@ static bool wooden_supports_paint_setup( /** rct2: 0x008AD230 */ static void miniature_railway_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { // TODO: The supports are inconsistent for different rotations @@ -1828,7 +1828,7 @@ static void miniature_railway_track_diag_25_deg_up( /** rct2: 0x008AD210 */ static void miniature_railway_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool hasSupports = false; @@ -1879,7 +1879,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( /** rct2: 0x008AD220 */ static void miniature_railway_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t supportOffsets[][4] = { { 0, +8, +8, +8 }, @@ -1955,7 +1955,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( /** rct2: 0x008AD260 */ static void miniature_railway_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t supportOffsets[][4] = { { 0, +16, +16, 0 }, @@ -2030,7 +2030,7 @@ static void miniature_railway_track_diag_25_deg_down( /** rct2: 0x008AD240 */ static void miniature_railway_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const int8_t supportOffsets[][4] = { { 0, +16, +16, 0 }, @@ -2103,7 +2103,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( static void miniature_railway_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { bool hasSupports = false; uint32_t floorImage = 0; diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 12bb602468..27c1e858b3 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -421,7 +421,7 @@ static constexpr const uint32_t monorail_track_pieces_diag_25_deg_up[4] = { /** rct2: 0x008AE1AC */ static void paint_monorail_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -456,7 +456,7 @@ static void paint_monorail_track_flat( /** rct2: 0x008AE25C, 0x008AE26C, 0x008AE27C */ static void paint_monorail_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; const StationObject* stationObject = nullptr; @@ -508,7 +508,7 @@ static void paint_monorail_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -517,7 +517,7 @@ static void paint_monorail_station( /** rct2: 0x008AE1BC */ static void paint_monorail_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -559,7 +559,7 @@ static void paint_monorail_track_25_deg_up( /** rct2: 0x008AE1CC */ static void paint_monorail_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -601,7 +601,7 @@ static void paint_monorail_track_flat_to_25_deg_up( /** rct2: 0x008AE1DC */ static void paint_monorail_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = monorail_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -643,31 +643,31 @@ static void paint_monorail_track_25_deg_up_to_flat( /** rct2: 0x008AE1EC */ static void paint_monorail_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AE1FC */ static void paint_monorail_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AE20C */ static void paint_monorail_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AE22C */ static void paint_monorail_track_right_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -730,16 +730,16 @@ static void paint_monorail_track_right_quarter_turn_5_tiles( /** rct2: 0x008AE21C */ static void paint_monorail_track_left_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - paint_monorail_track_right_quarter_turn_5_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + paint_monorail_track_right_quarter_turn_5_tiles(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } /** rct2: 0x */ static void paint_monorail_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -845,7 +845,7 @@ static void paint_monorail_track_s_bend_left( /** rct2: 0x008AE24C */ static void paint_monorail_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction == 2 || direction == 3) { @@ -951,7 +951,7 @@ static void paint_monorail_track_s_bend_right( /** rct2: 0x008AE29C */ static void paint_monorail_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_3_tiles_paint( session, 3, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -988,10 +988,10 @@ static void paint_monorail_track_right_quarter_turn_3_tiles( /** rct2: 0x008AE28C */ static void paint_monorail_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - paint_monorail_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + paint_monorail_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; @@ -999,7 +999,7 @@ static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { 0, 1, 2, /** rct2: 0x008AE31C */ static void paint_monorail_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1067,7 +1067,7 @@ static void paint_monorail_track_left_eighth_to_diag( /** rct2: 0x008AE32C */ static void paint_monorail_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { int8_t index = paint_monorail_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1135,21 +1135,21 @@ static void paint_monorail_track_right_eighth_to_diag( /** rct2: 0x008AE33C */ static void paint_monorail_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - paint_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + paint_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } /** rct2: 0x008AE34C */ static void paint_monorail_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { const uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; - paint_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static constexpr const bool monorail_diag_image_segment[][4] = { @@ -1169,7 +1169,7 @@ static constexpr const int32_t monorail_diag_blocked_segments[] = { SEGMENT_C4 | /** rct2: 0x008AE2AC */ static void paint_monorail_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1192,7 +1192,7 @@ static void paint_monorail_track_diag_flat( /** rct2: 0x008AE2DC */ static void paint_monorail_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1215,7 +1215,7 @@ static void paint_monorail_track_diag_25_deg_up( /** rct2: 0x008AE2BC */ static void paint_monorail_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1238,7 +1238,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_up( /** rct2: 0x008AE2CC */ static void paint_monorail_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1261,7 +1261,7 @@ static void paint_monorail_track_diag_25_deg_up_to_flat( /** rct2: 0x008AE30C */ static void paint_monorail_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1284,7 +1284,7 @@ static void paint_monorail_track_diag_25_deg_down( /** rct2: 0x008AE2EC */ static void paint_monorail_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { @@ -1308,7 +1308,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_down( /** rct2: 0x008AE2FC */ static void paint_monorail_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) { diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 6a629cd276..558fd8690f 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -22,7 +22,7 @@ /** rct2: 0x008636F4 */ static void suspended_monorail_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -54,7 +54,7 @@ static void suspended_monorail_track_flat( /** rct2: 0x008637A4, 0x008637B4, 0x008637C4 */ static void suspended_monorail_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_STATION_BASE_C_SW_NE, 25853, SPR_STATION_INVERTED_BAR_F_SW_NE }, @@ -72,7 +72,7 @@ static void suspended_monorail_track_station( session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 32, 0, 6, height + 32); track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3); - track_paint_util_draw_station_inverted(session, ride, direction, height, tileElement, STATION_VARIANT_TALL); + track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -81,7 +81,7 @@ static void suspended_monorail_track_station( /** rct2: 0x00863704 */ static void suspended_monorail_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -146,7 +146,7 @@ static void suspended_monorail_track_25_deg_up( /** rct2: 0x00863714 */ static void suspended_monorail_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -211,7 +211,7 @@ static void suspended_monorail_track_flat_to_25_deg_up( /** rct2: 0x00863724 */ static void suspended_monorail_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -276,31 +276,31 @@ static void suspended_monorail_track_25_deg_up_to_flat( /** rct2: 0x00863734 */ static void suspended_monorail_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00863744 */ static void suspended_monorail_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00863754 */ static void suspended_monorail_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - suspended_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00863764 */ static void suspended_monorail_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -480,16 +480,16 @@ static void suspended_monorail_track_left_quarter_turn_5( /** rct2: 0x00863774 */ static void suspended_monorail_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - suspended_monorail_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_monorail_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00863784 */ static void suspended_monorail_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -660,7 +660,7 @@ static void suspended_monorail_track_s_bend_left( /** rct2: 0x00863794 */ static void suspended_monorail_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -831,7 +831,7 @@ static void suspended_monorail_track_s_bend_right( /** rct2: 0x008637D4 */ static void suspended_monorail_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -950,16 +950,16 @@ static void suspended_monorail_track_left_quarter_turn_3( /** rct2: 0x008637E4 */ static void suspended_monorail_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - suspended_monorail_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, tileElement); + suspended_monorail_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } /** rct2: 0x00863864 */ static void suspended_monorail_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1122,7 +1122,7 @@ static void suspended_monorail_track_left_eighth_to_diag( /** rct2: 0x00863874 */ static void suspended_monorail_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1285,25 +1285,25 @@ static void suspended_monorail_track_right_eighth_to_diag( /** rct2: 0x00863884 */ static void suspended_monorail_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + suspended_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } /** rct2: 0x00863894 */ static void suspended_monorail_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - suspended_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, tileElement); + suspended_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement); } /** rct2: 0x008637F4 */ static void suspended_monorail_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1386,7 +1386,7 @@ static void suspended_monorail_track_diag_flat( /** rct2: 0x00863824 */ static void suspended_monorail_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1469,7 +1469,7 @@ static void suspended_monorail_track_diag_25_deg_up( /** rct2: 0x00863804 */ static void suspended_monorail_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1552,7 +1552,7 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( /** rct2: 0x00863814 */ static void suspended_monorail_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1635,7 +1635,7 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( /** rct2: 0x00863854 */ static void suspended_monorail_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1718,7 +1718,7 @@ static void suspended_monorail_track_diag_25_deg_down( /** rct2: 0x00863834 */ static void suspended_monorail_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { @@ -1798,7 +1798,7 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( /** rct2: 0x00863844 */ static void suspended_monorail_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (trackSequence) { diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index 2fddb5c9d0..2356167ad6 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -32,7 +32,7 @@ enum /** rct2: 0x008B0E40 */ static void paint_boat_hire_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -62,7 +62,7 @@ static void paint_boat_hire_track_flat( /** rct2: 0x008B0E50 */ static void paint_boat_hire_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -73,13 +73,13 @@ static void paint_boat_hire_station( { paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation); + session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } else { paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation); + session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -89,7 +89,7 @@ static void paint_boat_hire_station( /** rct2: 0x008B0E80 */ static void paint_boat_hire_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; const auto offset = CoordsXYZ{ 0, 0, height }; @@ -133,9 +133,9 @@ static void paint_boat_hire_track_left_quarter_turn_1_tile( /** rct2: 0x008B0E90 */ static void paint_boat_hire_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_boat_hire_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + paint_boat_hire_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** diff --git a/src/openrct2/ride/water/DingySlide.cpp b/src/openrct2/ride/water/DingySlide.cpp index e251ba9544..513a465055 100644 --- a/src/openrct2/ride/water/DingySlide.cpp +++ b/src/openrct2/ride/water/DingySlide.cpp @@ -350,7 +350,7 @@ enum static void dinghy_slide_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -367,7 +367,7 @@ static void dinghy_slide_track_flat( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); @@ -388,7 +388,7 @@ static void dinghy_slide_track_flat( static void dinghy_slide_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_STATION_SW_NE, SPR_STATION_BASE_B_SW_NE }, @@ -408,7 +408,7 @@ static void dinghy_slide_track_station( metal_a_supports_paint_setup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); - track_paint_util_draw_station(session, ride, direction, height, tileElement); + track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -418,7 +418,7 @@ static void dinghy_slide_track_station( static void dinghy_slide_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -435,7 +435,7 @@ static void dinghy_slide_track_25_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); @@ -463,7 +463,7 @@ static void dinghy_slide_track_25_deg_up( static void dinghy_slide_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_60_DEG_SW_NE, SPR_DINGHY_SLIDE_60_DEG_FRONT_SW_NE }, @@ -499,7 +499,7 @@ static void dinghy_slide_track_60_deg_up( static void dinghy_slide_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -516,7 +516,7 @@ static void dinghy_slide_track_flat_to_25_deg_up( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); @@ -544,7 +544,7 @@ static void dinghy_slide_track_flat_to_25_deg_up( static void dinghy_slide_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_25_DEG_TO_60_DEG_SW_NE, SPR_DINGHY_SLIDE_25_DEG_TO_60_DEG_FRONT_SW_NE }, @@ -580,7 +580,7 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up( static void dinghy_slide_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_60_DEG_TO_25_DEG_SW_NE, SPR_DINGHY_SLIDE_60_DEG_TO_25_DEG_FRONT_SW_NE }, @@ -616,7 +616,7 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up( static void dinghy_slide_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4][2] = { { @@ -633,7 +633,7 @@ static void dinghy_slide_track_25_deg_up_to_flat( }, }; - uint8_t isChained = tileElement->AsTrack()->HasChain() ? 1 : 0; + uint8_t isChained = trackElement.HasChain() ? 1 : 0; uint32_t imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); @@ -661,42 +661,42 @@ static void dinghy_slide_track_25_deg_up_to_flat( static void dinghy_slide_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_right_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -824,22 +824,22 @@ static void dinghy_slide_track_right_quarter_turn_5( static void dinghy_slide_track_left_quarter_turn_5( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_5(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void dinghy_slide_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_0 }, @@ -934,7 +934,7 @@ static void dinghy_slide_track_s_bend_left( static void dinghy_slide_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_0 }, @@ -1027,7 +1027,7 @@ static void dinghy_slide_track_s_bend_right( static void dinghy_slide_track_right_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -1108,15 +1108,15 @@ static void dinghy_slide_track_right_quarter_turn_3( static void dinghy_slide_track_left_quarter_turn_3( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_3(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void dinghy_slide_track_flat_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_FLAT_COVERED_SW_NE, SPR_DINGHY_SLIDE_FLAT_COVERED_FRONT_SW_NE }, @@ -1145,7 +1145,7 @@ static void dinghy_slide_track_flat_covered( static void dinghy_slide_track_25_deg_up_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_25_DEG_COVERED_SW_NE, SPR_DINGHY_SLIDE_25_DEG_COVERED_FRONT_SW_NE }, @@ -1181,7 +1181,7 @@ static void dinghy_slide_track_25_deg_up_covered( static void dinghy_slide_track_60_deg_up_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_60_DEG_COVERED_SW_NE, SPR_DINGHY_SLIDE_60_DEG_COVERED_FRONT_SW_NE }, @@ -1217,7 +1217,7 @@ static void dinghy_slide_track_60_deg_up_covered( static void dinghy_slide_track_flat_to_25_deg_up_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_FLAT_TO_25_DEG_COVERED_SW_NE, SPR_DINGHY_SLIDE_FLAT_TO_25_DEG_COVERED_FRONT_SW_NE }, @@ -1253,7 +1253,7 @@ static void dinghy_slide_track_flat_to_25_deg_up_covered( static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_25_DEG_TO_60_DEG_COVERED_SW_NE, SPR_DINGHY_SLIDE_25_DEG_TO_60_DEG_COVERED_FRONT_SW_NE }, @@ -1289,7 +1289,7 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_60_DEG_TO_25_DEG_COVERED_SW_NE, SPR_DINGHY_SLIDE_60_DEG_TO_25_DEG_COVERED_FRONT_SW_NE }, @@ -1325,7 +1325,7 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( static void dinghy_slide_track_25_deg_up_to_flat_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_DINGHY_SLIDE_25_DEG_TO_FLAT_COVERED_SW_NE, SPR_DINGHY_SLIDE_25_DEG_TO_FLAT_COVERED_FRONT_SW_NE }, @@ -1361,42 +1361,42 @@ static void dinghy_slide_track_25_deg_up_to_flat_covered( static void dinghy_slide_track_25_deg_down_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_60_deg_down_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_flat_to_25_deg_down_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up_to_flat_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_flat_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_60_deg_up_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_60_deg_up_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_flat_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_flat_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_flat_to_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_right_quarter_turn_5_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][5] = { { @@ -1524,15 +1524,15 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( static void dinghy_slide_track_left_quarter_turn_5_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_5_covered(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_5_covered(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void dinghy_slide_track_s_bend_left_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_0 }, @@ -1627,7 +1627,7 @@ static void dinghy_slide_track_s_bend_left_covered( static void dinghy_slide_track_s_bend_right_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_0 }, @@ -1720,7 +1720,7 @@ static void dinghy_slide_track_s_bend_right_covered( static void dinghy_slide_track_right_quarter_turn_3_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const sprite_bb imageIds[4][3] = { { @@ -1801,17 +1801,17 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( static void dinghy_slide_track_left_quarter_turn_3_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - dinghy_slide_track_right_quarter_turn_3_covered(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + dinghy_slide_track_right_quarter_turn_3_covered(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void dinghy_slide_track_60_deg_down_to_25_deg_down_covered( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - dinghy_slide_track_25_deg_up_to_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + dinghy_slide_track_25_deg_up_to_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int32_t trackType) diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 10a591c807..0d73303c22 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -162,7 +162,7 @@ static constexpr const uint32_t LogFlumeTrackFlatImageIds[4][2] = { static void paint_log_flume_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = LogFlumeTrackFlatImageIds[direction][0] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = LogFlumeTrackFlatImageIds[direction][1] | session->TrackColours[SCHEME_TRACK]; @@ -183,7 +183,7 @@ static void paint_log_flume_track_flat( static void paint_log_flume_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = LogFlumeTrackFlatImageIds[direction][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); @@ -209,7 +209,7 @@ static void paint_log_flume_track_station( metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - track_paint_util_draw_station_3(session, ride, direction, height + 2, height, tileElement); + track_paint_util_draw_station_3(session, ride, direction, height + 2, height, trackElement); // Covers shouldn't be offset by +2 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -220,7 +220,7 @@ static void paint_log_flume_track_station( static void paint_log_flume_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_25_DEG_UP_SW_NE, SPR_LOG_FLUME_25_DEG_UP_FRONT_SW_NE }, @@ -255,7 +255,7 @@ static void paint_log_flume_track_25_deg_up( static void paint_log_flume_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_SW_NE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SW_NE }, @@ -290,7 +290,7 @@ static void paint_log_flume_track_flat_to_25_deg_up( static void paint_log_flume_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_SW_NE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SW_NE }, @@ -325,7 +325,7 @@ static void paint_log_flume_track_25_deg_up_to_flat( static void paint_log_flume_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_25_DEG_DOWN_SW_NE, SPR_LOG_FLUME_25_DEG_UP_FRONT_NE_SW }, @@ -360,7 +360,7 @@ static void paint_log_flume_track_25_deg_down( static void paint_log_flume_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_SW_NE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NE_SW }, @@ -395,7 +395,7 @@ static void paint_log_flume_track_flat_to_25_deg_down( static void paint_log_flume_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_SW_NE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NE_SW }, @@ -430,7 +430,7 @@ static void paint_log_flume_track_25_deg_down_to_flat( static void paint_log_flume_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 }, @@ -525,7 +525,7 @@ static void paint_log_flume_track_s_bend_left( static void paint_log_flume_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 }, @@ -618,7 +618,7 @@ static void paint_log_flume_track_s_bend_right( static void paint_log_flume_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_3 }, @@ -685,7 +685,7 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( static void paint_log_flume_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { { SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_3 }, @@ -752,7 +752,7 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( static void paint_log_flume_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SPR_STATION_BASE_D | IMAGE_TYPE_REMAP; PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); @@ -774,7 +774,7 @@ static void paint_log_flume_track_on_ride_photo( imageId = LogFlumeTrackFlatImageIds[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 1, 21, height, 0, 27, height + 5); - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -783,7 +783,7 @@ static void paint_log_flume_track_on_ride_photo( static void paint_log_flume_track_reverser( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { { SPR_LOG_FLUME_REVERSER_SW_NE, SPR_LOG_FLUME_REVERSER_FRONT_SW_NE }, diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index c222f077e1..a1424ca583 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -277,7 +277,7 @@ void vehicle_visual_river_rapids( /** rct2: 0x00757650 */ static void paint_river_rapids_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -320,11 +320,11 @@ static void paint_river_rapids_track_flat( /** rct2: 0x007576C0 */ static void paint_river_rapids_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, tileElement); + paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, trackElement); if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, trackElement); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -508,7 +508,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( /** rct2: 0x00757660 */ static void paint_river_rapids_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg(session, direction, height, river_rapids_track_pieces_25_deg_up); } @@ -516,7 +516,7 @@ static void paint_river_rapids_track_25_deg_up( /** rct2: 0x00757670 */ static void paint_river_rapids_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_b(session, direction, height, river_rapids_track_pieces_flat_to_25_deg_up); } @@ -524,7 +524,7 @@ static void paint_river_rapids_track_flat_to_25_deg_up( /** rct2: 0x00757680 */ static void paint_river_rapids_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_a(session, direction, height, river_rapids_track_pieces_25_deg_up_to_flat); } @@ -532,7 +532,7 @@ static void paint_river_rapids_track_25_deg_up_to_flat( /** rct2: 0x00757690 */ static void paint_river_rapids_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg(session, (direction + 2) % 4, height, river_rapids_track_pieces_25_deg_down); } @@ -540,7 +540,7 @@ static void paint_river_rapids_track_25_deg_down( /** rct2: 0x007576A0 */ static void paint_river_rapids_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_a( session, (direction + 2) % 4, height, river_rapids_track_pieces_flat_to_25_deg_down); @@ -549,7 +549,7 @@ static void paint_river_rapids_track_flat_to_25_deg_down( /** rct2: 0x007576B0 */ static void paint_river_rapids_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { paint_river_rapids_track_25_deg_to_flat_b( session, (direction + 2) % 4, height, river_rapids_track_pieces_25_deg_down_to_flat); @@ -558,7 +558,7 @@ static void paint_river_rapids_track_25_deg_down_to_flat( /** rct2: 0x007576F0 */ static void paint_river_rapids_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; switch (direction) @@ -614,7 +614,7 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( /** rct2: 0x00757700 */ static void paint_river_rapids_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -671,7 +671,7 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( /** rct2: 0x00757710 */ static void paint_river_rapids_track_waterfall( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -734,7 +734,7 @@ static void paint_river_rapids_track_waterfall( /** rct2: 0x00757720 */ static void paint_river_rapids_track_rapids( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -775,17 +775,17 @@ static void paint_river_rapids_track_rapids( /** rct2: 0x00757740 */ static void paint_river_rapids_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, tileElement); - track_paint_util_onride_photo_paint(session, direction, height + 13, tileElement); + paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, trackElement); + track_paint_util_onride_photo_paint(session, direction, height + 13, trackElement); paint_util_set_general_support_height(session, height + 48, 0x20); } /** rct2: 0x */ static void paint_river_rapids_track_whirlpool( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index f54a63389a..e85581cb5d 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -477,7 +477,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { static void paint_splash_boats_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -502,7 +502,7 @@ static void paint_splash_boats_track_25_deg_up( static void paint_splash_boats_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats60DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -528,7 +528,7 @@ static void paint_splash_boats_track_60_deg_up( static void paint_splash_boats_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoatsFlatTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoatsFlatTo25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -553,7 +553,7 @@ static void paint_splash_boats_track_flat_to_25_deg_up( static void paint_splash_boats_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpToFlatFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -578,7 +578,7 @@ static void paint_splash_boats_track_25_deg_up_to_flat( static void paint_splash_boats_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegUpTo60DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegUpTo60DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -604,7 +604,7 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up( static void paint_splash_boats_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats60DegUpTo25DegUpFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -630,7 +630,7 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up( static void paint_splash_boats_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegDownFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -656,14 +656,14 @@ static void paint_splash_boats_track_25_deg_down( static void paint_splash_boats_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_splash_boats_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoatsFlatTo25DegDownImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoatsFlatTo25DegDownFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -689,21 +689,21 @@ static void paint_splash_boats_track_flat_to_25_deg_down( static void paint_splash_boats_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_splash_boats_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - paint_splash_boats_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + paint_splash_boats_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId = SplashBoats25DegDownToFlatImageId[direction] | session->TrackColours[SCHEME_TRACK]; uint32_t frontImageId = SplashBoats25DegDownToFlatFrontImageId[direction] | session->TrackColours[SCHEME_TRACK]; @@ -741,7 +741,7 @@ static void paint_splash_boats_track_25_deg_down_to_flat( /** rct2: 0x0089B170 */ static void paint_splash_boats_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { uint32_t imageId; @@ -784,7 +784,7 @@ static void paint_splash_boats_track_flat( /** rct2: 0x0089B1A0 */ static void paint_splash_boats_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (direction & 1) { @@ -808,7 +808,7 @@ static void paint_splash_boats_station( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); if (ride != nullptr) - track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, tileElement); + track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -819,7 +819,7 @@ static void paint_splash_boats_station( /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_left_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( session, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], RiverRaftsLeftQuarterTurn5_Top); @@ -900,7 +900,7 @@ static void paint_splash_boats_track_left_quarter_turn_5_tiles( /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_right_quarter_turn_5_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_right_quarter_turn_5_tiles_paint_2( session, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], RiverRaftsRightQuarterTurn5_Top); @@ -981,7 +981,7 @@ static void paint_splash_boats_track_right_quarter_turn_5_tiles( /** rct2: 0x0089B180 */ static void paint_splash_boats_track_s_bend_left( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_0 }, @@ -1073,7 +1073,7 @@ static void paint_splash_boats_track_s_bend_left( /** rct2: 0x0089B190 */ static void paint_splash_boats_track_s_bend_right( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { { { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_0 }, @@ -1164,7 +1164,7 @@ static void paint_splash_boats_track_s_bend_right( static void paint_splash_boats_track_on_ride_photo( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { switch (direction) { @@ -1182,9 +1182,9 @@ static void paint_splash_boats_track_on_ride_photo( break; } - paint_splash_boats_track_flat(session, ride, trackSequence, direction, height, tileElement); + paint_splash_boats_track_flat(session, ride, trackSequence, direction, height, trackElement); - track_paint_util_onride_photo_paint(session, direction, height + 3, tileElement); + track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 745fc4a0b9..d98b96186b 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -82,7 +82,7 @@ void vehicle_visual_submarine( static void submarine_ride_paint_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { if (ride == nullptr) return; @@ -98,7 +98,7 @@ static void submarine_ride_paint_track_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation); + session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } else { @@ -107,7 +107,7 @@ static void submarine_ride_paint_track_station( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( - session, ride, stationObj, session->MapPosition, direction, height, tileElement, session->CurrentRotation); + session, ride, stationObj, session->MapPosition, direction, height, trackElement, session->CurrentRotation); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -116,7 +116,7 @@ static void submarine_ride_paint_track_station( static void submarine_ride_paint_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { int32_t heightLower = height - 16; uint32_t imageId; @@ -148,7 +148,7 @@ static void submarine_ride_paint_track_flat( static void submarine_ride_paint_track_left_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 3, height - 16, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -181,16 +181,16 @@ static void submarine_ride_paint_track_left_quarter_turn_3_tiles( static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; static void submarine_ride_paint_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[trackSequence]; submarine_ride_paint_track_left_quarter_turn_3_tiles( - session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static void submarine_ride_paint_track_left_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 1, height - 16, 0, direction, session->TrackColours[SCHEME_TRACK], @@ -204,9 +204,10 @@ static void submarine_ride_paint_track_left_quarter_turn_1_tile( static void submarine_ride_paint_track_right_quarter_turn_1_tile( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - submarine_ride_paint_track_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, tileElement); + submarine_ride_paint_track_left_quarter_turn_1_tile( + session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } /** diff --git a/src/openrct2/ride/water/WaterCoaster.cpp b/src/openrct2/ride/water/WaterCoaster.cpp index 7d2ae88a1e..3fbef01e80 100644 --- a/src/openrct2/ride/water/WaterCoaster.cpp +++ b/src/openrct2/ride/water/WaterCoaster.cpp @@ -14,306 +14,308 @@ static void water_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, tileElement); + water_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_flat_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_up_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_flat_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - bool isChained = tileElement->AsTrack()->HasChain(); + bool isChained = trackElement.HasChain(); junior_rc_paint_track_diag_25_deg_down_to_flat( - session, ride, trackSequence, direction, height, tileElement, + session, ride, trackSequence, direction, height, trackElement, isChained ? JuniorRcChainType::ChainLift : JuniorRcChainType::None); } static void water_rc_track_station( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_paint_station(session, ride, trackSequence, direction, height, tileElement, RIDE_TYPE_WATER_COASTER); + junior_rc_paint_station(session, ride, trackSequence, direction, height, trackElement, RIDE_TYPE_WATER_COASTER); } static void water_rc_track_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_paint_track_60_deg_up(session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + junior_rc_paint_track_60_deg_up(session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void water_rc_track_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_60_deg_up_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void water_rc_track_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - water_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, tileElement); + water_rc_track_25_deg_up_to_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } // 5 tile turns static void water_rc_track_left_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static constexpr const uint8_t water_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; static void water_rc_track_left_quarter_turn_5_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { water_rc_track_right_quarter_turn_5_tiles_25_deg_up( session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 1) % 4, height, - tileElement); + trackElement); } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { water_rc_track_left_quarter_turn_5_tiles_25_deg_up( session, ride, water_rc_left_quarter_turn_5_tiles_to_right_turn_map[trackSequence], (direction + 3) % 4, height, - tileElement); + trackElement); } // 3 tile turns static void water_rc_track_right_quarter_turn_3_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_right_quarter_turn_3_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static constexpr const uint8_t water_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { 3, 1, 2, 0 }; static void water_rc_track_left_quarter_turn_3_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = water_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; water_rc_track_right_quarter_turn_3_tiles_25_deg_down( - session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void water_rc_track_left_quarter_turn_3_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { trackSequence = water_rc_left_quarter_turn_3_tiles_to_right_turn_map[trackSequence]; - water_rc_track_right_quarter_turn_3_tiles_25_deg_up(session, ride, trackSequence, (direction + 1) % 4, height, tileElement); + water_rc_track_right_quarter_turn_3_tiles_25_deg_up( + session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } static void water_rc_track_diag_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { - junior_rc_paint_track_diag_60_deg_up(session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + junior_rc_paint_track_diag_60_deg_up( + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_up_to_60_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_up_to_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_diag_25_deg_down_to_60_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_diag_60_deg_down_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TileElement* tileElement) + const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - session, ride, trackSequence, direction, height, tileElement, JuniorRcChainType::None); + session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int32_t trackType) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index df129f43f4..c155e3cc7d 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -94,16 +94,14 @@ static constexpr const uint8_t connected_path_count[] = { 4, // 0b1111 }; -int32_t entrance_get_directions(const TileElement* tileElement) +int32_t EntranceElement::GetDirections() const { - uint8_t entranceType = tileElement->AsEntrance()->GetEntranceType(); - uint8_t sequence = tileElement->AsEntrance()->GetSequenceIndex(); - return EntranceDirections[(entranceType * 8) + sequence]; + return EntranceDirections[(GetEntranceType() * 8) + GetSequenceIndex()]; } -static bool entrance_has_direction(TileElement* tileElement, int32_t direction) +static bool entrance_has_direction(const EntranceElement& entranceElement, int32_t direction) { - return entrance_get_directions(tileElement) & (1 << (direction & 3)); + return entranceElement.GetDirections() & (1 << (direction & 3)); } TileElement* map_get_footpath_element(const CoordsXYZ& coords) @@ -353,7 +351,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i && viewport->flags & (VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_HIDE_VERTICAL) && (*tileElement)->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) { - int32_t directions = entrance_get_directions(*tileElement); + int32_t directions = (*tileElement)->AsEntrance()->GetDirections(); if (directions & 0x0F) { int32_t bx = bitscanforward(directions); @@ -370,7 +368,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath, ViewportInteractionItem::Ride)); if (info.SpriteType == ViewportInteractionItem::Ride && (*tileElement)->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) { - int32_t directions = entrance_get_directions(*tileElement); + int32_t directions = (*tileElement)->AsEntrance()->GetDirections(); if (directions & 0x0F) { int32_t bx = (*tileElement)->GetDirectionWithOffset(bitscanforward(directions)); @@ -903,7 +901,8 @@ static void loc_6A6D7E( case TILE_ELEMENT_TYPE_ENTRANCE: if (initialTileElementPos.z == tileElement->GetBaseZ()) { - if (entrance_has_direction(tileElement, direction_reverse(direction - tileElement->GetDirection()))) + if (entrance_has_direction( + *(tileElement->AsEntrance()), direction_reverse(direction - tileElement->GetDirection()))) { if (query) { @@ -941,7 +940,8 @@ static void loc_6A6C85( if (tileElementPos.element->GetType() == TILE_ELEMENT_TYPE_ENTRANCE) { - if (!entrance_has_direction(tileElementPos.element, direction - tileElementPos.element->GetDirection())) + if (!entrance_has_direction( + *(tileElementPos.element->AsEntrance()), direction - tileElementPos.element->GetDirection())) { return; } @@ -2117,7 +2117,7 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co case TILE_ELEMENT_TYPE_ENTRANCE: if (tileElement->base_height == coords.z) { - if (entrance_has_direction(tileElement, coords.direction - tileElement->GetDirection())) + if (entrance_has_direction(*(tileElement->AsEntrance()), coords.direction - tileElement->GetDirection())) { // Entrance wants to be connected towards the given direction return true; diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 98318556fd..3f45837433 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -196,7 +196,6 @@ bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); int32_t footpath_is_connected_to_map_edge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags); void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement); -int32_t entrance_get_directions(const TileElement* tileElement); PathSurfaceEntry* get_path_surface_entry(PathSurfaceIndex entryIndex); PathRailingsEntry* get_path_railings_entry(PathRailingsIndex entryIndex); diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 7efd8744a7..8b12e7a319 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -591,6 +591,8 @@ public: PathSurfaceIndex GetPathType() const; void SetPathType(PathSurfaceIndex newPathType); + + int32_t GetDirections() const; }; assert_struct_size(EntranceElement, 16); From cf9bb4cd2c8963eb7fb6b39480c9bb565924eb53 Mon Sep 17 00:00:00 2001 From: Kane Date: Fri, 13 Aug 2021 01:43:34 +1000 Subject: [PATCH 156/681] Fix issue #15211: Rename RideConstructionState::Build to ...::MazeBuild (#15212) Pull #15203 commited enum RideConstructionState missing the "Maze" part in "MazeBuild" --- src/openrct2-ui/windows/MazeConstruction.cpp | 6 +++--- src/openrct2-ui/windows/RideConstruction.cpp | 4 ++-- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideConstruction.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 171a49942c..93006dd0c6 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -274,7 +274,7 @@ static void window_maze_construction_mousedown(rct_window* w, rct_widgetindex wi switch (widgetIndex) { case WIDX_MAZE_BUILD_MODE: - window_maze_construction_build_mode_mousedown(RideConstructionState::Build); + window_maze_construction_build_mode_mousedown(RideConstructionState::MazeBuild); break; case WIDX_MAZE_MOVE_MODE: window_maze_construction_build_mode_mousedown(RideConstructionState::MazeMove); @@ -484,7 +484,7 @@ void window_maze_construction_update_pressed_widgets() pressedWidgets |= EnumToFlag(WIDX_MAZE_EXIT); } break; - case RideConstructionState::Build: + case RideConstructionState::MazeBuild: pressedWidgets |= EnumToFlag(WIDX_MAZE_BUILD_MODE); break; case RideConstructionState::MazeMove: @@ -519,7 +519,7 @@ static void window_maze_construction_construct(int32_t direction) z = _currentTrackBegin.z; switch (_rideConstructionState) { - case RideConstructionState::Build: + case RideConstructionState::MazeBuild: mode = GC_SET_MAZE_TRACK_BUILD; flags = GAME_COMMAND_FLAG_APPLY; break; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f66bae7077..fa6da74546 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2610,7 +2610,7 @@ void sub_6C94D8() } break; } - case RideConstructionState::Build: + case RideConstructionState::MazeBuild: case RideConstructionState::MazeMove: case RideConstructionState::MazeFill: { @@ -3735,7 +3735,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) { for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { - _rideConstructionState = RideConstructionState::Build; + _rideConstructionState = RideConstructionState::MazeBuild; _currentTrackBegin.x = mapCoords.x; _currentTrackBegin.y = mapCoords.y; _currentTrackBegin.z = z; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index d86a11a40f..2df6091a66 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -889,7 +889,7 @@ enum class RideConstructionState : uint8_t Selected, Place, EntranceExit, - Build, + MazeBuild, MazeMove, MazeFill }; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 45cbc3e523..cd8ec533c7 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -550,7 +550,7 @@ void ride_construction_invalidate_current_track() { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); break; - case RideConstructionState::Build: + case RideConstructionState::MazeBuild: case RideConstructionState::MazeMove: case RideConstructionState::MazeFill: case RideConstructionState::Front: @@ -950,7 +950,7 @@ static bool ride_modify_maze(const CoordsXYE& tileElement) if (trackElement != nullptr) { _currentRideIndex = trackElement->GetRideIndex(); - _rideConstructionState = RideConstructionState::Build; + _rideConstructionState = RideConstructionState::MazeBuild; _currentTrackBegin.x = tileElement.x; _currentTrackBegin.y = tileElement.y; _currentTrackBegin.z = trackElement->GetBaseZ(); From d6ad9b67e7a6a716dc7ffd705d26ac191f76397d Mon Sep 17 00:00:00 2001 From: Saad Rehman Date: Thu, 12 Aug 2021 20:20:15 +0400 Subject: [PATCH 157/681] Fix #15161 #15159 one-off error when getting stationIndex (#15163) * Fix #14918 refactor stationIndex and loop to avoid in/decrement to null Fix #15161 #15159 one-off error when getting stationIndex * Add const and remove unused variable Co-authored-by: duncanspumpkin --- src/openrct2-ui/windows/Ride.cpp | 72 +++++++++++++++++++------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 27854bab16..352c565272 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include using namespace OpenRCT2; @@ -1546,6 +1547,32 @@ static void window_ride_anchor_border_widgets(rct_window* w) #pragma region Main +static std::optional GetStationIndexFromViewSelection(const rct_window& w) +{ + const auto* ride = get_ride(w.number); + if (ride == nullptr) + return {}; + + int32_t viewSelectionIndex = w.ride.view - 1 - ride->num_vehicles; + if (viewSelectionIndex < 0) + { + return {}; + } + + for (StationIndex index = 0; index < sizeof(ride->stations); ++index) + { + const auto& station = ride->stations[index]; + if (!station.Start.isNull()) + { + if (viewSelectionIndex-- == 0) + { + return { index }; + } + } + } + return {}; +} + /** * * rct2: 0x006AF994 @@ -1599,22 +1626,14 @@ static void window_ride_init_viewport(rct_window* w) } else if (viewSelectionIndex >= ride->num_vehicles && viewSelectionIndex < (ride->num_vehicles + ride->num_stations)) { - int32_t count = viewSelectionIndex - ride->num_vehicles; - for (const auto& station : ride->stations) + auto stationIndex = GetStationIndexFromViewSelection(*w); + if (stationIndex) { - if (!station.Start.isNull()) - { - count--; - } - if (count == 0) - { - auto location = station.GetStart(); - focus.coordinate.x = location.x; - focus.coordinate.y = location.y; - focus.coordinate.z = location.z; - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; - break; - } + auto location = ride->stations[*stationIndex].GetStart(); + focus.coordinate.x = location.x; + focus.coordinate.y = location.y; + focus.coordinate.z = location.z; + focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; } } else @@ -2527,36 +2546,31 @@ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft if (ride == nullptr) return STR_NONE; - int32_t count = w->ride.view - ride->num_vehicles - 1; - StationIndex stationIndex = STATION_INDEX_NULL; - rct_string_id stringId = STR_EMPTY; - - do + const auto stationIndex = GetStationIndexFromViewSelection(*w); + if (!stationIndex) { - stationIndex++; - if (!ride->stations[stationIndex].Start.isNull()) - count--; - } while (count >= 0); + return STR_NONE; + } + rct_string_id stringId = STR_EMPTY; // Entrance / exit if (ride->status == RideStatus::Closed) { - if (ride_get_entrance_location(ride, static_cast(stationIndex)).isNull()) + if (ride_get_entrance_location(ride, static_cast(*stationIndex)).isNull()) stringId = STR_NO_ENTRANCE; - else if (ride_get_exit_location(ride, static_cast(stationIndex)).isNull()) + else if (ride_get_exit_location(ride, static_cast(*stationIndex)).isNull()) stringId = STR_NO_EXIT; } else { - if (ride_get_entrance_location(ride, static_cast(stationIndex)).isNull()) + if (ride_get_entrance_location(ride, static_cast(*stationIndex)).isNull()) stringId = STR_EXIT_ONLY; } - // Queue length if (stringId == STR_EMPTY) { stringId = STR_QUEUE_EMPTY; - uint16_t queueLength = ride->stations[stationIndex].QueueLength; + uint16_t queueLength = ride->stations[*stationIndex].QueueLength; if (queueLength == 1) stringId = STR_QUEUE_ONE_PERSON; else if (queueLength > 1) From 72404f1b85602f8ffdbd393273d882a7fcab6cd9 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 31 Jul 2021 22:18:15 +0200 Subject: [PATCH 158/681] Eliminate _trackDesignPlaceCost --- src/openrct2/ride/TrackDesign.cpp | 122 +++++++++++++++--------------- src/openrct2/ride/TrackDesign.h | 2 +- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 4a6655993f..add3914c5f 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -73,7 +73,6 @@ static CoordsXYZ _trackPreviewOrigin; bool _trackDesignDrawingPreview; static uint8_t _trackDesignPlaceOperation; -static money32 _trackDesignPlaceCost; static int16_t _trackDesignPlaceZ; static int16_t _trackDesignPlaceSceneryZ; @@ -965,23 +964,24 @@ static bool TrackDesignPlaceSceneryElementGetPlaceZ(const TrackDesignSceneryElem return true; } -static bool TrackDesignPlaceSceneryElement( - CoordsXY mapCoord, uint8_t mode, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ) +static std::pair TrackDesignPlaceSceneryElement( + CoordsXY mapCoord, uint8_t mode, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ, + money32 totalCost) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES && mode == 0) { track_design_add_selection_tile(mapCoord); - return true; + return std::pair(true, totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST && mode == 0) { - return TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ); + return std::pair(TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ), totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return TrackDesignPlaceSceneryElementGetPlaceZ(scenery); + return std::pair(TrackDesignPlaceSceneryElementGetPlaceZ(scenery), totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY || _trackDesignPlaceOperation == PTD_OPERATION_PLACE @@ -992,7 +992,7 @@ static bool TrackDesignPlaceSceneryElement( ObjectEntryIndex entry_index; if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) { - return true; + return std::pair(true, totalCost); } money32 cost; @@ -1006,11 +1006,11 @@ static bool TrackDesignPlaceSceneryElement( { if (mode != 0) { - return true; + return std::pair(true, totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return std::pair(true, totalCost); } rotation += scenery.flags; @@ -1054,11 +1054,11 @@ static bool TrackDesignPlaceSceneryElement( { if (mode != 0) { - return true; + return std::pair(true, totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return std::pair(true, totalCost); } rotation += scenery.flags; @@ -1098,11 +1098,11 @@ static bool TrackDesignPlaceSceneryElement( { if (mode != 0) { - return true; + return std::pair(true, totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return std::pair(true, totalCost); } z = scenery.z * COORDS_Z_STEP + originZ; @@ -1141,7 +1141,7 @@ static bool TrackDesignPlaceSceneryElement( case ObjectType::Paths: if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return true; + return std::pair(true, totalCost); } z = (scenery.z * COORDS_Z_STEP + originZ) / COORDS_Z_STEP; @@ -1193,14 +1193,14 @@ static bool TrackDesignPlaceSceneryElement( { if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY) { - return true; + return std::pair(true, totalCost); } auto* pathElement = map_get_path_element_at({ mapCoord.x / 32, mapCoord.y / 32, z }); if (pathElement == nullptr) { - return true; + return std::pair(true, totalCost); } footpath_queue_chain_reset(); @@ -1222,40 +1222,40 @@ static bool TrackDesignPlaceSceneryElement( } footpath_connect_edges(mapCoord, reinterpret_cast(pathElement), flags); footpath_update_queue_chains(); - return true; + return std::pair(true, totalCost); } break; default: _trackDesignPlaceStateSceneryUnavailable = true; - return true; + return std::pair(true, totalCost); } - _trackDesignPlaceCost = add_clamp_money32(_trackDesignPlaceCost, cost); + totalCost = add_clamp_money32(totalCost, cost); if (_trackDesignPlaceOperation != PTD_OPERATION_PLACE) { if (cost == MONEY32_UNDEFINED) { - _trackDesignPlaceCost = MONEY32_UNDEFINED; + totalCost = MONEY32_UNDEFINED; } } - if (_trackDesignPlaceCost != MONEY32_UNDEFINED) + if (totalCost != MONEY32_UNDEFINED) { - return true; + return std::pair(true, totalCost); } if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE) { - return true; + return std::pair(true, totalCost); } - return false; + return std::pair(false, totalCost); } - return true; + return std::pair(true, totalCost); } /** * * rct2: 0x006D0964 */ -static int32_t track_design_place_all_scenery( - const std::vector& sceneryList, const CoordsXYZ& origin) +static std::pair track_design_place_all_scenery( + const std::vector& sceneryList, const CoordsXYZ& origin, money32 cost) { for (uint8_t mode = 0; mode <= 1; mode++) { @@ -1279,16 +1279,20 @@ static int32_t track_design_place_all_scenery( auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), origin.z }; track_design_update_max_min_coordinates(mapCoord); - if (!TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z)) + auto [placementSuccess, newCost] = TrackDesignPlaceSceneryElement( + mapCoord, mode, scenery, rotation, origin.z, cost); + cost = newCost; + if (!placementSuccess) { - return 0; + return std::pair(false, cost); } } } - return 1; + return std::pair(true, cost); } -static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords, Ride* ride) +static std::pair track_design_place_maze( + TrackDesign* td6, const CoordsXYZ& coords, Ride* ride, money32 totalCost) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) { @@ -1298,7 +1302,7 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords } _trackDesignPlaceZ = 0; - _trackDesignPlaceCost = 0; + totalCost = 0; for (const auto& maze_element : td6->maze_elements) { @@ -1435,12 +1439,11 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords break; } - _trackDesignPlaceCost += cost; + totalCost += cost; if (cost == MONEY32_UNDEFINED) { - _trackDesignPlaceCost = cost; - return 0; + return std::pair(false, MONEY32_UNDEFINED); } } @@ -1487,10 +1490,11 @@ static int32_t track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords } _trackPreviewOrigin = coords; - return 1; + return std::pair(true, totalCost); } -static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, Ride* ride) +static std::pair track_design_place_ride( + TrackDesign* td6, const CoordsXYZ& origin, Ride* ride, money32 totalCost) { _trackPreviewOrigin = origin; if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) @@ -1501,7 +1505,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R } _trackDesignPlaceZ = 0; - _trackDesignPlaceCost = 0; + totalCost = 0; uint8_t rotation = _currentTrackPieceDirection; // Track elements @@ -1587,11 +1591,10 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R : GameActions::QueryNested(&trackPlaceAction); money32 cost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; - _trackDesignPlaceCost += cost; + totalCost += cost; if (cost == MONEY32_UNDEFINED) { - _trackDesignPlaceCost = cost; - return false; + return std::pair(false, MONEY32_UNDEFINED); } break; } @@ -1609,7 +1612,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R auto surfaceElement = map_get_surface_element_at(tile); if (surfaceElement == nullptr) { - return false; + return std::pair(false, MONEY32_UNDEFINED); } int32_t surfaceZ = surfaceElement->GetBaseZ(); @@ -1682,8 +1685,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R newCoords.z += entrance.z; if (tile_element == nullptr) { - _trackDesignPlaceCost = MONEY32_UNDEFINED; - return false; + return std::pair(false, MONEY32_UNDEFINED); } do @@ -1724,12 +1726,11 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&rideEntranceExitPlaceAction) : GameActions::QueryNested(&rideEntranceExitPlaceAction); - _trackDesignPlaceCost += res->Cost; + totalCost += res->Cost; if (res->Error != GameActions::Status::Ok) { - _trackDesignPlaceCost = MONEY32_UNDEFINED; - return false; + return std::pair(false, MONEY32_UNDEFINED); } _trackDesignPlaceStateEntranceExitPlaced = true; break; @@ -1743,12 +1744,11 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R auto res = RideEntranceExitPlaceAction::TrackPlaceQuery(newCoords, false); if (res->Error != GameActions::Status::Ok) { - _trackDesignPlaceCost = MONEY32_UNDEFINED; - return false; + return std::pair(false, MONEY32_UNDEFINED); } else { - _trackDesignPlaceCost += res->Cost; + totalCost += res->Cost; _trackDesignPlaceStateEntranceExitPlaced = true; } } @@ -1762,7 +1762,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R sub_6CB945(ride); ride->Delete(); } - return true; + return std::pair(true, totalCost); } /** @@ -1778,7 +1778,7 @@ static bool track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, R * bl == 6, Clear white outlined track. * rct2: 0x006D01B3 */ -int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeScenery, Ride* ride, const CoordsXYZ& coords) +money32 place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeScenery, Ride* ride, const CoordsXYZ& coords) { // Previously byte_F4414E was cleared here _trackDesignPlaceStatePlaceScenery = placeScenery; @@ -1799,22 +1799,26 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc _trackPreviewMax = coords; _trackDesignPlaceSceneryZ = 0; - uint8_t track_place_success = 0; + bool trackPlaceSuccess = false; + money32 trackPlaceCost = 0; if (td6->type == RIDE_TYPE_MAZE) { - track_place_success = track_design_place_maze(td6, coords, ride); + std::tie(trackPlaceSuccess, trackPlaceCost) = track_design_place_maze(td6, coords, ride, trackPlaceCost); } else { - track_place_success = track_design_place_ride(td6, coords, ride); + std::tie(trackPlaceSuccess, trackPlaceCost) = track_design_place_ride(td6, coords, ride, trackPlaceCost); } // Scenery elements - if (track_place_success) + if (trackPlaceSuccess) { - if (!track_design_place_all_scenery(td6->scenery_elements, _trackPreviewOrigin)) + bool success = false; + std::tie(success, trackPlaceCost) = track_design_place_all_scenery( + td6->scenery_elements, _trackPreviewOrigin, trackPlaceCost); + if (!success) { - return _trackDesignPlaceCost; + return MONEY32_UNDEFINED; } } @@ -1833,7 +1837,7 @@ int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc // from _trackDesignPlaceZ, causing bug #259. return _trackDesignPlaceZ - _trackDesignPlaceSceneryZ; } - return _trackDesignPlaceCost; + return trackPlaceCost; } static money32 track_design_ride_create_command(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex) diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 68587c8c34..e7da3a3328 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -204,7 +204,7 @@ std::unique_ptr track_design_open(const utf8* path); void track_design_mirror(TrackDesign* td6); -int32_t place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeScenery, Ride* ride, const CoordsXYZ& coords); +money32 place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeScenery, Ride* ride, const CoordsXYZ& coords); /////////////////////////////////////////////////////////////////////////////// // Track design preview From c071b61d3ee5b25894ef4640db820e11f9d0e5fa Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 8 Aug 2021 12:27:06 +0200 Subject: [PATCH 159/681] Use std::optional instead of std::pair --- src/openrct2/ride/TrackDesign.cpp | 106 ++++++++++++++++-------------- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index add3914c5f..dbcbcf4b32 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -964,24 +964,30 @@ static bool TrackDesignPlaceSceneryElementGetPlaceZ(const TrackDesignSceneryElem return true; } -static std::pair TrackDesignPlaceSceneryElement( +static std::optional TrackDesignPlaceSceneryElement( CoordsXY mapCoord, uint8_t mode, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ, money32 totalCost) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES && mode == 0) { track_design_add_selection_tile(mapCoord); - return std::pair(true, totalCost); + return totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST && mode == 0) { - return std::pair(TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ), totalCost); + if (TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ)) + return totalCost; + + return std::nullopt; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return std::pair(TrackDesignPlaceSceneryElementGetPlaceZ(scenery), totalCost); + if (TrackDesignPlaceSceneryElementGetPlaceZ(scenery)) + return totalCost; + + return std::nullopt; } if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY || _trackDesignPlaceOperation == PTD_OPERATION_PLACE @@ -992,7 +998,7 @@ static std::pair TrackDesignPlaceSceneryElement( ObjectEntryIndex entry_index; if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) { - return std::pair(true, totalCost); + return totalCost; } money32 cost; @@ -1006,11 +1012,11 @@ static std::pair TrackDesignPlaceSceneryElement( { if (mode != 0) { - return std::pair(true, totalCost); + return totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return std::pair(true, totalCost); + return totalCost; } rotation += scenery.flags; @@ -1054,11 +1060,11 @@ static std::pair TrackDesignPlaceSceneryElement( { if (mode != 0) { - return std::pair(true, totalCost); + return totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return std::pair(true, totalCost); + return totalCost; } rotation += scenery.flags; @@ -1098,11 +1104,11 @@ static std::pair TrackDesignPlaceSceneryElement( { if (mode != 0) { - return std::pair(true, totalCost); + return totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return std::pair(true, totalCost); + return totalCost; } z = scenery.z * COORDS_Z_STEP + originZ; @@ -1141,7 +1147,7 @@ static std::pair TrackDesignPlaceSceneryElement( case ObjectType::Paths: if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return std::pair(true, totalCost); + return totalCost; } z = (scenery.z * COORDS_Z_STEP + originZ) / COORDS_Z_STEP; @@ -1193,14 +1199,14 @@ static std::pair TrackDesignPlaceSceneryElement( { if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY) { - return std::pair(true, totalCost); + return totalCost; } auto* pathElement = map_get_path_element_at({ mapCoord.x / 32, mapCoord.y / 32, z }); if (pathElement == nullptr) { - return std::pair(true, totalCost); + return totalCost; } footpath_queue_chain_reset(); @@ -1222,12 +1228,12 @@ static std::pair TrackDesignPlaceSceneryElement( } footpath_connect_edges(mapCoord, reinterpret_cast(pathElement), flags); footpath_update_queue_chains(); - return std::pair(true, totalCost); + return totalCost; } break; default: _trackDesignPlaceStateSceneryUnavailable = true; - return std::pair(true, totalCost); + return totalCost; } totalCost = add_clamp_money32(totalCost, cost); if (_trackDesignPlaceOperation != PTD_OPERATION_PLACE) @@ -1239,22 +1245,22 @@ static std::pair TrackDesignPlaceSceneryElement( } if (totalCost != MONEY32_UNDEFINED) { - return std::pair(true, totalCost); + return totalCost; } if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE) { - return std::pair(true, totalCost); + return totalCost; } - return std::pair(false, totalCost); + return std::nullopt; } - return std::pair(true, totalCost); + return totalCost; } /** * * rct2: 0x006D0964 */ -static std::pair track_design_place_all_scenery( +static std::optional track_design_place_all_scenery( const std::vector& sceneryList, const CoordsXYZ& origin, money32 cost) { for (uint8_t mode = 0; mode <= 1; mode++) @@ -1279,20 +1285,18 @@ static std::pair track_design_place_all_scenery( auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), origin.z }; track_design_update_max_min_coordinates(mapCoord); - auto [placementSuccess, newCost] = TrackDesignPlaceSceneryElement( - mapCoord, mode, scenery, rotation, origin.z, cost); - cost = newCost; - if (!placementSuccess) + auto placementCost = TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z, cost); + if (!placementCost.has_value() || placementCost == MONEY32_UNDEFINED) { - return std::pair(false, cost); + return std::nullopt; } + cost = placementCost.value(); } } - return std::pair(true, cost); + return cost; } -static std::pair track_design_place_maze( - TrackDesign* td6, const CoordsXYZ& coords, Ride* ride, money32 totalCost) +static std::optional track_design_place_maze(TrackDesign* td6, const CoordsXYZ& coords, Ride* ride) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) { @@ -1302,7 +1306,7 @@ static std::pair track_design_place_maze( } _trackDesignPlaceZ = 0; - totalCost = 0; + money32 totalCost = 0; for (const auto& maze_element : td6->maze_elements) { @@ -1443,7 +1447,7 @@ static std::pair track_design_place_maze( if (cost == MONEY32_UNDEFINED) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } } @@ -1490,11 +1494,10 @@ static std::pair track_design_place_maze( } _trackPreviewOrigin = coords; - return std::pair(true, totalCost); + return totalCost; } -static std::pair track_design_place_ride( - TrackDesign* td6, const CoordsXYZ& origin, Ride* ride, money32 totalCost) +static std::optional track_design_place_ride(TrackDesign* td6, const CoordsXYZ& origin, Ride* ride) { _trackPreviewOrigin = origin; if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES) @@ -1505,7 +1508,7 @@ static std::pair track_design_place_ride( } _trackDesignPlaceZ = 0; - totalCost = 0; + money32 totalCost = 0; uint8_t rotation = _currentTrackPieceDirection; // Track elements @@ -1594,7 +1597,7 @@ static std::pair track_design_place_ride( totalCost += cost; if (cost == MONEY32_UNDEFINED) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } break; } @@ -1612,7 +1615,7 @@ static std::pair track_design_place_ride( auto surfaceElement = map_get_surface_element_at(tile); if (surfaceElement == nullptr) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } int32_t surfaceZ = surfaceElement->GetBaseZ(); @@ -1685,7 +1688,7 @@ static std::pair track_design_place_ride( newCoords.z += entrance.z; if (tile_element == nullptr) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } do @@ -1730,7 +1733,7 @@ static std::pair track_design_place_ride( if (res->Error != GameActions::Status::Ok) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } _trackDesignPlaceStateEntranceExitPlaced = true; break; @@ -1744,7 +1747,7 @@ static std::pair track_design_place_ride( auto res = RideEntranceExitPlaceAction::TrackPlaceQuery(newCoords, false); if (res->Error != GameActions::Status::Ok) { - return std::pair(false, MONEY32_UNDEFINED); + return std::nullopt; } else { @@ -1762,7 +1765,7 @@ static std::pair track_design_place_ride( sub_6CB945(ride); ride->Delete(); } - return std::pair(true, totalCost); + return totalCost; } /** @@ -1799,27 +1802,27 @@ money32 place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc _trackPreviewMax = coords; _trackDesignPlaceSceneryZ = 0; - bool trackPlaceSuccess = false; - money32 trackPlaceCost = 0; + std::optional trackPlaceCost; if (td6->type == RIDE_TYPE_MAZE) { - std::tie(trackPlaceSuccess, trackPlaceCost) = track_design_place_maze(td6, coords, ride, trackPlaceCost); + trackPlaceCost = track_design_place_maze(td6, coords, ride); } else { - std::tie(trackPlaceSuccess, trackPlaceCost) = track_design_place_ride(td6, coords, ride, trackPlaceCost); + trackPlaceCost = track_design_place_ride(td6, coords, ride); } // Scenery elements - if (trackPlaceSuccess) + if (trackPlaceCost.has_value()) { - bool success = false; - std::tie(success, trackPlaceCost) = track_design_place_all_scenery( - td6->scenery_elements, _trackPreviewOrigin, trackPlaceCost); - if (!success) + auto trackPlusSceneryCost = track_design_place_all_scenery( + td6->scenery_elements, _trackPreviewOrigin, trackPlaceCost.value()); + if (!trackPlusSceneryCost.has_value()) { return MONEY32_UNDEFINED; } + + trackPlaceCost = trackPlusSceneryCost; } // 0x6D0FE6 @@ -1837,7 +1840,8 @@ money32 place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc // from _trackDesignPlaceZ, causing bug #259. return _trackDesignPlaceZ - _trackDesignPlaceSceneryZ; } - return trackPlaceCost; + + return trackPlaceCost.has_value() ? trackPlaceCost.value() : MONEY32_UNDEFINED; } static money32 track_design_ride_create_command(int32_t type, int32_t subType, int32_t flags, ride_id_t* outRideIndex) From 33b0963f5362920b1a247a85f06534d62aef0fba Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 15 Aug 2021 13:39:04 +0200 Subject: [PATCH 160/681] Move scenery cost addition to the caller --- src/openrct2/ride/TrackDesign.cpp | 50 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index dbcbcf4b32..6c8c745329 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -965,19 +965,18 @@ static bool TrackDesignPlaceSceneryElementGetPlaceZ(const TrackDesignSceneryElem } static std::optional TrackDesignPlaceSceneryElement( - CoordsXY mapCoord, uint8_t mode, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ, - money32 totalCost) + CoordsXY mapCoord, uint8_t mode, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ) { if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES && mode == 0) { track_design_add_selection_tile(mapCoord); - return totalCost; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST && mode == 0) { if (TrackDesignPlaceSceneryElementRemoveGhost(mapCoord, scenery, rotation, originZ)) - return totalCost; + return 0; return std::nullopt; } @@ -985,11 +984,12 @@ static std::optional TrackDesignPlaceSceneryElement( if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { if (TrackDesignPlaceSceneryElementGetPlaceZ(scenery)) - return totalCost; + return 0; return std::nullopt; } + money32 totalCost = 0; if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY || _trackDesignPlaceOperation == PTD_OPERATION_PLACE || _trackDesignPlaceOperation == PTD_OPERATION_PLACE_GHOST || _trackDesignPlaceOperation == PTD_OPERATION_PLACE_TRACK_PREVIEW) @@ -998,7 +998,7 @@ static std::optional TrackDesignPlaceSceneryElement( ObjectEntryIndex entry_index; if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) { - return totalCost; + return 0; } money32 cost; @@ -1012,11 +1012,11 @@ static std::optional TrackDesignPlaceSceneryElement( { if (mode != 0) { - return totalCost; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return totalCost; + return 0; } rotation += scenery.flags; @@ -1060,11 +1060,11 @@ static std::optional TrackDesignPlaceSceneryElement( { if (mode != 0) { - return totalCost; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return totalCost; + return 0; } rotation += scenery.flags; @@ -1104,11 +1104,11 @@ static std::optional TrackDesignPlaceSceneryElement( { if (mode != 0) { - return totalCost; + return 0; } if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return totalCost; + return 0; } z = scenery.z * COORDS_Z_STEP + originZ; @@ -1147,7 +1147,7 @@ static std::optional TrackDesignPlaceSceneryElement( case ObjectType::Paths: if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - return totalCost; + return 0; } z = (scenery.z * COORDS_Z_STEP + originZ) / COORDS_Z_STEP; @@ -1199,14 +1199,14 @@ static std::optional TrackDesignPlaceSceneryElement( { if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_QUERY) { - return totalCost; + return 0; } auto* pathElement = map_get_path_element_at({ mapCoord.x / 32, mapCoord.y / 32, z }); if (pathElement == nullptr) { - return totalCost; + return 0; } footpath_queue_chain_reset(); @@ -1228,12 +1228,12 @@ static std::optional TrackDesignPlaceSceneryElement( } footpath_connect_edges(mapCoord, reinterpret_cast(pathElement), flags); footpath_update_queue_chains(); - return totalCost; + return 0; } break; default: _trackDesignPlaceStateSceneryUnavailable = true; - return totalCost; + return 0; } totalCost = add_clamp_money32(totalCost, cost); if (_trackDesignPlaceOperation != PTD_OPERATION_PLACE) @@ -1261,8 +1261,10 @@ static std::optional TrackDesignPlaceSceneryElement( * rct2: 0x006D0964 */ static std::optional track_design_place_all_scenery( - const std::vector& sceneryList, const CoordsXYZ& origin, money32 cost) + const std::vector& sceneryList, const CoordsXYZ& origin) { + money32 cost = 0; + for (uint8_t mode = 0; mode <= 1; mode++) { if (!sceneryList.empty()) @@ -1285,14 +1287,15 @@ static std::optional track_design_place_all_scenery( auto mapCoord = CoordsXYZ{ tileCoords.ToCoordsXY(), origin.z }; track_design_update_max_min_coordinates(mapCoord); - auto placementCost = TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z, cost); + auto placementCost = TrackDesignPlaceSceneryElement(mapCoord, mode, scenery, rotation, origin.z); if (!placementCost.has_value() || placementCost == MONEY32_UNDEFINED) { return std::nullopt; } - cost = placementCost.value(); + cost += placementCost.value(); } } + return cost; } @@ -1815,14 +1818,13 @@ money32 place_virtual_track(TrackDesign* td6, uint8_t ptdOperation, bool placeSc // Scenery elements if (trackPlaceCost.has_value()) { - auto trackPlusSceneryCost = track_design_place_all_scenery( - td6->scenery_elements, _trackPreviewOrigin, trackPlaceCost.value()); - if (!trackPlusSceneryCost.has_value()) + auto sceneryCost = track_design_place_all_scenery(td6->scenery_elements, _trackPreviewOrigin); + if (!sceneryCost.has_value()) { return MONEY32_UNDEFINED; } - trackPlaceCost = trackPlusSceneryCost; + trackPlaceCost = trackPlaceCost.value() + sceneryCost.value(); } // 0x6D0FE6 From 175394f15b98573e64242a1da977e5672f851570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 15 Aug 2021 05:28:08 -0700 Subject: [PATCH 161/681] Fix #15193: Crash when rides/stalls are demolished --- distribution/changelog.txt | 1 + src/openrct2/actions/RideDemolishAction.cpp | 84 +-------------- src/openrct2/peep/Guest.cpp | 109 ++++++++++++++++++++ src/openrct2/peep/Peep.h | 4 + 4 files changed, 115 insertions(+), 83 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c23034eb8b..f9c7ead1d9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -13,6 +13,7 @@ - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Fix: [#15170] Plugin: incorrect label text alignment. - Fix: [#15184] Crash when hovering over water types in Object Selection. +- Fix: [#15193] Crash when rides/stalls are demolished. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 7e5e0b89ab..1e584de91b 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -136,89 +136,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const for (auto peep : EntityList()) { - uint8_t ride_id_bit = _rideIndex % 8; - uint8_t ride_id_offset = _rideIndex / 8; - - // clear ride from potentially being in RidesBeenOn - peep->RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); - if (peep->State == PeepState::Watching) - { - if (peep->CurrentRide == _rideIndex) - { - peep->CurrentRide = RIDE_ID_NULL; - if (peep->TimeToStand >= 50) - { - // make peep stop watching the ride - peep->TimeToStand = 50; - } - } - } - - // remove any free voucher for this ride from peep - if (peep->HasItem(ShopItem::Voucher)) - { - if (peep->VoucherType == VOUCHER_TYPE_RIDE_FREE && peep->VoucherRideId == _rideIndex) - { - peep->RemoveItem(ShopItem::Voucher); - } - } - - // remove any photos of this ride from peep - if (peep->HasItem(ShopItem::Photo)) - { - if (peep->Photo1RideRef == _rideIndex) - { - peep->RemoveItem(ShopItem::Photo); - } - } - if (peep->HasItem(ShopItem::Photo2)) - { - if (peep->Photo2RideRef == _rideIndex) - { - peep->RemoveItem(ShopItem::Photo2); - } - } - if (peep->HasItem(ShopItem::Photo3)) - { - if (peep->Photo3RideRef == _rideIndex) - { - peep->RemoveItem(ShopItem::Photo3); - } - } - if (peep->HasItem(ShopItem::Photo4)) - { - if (peep->Photo4RideRef == _rideIndex) - { - peep->RemoveItem(ShopItem::Photo4); - } - } - - if (peep->GuestHeadingToRideId == _rideIndex) - { - peep->GuestHeadingToRideId = RIDE_ID_NULL; - } - if (peep->FavouriteRide == _rideIndex) - { - peep->FavouriteRide = RIDE_ID_NULL; - } - - for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; i++) - { - // Don't touch items after the first NONE thought as they are not valid - // fixes issues with clearing out bad thought data in multiplayer - if (peep->Thoughts[i].type == PeepThoughtType::None) - break; - - if (peep->Thoughts[i].type != PeepThoughtType::None && peep->Thoughts[i].item == _rideIndex) - { - // Clear top thought, push others up - memmove(&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); - peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None; - peep->Thoughts[PEEP_MAX_THOUGHTS - 1].item = PEEP_THOUGHT_ITEM_NONE; - // Next iteration, check the new thought at this index - i--; - } - } + peep->RemoveRideFromMemory(_rideIndex); } MarketingCancelCampaignsForRide(_rideIndex); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 828082215b..2aa6787403 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -7356,3 +7356,112 @@ bool Guest::HasItem(ShopItem peepItem) const { return GetItemFlags() & EnumToFlag(peepItem); } + +static bool IsThoughtShopItemRelated(const PeepThoughtType type) +{ + switch (type) + { + case PeepThoughtType::AlreadyGot: + case PeepThoughtType::HaventFinished: + case PeepThoughtType::CantAffordItem: + return true; + default: + break; + } + return false; +} + +void Guest::RemoveRideFromMemory(ride_id_t rideId) +{ + uint8_t ride_id_bit = rideId % 8; + uint8_t ride_id_offset = rideId / 8; + + // clear ride from potentially being in RidesBeenOn + RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); + if (State == PeepState::Watching) + { + if (CurrentRide == rideId) + { + CurrentRide = RIDE_ID_NULL; + if (TimeToStand >= 50) + { + // make peep stop watching the ride + TimeToStand = 50; + } + } + } + + // remove any free voucher for this ride from peep + if (HasItem(ShopItem::Voucher)) + { + if (VoucherType == VOUCHER_TYPE_RIDE_FREE && VoucherRideId == rideId) + { + RemoveItem(ShopItem::Voucher); + } + } + + // remove any photos of this ride from peep + if (HasItem(ShopItem::Photo)) + { + if (Photo1RideRef == rideId) + { + RemoveItem(ShopItem::Photo); + } + } + if (HasItem(ShopItem::Photo2)) + { + if (Photo2RideRef == rideId) + { + RemoveItem(ShopItem::Photo2); + } + } + if (HasItem(ShopItem::Photo3)) + { + if (Photo3RideRef == rideId) + { + RemoveItem(ShopItem::Photo3); + } + } + if (HasItem(ShopItem::Photo4)) + { + if (Photo4RideRef == rideId) + { + RemoveItem(ShopItem::Photo4); + } + } + + if (GuestHeadingToRideId == rideId) + { + GuestHeadingToRideId = RIDE_ID_NULL; + } + if (FavouriteRide == rideId) + { + FavouriteRide = RIDE_ID_NULL; + } + + // Erase all thoughts that contain the ride. + for (auto it = std::begin(Thoughts); it != std::end(Thoughts);) + { + const auto& entry = *it; + if (entry.type == PeepThoughtType::None) + break; + + // Ride ids and shop item ids might have the same value, look only for ride thoughts. + if (IsThoughtShopItemRelated(entry.type) || entry.item != rideId) + { + it++; + continue; + } + + if (auto itNext = std::next(it); itNext != std::end(Thoughts)) + { + // Overwrite this entry by shifting all entries that follow. + std::rotate(it, itNext, std::end(Thoughts)); + } + + // Last slot is now free. + auto& lastEntry = Thoughts.back(); + lastEntry.type = PeepThoughtType::None; + lastEntry.item = PEEP_THOUGHT_ITEM_NONE; + } +} diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 7b0d176ebe..6683f419c9 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -784,6 +784,10 @@ public: bool HasItem(ShopItem peepItem) const; void Serialise(DataSerialiser& stream); + // Removes the ride from the guests memory, this includes + // the history, thoughts, etc. + void RemoveRideFromMemory(ride_id_t rideId); + private: void UpdateRide(); void UpdateOnRide(){}; // TODO From 767dbfe41cf1d77dff1c6b26070c83c604ec53b2 Mon Sep 17 00:00:00 2001 From: Kane Date: Mon, 16 Aug 2021 01:09:08 +1000 Subject: [PATCH 162/681] Issue #13814: Refactor window to class: Viewport (#15217) * Issue #13814: Refactor window to class: Viewport * Code style * Code improvements * Code improvements Removes unnecessary private var _viewportWindowNumber GetFreeViewportNumber function updates window->number --- src/openrct2-ui/windows/Viewport.cpp | 350 +++++++++++++++------------ 1 file changed, 189 insertions(+), 161 deletions(-) diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index ea481aedd9..821ede093a 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -10,192 +10,220 @@ #include #include #include +#include #include #include #include #include -static constexpr const rct_string_id WINDOW_TITLE = STR_VIEWPORT_NO; -static constexpr const int32_t WH = 500; -static constexpr const int32_t WW = 350; - // clang-format off -enum { +enum WINDOW_VIEWPORT_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, + WIDX_CONTENT_PANEL, WIDX_VIEWPORT, WIDX_ZOOM_IN, WIDX_ZOOM_OUT, - WIDX_LOCATE + WIDX_LOCATE, }; -static rct_widget window_viewport_widgets[] = { +#pragma region MEASUREMENTS + +static constexpr const rct_string_id WINDOW_TITLE = STR_VIEWPORT_NO; +static constexpr const int32_t WW = 200; +static constexpr const int32_t WH = 200; + +static constexpr ScreenSize VIEWPORT_BUTTON = {24, 24}; + +#pragma endregion + +static rct_widget window_viewport_widgets[] = +{ WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 14}, { WW - 1, WH - 1}, WindowWidgetType::Resize, WindowColour::Secondary ), // resize MakeWidget({ 3, 17}, {WW - 26, WH - 3}, WindowWidgetType::Viewport, WindowColour::Primary ), // viewport - MakeWidget({WW - 25, 17}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_IN, STR_ZOOM_IN_TIP ), // zoom in - MakeWidget({WW - 25, 41}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_OUT, STR_ZOOM_OUT_TIP ), // zoom out - MakeWidget({WW - 25, 65}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_LOCATE, STR_LOCATE_SUBJECT_TIP), // locate + MakeWidget({WW - 25, 17}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_IN, STR_ZOOM_IN_TIP ), // zoom in + MakeWidget({WW - 25, 41}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_OUT, STR_ZOOM_OUT_TIP ), // zoom out + MakeWidget({WW - 25, 65}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_LOCATE, STR_LOCATE_SUBJECT_TIP), // locate { WIDGETS_END }, }; -static void window_viewport_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_viewport_resize(rct_window *w); -static void window_viewport_update(rct_window *w); -static void window_viewport_invalidate(rct_window *w); -static void window_viewport_paint(rct_window *w, rct_drawpixelinfo *dpi); - -static rct_window_event_list window_viewport_events([](auto& events) -{ - events.mouse_up = &window_viewport_mouseup; - events.resize = &window_viewport_resize; - events.update = &window_viewport_update; - events.invalidate = &window_viewport_invalidate; - events.paint = &window_viewport_paint; -}); // clang-format on -static int32_t _viewportNumber = 1; +class ViewportWindow final : public Window +{ +private: + void GetFreeViewportNumber() + { + number = 1; + window_visit_each([&](rct_window* w) { + if (w != nullptr && w != this && w->classification == WC_VIEWPORT) + { + if (w->number >= number) + number = w->number + 1; + } + }); + } + +public: + void OnOpen() override + { + GetFreeViewportNumber(); + + widgets = window_viewport_widgets; + enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_ZOOM_IN) | (1ULL << WIDX_ZOOM_OUT) | (1ULL << WIDX_LOCATE); + + // Create viewport + viewport_create(this, windowPos, width, height, 0, TileCoordsXYZ(128, 128, 0).ToCoordsXYZ(), 1, SPRITE_INDEX_NULL); + if (viewport == nullptr) + { + Close(); + window_error_open("Unexpected Error", "Failed to create viewport window."); + return; + } + + auto* mainWindow = window_get_main(); + if (mainWindow != nullptr) + { + rct_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; + + min_width = WW; + min_height = WH; + max_width = WW; + max_height = WH; + } + + void OnUpdate() override + { + auto* mainWindow = window_get_main(); + if (mainWindow == nullptr) + return; + + if (viewport != nullptr && viewport->flags != mainWindow->viewport->flags) + { + viewport->flags = mainWindow->viewport->flags; + 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(rct_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 = window_get_main(); + if (mainWindow != nullptr) + { + auto info = get_map_coordinates_from_pos( + { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); + window_scroll_to_location(mainWindow, { info.Loc, tile_element_height(info.Loc) }); + } + break; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + + // Draw viewport + if (viewport != nullptr) + window_draw_viewport(&dpi, this); + } + + void OnResize() override + { + int32_t screenWidth = context_get_width(); + int32_t screenHeight = context_get_height(); + + max_width = (screenWidth * 4) / 5; + max_height = (screenHeight * 4) / 5; + + min_width = WW; + min_height = WH; + + window_set_resize(this, min_width, min_height, max_width, max_height); + } + + void OnPrepareDraw() override + { + rct_widget* viewportWidget = &window_viewport_widgets[WIDX_VIEWPORT]; + + widgets[WIDX_BACKGROUND].right = width - 1; + widgets[WIDX_BACKGROUND].bottom = height - 1; + widgets[WIDX_TITLE].right = width - 2; + widgets[WIDX_CLOSE].left = width - 13; + widgets[WIDX_CLOSE].right = width - 3; + widgets[WIDX_CONTENT_PANEL].right = width - 1; + widgets[WIDX_CONTENT_PANEL].bottom = height - 1; + 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_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->width * viewport->zoom; + viewport->view_height = viewport->height * viewport->zoom; + } + } +}; -/** - * Creates a custom viewport window. - */ rct_window* window_viewport_open() { - rct_window* w = WindowCreateAutoPos(WW, WH, &window_viewport_events, WC_VIEWPORT, WF_RESIZABLE); - w->widgets = window_viewport_widgets; - w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_ZOOM_IN) | (1ULL << WIDX_ZOOM_OUT) | (1ULL << WIDX_LOCATE); - w->number = _viewportNumber++; + int32_t screenWidth = context_get_width(); + int32_t screenHeight = context_get_height(); + int32_t width = (screenWidth / 2); + int32_t height = (screenHeight / 2); - // Create viewport - viewport_create(w, w->windowPos, w->width, w->height, 0, TileCoordsXYZ(128, 128, 0).ToCoordsXYZ(), 1, SPRITE_INDEX_NULL); - rct_window* mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - rct_viewport* mainViewport = mainWindow->viewport; - int32_t x = mainViewport->viewPos.x + (mainViewport->view_width / 2); - int32_t y = mainViewport->viewPos.y + (mainViewport->view_height / 2); - w->savedViewPos = { x - (w->viewport->view_width / 2), y - (w->viewport->view_height / 2) }; - } + auto* w = WindowCreate(WC_VIEWPORT, std::max(WW, width), std::max(WH, height), WF_RESIZABLE); - w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - - return w; -} - -static void window_viewport_anchor_border_widgets(rct_window* w) -{ - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; -} - -static void window_viewport_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - rct_window* mainWindow; - - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_ZOOM_IN: - if (w->viewport != nullptr && w->viewport->zoom > ZoomLevel::min()) - { - w->viewport->zoom--; - w->Invalidate(); - } - break; - case WIDX_ZOOM_OUT: - if (w->viewport != nullptr && w->viewport->zoom < ZoomLevel::max()) - { - w->viewport->zoom++; - w->Invalidate(); - } - break; - case WIDX_LOCATE: - mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - auto info = get_map_coordinates_from_pos( - { w->windowPos.x + (w->width / 2), w->windowPos.y + (w->height / 2) }, ViewportInteractionItemAll); - window_scroll_to_location(mainWindow, { info.Loc, tile_element_height(info.Loc) }); - } - break; - } -} - -static void window_viewport_resize(rct_window* w) -{ - w->flags |= WF_RESIZABLE; - window_set_resize(w, 200, 200, 2000, 2000); -} - -static void window_viewport_update(rct_window* w) -{ - rct_window* mainWindow; - - mainWindow = window_get_main(); - if (mainWindow == nullptr) - return; - - if (w->viewport->flags != mainWindow->viewport->flags) - { - w->viewport->flags = mainWindow->viewport->flags; - w->Invalidate(); - } - - // Not sure how to invalidate part of the viewport that has changed, this will have to do for now - // widget_invalidate(w, WIDX_VIEWPORT); -} - -static void window_viewport_invalidate(rct_window* w) -{ - rct_widget* viewportWidget; - rct_viewport* viewport; - int32_t i; - - viewportWidget = &window_viewport_widgets[WIDX_VIEWPORT]; - viewport = w->viewport; - - // Anchor widgets - window_viewport_anchor_border_widgets(w); - viewportWidget->right = w->width - 26; - viewportWidget->bottom = w->height - 3; - for (i = WIDX_ZOOM_IN; i <= WIDX_LOCATE; i++) - { - window_viewport_widgets[i].left = w->width - 25; - window_viewport_widgets[i].right = w->width - 2; - } - - // Set title - Formatter::Common().Add(w->number); - - // Set disabled widgets - w->disabled_widgets = 0; - if (viewport->zoom == ZoomLevel::min()) - w->disabled_widgets |= 1ULL << WIDX_ZOOM_IN; - if (viewport->zoom >= ZoomLevel::max()) - w->disabled_widgets |= 1ULL << WIDX_ZOOM_OUT; - - viewport->pos = w->windowPos + ScreenCoordsXY{ viewportWidget->left, viewportWidget->top }; - viewport->width = viewportWidget->width(); - viewport->height = viewportWidget->height(); - viewport->view_width = viewport->width * viewport->zoom; - viewport->view_height = viewport->height * viewport->zoom; -} - -static void window_viewport_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - - // Draw viewport - if (w->viewport != nullptr) - window_draw_viewport(dpi, w); + if (w != nullptr) + return w; + return nullptr; } From 8993e4d062cd26ae7c8d2c46a57781aa161454e9 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 15 Aug 2021 22:54:43 +0200 Subject: [PATCH 163/681] Use ObjectEntryIndex for entrance style --- src/openrct2/actions/RideSetAppearanceAction.cpp | 3 ++- src/openrct2/actions/RideSetAppearanceAction.h | 4 ++-- src/openrct2/ride/Ride.h | 4 ++-- src/openrct2/ride/RideConstruction.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index d17ad76035..551d1edd5e 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -21,7 +21,8 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" -RideSetAppearanceAction::RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint8_t value, uint32_t index) +RideSetAppearanceAction::RideSetAppearanceAction( + ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index) : _rideIndex(rideIndex) , _type(type) , _value(value) diff --git a/src/openrct2/actions/RideSetAppearanceAction.h b/src/openrct2/actions/RideSetAppearanceAction.h index ce9a93d0d6..cc4d56bf4d 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.h +++ b/src/openrct2/actions/RideSetAppearanceAction.h @@ -29,12 +29,12 @@ DEFINE_GAME_ACTION(RideSetAppearanceAction, GameCommand::SetRideAppearance, Game private: NetworkRideId_t _rideIndex{ RIDE_ID_NULL }; RideSetAppearanceType _type{}; - uint8_t _value{}; + uint16_t _value{}; uint32_t _index{}; public: RideSetAppearanceAction() = default; - RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint8_t value, uint32_t index); + RideSetAppearanceAction(ride_id_t rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index); void AcceptParameters(GameActionParameterVisitor & visitor) override; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 2df6091a66..1c0340b0b9 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -363,7 +363,7 @@ public: money64 profit; TrackColour track_colour[NUM_COLOUR_SCHEMES]; uint8_t music; - uint8_t entrance_style; + ObjectEntryIndex entrance_style; uint16_t vehicle_change_timeout; uint8_t num_block_brakes; uint8_t lift_hill_speed; @@ -1119,7 +1119,7 @@ extern uint8_t gRideEntranceExitPlaceDirection; extern bool gGotoStartPlacementMode; -extern uint8_t gLastEntranceStyle; +extern ObjectEntryIndex gLastEntranceStyle; int32_t ride_get_count(); void ride_init_all(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index cd8ec533c7..8abc33ef60 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -78,7 +78,7 @@ uint8_t _currentSeatRotationAngle; CoordsXYZD _unkF440C5; -uint8_t gLastEntranceStyle; +ObjectEntryIndex gLastEntranceStyle; uint8_t gRideEntranceExitPlaceType; ride_id_t gRideEntranceExitPlaceRideIndex; From 1553c904ea365f00fa707b00c061d0c2ecdceede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 16 Aug 2021 02:36:02 -0700 Subject: [PATCH 164/681] Fix #15221: Update tile inspector highlighted element when order changes (#15223) --- src/openrct2-ui/windows/TileInspector.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 54103820a2..8d695d303b 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -818,6 +818,10 @@ static void window_tile_inspector_mouseup(rct_window* w, rct_widgetindex widgetI } TileElement* const tileElement = window_tile_inspector_get_selected_element(w); + + // Update selection, can be nullptr. + OpenRCT2::TileInspector::SetSelectedElement(tileElement); + if (tileElement == nullptr) return; From 758ad547cec1d9e04dcfca58d7bf06c296c20df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 16 Aug 2021 06:18:22 -0700 Subject: [PATCH 165/681] Remove strdup in ObjectLoadError.cpp fixing a memory leak (#15218) --- src/openrct2-ui/windows/ObjectLoadError.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index ed1b1e70a0..7c7ea87945 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -476,13 +476,14 @@ static void window_object_load_error_mouseup(rct_window* w, rct_widgetindex widg case WIDX_COPY_CURRENT: if (w->selected_list_item > -1 && w->selected_list_item < w->no_list_items) { - utf8* selected_name = strndup(_invalid_entries[w->selected_list_item].name, 8); - utf8* strp = strchr(selected_name, ' '); + utf8 selectedName[32]{}; + strncpy(selectedName, _invalid_entries[w->selected_list_item].name, 8); + + utf8* strp = strchr(selectedName, ' '); if (strp != nullptr) *strp = '\0'; - platform_place_string_on_clipboard(selected_name); - SafeFree(selected_name); + platform_place_string_on_clipboard(selectedName); } break; case WIDX_COPY_ALL: @@ -578,7 +579,10 @@ static void window_object_load_error_scrollpaint(rct_window* w, rct_drawpixelinf // Draw the actual object entry's name... screenCoords.x = NAME_COL_LEFT - 3; - gfx_draw_string(dpi, screenCoords, strndup(_invalid_entries[i].name, 8), { COLOUR_DARK_GREEN }); + + utf8 nameBuf[32]{}; + strncpy(nameBuf, _invalid_entries[i].name, 8); + gfx_draw_string(dpi, screenCoords, nameBuf, { COLOUR_DARK_GREEN }); // ... source game ... rct_string_id sourceStringId = object_manager_get_source_game_string(_invalid_entries[i].GetSourceGame()); From bef853d0abe6936f83e6eeebe6201957c81e4a72 Mon Sep 17 00:00:00 2001 From: Kane Date: Tue, 17 Aug 2021 05:01:37 +1000 Subject: [PATCH 166/681] Fix #15225: Some scenarios show incorrect name in-game The S6Importer/SawyerChunkReader correctly decodes the scenario name and description and stores it under the rct_s6_info struct (info.name and info.details) The problem is that on lines 369-370 the name and description are replaced with the scenario internal name and description - which is sometimes incorrect - specifically a number of scenarios by Frontier in the exapansion packs. --- src/openrct2/rct2/S6Importer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 206dabcd4a..3bbced91e5 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -366,8 +366,6 @@ public: // pad_01358842 ImportResearchList(); gMapBaseZ = _s6.map_base_z; - gScenarioName = std::string_view(_s6.scenario_name, sizeof(_s6.scenario_name)); - gScenarioDetails = std::string_view(_s6.scenario_description, sizeof(_s6.scenario_description)); gBankLoanInterestRate = _s6.current_interest_rate; // pad_0135934B // Preserve compatibility with vanilla RCT2's save format. From 940cab87d33e09aa89571b68bce76808a7063ab6 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 16 Aug 2021 20:51:16 +0100 Subject: [PATCH 167/681] Map size refactors from NSF (#15112) * Support large map sizes * Fix top spin painting * Fix crooked house * Increase bb size * Decrease limit back * Clang format * Remove asserts and apply review comments * Fix rebase mistake Co-authored-by: Ted John --- src/openrct2-ui/input/MouseInput.cpp | 4 +- src/openrct2-ui/windows/Map.cpp | 6 -- src/openrct2-ui/windows/RideConstruction.cpp | 11 +- src/openrct2/actions/ClearAction.cpp | 4 +- src/openrct2/actions/FootpathPlaceAction.cpp | 4 +- src/openrct2/actions/LandBuyRightsAction.cpp | 4 +- src/openrct2/actions/LandLowerAction.cpp | 4 +- src/openrct2/actions/LandRaiseAction.cpp | 4 +- src/openrct2/actions/LandSetHeightAction.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 4 +- .../actions/LargeScenerySetColourAction.cpp | 2 +- .../actions/PlaceParkEntranceAction.cpp | 4 +- src/openrct2/actions/PlacePeepSpawnAction.cpp | 4 +- src/openrct2/actions/SetCheatAction.cpp | 2 +- .../actions/SmallSceneryPlaceAction.cpp | 2 +- .../actions/SurfaceSetStyleAction.cpp | 8 +- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/actions/WaterLowerAction.cpp | 4 +- src/openrct2/actions/WaterRaiseAction.cpp | 4 +- src/openrct2/actions/WaterSetHeightAction.cpp | 2 +- src/openrct2/drawing/Drawing.h | 10 +- src/openrct2/interface/Viewport.cpp | 88 +++++++-------- src/openrct2/interface/Viewport.h | 10 +- src/openrct2/interface/Window.cpp | 32 +++--- src/openrct2/interface/Window.h | 14 +-- src/openrct2/paint/Paint.cpp | 53 +++++---- src/openrct2/paint/Paint.h | 102 ++++++++---------- src/openrct2/paint/PaintHelpers.cpp | 16 +-- src/openrct2/rct2/S6Exporter.cpp | 6 +- src/openrct2/rct2/S6Importer.cpp | 3 - src/openrct2/ride/TrackDesign.cpp | 2 - src/openrct2/ride/gentle/CrookedHouse.cpp | 12 +-- src/openrct2/ride/thrill/TopSpin.cpp | 12 +-- src/openrct2/world/Map.cpp | 30 ++---- src/openrct2/world/Map.h | 24 +++-- test/testpaint/Compat.cpp | 3 +- 36 files changed, 229 insertions(+), 269 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index d4c15a7b31..b875acab4c 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1619,11 +1619,11 @@ void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords) } // Clamp to the map maximum value (scenario specific) - if (mapCoord.x > gMapSizeMinus2 || mapCoord.y > gMapSizeMinus2) + if (mapCoord.x > GetMapSizeMinus2() || mapCoord.y > GetMapSizeMinus2()) { at_map_edge = 1; } - if (mapCoord_dy.x > gMapSizeMinus2 || mapCoord_dy.y > gMapSizeMinus2) + if (mapCoord_dy.x > GetMapSizeMinus2() || mapCoord_dy.y > GetMapSizeMinus2()) { at_map_edge_dy = 1; } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 08dcfd61d7..4429b7d17a 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1375,9 +1375,6 @@ static void map_window_increase_map_size() } gMapSize++; - gMapSizeUnits = (gMapSize - 1) * 32; - gMapSizeMinus2 = (gMapSize * 32) + MAXIMUM_MAP_SIZE_PRACTICAL; - gMapSizeMaxXY = ((gMapSize - 1) * 32) - 1; map_extend_boundary_surface(); window_map_init_map(); window_map_centre_on_view_point(); @@ -1397,9 +1394,6 @@ static void map_window_decrease_map_size() } gMapSize--; - gMapSizeUnits = (gMapSize - 1) * 32; - gMapSizeMinus2 = (gMapSize * 32) + MAXIMUM_MAP_SIZE_PRACTICAL; - gMapSizeMaxXY = ((gMapSize - 1) * 32) - 1; map_remove_out_of_range_elements(); window_map_init_map(); window_map_centre_on_view_point(); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index fa6da74546..b5e470b26a 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2395,15 +2395,9 @@ static void sub_6CBCE2( if (ride == nullptr) return; - int16_t preserveMapSizeUnits = gMapSizeUnits; - int16_t preserveMapSizeMinus2 = gMapSizeMinus2; - int16_t preserveMapSize = gMapSize; - int16_t preserveMapSizeMaxXY = gMapSizeMaxXY; + int32_t preserveMapSize = gMapSize; - gMapSizeUnits = MAXIMUM_TILE_START_XY; - gMapSizeMinus2 = ((MAXIMUM_MAP_SIZE_TECHNICAL - 1) * 32) + 286; gMapSize = MAXIMUM_MAP_SIZE_TECHNICAL; - gMapSizeMaxXY = MAXIMUM_MAP_SIZE_BIG - 1; auto trackBlock = TrackBlocks[trackType]; while (trackBlock->index != 255) @@ -2463,10 +2457,7 @@ static void sub_6CBCE2( trackBlock++; } - gMapSizeUnits = preserveMapSizeUnits; - gMapSizeMinus2 = preserveMapSizeMinus2; gMapSize = preserveMapSize; - gMapSizeMaxXY = preserveMapSizeMaxXY; PaintSessionArrange(session); PaintDrawStructs(session); diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index e866d14dea..cfeea2f993 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -72,8 +72,8 @@ GameActions::Result::Ptr ClearAction::QueryExecute(bool executing) const auto x0 = std::max(_range.GetLeft(), 32); auto y0 = std::max(_range.GetTop(), 32); - auto x1 = std::min(_range.GetRight(), static_cast(gMapSizeMaxXY)); - auto y1 = std::min(_range.GetBottom(), static_cast(gMapSizeMaxXY)); + auto x1 = std::min(_range.GetRight(), GetMapSizeMaxXY()); + auto y1 = std::min(_range.GetBottom(), GetMapSizeMaxXY()); for (int32_t y = y0; y <= y1; y += COORDS_XY_STEP) { diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 5b1894b9b8..6124336ffd 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -390,10 +390,10 @@ void FootpathPlaceAction::AutomaticallySetPeepSpawn() const if (_loc.x != 32) { direction++; - if (_loc.y != gMapSizeUnits - 32) + if (_loc.y != GetMapSizeUnits() - 32) { direction++; - if (_loc.x != gMapSizeUnits - 32) + if (_loc.x != GetMapSizeUnits() - 32) { direction++; if (_loc.y != 32) diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 46096f3886..4b23324081 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -65,9 +65,9 @@ GameActions::Result::Ptr LandBuyRightsAction::QueryExecute(bool isExecuting) con MapRange normRange = _range.Normalise(); // Keep big coordinates within map boundaries auto aX = std::max(32, normRange.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, normRange.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), normRange.GetRight()); auto aY = std::max(32, normRange.GetTop()); - auto bY = std::min(gMapSizeMaxXY, normRange.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), normRange.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 53cbb4b901..9efbffedb6 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -63,9 +63,9 @@ GameActions::Result::Ptr LandLowerAction::QueryExecute(bool isExecuting) const // Keep big coordinates within map boundaries auto aX = std::max(32, _range.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, _range.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), _range.GetRight()); auto aY = std::max(32, _range.GetTop()); - auto bY = std::min(gMapSizeMaxXY, _range.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), _range.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 05c33c6045..d7a971c7bf 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -64,9 +64,9 @@ GameActions::Result::Ptr LandRaiseAction::QueryExecute(bool isExecuting) const // Keep big coordinates within map boundaries auto aX = std::max(32, _range.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, _range.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), _range.GetRight()); auto aY = std::max(32, _range.GetTop()); - auto bY = std::min(gMapSizeMaxXY, _range.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), _range.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 43144fcfe0..5275232f34 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -183,7 +183,7 @@ rct_string_id LandSetHeightAction::CheckParameters() const return STR_OFF_EDGE_OF_MAP; } - if (_coords.x > gMapSizeMaxXY || _coords.y > gMapSizeMaxXY) + if (_coords.x > GetMapSizeMaxXY() || _coords.y > GetMapSizeMaxXY()) { return STR_OFF_EDGE_OF_MAP; } diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 3510399c91..ab0d0203f4 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -70,9 +70,9 @@ GameActions::Result::Ptr LandSetRightsAction::QueryExecute(bool isExecuting) con MapRange normRange = _range.Normalise(); // Keep big coordinates within map boundaries auto aX = std::max(32, normRange.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, normRange.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), normRange.GetRight()); auto aY = std::max(32, normRange.GetTop()); - auto bY = std::min(gMapSizeMaxXY, normRange.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), normRange.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 794d863794..5119b4200a 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -53,7 +53,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut res->Position.z = tile_element_height(_loc); res->ErrorTitle = STR_CANT_REPAINT_THIS; - if (_loc.x < 0 || _loc.y < 0 || _loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY) + if (_loc.x < 0 || _loc.y < 0 || _loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY()) { log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 288d921007..8b4e3db1d2 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -50,8 +50,8 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Query() const res->Expenditure = ExpenditureType::LandPurchase; res->Position = { _loc.x, _loc.y, _loc.z }; - if (!LocationValid(_loc) || _loc.x <= 32 || _loc.y <= 32 || _loc.x >= (gMapSizeUnits - 32) - || _loc.y >= (gMapSizeUnits - 32)) + if (!LocationValid(_loc) || _loc.x <= 32 || _loc.y <= 32 || _loc.x >= (GetMapSizeUnits() - 32) + || _loc.y >= (GetMapSizeUnits() - 32)) { return std::make_unique( GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_CLOSE_TO_EDGE_OF_MAP); diff --git a/src/openrct2/actions/PlacePeepSpawnAction.cpp b/src/openrct2/actions/PlacePeepSpawnAction.cpp index 9af4289dd1..b4ce3a211f 100644 --- a/src/openrct2/actions/PlacePeepSpawnAction.cpp +++ b/src/openrct2/actions/PlacePeepSpawnAction.cpp @@ -47,8 +47,8 @@ GameActions::Result::Ptr PlacePeepSpawnAction::Query() const res->Expenditure = ExpenditureType::LandPurchase; res->Position = _location; - if (!LocationValid(_location) || _location.x <= 16 || _location.y <= 16 || _location.x >= (gMapSizeUnits - 16) - || _location.y >= (gMapSizeUnits - 16)) + if (!LocationValid(_location) || _location.x <= 16 || _location.y <= 16 || _location.x >= (GetMapSizeUnits() - 16) + || _location.y >= (GetMapSizeUnits() - 16)) { return std::make_unique( GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_OFF_EDGE_OF_MAP); diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index ee749f9911..5f6887bd81 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -683,7 +683,7 @@ void SetCheatAction::SetStaffSpeed(uint8_t value) const void SetCheatAction::OwnAllLand() const { const int32_t min = 32; - const int32_t max = gMapSizeUnits - 32; + const int32_t max = GetMapSizeUnits() - 32; for (CoordsXY coords = { min, min }; coords.y <= max; coords.y += COORDS_XY_STEP) { diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index d78fc3fea1..5a4ed72cd3 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -121,7 +121,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const return std::make_unique(GameActions::Status::NoFreeElements); } - if (!_trackDesignDrawingPreview && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) + if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())) { return std::make_unique(GameActions::Status::InvalidParameters); } diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 7847228cd1..47c1a32108 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -42,8 +42,8 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Query() const auto normRange = _range.Normalise(); auto x0 = std::max(normRange.GetLeft(), 32); auto y0 = std::max(normRange.GetTop(), 32); - auto x1 = std::min(normRange.GetRight(), static_cast(gMapSizeMaxXY)); - auto y1 = std::min(normRange.GetBottom(), static_cast(gMapSizeMaxXY)); + auto x1 = std::min(normRange.GetRight(), GetMapSizeMaxXY()); + auto y1 = std::min(normRange.GetBottom(), GetMapSizeMaxXY()); MapRange validRange{ x0, y0, x1, y1 }; @@ -160,8 +160,8 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Execute() const auto normRange = _range.Normalise(); auto x0 = std::max(normRange.GetLeft(), 32); auto y0 = std::max(normRange.GetTop(), 32); - auto x1 = std::min(normRange.GetRight(), static_cast(gMapSizeMaxXY)); - auto y1 = std::min(normRange.GetBottom(), static_cast(gMapSizeMaxXY)); + auto x1 = std::min(normRange.GetRight(), GetMapSizeMaxXY()); + auto y1 = std::min(normRange.GetBottom(), GetMapSizeMaxXY()); MapRange validRange{ x0, y0, x1, y1 }; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index e250a017b4..466f90c252 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -109,7 +109,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const return std::make_unique(GameActions::Status::NotOwned); } } - else if (!_trackDesignDrawingPreview && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY)) + else if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())) { log_error("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y); return std::make_unique(GameActions::Status::InvalidParameters); diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 0403fc2bcc..2bd0e66a66 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -46,9 +46,9 @@ GameActions::Result::Ptr WaterLowerAction::QueryExecute(bool isExecuting) const // Keep big coordinates within map boundaries auto aX = std::max(32, _range.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, _range.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), _range.GetRight()); auto aY = std::max(32, _range.GetTop()); - auto bY = std::min(gMapSizeMaxXY, _range.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), _range.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 231ef43027..dbf10f83d6 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -46,9 +46,9 @@ GameActions::Result::Ptr WaterRaiseAction::QueryExecute(bool isExecuting) const // Keep big coordinates within map boundaries auto aX = std::max(32, _range.GetLeft()); - auto bX = std::min(gMapSizeMaxXY, _range.GetRight()); + auto bX = std::min(GetMapSizeMaxXY(), _range.GetRight()); auto aY = std::max(32, _range.GetTop()); - auto bY = std::min(gMapSizeMaxXY, _range.GetBottom()); + auto bY = std::min(GetMapSizeMaxXY(), _range.GetBottom()); MapRange validRange = MapRange{ aX, aY, bX, bY }; diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 43d41bfe87..bf4eb860c2 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -133,7 +133,7 @@ GameActions::Result::Ptr WaterSetHeightAction::Execute() const rct_string_id WaterSetHeightAction::CheckParameters() const { - if (_coords.x > gMapSizeMaxXY || _coords.y > gMapSizeMaxXY) + if (_coords.x > GetMapSizeMaxXY() || _coords.y > GetMapSizeMaxXY()) { return STR_OFF_EDGE_OF_MAP; } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 2e28549e81..c494e66674 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -105,11 +105,11 @@ struct rct_gx struct rct_drawpixelinfo { uint8_t* bits{}; - int16_t x{}; - int16_t y{}; - int16_t width{}; - int16_t height{}; - int16_t pitch{}; // note: this is actually (pitch - width) + int32_t x{}; + int32_t y{}; + int32_t width{}; + int32_t height{}; + int32_t pitch{}; // note: this is actually (pitch - width) ZoomLevel zoom_level{}; /** diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 6fde1dba5a..6aa028ae56 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -225,7 +225,7 @@ void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bott */ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords) { - int16_t height = 0; + int32_t height = 0; uint32_t rotation = get_current_rotation(); CoordsXY pos{}; @@ -236,7 +236,7 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords) // HACK: This is to prevent the x and y values being set to values outside // of the map. This can happen when the height is larger than the map size. - int16_t max = gMapSizeMinus2; + auto max = GetMapSizeMinus2(); if (pos.x > max && pos.y > max) { const CoordsXY corr[] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }; @@ -327,10 +327,10 @@ static void viewport_redraw_after_shift( } else { - int16_t left = viewport->pos.x; - int16_t right = viewport->pos.x + viewport->width; - int16_t top = viewport->pos.y; - int16_t bottom = viewport->pos.y + viewport->height; + auto left = viewport->pos.x; + auto right = viewport->pos.x + viewport->width; + auto top = viewport->pos.y; + auto bottom = viewport->pos.y + viewport->height; // if moved more than the viewport size if (abs(coords.x) < viewport->width && abs(coords.y) < viewport->height) @@ -341,14 +341,14 @@ static void viewport_redraw_after_shift( if (coords.x > 0) { // draw left - int16_t _right = viewport->pos.x + coords.x; + auto _right = viewport->pos.x + coords.x; window_draw_all(dpi, left, top, _right, bottom); left += coords.x; } else if (coords.x < 0) { // draw right - int16_t _left = viewport->pos.x + viewport->width + coords.x; + auto _left = viewport->pos.x + viewport->width + coords.x; window_draw_all(dpi, _left, top, right, bottom); right += coords.x; } @@ -375,7 +375,7 @@ static void viewport_redraw_after_shift( } static void viewport_shift_pixels( - rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int16_t x_diff, int16_t y_diff) + rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int32_t x_diff, int32_t y_diff) { auto it = window_get_iterator(window); for (; it != g_window_list.end(); it++) @@ -429,8 +429,8 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp // Note: do not do the subtraction and then divide! // Note: Due to arithmetic shift != /zoom a shift will have to be used // hopefully when 0x006E7FF3 is finished this can be converted to /zoom. - int16_t x_diff = (viewport->viewPos.x / viewport->zoom) - (coords.x / viewport->zoom); - int16_t y_diff = (viewport->viewPos.y / viewport->zoom) - (coords.y / viewport->zoom); + auto x_diff = (viewport->viewPos.x / viewport->zoom) - (coords.x / viewport->zoom); + auto y_diff = (viewport->viewPos.y / viewport->zoom) - (coords.y / viewport->zoom); viewport->viewPos = coords; @@ -578,14 +578,14 @@ void viewport_update_position(rct_window* window) } // Clamp to the map maximum value (scenario specific) - if (mapCoord.x > gMapSizeMinus2) + if (mapCoord.x > GetMapSizeMinus2()) { - mapCoord.x = gMapSizeMinus2; + mapCoord.x = GetMapSizeMinus2(); at_map_edge = 1; } - if (mapCoord.y > gMapSizeMinus2) + if (mapCoord.y > GetMapSizeMinus2()) { - mapCoord.y = gMapSizeMinus2; + mapCoord.y = GetMapSizeMinus2(); at_map_edge = 1; } @@ -960,13 +960,13 @@ static void viewport_paint_column(paint_session* session) * ebp: bottom */ void viewport_paint( - const rct_viewport* viewport, rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom, + const rct_viewport* viewport, rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, std::vector* recorded_sessions) { uint32_t viewFlags = viewport->flags; - uint16_t width = right - left; - uint16_t height = bottom - top; - uint16_t bitmask = viewport->zoom >= 0 ? 0xFFFF & (0xFFFF * viewport->zoom) : 0xFFFF; + uint32_t width = right - left; + uint32_t height = bottom - top; + uint32_t bitmask = viewport->zoom >= 0 ? 0xFFFFFFFF & (0xFFFFFFFF * viewport->zoom) : 0xFFFFFFFF; width &= bitmask; height &= bitmask; @@ -975,11 +975,11 @@ void viewport_paint( right = left + width; bottom = top + height; - int16_t x = static_cast(left - static_cast(viewport->viewPos.x & bitmask)); + auto x = left - static_cast(viewport->viewPos.x & bitmask); x = x / viewport->zoom; x += viewport->pos.x; - int16_t y = static_cast(top - static_cast(viewport->viewPos.y & bitmask)); + auto y = top - static_cast(viewport->viewPos.y & bitmask); y = y / viewport->zoom; y += viewport->pos.y; @@ -995,10 +995,10 @@ void viewport_paint( dpi1.remX = std::max(0, dpi->x - x); dpi1.remY = std::max(0, dpi->y - y); - // make sure, the compare operation is done in int16_t to avoid the loop becoming an infiniteloop. + // make sure, the compare operation is done in int32_t to avoid the loop becoming an infiniteloop. // this as well as the [x += 32] in the loop causes signed integer overflow -> undefined behaviour. - const int16_t rightBorder = dpi1.x + dpi1.width; - const int16_t alignedX = floor2(dpi1.x, 32); + auto rightBorder = dpi1.x + dpi1.width; + auto alignedX = floor2(dpi1.x, 32); _paintColumns.clear(); @@ -1016,8 +1016,8 @@ void viewport_paint( size_t index = 0; if (recorded_sessions != nullptr) { - const uint16_t columnSize = rightBorder - alignedX; - const uint16_t columnCount = (columnSize + 31) / 32; + auto columnSize = rightBorder - alignedX; + auto columnCount = (columnSize + 31) / 32; recorded_sessions->resize(columnCount); } @@ -1030,17 +1030,17 @@ void viewport_paint( rct_drawpixelinfo& dpi2 = session->DPI; if (x >= dpi2.x) { - int16_t leftPitch = x - dpi2.x; + auto leftPitch = x - dpi2.x; dpi2.width -= leftPitch; dpi2.bits += leftPitch / dpi2.zoom_level; dpi2.pitch += leftPitch / dpi2.zoom_level; dpi2.x = x; } - int16_t paintRight = dpi2.x + dpi2.width; + auto paintRight = dpi2.x + dpi2.width; if (paintRight >= x + 32) { - int16_t rightPitch = paintRight - x - 32; + auto rightPitch = paintRight - x - 32; paintRight -= rightPitch; dpi2.pitch += rightPitch / dpi2.zoom_level; } @@ -1102,8 +1102,8 @@ std::optional screen_pos_to_map_pos(const ScreenCoordsXY& screenCoords } else { - int16_t mod_x = mapCoords->x & 0x1F; - int16_t mod_y = mapCoords->y & 0x1F; + auto mod_x = mapCoords->x & 0x1F; + auto mod_y = mapCoords->y & 0x1F; if (mod_x <= 16) { if (mod_y < 16) @@ -1376,9 +1376,9 @@ static bool is_pixel_present_bmp( /** * rct2: 0x0067933B, 0x00679788, 0x00679C4A, 0x0067A117 */ -static bool is_pixel_present_rle(const uint8_t* esi, int16_t x_start_point, int16_t y_start_point, int32_t round) +static bool is_pixel_present_rle(const uint8_t* esi, int32_t x_start_point, int32_t y_start_point, int32_t round) { - uint16_t start_offset = esi[y_start_point * 2] | (esi[y_start_point * 2 + 1] << 8); + uint32_t start_offset = esi[y_start_point * 2] | (esi[y_start_point * 2 + 1] << 8); const uint8_t* ebx = esi + start_offset; uint8_t last_data_line = 0; @@ -1489,8 +1489,8 @@ static bool is_sprite_interacted_with_palette_set( // TODO: SAR in dpi done with `>> 1`, in coordinates with `/ 2` rct_drawpixelinfo zoomed_dpi = { /* .bits = */ dpi->bits, - /* .x = */ static_cast(dpi->x >> 1), - /* .y = */ static_cast(dpi->y >> 1), + /* .x = */ dpi->x >> 1, + /* .y = */ dpi->y >> 1, /* .height = */ dpi->height, /* .width = */ dpi->width, /* .pitch = */ dpi->pitch, @@ -1511,8 +1511,8 @@ static bool is_sprite_interacted_with_palette_set( } origin.y += g1->y_offset; - int16_t yStartPoint = 0; - int16_t height = g1->height; + int32_t yStartPoint = 0; + int32_t height = g1->height; if (dpi->zoom_level != 0) { if (height % 2) @@ -1537,7 +1537,7 @@ static bool is_sprite_interacted_with_palette_set( } origin.y = floor2(origin.y, round); - int16_t yEndPoint = height; + int32_t yEndPoint = height; origin.y -= dpi->y; if (origin.y < 0) { @@ -1562,8 +1562,8 @@ static bool is_sprite_interacted_with_palette_set( } } - int16_t xStartPoint = 0; - int16_t xEndPoint = g1->width; + int32_t xStartPoint = 0; + int32_t xEndPoint = g1->width; origin.x += g1->x_offset; origin.x = floor2(origin.x, round); @@ -1852,7 +1852,7 @@ std::optional screen_get_map_xy(const ScreenCoordsXY& screenCoords, rc * * rct2: 0x006894D4 */ -std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int16_t z) +std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int32_t z) { rct_viewport* viewport = viewport_find_from_point(screenCoords); if (viewport == nullptr) @@ -1888,7 +1888,7 @@ std::optional screen_get_map_xy_quadrant(const ScreenCoordsXY& screenC * * rct2: 0x0068964B */ -std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* quadrant) +std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* quadrant) { auto mapCoords = screen_get_map_xy_with_z(screenCoords, z); if (!mapCoords) @@ -1916,7 +1916,7 @@ std::optional screen_get_map_xy_side(const ScreenCoordsXY& screenCoord * * rct2: 0x006896DC */ -std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* side) +std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* side) { auto mapCoords = screen_get_map_xy_with_z(screenCoords, z); if (!mapCoords) @@ -1949,7 +1949,7 @@ uint8_t get_current_rotation() return rotation_masked; } -int16_t get_height_marker_offset() +int32_t get_height_marker_offset() { // Height labels in units if (gConfigGeneral.show_height_as_units) diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 0c7afab621..e5ae588f0b 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -119,7 +119,7 @@ void viewport_render( rct_drawpixelinfo* dpi, const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom, std::vector* sessions = nullptr); void viewport_paint( - const rct_viewport* viewport, rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom, + const rct_viewport* viewport, rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, std::vector* sessions = nullptr); CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords); @@ -151,14 +151,14 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo void viewport_invalidate(const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom); std::optional screen_get_map_xy(const ScreenCoordsXY& screenCoords, rct_viewport** viewport); -std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int16_t z); +std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int32_t z); std::optional screen_get_map_xy_quadrant(const ScreenCoordsXY& screenCoords, uint8_t* quadrant); -std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* quadrant); +std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* quadrant); std::optional screen_get_map_xy_side(const ScreenCoordsXY& screenCoords, uint8_t* side); -std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* side); +std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* side); uint8_t get_current_rotation(); -int16_t get_height_marker_offset(); +int32_t get_height_marker_offset(); void viewport_set_saved_view(); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 6d54804b2c..000d6e4d3b 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -732,7 +732,7 @@ void window_push_others_right(rct_window* window) w->Invalidate(); if (window->windowPos.x + window->width + 13 >= context_get_width()) return; - uint16_t push_amount = window->windowPos.x + window->width - w->windowPos.x + 3; + auto push_amount = window->windowPos.x + window->width - w->windowPos.x + 3; w->windowPos.x += push_amount; w->Invalidate(); if (w->viewport != nullptr) @@ -834,15 +834,15 @@ void window_scroll_to_location(rct_window* w, const CoordsXYZ& coords) bool found = false; while (!found) { - int16_t x2 = w->viewport->pos.x + static_cast(w->viewport->width * window_scroll_locations[i][0]); - int16_t y2 = w->viewport->pos.y + static_cast(w->viewport->height * window_scroll_locations[i][1]); + auto x2 = w->viewport->pos.x + static_cast(w->viewport->width * window_scroll_locations[i][0]); + auto y2 = w->viewport->pos.y + static_cast(w->viewport->height * window_scroll_locations[i][1]); auto it = window_get_iterator(w); for (; it != g_window_list.end(); it++) { auto w2 = (*it).get(); - int16_t x1 = w2->windowPos.x - 10; - int16_t y1 = w2->windowPos.y - 10; + auto x1 = w2->windowPos.x - 10; + auto y1 = w2->windowPos.y - 10; if (x2 >= x1 && x2 <= w2->width + x1 + 20) { if (y2 >= y1 && y2 <= w2->height + y1 + 20) @@ -871,8 +871,8 @@ void window_scroll_to_location(rct_window* w, const CoordsXYZ& coords) if (!(w->flags & WF_NO_SCROLLING)) { w->savedViewPos = screenCoords - - ScreenCoordsXY{ static_cast(w->viewport->view_width * window_scroll_locations[i][0]), - static_cast(w->viewport->view_height * window_scroll_locations[i][1]) }; + - ScreenCoordsXY{ static_cast(w->viewport->view_width * window_scroll_locations[i][0]), + static_cast(w->viewport->view_height * window_scroll_locations[i][1]) }; w->flags |= WF_SCROLLING_TO_LOCATION; } } @@ -940,7 +940,7 @@ void window_rotate_camera(rct_window* w, int32_t direction) } void window_viewport_get_map_coords_by_cursor( - rct_window* w, int16_t* map_x, int16_t* map_y, int16_t* offset_x, int16_t* offset_y) + rct_window* w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y) { // Get mouse position to offset against. auto mouseCoords = context_get_cursor_position_scaled(); @@ -971,7 +971,7 @@ void window_viewport_get_map_coords_by_cursor( *offset_y = (w->savedViewPos.y - (centreLoc->y + rebased_y)) * w->viewport->zoom; } -void window_viewport_centre_tile_around_cursor(rct_window* w, int16_t map_x, int16_t map_y, int16_t offset_x, int16_t offset_y) +void window_viewport_centre_tile_around_cursor(rct_window* w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y) { // Get viewport coordinates centring around the tile. int32_t z = tile_element_height({ map_x, map_y }); @@ -1019,10 +1019,10 @@ void window_zoom_set(rct_window* w, ZoomLevel zoomLevel, bool atCursor) return; // Zooming to cursor? Remember where we're pointing at the moment. - int16_t saved_map_x = 0; - int16_t saved_map_y = 0; - int16_t offset_x = 0; - int16_t offset_y = 0; + int32_t saved_map_x = 0; + int32_t saved_map_y = 0; + int32_t offset_x = 0; + int32_t offset_y = 0; if (gConfigGeneral.zoom_to_cursor && atCursor) { window_viewport_get_map_coords_by_cursor(w, &saved_map_x, &saved_map_y, &offset_x, &offset_y); @@ -1281,8 +1281,8 @@ void window_resize(rct_window* w, int32_t dw, int32_t dh) w->Invalidate(); // Clamp new size to minimum and maximum - 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); + w->width = std::clamp(w->width + dw, w->min_width, w->max_width); + w->height = std::clamp(w->height + dh, w->min_height, w->max_height); window_event_resize_call(w); window_event_invalidate_call(w); @@ -2078,7 +2078,7 @@ bool window_is_visible(rct_window* w) * right (dx) * bottom (bp) */ -void window_draw_all(rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom) +void window_draw_all(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom) { auto windowDPI = dpi->Crop({ left, top }, { right - left, bottom - top }); window_visit_each([&windowDPI, left, top, right, bottom](rct_window* w) { diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 17db7753c0..4b8b721224 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -147,12 +147,12 @@ struct rct_widget */ struct rct_viewport { - int16_t width; - int16_t height; + int32_t width; + int32_t height; ScreenCoordsXY pos; ScreenCoordsXY viewPos; - int16_t view_width; - int16_t view_height; + int32_t view_width; + int32_t view_height; uint32_t flags; ZoomLevel zoom; uint8_t var_11; @@ -768,8 +768,8 @@ rct_window* window_get_main(); void window_scroll_to_location(rct_window* w, const CoordsXYZ& coords); void window_rotate_camera(rct_window* w, int32_t direction); void window_viewport_get_map_coords_by_cursor( - rct_window* w, int16_t* map_x, int16_t* map_y, int16_t* offset_x, int16_t* offset_y); -void window_viewport_centre_tile_around_cursor(rct_window* w, int16_t map_x, int16_t map_y, int16_t offset_x, int16_t offset_y); + rct_window* w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y); +void window_viewport_centre_tile_around_cursor(rct_window* w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y); void window_check_all_valid_zoom(); void window_zoom_set(rct_window* w, ZoomLevel zoomLevel, bool atCursor); void window_zoom_in(rct_window* w, bool atCursor); @@ -778,7 +778,7 @@ void main_window_zoom(bool zoomIn, bool atCursor); void window_show_textinput(rct_window* w, rct_widgetindex widgetIndex, uint16_t title, uint16_t text, int32_t value); -void window_draw_all(rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom); +void window_draw_all(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom); void window_draw(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom); void WindowDrawWidgets(rct_window* w, rct_drawpixelinfo* dpi); void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window* w); diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index d39013413c..f88b011bf7 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -52,13 +52,13 @@ bool gPaintBoundingBoxes; bool gPaintBlockedTiles; static void PaintAttachedPS(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t viewFlags); -static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y); -static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y); +static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y); +static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y); static uint32_t PaintPSColourifyImage(uint32_t imageId, ViewportInteractionItem spriteType, uint32_t viewFlags); static constexpr int32_t CalculatePositionHash(const paint_struct& ps, uint8_t rotation) { - auto pos = CoordsXY{ static_cast(ps.bounds.x), static_cast(ps.bounds.y) }.Rotate(rotation); + auto pos = CoordsXY{ ps.bounds.x, ps.bounds.y }.Rotate(rotation); switch (rotation) { case 0: @@ -189,8 +189,7 @@ static paint_struct* CreateNormalPaintStruct( template void PaintSessionGenerateRotate(paint_session* session) { // Optimised modified version of viewport_coord_to_map_coord - ScreenCoordsXY screenCoord = { static_cast((session->DPI.x) & 0xFFE0), - static_cast((session->DPI.y - 16) & 0xFFE0) }; + ScreenCoordsXY screenCoord = { floor2(session->DPI.x, 32), floor2((session->DPI.y - 16), 32) }; CoordsXY mapTile = { screenCoord.y - screenCoord.x / 2, screenCoord.y + screenCoord.x / 2 }; mapTile = mapTile.Rotate(direction); @@ -445,8 +444,8 @@ static void PaintDrawStruct(paint_session* session, paint_struct* ps) { rct_drawpixelinfo* dpi = &session->DPI; - int16_t x = ps->x; - int16_t y = ps->y; + auto x = ps->x; + auto y = ps->y; if (ps->sprite_type == ViewportInteractionItem::Entity) { @@ -522,7 +521,7 @@ static void PaintAttachedPS(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t v } } -static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y) +static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y) { const uint8_t colour = BoundBoxDebugColours[EnumValue(ps->sprite_type)]; const uint8_t rotation = get_current_rotation(); @@ -608,7 +607,7 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* gfx_draw_line(dpi, { screenCoordFrontTop, screenCoordRightTop }, colour); } -static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y) +static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y) { if (ps->flags & PAINT_STRUCT_FLAG_IS_MASKED) { @@ -700,8 +699,8 @@ paint_struct* PaintAddImageAsParent( } paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset) + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset) { return PaintAddImageAsParent( session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }); @@ -742,9 +741,9 @@ paint_struct* PaintAddImageAsParent( } paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z) + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z) { return PaintAddImageAsParent( session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, @@ -769,12 +768,12 @@ paint_struct* PaintAddImageAsParent( * Creates a paint struct but does not allocate to a paint quadrant. Result cannot be ignored! */ [[nodiscard]] paint_struct* PaintAddImageAsOrphan( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z) + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z) { - assert(static_cast(bound_box_length_x) == static_cast(bound_box_length_x)); - assert(static_cast(bound_box_length_y) == static_cast(bound_box_length_y)); + assert(bound_box_length_x > 0); + assert(bound_box_length_y > 0); session->LastPS = nullptr; session->LastAttachedPS = nullptr; @@ -831,12 +830,12 @@ paint_struct* PaintAddImageAsChild( } paint_struct* PaintAddImageAsChild( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z) + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z) { - assert(static_cast(bound_box_length_x) == static_cast(bound_box_length_x)); - assert(static_cast(bound_box_length_y) == static_cast(bound_box_length_y)); + assert(bound_box_length_x > 0); + assert(bound_box_length_y > 0); return PaintAddImageAsChild( session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); @@ -850,7 +849,7 @@ paint_struct* PaintAddImageAsChild( * @param y (cx) * @return (!CF) success */ -bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int16_t x, int16_t y) +bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int32_t x, int32_t y) { auto* previousAttachedPS = session->LastAttachedPS; if (previousAttachedPS == nullptr) @@ -883,7 +882,7 @@ bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int1 * @param y (cx) * @return (!CF) success */ -bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int16_t x, int16_t y) +bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int32_t x, int32_t y) { auto* masterPs = session->LastPS; if (masterPs == nullptr) @@ -920,7 +919,7 @@ bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int16_t * @param rotation (ebp) */ void PaintFloatingMoneyEffect( - paint_session* session, money64 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, + paint_session* session, money64 amount, rct_string_id string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation) { auto* ps = session->AllocateStringPaintEntry(); diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 303d9102c8..87dfaee9cc 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -21,27 +21,21 @@ struct TileElement; enum class ViewportInteractionItem : uint8_t; -#pragma pack(push, 1) -/* size 0x12 */ struct attached_paint_struct { - uint32_t image_id; // 0x00 + uint32_t image_id; union { uint32_t tertiary_colour; // If masked image_id is masked_id uint32_t colour_image_id; }; - int16_t x; // 0x08 - int16_t y; // 0x0A - uint8_t flags; // 0x0C + int32_t x; + int32_t y; + uint8_t flags; uint8_t pad_0D; - attached_paint_struct* next; // 0x0E + attached_paint_struct* next; }; -#ifdef PLATFORM_32BIT -// TODO: drop packing from this when all rendering is done. -assert_struct_size(attached_paint_struct, 0x12); -#endif enum PAINT_QUADRANT_FLAGS { @@ -52,44 +46,39 @@ enum PAINT_QUADRANT_FLAGS struct paint_struct_bound_box { - uint16_t x; - uint16_t y; - uint16_t z; - uint16_t x_end; - uint16_t y_end; - uint16_t z_end; + int32_t x; + int32_t y; + int32_t z; + int32_t x_end; + int32_t y_end; + int32_t z_end; }; -/* size 0x34 */ struct paint_struct { - uint32_t image_id; // 0x00 + uint32_t image_id; union { - uint32_t tertiary_colour; // 0x04 + uint32_t tertiary_colour; // If masked image_id is masked_id - uint32_t colour_image_id; // 0x04 + uint32_t colour_image_id; }; - paint_struct_bound_box bounds; // 0x08 - int16_t x; // 0x14 - int16_t y; // 0x16 + paint_struct_bound_box bounds; + int32_t x; + int32_t y; uint16_t quadrant_index; uint8_t flags; uint8_t quadrant_flags; - attached_paint_struct* attached_ps; // 0x1C + attached_paint_struct* attached_ps; paint_struct* children; - paint_struct* next_quadrant_ps; // 0x24 - ViewportInteractionItem sprite_type; // 0x28 + paint_struct* next_quadrant_ps; + ViewportInteractionItem sprite_type; uint8_t var_29; uint16_t pad_2A; - uint16_t map_x; // 0x2C - uint16_t map_y; // 0x2E - TileElement* tileElement; // 0x30 (or sprite pointer) + int32_t map_x; + int32_t map_y; + TileElement* tileElement; }; -#ifdef PLATFORM_32BIT -// TODO: drop packing from this when all rendering is done. -assert_struct_size(paint_struct, 0x34); -#endif struct paint_string_struct { @@ -100,7 +89,6 @@ struct paint_string_struct uint32_t args[4]; // 0x0A uint8_t* y_offsets; // 0x1A }; -#pragma pack(pop) union paint_entry { @@ -290,47 +278,47 @@ extern bool gPaintBlockedTiles; extern bool gPaintWidePathsAsGhost; paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset); + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z); + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); [[nodiscard]] paint_struct* PaintAddImageAsOrphan( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z); + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsChild( - paint_session* session, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z); + paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, + int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, + int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsChild( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxLength, const CoordsXYZ& boundBoxOffset); paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsChildRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z); void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, uint16_t height, uint8_t type); -bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int16_t x, int16_t y); -bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int16_t x, int16_t y); +bool PaintAttachToPreviousAttach(paint_session* session, uint32_t image_id, int32_t x, int32_t y); +bool PaintAttachToPreviousPS(paint_session* session, uint32_t image_id, int32_t x, int32_t y); void PaintFloatingMoneyEffect( - paint_session* session, money64 amount, rct_string_id string_id, int16_t y, int16_t z, int8_t y_offsets[], int16_t offset_x, + paint_session* session, money64 amount, rct_string_id string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation); paint_session* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index e50c12f97e..bc934fc77e 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -12,8 +12,8 @@ #include "Paint.h" paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset) + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset) { if (direction & 1) { @@ -30,9 +30,9 @@ paint_struct* PaintAddImageAsParentRotated( } paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z) + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z) { if (direction & 1) { @@ -49,9 +49,9 @@ paint_struct* PaintAddImageAsParentRotated( } paint_struct* PaintAddImageAsChildRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int8_t x_offset, int8_t y_offset, int16_t bound_box_length_x, - int16_t bound_box_length_y, int8_t bound_box_length_z, int16_t z_offset, int16_t bound_box_offset_x, - int16_t bound_box_offset_y, int16_t bound_box_offset_z) + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z) { if (direction & 1) { diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 3a5781ba5d..b32404921e 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -347,10 +347,10 @@ void S6Exporter::Export() _s6.cash = ENCRYPT_MONEY(ToMoney32(gCash)); // pad_013587FC _s6.park_rating_casualty_penalty = gParkRatingCasualtyPenalty; - _s6.map_size_units = gMapSizeUnits; - _s6.map_size_minus_2 = gMapSizeMinus2; + _s6.map_size_units = GetMapSizeUnits(); + _s6.map_size_minus_2 = GetMapSizeMinus2(); _s6.map_size = gMapSize; - _s6.map_max_xy = gMapSizeMaxXY; + _s6.map_max_xy = GetMapSizeMaxXY(); _s6.same_price_throughout = gSamePriceThroughoutPark & 0xFFFFFFFF; _s6.suggested_max_guests = _suggestedGuestMaximum; _s6.park_rating_warning_days = gScenarioParkRatingWarningDays; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 3bbced91e5..441926fb5a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -353,10 +353,7 @@ public: gCash = ToMoney64(DECRYPT_MONEY(_s6.cash)); // pad_013587FC gParkRatingCasualtyPenalty = _s6.park_rating_casualty_penalty; - gMapSizeUnits = _s6.map_size_units; - gMapSizeMinus2 = _s6.map_size_minus_2; gMapSize = _s6.map_size; - gMapSizeMaxXY = _s6.map_max_xy; gSamePriceThroughoutPark = _s6.same_price_throughout | (static_cast(_s6.same_price_throughout_extended) << 32); _suggestedGuestMaximum = _s6.suggested_max_guests; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 6c8c745329..63e9dfc8d2 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2086,8 +2086,6 @@ static void track_design_preview_clear_map() { auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; - gMapSizeUnits = 255 * COORDS_XY_STEP; - gMapSizeMinus2 = (264 * 32) - 2; gMapSize = 256; // Reserve ~8 elements per tile diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index d61ed4ed51..e8a8ff47e9 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -32,7 +32,7 @@ static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { 6, * rct2: 0x0088ABA4 */ static void paint_crooked_house_structure( - paint_session* session, uint8_t direction, uint8_t x_offset, uint8_t y_offset, uint32_t segment, int32_t height) + paint_session* session, uint8_t direction, int32_t x_offset, int32_t y_offset, uint32_t segment, int32_t height) { const TileElement* original_tile_element = static_cast(session->CurrentlyDrawnItem); @@ -88,16 +88,16 @@ static void paint_crooked_house( switch (trackSequence) { case 3: - paint_crooked_house_structure(session, direction, 32, 224, 0, height); + paint_crooked_house_structure(session, direction, 32, -32, 0, height); break; - // case 5: sub_88ABA4(direction, 0, 224, 1, height); break; + // case 5: sub_88ABA4(direction, 0, -32, 1, height); break; case 6: - paint_crooked_house_structure(session, direction, 224, 32, 4, height); + paint_crooked_house_structure(session, direction, -32, 32, 4, height); break; case 7: - paint_crooked_house_structure(session, direction, 224, 224, 2, height); + paint_crooked_house_structure(session, direction, -32, -32, 2, height); break; - // case 8: sub_88ABA4(rideIndex, 224, 0, 3, height); break; + // case 8: sub_88ABA4(rideIndex, -32, 0, 3, height); break; } int32_t cornerSegments = 0; diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 2e63f3565c..c0f86c3a18 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -43,13 +43,13 @@ static int8_t TopSpinSeatPositionOffset[] = { * rct2: 0x0076750D */ static void top_spin_paint_vehicle( - paint_session* session, int8_t al, int8_t cl, const Ride* ride, uint8_t direction, int32_t height, - const TrackElement& trackElement) + paint_session* session, int32_t al, int32_t cl, const Ride* ride, uint8_t direction, int32_t height, + const TrackElement& tileElement) { if (ride == nullptr) return; - uint16_t boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; + int32_t boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ; // As we will be drawing a vehicle we need to backup the trackElement that // is assigned to the drawings. const TileElement* curTileElement = static_cast(session->CurrentlyDrawnItem); @@ -74,10 +74,8 @@ static void top_spin_paint_vehicle( boundBoxOffsetY = cl + 16; boundBoxOffsetZ = height; - // di - uint8_t lengthX = 24; - // si - uint8_t lengthY = 24; + auto lengthX = 24; + auto lengthY = 24; uint32_t image_id = session->TrackColours[SCHEME_MISC]; if (image_id == IMAGE_TYPE_REMAP) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 4dcbba361a..04e5f8e4aa 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -93,11 +93,8 @@ uint8_t gMapSelectArrowDirection; TileCoordsXY gWidePathTileLoopPosition; uint16_t gGrassSceneryTileLoopPosition; -int16_t gMapSizeUnits; -int16_t gMapSizeMinus2; -int16_t gMapSize; -int16_t gMapSizeMaxXY; -int16_t gMapBaseZ; +int32_t gMapSize; +int32_t gMapBaseZ; std::vector gMapSelectionTiles; std::vector gPeepSpawns; @@ -108,8 +105,8 @@ bool gClearSmallScenery; bool gClearLargeScenery; bool gClearFootpath; -uint16_t gLandRemainingOwnershipSales; -uint16_t gLandRemainingConstructionSales; +uint32_t gLandRemainingOwnershipSales; +uint32_t gLandRemainingConstructionSales; bool gMapLandRightsUpdateSuccess; @@ -119,8 +116,6 @@ static TilePointerIndex _tileIndexStash; static std::vector _tileElementsStash; static size_t _tileElementsInUse; static size_t _tileElementsInUseStash; -static int32_t _mapSizeUnitsStash; -static int32_t _mapSizeMinus2Stash; static int32_t _mapSizeStash; static int32_t _currentRotationStash; @@ -128,8 +123,6 @@ void StashMap() { _tileIndexStash = std::move(_tileIndex); _tileElementsStash = std::move(_tileElements); - _mapSizeUnitsStash = gMapSizeUnits; - _mapSizeMinus2Stash = gMapSizeMinus2; _mapSizeStash = gMapSize; _currentRotationStash = gCurrentRotation; _tileElementsInUseStash = _tileElementsInUse; @@ -139,8 +132,6 @@ void UnstashMap() { _tileIndex = std::move(_tileIndexStash); _tileElements = std::move(_tileElementsStash); - gMapSizeUnits = _mapSizeUnitsStash; - gMapSizeMinus2 = _mapSizeMinus2Stash; gMapSize = _mapSizeStash; gCurrentRotation = _currentRotationStash; _tileElementsInUse = _tileElementsInUseStash; @@ -403,10 +394,7 @@ void map_init(int32_t size) gGrassSceneryTileLoopPosition = 0; gWidePathTileLoopPosition = {}; - gMapSizeUnits = size * 32 - 32; - gMapSizeMinus2 = size * 32 - 2; gMapSize = size; - gMapSizeMaxXY = size * 32 - 33; gMapBaseZ = 7; map_remove_out_of_range_elements(); AutoCreateMapAnimations(); @@ -752,7 +740,7 @@ bool map_is_location_valid(const CoordsXY& coords) bool map_is_edge(const CoordsXY& coords) { - return (coords.x < 32 || coords.y < 32 || coords.x >= gMapSizeUnits || coords.y >= gMapSizeUnits); + return (coords.x < 32 || coords.y < 32 || coords.x >= GetMapSizeUnits() || coords.y >= GetMapSizeUnits()); } bool map_can_build_at(const CoordsXYZ& loc) @@ -938,8 +926,7 @@ int32_t tile_element_get_corner_height(const SurfaceElement* surfaceElement, int uint8_t map_get_lowest_land_height(const MapRange& range) { MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), static_cast(gMapSizeMaxXY)), - std::min(range.GetBottom(), static_cast(gMapSizeMaxXY)) }; + std::min(range.GetRight(), GetMapSizeMaxXY()), std::min(range.GetBottom(), GetMapSizeMaxXY()) }; uint8_t min_height = 0xFF; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += COORDS_XY_STEP) @@ -968,8 +955,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range) uint8_t map_get_highest_land_height(const MapRange& range) { MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), static_cast(gMapSizeMaxXY)), - std::min(range.GetBottom(), static_cast(gMapSizeMaxXY)) }; + std::min(range.GetRight(), GetMapSizeMaxXY()), std::min(range.GetBottom(), GetMapSizeMaxXY()) }; uint8_t max_height = 0; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += COORDS_XY_STEP) @@ -1610,7 +1596,7 @@ void map_restore_provisional_elements() */ void map_remove_out_of_range_elements() { - int32_t mapMaxXY = gMapSizeMaxXY; + int32_t mapMaxXY = GetMapSizeMaxXY(); // Ensure that we can remove elements // diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 9fae19b987..2f6ccb551a 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -101,11 +101,21 @@ extern const TileCoordsXY TileDirectionDelta[]; extern TileCoordsXY gWidePathTileLoopPosition; extern uint16_t gGrassSceneryTileLoopPosition; -extern int16_t gMapSizeUnits; -extern int16_t gMapSizeMinus2; -extern int16_t gMapSize; -extern int16_t gMapSizeMaxXY; -extern int16_t gMapBaseZ; +extern int32_t gMapSize; +extern int32_t gMapBaseZ; + +inline int32_t GetMapSizeUnits() +{ + return (gMapSize - 1) * COORDS_XY_STEP; +} +inline int32_t GetMapSizeMinus2() +{ + return (gMapSize * COORDS_XY_STEP) + (8 * COORDS_XY_STEP - 2); +} +inline int32_t GetMapSizeMaxXY() +{ + return GetMapSizeUnits() - 1; +} extern uint16_t gMapSelectFlags; extern uint16_t gMapSelectType; @@ -126,8 +136,8 @@ extern bool gClearSmallScenery; extern bool gClearLargeScenery; extern bool gClearFootpath; -extern uint16_t gLandRemainingOwnershipSales; -extern uint16_t gLandRemainingConstructionSales; +extern uint32_t gLandRemainingOwnershipSales; +extern uint32_t gLandRemainingConstructionSales; extern bool gMapLandRightsUpdateSuccess; diff --git a/test/testpaint/Compat.cpp b/test/testpaint/Compat.cpp index 7c2f408090..5c23207e35 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -33,7 +33,6 @@ rct_sprite* sprite_list = RCT2_ADDRESS(0x010E63BC, rct_sprite); bool gCheatsEnableAllDrawableTrackPieces = false; Ride gRideList[MAX_RIDES]; -int16_t gMapSizeUnits; int16_t gMapBaseZ; bool gTrackDesignSaveMode = false; ride_id_t gTrackDesignSaveRideIndex = RIDE_ID_NULL; @@ -212,7 +211,7 @@ TileElement* map_get_first_element_at(const CoordsXY& elementPos) return gTileElementTilePointers[tileElementPos.x + tileElementPos.y * 256]; } -int16_t get_height_marker_offset() +int32_t get_height_marker_offset() { return 0; } From 15ba3d3229390595c9e88d59a9965b1b9bbb956b Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 16 Aug 2021 23:36:58 +0200 Subject: [PATCH 168/681] Fix compiler warning C4702 in ScMap.cpp Co-authored-by: ZehMatt Co-authored-by: Ted John --- .../scripting/bindings/world/ScMap.cpp | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 6e68adc6ef..d354850606 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -179,61 +179,65 @@ namespace OpenRCT2::Scripting DukValue ScMap::createEntity(const std::string& type, const DukValue& initializer) { + DukValue res; if (type == "car") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "staff") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "guest") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "steam_particle") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "money_effect") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "crashed_vehicle_particle") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "explosion_cloud") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "crash_splash") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "explosion_flare") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "balloon") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "duck") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "jumping_fountain") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); } else if (type == "litter") { - return createEntityType(_context, initializer); + res = createEntityType(_context, initializer); + } + else + { + duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); } - duk_error(_context, DUK_ERR_ERROR, "Invalid entity type."); - return DukValue{}; + return res; } void ScMap::Register(duk_context* ctx) From b7a4b00a0724ab49ed9372218542fbeeb36d8f4f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 00:42:39 +0300 Subject: [PATCH 169/681] Remove capture of window pointer in Player.cpp --- src/openrct2-ui/windows/Player.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 640d1a73f4..10c70f0c85 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -23,6 +23,7 @@ #include #include #include +#include // clang-format off enum WINDOW_PLAYER_PAGE { @@ -265,8 +266,9 @@ void window_player_overview_mouse_down(rct_window* w, rct_widgetindex widgetInde void window_player_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) { - int32_t player = network_get_player_index(static_cast(w->number)); - if (player == -1) + const auto playerId = static_cast(w->number); + const auto playerIdx = network_get_player_index(playerId); + if (playerIdx == -1) { return; } @@ -274,12 +276,13 @@ void window_player_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, { return; } - int32_t group = network_get_group_id(dropdownIndex); - auto playerSetGroupAction = PlayerSetGroupAction(w->number, group); + const auto groupId = network_get_group_id(dropdownIndex); + const auto windowHandle = std::make_pair(w->classification, w->number); + auto playerSetGroupAction = PlayerSetGroupAction(playerId, groupId); playerSetGroupAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - w->Invalidate(); + window_invalidate_by_number(windowHandle.first, windowHandle.second); } }); GameActions::Execute(&playerSetGroupAction); From f4602f49c72caf33f079ad034f62e180b401de35 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 00:43:03 +0300 Subject: [PATCH 170/681] Remove capture of window pointer in RideConstruction.cpp --- src/openrct2-ui/windows/RideConstruction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b5e470b26a..52aef8142c 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1933,6 +1933,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) _currentTrackPieceType, 0, { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, _currentTrackPieceDirection }); + const auto rideId = w->number; trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -1940,7 +1941,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) } else { - auto ride = get_ride(w->number); + auto ride = get_ride(rideId); if (ride != nullptr) { _stationConstructed = ride->num_stations != 0; From 40313b1ea3182adbb4586e9c8ca13032a19a0350 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:20:07 +0300 Subject: [PATCH 171/681] Move network instance into Context --- src/openrct2/Context.cpp | 18 +- src/openrct2/Context.h | 8 +- src/openrct2/network/NetworkBase.cpp | 320 +++++++++++++++------------ src/openrct2/network/NetworkBase.h | 9 +- 4 files changed, 213 insertions(+), 142 deletions(-) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d0f739970e..620c364caa 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -46,6 +46,7 @@ #include "localisation/Localisation.h" #include "localisation/LocalisationService.h" #include "network/DiscordService.h" +#include "network/NetworkBase.h" #include "network/network.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" @@ -108,6 +109,9 @@ namespace OpenRCT2 #ifdef ENABLE_SCRIPTING ScriptEngine _scriptEngine; #endif +#ifndef DISABLE_NETWORK + NetworkBase _network; +#endif // Game states std::unique_ptr _titleScreen; @@ -149,6 +153,9 @@ namespace OpenRCT2 , _localisationService(std::make_unique(env)) #ifdef ENABLE_SCRIPTING , _scriptEngine(_stdInOutConsole, *env) +#endif +#ifndef DISABLE_NETWORK + , _network(*this) #endif , _painter(std::make_unique(uiContext)) { @@ -164,7 +171,7 @@ namespace OpenRCT2 // If objects use GetContext() in their destructor things won't go well. GameActions::ClearQueue(); - network_close(); + _network.Close(); window_close_all(); // Unload objects after closing all windows, this is to overcome windows like @@ -256,11 +263,18 @@ namespace OpenRCT2 return _drawingEngine.get(); } - virtual Paint::Painter* GetPainter() override + Paint::Painter* GetPainter() override { return _painter.get(); } +#ifndef DISABLE_NETWORK + NetworkBase& GetNetwork() override + { + return _network; + } +#endif + int32_t RunOpenRCT2(int argc, const char** argv) override { if (Initialise()) diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 967ac662b7..258f636926 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/***************************************************************************** * Copyright (c) 2014-2020 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md @@ -70,6 +70,8 @@ enum CURSOR_PRESSED = CURSOR_DOWN | CURSOR_CHANGED, }; +class NetworkBase; + namespace OpenRCT2 { class GameState; @@ -131,7 +133,9 @@ namespace OpenRCT2 virtual DrawingEngine GetDrawingEngineType() abstract; virtual Drawing::IDrawingEngine* GetDrawingEngine() abstract; virtual Paint::Painter* GetPainter() abstract; - +#ifndef DISABLE_NETWORK + virtual NetworkBase& GetNetwork() abstract; +#endif virtual int32_t RunOpenRCT2(int argc, const char** argv) abstract; virtual bool Initialise() abstract; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7f3578ff38..f028427c9d 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -105,9 +105,8 @@ static void network_get_keys_directory(utf8* buffer, size_t bufferSize); static void network_get_private_key_path(utf8* buffer, size_t bufferSize, const std::string& playerName); static void network_get_public_key_path(utf8* buffer, size_t bufferSize, const std::string& playerName, const utf8* hash); -static NetworkBase gNetwork; - -NetworkBase::NetworkBase() +NetworkBase::NetworkBase(OpenRCT2::IContext& context) + : _context(context) { wsa_initialized = false; mode = NETWORK_MODE_NONE; @@ -561,7 +560,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_resolving }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); } break; @@ -576,7 +575,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_connecting }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); server_connect_time = platform_get_ticks(); @@ -593,7 +592,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_authenticating }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); break; } @@ -1990,7 +1989,7 @@ void NetworkBase::ServerClientDisconnected(std::unique_ptr& c network_get_current_player_id() }; auto res = GameActions::Execute(&pickupAction); } - gNetwork.Server_Send_EVENT_PLAYER_DISCONNECTED( + Server_Send_EVENT_PLAYER_DISCONNECTED( const_cast(connection_player->Name.c_str()), connection->GetLastDisconnectReason()); // Log player disconnected event @@ -2339,7 +2338,7 @@ void NetworkBase::Client_Handle_OBJECTS_LIST(NetworkConnection& connection, Netw auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ objectListMsg }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); char objectName[12]{}; @@ -2665,7 +2664,7 @@ void NetworkBase::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connecti auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_downloading_map }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { gNetwork.Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); std::memcpy(&chunk_buffer[offset], const_cast(static_cast(packet.Read(chunksize))), chunksize); @@ -3220,137 +3219,143 @@ void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& con void network_set_env(const std::shared_ptr& env) { - gNetwork.SetEnvironment(env); + OpenRCT2::GetContext()->GetNetwork().SetEnvironment(env); } void network_close() { - gNetwork.Close(); + OpenRCT2::GetContext()->GetNetwork().Close(); } void network_reconnect() { - gNetwork.Reconnect(); + OpenRCT2::GetContext()->GetNetwork().Reconnect(); } void network_shutdown_client() { - gNetwork.ServerClientDisconnected(); + OpenRCT2::GetContext()->GetNetwork().ServerClientDisconnected(); } int32_t network_begin_client(const std::string& host, int32_t port) { - return gNetwork.BeginClient(host, port); + return OpenRCT2::GetContext()->GetNetwork().BeginClient(host, port); } int32_t network_begin_server(int32_t port, const std::string& address) { - return gNetwork.BeginServer(port, address); + return OpenRCT2::GetContext()->GetNetwork().BeginServer(port, address); } void network_update() { - gNetwork.Update(); + OpenRCT2::GetContext()->GetNetwork().Update(); } void network_process_pending() { - gNetwork.ProcessPending(); + OpenRCT2::GetContext()->GetNetwork().ProcessPending(); } void network_flush() { - gNetwork.Flush(); + OpenRCT2::GetContext()->GetNetwork().Flush(); } int32_t network_get_mode() { - return gNetwork.GetMode(); + return OpenRCT2::GetContext()->GetNetwork().GetMode(); } int32_t network_get_status() { - return gNetwork.GetStatus(); + return OpenRCT2::GetContext()->GetNetwork().GetStatus(); } bool network_is_desynchronised() { - return gNetwork.IsDesynchronised(); + return OpenRCT2::GetContext()->GetNetwork().IsDesynchronised(); } bool network_check_desynchronisation() { - return gNetwork.CheckDesynchronizaton(); + return OpenRCT2::GetContext()->GetNetwork().CheckDesynchronizaton(); } void network_request_gamestate_snapshot() { - return gNetwork.RequestStateSnapshot(); + return OpenRCT2::GetContext()->GetNetwork().RequestStateSnapshot(); } void network_send_tick() { - gNetwork.Server_Send_TICK(); + OpenRCT2::GetContext()->GetNetwork().Server_Send_TICK(); } NetworkAuth network_get_authstatus() { - return gNetwork.GetAuthStatus(); + return OpenRCT2::GetContext()->GetNetwork().GetAuthStatus(); } uint32_t network_get_server_tick() { - return gNetwork.GetServerTick(); + return OpenRCT2::GetContext()->GetNetwork().GetServerTick(); } uint8_t network_get_current_player_id() { - return gNetwork.GetPlayerID(); + return OpenRCT2::GetContext()->GetNetwork().GetPlayerID(); } int32_t network_get_num_players() { - return static_cast(gNetwork.player_list.size()); + return static_cast(OpenRCT2::GetContext()->GetNetwork().player_list.size()); } const char* network_get_player_name(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return static_cast(gNetwork.player_list[index]->Name.c_str()); + return static_cast(network.player_list[index]->Name.c_str()); } uint32_t network_get_player_flags(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return gNetwork.player_list[index]->Flags; + return network.player_list[index]->Flags; } int32_t network_get_player_ping(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return gNetwork.player_list[index]->Ping; + return network.player_list[index]->Ping; } int32_t network_get_player_id(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return gNetwork.player_list[index]->Id; + return network.player_list[index]->Id; } money32 network_get_player_money_spent(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return gNetwork.player_list[index]->MoneySpent; + return network.player_list[index]->MoneySpent; } std::string network_get_player_ip_address(uint32_t id) { - auto conn = gNetwork.GetPlayerConnection(id); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + auto conn = network.GetPlayerConnection(id); if (conn != nullptr && conn->Socket != nullptr) { return conn->Socket->GetIpAddress(); @@ -3360,7 +3365,8 @@ std::string network_get_player_ip_address(uint32_t id) std::string network_get_player_public_key_hash(uint32_t id) { - auto player = gNetwork.GetPlayerByID(id); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + auto player = network.GetPlayerByID(id); if (player != nullptr) { return player->KeyHash; @@ -3370,104 +3376,117 @@ std::string network_get_player_public_key_hash(uint32_t id) void network_add_player_money_spent(uint32_t index, money32 cost) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - gNetwork.player_list[index]->AddMoneySpent(cost); + network.player_list[index]->AddMoneySpent(cost); } int32_t network_get_player_last_action(uint32_t index, int32_t time) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - if (time && platform_get_ticks() > gNetwork.player_list[index]->LastActionTime + time) + if (time && platform_get_ticks() > network.player_list[index]->LastActionTime + time) { return -999; } - return gNetwork.player_list[index]->LastAction; + return network.player_list[index]->LastAction; } void network_set_player_last_action(uint32_t index, GameCommand command) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - gNetwork.player_list[index]->LastAction = static_cast(NetworkActions::FindCommand(command)); - gNetwork.player_list[index]->LastActionTime = platform_get_ticks(); + network.player_list[index]->LastAction = static_cast(NetworkActions::FindCommand(command)); + network.player_list[index]->LastActionTime = platform_get_ticks(); } CoordsXYZ network_get_player_last_action_coord(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, OpenRCT2::GetContext()->GetNetwork().player_list); - return gNetwork.player_list[index]->LastActionCoord; + return network.player_list[index]->LastActionCoord; } void network_set_player_last_action_coord(uint32_t index, const CoordsXYZ& coord) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - if (index < gNetwork.player_list.size()) + if (index < network.player_list.size()) { - gNetwork.player_list[index]->LastActionCoord = coord; + network.player_list[index]->LastActionCoord = coord; } } uint32_t network_get_player_commands_ran(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, OpenRCT2::GetContext()->GetNetwork().player_list); - return gNetwork.player_list[index]->CommandsRan; + return network.player_list[index]->CommandsRan; } int32_t network_get_player_index(uint32_t id) { - auto it = gNetwork.GetPlayerIteratorByID(id); - if (it == gNetwork.player_list.end()) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + auto it = network.GetPlayerIteratorByID(id); + if (it == network.player_list.end()) { return -1; } - return static_cast(gNetwork.GetPlayerIteratorByID(id) - gNetwork.player_list.begin()); + return static_cast(network.GetPlayerIteratorByID(id) - network.player_list.begin()); } uint8_t network_get_player_group(uint32_t index) { - Guard::IndexInRange(index, gNetwork.player_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); - return gNetwork.player_list[index]->Group; + return network.player_list[index]->Group; } void network_set_player_group(uint32_t index, uint32_t groupindex) { - Guard::IndexInRange(index, gNetwork.player_list); - Guard::IndexInRange(groupindex, gNetwork.group_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.player_list); + Guard::IndexInRange(groupindex, network.group_list); - gNetwork.player_list[index]->Group = gNetwork.group_list[groupindex]->Id; + network.player_list[index]->Group = network.group_list[groupindex]->Id; } int32_t network_get_group_index(uint8_t id) { - auto it = gNetwork.GetGroupIteratorByID(id); - if (it == gNetwork.group_list.end()) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + auto it = network.GetGroupIteratorByID(id); + if (it == network.group_list.end()) { return -1; } - return static_cast(gNetwork.GetGroupIteratorByID(id) - gNetwork.group_list.begin()); + return static_cast(network.GetGroupIteratorByID(id) - network.group_list.begin()); } uint8_t network_get_group_id(uint32_t index) { - Guard::IndexInRange(index, gNetwork.group_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(index, network.group_list); - return gNetwork.group_list[index]->Id; + return network.group_list[index]->Id; } int32_t network_get_num_groups() { - return static_cast(gNetwork.group_list.size()); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return static_cast(network.group_list.size()); } const char* network_get_group_name(uint32_t index) { - return gNetwork.group_list[index]->GetName().c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.group_list[index]->GetName().c_str(); } void network_chat_show_connected_message() @@ -3501,15 +3520,16 @@ void network_chat_show_server_greeting() GameActions::Result::Ptr network_set_player_group( NetworkPlayerId_t actionPlayerId, NetworkPlayerId_t playerId, uint8_t groupId, bool isExecuting) { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerId); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + NetworkPlayer* player = network.GetPlayerByID(playerId); - NetworkGroup* fromgroup = gNetwork.GetGroupByID(actionPlayerId); + NetworkGroup* fromgroup = network.GetGroupByID(actionPlayerId); if (player == nullptr) { return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); } - if (!gNetwork.GetGroupByID(groupId)) + if (!network.GetGroupByID(groupId)) { return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); } @@ -3532,18 +3552,18 @@ GameActions::Result::Ptr network_set_player_group( if (network_get_mode() == NETWORK_MODE_SERVER) { // Add or update saved user - NetworkUserManager* userManager = &gNetwork._userManager; - NetworkUser* networkUser = userManager->GetOrAddUser(player->KeyHash); + NetworkUserManager& userManager = network._userManager; + NetworkUser* networkUser = userManager.GetOrAddUser(player->KeyHash); networkUser->GroupId = groupId; networkUser->Name = player->Name; - userManager->Save(); + userManager.Save(); } window_invalidate_by_number(WC_PLAYER, playerId); // Log set player group event - NetworkPlayer* game_command_player = gNetwork.GetPlayerByID(actionPlayerId); - NetworkGroup* new_player_group = gNetwork.GetGroupByID(groupId); + NetworkPlayer* game_command_player = network.GetPlayerByID(actionPlayerId); + NetworkGroup* new_player_group = network.GetGroupByID(groupId); char log_msg[256]; const char* args[3] = { player->Name.c_str(), @@ -3560,13 +3580,14 @@ GameActions::Result::Ptr network_modify_groups( NetworkPlayerId_t actionPlayerId, ModifyGroupType type, uint8_t groupId, const std::string& name, uint32_t permissionIndex, PermissionState permissionState, bool isExecuting) { + auto& network = OpenRCT2::GetContext()->GetNetwork(); switch (type) { case ModifyGroupType::AddGroup: { if (isExecuting) { - NetworkGroup* newgroup = gNetwork.AddGroup(); + NetworkGroup* newgroup = network.AddGroup(); if (newgroup == nullptr) { return std::make_unique(GameActions::Status::Unknown, STR_CANT_DO_THIS); @@ -3581,7 +3602,7 @@ GameActions::Result::Ptr network_modify_groups( return std::make_unique( GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED); } - for (const auto& it : gNetwork.player_list) + for (const auto& it : network.player_list) { if ((it.get())->Group == groupId) { @@ -3591,7 +3612,7 @@ GameActions::Result::Ptr network_modify_groups( } if (isExecuting) { - gNetwork.RemoveGroup(groupId); + network.RemoveGroup(groupId); } } break; @@ -3603,11 +3624,11 @@ GameActions::Result::Ptr network_modify_groups( GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED); } NetworkGroup* mygroup = nullptr; - NetworkPlayer* player = gNetwork.GetPlayerByID(actionPlayerId); + NetworkPlayer* player = network.GetPlayerByID(actionPlayerId); auto networkPermission = static_cast(permissionIndex); if (player != nullptr && permissionState == PermissionState::Toggle) { - mygroup = gNetwork.GetGroupByID(player->Group); + mygroup = network.GetGroupByID(player->Group); if (mygroup == nullptr || !mygroup->CanPerformAction(networkPermission)) { return std::make_unique( @@ -3616,7 +3637,7 @@ GameActions::Result::Ptr network_modify_groups( } if (isExecuting) { - NetworkGroup* group = gNetwork.GetGroupByID(groupId); + NetworkGroup* group = network.GetGroupByID(groupId); if (group != nullptr) { if (permissionState != PermissionState::Toggle) @@ -3643,7 +3664,7 @@ GameActions::Result::Ptr network_modify_groups( break; case ModifyGroupType::SetName: { - NetworkGroup* group = gNetwork.GetGroupByID(groupId); + NetworkGroup* group = network.GetGroupByID(groupId); const char* oldName = group->GetName().c_str(); if (strcmp(oldName, name.c_str()) == 0) @@ -3674,7 +3695,7 @@ GameActions::Result::Ptr network_modify_groups( } if (isExecuting) { - gNetwork.SetDefaultGroup(groupId); + network.SetDefaultGroup(groupId); } } break; @@ -3683,14 +3704,15 @@ GameActions::Result::Ptr network_modify_groups( return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); } - gNetwork.SaveGroups(); + network.SaveGroups(); return std::make_unique(); } GameActions::Result::Ptr network_kick_player(NetworkPlayerId_t playerId, bool isExecuting) { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerId); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + NetworkPlayer* player = network.GetPlayerByID(playerId); if (player == nullptr) { // Player might be already removed by the PLAYERLIST command, need to refactor non-game commands executing too @@ -3705,14 +3727,14 @@ GameActions::Result::Ptr network_kick_player(NetworkPlayerId_t playerId, bool is if (isExecuting) { - if (gNetwork.GetMode() == NETWORK_MODE_SERVER) + if (network.GetMode() == NETWORK_MODE_SERVER) { - gNetwork.KickPlayer(playerId); + network.KickPlayer(playerId); - NetworkUserManager* networkUserManager = &gNetwork._userManager; - networkUserManager->Load(); - networkUserManager->RemoveUser(player->KeyHash); - networkUserManager->Save(); + NetworkUserManager& networkUserManager = network._userManager; + networkUserManager.Load(); + networkUserManager.RemoveUser(player->KeyHash); + networkUserManager.Save(); } } return std::make_unique(); @@ -3720,7 +3742,8 @@ GameActions::Result::Ptr network_kick_player(NetworkPlayerId_t playerId, bool is uint8_t network_get_default_group() { - return gNetwork.GetDefaultGroup(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.GetDefaultGroup(); } int32_t network_get_num_actions() @@ -3742,27 +3765,30 @@ rct_string_id network_get_action_name_string_id(uint32_t index) int32_t network_can_perform_action(uint32_t groupindex, NetworkPermission index) { - Guard::IndexInRange(groupindex, gNetwork.group_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(groupindex, network.group_list); - return gNetwork.group_list[groupindex]->CanPerformAction(index); + return network.group_list[groupindex]->CanPerformAction(index); } int32_t network_can_perform_command(uint32_t groupindex, int32_t index) { - Guard::IndexInRange(groupindex, gNetwork.group_list); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + Guard::IndexInRange(groupindex, network.group_list); - return gNetwork.group_list[groupindex]->CanPerformCommand(static_cast(index)); // TODO + return network.group_list[groupindex]->CanPerformCommand(static_cast(index)); // TODO } void network_set_pickup_peep(uint8_t playerid, Peep* peep) { - if (gNetwork.GetMode() == NETWORK_MODE_NONE) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + if (network.GetMode() == NETWORK_MODE_NONE) { _pickup_peep = peep; } else { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerid); + NetworkPlayer* player = network.GetPlayerByID(playerid); if (player) { player->PickupPeep = peep; @@ -3772,13 +3798,14 @@ void network_set_pickup_peep(uint8_t playerid, Peep* peep) Peep* network_get_pickup_peep(uint8_t playerid) { - if (gNetwork.GetMode() == NETWORK_MODE_NONE) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + if (network.GetMode() == NETWORK_MODE_NONE) { return _pickup_peep; } else { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerid); + NetworkPlayer* player = network.GetPlayerByID(playerid); if (player) { return player->PickupPeep; @@ -3789,13 +3816,14 @@ Peep* network_get_pickup_peep(uint8_t playerid) void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x) { - if (gNetwork.GetMode() == NETWORK_MODE_NONE) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + if (network.GetMode() == NETWORK_MODE_NONE) { _pickup_peep_old_x = x; } else { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerid); + NetworkPlayer* player = network.GetPlayerByID(playerid); if (player) { player->PickupPeepOldX = x; @@ -3805,13 +3833,14 @@ void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x) int32_t network_get_pickup_peep_old_x(uint8_t playerid) { - if (gNetwork.GetMode() == NETWORK_MODE_NONE) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + if (network.GetMode() == NETWORK_MODE_NONE) { return _pickup_peep_old_x; } else { - NetworkPlayer* player = gNetwork.GetPlayerByID(playerid); + NetworkPlayer* player = network.GetPlayerByID(playerid); if (player) { return player->PickupPeepOldX; @@ -3822,7 +3851,8 @@ int32_t network_get_pickup_peep_old_x(uint8_t playerid) int32_t network_get_current_player_group_index() { - NetworkPlayer* player = gNetwork.GetPlayerByID(gNetwork.GetPlayerID()); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + NetworkPlayer* player = network.GetPlayerByID(network.GetPlayerID()); if (player) { return network_get_group_index(player->Group); @@ -3832,31 +3862,33 @@ int32_t network_get_current_player_group_index() void network_send_map() { - gNetwork.Server_Send_MAP(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + network.Server_Send_MAP(); } void network_send_chat(const char* text, const std::vector& playerIds) { - if (gNetwork.GetMode() == NETWORK_MODE_CLIENT) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + if (network.GetMode() == NETWORK_MODE_CLIENT) { - gNetwork.Client_Send_CHAT(text); + network.Client_Send_CHAT(text); } - else if (gNetwork.GetMode() == NETWORK_MODE_SERVER) + else if (network.GetMode() == NETWORK_MODE_SERVER) { std::string message = text; - if (ProcessChatMessagePluginHooks(gNetwork.GetPlayerID(), message)) + if (ProcessChatMessagePluginHooks(network.GetPlayerID(), message)) { - auto player = gNetwork.GetPlayerByID(gNetwork.GetPlayerID()); + auto player = network.GetPlayerByID(network.GetPlayerID()); if (player != nullptr) { - auto formatted = gNetwork.FormatChat(player, message.c_str()); + auto formatted = network.FormatChat(player, message.c_str()); if (playerIds.empty() - || std::find(playerIds.begin(), playerIds.end(), gNetwork.GetPlayerID()) != playerIds.end()) + || std::find(playerIds.begin(), playerIds.end(), network.GetPlayerID()) != playerIds.end()) { // Server is one of the recipients chat_history_add(formatted); } - gNetwork.Server_Send_CHAT(formatted, playerIds); + network.Server_Send_CHAT(formatted, playerIds); } } } @@ -3864,19 +3896,21 @@ void network_send_chat(const char* text, const std::vector& playerIds) void network_send_game_action(const GameAction* action) { - switch (gNetwork.GetMode()) + auto& network = OpenRCT2::GetContext()->GetNetwork(); + switch (network.GetMode()) { case NETWORK_MODE_SERVER: - gNetwork.Server_Send_GAME_ACTION(action); + network.Server_Send_GAME_ACTION(action); break; case NETWORK_MODE_CLIENT: - gNetwork.Client_Send_GAME_ACTION(action); + network.Client_Send_GAME_ACTION(action); break; } } void network_send_password(const std::string& password) { + auto& network = OpenRCT2::GetContext()->GetNetwork(); utf8 keyPath[MAX_PATH]; network_get_private_key_path(keyPath, sizeof(keyPath), gConfigNetwork.player_name); if (!Platform::FileExists(keyPath)) @@ -3887,36 +3921,39 @@ void network_send_password(const std::string& password) try { auto fs = FileStream(keyPath, FILE_MODE_OPEN); - gNetwork._key.LoadPrivate(&fs); + network._key.LoadPrivate(&fs); } catch (const std::exception&) { log_error("Error reading private key from %s.", keyPath); return; } - const std::string pubkey = gNetwork._key.PublicKeyString(); + const std::string pubkey = network._key.PublicKeyString(); std::vector signature; - gNetwork._key.Sign(gNetwork._challenge.data(), gNetwork._challenge.size(), signature); + network._key.Sign(network._challenge.data(), network._challenge.size(), signature); // Don't keep private key in memory. There's no need and it may get leaked // when process dump gets collected at some point in future. - gNetwork._key.Unload(); - gNetwork.Client_Send_AUTH(gConfigNetwork.player_name.c_str(), password, pubkey.c_str(), signature); + network._key.Unload(); + network.Client_Send_AUTH(gConfigNetwork.player_name.c_str(), password, pubkey.c_str(), signature); } void network_set_password(const char* password) { - gNetwork.SetPassword(password); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + network.SetPassword(password); } void network_append_chat_log(const utf8* text) { - gNetwork.AppendChatLog(text); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + network.AppendChatLog(text); } void network_append_server_log(const utf8* text) { - gNetwork.AppendServerLog(text); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + network.AppendServerLog(text); } static void network_get_keys_directory(utf8* buffer, size_t bufferSize) @@ -3942,27 +3979,33 @@ static void network_get_public_key_path(utf8* buffer, size_t bufferSize, const s const utf8* network_get_server_name() { - return gNetwork.ServerName.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerName.c_str(); } const utf8* network_get_server_description() { - return gNetwork.ServerDescription.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerDescription.c_str(); } const utf8* network_get_server_greeting() { - return gNetwork.ServerGreeting.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerGreeting.c_str(); } const utf8* network_get_server_provider_name() { - return gNetwork.ServerProviderName.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerProviderName.c_str(); } const utf8* network_get_server_provider_email() { - return gNetwork.ServerProviderEmail.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerProviderEmail.c_str(); } const utf8* network_get_server_provider_website() { - return gNetwork.ServerProviderWebsite.c_str(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.ServerProviderWebsite.c_str(); } std::string network_get_version() @@ -3972,12 +4015,14 @@ std::string network_get_version() NetworkStats_t network_get_stats() { - return gNetwork.GetStats(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.GetStats(); } NetworkServerState_t network_get_server_state() { - return gNetwork.GetServerState(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.GetServerState(); } bool network_gamestate_snapshots_enabled() @@ -3987,7 +4032,8 @@ bool network_gamestate_snapshots_enabled() json_t network_get_server_info_as_json() { - return gNetwork.GetServerInfoAsJson(); + auto& network = OpenRCT2::GetContext()->GetNetwork(); + return network.GetServerInfoAsJson(); } #else int32_t network_get_mode() diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 8981377d9e..7d98f6d1ab 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -12,10 +12,17 @@ #ifndef DISABLE_NETWORK +namespace OpenRCT2 +{ + struct IContext; +} + class NetworkBase { + OpenRCT2::IContext& _context; + public: - NetworkBase(); + NetworkBase(OpenRCT2::IContext& context); public: // Uncategorized bool BeginServer(uint16_t port, const std::string& address); From e440942c545cc0cf2652e661cd90dfe34ae59ac5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:25:47 +0300 Subject: [PATCH 172/681] Remove SetEnvironment from NetworkBase and all its other wrappers --- src/openrct2/Context.cpp | 1 - src/openrct2/network/NetworkBase.cpp | 19 ++++--------------- src/openrct2/network/NetworkBase.h | 2 -- src/openrct2/network/network.h | 6 ------ 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 620c364caa..184ae69bbf 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -477,7 +477,6 @@ namespace OpenRCT2 gGameSoundsOff = !gConfigSound.master_sound_enabled; } - network_set_env(_env); chat_init(); CopyOriginalUserFilesOver(); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index f028427c9d..7422b9ebcb 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -147,11 +147,6 @@ NetworkBase::NetworkBase(OpenRCT2::IContext& context) _server_log_fs << std::unitbuf; } -void NetworkBase::SetEnvironment(const std::shared_ptr& env) -{ - _env = env; -} - bool NetworkBase::Init() { status = NETWORK_STATUS_READY; @@ -1101,7 +1096,8 @@ void NetworkBase::AppendLog(std::ostream& fs, const std::string& s) void NetworkBase::BeginChatLog() { - auto directory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); + auto env = _context.GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); _chatLogPath = BeginLog(directory, "", _chatLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -1127,7 +1123,8 @@ void NetworkBase::CloseChatLog() void NetworkBase::BeginServerLog() { - auto directory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); + auto env = _context.GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); _serverLogPath = BeginLog(directory, ServerName, _serverLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -3217,11 +3214,6 @@ void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& con network_chat_show_server_greeting(); } -void network_set_env(const std::shared_ptr& env) -{ - OpenRCT2::GetContext()->GetNetwork().SetEnvironment(env); -} - void network_close() { OpenRCT2::GetContext()->GetNetwork().Close(); @@ -4237,9 +4229,6 @@ void network_close() void network_reconnect() { } -void network_set_env(const std::shared_ptr&) -{ -} void network_shutdown_client() { } diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 7d98f6d1ab..2a67c203d9 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -29,7 +29,6 @@ public: // Uncategorized bool BeginClient(const std::string& host, uint16_t port); public: // Common - void SetEnvironment(const std::shared_ptr& env); bool Init(); void Close(); uint32_t GetServerTick(); @@ -180,7 +179,6 @@ public: // Public common private: // Common Data using CommandHandler = void (NetworkBase::*)(NetworkConnection& connection, NetworkPacket& packet); - std::shared_ptr _env; std::vector chunk_buffer; std::ofstream _chat_log_fs; uint32_t _lastUpdateTime = 0; diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 2876339f21..716f7bb72a 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -35,12 +35,6 @@ enum class ModifyGroupType : uint8_t; enum class PermissionState : uint8_t; enum class NetworkPermission : uint32_t; -namespace OpenRCT2 -{ - struct IPlatformEnvironment; -} - -void network_set_env(const std::shared_ptr& env); void network_close(); void network_reconnect(); void network_shutdown_client(); From 95c2e817f71ec42438cbbd65435fd32fa54e7f82 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:29:29 +0300 Subject: [PATCH 173/681] Directly call functions in NetworkBase from Context --- src/openrct2/Context.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 184ae69bbf..a0636e15d9 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -654,12 +654,12 @@ namespace OpenRCT2 bool sendMap = false; if (info.Type == FILE_TYPE::SAVED_GAME) { - if (network_get_mode() == NETWORK_MODE_CLIENT) + if (_network.GetMode() == NETWORK_MODE_CLIENT) { - network_close(); + _network.Close(); } game_load_init(); - if (network_get_mode() == NETWORK_MODE_SERVER) + if (_network.GetMode() == NETWORK_MODE_SERVER) { sendMap = true; } @@ -667,13 +667,13 @@ namespace OpenRCT2 else { scenario_begin(); - if (network_get_mode() == NETWORK_MODE_SERVER) + if (_network.GetMode() == NETWORK_MODE_SERVER) { sendMap = true; } - if (network_get_mode() == NETWORK_MODE_CLIENT) + if (_network.GetMode() == NETWORK_MODE_CLIENT) { - network_close(); + _network.Close(); } } // This ensures that the newly loaded save reflects the user's @@ -681,10 +681,10 @@ namespace OpenRCT2 peep_update_names(gConfigGeneral.show_real_names_of_guests); if (sendMap) { - network_send_map(); + _network.Server_Send_MAP(); } #ifdef USE_BREAKPAD - if (network_get_mode() == NETWORK_MODE_NONE) + if (_network.GetMode() == NETWORK_MODE_NONE) { start_silent_record(); } @@ -884,13 +884,13 @@ namespace OpenRCT2 if (String::IsNullOrEmpty(gCustomPassword)) { - network_set_password(gConfigNetwork.default_password.c_str()); + _network.SetPassword(gConfigNetwork.default_password.c_str()); } else { - network_set_password(gCustomPassword); + _network.SetPassword(gCustomPassword); } - network_begin_server(gNetworkStartPort, gNetworkStartAddress); + _network.BeginServer(gNetworkStartPort, gNetworkStartAddress); } else #endif // DISABLE_NETWORK @@ -920,7 +920,7 @@ namespace OpenRCT2 { gNetworkStartPort = gConfigNetwork.default_port; } - network_begin_client(gNetworkStartHost, gNetworkStartPort); + _network.BeginClient(gNetworkStartHost, gNetworkStartPort); } #endif // DISABLE_NETWORK From b8a81ae1c7eabecd30b9076a80be1356a9de733f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:30:16 +0300 Subject: [PATCH 174/681] Remove unused declarations --- src/openrct2/network/network.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 716f7bb72a..8f521837e8 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -96,12 +96,10 @@ int32_t network_get_pickup_peep_old_x(uint8_t playerid); void network_send_map(); void network_send_chat(const char* text, const std::vector& playerIds = {}); void network_send_game_action(const GameAction* action); -void network_enqueue_game_action(const GameAction* action); void network_send_password(const std::string& password); void network_set_password(const char* password); -void network_print_error(); void network_append_chat_log(const utf8* text); void network_append_server_log(const utf8* text); const utf8* network_get_server_name(); From 096041392791a146f62245327a5566ddec7907aa Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:31:12 +0300 Subject: [PATCH 175/681] Remove unused function network_send_map --- src/openrct2/network/NetworkBase.cpp | 9 --------- src/openrct2/network/network.h | 1 - 2 files changed, 10 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7422b9ebcb..78ef434d6a 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -3852,12 +3852,6 @@ int32_t network_get_current_player_group_index() return -1; } -void network_send_map() -{ - auto& network = OpenRCT2::GetContext()->GetNetwork(); - network.Server_Send_MAP(); -} - void network_send_chat(const char* text, const std::vector& playerIds) { auto& network = OpenRCT2::GetContext()->GetNetwork(); @@ -4068,9 +4062,6 @@ void network_request_gamestate_snapshot() void network_send_game_action(const GameAction* action) { } -void network_send_map() -{ -} void network_update() { } diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 8f521837e8..8a166c5a24 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -93,7 +93,6 @@ Peep* network_get_pickup_peep(uint8_t playerid); void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x); int32_t network_get_pickup_peep_old_x(uint8_t playerid); -void network_send_map(); void network_send_chat(const char* text, const std::vector& playerIds = {}); void network_send_game_action(const GameAction* action); void network_send_password(const std::string& password); From 4ece997ff31655e4d270c236b2732dd796381bb4 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:33:50 +0300 Subject: [PATCH 176/681] Remove unused function network_close --- src/openrct2/network/NetworkBase.cpp | 8 -------- src/openrct2/network/network.h | 1 - src/openrct2/title/TitleScreen.cpp | 3 ++- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 78ef434d6a..7b6af5e6af 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -3214,11 +3214,6 @@ void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& con network_chat_show_server_greeting(); } -void network_close() -{ - OpenRCT2::GetContext()->GetNetwork().Close(); -} - void network_reconnect() { OpenRCT2::GetContext()->GetNetwork().Reconnect(); @@ -4214,9 +4209,6 @@ void network_send_chat(const char* text, const std::vector& playerIds) void network_send_password(const std::string& password) { } -void network_close() -{ -} void network_reconnect() { } diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 8a166c5a24..ed06ba1b2f 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -35,7 +35,6 @@ enum class ModifyGroupType : uint8_t; enum class PermissionState : uint8_t; enum class NetworkPermission : uint32_t; -void network_close(); void network_reconnect(); void network_shutdown_client(); int32_t network_begin_client(const std::string& host, int32_t port); diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index f267ae4891..3fe9f9e2b1 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -23,6 +23,7 @@ #include "../interface/Viewport.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" +#include "../network/NetworkBase.h" #include "../network/network.h" #include "../scenario/Scenario.h" #include "../scenario/ScenarioRepository.h" @@ -124,7 +125,7 @@ void TitleScreen::Load() gScreenAge = 0; gCurrentLoadedPath = ""; - network_close(); + GetContext()->GetNetwork().Close(); OpenRCT2::Audio::StopAll(); GetContext()->GetGameState()->InitAll(150); viewport_init_all(); From 1cfc933a59f37355ed8f5f614daf7e9429cb65b7 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:57:29 +0300 Subject: [PATCH 177/681] Introduce a base class for system models --- src/openrct2/System.hpp | 60 ++++++++++++++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 1 + 2 files changed, 61 insertions(+) create mode 100644 src/openrct2/System.hpp diff --git a/src/openrct2/System.hpp b/src/openrct2/System.hpp new file mode 100644 index 0000000000..2987df5538 --- /dev/null +++ b/src/openrct2/System.hpp @@ -0,0 +1,60 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +namespace OpenRCT2 +{ + struct IContext; + + // Base class for systems that are hosted in the Context. + class System + { + IContext& _context; + + public: + System(IContext& owner) + : _context(owner) + { + } + + virtual ~System() = default; + + // Called before a tick. + virtual void PreTick() + { + } + + // Called every game tick, which by default is 40hz. + virtual void Tick() + { + } + + // Called after a tick. + virtual void PostTick() + { + } + + // Called every frame. + virtual void Update() + { + } + + IContext& GetContext() + { + return _context; + } + + const IContext& GetContext() const + { + return _context; + } + }; + +} // namespace OpenRCT2 diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 7029514897..91c438e8fc 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -436,6 +436,7 @@ + From b3bb2f5d80765bf383fd60d5bd5b2c79fd0dcbba Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 06:59:23 +0300 Subject: [PATCH 178/681] Refactor NetworkBase to use the System base class --- src/openrct2/network/NetworkBase.cpp | 47 ++++++++++++++-------------- src/openrct2/network/NetworkBase.h | 10 +++--- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7b6af5e6af..855b50bec8 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -106,7 +106,7 @@ static void network_get_private_key_path(utf8* buffer, size_t bufferSize, const static void network_get_public_key_path(utf8* buffer, size_t bufferSize, const std::string& playerName, const utf8* hash); NetworkBase::NetworkBase(OpenRCT2::IContext& context) - : _context(context) + : OpenRCT2::System(context) { wsa_initialized = false; mode = NETWORK_MODE_NONE; @@ -555,7 +555,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_resolving }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); } break; @@ -570,7 +570,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_connecting }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); server_connect_time = platform_get_ticks(); @@ -587,7 +587,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_authenticating }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); break; } @@ -1096,7 +1096,7 @@ void NetworkBase::AppendLog(std::ostream& fs, const std::string& s) void NetworkBase::BeginChatLog() { - auto env = _context.GetPlatformEnvironment(); + auto env = GetContext().GetPlatformEnvironment(); auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); _chatLogPath = BeginLog(directory, "", _chatLogFilenameFormat); @@ -1123,7 +1123,7 @@ void NetworkBase::CloseChatLog() void NetworkBase::BeginServerLog() { - auto env = _context.GetPlatformEnvironment(); + auto env = GetContext().GetPlatformEnvironment(); auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); _serverLogPath = BeginLog(directory, ServerName, _serverLogFilenameFormat); @@ -1270,14 +1270,14 @@ void NetworkBase::Server_Send_OBJECTS_LIST( } } -void NetworkBase::Server_Send_SCRIPTS(NetworkConnection& connection) const +void NetworkBase::Server_Send_SCRIPTS(NetworkConnection& connection) { NetworkPacket packet(NetworkCommand::Scripts); # ifdef ENABLE_SCRIPTING using namespace OpenRCT2::Scripting; - auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& scriptEngine = GetContext().GetScriptEngine(); const auto& plugins = scriptEngine.GetPlugins(); std::vector> pluginsToSend; for (const auto& plugin : plugins) @@ -1366,8 +1366,8 @@ void NetworkBase::Server_Send_MAP(NetworkConnection* connection) { // This will send all custom objects to connected clients // TODO: fix it so custom objects negotiation is performed even in this case. - auto context = GetContext(); - auto& objManager = context->GetObjectManager(); + auto& context = GetContext(); + auto& objManager = context.GetObjectManager(); objects = objManager.GetPackableObjects(); } @@ -2180,7 +2180,7 @@ void NetworkBase::Server_Handle_REQUEST_GAMESTATE(NetworkConnection& connection, return; } - IGameStateSnapshots* snapshots = GetContext()->GetGameStateSnapshots(); + IGameStateSnapshots* snapshots = GetContext().GetGameStateSnapshots(); const GameStateSnapshot_t* snapshot = snapshots->GetLinkedSnapshot(tick); if (snapshot) @@ -2275,8 +2275,8 @@ void NetworkBase::Server_Client_Joined(const char* name, const std::string& keyh format_string(text, 256, STR_MULTIPLAYER_PLAYER_HAS_JOINED_THE_GAME, &player_name); chat_history_add(text); - auto context = GetContext(); - auto& objManager = context->GetObjectManager(); + auto& context = GetContext(); + auto& objManager = context.GetObjectManager(); auto objects = objManager.GetPackableObjects(); Server_Send_OBJECTS_LIST(connection, objects); Server_Send_SCRIPTS(connection); @@ -2304,7 +2304,7 @@ void NetworkBase::Server_Handle_TOKEN(NetworkConnection& connection, [[maybe_unu void NetworkBase::Client_Handle_OBJECTS_LIST(NetworkConnection& connection, NetworkPacket& packet) { - auto& repo = GetContext()->GetObjectRepository(); + auto& repo = GetContext().GetObjectRepository(); uint32_t index = 0; uint32_t totalObjects = 0; @@ -2335,7 +2335,7 @@ void NetworkBase::Client_Handle_OBJECTS_LIST(NetworkConnection& connection, Netw auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ objectListMsg }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); char objectName[12]{}; @@ -2375,7 +2375,7 @@ void NetworkBase::Client_Handle_SCRIPTS(NetworkConnection& connection, NetworkPa packet >> numScripts; # ifdef ENABLE_SCRIPTING - auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& scriptEngine = GetContext().GetScriptEngine(); for (uint32_t i = 0; i < numScripts; i++) { uint32_t codeLength{}; @@ -2421,7 +2421,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network _serverGameState.SetPosition(0); DataSerialiser ds(false, _serverGameState); - IGameStateSnapshots* snapshots = GetContext()->GetGameStateSnapshots(); + IGameStateSnapshots* snapshots = GetContext().GetGameStateSnapshots(); GameStateSnapshot_t& serverSnapshot = snapshots->CreateSnapshot(); snapshots->SerialiseSnapshot(serverSnapshot, ds); @@ -2431,8 +2431,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network { GameStateCompareData_t cmpData = snapshots->Compare(serverSnapshot, *desyncSnapshot); - std::string outputPath = GetContext()->GetPlatformEnvironment()->GetDirectoryPath( - DIRBASE::USER, DIRID::LOG_DESYNCS); + std::string outputPath = GetContext().GetPlatformEnvironment()->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_DESYNCS); platform_ensure_directory_exists(outputPath.c_str()); @@ -2480,7 +2479,7 @@ void NetworkBase::Server_Handle_MAPREQUEST(NetworkConnection& connection, Networ return; } log_verbose("Client requested %u objects", size); - auto& repo = GetContext()->GetObjectRepository(); + auto& repo = GetContext().GetObjectRepository(); for (uint32_t i = 0; i < size; i++) { const char* name = reinterpret_cast(packet.Read(8)); @@ -2661,7 +2660,7 @@ void NetworkBase::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connecti auto intent = Intent(WC_NETWORK_STATUS); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_downloading_map }); - intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { GetContext()->GetNetwork().Close(); }); + intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); context_open_intent(&intent); std::memcpy(&chunk_buffer[offset], const_cast(static_cast(packet.Read(chunksize))), chunksize); @@ -2733,9 +2732,9 @@ bool NetworkBase::LoadMap(IStream* stream) bool result = false; try { - auto context = GetContext(); - auto& objManager = context->GetObjectManager(); - auto importer = ParkImporter::CreateS6(context->GetObjectRepository()); + auto& context = GetContext(); + auto& objManager = context.GetObjectManager(); + auto importer = ParkImporter::CreateS6(context.GetObjectRepository()); auto loadResult = importer->LoadFromStream(stream, false); objManager.LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size()); importer->Import(); diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 2a67c203d9..73f31cf726 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -1,5 +1,6 @@ #pragma once +#include "../System.hpp" #include "../actions/GameAction.h" #include "NetworkConnection.h" #include "NetworkGroup.h" @@ -17,10 +18,8 @@ namespace OpenRCT2 struct IContext; } -class NetworkBase +class NetworkBase : public OpenRCT2::System { - OpenRCT2::IContext& _context; - public: NetworkBase(OpenRCT2::IContext& context); @@ -32,7 +31,8 @@ public: // Common bool Init(); void Close(); uint32_t GetServerTick(); - void Update(); + // FIXME: This is currently the wrong function to override in System, will be refactored later. + void Update() override final; void Flush(); void ProcessPending(); void ProcessPlayerList(); @@ -96,7 +96,7 @@ public: // Server void Server_Send_EVENT_PLAYER_JOINED(const char* playerName); void Server_Send_EVENT_PLAYER_DISCONNECTED(const char* playerName, const char* reason); void Server_Send_OBJECTS_LIST(NetworkConnection& connection, const std::vector& objects) const; - void Server_Send_SCRIPTS(NetworkConnection& connection) const; + void Server_Send_SCRIPTS(NetworkConnection& connection); // Handlers void Server_Handle_REQUEST_GAMESTATE(NetworkConnection& connection, NetworkPacket& packet); From 72a63735206b36c50d08bd1e10fbba445253445e Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Tue, 17 Aug 2021 10:36:18 +0300 Subject: [PATCH 179/681] Guard code with DISABLE_NETWORK --- src/openrct2/Context.cpp | 13 +++++++++++++ src/openrct2/title/TitleScreen.cpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index a0636e15d9..1a11ca47d5 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -171,7 +171,9 @@ namespace OpenRCT2 // If objects use GetContext() in their destructor things won't go well. GameActions::ClearQueue(); +#ifndef DISABLE_NETWORK _network.Close(); +#endif window_close_all(); // Unload objects after closing all windows, this is to overcome windows like @@ -651,22 +653,29 @@ namespace OpenRCT2 gScreenAge = 0; gLastAutoSaveUpdate = AUTOSAVE_PAUSE; +#ifndef DISABLE_NETWORK bool sendMap = false; +#endif if (info.Type == FILE_TYPE::SAVED_GAME) { +#ifndef DISABLE_NETWORK if (_network.GetMode() == NETWORK_MODE_CLIENT) { _network.Close(); } +#endif game_load_init(); +#ifndef DISABLE_NETWORK if (_network.GetMode() == NETWORK_MODE_SERVER) { sendMap = true; } +#endif } else { scenario_begin(); +#ifndef DISABLE_NETWORK if (_network.GetMode() == NETWORK_MODE_SERVER) { sendMap = true; @@ -675,14 +684,18 @@ namespace OpenRCT2 { _network.Close(); } +#endif } // This ensures that the newly loaded save reflects the user's // 'show real names of guests' option, now that it's a global setting peep_update_names(gConfigGeneral.show_real_names_of_guests); +#ifndef DISABLE_NETWORK if (sendMap) { _network.Server_Send_MAP(); } +#endif + #ifdef USE_BREAKPAD if (_network.GetMode() == NETWORK_MODE_NONE) { diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index 3fe9f9e2b1..02e134ef8f 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -125,7 +125,9 @@ void TitleScreen::Load() gScreenAge = 0; gCurrentLoadedPath = ""; +#ifndef DISABLE_NETWORK GetContext()->GetNetwork().Close(); +#endif OpenRCT2::Audio::StopAll(); GetContext()->GetGameState()->InitAll(150); viewport_init_all(); From 4bc5f70581f61654b2a984c87014bc317f17dbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 17 Aug 2021 01:32:58 -0700 Subject: [PATCH 180/681] Minor refactor work around the painting (#15226) * Remove unused variables and drop packing of paint structs * Move PAINT_QUADRANT_FLAGS out of the header * Rename enum and variable to SortFlags * Rename variable and document the sorting * Apply review --- src/openrct2/paint/Paint.cpp | 61 ++++++++++++++++++++++++++---------- src/openrct2/paint/Paint.h | 42 ++++++++++--------------- 2 files changed, 61 insertions(+), 42 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index f88b011bf7..f4d9913b37 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -178,7 +178,6 @@ static paint_struct* CreateNormalPaintStruct( ps->attached_ps = nullptr; ps->children = nullptr; ps->sprite_type = session->InteractionType; - ps->var_29 = 0; ps->map_x = session->MapPosition.x; ps->map_y = session->MapPosition.y; ps->tileElement = reinterpret_cast(const_cast(session->CurrentlyDrawnItem)); @@ -298,11 +297,21 @@ template<> bool CheckBoundingBox<3>(const paint_struct_bound_box& initialBBox, c return false; } +namespace PaintSortFlags +{ + static constexpr uint8_t None = 0; + static constexpr uint8_t PendingVisit = (1U << 0); + static constexpr uint8_t Neighbour = (1U << 1); + static constexpr uint8_t OutsideQuadrant = (1U << 7); +} // namespace PaintSortFlags + template static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, uint16_t quadrantIndex, uint8_t flag) { paint_struct* ps; paint_struct* ps_temp; + + // Get the first node in the specified quadrant. do { ps = ps_next; @@ -311,9 +320,12 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui return ps; } while (quadrantIndex > ps_next->quadrant_index); - // Cache the last visited node so we don't have to walk the whole list again - paint_struct* ps_cache = ps; + // We keep track of the first node in the quadrant so the next call with a higher quadrant index + // can use this node to skip some iterations. + paint_struct* psQuadrantEntry = ps; + // Visit all nodes in the linked quadrant list and determine their current + // sorting relevancy. ps_temp = ps; do { @@ -323,47 +335,63 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui if (ps->quadrant_index > quadrantIndex + 1) { - ps->quadrant_flags = PAINT_QUADRANT_FLAG_BIGGER; + // Outside of the range. + ps->SortFlags = PaintSortFlags::OutsideQuadrant; } else if (ps->quadrant_index == quadrantIndex + 1) { - ps->quadrant_flags = PAINT_QUADRANT_FLAG_NEXT | PAINT_QUADRANT_FLAG_IDENTICAL; + // Is neighbour and requires a visit. + ps->SortFlags = PaintSortFlags::Neighbour | PaintSortFlags::PendingVisit; } else if (ps->quadrant_index == quadrantIndex) { - ps->quadrant_flags = flag | PAINT_QUADRANT_FLAG_IDENTICAL; + // In specified quadrant, requires visit. + ps->SortFlags = flag | PaintSortFlags::PendingVisit; } } while (ps->quadrant_index <= quadrantIndex + 1); ps = ps_temp; + // Iterate all nodes in the current list and re-order them based on + // the current rotation and their bounding box. while (true) { + // Get the first pending node in the quadrant list while (true) { ps_next = ps->next_quadrant_ps; if (ps_next == nullptr) - return ps_cache; - if (ps_next->quadrant_flags & PAINT_QUADRANT_FLAG_BIGGER) - return ps_cache; - if (ps_next->quadrant_flags & PAINT_QUADRANT_FLAG_IDENTICAL) + { + // End of the current list. + return psQuadrantEntry; + } + if (ps_next->SortFlags & PaintSortFlags::OutsideQuadrant) + { + // Reached point outside of specified quadrant. + return psQuadrantEntry; + } + if (ps_next->SortFlags & PaintSortFlags::PendingVisit) + { + // Found node to check on. break; + } ps = ps_next; } - ps_next->quadrant_flags &= ~PAINT_QUADRANT_FLAG_IDENTICAL; + // Mark visited. + ps_next->SortFlags &= ~PaintSortFlags::PendingVisit; ps_temp = ps; + // Compare current node against the remaining children. const paint_struct_bound_box& initialBBox = ps_next->bounds; - while (true) { ps = ps_next; ps_next = ps_next->next_quadrant_ps; if (ps_next == nullptr) break; - if (ps_next->quadrant_flags & PAINT_QUADRANT_FLAG_BIGGER) + if (ps_next->SortFlags & PaintSortFlags::OutsideQuadrant) break; - if (!(ps_next->quadrant_flags & PAINT_QUADRANT_FLAG_NEXT)) + if (!(ps_next->SortFlags & PaintSortFlags::Neighbour)) continue; const paint_struct_bound_box& currentBBox = ps_next->bounds; @@ -372,6 +400,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui if (compareResult) { + // Child node intersects with current node, move behind. ps->next_quadrant_ps = ps_next->next_quadrant_ps; paint_struct* ps_temp2 = ps_temp->next_quadrant_ps; ps_temp->next_quadrant_ps = ps_next; @@ -410,12 +439,12 @@ template static void PaintSessionArrange(PaintSessionCore* sessio } while (++quadrantIndex <= session->QuadrantFrontIndex); paint_struct* ps_cache = PaintArrangeStructsHelperRotation( - psHead, session->QuadrantBackIndex & 0xFFFF, PAINT_QUADRANT_FLAG_NEXT); + psHead, session->QuadrantBackIndex & 0xFFFF, PaintSortFlags::Neighbour); quadrantIndex = session->QuadrantBackIndex; while (++quadrantIndex < session->QuadrantFrontIndex) { - ps_cache = PaintArrangeStructsHelperRotation(ps_cache, quadrantIndex & 0xFFFF, 0); + ps_cache = PaintArrangeStructsHelperRotation(ps_cache, quadrantIndex & 0xFFFF, PaintSortFlags::None); } } } diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 87dfaee9cc..9fbd29d124 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -23,6 +23,7 @@ enum class ViewportInteractionItem : uint8_t; struct attached_paint_struct { + attached_paint_struct* next; uint32_t image_id; union { @@ -33,15 +34,6 @@ struct attached_paint_struct int32_t x; int32_t y; uint8_t flags; - uint8_t pad_0D; - attached_paint_struct* next; -}; - -enum PAINT_QUADRANT_FLAGS -{ - PAINT_QUADRANT_FLAG_IDENTICAL = (1 << 0), - PAINT_QUADRANT_FLAG_BIGGER = (1 << 7), - PAINT_QUADRANT_FLAG_NEXT = (1 << 1), }; struct paint_struct_bound_box @@ -56,6 +48,11 @@ struct paint_struct_bound_box struct paint_struct { + paint_struct_bound_box bounds; + attached_paint_struct* attached_ps; + paint_struct* children; + paint_struct* next_quadrant_ps; + TileElement* tileElement; uint32_t image_id; union { @@ -63,31 +60,24 @@ struct paint_struct // If masked image_id is masked_id uint32_t colour_image_id; }; - paint_struct_bound_box bounds; int32_t x; int32_t y; - uint16_t quadrant_index; - uint8_t flags; - uint8_t quadrant_flags; - attached_paint_struct* attached_ps; - paint_struct* children; - paint_struct* next_quadrant_ps; - ViewportInteractionItem sprite_type; - uint8_t var_29; - uint16_t pad_2A; int32_t map_x; int32_t map_y; - TileElement* tileElement; + uint16_t quadrant_index; + uint8_t flags; + uint8_t SortFlags; + ViewportInteractionItem sprite_type; }; struct paint_string_struct { - rct_string_id string_id; // 0x00 - paint_string_struct* next; // 0x02 - int32_t x; // 0x06 - int32_t y; // 0x08 - uint32_t args[4]; // 0x0A - uint8_t* y_offsets; // 0x1A + rct_string_id string_id; + paint_string_struct* next; + int32_t x; + int32_t y; + uint32_t args[4]; + uint8_t* y_offsets; }; union paint_entry From 399f6f27b46594048d0ea2a58bcc0a2044d17dcb Mon Sep 17 00:00:00 2001 From: Basssiiie Date: Tue, 17 Aug 2021 18:10:33 +0200 Subject: [PATCH 181/681] Fix #15176: Incorrect base height in tile inspector for track pieces (#15233) --- src/openrct2-ui/windows/TileInspector.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 8d695d303b..9fe20395ba 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1991,6 +1991,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Current base height screenCoords.x = w->windowPos.x + w->widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; + ft = Formatter(); ft.Add(tileElement->base_height); DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { COLOUR_WHITE }); break; From 223b926f8c7f499cef4f69f66c0ce2b612a5d3b5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 17 Aug 2021 21:29:35 +0100 Subject: [PATCH 182/681] Use std::vector for ride use memory (#14884) * Use std::vector for ride use memory * Use new system for import/export * Remove legacy field * Add replay entity size protection to prevent crash * Increment network version * Update replays * Move function to header * Move constant to RCT12 header as used for both 1 and 2 * Align naming with nsf --- CMakeLists.txt | 4 +- OpenRCT2.xcodeproj/project.pbxproj | 12 +++ openrct2.proj | 4 +- src/openrct2/GameStateSnapshots.cpp | 30 ++++++-- src/openrct2/actions/RideDemolishAction.cpp | 2 + src/openrct2/core/GroupVector.hpp | 81 +++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 3 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/peep/Guest.cpp | 19 ++--- src/openrct2/peep/Peep.h | 4 - src/openrct2/peep/RideUseSystem.cpp | 26 +++++++ src/openrct2/peep/RideUseSystem.h | 22 ++++++ src/openrct2/rct1/S4Importer.cpp | 11 +-- src/openrct2/rct12/RCT12.h | 28 +++++++ src/openrct2/rct2/RCT2.h | 5 +- src/openrct2/rct2/S6Exporter.cpp | 21 ++++-- src/openrct2/rct2/S6Importer.cpp | 13 ++-- src/openrct2/world/Entity.cpp | 2 - src/openrct2/world/Sprite.cpp | 32 ++++++-- 19 files changed, 260 insertions(+), 61 deletions(-) create mode 100644 src/openrct2/core/GroupVector.hpp create mode 100644 src/openrct2/peep/RideUseSystem.cpp create mode 100644 src/openrct2/peep/RideUseSystem.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 91e31c0b4f..b2a742f306 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.46") +set(REPLAYS_VERSION "0.0.47") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "4DDCF0A78F8B9A20601607173247C418A2526CC3") +set(REPLAYS_SHA1 "61CAB8A0AD0B057B13B003DF32748977C2B5975F") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 5b071a34fb..5733a6f091 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -796,6 +796,9 @@ 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43D18154E96444749737E3F6 /* ScTileElement.cpp */; }; DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */; }; 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B67E36A8620400CA70FBA49 /* ScTile.cpp */; }; + 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */; }; + E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA720D496604387806AC168 /* RideUseSystem.h */; }; + C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4D523B8782E4C458AF1490D /* GroupVector.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1894,6 +1897,9 @@ 43D18154E96444749737E3F6 /* ScTileElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTileElement.cpp; path = src/openrct2/scripting/bindings/world/ScTileElement.cpp; sourceTree = SOURCE_ROOT; }; F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTileElement.hpp; path = src/openrct2/scripting/bindings/world/ScTileElement.hpp; sourceTree = SOURCE_ROOT; }; 5B67E36A8620400CA70FBA49 /* ScTile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTile.cpp; path = src/openrct2/scripting/bindings/world/ScTile.cpp; sourceTree = SOURCE_ROOT; }; + 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideUseSystem.cpp; path = src/openrct2/peep/RideUseSystem.cpp; sourceTree = SOURCE_ROOT; }; + 2DA720D496604387806AC168 /* RideUseSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RideUseSystem.h; path = src/openrct2/peep/RideUseSystem.h; sourceTree = SOURCE_ROOT; }; + F4D523B8782E4C458AF1490D /* GroupVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GroupVector.hpp; path = src/openrct2/core/GroupVector.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2563,6 +2569,7 @@ F76C83991EC4E7CC00FA49E2 /* Zip.cpp */, F76C839A1EC4E7CC00FA49E2 /* Zip.h */, BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */, + F4D523B8782E4C458AF1490D /* GroupVector.hpp */, ); path = core; sourceTree = ""; @@ -2831,6 +2838,8 @@ 4CFE4E7D1F90A3F1005243C2 /* PeepData.cpp */, 4CFE4E7E1F90A3F1005243C2 /* Staff.cpp */, 4CFE4E7F1F90A3F1005243C2 /* Staff.h */, + 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */, + 2DA720D496604387806AC168 /* RideUseSystem.h */, ); path = peep; sourceTree = ""; @@ -3638,6 +3647,8 @@ 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */, AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */, DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */, + E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */, + C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4457,6 +4468,7 @@ 887B0043454440BAB322A9E8 /* ScPark.cpp in Sources */, 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */, 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */, + 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/openrct2.proj b/openrct2.proj index 014df4a74d..710f325bd9 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.46/replays.zip - 4DDCF0A78F8B9A20601607173247C418A2526CC3 + https://github.com/OpenRCT2/replays/releases/download/v0.0.47/replays.zip + 61CAB8A0AD0B057B13B003DF32748977C2B5975F diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 3a95370b77..5574143b7f 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -39,6 +39,21 @@ struct GameStateSnapshot_t OpenRCT2::MemoryStream storedSprites; OpenRCT2::MemoryStream parkParameters; + template bool EntitySizeCheck(DataSerialiser& ds) + { + uint32_t size = sizeof(T); + ds << size; + if (ds.IsLoading()) + { + return size == sizeof(T); + } + return true; + } + template bool EntitiesSizeCheck(DataSerialiser& ds) + { + return (EntitySizeCheck(ds) && ...); + } + // Must pass a function that can access the sprite. void SerialiseSprites(std::function getEntity, const size_t numSprites, bool saving) { @@ -64,6 +79,13 @@ struct GameStateSnapshot_t numSavedSprites = static_cast(indexTable.size()); } + // Encodes and checks the size of each of the entity so that we + // can fail gracefully when fields added/removed + if (!EntitiesSizeCheck(ds)) + { + log_error("Entity index corrupted!"); + return; + } ds << numSavedSprites; if (loading) @@ -300,20 +322,12 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Guest, Intensity); COMPARE_FIELD(Guest, NauseaTolerance); COMPARE_FIELD(Guest, PaidOnDrink); - for (int i = 0; i < 16; i++) - { - COMPARE_FIELD(Guest, RideTypesBeenOn[i]); - } COMPARE_FIELD(Guest, ItemFlags); COMPARE_FIELD(Guest, Photo2RideRef); COMPARE_FIELD(Guest, Photo3RideRef); COMPARE_FIELD(Guest, Photo4RideRef); COMPARE_FIELD(Guest, GuestNextInQueue); COMPARE_FIELD(Guest, TimeInQueue); - for (int i = 0; i < 32; i++) - { - COMPARE_FIELD(Guest, RidesBeenOn[i]); - } COMPARE_FIELD(Guest, CashInPocket); COMPARE_FIELD(Guest, CashSpent); diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 1e584de91b..3add2042dc 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -17,6 +17,7 @@ #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../management/NewsItem.h" +#include "../peep/RideUseSystem.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ui/UiContext.h" @@ -134,6 +135,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const UnlinkAllBannersForRide(_rideIndex); + RideUse::GetHistory().RemoveValue(_rideIndex); for (auto peep : EntityList()) { peep->RemoveRideFromMemory(_rideIndex); diff --git a/src/openrct2/core/GroupVector.hpp b/src/openrct2/core/GroupVector.hpp new file mode 100644 index 0000000000..195e669783 --- /dev/null +++ b/src/openrct2/core/GroupVector.hpp @@ -0,0 +1,81 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 +#include + +template class GroupVector +{ + std::vector> _data; + +public: + bool Contains(Handle handle, V value) + { + if (handle >= _data.size()) + return false; + + const auto& values = _data[handle]; + return std::find(values.begin(), values.end(), value) != values.end(); + } + + void Add(Handle handle, V value) + { + if (handle >= _data.size()) + { + _data.resize(handle + 1); + } + auto& values = _data[handle]; + + auto it = std::find(values.begin(), values.end(), value); + if (it != values.end()) + return; + + values.push_back(value); + } + + void Set(Handle handle, std::vector&& values) + { + if (handle >= _data.size()) + { + _data.resize(handle + 1); + } + _data[handle] = values; + } + + std::vector* GetAll(Handle handle) + { + if (handle < _data.size()) + { + return &_data[handle]; + } + return nullptr; + } + + void Clear() + { + _data.clear(); + } + + void RemoveHandle(Handle handle) + { + if (handle < _data.size()) + { + _data[handle].clear(); + } + } + + void RemoveValue(V value) + { + for (auto& values : _data) + { + values.erase(std::remove_if(values.begin(), values.end(), [value](auto v) { return v == value; }), values.end()); + } + } +}; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 7029514897..3d685e7517 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -164,6 +164,7 @@ + @@ -285,6 +286,7 @@ + @@ -735,6 +737,7 @@ + diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7f3578ff38..a0417603bc 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "3" +#define NETWORK_STREAM_VERSION "4" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 2aa6787403..d57c25d151 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -45,6 +45,7 @@ #include "../world/TileElementsView.h" #include "GuestPathfinding.h" #include "Peep.h" +#include "RideUseSystem.h" #include "Staff.h" #include @@ -2296,27 +2297,30 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp void Guest::SetHasRidden(const Ride* ride) { - RidesBeenOn[ride->id / 8] |= 1 << (ride->id % 8); + OpenRCT2::RideUse::GetHistory().Add(sprite_index, ride->id); + SetHasRiddenRideType(ride->type); } bool Guest::HasRidden(const Ride* ride) const { - return RidesBeenOn[ride->id / 8] & (1 << (ride->id % 8)); + return OpenRCT2::RideUse::GetHistory().Contains(sprite_index, ride->id); } void Guest::SetHasRiddenRideType(int32_t rideType) { // This is needed to avoid desyncs. TODO: remove once the new save format is introduced. rideType = OpenRCT2RideTypeToRCT2RideType(rideType); - RideTypesBeenOn[rideType / 8] |= 1 << (rideType % 8); + + OpenRCT2::RideUse::GetTypeHistory().Add(sprite_index, rideType); } bool Guest::HasRiddenRideType(int32_t rideType) const { // This is needed to avoid desyncs. TODO: remove once the new save format is introduced. rideType = OpenRCT2RideTypeToRCT2RideType(rideType); - return RideTypesBeenOn[rideType / 8] & (1 << (rideType % 8)); + + return OpenRCT2::RideUse::GetTypeHistory().Contains(sprite_index, rideType); } void Guest::SetParkEntryTime(int32_t entryTime) @@ -7030,10 +7034,8 @@ Guest* Guest::Generate(const CoordsXYZ& coords) peep->Toilet = 0; peep->TimeToConsume = 0; - std::fill_n(peep->RidesBeenOn, 32, 0x00); peep->GuestNumRides = 0; - std::fill_n(peep->RideTypesBeenOn, 16, 0x00); peep->Id = gNextGuestNumber++; peep->Name = nullptr; @@ -7373,11 +7375,6 @@ static bool IsThoughtShopItemRelated(const PeepThoughtType type) void Guest::RemoveRideFromMemory(ride_id_t rideId) { - uint8_t ride_id_bit = rideId % 8; - uint8_t ride_id_offset = rideId / 8; - - // clear ride from potentially being in RidesBeenOn - RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); if (State == PeepState::Watching) { if (CurrentRide == rideId) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 6683f419c9..cf3f035803 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -693,11 +693,7 @@ public: uint8_t TimeToConsume; IntensityRange Intensity{ 0 }; PeepNauseaTolerance NauseaTolerance; - uint8_t RideTypesBeenOn[16]; uint16_t TimeInQueue; - // 255 bit bitmap of every ride the peep has been on see - // window_peep_rides_update for how to use. - uint8_t RidesBeenOn[32]; money32 CashInPocket; money32 CashSpent; ride_id_t Photo1RideRef; diff --git a/src/openrct2/peep/RideUseSystem.cpp b/src/openrct2/peep/RideUseSystem.cpp new file mode 100644 index 0000000000..d393dfe93c --- /dev/null +++ b/src/openrct2/peep/RideUseSystem.cpp @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "RideUseSystem.h" + +namespace OpenRCT2::RideUse +{ + static RideHistory _history; + static RideTypeHistory _typeHistory; + + RideHistory& GetHistory() + { + return _history; + } + + RideTypeHistory& GetTypeHistory() + { + return _typeHistory; + } +} // namespace OpenRCT2::RideUse diff --git a/src/openrct2/peep/RideUseSystem.h b/src/openrct2/peep/RideUseSystem.h new file mode 100644 index 0000000000..bc1971ef00 --- /dev/null +++ b/src/openrct2/peep/RideUseSystem.h @@ -0,0 +1,22 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../core/GroupVector.hpp" +#include "../ride/RideTypes.h" + +namespace OpenRCT2::RideUse +{ + using RideHistory = GroupVector; + using RideTypeHistory = GroupVector; + + RideHistory& GetHistory(); + RideTypeHistory& GetTypeHistory(); + +} // namespace OpenRCT2::RideUse diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c0e9c05d26..c4a4a54212 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -33,6 +33,7 @@ #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" #include "../peep/Peep.h" +#include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../ride/RideData.h" #include "../ride/Station.h" @@ -2832,14 +2833,8 @@ template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) dst->Angriness = src->angriness; dst->TimeLost = src->time_lost; - for (size_t i = 0; i < 32; i++) - { - dst->RidesBeenOn[i] = src->rides_been_on[i]; - } - for (size_t i = 0; i < 16; i++) - { - dst->RideTypesBeenOn[i] = src->ride_types_been_on[i]; - } + OpenRCT2::RideUse::GetHistory().Set(dst->sprite_index, RCT12GetRidesBeenOn(src)); + OpenRCT2::RideUse::GetTypeHistory().Set(dst->sprite_index, RCT12GetRideTypesBeenOn(src)); dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->photo1_ride_ref); diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index d83239370f..4652c88625 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -17,6 +17,7 @@ #include #include +#include using track_type_t = uint16_t; using RCT12TrackType = uint8_t; @@ -26,6 +27,8 @@ constexpr uint8_t RCT2_STRING_FORMAT_ARG_END = 141; constexpr uint8_t RCT2_STRING_FORMAT_COLOUR_START = 142; constexpr uint8_t RCT2_STRING_FORMAT_COLOUR_END = 156; +constexpr const uint8_t RCT12_MAX_RIDE_OBJECTS = 128; + constexpr const uint8_t RCT12_MAX_RIDES_IN_PARK = 255; constexpr const uint8_t RCT12_MAX_AWARDS = 4; constexpr const uint8_t RCT12_MAX_NEWS_ITEMS = 61; @@ -937,3 +940,28 @@ static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue); money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue); + +template std::vector RCT12GetRideTypesBeenOn(T* srcPeep) +{ + std::vector ridesTypesBeenOn; + for (uint16_t i = 0; i < RCT12_MAX_RIDE_OBJECTS; i++) + { + if (srcPeep->ride_types_been_on[i / 8] & (1 << (i % 8))) + { + ridesTypesBeenOn.push_back(i); + } + } + return ridesTypesBeenOn; +} +template std::vector RCT12GetRidesBeenOn(T* srcPeep) +{ + std::vector ridesBeenOn; + for (uint16_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + { + if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8))) + { + ridesBeenOn.push_back(i); + } + } + return ridesBeenOn; +} diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 10003fb038..d3a95d98b7 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -39,7 +39,6 @@ constexpr const uint16_t RCT2_MAX_RESEARCHED_SCENERY_ITEMS = (RCT2_MAX_RESEARCHE // per quad. constexpr uint16_t TD6MaxTrackElements = 8192; -constexpr const uint8_t RCT2_MAX_RIDE_OBJECTS = 128; constexpr const uint8_t RCT2_MAX_SMALL_SCENERY_OBJECTS = 252; constexpr const uint8_t RCT2_MAX_LARGE_SCENERY_OBJECTS = 128; constexpr const uint8_t RCT2_MAX_WALL_SCENERY_OBJECTS = 128; @@ -58,7 +57,7 @@ constexpr const uint16_t RCT2_MAXIMUM_MAP_SIZE_TECHNICAL = 256; // clang-format off constexpr const uint16_t RCT2_OBJECT_ENTRY_COUNT = - RCT2_MAX_RIDE_OBJECTS + + RCT12_MAX_RIDE_OBJECTS + RCT2_MAX_SMALL_SCENERY_OBJECTS + RCT2_MAX_LARGE_SCENERY_OBJECTS + RCT2_MAX_WALL_SCENERY_OBJECTS + @@ -74,7 +73,7 @@ static_assert(RCT2_OBJECT_ENTRY_COUNT == 721); // clang-format off constexpr const int32_t rct2_object_entry_group_counts[] = { - RCT2_MAX_RIDE_OBJECTS, + RCT12_MAX_RIDE_OBJECTS, RCT2_MAX_SMALL_SCENERY_OBJECTS, RCT2_MAX_LARGE_SCENERY_OBJECTS, RCT2_MAX_WALL_SCENERY_OBJECTS, diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index b32404921e..9f0d58f773 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -33,6 +33,7 @@ #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" #include "../peep/Peep.h" +#include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../rct12/SawyerChunkWriter.h" #include "../ride/Ride.h" @@ -1212,9 +1213,21 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src) dst->intensity = static_cast(src->Intensity); dst->nausea_tolerance = EnumValue(src->NauseaTolerance); dst->paid_on_drink = src->PaidOnDrink; - for (size_t i = 0; i < std::size(src->RideTypesBeenOn); i++) + auto* typeHistory = OpenRCT2::RideUse::GetTypeHistory().GetAll(src->sprite_index); + if (typeHistory != nullptr) { - dst->ride_types_been_on[i] = src->RideTypesBeenOn[i]; + for (auto typeId : *typeHistory) + { + dst->ride_types_been_on[typeId / 8] |= (1 << (typeId % 8)); + } + } + auto* rideHistory = OpenRCT2::RideUse::GetHistory().GetAll(src->sprite_index); + if (rideHistory != nullptr) + { + for (auto rideId : *rideHistory) + { + dst->rides_been_on[rideId / 8] |= (1 << (rideId % 8)); + } } dst->item_extra_flags = static_cast(src->GetItemFlags() >> 32); dst->photo1_ride_ref = OpenRCT2RideIdToRCT12RideId(src->Photo1RideRef); @@ -1223,10 +1236,6 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src) dst->photo4_ride_ref = OpenRCT2RideIdToRCT12RideId(src->Photo4RideRef); dst->next_in_queue = src->GuestNextInQueue; dst->time_in_queue = src->TimeInQueue; - for (size_t i = 0; i < std::size(src->RidesBeenOn); i++) - { - dst->rides_been_on[i] = src->RidesBeenOn[i]; - } dst->cash_in_pocket = src->CashInPocket; dst->cash_spent = src->CashSpent; dst->park_entry_time = src->ParkEntryTime; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 441926fb5a..ed4a4397d9 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -34,6 +34,7 @@ #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" #include "../peep/Peep.h" +#include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../rct12/RCT12.h" #include "../rct12/SawyerChunkReader.h" @@ -1699,10 +1700,10 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) dst->Intensity = static_cast(src->intensity); dst->NauseaTolerance = static_cast(src->nausea_tolerance); dst->PaidOnDrink = src->paid_on_drink; - for (size_t i = 0; i < std::size(src->ride_types_been_on); i++) - { - dst->RideTypesBeenOn[i] = src->ride_types_been_on[i]; - } + + OpenRCT2::RideUse::GetHistory().Set(dst->sprite_index, RCT12GetRidesBeenOn(src)); + OpenRCT2::RideUse::GetTypeHistory().Set(dst->sprite_index, RCT12GetRideTypesBeenOn(src)); + dst->SetItemFlags(src->GetItemFlags()); dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->photo1_ride_ref); dst->Photo2RideRef = RCT12RideIdToOpenRCT2RideId(src->photo2_ride_ref); @@ -1710,10 +1711,6 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) dst->Photo4RideRef = RCT12RideIdToOpenRCT2RideId(src->photo4_ride_ref); dst->GuestNextInQueue = src->next_in_queue; dst->TimeInQueue = src->time_in_queue; - for (size_t i = 0; i < std::size(src->rides_been_on); i++) - { - dst->RidesBeenOn[i] = src->rides_been_on[i]; - } dst->CashInPocket = src->cash_in_pocket; dst->CashSpent = src->cash_spent; dst->ParkEntryTime = src->park_entry_time; diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/world/Entity.cpp index 3d3624dd4e..d3591c07f2 100644 --- a/src/openrct2/world/Entity.cpp +++ b/src/openrct2/world/Entity.cpp @@ -186,9 +186,7 @@ void Guest::Serialise(DataSerialiser& stream) stream << TimeToConsume; stream << Intensity; stream << NauseaTolerance; - stream << RideTypesBeenOn; stream << TimeInQueue; - stream << RidesBeenOn; stream << CashInPocket; stream << CashSpent; stream << Photo1RideRef; diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 8c0a36a03f..7537acdc8d 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -17,6 +17,7 @@ #include "../core/MemoryStream.h" #include "../interface/Viewport.h" #include "../peep/Peep.h" +#include "../peep/RideUseSystem.h" #include "../ride/Vehicle.h" #include "../scenario/Scenario.h" #include "Balloon.h" @@ -43,6 +44,8 @@ constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex; +static void FreeEntity(SpriteBase* entity); + constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) { size_t index = SPATIAL_INDEX_LOCATION_NULL; @@ -226,6 +229,8 @@ void reset_sprite_list() { gSavedAge = 0; std::memset(static_cast(_spriteList), 0, sizeof(_spriteList)); + OpenRCT2::RideUse::GetHistory().Clear(); + OpenRCT2::RideUse::GetTypeHistory().Clear(); for (int32_t i = 0; i < MAX_ENTITIES; ++i) { auto* spr = GetEntity(i); @@ -233,7 +238,7 @@ void reset_sprite_list() { continue; } - + FreeEntity(spr); spr->Type = EntityType::Null; spr->sprite_index = i; @@ -537,17 +542,32 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite) sprite->z = spritePos.z; } +/** + * Frees any dynamically attached memory to the entity, such as peep name. + */ +static void FreeEntity(SpriteBase* entity) +{ + auto* guest = entity->As(); + auto* staff = entity->As(); + if (staff != nullptr) + { + staff->SetName({}); + } + else if (guest != nullptr) + { + guest->SetName({}); + OpenRCT2::RideUse::GetHistory().RemoveHandle(guest->sprite_index); + OpenRCT2::RideUse::GetTypeHistory().RemoveHandle(guest->sprite_index); + } +} + /** * * rct2: 0x0069EDB6 */ void sprite_remove(SpriteBase* sprite) { - auto peep = sprite->As(); - if (peep != nullptr) - { - peep->SetName({}); - } + FreeEntity(sprite); EntityTweener::Get().RemoveEntity(sprite); RemoveFromEntityList(sprite); // remove from existing list From a371d1ff117e078a7e3a2e85417003a5cc3d9769 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Thu, 19 Aug 2021 00:04:49 -1000 Subject: [PATCH 183/681] Disallow opening problematic windows in multiplayer --- src/openrct2-ui/windows/TopToolbar.cpp | 1 + src/openrct2/interface/InteractiveConsole.cpp | 31 ++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 1f4f1f08b1..a14e62993e 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -3455,6 +3455,7 @@ static void top_toolbar_init_cheats_menu(rct_window* w, rct_widget* widget) { Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true); Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true); + Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true); } if (gScreenFlags & SCREEN_FLAGS_EDITOR) diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 59d7231374..3ad3c5fb25 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1172,13 +1172,27 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) bool invalidTitle = false; if (argv[0] == "object_selection" && invalidArguments(&invalidTitle, !title)) { - // Only this window should be open for safety reasons - window_close_all(); - context_open_window(WC_EDITOR_OBJECT_SELECTION); + if (network_get_mode() != NETWORK_MODE_NONE) + { + console.WriteLineError("Cannot open this window in multiplayer mode."); + } + else + { + // Only this window should be open for safety reasons + window_close_all(); + context_open_window(WC_EDITOR_OBJECT_SELECTION); + } } else if (argv[0] == "inventions_list" && invalidArguments(&invalidTitle, !title)) { - context_open_window(WC_EDITOR_INVENTION_LIST); + if (network_get_mode() != NETWORK_MODE_NONE) + { + console.WriteLineError("Cannot open this window in multiplayer mode."); + } + else + { + context_open_window(WC_EDITOR_INVENTION_LIST); + } } else if (argv[0] == "scenario_options" && invalidArguments(&invalidTitle, !title)) { @@ -1186,7 +1200,14 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "objective_options" && invalidArguments(&invalidTitle, !title)) { - context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS); + if (network_get_mode() != NETWORK_MODE_NONE) + { + console.WriteLineError("Cannot open this window in multiplayer mode."); + } + else + { + context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS); + } } else if (argv[0] == "options") { From c6a78295544e7793a64ff87f3a7589f95d2ce7f1 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 20 Aug 2021 13:05:54 +0200 Subject: [PATCH 184/681] Fix #15245: Excitement factors are all listed as 0% --- src/openrct2-ui/windows/Ride.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 352c565272..a1440b29db 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2946,7 +2946,7 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(rideEntry->intensity_multiplier); + ft.Add(rideEntry->excitement_multiplier); DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, ft); } From 6c233ac802bdbdd602af01f6d9eece8b225decb9 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 20:59:32 +0300 Subject: [PATCH 185/681] Remove first overload of PaintAddImageAsParent --- src/openrct2/paint/Paint.cpp | 8 --- src/openrct2/paint/Paint.h | 3 -- src/openrct2/paint/Supports.cpp | 49 ++++++++++--------- .../paint/tile_element/Paint.Path.cpp | 2 +- .../paint/tile_element/Paint.Surface.cpp | 4 +- src/openrct2/ride/TrackPaint.cpp | 14 +++--- .../ride/coaster/JuniorRollerCoaster.cpp | 16 +++--- src/openrct2/ride/coaster/WildMouse.cpp | 13 +++-- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 4 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 2 +- .../ride/thrill/SwingingInverterShip.cpp | 6 +-- src/openrct2/ride/thrill/SwingingShip.cpp | 24 ++++----- src/openrct2/ride/transport/Monorail.cpp | 12 ++--- src/openrct2/ride/water/LogFlume.cpp | 4 +- src/openrct2/ride/water/SplashBoats.cpp | 4 +- 16 files changed, 74 insertions(+), 93 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index f4d9913b37..fdd116504f 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -727,14 +727,6 @@ paint_struct* PaintAddImageAsParent( return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, offset); } -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset) -{ - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }); -} - /** * rct2: 0x00686806, 0x006869B2, 0x00686B6F, 0x00686D31, 0x0098197C * diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 9fbd29d124..6f1c2554eb 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -267,9 +267,6 @@ extern bool gPaintBoundingBoxes; extern bool gPaintBlockedTiles; extern bool gPaintWidePathsAsGhost; -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); paint_struct* PaintAddImageAsParent( diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index d42d93c05e..8f40666645 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -757,8 +757,8 @@ bool wooden_b_supports_paint_setup( if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight) { PaintAddImageAsParent( - session, WoodenSupportImageIds[supportType].half | imageColourFlags, 0, 0, 32, 32, - ((heightSteps == 1) ? 7 : 12), baseHeight); + session, WoodenSupportImageIds[supportType].half | imageColourFlags, { 0, 0, baseHeight }, + { 32, 32, ((heightSteps == 1) ? 7 : 12) }); heightSteps -= 1; baseHeight += 16; _9E32B1 = true; @@ -766,8 +766,8 @@ bool wooden_b_supports_paint_setup( else { PaintAddImageAsParent( - session, WoodenSupportImageIds[supportType].full | imageColourFlags, 0, 0, 32, 32, - ((heightSteps == 2) ? 23 : 28), baseHeight); + session, WoodenSupportImageIds[supportType].full | imageColourFlags, { 0, 0, baseHeight }, + { 32, 32, ((heightSteps == 2) ? 23 : 28) }); heightSteps -= 2; baseHeight += 32; _9E32B1 = true; @@ -1082,8 +1082,9 @@ bool metal_b_supports_paint_setup( PaintAddImageAsParent( session, _metalSupportTypeToCrossbeamImages[supportType][ebp] | imageColourFlags, - SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, - _97B062[ebp].x, _97B062[ebp].y, 1, baseHeight); + { SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, + SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, baseHeight }, + { _97B062[ebp].x, _97B062[ebp].y, 1 }); } int32_t si = baseHeight; @@ -1099,8 +1100,8 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, 5, - supportSegments[segment].height); + session, imageId | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; } @@ -1115,8 +1116,8 @@ bool metal_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, heightDiff - 1, baseHeight); + session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1151,8 +1152,8 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, - beamLength - 1, baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1237,7 +1238,8 @@ bool path_a_supports_paint_setup( if (session->Support.slope & 0x20) { // save dx2 - PaintAddImageAsParent(session, (railingEntry->bridge_image + 48) | imageColourFlags, 0, 0, 32, 32, 0, baseHeight - 2); + PaintAddImageAsParent( + session, (railingEntry->bridge_image + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1287,7 +1289,8 @@ bool path_a_supports_paint_setup( { uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 23; - PaintAddImageAsParent(session, imageId | imageColourFlags, 0, 0, 32, 32, ((heightSteps == 1) ? 7 : 12), baseHeight); + PaintAddImageAsParent( + session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) }); heightSteps -= 1; baseHeight += 16; hasSupports = true; @@ -1297,7 +1300,7 @@ bool path_a_supports_paint_setup( uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 22; PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, 32, 32, ((heightSteps == 2) ? 23 : 28), baseHeight); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) }); heightSteps -= 2; baseHeight += 32; hasSupports = true; @@ -1385,8 +1388,8 @@ bool path_b_supports_paint_setup( baseHeight = supportSegments[segment].height; PaintAddImageAsParent( - session, (railingEntry->bridge_image + 37 + imageOffset) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, 5, baseHeight); + session, (railingEntry->bridge_image + 37 + imageOffset) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1404,8 +1407,8 @@ bool path_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, heightDiff - 1, baseHeight); + session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1437,8 +1440,8 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, SupportBoundBoxes[segment].x, - SupportBoundBoxes[segment].y, 0, 0, (z - 1), baseHeight); + session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, + { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1455,8 +1458,8 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, (z - 1), - baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, (z - 1) }); baseHeight += z; } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 1ce3286ba4..7a4c00666a 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -928,7 +928,7 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } PaintAddImageAsParent( - session, imageId | patrolColour << 19 | IMAGE_TYPE_REMAP, 16, 16, 1, 1, 0, patrolAreaBaseZ + 2); + session, imageId | patrolColour << 19 | IMAGE_TYPE_REMAP, { 16, 16, patrolAreaBaseZ + 2 }, { 1, 1, 0 }); } } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index ee89107d53..fb6f601787 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1037,7 +1037,7 @@ void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, co image_id += get_height_marker_offset(); image_id -= gMapBaseZ; - PaintAddImageAsParent(session, image_id, 16, 16, 1, 1, 0, height); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 1, 1, 0 }); } bool has_surface = false; @@ -1137,7 +1137,7 @@ void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, co { if ((spawn.x & 0xFFE0) == pos.x && (spawn.y & 0xFFE0) == pos.y) { - PaintAddImageAsParent(session, SPR_TERRAIN_SELECTION_SQUARE_SIMPLE, 0, 0, 32, 32, 16, spawn.z); + PaintAddImageAsParent(session, SPR_TERRAIN_SELECTION_SQUARE_SIMPLE, { 0, 0, spawn.z }, { 32, 32, 16 }); const int32_t offset = (direction_reverse(spawn.direction) + rotation) & 3; const uint32_t image_id = (PEEP_SPAWN_ARROW_0 + offset) | 0x20380000; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index bde96b1845..77389bf673 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1501,10 +1501,9 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_3( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; - PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z); + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size); } void track_paint_util_right_quarter_turn_5_tiles_tunnel( @@ -1772,10 +1771,9 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_4( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; - PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z); + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size); } void track_paint_util_right_quarter_turn_3_tiles_tunnel( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 9f86c51f2d..3b21211da5 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2732,13 +2732,11 @@ static void junior_rc_s_bend_left_paint_setup( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 1, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 1 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 1, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 1 }); } if (direction == 0 || direction == 2) @@ -2838,13 +2836,11 @@ static void junior_rc_s_bend_right_paint_setup( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 1, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 1 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 1, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 1 }); } if (direction == 0 || direction == 2) @@ -5643,14 +5639,14 @@ static void junior_rc_booster_paint_setup( if (direction & 1) { PaintAddImageAsParent( - session, SPR_JUNIOR_RC_BOOSTER_NE_SW | session->TrackColours[SCHEME_TRACK], 0, 0, 20, 32, 1, height); + session, SPR_JUNIOR_RC_BOOSTER_NE_SW | session->TrackColours[SCHEME_TRACK], { 0, 0, height }, { 20, 32, 1 }); paint_util_push_tunnel_right(session, height, TUNNEL_0); } else { PaintAddImageAsParent( - session, SPR_JUNIOR_RC_BOOSTER_NW_SE | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height); + session, SPR_JUNIOR_RC_BOOSTER_NW_SE | session->TrackColours[SCHEME_TRACK], { 0, 0, height }, { 32, 20, 1 }); paint_util_push_tunnel_left(session, height, TUNNEL_0); } diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 2549271f94..5f92eb6482 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -591,10 +591,10 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( { int32_t part = trackSequence == 0 ? 0 : 1; const sprite_bb* sbb = &imageIds[direction][part]; + const auto& offset = sbb->offset; PaintAddImageAsParent( - session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], static_cast(sbb->offset.x), - static_cast(sbb->offset.y), sbb->bb_size.x, sbb->bb_size.y, static_cast(sbb->bb_size.z), - height + static_cast(sbb->offset.z)); + session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], { offset.x, offset.y, height + offset.z }, + sbb->bb_size); } track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel( @@ -660,9 +660,8 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( int32_t part = trackSequence == 0 ? 0 : 1; const sprite_bb* sbb = &imageIds[direction][part]; PaintAddImageAsParent( - session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], static_cast(sbb->offset.x), - static_cast(sbb->offset.y), sbb->bb_size.x, sbb->bb_size.y, static_cast(sbb->bb_size.z), - height + static_cast(sbb->offset.z)); + session, sbb->sprite_id | session->TrackColours[SCHEME_TRACK], + { sbb->offset.x, sbb->offset.y, height + sbb->offset.z }, sbb->bb_size); } track_paint_util_right_quarter_turn_3_tiles_25_deg_up_tunnel(session, height, direction, trackSequence, TUNNEL_1, TUNNEL_2); @@ -736,7 +735,7 @@ static void wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, 0, 0, 26, 24, 2, height, 6, 2, height); break; case 1: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 26, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 2 }); break; case 2: PaintAddImageAsParent(session, imageId, 0, 0, 24, 26, 2, height, 2, 6, height); diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index dc54c46659..9887a15241 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -573,13 +573,13 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, 6, 0, 26, 24, 1, height, 6, 2, height); break; case 1: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 26, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 1 }); break; case 2: PaintAddImageAsParent(session, imageId, 0, 6, 24, 26, 1, height, 2, 6, height); break; case 3: - PaintAddImageAsParent(session, imageId, 6, 6, 24, 24, 1, height); + PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); break; } wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 1860010dbe..024dd0c15f 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -31,7 +31,7 @@ static constexpr const uint32_t dodgems_fence_sprites[] = { SPR_DODGEMS_FENCE_TO static void paint_dodgems_roof(paint_session* session, int32_t height, int32_t offset) { uint32_t image_id = (SPR_DODGEMS_ROOF_FRAME + offset) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 0, 0, 32, 32, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 32, 2 }); image_id = (SPR_DODGEMS_ROOF_GLASS + offset) | (EnumValue(FilterPaletteID::PaletteDarken3) << 19) | IMAGE_TYPE_TRANSPARENT; PaintAttachToPreviousPS(session, image_id, 0, 0); diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 3e717b963d..2504d31723 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -241,7 +241,7 @@ static void paint_magic_carpet( } uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); break; } diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 7e543f57b0..e8ef655a0d 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -143,17 +143,17 @@ static void paint_swinging_inverter_ship( } imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); switch (direction) { case 0: imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 24, 32, 8, 1, height + 9); + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); break; case 1: imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 24, 0, 8, 32, 1, height + 9); + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); break; case 2: imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 94d0a48909..ebc1cb3a7c 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -194,7 +194,7 @@ static void paint_swinging_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); imageId = SPR_STATION_BASE_A_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } else { @@ -202,7 +202,7 @@ static void paint_swinging_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); imageId = SPR_STATION_BASE_A_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -226,7 +226,7 @@ static void paint_swinging_ship( imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 24, 0, 8, 32, 1, height + 9); + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 3) @@ -234,21 +234,21 @@ static void paint_swinging_ship( if (hasFence) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 32, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } else { imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 23, 31, 8, 1, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 23, 31, height + 11 }, { 8, 1, 7 }); } imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 8, 1, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 8, 1, 7 }); } else if (hasFence) { imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 32, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } } } @@ -271,7 +271,7 @@ static void paint_swinging_ship( imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 24, 32, 8, 1, height + 9); + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); if (relativeTrackSequence == 3) @@ -279,21 +279,21 @@ static void paint_swinging_ship( if (hasFence) { imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 32, 1, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } else { imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 23, 1, 8, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 31, 23, height + 11 }, { 1, 8, 7 }); } imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 31, 0, 1, 8, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 8, 7 }); } else if (hasFence) { imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 31, 32, 1, 7, height + 11); + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } } } diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 27c1e858b3..ab49c14d16 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -765,13 +765,11 @@ static void paint_monorail_track_s_bend_left( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 3, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 3 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 3, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 3 }); } if (direction == 0 || direction == 2) @@ -871,13 +869,11 @@ static void paint_monorail_track_s_bend_right( CoordsXY bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { - PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, 3, height); + PaintAddImageAsParent(session, imageId, { offset.x, offset.y, height }, { bounds.x, bounds.y, 3 }); } else { - PaintAddImageAsParent( - session, imageId, static_cast(offset.y), static_cast(offset.x), bounds.y, bounds.x, 3, height); + PaintAddImageAsParent(session, imageId, { offset.y, offset.x, height }, { bounds.y, bounds.x, 3 }); } if (direction == 0 || direction == 2) diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 0d73303c22..94130ba46f 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -196,7 +196,7 @@ static void paint_log_flume_track_station( { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; } - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); if (direction & 1) { @@ -755,7 +755,7 @@ static void paint_log_flume_track_on_ride_photo( const TrackElement& trackElement) { uint32_t imageId = SPR_STATION_BASE_D | IMAGE_TYPE_REMAP; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); if (direction & 1) { diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index e85581cb5d..fae611eba4 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -793,7 +793,7 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height + 3); imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } else { @@ -802,7 +802,7 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); From 7feea62ab344b63ea94aa407705946c7fc418ce5 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 21:45:25 +0300 Subject: [PATCH 186/681] Remove overload of PaintAddImageAsParent with bbox offset --- src/openrct2/paint/Paint.cpp | 10 -- src/openrct2/paint/Paint.h | 4 - src/openrct2/paint/PaintHelpers.cpp | 8 +- src/openrct2/paint/Supports.cpp | 29 ++-- src/openrct2/paint/sprite/Paint.Litter.cpp | 2 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- .../paint/tile_element/Paint.Banner.cpp | 6 +- .../paint/tile_element/Paint.Entrance.cpp | 13 +- .../paint/tile_element/Paint.LargeScenery.cpp | 3 +- .../paint/tile_element/Paint.Path.cpp | 36 ++--- .../paint/tile_element/Paint.SmallScenery.cpp | 8 +- .../paint/tile_element/Paint.Wall.cpp | 20 +-- src/openrct2/ride/TrackPaint.cpp | 56 +++---- src/openrct2/ride/VehiclePaint.cpp | 5 +- .../ride/coaster/JuniorRollerCoaster.cpp | 143 ++++++++++-------- .../ride/coaster/ReverseFreefallCoaster.cpp | 12 +- src/openrct2/ride/coaster/VirginiaReel.cpp | 27 ++-- src/openrct2/ride/coaster/WildMouse.cpp | 6 +- .../ride/coaster/WoodenRollerCoaster.cpp | 5 +- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 4 +- src/openrct2/ride/gentle/Circus.cpp | 3 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 4 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 8 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 4 +- src/openrct2/ride/gentle/MiniGolf.cpp | 41 ++--- src/openrct2/ride/gentle/MiniHelicopters.cpp | 32 ++-- src/openrct2/ride/gentle/MonorailCycles.cpp | 12 +- src/openrct2/ride/gentle/ObservationTower.cpp | 14 +- src/openrct2/ride/gentle/SpaceRings.cpp | 6 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 18 +-- src/openrct2/ride/shops/Facility.cpp | 11 +- src/openrct2/ride/shops/Shop.cpp | 4 +- src/openrct2/ride/thrill/3dCinema.cpp | 3 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 14 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 4 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 24 ++- src/openrct2/ride/thrill/RotoDrop.cpp | 14 +- .../ride/thrill/SwingingInverterShip.cpp | 8 +- src/openrct2/ride/thrill/SwingingShip.cpp | 4 +- src/openrct2/ride/thrill/Twist.cpp | 7 +- src/openrct2/ride/transport/Lift.cpp | 6 +- .../ride/transport/MiniatureRailway.cpp | 76 +++++----- src/openrct2/ride/transport/Monorail.cpp | 22 +-- src/openrct2/ride/water/RiverRapids.cpp | 3 +- src/openrct2/ride/water/SplashBoats.cpp | 12 +- src/openrct2/ride/water/SubmarineRide.cpp | 13 +- 48 files changed, 404 insertions(+), 366 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index fdd116504f..63508d5eba 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -761,16 +761,6 @@ paint_struct* PaintAddImageAsParent( return ps; } -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z) -{ - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, - { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); -} - /** * * rct2: 0x00686EF0, 0x00687056, 0x006871C8, 0x0068733C, 0x0098198C diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 6f1c2554eb..83db6e3c7b 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -269,10 +269,6 @@ extern bool gPaintWidePathsAsGhost; paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); -paint_struct* PaintAddImageAsParent( - paint_session* session, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsParent( paint_session* session, uint32_t image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index bc934fc77e..994c306c57 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -37,14 +37,14 @@ paint_struct* PaintAddImageAsParentRotated( if (direction & 1) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } else { return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } } diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 8f40666645..38336abb3e 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -607,8 +607,8 @@ bool wooden_a_supports_paint_setup( if (byte_97B23C[special].var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId, 0, 0, bBox.length.x, bBox.length.y, bBox.length.z, z, bBox.offset.x, bBox.offset.y, - bBox.offset.z + z); + session, imageId, { 0, 0, z }, { bBox.length.x, bBox.length.y, bBox.length.z }, + { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); hasSupports = true; } else @@ -701,7 +701,8 @@ bool wooden_b_supports_paint_setup( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; - PaintAddImageAsParent(session, (imageId + 4) | imageColourFlags, 0, 0, 32, 32, 3, baseHeight, 0, 0, baseHeight + 2); + PaintAddImageAsParent( + session, (imageId + 4) | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 3 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; _9E32B1 = true; @@ -792,8 +793,9 @@ bool wooden_b_supports_paint_setup( if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, boundBox.length.x, boundBox.length.y, boundBox.length.z, - baseHeight, boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, + { boundBox.length.x, boundBox.length.y, boundBox.length.z }, + { boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight }); _9E32B1 = true; } else @@ -1182,8 +1184,9 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].beam_id + (beamLength - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, - 0, 0, 0, baseHeight, SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height); + session, imageId | imageColourFlags, + { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height }); baseHeight += beamLength; } } @@ -1259,7 +1262,8 @@ bool path_a_supports_paint_setup( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; - PaintAddImageAsParent(session, (imageId + 4) | imageColourFlags, 0, 0, 32, 32, 11, baseHeight, 0, 0, baseHeight + 2); + PaintAddImageAsParent( + session, (imageId + 4) | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); baseHeight += 16; hasSupports = true; @@ -1319,8 +1323,9 @@ bool path_a_supports_paint_setup( if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, 0, 0, boundBox.length.y, boundBox.length.x, boundBox.length.z, baseHeight, - boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z); + session, imageId | imageColourFlags, { 0, 0, baseHeight }, + { boundBox.length.y, boundBox.length.x, boundBox.length.z }, + { boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z }); hasSupports = true; } else @@ -1488,8 +1493,8 @@ bool path_b_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, 0, 0, 0, - baseHeight, SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, + { 0, 0, 0 }, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }); baseHeight += z; } diff --git a/src/openrct2/paint/sprite/Paint.Litter.cpp b/src/openrct2/paint/sprite/Paint.Litter.cpp index e0fc132747..b06495eebc 100644 --- a/src/openrct2/paint/sprite/Paint.Litter.cpp +++ b/src/openrct2/paint/sprite/Paint.Litter.cpp @@ -83,5 +83,5 @@ template<> void PaintEntity(paint_session* session, const Litter* litter, int32_ // In the following call to PaintAddImageAsParent, we add 4 (instead of 2) to the // bound_box_offset_z to make sure litter is drawn on top of railways - PaintAddImageAsParent(session, image_id, 0, 0, 4, 4, -1, litter->z, -4, -4, litter->z + 4); + PaintAddImageAsParent(session, image_id, { 0, 0, litter->z }, { 4, 4, -1 }, { -4, -4, litter->z + 4 }); } diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 804e6f5026..7083f70fd2 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -80,7 +80,7 @@ template<> void PaintEntity(paint_session* session, const Peep* peep, int32_t im + imageOffset * 4; uint32_t imageId = baseImageId | peep->TshirtColour << 19 | peep->TrousersColour << 24 | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 5); + PaintAddImageAsParent(session, imageId, { 0, 0, peep->z }, { 1, 1, 11 }, { 0, 0, peep->z + 5 }); auto* guest = peep->As(); if (guest != nullptr) { diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index a3b6946732..44cd06cdd7 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -78,12 +78,14 @@ void PaintBanner(paint_session* session, uint8_t direction, int32_t height, cons image_id |= (banner->colour << 19) | IMAGE_TYPE_REMAP; } - PaintAddImageAsParent(session, image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z); + PaintAddImageAsParent( + session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); boundBoxOffset.x = BannerBoundBoxes[direction][1].x; boundBoxOffset.y = BannerBoundBoxes[direction][1].y; image_id++; - PaintAddImageAsParent(session, image_id, 0, 0, 1, 1, 0x15, height, boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z); + PaintAddImageAsParent( + session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); // Opposite direction direction = direction_reverse(direction); diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 7db9c608ae..42b672386b 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -129,7 +129,7 @@ static void ride_entrance_exit_paint( int16_t lengthY = (direction & 1) ? 28 : 2; int16_t lengthX = (direction & 1) ? 2 : 28; - PaintAddImageAsParent(session, image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { lengthX, lengthY, ah }, { 2, 2, height }); if (transparant_image_id) { @@ -148,7 +148,8 @@ static void ride_entrance_exit_paint( image_id += 4; PaintAddImageAsParent( - session, image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); + session, image_id, { 0, 0, height }, { lengthX, lengthY, ah }, + { (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height }); if (transparant_image_id) { @@ -260,7 +261,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 if (path_entry != nullptr) { image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 0x1C, 0 }, { 0, 2, height }); } entrance = static_cast(object_entry_get_chunk(ObjectType::ParkEntrance, 0)); @@ -269,7 +270,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 return; } image_id = (entrance->image_id + direction * 3) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 0x1C, 0x1C, 0x2F }, { 2, 2, height + 32 }); if ((direction + 1) & (1 << 1)) break; @@ -322,7 +323,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 return; } image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; - PaintAddImageAsParent(session, image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 0x1A, di, 0x4F }, { 3, 3, height }); break; } @@ -353,7 +354,7 @@ void PaintEntrance(paint_session* session, uint8_t direction, int32_t height, co uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16); image_id -= gMapBaseZ; - PaintAddImageAsParent(session, image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 1, 1, 0 }, { 31, 31, z + 64 }); } } diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 53f97ed098..88e21ec6b8 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -290,7 +290,8 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh boxlength.y = s98E3C4[esi].length.y; boxlength.z = boxlengthZ; PaintAddImageAsParent( - session, image_id, 0, 0, boxlength.x, boxlength.y, boxlengthZ, height, boxoffset.x, boxoffset.y, boxoffset.z); + session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, + { boxoffset.x, boxoffset.y, boxoffset.z }); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 7a4c00666a..7138dd62b5 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -370,8 +370,8 @@ static void sub_6A4101( case 3: PaintAddImageAsParent(session, 17 + base_image_id, { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( - session, 18 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, - height + 2); // bound_box_offset_y seems to be a bug + session, 18 + base_image_id, { 28, 0, height }, { 1, 28, 7 }, + { 28, 4, height + 2 }); // bound_box_offset_y seems to be a bug PaintAddImageAsParent(session, 25 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 0, 28, height + 2 }); break; case 4: @@ -403,8 +403,8 @@ static void sub_6A4101( case 12: PaintAddImageAsParent(session, 16 + base_image_id, { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( - session, 19 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, - height + 2); // bound_box_offset_x seems to be a bug + session, 19 + base_image_id, { 0, 28, height }, { 28, 1, 7 }, + { 4, 28, height + 2 }); // bound_box_offset_x seems to be a bug PaintAddImageAsParent(session, 27 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 28, 0, height + 2 }); break; default: @@ -435,14 +435,14 @@ static void sub_6A4101( // Draw pole in the back PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z); + session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); // Draw pole in the front and banner boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; boundBoxOffsets.y = BannerBoundBoxes[direction][1].y; imageId++; PaintAddImageAsParent( - session, imageId, 0, 0, 1, 1, 21, height, boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z); + session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); direction--; // If text shown @@ -559,8 +559,8 @@ static void sub_6A4101( case 3: PaintAddImageAsParent(session, 3 + base_image_id, { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( - session, 4 + base_image_id, 28, 0, 1, 28, 7, height, 28, 4, - height + 2); // bound_box_offset_y seems to be a bug + session, 4 + base_image_id, { 28, 0, height }, { 1, 28, 7 }, + { 28, 4, height + 2 }); // bound_box_offset_y seems to be a bug if (!(drawnCorners & FOOTPATH_CORNER_0)) { PaintAddImageAsParent(session, 11 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 0, 28, height + 2 }); @@ -585,8 +585,8 @@ static void sub_6A4101( case 12: PaintAddImageAsParent(session, 2 + base_image_id, { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( - session, 5 + base_image_id, 0, 28, 28, 1, 7, height, 4, 28, - height + 2); // bound_box_offset_x seems to be a bug + session, 5 + base_image_id, { 0, 28, height }, { 28, 1, 7 }, + { 4, 28, height + 2 }); // bound_box_offset_x seems to be a bug if (!(drawnCorners & FOOTPATH_CORNER_2)) { PaintAddImageAsParent(session, 13 + base_image_id, { 0, 0, height }, { 4, 4, 7 }, { 28, 0, height + 2 }); @@ -1047,8 +1047,8 @@ void path_paint_box_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); } else { @@ -1064,8 +1064,8 @@ void path_paint_box_support( } PaintAddImageAsParent( - session, image_id | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) @@ -1194,8 +1194,8 @@ void path_paint_pole_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, - height + boundingBoxZOffset); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); } else { @@ -1213,8 +1213,8 @@ void path_paint_pole_support( } PaintAddImageAsParent( - session, bridgeImage | imageFlags, 0, 0, boundBoxSize.x, boundBoxSize.y, 0, height, boundBoxOffset.x, - boundBoxOffset.y, height + boundingBoxZOffset); + session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 7deaac180d..3de63b9e8d 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -159,8 +159,8 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) { PaintAddImageAsParent( - session, baseImageid, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, - boxoffset.y, boxoffset.z); + session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, + { boxoffset.x, boxoffset.y, boxoffset.z }); } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) @@ -326,8 +326,8 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) { PaintAddImageAsParent( - session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, - boxoffset.y, boxoffset.z); + session, image_id, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, + { boxoffset.x, boxoffset.y, boxoffset.z }); } else { diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 49ab6dcc09..4bced75a05 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -60,16 +60,16 @@ static void PaintWallDoor( paint_struct* ps; ps = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsR1.x, boundsR1.y, - static_cast(boundsR1.z), offset.z, boundsR1_.x, boundsR1_.y, boundsR1_.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsR1.x, boundsR1.y, static_cast(boundsR1.z) }, { boundsR1_.x, boundsR1_.y, boundsR1_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; } ps = PaintAddImageAsParent( - session, imageId + 1, static_cast(offset.x), static_cast(offset.y), boundsR2.x, boundsR2.y, - static_cast(boundsR2.z), offset.z, boundsR2_.x, boundsR2_.y, boundsR2_.z); + session, imageId + 1, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsR2.x, boundsR2.y, static_cast(boundsR2.z) }, { boundsR2_.x, boundsR2_.y, boundsR2_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -80,8 +80,8 @@ static void PaintWallDoor( paint_struct* ps; ps = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsL1.x, boundsL1.y, - static_cast(boundsL1.z), offset.z, boundsL1_.x, boundsL1_.y, boundsL1_.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { boundsL1.x, boundsL1.y, static_cast(boundsL1.z) }, { boundsL1_.x, boundsL1_.y, boundsL1_.z }); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -118,8 +118,8 @@ static void PaintWallWall( } PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); if (dword_141F710 == 0) { imageId = baseImageId + dword_141F718; @@ -141,8 +141,8 @@ static void PaintWallWall( } paint_struct* paint = PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); if (paint != nullptr) { paint->tertiary_colour = tertiaryColour; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 77389bf673..52b33096c5 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -830,8 +830,8 @@ bool track_paint_util_draw_station_covers_2( { imageId = (baseImageId & ~IMAGE_TYPE_TRANSPARENT) + imageOffset; PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); uint32_t edi = session->TrackColours[SCHEME_TRACK] & (0b11111 << 19); @@ -845,8 +845,8 @@ bool track_paint_util_draw_station_covers_2( imageId = (baseImageId + imageOffset) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bounds.x, bounds.y, - static_cast(bounds.z), offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); return true; } @@ -1036,8 +1036,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1047,8 +1047,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1134,8 +1134,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1145,8 +1145,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1305,8 +1305,9 @@ void track_paint_util_eighth_to_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness[direction][index], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness[direction][index] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } constexpr CoordsXY defaultDiagTileOffsets[4] = { @@ -1346,8 +1347,8 @@ void track_paint_util_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { @@ -1468,8 +1469,8 @@ void track_paint_util_right_quarter_turn_5_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -1485,9 +1486,10 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( const sprite_bb* spriteBB = &sprites[direction][sprite]; uint32_t imageId = spriteBB->sprite_id | colourFlags; PaintAddImageAsParent( - session, imageId, static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->bb_size.x, - spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z), height + spriteBB->offset.z, spriteBB->bb_offset.x, - spriteBB->bb_offset.y, height + spriteBB->bb_offset.z); + session, imageId, + { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), height + spriteBB->offset.z }, + { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, + { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_3( @@ -1643,8 +1645,8 @@ void track_paint_util_right_quarter_turn_3_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, - thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_2( @@ -1754,10 +1756,10 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_3( } const sprite_bb* spriteBB = &sprites[direction][sprite]; PaintAddImageAsParent( - session, spriteBB->sprite_id | colourFlags, static_cast(spriteBB->offset.x), - static_cast(spriteBB->offset.y), spriteBB->bb_size.x, spriteBB->bb_size.y, - static_cast(spriteBB->bb_size.z), spriteBB->offset.z + height, spriteBB->bb_offset.x, spriteBB->bb_offset.y, - height + spriteBB->bb_offset.z); + session, spriteBB->sprite_id | colourFlags, + { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->offset.z + height }, + { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, + { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_4( diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index cd9ddfa79f..64f8c128a6 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -918,7 +918,8 @@ static void vehicle_sprite_paint( image_id |= CONSTRUCTION_MARKER; } paint_struct* ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, bb.length_z }, + { bb.offset_x, bb.offset_y, bb.offset_z + z }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -3144,7 +3145,7 @@ template<> void PaintEntity(paint_session* session, const Vehicle* vehicle, int3 if (vehicle->IsCrashedVehicle) { uint32_t ebx = 22965 + vehicle->animation_frame; - PaintAddImageAsParent(session, ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2); + PaintAddImageAsParent(session, ebx, { 0, 0, z }, { 1, 1, 0 }, { 0, 0, z + 2 }); return; } diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 3b21211da5..7203e411fc 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2467,9 +2467,10 @@ static void junior_rc_left_bank_paint_setup( image_id = junior_rc_track_pieces_left_bank[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, image_id, 0, 0, junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, - static_cast(junior_rc_left_bank_bound_lengths[direction].z), height, - junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height); + session, image_id, { 0, 0, height }, + { junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, + static_cast(junior_rc_left_bank_bound_lengths[direction].z) }, + { junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height }); if (direction & 1) { @@ -3085,8 +3086,8 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( } if (imageId != 0) PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); if (direction == 0 && trackSequence == 0) { @@ -3164,8 +3165,8 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( } if (imageId != 0) PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), boundsLength.x, boundsLength.y, 1, - height, boundsOffset.x, boundsOffset.y, height); + session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, + { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); if (direction == 0 && trackSequence == 0) { @@ -4958,10 +4959,12 @@ void junior_rc_paint_track_60_deg_up( image_id |= junior_rc_track_pieces_60_deg_up[EnumValue(chainType)][direction]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), junior_rc_60_deg_up_bound_lengths[direction].x, - junior_rc_60_deg_up_bound_lengths[direction].y, junior_rc_60_deg_up_bound_thickness[direction], height, - junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_60_deg_up_bound_lengths[direction].x, junior_rc_60_deg_up_bound_lengths[direction].y, + junior_rc_60_deg_up_bound_thickness[direction] }, + { junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height }); switch (direction) { @@ -5034,13 +5037,14 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5049,13 +5053,14 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5113,13 +5118,14 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5128,13 +5134,14 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction], height, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), + static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5254,7 +5261,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( session, junior_rc_track_pieces_diag_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK], - -16, -16, 16, 16, 1, height, 0, 0, height); + { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); } else { @@ -5286,7 +5293,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( session, junior_rc_track_pieces_diag_25_deg_down_to_60_deg_down[EnumValue(chainType)][direction] | session->TrackColours[SCHEME_TRACK], - -16, -16, 16, 16, 1, height, 0, 0, height); + { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); } else { @@ -5430,12 +5437,13 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction], height + 24, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height); + session, image_id, + { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), + static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, + height }); if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) { @@ -5444,12 +5452,14 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, junior_rc_flat_to_60_deg_up_bound_thickness[direction], - height, junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), + static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) @@ -5499,12 +5509,13 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction], height + 24, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height); + session, image_id, + { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), + static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, + height }); if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) { @@ -5513,12 +5524,14 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, junior_rc_flat_to_60_deg_up_bound_thickness[direction], - height, junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height); + session, image_id, + { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), + static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, + junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, + junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); } switch (direction) diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 91595189b6..8487a3aba5 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -202,13 +202,13 @@ static void paint_reverse_freefall_rc_flat( if (direction & 1) { uint32_t imageId = SPR_REVERSE_FREEFALL_RC_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } else { uint32_t imageId = SPR_REVERSE_FREEFALL_RC_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } @@ -227,7 +227,7 @@ static void paint_reverse_freefall_rc_station( { // height -= 2 (height - 2) imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); // height += 2 (height) imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; @@ -241,7 +241,7 @@ static void paint_reverse_freefall_rc_station( { // height -= 2 (height - 2) imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); // height += 2 (height) imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; @@ -323,7 +323,7 @@ static void paint_reverse_freefall_rc_slope( { floorImageId = SPR_FLOOR_PLANKS | session->TrackColours[SCHEME_SUPPORTS]; } - PaintAddImageAsParent(session, floorImageId, 0, 0, 26, 26, 126, height, 3, 3, height); + PaintAddImageAsParent(session, floorImageId, { 0, 0, height }, { 26, 26, 126 }, { 3, 3, height }); PaintAddImageAsChildRotated( session, direction, supportsImageId, 0, 0, isDirection03 ? 26 : 18, 26, 126, height, isDirection03 ? 3 : 11, 3, height); @@ -365,7 +365,7 @@ static void paint_reverse_freefall_rc_vertical( case 0: supportsImageId = reverse_freefall_rc_track_pieces_vertical_supports[direction] | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, supportsImageId, 0, 0, 26, 26, 79, height, 3, 3, height); + PaintAddImageAsParent(session, supportsImageId, { 0, 0, height }, { 26, 26, 79 }, { 3, 3, height }); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 80, 0x20); break; diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index a503b317d6..ab308cd268 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -182,7 +182,8 @@ void vehicle_visual_virginia_reel( image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER; } PaintAddImageAsParent( - session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z); + session, image_id, { 0, 0, z }, { bb->length_x, bb->length_y, bb->length_z }, + { bb->offset_x, bb->offset_y, bb->offset_z + z }); if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -221,12 +222,12 @@ static void paint_virginia_reel_track_flat( uint32_t imageId = sprites[direction] | session->TrackColours[SCHEME_TRACK]; if (direction & 1) { - PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } else { - PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } @@ -252,11 +253,11 @@ static void paint_virginia_reel_track_25_deg_up( if (direction & 1) { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); } else { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); } if (direction == 1 || direction == 2) @@ -304,27 +305,27 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); session->WoodenSupportsPrependTo = ps; wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); break; case 2: - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); session->WoodenSupportsPrependTo = ps; wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); break; case 3: - PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); @@ -351,11 +352,11 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( if (direction & 1) { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); } else { - ps = PaintAddImageAsParent(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); } if (direction == 1 || direction == 2) @@ -421,7 +422,7 @@ static void paint_virginia_reel_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); imageId = SPR_VIRGINIA_REEL_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 2, height, 0, 0, height); @@ -431,7 +432,7 @@ static void paint_virginia_reel_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); imageId = SPR_VIRGINIA_REEL_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 2, height, 0, 0, height); diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 5f92eb6482..f93c77ea05 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -732,16 +732,16 @@ static void wild_mouse_track_left_quarter_turn_1( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 0, 0, 26, 24, 2, height, 6, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 24, 2 }, { 6, 2, height }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 2 }); break; case 2: - PaintAddImageAsParent(session, imageId, 0, 0, 24, 26, 2, height, 2, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 26, 2 }, { 2, 6, height }); break; case 3: - PaintAddImageAsParent(session, imageId, 0, 0, 24, 24, 2, height, 6, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 24, 2 }, { 6, 6, height }); break; } metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session->TrackColours[SCHEME_SUPPORTS]); diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index e86761c50f..b3f6b94017 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -428,8 +428,9 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* uint32_t railsImageId = bb->sprite_id_b | wooden_rc_get_rails_colour(session); PaintAddImageAsParent( - session, imageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, - static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z); + session, imageId, { static_cast(bb->offset.x), static_cast(bb->offset.y), height + bb->offset.z }, + { bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z) }, + { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); PaintAddImageAsChild( session, railsImageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index 9887a15241..282fb7bace 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -570,13 +570,13 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, 6, 0, 26, 24, 1, height, 6, 2, height); + PaintAddImageAsParent(session, imageId, { 6, 0, height }, { 26, 24, 1 }, { 6, 2, height }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 1 }); break; case 2: - PaintAddImageAsParent(session, imageId, 0, 6, 24, 26, 1, height, 2, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 24, 26, 1 }, { 2, 6, height }); break; case 3: PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index f0896c57c1..00ae90a9ed 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -43,7 +43,8 @@ static void paint_circus_tent( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim); } - PaintAddImageAsParent(session, imageId | imageColourFlags, al, cl, 24, 24, 47, height + 3, al + 16, cl + 16, height + 3); + PaintAddImageAsParent( + session, imageId | imageColourFlags, { al, cl, height + 3 }, { 24, 24, 47 }, { al + 16, cl + 16, height + 3 }); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index e8a8ff47e9..32286cb425 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -58,8 +58,8 @@ static void paint_crooked_house_structure( rct_crooked_house_bound_box boundBox = crooked_house_data[segment]; PaintAddImageAsParent( - session, image_id, x_offset, y_offset, boundBox.length_x, boundBox.length_y, 127, height + 3, boundBox.offset_x, - boundBox.offset_y, height + 3); + session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height + 3 }); } static void paint_crooked_house( diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 024dd0c15f..98c4069b18 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -48,7 +48,7 @@ static void paint_dodgems( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 30, 30, 1, height, 1, 1, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index a52c950285..9e2b3b5005 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -93,8 +93,8 @@ static void paint_ferris_wheel_structure( imageId = (22150 + (direction & 1) * 2) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); imageId = (baseImageId + direction * 8 + imageOffset) | imageColourFlags; PaintAddImageAsChild( @@ -175,12 +175,12 @@ static void paint_ferris_wheel( { // Bound box is slightly different from track_paint_util_paint_fences imageId = SPR_FENCE_ROPE_SE | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); } if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, rotation)) { imageId = SPR_FENCE_ROPE_SW | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 32, 7, height, 30, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 30, 0, height + 2 }); } } diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 5a6d221340..0a6c80e1c3 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -58,8 +58,8 @@ static void paint_haunted_house_structure( uint32_t imageId = (baseImageId + direction) | session->TrackColours[SCHEME_MISC]; haunted_house_bound_box boundBox = haunted_house_data[part]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); rct_drawpixelinfo* dpi = &session->DPI; if (dpi->zoom_level <= 0 && frameNum != 0) diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index c11a967c34..88cadb74d8 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -451,13 +451,13 @@ static paint_struct* mini_golf_paint_util_7c( if (direction & 1) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } static bool mini_golf_paint_util_should_draw_fence(paint_session* session, const TrackElement& trackElement) @@ -691,7 +691,7 @@ static void paint_mini_golf_station( if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, -10, 0, 1, 32, 7, height, 0, 0, height + 2); + PaintAddImageAsParent(session, imageId, { -10, 0, height }, { 1, 32, 7 }, { 0, 0, height + 2 }); } bool hasSWFence = track_paint_util_has_fence( @@ -714,7 +714,7 @@ static void paint_mini_golf_station( if (hasFence) { imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, -10, 32, 1, 7, height, 0, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, -10, height }, { 32, 1, 7 }, { 0, 0, height + 2 }); } bool hasSEFence = track_paint_util_has_fence( @@ -859,13 +859,13 @@ static void paint_mini_golf_hole_ab( imageId = sprites[direction][trackSequence][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); if (drewSupports) { imageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = sprites[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -875,7 +875,7 @@ static void paint_mini_golf_hole_ab( { imageId = sprites[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -943,7 +943,8 @@ static void paint_mini_golf_hole_c( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -951,7 +952,7 @@ static void paint_mini_golf_hole_c( { imageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -961,7 +962,7 @@ static void paint_mini_golf_hole_c( { imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1026,7 +1027,8 @@ static void paint_mini_golf_hole_d( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -1044,7 +1046,7 @@ static void paint_mini_golf_hole_d( { imageId = ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -1054,7 +1056,7 @@ static void paint_mini_golf_hole_d( { imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1119,7 +1121,8 @@ static void paint_mini_golf_hole_e( break; default: PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, + { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); break; } @@ -1137,7 +1140,7 @@ static void paint_mini_golf_hole_e( { imageId = ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( @@ -1147,7 +1150,7 @@ static void paint_mini_golf_hole_e( { imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height); + session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); } } @@ -1239,7 +1242,7 @@ void vehicle_visual_mini_golf_player( uint32_t image_id = rideEntry->vehicles[0].base_image_id + 1 + ebx; uint32_t peep_palette = peep->TshirtColour << 19 | peep->TrousersColour << 24 | 0x0A0000000; - PaintAddImageAsParent(session, image_id | peep_palette, 0, 0, 1, 1, 11, z, 0, 0, z + 5); + PaintAddImageAsParent(session, image_id | peep_palette, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); } /** diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 6012898d68..f98551127d 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -26,7 +26,7 @@ static void paint_mini_helicopters_track_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 1, height, 0, 0, height); @@ -38,7 +38,7 @@ static void paint_mini_helicopters_track_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 1, height, 0, 0, height); @@ -64,13 +64,13 @@ static void paint_mini_helicopters_track_flat( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_0); } @@ -97,22 +97,22 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_2); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height, TUNNEL_2); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height, TUNNEL_0); break; } @@ -138,22 +138,22 @@ static void paint_mini_helicopters_track_25_deg_up( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); break; } @@ -179,22 +179,22 @@ static void paint_mini_helicopters_track_25_deg_up_to_flat( { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height + 8, TUNNEL_12); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); paint_util_push_tunnel_left(session, height + 8, TUNNEL_12); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); break; } diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 6682ad9d8a..5183ec0f20 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -153,13 +153,13 @@ static paint_struct* paint_monorail_cycles_util_7c( if (flip) { return PaintAddImageAsParent( - session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, - bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); + session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, + { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } return PaintAddImageAsParent( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } /** rct2: 0x0088AD48 */ @@ -199,7 +199,7 @@ static void paint_monorail_cycles_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 1, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = SPR_MONORAIL_CYCLES_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 1, height, 0, 0, height); @@ -211,7 +211,7 @@ static void paint_monorail_cycles_station( else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 1, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = SPR_MONORAIL_CYCLES_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 1, height, 0, 0, height); diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index 1c1a74da4a..e530d90549 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -65,7 +65,7 @@ void vehicle_visual_observation_tower( { image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER; } - paint_struct* ps = PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + paint_struct* ps = PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -73,7 +73,7 @@ void vehicle_visual_observation_tower( image_id++; - ps = PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + ps = PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -95,7 +95,7 @@ static void paint_observation_tower_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -107,13 +107,13 @@ static void paint_observation_tower_base( if (trackSequence == 0) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 32 }, { 2, 2, 30 }, { 8, 8, height + 32 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { 2, 2, 30 }, { 8, 8, height + 64 }); paint_util_set_vertical_tunnel(session, height + 96); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -170,7 +170,7 @@ static void paint_observation_tower_section( } uint32_t imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 5c1b6fc94c..e2dc0c6849 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -67,7 +67,7 @@ static void paint_space_rings_structure( } uint32_t imageId = (baseImageId + frameNum) | imageColourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 20, 23, height, -10, -10, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 20, 23 }, { -10, -10, height }); if (vehicle != nullptr && vehicle->num_peeps > 0) { @@ -111,12 +111,12 @@ static void paint_space_rings( if (track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SW | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 29, 0, height + 2 }); } if (track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, session->CurrentRotation)) { imageId = SPR_SPACE_RINGS_FENCE_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 2); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 2 }); } break; default: diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 7ee8c220be..46ac648aa4 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -60,7 +60,7 @@ static void spiral_slide_paint_tile_right( if (direction == 3) image_id = SPIRAL_SLIDE_RIGHT_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 16, 108, height, 16, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 16, 108 }, { 16, 0, height + 3 }); } static void spiral_slide_paint_tile_left( @@ -78,7 +78,7 @@ static void spiral_slide_paint_tile_left( if (direction == 3) image_id = SPIRAL_SLIDE_LEFT_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 16, 108, height, 0, 16, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 16, 108 }, { 0, 16, height + 3 }); } static void spiral_slide_paint_tile_front( @@ -93,33 +93,33 @@ static void spiral_slide_paint_tile_front( if (direction == 1) { image_id = SPIRAL_SLIDE_INSIDE_R1 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 2, 16, 108, height, -12, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 2, 16, 108 }, { -12, 0, height + 3 }); } else if (direction == 2) { image_id = SPIRAL_SLIDE_INSIDE_R2 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 2, 108, height, 0, -12, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 2, 108 }, { 0, -12, height + 3 }); } if (direction == 0) { image_id = SPIRAL_SLIDE_CENTRE_R0 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 8, 108, height, 0, 8, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 8, 108 }, { 0, 8, height + 3 }); } else if (direction == 1) { image_id = SPIRAL_SLIDE_CENTRE_R1 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 2, 16, 108, height, 14, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 2, 16, 108 }, { 14, 0, height + 3 }); } else if (direction == 2) { image_id = SPIRAL_SLIDE_CENTRE_R2 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 16, 2, 108, height, 0, 14, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 16, 2, 108 }, { 0, 14, height + 3 }); } else if (direction == 3) { image_id = SPIRAL_SLIDE_CENTRE_R3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, image_id, 16, 16, 8, 16, 108, height, 8, 0, height + 3); + PaintAddImageAsParent(session, image_id, { 16, 16, height }, { 8, 16, 108 }, { 8, 0, height + 3 }); } rct_drawpixelinfo* dpi = &session->DPI; @@ -202,7 +202,7 @@ static void paint_spiral_slide( // Base uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 5c69526cb0..d8028570f4 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -51,8 +51,8 @@ static void facility_paint_setup( uint32_t foundationImageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_3]; PaintAddImageAsParent( - session, foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, - height); + session, foundationImageId, { 0, 0, height }, { lengthX, lengthY, 29 }, + { direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height }); // Door image or base PaintAddImageAsChild( @@ -62,19 +62,20 @@ static void facility_paint_setup( { // Door image or base PaintAddImageAsParent( - session, imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height); + session, imageId, { 0, 0, height }, { lengthX, lengthY, 29 }, + { direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height }); } // Base image if door was drawn if (direction == 1) { imageId += 2; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 28, 29, height, 28, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 28, 29 }, { 28, 2, height }); } else if (direction == 2) { imageId += 4; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 2, 29, height, 2, 28, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 2, 29 }, { 2, 28, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index 806e457420..f4311ceb62 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -52,13 +52,13 @@ static void shop_paint_setup( { uint32_t foundationImageId = ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | session->TrackColours[SCHEME_3]; - PaintAddImageAsParent(session, foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height); + PaintAddImageAsParent(session, foundationImageId, { 0, 0, height }, { 28, 28, 45 }, { 2, 2, height }); PaintAddImageAsChild(session, imageId, 0, 0, 28, 28, 45, height, 2, 2, height); } else { - PaintAddImageAsParent(session, imageId, 0, 0, 28, 28, 45, height, 2, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 45 }, { 2, 2, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 75782a45e9..0546bd9603 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -42,7 +42,8 @@ static void paint_3d_cinema_structure( } uint32_t imageId = (rideEntry->vehicles[0].base_image_id + direction) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 47, height + 3, xOffset + 16, yOffset + 16, height + 3); + PaintAddImageAsParent( + session, imageId, { xOffset, yOffset, height + 3 }, { 24, 24, 47 }, { xOffset + 16, yOffset + 16, height + 3 }); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index a66a03451a..e88887aff6 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -53,7 +53,7 @@ static void paint_enterprise_structure( } uint32_t imageId = (baseImageId + imageOffset) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 48, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { xOffset, yOffset, height }, { 24, 24, 48 }, { 0, 0, height }); rct_drawpixelinfo* dpi = &session->DPI; diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 4632ab5441..4881092781 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -44,11 +44,11 @@ void vehicle_visual_launched_freefall( // Draw back: int32_t baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2); auto image_id = (baseImage_id + 2) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); // Draw front: image_id = (baseImage_id + 1) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); // Draw peeps: if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) @@ -97,7 +97,7 @@ static void paint_launched_freefall_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -109,15 +109,15 @@ static void paint_launched_freefall_base( if (trackSequence == 0) { imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); paint_util_set_vertical_tunnel(session, height + 32); @@ -171,7 +171,7 @@ static void paint_launched_freefall_tower_section( } uint32_t imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 2504d31723..4b274c6a08 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -85,8 +85,8 @@ static void paint_magic_carpet_frame( if (plane == PLANE_BACK) { PaintAddImageAsParent( - session, imageId, static_cast(offset.x), static_cast(offset.y), bbSize.x, bbSize.y, 127, offset.z, - bbOffset.x, bbOffset.y, bbOffset.z); + session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, + { bbSize.x, bbSize.y, 127 }, { bbOffset.x, bbOffset.y, bbOffset.z }); } else { diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 6c6471dfed..3a45815cae 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -83,32 +83,38 @@ static void paint_motionsimulator_vehicle( case 0: // Simulator imageId = simulatorImageId; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 2, 44, offsetZ, offsetX, offsetY + 32, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 2, 44 }, { offsetX, offsetY + 32, offsetZ }); break; case 1: // Simulator imageId = simulatorImageId; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY, offsetZ); // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 2, 20, 44, offsetZ, offsetX + 34, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 2, 20, 44 }, { offsetX + 34, offsetY, offsetZ }); break; case 2: // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 2, 44, offsetZ, offsetX, offsetY - 10, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 2, 44 }, { offsetX, offsetY - 10, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY + 5, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX, offsetY + 5, offsetZ }); // Simulator imageId = simulatorImageId; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX, offsetY + 5, offsetZ); @@ -116,10 +122,12 @@ static void paint_motionsimulator_vehicle( case 3: // Stairs (rail) imageId = (SPR_MOTION_SIMULATOR_STAIRS_RAIL_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 2, 20, 44, offsetZ, offsetX - 10, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 2, 20, 44 }, { offsetX - 10, offsetY, offsetZ }); // Stairs imageId = (SPR_MOTION_SIMULATOR_STAIRS_R0 + direction) | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX + 5, offsetY, offsetZ); + PaintAddImageAsParent( + session, imageId, { offsetX, offsetY, offsetZ }, { 20, 20, 44 }, { offsetX + 5, offsetY, offsetZ }); // Simulator imageId = simulatorImageId; PaintAddImageAsChild(session, imageId, offsetX, offsetY, 20, 20, 44, offsetZ, offsetX + 5, offsetY, offsetZ); diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 730c109e51..3840486e7a 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -52,11 +52,11 @@ void vehicle_visual_roto_drop( // Draw back: image_id = baseImage_id | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); // Draw front: image_id = (baseImage_id + 4) | imageFlags; - PaintAddImageAsParent(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); if (vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -107,7 +107,7 @@ static void paint_roto_drop_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { @@ -120,15 +120,15 @@ static void paint_roto_drop_base( { imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 32 }, { 2, 2, 30 }, { 8, 8, height + 32 }); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64); + PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { 2, 2, 30 }, { 8, 8, height + 64 }); paint_util_set_vertical_tunnel(session, height + 96); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -186,7 +186,7 @@ static void paint_roto_drop_tower_section( } uint32_t imageId = SPR_ROTO_DROP_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index e8ef655a0d..4972e34039 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -101,8 +101,8 @@ static void paint_swinging_inverter_ship_structure( if (direction & 2) { PaintAddImageAsParent( - session, vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, vehicleImageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); PaintAddImageAsChild( session, frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); @@ -110,8 +110,8 @@ static void paint_swinging_inverter_ship_structure( else { PaintAddImageAsParent( - session, frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, frameImageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, + { boundBox.offset_x, boundBox.offset_y, height }); PaintAddImageAsChild( session, vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index ebc1cb3a7c..f6c5c5774d 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -113,8 +113,8 @@ static void paint_swinging_ship_structure( imageId = swinging_ship_frame_sprites[(direction & 1)][0] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, xOffset, yOffset, bounds.length_x, bounds.length_y, 80, height, bounds.offset_x, bounds.offset_y, - height); + session, imageId, { xOffset, yOffset, height }, { bounds.length_x, bounds.length_y, 80 }, + { bounds.offset_x, bounds.offset_y, height }); imageId = baseImageId | imageColourFlags; PaintAddImageAsChild( diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 66a6d0141a..53223392d9 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -57,7 +57,8 @@ static void paint_twist_structure( uint32_t structureFrameNum = frameNum % 24; uint32_t imageId = (baseImageId + structureFrameNum) | imageColourFlags; - PaintAddImageAsParent(session, imageId, xOffset, yOffset, 24, 24, 48, height, xOffset + 16, yOffset + 16, height); + PaintAddImageAsParent( + session, imageId, { xOffset, yOffset, height }, { 24, 24, 48 }, { xOffset + 16, yOffset + 16, height }); rct_drawpixelinfo* dpi = &session->DPI; @@ -102,12 +103,12 @@ static void paint_twist( if (track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SW | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 29, 0, height + 3 }); } if (track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation)) { imageId = SPR_FENCE_ROPE_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); } break; default: diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index b811949af0..a246809f4a 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -39,10 +39,10 @@ static void paint_lift_cage(paint_session* session, int8_t index, uint32_t colou uint32_t imageId; imageId = lift_cage_sprites[1 + index][0] | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 2, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 2, 2, height }); imageId = lift_cage_sprites[1 + index][1] | colourFlags; - PaintAddImageAsParent(session, imageId, 0, 0, 2, 2, 30, height, 28, 28, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 28, 28, height }); } /** rct2: 0x0076C6CC */ @@ -75,7 +75,7 @@ static void paint_lift_base( int32_t edges = edges_3x3[trackSequence]; uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); if (ride != nullptr) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index b3d4cb4e50..1b5558df4c 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1286,7 +1286,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( if (trackSequence == 1 && direction == 0) { uint32_t imageId = SPR_G2_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_3 | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 8, 8, 2, height, 0, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 8, 8, 2 }, { 0, 0, height }); } } else @@ -1443,7 +1443,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag( offset = miniature_railway_track_pieces_right_eight_to_orthog_offset[direction][index]; } PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); } } else @@ -1453,7 +1454,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag( CoordsXY offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1583,7 +1585,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag( offset = miniature_railway_track_pieces_left_eight_to_orthog_offset[direction][index]; } PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); } } else @@ -1593,7 +1596,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag( CoordsXY offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; PaintAddImageAsParent( - session, imageId, 0, 0, bounds.x, bounds.y, static_cast(bounds.z), height, offset.x, offset.y, height); + session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, + { offset.x, offset.y, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1709,8 +1713,8 @@ static void miniature_railway_track_diag_flat( if (isSupported) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -1721,7 +1725,7 @@ static void miniature_railway_track_diag_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1804,9 +1808,10 @@ static void miniature_railway_track_diag_25_deg_up( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1817,8 +1822,8 @@ static void miniature_railway_track_diag_25_deg_up( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + offsetB[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + offsetB[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1857,8 +1862,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -1869,7 +1874,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1931,9 +1936,10 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1944,8 +1950,8 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2006,9 +2012,10 @@ static void miniature_railway_track_diag_25_deg_down( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2019,8 +2026,8 @@ static void miniature_railway_track_diag_25_deg_down( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2080,9 +2087,10 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height + offsetsB[direction][trackSequence][0], floorBoundOffset.x, floorBoundOffset.y, - height + offsetsB[direction][trackSequence][1]); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, + { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2093,8 +2101,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, - height + railOffsets[direction]); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, + { -16, -16, height + railOffsets[direction] }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -2131,8 +2139,8 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( if (hasSupports) { PaintAddImageAsParent( - session, floorImage | session->TrackColours[SCHEME_SUPPORTS], 0, 0, floorBoundSize.x, floorBoundSize.y, - (drawRail ? 2 : 0), height, floorBoundOffset.x, floorBoundOffset.y, height); + session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, + { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); if (drawRail) { PaintAddImageAsChild( @@ -2143,7 +2151,7 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( else if (drawRail) { PaintAddImageAsParent( - session, imageId | session->TrackColours[SCHEME_TRACK], -16, -16, 32, 32, 2, height, -16, -16, height); + session, imageId | session->TrackColours[SCHEME_TRACK], { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index ab49c14d16..65a534cc6a 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -469,12 +469,12 @@ static void paint_monorail_station( if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); } else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; - PaintAddImageAsParent(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); } } @@ -1003,7 +1003,7 @@ static void paint_monorail_track_left_eighth_to_diag( uint32_t imageId = ghost_train_track_pieces_left_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; const CoordsXY offset = ghost_train_track_pieces_left_eight_to_diag_offset[direction][index]; const CoordsXY bounds = ghost_train_track_pieces_left_eight_to_diag_bounds[direction][index]; - PaintAddImageAsParent(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { bounds.x, bounds.y, 2 }, { offset.x, offset.y, height }); } switch (trackSequence) @@ -1071,7 +1071,7 @@ static void paint_monorail_track_right_eighth_to_diag( uint32_t imageId = ghost_train_track_pieces_right_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; const CoordsXY offset = ghost_train_track_pieces_right_eight_to_diag_offset[direction][index]; const CoordsXY bounds = ghost_train_track_pieces_right_eight_to_diag_bounds[direction][index]; - PaintAddImageAsParent(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { bounds.x, bounds.y, 2 }, { offset.x, offset.y, height }); } switch (trackSequence) @@ -1170,7 +1170,7 @@ static void paint_monorail_track_diag_flat( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_flat[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1193,7 +1193,7 @@ static void paint_monorail_track_diag_25_deg_up( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1216,7 +1216,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_up( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1239,7 +1239,7 @@ static void paint_monorail_track_diag_25_deg_up_to_flat( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1262,7 +1262,7 @@ static void paint_monorail_track_diag_25_deg_down( if (monorail_diag_image_segment[direction][trackSequence]) { uint32_t imageId = monorail_track_pieces_diag_25_deg_up[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1286,7 +1286,7 @@ static void paint_monorail_track_diag_flat_to_25_deg_down( { uint32_t imageId = monorail_track_pieces_diag_25_deg_up_to_flat[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) @@ -1310,7 +1310,7 @@ static void paint_monorail_track_diag_25_deg_down_to_flat( { uint32_t imageId = monorail_track_pieces_diag_flat_to_25_deg_up[(direction + 2) % 4] | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, -16, -16, 32, 32, 2, height, -16, -16, height); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); } if (trackSequence == 3) diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index a1424ca583..0b51f32807 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -229,7 +229,8 @@ void vehicle_visual_river_rapids( image_id |= CONSTRUCTION_MARKER; } PaintAddImageAsParent( - session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z); + session, image_id, { 0, 0, z }, { bb->length_x, bb->length_y, bb->length_z }, + { bb->offset_x, bb->offset_y, bb->offset_z + z }); if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index fae611eba4..9d4788ac8c 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -749,21 +749,21 @@ static void paint_splash_boats_track_flat( { imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_TOP_NW_SE : SPR_SPLASH_BOATS_FLAT_TOP_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 2, height, 6, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_SIDE_NW_SE : SPR_SPLASH_BOATS_FLAT_SIDE_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 1, 32, 26, height, 27, 0, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); } else { imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_TOP_SW_NE : SPR_SPLASH_BOATS_FLAT_TOP_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_SIDE_SW_NE : SPR_SPLASH_BOATS_FLAT_SIDE_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 1, 26, height, 0, 27, height); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); @@ -790,7 +790,7 @@ static void paint_splash_boats_station( { uint32_t imageId = (direction == 1 ? SPR_SPLASH_BOATS_FLAT_TOP_NW_SE : SPR_SPLASH_BOATS_FLAT_TOP_SE_NW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 3 }); imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); @@ -799,7 +799,7 @@ static void paint_splash_boats_station( { uint32_t imageId = (direction == 0 ? SPR_SPLASH_BOATS_FLAT_TOP_SW_NE : SPR_SPLASH_BOATS_FLAT_TOP_NE_SW) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index d98b96186b..0b3a33bcc7 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -62,7 +62,8 @@ void vehicle_visual_submarine( image_id = baseImage_id | imageFlags; paint_struct* ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, bb.length_z }, + { bb.offset_x, bb.offset_y, bb.offset_z + z }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -70,7 +71,7 @@ void vehicle_visual_submarine( image_id = (baseImage_id + 1) | imageFlags; ps = PaintAddImageAsParent( - session, image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10); + session, image_id, { 0, 0, z }, { bb.length_x, bb.length_y, 2 }, { bb.offset_x, bb.offset_y, bb.offset_z + z - 10 }); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; @@ -94,7 +95,7 @@ static void submarine_ride_paint_track_station( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( @@ -103,7 +104,7 @@ static void submarine_ride_paint_track_station( else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( @@ -124,13 +125,13 @@ static void submarine_ride_paint_track_flat( if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); paint_util_push_tunnel_right(session, heightLower, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower); + PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); paint_util_push_tunnel_left(session, heightLower, TUNNEL_0); } From efa9af4610869bdfaba6d61c881bbf91479a23c9 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 22:10:46 +0300 Subject: [PATCH 187/681] Simplify passing args on PaintAddImageAsParent where possible --- .../paint/tile_element/Paint.LargeScenery.cpp | 4 +- .../paint/tile_element/Paint.Path.cpp | 3 +- .../paint/tile_element/Paint.SmallScenery.cpp | 5 +- .../paint/tile_element/Paint.Wall.cpp | 20 +--- src/openrct2/ride/TrackPaint.cpp | 19 ++-- .../ride/coaster/JuniorRollerCoaster.cpp | 103 ++++++------------ 6 files changed, 49 insertions(+), 105 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 88e21ec6b8..ea436e96ce 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -289,9 +289,7 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh boxlength.x = s98E3C4[esi].length.x; boxlength.y = s98E3C4[esi].length.y; boxlength.z = boxlengthZ; - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, boxoffset); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 7138dd62b5..0e3a609b6c 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -441,8 +441,7 @@ static void sub_6A4101( boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; boundBoxOffsets.y = BannerBoundBoxes[direction][1].y; imageId++; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 21 }, boundBoxOffsets); direction--; // If text shown diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 3de63b9e8d..1ba7d0bc2d 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -159,8 +159,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) { PaintAddImageAsParent( - session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, boxoffset); } if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) @@ -327,7 +326,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { PaintAddImageAsParent( session, image_id, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, - { boxoffset.x, boxoffset.y, boxoffset.z }); + boxoffset); } else { diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 4bced75a05..6b98e5f20a 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -59,17 +59,13 @@ static void PaintWallDoor( { paint_struct* ps; - ps = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsR1.x, boundsR1.y, static_cast(boundsR1.z) }, { boundsR1_.x, boundsR1_.y, boundsR1_.z }); + ps = PaintAddImageAsParent(session, imageId, offset, boundsR1, boundsR1_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; } - ps = PaintAddImageAsParent( - session, imageId + 1, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsR2.x, boundsR2.y, static_cast(boundsR2.z) }, { boundsR2_.x, boundsR2_.y, boundsR2_.z }); + ps = PaintAddImageAsParent(session, imageId + 1, offset, boundsR2, boundsR2_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -79,9 +75,7 @@ static void PaintWallDoor( { paint_struct* ps; - ps = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { boundsL1.x, boundsL1.y, static_cast(boundsL1.z) }, { boundsL1_.x, boundsL1_.y, boundsL1_.z }); + ps = PaintAddImageAsParent(session, imageId, offset, boundsL1, boundsL1_); if (ps != nullptr) { ps->tertiary_colour = tertiaryColour; @@ -117,9 +111,7 @@ static void PaintWallWall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (dword_141F710 == 0) { imageId = baseImageId + dword_141F718; @@ -140,9 +132,7 @@ static void PaintWallWall( imageId = (imageId & 0x7FFFF) | dword_141F710; } - paint_struct* paint = PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + paint_struct* paint = PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); if (paint != nullptr) { paint->tertiary_colour = tertiaryColour; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 52b33096c5..aadcb94724 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -844,9 +844,7 @@ bool track_paint_util_draw_station_covers_2( } imageId = (baseImageId + imageOffset) | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); return true; } @@ -1048,7 +1046,7 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( PaintAddImageAsParent( session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + { boundsLength.x, boundsLength.y, thickness[1] }, boundsOffset); } } @@ -1305,8 +1303,7 @@ void track_paint_util_eighth_to_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[direction][index] }, + session, imageId, { offset.x, offset.y, height }, { boundsLength.x, boundsLength.y, thickness[direction][index] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } @@ -1484,12 +1481,12 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( } const sprite_bb* spriteBB = &sprites[direction][sprite]; - uint32_t imageId = spriteBB->sprite_id | colourFlags; + const uint32_t imageId = spriteBB->sprite_id | colourFlags; + const auto& offset = spriteBB->offset; + const auto& bbOffset = spriteBB->offset; PaintAddImageAsParent( - session, imageId, - { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), height + spriteBB->offset.z }, - { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, - { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); + session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size, + { bbOffset.x, bbOffset.y, height + bbOffset.z }); } void track_paint_util_right_quarter_turn_5_tiles_paint_3( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 7203e411fc..8d5cb5bed1 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2467,10 +2467,8 @@ static void junior_rc_left_bank_paint_setup( image_id = junior_rc_track_pieces_left_bank[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, image_id, { 0, 0, height }, - { junior_rc_left_bank_bound_lengths[direction].x, junior_rc_left_bank_bound_lengths[direction].y, - static_cast(junior_rc_left_bank_bound_lengths[direction].z) }, - { junior_rc_left_bank_bound_offsets[direction].x, junior_rc_left_bank_bound_offsets[direction].y, height }); + session, image_id, { 0, 0, height }, junior_rc_left_bank_bound_lengths[direction], + { junior_rc_left_bank_bound_offsets[direction], height }); if (direction & 1) { @@ -3085,9 +3083,9 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( break; } if (imageId != 0) - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); + { + PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { @@ -4959,12 +4957,9 @@ void junior_rc_paint_track_60_deg_up( image_id |= junior_rc_track_pieces_60_deg_up[EnumValue(chainType)][direction]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_60_deg_up_bound_lengths[direction].x, junior_rc_60_deg_up_bound_lengths[direction].y, - junior_rc_60_deg_up_bound_thickness[direction] }, - { junior_rc_60_deg_up_bound_offsets[direction].x, junior_rc_60_deg_up_bound_offsets[direction].y, height }); + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_60_deg_up_bound_lengths[direction], junior_rc_60_deg_up_bound_thickness[direction] }, + { junior_rc_60_deg_up_bound_offsets[direction], height }); switch (direction) { @@ -5037,14 +5032,10 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5053,14 +5044,10 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( image_id |= junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5118,14 +5105,10 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][0], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5134,14 +5117,10 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( image_id |= junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_tile_offsets[direction].x), - static_cast(junior_rc_60_deg_up_tile_offsets[direction].y), height }, - { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1].y, + session, image_id, { junior_rc_60_deg_up_tile_offsets[direction], height }, + { junior_rc_25_deg_up_to_60_deg_up_bound_lengths[direction][1], junior_rc_25_deg_up_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1].y, height }); + { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5437,13 +5416,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][0].y), height + 24 }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height }); + session, image_id, { junior_rc_flat_to_60_deg_up_tile_offsets[direction][0], height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) { @@ -5452,14 +5427,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( image_id |= junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].x), - static_cast(junior_rc_flat_to_60_deg_up_tile_offsets[direction][1].y), height }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); + session, image_id, { junior_rc_flat_to_60_deg_up_tile_offsets[direction][1], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) @@ -5509,13 +5479,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][0]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][0].y), height + 24 }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].x, junior_rc_flat_to_60_deg_up_bound_lengths[direction][0].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].x, junior_rc_flat_to_60_deg_up_bound_offsets[direction][0].y, - height }); + session, image_id, { junior_rc_60_deg_up_to_flat_tile_offsets[direction][0], height + 24 }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }); if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) { @@ -5524,14 +5490,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( image_id |= junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1]; PaintAddImageAsParent( - session, image_id, - { static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].x), - static_cast(junior_rc_60_deg_up_to_flat_tile_offsets[direction][1].y), height }, - { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_lengths[direction][1].y, - junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, - { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].x, - junior_rc_flat_to_60_deg_up_bound_offsets[direction][1].y, height }); + session, image_id, { junior_rc_60_deg_up_to_flat_tile_offsets[direction][1], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][1], junior_rc_flat_to_60_deg_up_bound_thickness[direction] }, + { junior_rc_flat_to_60_deg_up_bound_offsets[direction][1], height }); } switch (direction) From 7764bb910f77afaa7c6147ac5ae3d464ee0a3194 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 22:56:32 +0300 Subject: [PATCH 188/681] Use CoordsXYZ instead of anonymous struct in unk_supports_desc --- src/openrct2/paint/Supports.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 38336abb3e..636ceba4e2 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -305,12 +305,8 @@ static constexpr const uint16_t* WoodenCurveSupportImageIds[12] = { }; struct unk_supports_desc_bound_box { - struct { - uint8_t x, y, z; - } offset; - struct { - uint8_t x, y, z; - } length; + CoordsXYZ offset; + CoordsXYZ length; }; struct unk_supports_desc { @@ -780,7 +776,7 @@ bool wooden_b_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - unk_supports_desc supportsDesc = byte_97B23C[specialIndex]; + const unk_supports_desc& supportsDesc = byte_97B23C[specialIndex]; if (WoodenCurveSupportImageIds[supportType] != nullptr && WoodenCurveSupportImageIds[supportType][specialIndex] != 0 && supportsDesc.var_7 != 0) @@ -788,13 +784,12 @@ bool wooden_b_supports_paint_setup( uint32_t imageId = WoodenCurveSupportImageIds[supportType][specialIndex]; imageId |= imageColourFlags; - unk_supports_desc_bound_box boundBox = supportsDesc.bounding_box; + const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, { 0, 0, baseHeight }, - { boundBox.length.x, boundBox.length.y, boundBox.length.z }, + session, imageId | imageColourFlags, { 0, 0, baseHeight }, boundBox.length, { boundBox.offset.x, boundBox.offset.y, boundBox.offset.z + baseHeight }); _9E32B1 = true; } From 3d90257dde7a1b326e3da2c887a77dc5ebb9bf87 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:01:57 +0300 Subject: [PATCH 189/681] Simplify more argument passing to PaintAddImageAsParent --- src/openrct2/paint/Supports.cpp | 35 ++++++++----------- .../paint/tile_element/Paint.Banner.cpp | 6 ++-- .../paint/tile_element/Paint.Path.cpp | 15 ++++---- src/openrct2/ride/TrackPaint.cpp | 32 ++++++++--------- .../ride/coaster/JuniorRollerCoaster.cpp | 5 +-- 5 files changed, 40 insertions(+), 53 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 636ceba4e2..3cb7ce746b 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -1079,9 +1079,7 @@ bool metal_b_supports_paint_setup( PaintAddImageAsParent( session, _metalSupportTypeToCrossbeamImages[supportType][ebp] | imageColourFlags, - { SupportBoundBoxes[originalSegment].x + loc_97B052[ebp].x, - SupportBoundBoxes[originalSegment].y + loc_97B052[ebp].y, baseHeight }, - { _97B062[ebp].x, _97B062[ebp].y, 1 }); + { SupportBoundBoxes[originalSegment] + loc_97B052[ebp], baseHeight }, { _97B062[ebp], 1 }); } int32_t si = baseHeight; @@ -1097,8 +1095,7 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( - session, imageId | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, supportSegments[segment].height }, { 0, 0, 5 }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; } @@ -1114,7 +1111,7 @@ bool metal_b_supports_paint_setup( { PaintAddImageAsParent( session, (_97B15C[supportType].beam_id + (heightDiff - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1149,8 +1146,7 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, beamLength - 1 }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1179,9 +1175,8 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].beam_id + (beamLength - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, - { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, baseHeight }, { 0, 0, 0 }, - { SupportBoundBoxes[originalSegment].x, SupportBoundBoxes[originalSegment].y, height }); + session, imageId | imageColourFlags, { SupportBoundBoxes[originalSegment], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[originalSegment], height }); baseHeight += beamLength; } } @@ -1312,14 +1307,13 @@ bool path_a_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 55 + specialIndex; - unk_supports_desc supportsDesc = byte_98D8D4[specialIndex]; - unk_supports_desc_bound_box boundBox = supportsDesc.bounding_box; + const unk_supports_desc& supportsDesc = byte_98D8D4[specialIndex]; + const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; if (supportsDesc.var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId | imageColourFlags, { 0, 0, baseHeight }, - { boundBox.length.y, boundBox.length.x, boundBox.length.z }, + session, imageId | imageColourFlags, { 0, 0, baseHeight }, boundBox.length, { boundBox.offset.x, boundBox.offset.y, baseHeight + boundBox.offset.z }); hasSupports = true; } @@ -1408,7 +1402,7 @@ bool path_b_supports_paint_setup( { PaintAddImageAsParent( session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, heightDiff - 1 }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } baseHeight += heightDiff; @@ -1441,7 +1435,7 @@ bool path_b_supports_paint_setup( PaintAddImageAsParent( session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, - { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, (z - 1) }); + { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1458,8 +1452,7 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, (z - 1) }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; } @@ -1488,8 +1481,8 @@ bool path_b_supports_paint_setup( uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); PaintAddImageAsParent( - session, imageId | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, - { 0, 0, 0 }, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }); + session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, 0 }, + { SupportBoundBoxes[segment], baseHeight }); baseHeight += z; } diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 44cd06cdd7..9006830aa4 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -78,14 +78,12 @@ void PaintBanner(paint_session* session, uint8_t direction, int32_t height, cons image_id |= (banner->colour << 19) | IMAGE_TYPE_REMAP; } - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, boundBoxOffset); boundBoxOffset.x = BannerBoundBoxes[direction][1].x; boundBoxOffset.y = BannerBoundBoxes[direction][1].y; image_id++; - PaintAddImageAsParent( - session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, { boundBoxOffset.x, boundBoxOffset.y, boundBoxOffset.z }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 1, 0x15 }, boundBoxOffset); // Opposite direction direction = direction_reverse(direction); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 0e3a609b6c..b1b3bacf92 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -434,8 +434,7 @@ static void sub_6A4101( uint32_t imageId = (direction << 1) + base_image_id + 28; // Draw pole in the back - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { 1, 1, 21 }, { boundBoxOffsets.x, boundBoxOffsets.y, boundBoxOffsets.z }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 21 }, boundBoxOffsets); // Draw pole in the front and banner boundBoxOffsets.x = BannerBoundBoxes[direction][1].x; @@ -1046,8 +1045,8 @@ void path_paint_box_support( if (!hasSupports || !session->DidPassSurface) { PaintAddImageAsParent( - session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, imageId | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); } else { @@ -1063,8 +1062,8 @@ void path_paint_box_support( } PaintAddImageAsParent( - session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) @@ -1212,8 +1211,8 @@ void path_paint_pole_support( } PaintAddImageAsParent( - session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize.x, boundBoxSize.y, 0 }, - { boundBoxOffset.x, boundBoxOffset.y, height + boundingBoxZOffset }); + session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, + { boundBoxOffset, height + boundingBoxZOffset }); // TODO: Revert this when path import works correctly. if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index aadcb94724..d30bb0b83f 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -829,9 +829,7 @@ bool track_paint_util_draw_station_covers_2( if (baseImageId & IMAGE_TYPE_TRANSPARENT) { imageId = (baseImageId & ~IMAGE_TYPE_TRANSPARENT) + imageOffset; - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bounds.x, bounds.y, static_cast(bounds.z) }, { boundsOffset.x, boundsOffset.y, boundsOffset.z }); + PaintAddImageAsParent(session, imageId, offset, bounds, boundsOffset); uint32_t edi = session->TrackColours[SCHEME_TRACK] & (0b11111 << 19); @@ -1034,8 +1032,8 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1044,9 +1042,7 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXY boundsLength = boundsLengths[direction][index][1]; CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, boundsOffset); + PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, thickness[1] }, boundsOffset); } } @@ -1132,8 +1128,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][0]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[0] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[0] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } if (sprites[direction][index][1] != 0) { @@ -1143,8 +1139,8 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness[1] }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness[1] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1344,8 +1340,8 @@ void track_paint_util_diag_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength, thickness }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { @@ -1752,11 +1748,11 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_3( return; } const sprite_bb* spriteBB = &sprites[direction][sprite]; + const auto& offset = spriteBB->offset; + const auto& bbOffset = spriteBB->bb_offset; PaintAddImageAsParent( - session, spriteBB->sprite_id | colourFlags, - { static_cast(spriteBB->offset.x), static_cast(spriteBB->offset.y), spriteBB->offset.z + height }, - { spriteBB->bb_size.x, spriteBB->bb_size.y, static_cast(spriteBB->bb_size.z) }, - { spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z }); + session, spriteBB->sprite_id | colourFlags, { offset.x, offset.y, offset.z + height }, spriteBB->bb_size, + { bbOffset.x, bbOffset.y, height + bbOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_4( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 8d5cb5bed1..46bd0265b5 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -3162,9 +3162,10 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( break; } if (imageId != 0) + { PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, 1 }, { boundsOffset.x, boundsOffset.y, height }); + session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, 1 }, { boundsOffset, height }); + } if (direction == 0 && trackSequence == 0) { From a5d2939108affb27c228feee0737cd9025c5b7e4 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:18:00 +0300 Subject: [PATCH 190/681] Use CoordsXY for rct_crooked_house_bound_box and correct arg passing --- src/openrct2/ride/gentle/CrookedHouse.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 32286cb425..dad4dfda77 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -16,17 +16,15 @@ struct rct_crooked_house_bound_box { - int16_t offset_x; - int16_t offset_y; - int16_t length_x; - int16_t length_y; + CoordsXY offset; + CoordsXY length; }; -static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { 6, 0, 42, 24 }, - { 0, 0, 0, 0 }, - { -16, -16, 32, 32 }, - { 0, 0, 0, 0 }, // Unused - { 0, 6, 24, 42 } }; +static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { { 6, 0 }, { 42, 24 } }, + { { 0, 0 }, { 0, 0 } }, + { { -16, -16 }, { 32, 32 } }, + { { 0, 0 }, { 0, 0 } }, // Unused + { { 0, 6 }, { 24, 42 } } }; /** * rct2: 0x0088ABA4 @@ -56,10 +54,9 @@ static void paint_crooked_house_structure( uint32_t image_id = (direction + rideEntry->vehicles[0].base_image_id) | session->TrackColours[SCHEME_MISC]; - rct_crooked_house_bound_box boundBox = crooked_house_data[segment]; + const rct_crooked_house_bound_box& boundBox = crooked_house_data[segment]; PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height + 3 }); + session, image_id, { x_offset, y_offset, height + 3 }, { boundBox.length, 127 }, { boundBox.offset, height + 3 }); } static void paint_crooked_house( From 5f49276d53745dd981d73cdfac0704285e89fcfe Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:22:00 +0300 Subject: [PATCH 191/681] Use CoordsXY for ferris_wheel_bound_box and correct arg passing --- src/openrct2/ride/gentle/FerrisWheel.cpp | 33 +++++++++++------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 9e2b3b5005..c3a0e0e1c6 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -32,18 +32,16 @@ static constexpr const uint8_t edges_1x4_nw_se[] = { struct ferris_wheel_bound_box { - int16_t length_x; - int16_t length_y; - int16_t offset_x; - int16_t offset_y; + CoordsXY length; + CoordsXY offset; }; /** rct2: 0x008A8CA8 */ -static ferris_wheel_bound_box ferris_wheel_data[] = { - { 31, 16, 1, 8 }, - { 16, 31, 8, 1 }, - { 31, 16, 1, 8 }, - { 16, 31, 8, 1 }, +static constexpr ferris_wheel_bound_box ferris_wheel_data[] = { + { { 31, 16 }, { 1, 8 } }, + { { 16, 31 }, { 8, 1 } }, + { { 31, 16 }, { 1, 8 } }, + { { 16, 31 }, { 8, 1 } }, }; /** @@ -89,17 +87,16 @@ static void paint_ferris_wheel_structure( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim); } - ferris_wheel_bound_box boundBox = ferris_wheel_data[direction]; + const ferris_wheel_bound_box& boundBox = ferris_wheel_data[direction]; imageId = (22150 + (direction & 1) * 2) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent( - session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height }); + session, imageId, { xOffset, yOffset, height }, { boundBox.length, 127 }, { boundBox.offset, height }); imageId = (baseImageId + direction * 8 + imageOffset) | imageColourFlags; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && vehicle != nullptr) { @@ -115,15 +112,15 @@ static void paint_ferris_wheel_structure( imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[i], vehicle->peep_tshirt_colours[i + 1]); imageId = (baseImageId + 32 + direction * 128 + frameNum) | imageColourFlags; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); } } imageId = (22150 + (direction & 1) * 2 + 1) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = ViewportInteractionItem::Ride; From 77b06cbf9a717605e825c67b9c4106fe9ccad381 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:24:10 +0300 Subject: [PATCH 192/681] Use CoordsXY for haunted_house_bound_box and correct arg passing --- src/openrct2/ride/gentle/HauntedHouse.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 0a6c80e1c3..1c120deba4 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -17,15 +17,14 @@ struct haunted_house_bound_box { - int16_t offset_x; - int16_t offset_y; - int16_t length_x; - int16_t length_y; + CoordsXY offset; + CoordsXY length; }; /** rct2: 0x1428180 */ -static haunted_house_bound_box haunted_house_data[] = { - { 6, 0, 42, 24 }, { 0, 0, 0, 0 }, { -16, -16, 32, 32 }, { 0, 0, 0, 0 }, { 0, 6, 24, 42 }, { 0, 0, 0, 0 }, +static constexpr haunted_house_bound_box haunted_house_data[] = { + { { 6, 0 }, { 42, 24 } }, { { 0, 0 }, { 0, 0 } }, { { -16, -16 }, { 32, 32 } }, + { { 0, 0 }, { 0, 0 } }, { { 0, 6 }, { 24, 42 } }, { { 0, 0 }, { 0, 0 } }, }; /** @@ -56,10 +55,10 @@ static void paint_haunted_house_structure( } uint32_t imageId = (baseImageId + direction) | session->TrackColours[SCHEME_MISC]; - haunted_house_bound_box boundBox = haunted_house_data[part]; + + const haunted_house_bound_box& boundBox = haunted_house_data[part]; PaintAddImageAsParent( - session, imageId, { xOffset, yOffset, height }, { boundBox.length_x, boundBox.length_y, 127 }, - { boundBox.offset_x, boundBox.offset_y, height }); + session, imageId, { xOffset, yOffset, height }, { boundBox.length, 127 }, { boundBox.offset, height }); rct_drawpixelinfo* dpi = &session->DPI; if (dpi->zoom_level <= 0 && frameNum != 0) @@ -81,8 +80,8 @@ static void paint_haunted_house_structure( } imageId = imageId | session->TrackColours[SCHEME_MISC]; PaintAddImageAsChild( - session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, - boundBox.offset_y, height); + session, imageId, xOffset, yOffset, boundBox.length.x, boundBox.length.y, 127, height, boundBox.offset.x, + boundBox.offset.y, height); } session->CurrentlyDrawnItem = savedTileElement; From 15e32ce5f8cf303cf4061bb499cb8ddd35e6a9e1 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Fri, 20 Aug 2021 23:30:14 +0300 Subject: [PATCH 193/681] Simplify some arg passing on PaintAddImageAsParent --- .../ride/transport/MiniatureRailway.cpp | 42 +++++++------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 1b5558df4c..cb599947e4 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1442,9 +1442,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( bounds = miniature_railway_track_pieces_right_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_right_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1453,9 +1451,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( | session->TrackColours[SCHEME_SUPPORTS]; CoordsXY offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1584,9 +1580,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( bounds = miniature_railway_track_pieces_left_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_left_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); } } else @@ -1595,9 +1589,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( | session->TrackColours[SCHEME_SUPPORTS]; CoordsXY offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { bounds.x, bounds.y, static_cast(bounds.z) }, - { offset.x, offset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1714,7 +1706,7 @@ static void miniature_railway_track_diag_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1809,9 +1801,8 @@ static void miniature_railway_track_diag_25_deg_up( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -1863,7 +1854,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( @@ -1937,9 +1928,8 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2013,9 +2003,8 @@ static void miniature_railway_track_diag_25_deg_down( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2088,9 +2077,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], - { 0, 0, height + offsetsB[direction][trackSequence][0] }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, - { floorBoundOffset.x, floorBoundOffset.y, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, + { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); if (drawRail) { PaintAddImageAsChild( @@ -2140,7 +2128,7 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( { PaintAddImageAsParent( session, floorImage | session->TrackColours[SCHEME_SUPPORTS], { 0, 0, height }, - { floorBoundSize.x, floorBoundSize.y, (drawRail ? 2 : 0) }, { floorBoundOffset.x, floorBoundOffset.y, height }); + { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); if (drawRail) { PaintAddImageAsChild( From a38ae68f09bb22c4f2a221f992157d7e13a394c1 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 20 Aug 2021 23:27:58 +0200 Subject: [PATCH 194/681] Remove Paint.cpp assertions Before the refactor, the assertion read like this: ``` assert(static_cast(bound_box_length_x) == static_cast(bound_box_length_x)); ``` which meant that bound_box_length_x = 0 was valid. The refactor (likely accidentally) changed this, which causes assertions to get hit within 2 seconds after opening on my machine. According to Duncan, the asserts are no longer necessary at all, so remove them altogether. --- src/openrct2/paint/Paint.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index f4d9913b37..ae49f096eb 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -801,9 +801,6 @@ paint_struct* PaintAddImageAsParent( int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z) { - assert(bound_box_length_x > 0); - assert(bound_box_length_y > 0); - session->LastPS = nullptr; session->LastAttachedPS = nullptr; @@ -863,8 +860,6 @@ paint_struct* PaintAddImageAsChild( int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z) { - assert(bound_box_length_x > 0); - assert(bound_box_length_y > 0); return PaintAddImageAsChild( session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); From 6011478590949b219fa08c9c18b14f9a247f97e3 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 20 Aug 2021 23:38:15 +0200 Subject: [PATCH 195/681] Directly use std::unique_ptr prvalues This removes the unnecessary constructor calls and improves flexibility in case of typename changes. All cases, except for the one in Context.cpp, are temporaries. --- src/openrct2-ui/scripting/ScTitleSequence.hpp | 3 +-- src/openrct2-ui/windows/TitleEditor.cpp | 2 +- src/openrct2/Context.cpp | 2 +- src/openrct2/cmdline/RootCommands.cpp | 3 +-- src/openrct2/config/Config.cpp | 8 +++----- src/openrct2/title/TitleSequence.cpp | 4 ++-- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 4e5d889015..5b158d176b 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -11,7 +11,6 @@ #ifdef ENABLE_SCRIPTING -# include # include # include # include @@ -209,7 +208,7 @@ namespace OpenRCT2::Scripting try { auto& objectMgr = GetContext()->GetObjectManager(); - auto parkImporter = std::unique_ptr(ParkImporter::Create(handle->HintPath)); + auto parkImporter = ParkImporter::Create(handle->HintPath); auto result = parkImporter->LoadFromStream(handle->Stream.get(), isScenario); objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); parkImporter->Import(); diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index 78b48d5211..4b9e4fe2a8 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -351,7 +351,7 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd try { auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); - auto parkImporter = std::unique_ptr(ParkImporter::Create(handle->HintPath)); + auto parkImporter = ParkImporter::Create(handle->HintPath); auto result = parkImporter->LoadFromStream(handle->Stream.get(), isScenario); objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); parkImporter->Import(); diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d0f739970e..59438d3054 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -524,7 +524,7 @@ namespace OpenRCT2 { drawingEngine->Initialise(); drawingEngine->SetVSync(gConfigGeneral.use_vsync); - _drawingEngine = std::unique_ptr(std::move(drawingEngine)); + _drawingEngine = std::move(drawingEngine); } catch (const std::exception& ex) { diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index b074e0b785..60782dd77a 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #ifdef USE_BREAKPAD @@ -406,7 +405,7 @@ static exitcode_t HandleCommandScanObjects([[maybe_unused]] CommandLineArgEnumer gOpenRCT2Headless = true; gOpenRCT2NoGraphics = true; - auto context = std::unique_ptr(OpenRCT2::CreateContext()); + auto context = OpenRCT2::CreateContext(); auto env = context->GetPlatformEnvironment(); auto objectRepository = CreateObjectRepository(env); objectRepository->Construct(gConfigGeneral.language); diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 8e2a232172..783697a7b7 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -37,8 +37,6 @@ #include "IniReader.hpp" #include "IniWriter.hpp" -#include - using namespace OpenRCT2; using namespace OpenRCT2::Ui; @@ -565,7 +563,7 @@ namespace Config { try { - auto reader = std::unique_ptr(CreateDefaultIniReader()); + auto reader = CreateDefaultIniReader(); ReadGeneral(reader.get()); ReadInterface(reader.get()); ReadSound(reader.get()); @@ -586,7 +584,7 @@ namespace Config try { auto fs = FileStream(path, FILE_MODE_OPEN); - auto reader = std::unique_ptr(CreateIniReader(&fs)); + auto reader = CreateIniReader(&fs); ReadGeneral(reader.get()); ReadInterface(reader.get()); ReadSound(reader.get()); @@ -610,7 +608,7 @@ namespace Config Path::CreateDirectory(directory); auto fs = FileStream(path, FILE_MODE_WRITE); - auto writer = std::unique_ptr(CreateIniWriter(&fs)); + auto writer = CreateIniWriter(&fs); WriteGeneral(writer.get()); WriteInterface(writer.get()); WriteSound(writer.get()); diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index c5e47ca72a..66b2b39515 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -53,7 +53,7 @@ std::unique_ptr LoadTitleSequence(const std::string& path) auto ext = Path::GetExtension(path); if (String::Equals(ext, TITLE_SEQUENCE_EXTENSION)) { - auto zip = std::unique_ptr(Zip::TryOpen(path, ZIP_ACCESS::READ)); + auto zip = Zip::TryOpen(path, ZIP_ACCESS::READ); if (zip == nullptr) { Console::Error::WriteLine("Unable to open '%s'", path.c_str()); @@ -103,7 +103,7 @@ std::unique_ptr TitleSequenceGetParkHandle(const TitleS const auto& filename = seq.Saves[index]; if (seq.IsZip) { - auto zip = std::unique_ptr(Zip::TryOpen(seq.Path, ZIP_ACCESS::READ)); + auto zip = Zip::TryOpen(seq.Path, ZIP_ACCESS::READ); if (zip != nullptr) { auto data = zip->GetFileData(filename); From 8d801d9126ba5625794e578eca76cb940cd4147b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 21 Aug 2021 01:10:36 +0300 Subject: [PATCH 196/681] Apply review suggestion --- src/openrct2-ui/windows/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 10c70f0c85..4e10af0025 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -279,7 +279,7 @@ void window_player_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, const auto groupId = network_get_group_id(dropdownIndex); const auto windowHandle = std::make_pair(w->classification, w->number); auto playerSetGroupAction = PlayerSetGroupAction(playerId, groupId); - playerSetGroupAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + playerSetGroupAction.SetCallback([windowHandle](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { window_invalidate_by_number(windowHandle.first, windowHandle.second); From cef26400cf3a7c55a91b3f5e3ea0ef5001557504 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 20 Aug 2021 23:42:03 +0200 Subject: [PATCH 197/681] Use std::make_unique instead of new for arrays --- src/openrct2/CmdlineSprite.cpp | 2 +- src/openrct2/core/DataSerialiserTraits.h | 2 +- src/openrct2/rct12/SawyerChunkReader.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/CmdlineSprite.cpp b/src/openrct2/CmdlineSprite.cpp index 8d44a95546..a0ecfed2db 100644 --- a/src/openrct2/CmdlineSprite.cpp +++ b/src/openrct2/CmdlineSprite.cpp @@ -185,7 +185,7 @@ bool SpriteFile::Save(const utf8* path) static bool SpriteImageExport(const rct_g1_element& spriteElement, const char* outPath) { const auto pixelBufferSize = spriteElement.width * spriteElement.height; - std::unique_ptr pixelBuffer(new uint8_t[pixelBufferSize]); + auto pixelBuffer = std::make_unique(pixelBufferSize); auto pixels = pixelBuffer.get(); std::fill_n(pixels, pixelBufferSize, 0x00); diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 4fdcbaf464..7284f69851 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -284,7 +284,7 @@ template<> struct DataSerializerTraits_t uint32_t length = 0; s.decode(stream, length); - std::unique_ptr buf(new uint8_t[length]); + auto buf = std::make_unique(length); stream->Read(buf.get(), length); val.Write(buf.get(), length); diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index cf03dfdc5b..b8240009f6 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -65,7 +65,7 @@ std::shared_ptr SawyerChunkReader::ReadChunk() case CHUNK_ENCODING_RLECOMPRESSED: case CHUNK_ENCODING_ROTATE: { - std::unique_ptr compressedData(new uint8_t[header.length]); + auto compressedData = std::make_unique(header.length); if (_stream->TryRead(compressedData.get(), header.length) != header.length) { throw SawyerChunkException(EXCEPTION_MSG_CORRUPT_CHUNK_SIZE); From be4159f9ac6adf33d0ea5b34b451584da77efb14 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 20 Aug 2021 23:47:16 +0200 Subject: [PATCH 198/681] Create std::unique_ptrinstead of raw pointer --- src/openrct2/localisation/LanguagePack.cpp | 13 +++++++------ src/openrct2/localisation/LanguagePack.h | 5 +++-- src/openrct2/localisation/LocalisationService.cpp | 5 ++--- test/tests/LanguagePackTest.cpp | 12 ++++-------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index b17e29017d..4f75eab211 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -20,6 +20,7 @@ #include "Localisation.h" #include +#include #include #include @@ -62,7 +63,7 @@ private: ScenarioOverride* _currentScenarioOverride = nullptr; public: - static LanguagePack* FromFile(uint16_t id, const utf8* path) + static std::unique_ptr FromFile(uint16_t id, const utf8* path) { Guard::ArgumentNotNull(path); @@ -90,15 +91,15 @@ public: } // Parse the memory as text - LanguagePack* result = FromText(id, fileData); + auto result = FromText(id, fileData); Memory::Free(fileData); return result; } - static LanguagePack* FromText(uint16_t id, const utf8* text) + static std::unique_ptr FromText(uint16_t id, const utf8* text) { - return new LanguagePack(id, text); + return std::make_unique(id, text); } LanguagePack(uint16_t id, const utf8* text) @@ -579,13 +580,13 @@ private: namespace LanguagePackFactory { - ILanguagePack* FromFile(uint16_t id, const utf8* path) + std::unique_ptr FromFile(uint16_t id, const utf8* path) { auto languagePack = LanguagePack::FromFile(id, path); return languagePack; } - ILanguagePack* FromText(uint16_t id, const utf8* text) + std::unique_ptr FromText(uint16_t id, const utf8* text) { auto languagePack = LanguagePack::FromText(id, text); return languagePack; diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index e6301b9135..ef3a17bbbf 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -11,6 +11,7 @@ #include "../common.h" +#include #include #include @@ -30,6 +31,6 @@ struct ILanguagePack namespace LanguagePackFactory { - ILanguagePack* FromFile(uint16_t id, const utf8* path); - ILanguagePack* FromText(uint16_t id, const utf8* text); + std::unique_ptr FromFile(uint16_t id, const utf8* path); + std::unique_ptr FromText(uint16_t id, const utf8* text); } // namespace LanguagePackFactory diff --git a/src/openrct2/localisation/LocalisationService.cpp b/src/openrct2/localisation/LocalisationService.cpp index 15a1a23db6..965e177233 100644 --- a/src/openrct2/localisation/LocalisationService.cpp +++ b/src/openrct2/localisation/LocalisationService.cpp @@ -86,12 +86,11 @@ void LocalisationService::OpenLanguage(int32_t id) if (id != LANGUAGE_ENGLISH_UK) { filename = GetLanguagePath(LANGUAGE_ENGLISH_UK); - _languageFallback = std::unique_ptr( - LanguagePackFactory::FromFile(LANGUAGE_ENGLISH_UK, filename.c_str())); + _languageFallback = LanguagePackFactory::FromFile(LANGUAGE_ENGLISH_UK, filename.c_str()); } filename = GetLanguagePath(id); - _languageCurrent = std::unique_ptr(LanguagePackFactory::FromFile(id, filename.c_str())); + _languageCurrent = LanguagePackFactory::FromFile(id, filename.c_str()); if (_languageCurrent != nullptr) { _currentLanguage = id; diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index b6b3a0206f..d3a969e521 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -23,27 +23,25 @@ protected: TEST_F(LanguagePackTest, create_empty) { - ILanguagePack* empty = LanguagePackFactory::FromText(0, ""); + auto empty = LanguagePackFactory::FromText(0, ""); ASSERT_EQ(empty->GetId(), 0); ASSERT_EQ(empty->GetCount(), 0U); - delete empty; } TEST_F(LanguagePackTest, create_mutable_id_1) { - ILanguagePack* lang = LanguagePackFactory::FromText(1, "STR_0000:\n"); + auto lang = LanguagePackFactory::FromText(1, "STR_0000:\n"); ASSERT_EQ(lang->GetId(), 1); ASSERT_EQ(lang->GetCount(), 1U); ASSERT_STREQ(lang->GetString(0), nullptr); lang->SetString(0, "xx"); ASSERT_EQ(lang->GetCount(), 1U); ASSERT_STREQ(lang->GetString(0), "xx"); - delete lang; } TEST_F(LanguagePackTest, language_pack_simple) { - ILanguagePack* lang = LanguagePackFactory::FromText(0, LanguageEnGB); + auto lang = LanguagePackFactory::FromText(0, LanguageEnGB); ASSERT_EQ(lang->GetId(), 0); ASSERT_EQ(lang->GetCount(), 4U); ASSERT_STREQ(lang->GetString(2), "Spiral Roller Coaster"); @@ -55,12 +53,11 @@ TEST_F(LanguagePackTest, language_pack_simple) ASSERT_EQ(lang->GetString(1000), nullptr); ASSERT_EQ(lang->GetScenarioOverrideStringId("No such park", 0), STR_NONE); ASSERT_EQ(lang->GetObjectOverrideStringId(" ", 0), STR_NONE); - delete lang; } TEST_F(LanguagePackTest, language_pack_multibyte) { - ILanguagePack* lang = LanguagePackFactory::FromText(0, (const utf8*)LanguageZhTW); + auto lang = LanguagePackFactory::FromText(0, (const utf8*)LanguageZhTW); ASSERT_EQ(lang->GetId(), 0); ASSERT_EQ(lang->GetCount(), 4U); ASSERT_STREQ(lang->GetString(2), u8"懸吊式雲霄飛車"); @@ -70,7 +67,6 @@ TEST_F(LanguagePackTest, language_pack_multibyte) ASSERT_STREQ(lang->GetString(0x7002), u8"在隱藏於森林深處的清空範圍中, 建造一個很受歡迎的樂園"); ASSERT_EQ(lang->GetObjectOverrideStringId("CONDORRD", 0), 0x6000); ASSERT_STREQ(lang->GetString(0x6000), u8"神鷹暢遊"); - delete lang; } const utf8* LanguagePackTest::LanguageEnGB = "# STR_XXXX part is read and XXXX becomes the string id number.\n" From d8997cd60fcff2296c71e427865b1c0788d33743 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 21 Aug 2021 04:07:57 +0000 Subject: [PATCH 199/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ko-KR.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 0b2aa1aec2..2e57f042b9 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -3656,6 +3656,7 @@ STR_6452 :{WINDOW_COLOUR_2}판매: {BLACK}{STRING} STR_6453 :버전 정보 복사 STR_6454 :팻말 이름을 변경할 수 없습니다… STR_6455 :팻말 이름을 변경할 수 없습니다… +STR_6456 :초대형 스크린 샷 ############# # Scenarios # From f5935931e307abd99641270d1230e479623d697a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 21 Aug 2021 09:42:05 +0200 Subject: [PATCH 200/681] Port remaining DrawTextWrapped calls with void args to Formatter --- src/openrct2-ui/windows/Multiplayer.cpp | 10 ++++++---- src/openrct2-ui/windows/Research.cpp | 18 ++++++++++++------ src/openrct2-ui/windows/Ride.cpp | 11 +++++++---- src/openrct2-ui/windows/TextInput.cpp | 9 ++++++--- src/openrct2-ui/windows/TrackDesignManage.cpp | 4 +++- src/openrct2/drawing/Text.cpp | 11 +++-------- src/openrct2/drawing/Text.h | 3 --- src/openrct2/interface/Chat.cpp | 5 +++-- 8 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 0f4e52b165..bd0b16afd3 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -415,16 +415,18 @@ static void window_multiplayer_information_paint(rct_window* w, rct_drawpixelinf const utf8* name = network_get_server_name(); { - screenCoords.y += DrawTextWrapped( - dpi, screenCoords, width, STR_STRING, static_cast(&name), { w->colours[1] }); + auto ft = Formatter(); + ft.Add(name); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); screenCoords.y += LIST_ROW_HEIGHT / 2; } const utf8* description = network_get_server_description(); if (!str_is_null_or_empty(description)) { - screenCoords.y += DrawTextWrapped( - dpi, screenCoords, width, STR_STRING, static_cast(&description), { w->colours[1] }); + auto ft = Formatter(); + ft.Add(description); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); screenCoords.y += LIST_ROW_HEIGHT / 2; } diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 708de4aed7..54ab4c7b2e 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -288,7 +288,6 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp auto screenCoords = w->windowPos + ScreenCoordsXY{ 10, w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + baseWidgetIndex].top + 12 }; - rct_string_id stringId; if (gResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) { @@ -341,16 +340,20 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp } } } - DrawTextWrapped(dpi, screenCoords, 296, label, &strings); + auto ft = Formatter(); + ft.Add(strings[0]); + ft.Add(strings[1]); + DrawTextWrapped(dpi, screenCoords, 296, label, ft); screenCoords.y += 25; // Progress - stringId = ResearchStageNames[gResearchProgressStage]; - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, &stringId); + ft = Formatter(); + ft.Add(ResearchStageNames[gResearchProgressStage]); + DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); screenCoords.y += 15; // Expected - auto ft = Formatter(); + ft = Formatter(); if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gResearchExpectedDay != 255) { // TODO: Should probably use game date format setting @@ -395,7 +398,10 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp } } - DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, &strings); + auto ft = Formatter(); + ft.Add(strings[0]); + ft.Add(strings[1]); + DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index a1440b29db..e44d140d7a 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2931,12 +2931,13 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) auto screenCoords = w->windowPos + ScreenCoordsXY{ 8, 64 }; // Description - screenCoords.y += DrawTextWrapped( - dpi, screenCoords, 300, STR_BLACK_STRING, &rideEntry->naming.Description, { TextAlignment::LEFT }); + auto ft = Formatter(); + ft.Add(rideEntry->naming.Description); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); screenCoords.y += 2; // Capacity - auto ft = Formatter(); + ft = Formatter(); ft.Add(rideEntry->capacity); DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); @@ -6941,7 +6942,9 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) { queueTime = ride->GetMaxQueueTime(); stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES; - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, &queueTime, { TextAlignment::LEFT }); + ft = Formatter(); + ft.Add(queueTime); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT }); screenCoords.y += 5; } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 011a457914..e942ecd3e9 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -202,14 +202,17 @@ public: if (_descriptionStringId == STR_NONE) { - auto* text = _description.c_str(); + auto ft = Formatter(); + ft.Add(_description.c_str()); DrawTextWrapped( - &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, &text, { colours[1], TextAlignment::CENTRE }); + &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); } else { + auto ft = Formatter(); + ft.Add(TextInputDescriptionArgs); DrawTextWrapped( - &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, &TextInputDescriptionArgs, + &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, ft, { colours[1], TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index ffeedee4e8..26d3bf50d5 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -247,9 +247,11 @@ static void window_track_delete_prompt_paint(rct_window* w, rct_drawpixelinfo* d { WindowDrawWidgets(w, dpi); + auto ft = Formatter(); + ft.Add(_trackDesignFileReference->name); DrawTextWrapped( dpi, { w->windowPos.x + (WW_DELETE_PROMPT / 2), w->windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), - STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, &_trackDesignFileReference->name, { TextAlignment::CENTRE }); + STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE }); } static void window_track_design_list_reload_tracks() diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 0c5a150993..8782f5c85b 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -141,9 +141,11 @@ void gfx_draw_string_no_formatting( } int32_t DrawTextWrapped( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const void* args, + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, TextPaint textPaint) { + const void* args = ft.Data(); + utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); @@ -165,10 +167,3 @@ int32_t DrawTextWrapped( return layout.GetHeight(); } - -int32_t DrawTextWrapped( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft, - TextPaint textPaint) -{ - return DrawTextWrapped(dpi, coords, width, format, ft.Data(), textPaint); -} diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index c49093e8a3..87f3c63cfd 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -153,6 +153,3 @@ void DrawTextEllipsised( int32_t DrawTextWrapped( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const Formatter& ft = {}, TextPaint textPaint = {}); -int32_t DrawTextWrapped( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, const void* args, - TextPaint textPaint = {}); diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 0a50e66ebd..820352ccbe 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -189,9 +189,10 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor) screenCoords.y = _chatBottom - inputLineHeight - 5; auto lineCh = lineBuffer.c_str(); + auto ft = Formatter(); + ft.Add(lineCh); inputLineHeight = DrawTextWrapped( - dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, static_cast(&lineCh), - { TEXT_COLOUR_255 }); + dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 }); gfx_set_dirty_blocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } }); // TODO: Show caret if the input text has multiple lines From dd2467d805b3de5cfcc2e07d01c1b9a5f4caf938 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 21 Aug 2021 09:43:26 +0200 Subject: [PATCH 201/681] Update include guards - Update from C-style to pragma once - Add missing include guard to ui.h --- src/openrct2-ui/Ui.h | 2 ++ src/openrct2/Cheats.h | 5 +---- src/openrct2/CmdlineSprite.h | 5 +---- src/openrct2/Input.h | 5 +---- src/openrct2/Intro.h | 5 +---- src/openrct2/interface/Chat.h | 5 +---- src/openrct2/localisation/Currency.h | 5 +---- src/openrct2/paint/tile_element/Paint.Surface.h | 5 +---- src/openrct2/peep/Peep.h | 5 +---- src/openrct2/peep/Staff.h | 5 +---- src/openrct2/platform/Crash.h | 5 +---- src/openrct2/ride/CableLift.h | 5 +---- src/openrct2/ride/VehicleData.h | 5 +---- src/openrct2/ride/VehiclePaint.h | 5 +---- src/openrct2/ride/coaster/JuniorRollerCoaster.h | 5 +---- src/openrct2/sprites.h | 5 +---- src/openrct2/util/SawyerCoding.h | 5 +---- src/openrct2/world/MapHelpers.h | 5 +---- src/openrct2/world/Water.h | 5 +---- test/testpaint/Addresses.h | 5 +---- test/testpaint/Data.h | 5 +---- 21 files changed, 22 insertions(+), 80 deletions(-) diff --git a/src/openrct2-ui/Ui.h b/src/openrct2-ui/Ui.h index 3922630fb5..cc0f0077cd 100644 --- a/src/openrct2-ui/Ui.h +++ b/src/openrct2-ui/Ui.h @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#pragma once + #ifdef _MSC_VER int NormalisedMain(int argc, const char** argv); #endif diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index 4f36817073..47653acd6b 100644 --- a/src/openrct2/Cheats.h +++ b/src/openrct2/Cheats.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _CHEATS_H_ -#define _CHEATS_H_ +#pragma once #include "common.h" @@ -120,5 +119,3 @@ void CheatsReset(); const char* CheatsGetName(CheatType cheatType); void CheatsSet(CheatType cheatType, int32_t param1 = 0, int32_t param2 = 0); void CheatsSerialise(class DataSerialiser& ds); - -#endif diff --git a/src/openrct2/CmdlineSprite.h b/src/openrct2/CmdlineSprite.h index 58227cc23e..e9f4e65686 100644 --- a/src/openrct2/CmdlineSprite.h +++ b/src/openrct2/CmdlineSprite.h @@ -7,12 +7,9 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _CMDLINE_SPRITE_H_ -#define _CMDLINE_SPRITE_H_ +#pragma once #include "common.h" int32_t cmdline_for_sprite(const char** argv, int32_t argc); extern int32_t gSpriteMode; - -#endif diff --git a/src/openrct2/Input.h b/src/openrct2/Input.h index c27addc3da..0de27cf7d4 100644 --- a/src/openrct2/Input.h +++ b/src/openrct2/Input.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _INPUT_H_ -#define _INPUT_H_ +#pragma once #include "interface/Window.h" @@ -117,5 +116,3 @@ void reset_tooltip_not_shown(); void input_reset_place_obj_modifier(); void InputScrollViewport(const ScreenCoordsXY& screenCoords); - -#endif diff --git a/src/openrct2/Intro.h b/src/openrct2/Intro.h index 70e9592fe3..8fbf9f9c27 100644 --- a/src/openrct2/Intro.h +++ b/src/openrct2/Intro.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _INTRO_H_ -#define _INTRO_H_ +#pragma once #include "common.h" @@ -34,5 +33,3 @@ extern IntroState gIntroState; void intro_update(); void intro_draw(rct_drawpixelinfo* dpi); - -#endif diff --git a/src/openrct2/interface/Chat.h b/src/openrct2/interface/Chat.h index d3885109f8..a51cba25a8 100644 --- a/src/openrct2/interface/Chat.h +++ b/src/openrct2/interface/Chat.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _CHAT_H_ -#define _CHAT_H_ +#pragma once #include "../common.h" @@ -42,5 +41,3 @@ void chat_history_add(const char* src); void chat_input(ChatInput input); int32_t chat_string_wrapped_get_height(void* args, int32_t width); - -#endif diff --git a/src/openrct2/localisation/Currency.h b/src/openrct2/localisation/Currency.h index a926f70bf8..9acb00e791 100644 --- a/src/openrct2/localisation/Currency.h +++ b/src/openrct2/localisation/Currency.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef CURRENCY_H -#define CURRENCY_H +#pragma once #include "../common.h" @@ -68,5 +67,3 @@ extern currency_descriptor CurrencyDescriptors[static_cast(CurrencyType * custom currency entry */ void currency_load_custom_currency_config(); - -#endif diff --git a/src/openrct2/paint/tile_element/Paint.Surface.h b/src/openrct2/paint/tile_element/Paint.Surface.h index 15a7a6793e..2010377992 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.h +++ b/src/openrct2/paint/tile_element/Paint.Surface.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PAINT_SURFACE_H -#define _PAINT_SURFACE_H +#pragma once #include "../../common.h" #include "../../sprites.h" @@ -104,5 +103,3 @@ enum SPR_RCT1_WATER_MASK = SPR_CSG_BEGIN + 46787, SPR_RCT1_WATER_OVERLAY = SPR_CSG_BEGIN + 46792, }; - -#endif //_PAINT_SURFACE_H diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index cf3f035803..6f4bad1206 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PEEP_H_ -#define _PEEP_H_ +#pragma once #include "../common.h" #include "../management/Finance.h" @@ -1036,5 +1035,3 @@ inline const rct_sprite_bounds& GetSpriteBounds( { return g_peep_animation_entries[EnumValue(spriteType)].sprite_bounds[EnumValue(actionSpriteType)]; }; - -#endif diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 245af03882..795b9d0fcc 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _STAFF_H_ -#define _STAFF_H_ +#pragma once #include "../common.h" #include "Peep.h" @@ -75,5 +74,3 @@ int32_t staff_get_available_entertainer_costume_list(EntertainerCostume* costume money32 GetStaffWage(StaffType type); PeepSpriteType EntertainerCostumeToSprite(EntertainerCostume entertainerType); - -#endif diff --git a/src/openrct2/platform/Crash.h b/src/openrct2/platform/Crash.h index ef1b140122..46c4a1c966 100644 --- a/src/openrct2/platform/Crash.h +++ b/src/openrct2/platform/Crash.h @@ -7,12 +7,9 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _OPENRCT2_CRASH_ -#define _OPENRCT2_CRASH_ +#pragma once using CExceptionHandler = void*; extern bool gOpenRCT2SilentBreakpad; CExceptionHandler crash_init(); - -#endif /* _OPENRCT2_CRASH_ */ diff --git a/src/openrct2/ride/CableLift.h b/src/openrct2/ride/CableLift.h index 2c1ec083bd..7660f052af 100644 --- a/src/openrct2/ride/CableLift.h +++ b/src/openrct2/ride/CableLift.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _CABLE_LIFT_H_ -#define _CABLE_LIFT_H_ +#pragma once #include "../common.h" #include "Ride.h" @@ -17,5 +16,3 @@ struct Vehicle; Vehicle* cable_lift_segment_create( Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head); - -#endif diff --git a/src/openrct2/ride/VehicleData.h b/src/openrct2/ride/VehicleData.h index c4fb7940b6..f78ee882fe 100644 --- a/src/openrct2/ride/VehicleData.h +++ b/src/openrct2/ride/VehicleData.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _VEHICLE_DATA_H -#define _VEHICLE_DATA_H +#pragma once #include "../common.h" @@ -31,5 +30,3 @@ extern const int32_t dword_9A2930[]; extern const int32_t dword_9A2970[]; extern const int32_t SpriteDirectionToSoundDirection[]; - -#endif diff --git a/src/openrct2/ride/VehiclePaint.h b/src/openrct2/ride/VehiclePaint.h index 5bbe90dc61..24edb42b9d 100644 --- a/src/openrct2/ride/VehiclePaint.h +++ b/src/openrct2/ride/VehiclePaint.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _VEHICLE_PAINT_H -#define _VEHICLE_PAINT_H +#pragma once #include "../common.h" @@ -61,5 +60,3 @@ void vehicle_visual_mini_golf_player( paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); void vehicle_visual_mini_golf_ball( paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); - -#endif diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/JuniorRollerCoaster.h index d9bbcaaf66..be1220034e 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _JUNIOR_ROLLER_COASTER_H -#define _JUNIOR_ROLLER_COASTER_H +#pragma once #include "../../common.h" @@ -114,5 +113,3 @@ void junior_rc_paint_track_diag_25_deg_down_to_flat( void junior_rc_paint_track_diag_60_deg_down_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType); - -#endif // _JUNIOR_ROLLER_COASTER_H diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 87b9c8ee91..991e0ef714 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _SPRITES_H_ -#define _SPRITES_H_ +#pragma once #include "drawing/ScrollingText.h" #include "rct1/RCT1.h" @@ -1098,5 +1097,3 @@ enum SPR_IMAGE_LIST_BEGIN = SPR_SCROLLING_TEXT_END, SPR_IMAGE_LIST_END = 0x7FFFE }; - -#endif diff --git a/src/openrct2/util/SawyerCoding.h b/src/openrct2/util/SawyerCoding.h index db4a2a1b70..3045ce888e 100644 --- a/src/openrct2/util/SawyerCoding.h +++ b/src/openrct2/util/SawyerCoding.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _SAWYERCODING_H_ -#define _SAWYERCODING_H_ +#pragma once #include "../common.h" @@ -55,5 +54,3 @@ int32_t sawyercoding_validate_track_checksum(const uint8_t* src, size_t length); int32_t sawyercoding_detect_file_type(const uint8_t* src, size_t length); int32_t sawyercoding_detect_rct1_version(int32_t gameVersion); - -#endif diff --git a/src/openrct2/world/MapHelpers.h b/src/openrct2/world/MapHelpers.h index bfcc7af89f..a2097c8a0a 100644 --- a/src/openrct2/world/MapHelpers.h +++ b/src/openrct2/world/MapHelpers.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _MAP_HELPERS_H_ -#define _MAP_HELPERS_H_ +#pragma once #include "../common.h" @@ -22,5 +21,3 @@ enum int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b); int32_t tile_smooth(int32_t x, int32_t y); - -#endif diff --git a/src/openrct2/world/Water.h b/src/openrct2/world/Water.h index ef1af4da04..77943a7c03 100644 --- a/src/openrct2/world/Water.h +++ b/src/openrct2/world/Water.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _WATER_H_ -#define _WATER_H_ +#pragma once #include "../common.h" @@ -28,5 +27,3 @@ struct rct_water_type }; assert_struct_size(rct_water_type, 16); #pragma pack(pop) - -#endif diff --git a/test/testpaint/Addresses.h b/test/testpaint/Addresses.h index 6d71cfa890..8db772bf4c 100644 --- a/test/testpaint/Addresses.h +++ b/test/testpaint/Addresses.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _ADDRESSES_H_ -#define _ADDRESSES_H_ +#pragma once #include @@ -41,5 +40,3 @@ */ int32_t RCT2_CALLPROC_X( int32_t address, int32_t _eax, int32_t _ebx, int32_t _ecx, int32_t _edx, int32_t _esi, int32_t _edi, int32_t _ebp); - -#endif diff --git a/test/testpaint/Data.h b/test/testpaint/Data.h index cb7feebffe..74717d403d 100644 --- a/test/testpaint/Data.h +++ b/test/testpaint/Data.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _TEST_PAINT_DATA_H_ -#define _TEST_PAINT_DATA_H_ +#pragma once #include #include @@ -20,5 +19,3 @@ extern const utf8string TrackElemNames[256]; extern const utf8string RideCodeNames[RCT2_RIDE_TYPE_COUNT]; extern const utf8string TrackCodeNames[256]; extern const uint32_t* RideTypeTrackPaintFunctionsOld[RCT2_RIDE_TYPE_COUNT]; - -#endif // #endif _TEST_PAINT_DATA_H_ From 15d3a4a9daa72af211033bdd7505caf1a9251470 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 21 Aug 2021 12:55:28 +0200 Subject: [PATCH 202/681] Update more include guards (#15254) --- src/openrct2-ui/interface/Graph.h | 5 +---- src/openrct2/Diagnostic.h | 5 +---- src/openrct2/Editor.h | 5 +---- src/openrct2/common.h | 5 +---- src/openrct2/drawing/Drawing.h | 5 +---- src/openrct2/drawing/Font.h | 5 +---- src/openrct2/drawing/LightFX.h | 5 +---- src/openrct2/interface/Colour.h | 5 +---- src/openrct2/interface/FontFamilies.h | 5 +---- src/openrct2/interface/Fonts.h | 5 +---- src/openrct2/interface/Viewport.h | 5 +---- src/openrct2/interface/Widget.h | 5 +---- src/openrct2/interface/Window.h | 5 +---- src/openrct2/localisation/Date.h | 5 +---- src/openrct2/localisation/Language.h | 5 +---- src/openrct2/localisation/Localisation.h | 5 +---- src/openrct2/localisation/StringIds.h | 5 +---- src/openrct2/network/NetworkKey.h | 5 +---- src/openrct2/paint/Supports.h | 5 +---- src/openrct2/paint/sprite/Paint.Sprite.h | 5 +---- src/openrct2/paint/tile_element/Paint.TileElement.h | 5 +---- src/openrct2/platform/platform.h | 5 +---- src/openrct2/rct1/RCT1.h | 5 +---- src/openrct2/ride/Ride.h | 5 +---- src/openrct2/ride/RideData.h | 5 +---- src/openrct2/ride/TrackDesign.h | 5 +---- src/openrct2/ride/TrackPaint.h | 5 +---- src/openrct2/ride/Vehicle.h | 5 +---- src/openrct2/scenario/Scenario.h | 5 +---- src/openrct2/util/Util.h | 5 +---- src/openrct2/world/Entrance.h | 5 +---- src/openrct2/world/Map.h | 5 +---- src/openrct2/world/Scenery.h | 5 +---- src/openrct2/world/Sprite.h | 5 +---- 34 files changed, 34 insertions(+), 136 deletions(-) diff --git a/src/openrct2-ui/interface/Graph.h b/src/openrct2-ui/interface/Graph.h index 509f19a5fd..11c57ed92a 100644 --- a/src/openrct2-ui/interface/Graph.h +++ b/src/openrct2-ui/interface/Graph.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _GRAPH_H_ -#define _GRAPH_H_ +#pragma once #include #include @@ -21,5 +20,3 @@ namespace Graph rct_drawpixelinfo* dpi, const money64* history, const int32_t count, const ScreenCoordsXY& coords, const int32_t modifier, const int32_t offset); } // namespace Graph - -#endif diff --git a/src/openrct2/Diagnostic.h b/src/openrct2/Diagnostic.h index c04e20c4ce..3ecfe7ad3a 100644 --- a/src/openrct2/Diagnostic.h +++ b/src/openrct2/Diagnostic.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _DIAGNOSTIC_H_ -#define _DIAGNOSTIC_H_ +#pragma once #include @@ -88,5 +87,3 @@ void diagnostic_log_with_location( #define log_warning(format, ...) diagnostic_log_macro(DiagnosticLevel::Warning, format, ##__VA_ARGS__) #define log_verbose(format, ...) diagnostic_log(DiagnosticLevel::Verbose, format, ##__VA_ARGS__) #define log_info(format, ...) diagnostic_log_macro(DiagnosticLevel::Information, format, ##__VA_ARGS__) - -#endif diff --git a/src/openrct2/Editor.h b/src/openrct2/Editor.h index 8a7499f2d8..17985ad6cc 100644 --- a/src/openrct2/Editor.h +++ b/src/openrct2/Editor.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _EDITOR_H_ -#define _EDITOR_H_ +#pragma once #include "common.h" #include "object/Object.h" @@ -47,5 +46,3 @@ enum class EditorStep : uint8_t extern EditorStep gEditorStep; void editor_open_windows_for_current_step(); - -#endif diff --git a/src/openrct2/common.h b/src/openrct2/common.h index b562e64c00..cc0e1d517a 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _COMMON_H_ -#define _COMMON_H_ +#pragma once #ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES @@ -232,5 +231,3 @@ constexpr uint16_t SPRITE_INDEX_NULL = 0xFFFF; #else // PLATFORM_X86 # define FASTCALL #endif // PLATFORM_X86 - -#endif diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index c494e66674..1ea01e08e7 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _DRAWING_H_ -#define _DRAWING_H_ +#pragma once #include "../common.h" #include "../interface/Colour.h" @@ -790,5 +789,3 @@ std::optional GetPaletteG1Index(colour_t paletteId); std::optional GetPaletteMapForColour(colour_t paletteId); #include "NewDrawing.h" - -#endif diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index 863dea90b2..0f870d241e 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _DRAWING_FONT_H_ -#define _DRAWING_FONT_H_ +#pragma once #include "../common.h" @@ -68,5 +67,3 @@ int32_t font_get_line_height_small(FontSpriteBase fontSpriteBase); bool font_supports_string_sprite(const utf8* text); bool font_supports_string_ttf(const utf8* text, int32_t fontSize); bool font_supports_string(const utf8* text, int32_t fontSize); - -#endif diff --git a/src/openrct2/drawing/LightFX.h b/src/openrct2/drawing/LightFX.h index acbd5ed4be..1473bb418c 100644 --- a/src/openrct2/drawing/LightFX.h +++ b/src/openrct2/drawing/LightFX.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _LIGHTFX_H -#define _LIGHTFX_H +#pragma once #ifdef __ENABLE_LIGHTFX__ @@ -79,5 +78,3 @@ void lightfx_render_to_texture( const uint32_t* lightPalette); #endif // __ENABLE_LIGHTFX__ - -#endif diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index 44dd0e3719..3dab46bc72 100644 --- a/src/openrct2/interface/Colour.h +++ b/src/openrct2/interface/Colour.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _COLOUR_H_ -#define _COLOUR_H_ +#pragma once #include "../common.h" @@ -217,5 +216,3 @@ namespace Colour #ifndef NO_TTF uint8_t blendColours(const uint8_t paletteIndex1, const uint8_t paletteIndex2); #endif - -#endif diff --git a/src/openrct2/interface/FontFamilies.h b/src/openrct2/interface/FontFamilies.h index 35c3191c98..d227de2d20 100644 --- a/src/openrct2/interface/FontFamilies.h +++ b/src/openrct2/interface/FontFamilies.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef OPENRCT2_FONT_FAMILIES_H -#define OPENRCT2_FONT_FAMILIES_H +#pragma once #define FAMILY_OPENRCT2_SPRITE nullptr @@ -33,5 +32,3 @@ extern TTFontFamily const TTFFamilySansSerif; # define FAMILY(x) FAMILY_OPENRCT2_SPRITE #endif // NO_TTF - -#endif // OPENRCT2_FONT_FAMILIES_H diff --git a/src/openrct2/interface/Fonts.h b/src/openrct2/interface/Fonts.h index 2eaea52884..5ca8073802 100644 --- a/src/openrct2/interface/Fonts.h +++ b/src/openrct2/interface/Fonts.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef OPENRCT2_FONTS_H -#define OPENRCT2_FONTS_H +#pragma once namespace OpenRCT2::Localisation { @@ -37,5 +36,3 @@ extern TTFFontSetDescriptor TTFFontMicroHei; #endif // NO_TTF void TryLoadFonts(OpenRCT2::Localisation::LocalisationService& localisationService); - -#endif // OPENRCT2_FONTS_H diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index e5ae588f0b..2212105dd2 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _VIEWPORT_H_ -#define _VIEWPORT_H_ +#pragma once #include "../world/Location.hpp" #include "Window.h" @@ -161,5 +160,3 @@ uint8_t get_current_rotation(); int32_t get_height_marker_offset(); void viewport_set_saved_view(); - -#endif diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index 3f8735f90b..c7ec7a485a 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _WIDGET_H_ -#define _WIDGET_H_ +#pragma once #include "../localisation/StringIds.h" #include "Window.h" @@ -152,5 +151,3 @@ void WidgetSetDisabled(rct_window* w, rct_widgetindex widgetIndex, bool value); void WidgetSetHoldable(rct_window* w, rct_widgetindex widgetIndex, bool value); void WidgetSetVisible(rct_window* w, rct_widgetindex widgetIndex, bool value); void WidgetSetCheckboxValue(rct_window* w, rct_widgetindex widgetIndex, int32_t value); - -#endif diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 4b8b721224..82aa4589f9 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _WINDOW_H_ -#define _WINDOW_H_ +#pragma once #include "../common.h" #include "../localisation/Formatter.h" @@ -899,5 +898,3 @@ extern bool _deferClose; rct_window* window_get_listening(); rct_windowclass window_get_classification(rct_window* window); - -#endif diff --git a/src/openrct2/localisation/Date.h b/src/openrct2/localisation/Date.h index f8de349382..b9099e218d 100644 --- a/src/openrct2/localisation/Date.h +++ b/src/openrct2/localisation/Date.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _DATE_H_ -#define _DATE_H_ +#pragma once #include "../common.h" @@ -64,5 +63,3 @@ bool date_is_day_start(int32_t monthTicks); bool date_is_week_start(int32_t monthTicks); bool date_is_fortnight_start(int32_t monthTicks); bool date_is_month_start(int32_t monthTicks); - -#endif diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index 557bbe4197..9723da13f1 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _LANGUAGE_H_ -#define _LANGUAGE_H_ +#pragma once #include "../common.h" #include "../drawing/Font.h" @@ -137,5 +136,3 @@ constexpr utf8* utf8_write_codepoint(utf8* dst, uint32_t codepoint) return dst + 4; } } - -#endif diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index 140023c147..b31df20aa7 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef LOCALISATION_H -#define LOCALISATION_H +#pragma once #include "../management/Marketing.h" #include "Currency.h" @@ -68,5 +67,3 @@ extern const rct_string_id PeepThoughts[174]; extern const rct_string_id DateDayNames[31]; extern const rct_string_id DateGameMonthNames[MONTH_COUNT]; extern const rct_string_id DateGameShortMonthNames[MONTH_COUNT]; - -#endif diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 148b2821bf..64b53a5e8f 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _STRING_IDS_H_ -#define _STRING_IDS_H_ +#pragma once #include "../common.h" @@ -3913,5 +3912,3 @@ enum // 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 }; - -#endif diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index 73f58de2b6..2cbe16c431 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef NETWORKKEY_H -#define NETWORKKEY_H +#pragma once #ifndef DISABLE_NETWORK @@ -50,5 +49,3 @@ private: }; #endif // DISABLE_NETWORK - -#endif // NETWORKKEY_H diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 69f9956d09..11982addc9 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _DRAWING_SUPPORTS_H_ -#define _DRAWING_SUPPORTS_H_ +#pragma once #include "../common.h" #include "../world/Footpath.h" @@ -54,5 +53,3 @@ enum { SUPPORTS_SLOPE_5 = 1 << 5 }; - -#endif diff --git a/src/openrct2/paint/sprite/Paint.Sprite.h b/src/openrct2/paint/sprite/Paint.Sprite.h index 1c038aa53a..12e843a157 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.h +++ b/src/openrct2/paint/sprite/Paint.Sprite.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PAINT_SPRITE_H -#define _PAINT_SPRITE_H +#pragma once #include "../../common.h" @@ -19,5 +18,3 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t template void PaintEntity(paint_session* session, const T* entity, int32_t imageDirection); extern const uint32_t vehicle_particle_base_sprites[5]; - -#endif diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index a30de42269..1c0016d591 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PAINT_TILE_ELEMENT_H -#define _PAINT_TILE_ELEMENT_H +#pragma once #include "../../common.h" #include "../../world/Map.h" @@ -113,5 +112,3 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh void PaintTrack(paint_session* session, uint8_t direction, int32_t height, const TrackElement& tileElement); bool PaintShouldShowHeightMarkers(const paint_session* session, const uint32_t viewportFlag); - -#endif diff --git a/src/openrct2/platform/platform.h b/src/openrct2/platform/platform.h index e0fb88d3fe..d3d898178b 100644 --- a/src/openrct2/platform/platform.h +++ b/src/openrct2/platform/platform.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ +#pragma once #include "../common.h" #include "../config/Config.h" @@ -167,5 +166,3 @@ public: void platform_android_init_class_loader(); jclass platform_android_find_class(JNIEnv* env, const char* name); #endif // __ANDROID__ - -#endif diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index e0dbcb6ddb..fb55d96cdf 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _RCT1_H_ -#define _RCT1_H_ +#pragma once #include "../management/Award.h" #include "../management/NewsItem.h" @@ -1289,5 +1288,3 @@ void load_from_sv4(const char* path); void load_from_sc4(const char* path); track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType); - -#endif diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 1c0340b0b9..400507c89c 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _RIDE_H_ -#define _RIDE_H_ +#pragma once #include "../common.h" #include "../localisation/Formatter.h" @@ -1254,5 +1253,3 @@ void ride_action_modify(Ride* ride, int32_t modifyType, int32_t flags); void determine_ride_entrance_and_exit_locations(); void ride_clear_leftover_entrances(Ride* ride); - -#endif diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index a55effda55..1905c17d96 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _RIDE_DATA_H_ -#define _RIDE_DATA_H_ +#pragma once #define TRACK_COLOUR_PRESETS(...) \ { \ @@ -365,5 +364,3 @@ constexpr bool RideTypeIsValid(ObjectEntryIndex rideType) { return rideType < std::size(RideTypeDescriptors); } - -#endif diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index e7da3a3328..d9b69783ff 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _TRACK_DESIGN_H_ -#define _TRACK_DESIGN_H_ +#pragma once #include "../common.h" #include "../object/Object.h" @@ -225,5 +224,3 @@ bool track_design_are_entrance_and_exit_placed(); extern std::vector _trackSavedTileElementsDesc; extern std::vector _trackSavedTileElements; - -#endif diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 2aaf550a18..5f7139116e 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _TRACK_PAINT_H -#define _TRACK_PAINT_H +#pragma once #include "../common.h" #include "../paint/Paint.h" @@ -479,5 +478,3 @@ namespace SingleRailRC { TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } - -#endif diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index d9fa5b711e..d24d584abc 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _VEHICLE_H_ -#define _VEHICLE_H_ +#pragma once #include "../audio/audio.h" #include "../common.h" @@ -563,5 +562,3 @@ extern int32_t _vehicleUnkF64E10; extern uint8_t _vehicleF64E2C; extern Vehicle* _vehicleFrontVehicle; extern CoordsXYZ unk_F64E20; - -#endif diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 26e7f177ed..d350236d5d 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _SCENARIO_H_ -#define _SCENARIO_H_ +#pragma once #include "../common.h" #include "../core/Random.hpp" @@ -467,5 +466,3 @@ void scenario_failure(); void scenario_success(); void scenario_success_submit_name(const char* name); void scenario_autosave_check(); - -#endif diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 766d60faa1..e0db4f33a2 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _UTIL_H_ -#define _UTIL_H_ +#pragma once #include "../common.h" @@ -88,5 +87,3 @@ template constexpr auto EnumValue(TEnum enumerator) noexcept { return static_cast>(enumerator); } - -#endif diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index f8dbfbcd63..8d3b20eade 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _ENTRANCE_H_ -#define _ENTRANCE_H_ +#pragma once #include "../common.h" #include "Location.hpp" @@ -56,5 +55,3 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance); void maze_entrance_hedge_removal(const CoordsXYE& entrance); void fix_park_entrance_locations(); - -#endif diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 2f6ccb551a..ed0bdb7275 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _MAP_H_ -#define _MAP_H_ +#pragma once #include "../common.h" #include "Location.hpp" @@ -312,5 +311,3 @@ uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos); void FixLandOwnershipTiles(std::initializer_list tiles); void FixLandOwnershipTilesWithOwnership( std::initializer_list tiles, uint8_t ownership, bool doNotDowngrade = false); - -#endif diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index f6d8620504..d5948ab0f7 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _SCENERY_H_ -#define _SCENERY_H_ +#pragma once #include "../common.h" #include "../world/Location.hpp" @@ -290,5 +289,3 @@ PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex); rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); - -#endif diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 6ac0545b30..14db05fa25 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -7,8 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#ifndef _SPRITE_H_ -#define _SPRITE_H_ +#pragma once #include "../common.h" #include "SpriteBase.h" @@ -47,5 +46,3 @@ rct_sprite_checksum sprite_checksum(); void sprite_set_flashing(SpriteBase* sprite, bool flashing); bool sprite_get_flashing(SpriteBase* sprite); - -#endif From 0e08286d88c3ea078b696e2089501b7332d0d545 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sat, 21 Aug 2021 01:01:54 +0300 Subject: [PATCH 203/681] Apply review comments --- src/openrct2/paint/Supports.cpp | 3 +-- .../paint/tile_element/Paint.LargeScenery.cpp | 14 ++++---------- src/openrct2/ride/TrackPaint.cpp | 4 ++-- src/openrct2/ride/coaster/WoodenRollerCoaster.cpp | 5 ++--- src/openrct2/ride/thrill/MagicCarpet.cpp | 4 +--- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 3cb7ce746b..9ac36e4c81 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -603,8 +603,7 @@ bool wooden_a_supports_paint_setup( if (byte_97B23C[special].var_6 == 0 || session->WoodenSupportsPrependTo == nullptr) { PaintAddImageAsParent( - session, imageId, { 0, 0, z }, { bBox.length.x, bBox.length.y, bBox.length.z }, - { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); + session, imageId, { 0, 0, z }, bBox.length, { bBox.offset.x, bBox.offset.y, bBox.offset.z + z }); hasSupports = true; } else diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index ea436e96ce..1fdaa946e4 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -244,8 +244,6 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh uint32_t dword_F4387C = 0; image_id |= SPRITE_ID_PALETTE_COLOUR_2(tileElement.GetPrimaryColour(), tileElement.GetSecondaryColour()); - CoordsXYZ boxlength; - CoordsXYZ boxoffset; if (gTrackDesignSaveMode) { if (!track_design_save_contains_tile_element(reinterpret_cast(&tileElement))) @@ -283,13 +281,9 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh edi = rol16(edi, direction); esi = (edi & 0xF) | (edi >> 12); } - boxoffset.x = s98E3C4[esi].offset.x; - boxoffset.y = s98E3C4[esi].offset.y; - boxoffset.z = height; - boxlength.x = s98E3C4[esi].length.x; - boxlength.y = s98E3C4[esi].length.y; - boxlength.z = boxlengthZ; - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { boxlength.x, boxlength.y, boxlengthZ }, boxoffset); + const CoordsXYZ bbLength = { s98E3C4[esi].offset, height }; + const CoordsXYZ bbOffset = { s98E3C4[esi].length, boxlengthZ }; + PaintAddImageAsParent(session, image_id, { 0, 0, height }, bbLength, bbOffset); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); @@ -453,7 +447,7 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; PaintAddImageAsChild( session, scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, ft, scroll, scrollMode, textColour), 0, 0, 1, 1, 21, - height + 25, boxoffset.x, boxoffset.y, boxoffset.z); + height + 25, bbOffset.x, bbOffset.y, bbOffset.z); } large_scenery_paint_supports(session, direction, height, tileElement, dword_F4387C, tile); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index d30bb0b83f..35efa3bf9c 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1638,8 +1638,8 @@ void track_paint_util_right_quarter_turn_3_tiles_paint( CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index]); PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), height }, - { boundsLength.x, boundsLength.y, thickness }, { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); + session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, thickness }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } void track_paint_util_right_quarter_turn_3_tiles_paint_2( diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index b3f6b94017..56fb20dca3 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -428,9 +428,8 @@ static void wooden_rc_track_paint_bb(paint_session* session, const sprite_bb_2* uint32_t railsImageId = bb->sprite_id_b | wooden_rc_get_rails_colour(session); PaintAddImageAsParent( - session, imageId, { static_cast(bb->offset.x), static_cast(bb->offset.y), height + bb->offset.z }, - { bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z) }, - { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); + session, imageId, { bb->offset.x, bb->offset.y, height + bb->offset.z }, + { bb->bb_size.x, bb->bb_size.y, bb->bb_size.z }, { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); PaintAddImageAsChild( session, railsImageId, static_cast(bb->offset.x), static_cast(bb->offset.y), bb->bb_size.x, bb->bb_size.y, static_cast(bb->bb_size.z), height + bb->offset.z, bb->bb_offset.x, bb->bb_offset.y, diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 4b274c6a08..44d609520f 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -84,9 +84,7 @@ static void paint_magic_carpet_frame( imageId |= session->TrackColours[SCHEME_TRACK]; if (plane == PLANE_BACK) { - PaintAddImageAsParent( - session, imageId, { static_cast(offset.x), static_cast(offset.y), offset.z }, - { bbSize.x, bbSize.y, 127 }, { bbOffset.x, bbOffset.y, bbOffset.z }); + PaintAddImageAsParent(session, imageId, offset, { bbSize.x, bbSize.y, 127 }, bbOffset); } else { From c49c6ca4a745a057cacaa9f118818b8c0ebe21cf Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sat, 21 Aug 2021 10:23:27 -0700 Subject: [PATCH 204/681] Rename animation vars --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/rct1/RCT1.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/CableLift.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 105 ++++++++++++++-------------- src/openrct2/ride/Vehicle.h | 2 +- src/openrct2/world/Entity.cpp | 2 +- 11 files changed, 62 insertions(+), 63 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 5574143b7f..b372119ce4 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -424,7 +424,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots { COMPARE_FIELD(Vehicle, pad_C6[i]); } - COMPARE_FIELD(Vehicle, var_C8); + COMPARE_FIELD(Vehicle, animationState); COMPARE_FIELD(Vehicle, var_CA); COMPARE_FIELD(Vehicle, scream_sound_id); COMPARE_FIELD(Vehicle, TrackSubposition); diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index fb55d96cdf..a516081618 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -300,7 +300,7 @@ struct rct1_vehicle : RCT12SpriteBase uint8_t var_C4; uint8_t animation_frame; uint8_t pad_C6[0x2]; - uint16_t var_C8; + uint16_t animationState; uint16_t var_CA; uint8_t scream_sound_id; // 0xCC uint8_t TrackSubposition; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c4a4a54212..22b2015af1 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2715,7 +2715,7 @@ template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase dst->var_C0 = src->var_C0; dst->var_C4 = src->var_C4; dst->animation_frame = src->animation_frame; - dst->var_C8 = src->var_C8; + dst->animationState = src->animationState; dst->var_CA = src->var_CA; dst->var_CE = src->var_CE; dst->var_D3 = src->var_D3; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index d3a95d98b7..85b4999605 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -537,7 +537,7 @@ struct RCT2SpriteVehicle : RCT12SpriteBase }; uint8_t animation_frame; // 0xC5 uint8_t pad_C6[0x2]; - uint16_t var_C8; + uint16_t animationState; uint16_t var_CA; uint8_t scream_sound_id; // 0xCC uint8_t TrackSubposition; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 9f0d58f773..79d752261b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1179,7 +1179,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle* dst->powered_acceleration = src->powered_acceleration; dst->dodgems_collision_direction = src->dodgems_collision_direction; dst->animation_frame = src->animation_frame; - dst->var_C8 = src->var_C8; + dst->animationState = src->animationState; dst->var_CA = src->var_CA; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = static_cast(src->TrackSubposition); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ed4a4397d9..2717601fee 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1663,7 +1663,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->powered_acceleration = src->powered_acceleration; dst->dodgems_collision_direction = src->dodgems_collision_direction; dst->animation_frame = src->animation_frame; - dst->var_C8 = src->var_C8; + dst->animationState = src->animationState; dst->var_CA = src->var_CA; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 913f395a80..3432ed6b92 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -54,7 +54,7 @@ Vehicle* cable_lift_segment_create( current->sound2_id = OpenRCT2::Audio::SoundId::Null; current->var_C4 = 0; current->animation_frame = 0; - current->var_C8 = 0; + current->animationState = 0; current->var_CA = 0; current->scream_sound_id = OpenRCT2::Audio::SoundId::Null; current->Pitch = 0; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 0cc906322d..f979b1dacf 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3058,7 +3058,7 @@ static Vehicle* vehicle_create_car( vehicle->next_vehicle_on_train = SPRITE_INDEX_NULL; vehicle->var_C4 = 0; vehicle->animation_frame = 0; - vehicle->var_C8 = 0; + vehicle->animationState = 0; vehicle->scream_sound_id = OpenRCT2::Audio::SoundId::Null; vehicle->Pitch = 0; vehicle->bank_rotation = 0; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 50f1c0c22d..5416990bb0 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1522,16 +1522,16 @@ bool Vehicle::OpenRestraints() } if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER && vehicle->animation_frame != 0) { - if (vehicle->var_C8 + 0x3333 < 0xFFFF) + if (vehicle->animationState + 0x3333 < 0xFFFF) { - vehicle->var_C8 = vehicle->var_C8 + 0x3333 - 0xFFFF; + vehicle->animationState = vehicle->animationState + 0x3333 - 0xFFFF; vehicle->animation_frame++; vehicle->animation_frame &= 7; vehicle->Invalidate(); } else { - vehicle->var_C8 += 0x3333; + vehicle->animationState += 0x3333; } restraintsOpen = false; continue; @@ -3639,7 +3639,7 @@ void Vehicle::UpdateCollisionSetup() } train->IsCrashedVehicle = true; - train->var_C8 = scenario_rand(); + train->animationState = scenario_rand(); train->var_CA = scenario_rand(); train->animation_frame = train->var_CA & 0x7; @@ -5408,7 +5408,7 @@ void Vehicle::CrashOnLand() IsCrashedVehicle = true; animation_frame = 0; - var_C8 = 0; + animationState = 0; sprite_width = 13; sprite_height_negative = 45; sprite_height_positive = 5; @@ -5475,7 +5475,7 @@ void Vehicle::CrashOnWater() IsCrashedVehicle = true; animation_frame = 0; - var_C8 = 0; + animationState = 0; sprite_width = 13; sprite_height_negative = 45; sprite_height_positive = 5; @@ -5506,14 +5506,14 @@ void Vehicle::UpdateCrash() ExplosionCloud::Create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); } } - if (curVehicle->var_C8 + 7281 > 0xFFFF) + if (curVehicle->animationState + 7281 > 0xFFFF) { curVehicle->animation_frame++; if (curVehicle->animation_frame >= 8) curVehicle->animation_frame = 0; curVehicle->Invalidate(); } - curVehicle->var_C8 += 7281; + curVehicle->animationState += 7281; continue; } @@ -7275,11 +7275,11 @@ void Vehicle::UpdateSpinningCar() */ void Vehicle::UpdateAdditionalAnimation() { - uint8_t al{}; - uint8_t ah{}; + uint8_t targetFrame{}; + uint8_t curFrame{}; uint32_t eax{}; - uint32_t* curVar_C8 = reinterpret_cast(&var_C8); + uint32_t* curAnimationState = reinterpret_cast(&animationState); auto vehicleEntry = Entry(); if (vehicleEntry == nullptr) { @@ -7288,16 +7288,15 @@ void Vehicle::UpdateAdditionalAnimation() switch (vehicleEntry->animation) { case VEHICLE_ENTRY_ANIMATION_MINITURE_RAILWAY_LOCOMOTIVE: // loc_6D652B - *curVar_C8 += _vehicleVelocityF64E08; - al = (*curVar_C8 >> 20) & 3; - if (animation_frame != al) + *curAnimationState += _vehicleVelocityF64E08; + targetFrame = (*curAnimationState >> 20) & 3; + if (animation_frame != targetFrame) { - ah = al; - al = animation_frame; - animation_frame = ah; - al &= 0x02; - ah &= 0x02; - if (al != ah) + curFrame = animation_frame; + animation_frame = targetFrame; + targetFrame &= 0x02; + curFrame &= 0x02; + if (targetFrame != curFrame) { auto curRide = GetRide(); if (curRide != nullptr) @@ -7328,74 +7327,74 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_SWAN: // loc_6D6424 - *curVar_C8 += _vehicleVelocityF64E08; - al = (*curVar_C8 >> 18) & 2; - if (animation_frame != al) + *curAnimationState += _vehicleVelocityF64E08; + targetFrame = (*curAnimationState >> 18) & 2; + if (animation_frame != targetFrame) { - animation_frame = al; + animation_frame = targetFrame; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_CANOES: // loc_6D6482 - *curVar_C8 += _vehicleVelocityF64E08; - eax = ((*curVar_C8 >> 13) & 0xFF) * 6; - ah = (eax >> 8) & 0xFF; - if (animation_frame != ah) + *curAnimationState += _vehicleVelocityF64E08; + eax = ((*curAnimationState >> 13) & 0xFF) * 6; + targetFrame = (eax >> 8) & 0xFF; + if (animation_frame != targetFrame) { - animation_frame = ah; + animation_frame = targetFrame; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_ROW_BOATS: // loc_6D64F7 - *curVar_C8 += _vehicleVelocityF64E08; - eax = ((*curVar_C8 >> 13) & 0xFF) * 7; - ah = (eax >> 8) & 0xFF; - if (animation_frame != ah) + *curAnimationState += _vehicleVelocityF64E08; + eax = ((*curAnimationState >> 13) & 0xFF) * 7; + targetFrame = (eax >> 8) & 0xFF; + if (animation_frame != targetFrame) { - animation_frame = ah; + animation_frame = targetFrame; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_WATER_TRICYCLES: // loc_6D6453 - *curVar_C8 += _vehicleVelocityF64E08; - al = (*curVar_C8 >> 19) & 1; - if (animation_frame != al) + *curAnimationState += _vehicleVelocityF64E08; + targetFrame = (*curAnimationState >> 19) & 1; + if (animation_frame != targetFrame) { - animation_frame = al; + animation_frame = targetFrame; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER: // loc_6D65C3 - if (var_C8 <= 0xCCCC) + if (animationState <= 0xCCCC) { - var_C8 += 0x3333; + animationState += 0x3333; } else { - var_C8 += 0x3333; + animationState += 0x3333; animation_frame += 1; animation_frame &= 7; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_HELICARS: // loc_6D63F5 - *curVar_C8 += _vehicleVelocityF64E08; - al = (*curVar_C8 >> 18) & 3; - if (animation_frame != al) + *curAnimationState += _vehicleVelocityF64E08; + targetFrame = (*curAnimationState >> 18) & 3; + if (animation_frame != targetFrame) { - animation_frame = al; + animation_frame = targetFrame; Invalidate(); } break; case VEHICLE_ENTRY_ANIMATION_MONORAIL_CYCLES: // loc_6D64B6 if (num_peeps != 0) { - *curVar_C8 += _vehicleVelocityF64E08; - eax = ((*curVar_C8 >> 13) & 0xFF) << 2; - ah = (eax >> 8) & 0xFF; - if (animation_frame != ah) + *curAnimationState += _vehicleVelocityF64E08; + eax = ((*curAnimationState >> 13) & 0xFF) << 2; + targetFrame = (eax >> 8) & 0xFF; + if (animation_frame != targetFrame) { - animation_frame = ah; + animation_frame = targetFrame; Invalidate(); } } @@ -7403,13 +7402,13 @@ void Vehicle::UpdateAdditionalAnimation() case VEHICLE_ENTRY_ANIMATION_MULTI_DIM_COASTER: // loc_6D65E1 if (seat_rotation != target_seat_rotation) { - if (var_C8 <= 0xCCCC) + if (animationState <= 0xCCCC) { - var_C8 += 0x3333; + animationState += 0x3333; } else { - var_C8 += 0x3333; + animationState += 0x3333; if (seat_rotation >= target_seat_rotation) seat_rotation--; diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index d24d584abc..dbfbd1b297 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -180,7 +180,7 @@ struct Vehicle : SpriteBase }; uint8_t animation_frame; uint8_t pad_C6[0x2]; - uint16_t var_C8; + uint16_t animationState; uint16_t var_CA; OpenRCT2::Audio::SoundId scream_sound_id; VehicleTrackSubposition TrackSubposition; diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/world/Entity.cpp index d3591c07f2..3f35c6a50f 100644 --- a/src/openrct2/world/Entity.cpp +++ b/src/openrct2/world/Entity.cpp @@ -278,7 +278,7 @@ void Vehicle::Serialise(DataSerialiser& stream) stream << powered_acceleration; stream << dodgems_collision_direction; stream << animation_frame; - stream << var_C8; + stream << animationState; stream << var_CA; stream << scream_sound_id; stream << TrackSubposition; From 3ab70b200bca8621c2c81ba6e6d15214c31093e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 21 Aug 2021 10:24:09 -0700 Subject: [PATCH 205/681] Fix #15255: Wall banner index defaults to 0 instead of null type --- distribution/changelog.txt | 1 + src/openrct2/actions/WallPlaceAction.cpp | 5 +---- src/openrct2/network/NetworkBase.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f9c7ead1d9..c06bd9227f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -14,6 +14,7 @@ - Fix: [#15170] Plugin: incorrect label text alignment. - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. +- Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 466f90c252..2cce251256 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -376,10 +376,7 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const wallElement->SetAcrossTrack(wallAcrossTrack); wallElement->SetEntryIndex(_wallType); - if (banner != nullptr) - { - wallElement->SetBannerIndex(banner->id); - } + wallElement->SetBannerIndex(banner != nullptr ? banner->id : BANNER_INDEX_NULL); if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) { diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index a0417603bc..4452f1f04f 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "4" +#define NETWORK_STREAM_VERSION "5" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From f49559daa5277b4659340a7855fc3927620770d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 22 Aug 2021 13:05:05 -0700 Subject: [PATCH 206/681] Fix #15259: Large scenery not rendering correctly --- src/openrct2/paint/tile_element/Paint.LargeScenery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 1fdaa946e4..f813261996 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -281,8 +281,8 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh edi = rol16(edi, direction); esi = (edi & 0xF) | (edi >> 12); } - const CoordsXYZ bbLength = { s98E3C4[esi].offset, height }; - const CoordsXYZ bbOffset = { s98E3C4[esi].length, boxlengthZ }; + const CoordsXYZ bbOffset = { s98E3C4[esi].offset, height }; + const CoordsXYZ bbLength = { s98E3C4[esi].length, boxlengthZ }; PaintAddImageAsParent(session, image_id, { 0, 0, height }, bbLength, bbOffset); if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE || direction == 1 || direction == 2) { From 5c261b6d2ed7acc6f2dad7f6d3a18315161d9938 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 09:06:58 -0400 Subject: [PATCH 207/681] Part of #13874: TrackElementDescriptor loader --- src/openrct2/Context.cpp | 2 ++ src/openrct2/ride/TrackData.cpp | 39 +++++++++++++++++++++++++++++++++ src/openrct2/ride/TrackData.h | 26 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d0f739970e..2017b60962 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -53,6 +53,7 @@ #include "platform/Crash.h" #include "platform/Platform2.h" #include "platform/platform.h" +#include "ride/TrackData.h" #include "ride/TrackDesignRepository.h" #include "scenario/Scenario.h" #include "scenario/ScenarioRepository.h" @@ -395,6 +396,7 @@ namespace OpenRCT2 } _env->SetBasePath(DIRBASE::RCT2, rct2InstallPath); } + TrackMetaData::Init(); _objectRepository = CreateObjectRepository(_env); _objectManager = CreateObjectManager(*_objectRepository); diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 57e88855ca..560258ba2c 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -12,6 +12,7 @@ #include "Track.h" #include "TrackPaint.h" +#include #include // clang-format off @@ -5127,3 +5128,41 @@ const uint16_t TrackFlags[TrackElemType::Count] = { /* TrackElemType::FlatTrack3x3 */ 0, }; // clang-format on + +namespace OpenRCT2 +{ + namespace TrackMetaData + { + static std::vector _trackElementDescriptors; + void Init() + { + _trackElementDescriptors.clear(); + _trackElementDescriptors.reserve(TrackElemType::Count); + + TrackElementDescriptor desc; + for (int i = 0; i < TrackElemType::Count; i++) + { + desc.AlternativeType = AlternativeTrackTypes[i]; + desc.Block = const_cast(TrackBlocks[i]); + desc.Coordinates = TrackCoordinates[i]; + desc.CurveChain = gTrackCurveChain[i]; + desc.Flags = TrackFlags[i]; + desc.HeightMarkerPositions = TrackHeightMarkerPositions[i]; + desc.MirrorMap = TrackElementMirrorMap[i]; + desc.PieceLength = TrackPieceLengths[i]; + desc.Pricing = TrackPricing[i]; + + for (uint8_t j = 0; j < MaxSequencesPerPiece; j++) + { + desc.SequenceElementAllowedWallEdges[j] = TrackSequenceElementAllowedWallEdges[i][j]; + desc.TrackSequenceProperties[j] = TrackSequenceProperties[i][j]; + } + _trackElementDescriptors.push_back(desc); + } + } + const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t& type) + { + return _trackElementDescriptors[type]; + } + } // namespace TrackMetaData +} // namespace OpenRCT2 diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index ba1dee8ee6..ff61c6efca 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -74,3 +74,29 @@ extern const uint32_t TrackHeightMarkerPositions[TrackElemType::Count]; extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; extern const uint16_t TrackFlags[TrackElemType::Count]; + +struct TrackElementDescriptor +{ + rct_track_coordinates Coordinates; + + rct_preview_track* Block; + uint8_t PieceLength; + track_curve_chain CurveChain; + track_type_t AlternativeType; + money32 Pricing; + track_type_t MirrorMap; + uint32_t HeightMarkerPositions; + uint16_t Flags; + + std::array SequenceElementAllowedWallEdges; + std::array TrackSequenceProperties; +}; + +namespace OpenRCT2 +{ + namespace TrackMetaData + { + void Init(); + const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t& type); + } // namespace TrackMetaData +} // namespace OpenRCT2 From 80418efafbe34cbf92f2d0db6e86d481f7ccff38 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 09:42:27 -0400 Subject: [PATCH 208/681] Part of #13874: Replace TrackCoordinates --- src/openrct2-ui/windows/TrackDesignPlace.cpp | 4 +++- src/openrct2/actions/WallPlaceAction.cpp | 13 ++++++++----- src/openrct2/ride/Ride.cpp | 16 +++++++++++----- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 1 - src/openrct2/ride/TrackDesign.cpp | 13 ++++++++----- src/openrct2/ride/Vehicle.cpp | 7 +++++-- src/openrct2/windows/_legacy.cpp | 7 +++++-- 8 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 4a3db512f6..2e2b25bbf9 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -594,7 +594,9 @@ static void window_track_place_draw_mini_preview_track( // Change rotation and next position based on track curvature curTrackRotation &= 3; - const rct_track_coordinates* track_coordinate = &TrackCoordinates[trackType]; + using namespace OpenRCT2::TrackMetaData; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_track_coordinates* track_coordinate = &teDescriptor.Coordinates; curTrackStart += CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(curTrackRotation); curTrackRotation += track_coordinate->rotation_end - track_coordinate->rotation_begin; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 466f90c252..9c948c9439 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -405,6 +405,9 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( WallSceneryEntry* wall, int32_t z0, TrackElement* trackElement, bool* wallAcrossTrack) const { track_type_t trackType = trackElement->GetTrackType(); + + using namespace OpenRCT2::TrackMetaData; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); int32_t sequence = trackElement->GetSequenceIndex(); int32_t direction = (_edge - trackElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; auto ride = get_ride(trackElement->GetRideIndex()); @@ -444,13 +447,13 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( if (TrackDefinitions[trackType].bank_start == 0) { - if (!(TrackCoordinates[trackType].rotation_begin & 4)) + if (!(teDescriptor.Coordinates.rotation_begin & 4)) { direction = direction_reverse(trackElement->GetDirection()); if (direction == _edge) { const rct_preview_track* trackBlock = &TrackBlocks[trackType][sequence]; - z = TrackCoordinates[trackType].z_begin; + z = teDescriptor.Coordinates.z_begin; z = trackElement->base_height + ((z - trackBlock->z) * 8); if (z == z0) { @@ -472,20 +475,20 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - direction = TrackCoordinates[trackType].rotation_end; + direction = teDescriptor.Coordinates.rotation_end; if (direction & 4) { return false; } - direction = (trackElement->GetDirection() + TrackCoordinates[trackType].rotation_end) & TILE_ELEMENT_DIRECTION_MASK; + direction = (trackElement->GetDirection() + teDescriptor.Coordinates.rotation_end) & TILE_ELEMENT_DIRECTION_MASK; if (direction != _edge) { return false; } trackBlock = &TrackBlocks[trackType][sequence]; - z = TrackCoordinates[trackType].z_end; + z = teDescriptor.Coordinates.z_end; z = trackElement->base_height + ((z - trackBlock->z) * 8); return z == z0; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 0cc906322d..b6b7ba338a 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -73,6 +73,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; RideMode& operator++(RideMode& d, int) { @@ -478,11 +479,12 @@ bool track_block_get_next_from_zero( if (tileElement->IsGhost() != isGhost) continue; + const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); auto nextTrackBlock = TrackBlocks[trackElement->GetTrackType()]; if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + auto nextTrackCoordinate = teDescriptor.Coordinates; uint8_t nextRotation = tileElement->GetDirectionWithOffset(nextTrackCoordinate.rotation_begin) | (nextTrackCoordinate.rotation_begin & TRACK_BLOCK_2); @@ -519,6 +521,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 return false; auto inputElement = input->element->AsTrack(); + const auto& teDescriptor = GetTrackElementDescriptor(inputElement->GetTrackType()); if (inputElement == nullptr) return false; @@ -533,7 +536,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 trackBlock += inputElement->GetSequenceIndex(); - auto trackCoordinate = TrackCoordinates[inputElement->GetTrackType()]; + auto trackCoordinate = teDescriptor.Coordinates; int32_t x = input->x; int32_t y = input->y; @@ -599,7 +602,8 @@ bool track_block_get_previous_from_zero( if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + const auto& teDesc = GetTrackElementDescriptor(trackElement->GetTrackType()); + auto nextTrackCoordinate = teDesc.Coordinates; nextTrackBlock += trackElement->GetSequenceIndex(); if ((nextTrackBlock + 1)->index != 255) @@ -663,6 +667,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra return false; auto trackElement = trackPos.element->AsTrack(); + const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); if (trackElement == nullptr) return false; @@ -677,7 +682,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra trackBlock += trackElement->GetSequenceIndex(); - auto trackCoordinate = TrackCoordinates[trackElement->GetTrackType()]; + auto trackCoordinate = teDescriptor.Coordinates; int32_t z = trackElement->GetBaseZ(); @@ -2857,7 +2862,8 @@ static void ride_set_boat_hire_return_point(Ride* ride, CoordsXYE* startElement) }; trackType = returnPos.element->AsTrack()->GetTrackType(); - int32_t elementReturnDirection = TrackCoordinates[trackType].rotation_begin; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + int32_t elementReturnDirection = teDescriptor.Coordinates.rotation_begin; ride->boat_hire_return_direction = returnPos.element->GetDirectionWithOffset(elementReturnDirection); ride->boat_hire_return_position = TileCoordsXY{ returnPos }; } diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 560258ba2c..ccb5301b03 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -16,7 +16,7 @@ #include // clang-format off -const rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { +const static rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { { 0, 0, 0, 0, 0, 0 }, // ELEM_FLAT { 0, 0, 0, 0, 0, 0 }, // ELEM_END_STATION { 0, 0, 0, 0, 0, 0 }, // ELEM_BEGIN_STATION diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index ff61c6efca..dcdaaa1c55 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -16,7 +16,6 @@ constexpr const uint8_t MaxSequencesPerPiece = 16; // 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3 -extern const rct_track_coordinates TrackCoordinates[TrackElemType::Count]; extern const uint8_t TrackSequenceProperties[TrackElemType::Count][MaxSequencesPerPiece]; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 63e9dfc8d2..ef996c45ea 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -65,6 +65,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Drawing; +using namespace OpenRCT2::TrackMetaData; bool gTrackDesignSceneryToggle; static CoordsXYZ _trackPreviewMin; @@ -182,7 +183,8 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) trackElement.y = newCoords->y; z = newCoords->z; - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackElement.element->AsTrack()->GetTrackType()]; + const auto& teDescriptor = GetTrackElementDescriptor(trackElement.element->AsTrack()->GetTrackType()); + const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; auto trackBlock = TrackBlocks[trackType]; // Used in the following loop to know when we have // completed all of the elements and are back at the @@ -1519,6 +1521,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co for (const auto& track : td6->track_elements) { auto trackType = track.type; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); track_design_update_max_min_coordinates(newCoords); @@ -1534,7 +1537,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co break; case PTD_OPERATION_REMOVE_GHOST: { - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; const rct_preview_track* trackBlock = TrackBlocks[trackType]; int32_t tempZ = newCoords.z - trackCoordinates->z_begin + trackBlock->z; auto trackRemoveAction = TrackRemoveAction( @@ -1549,7 +1552,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co case PTD_OPERATION_PLACE_GHOST: case PTD_OPERATION_PLACE_TRACK_PREVIEW: { - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; // di int16_t tempZ = newCoords.z - trackCoordinates->z_begin; @@ -1606,7 +1609,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co } case PTD_OPERATION_GET_PLACE_Z: { - int32_t tempZ = newCoords.z - TrackCoordinates[trackType].z_begin; + int32_t tempZ = newCoords.z - teDescriptor.Coordinates.z_begin; for (const rct_preview_track* trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) { auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); @@ -1646,7 +1649,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co } } - const rct_track_coordinates* track_coordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* track_coordinates = &teDescriptor.Coordinates; auto offsetAndRotatedTrack = CoordsXY{ newCoords } + CoordsXY{ track_coordinates->x, track_coordinates->y }.Rotate(rotation); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 50f1c0c22d..7b25234d35 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -50,6 +50,7 @@ #include #include +using namespace OpenRCT2::TrackMetaData; static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location); constexpr int16_t VEHICLE_MAX_SPIN_SPEED = 1536; @@ -7493,12 +7494,13 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& void Vehicle::UpdateSceneryDoor() const { auto trackType = GetTrackType(); + const auto& teDescriptor = GetTrackElementDescriptor(trackType); const rct_preview_track* trackBlock = TrackBlocks[trackType]; while ((trackBlock + 1)->index != 255) { trackBlock++; } - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; auto wallCoords = CoordsXYZ{ x, y, TrackLocation.z - trackBlock->z + trackCoordinates->z_end }.ToTileStart(); int32_t direction = (GetTrackDirection() + trackCoordinates->rotation_end) & 3; @@ -7590,8 +7592,9 @@ static void trigger_on_ride_photo(const CoordsXYZ& loc, TileElement* tileElement void Vehicle::UpdateSceneryDoorBackwards() const { auto trackType = GetTrackType(); + const auto& teDescriptor = GetTrackElementDescriptor(trackType); const rct_preview_track* trackBlock = TrackBlocks[trackType]; - const rct_track_coordinates* trackCoordinates = &TrackCoordinates[trackType]; + const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; auto wallCoords = CoordsXYZ{ TrackLocation, TrackLocation.z - trackBlock->z + trackCoordinates->z_begin }; int32_t direction = (GetTrackDirection() + trackCoordinates->rotation_begin) & 3; direction = direction_reverse(direction); diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index bfbcb7da71..9c3691c30a 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -27,6 +27,7 @@ #include #include +using namespace OpenRCT2::TrackMetaData; bool gDisableErrorWindowSound = false; uint64_t _enabledRidePieces; @@ -90,7 +91,8 @@ money32 place_provisional_track_piece( return result; int16_t z_begin, z_end; - const rct_track_coordinates& coords = TrackCoordinates[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& coords = teDescriptor.Coordinates; if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) { z_begin = coords.z_begin; @@ -312,7 +314,8 @@ bool window_ride_construction_update_state( } } - const rct_track_coordinates& trackCoordinates = TrackCoordinates[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& trackCoordinates = teDescriptor.Coordinates; x = _currentTrackBegin.x; y = _currentTrackBegin.y; From 5a8cc7c610eb15086ea9530b24b9d6069d0227c2 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 09:44:36 -0400 Subject: [PATCH 209/681] Part of #13874: Replace alternativeTypes --- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- src/openrct2/windows/_legacy.cpp | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index ccb5301b03..7b867db264 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -3503,7 +3503,7 @@ const track_descriptor gTrackDescriptors[142] = { }; /** rct2: 0x00993D1C */ -const track_type_t AlternativeTrackTypes[TrackElemType::Count] = { +const static track_type_t AlternativeTrackTypes[TrackElemType::Count] = { TrackElemType::FlatCovered, // TrackElemType::Flat TrackElemType::None, TrackElemType::None, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index dcdaaa1c55..f7ef28b4af 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -44,8 +44,6 @@ struct track_descriptor extern const track_descriptor gTrackDescriptors[142]; -extern const track_type_t AlternativeTrackTypes[TrackElemType::Count]; - extern const money32 TrackPricing[TrackElemType::Count]; struct dodgems_track_size diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 9c3691c30a..15ff0447f5 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -306,7 +306,8 @@ bool window_ride_construction_update_state( && _currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) { auto availablePieces = rtd.CoveredTrackPieces; - auto alternativeType = AlternativeTrackTypes[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + auto alternativeType = teDescriptor.AlternativeType; if (alternativeType != TrackElemType::None && (availablePieces & (1ULL << trackType))) { trackType = alternativeType; From 675777efaf8bdfa3c38d95ea436508a041e029b6 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 09:50:44 -0400 Subject: [PATCH 210/681] Part of #13874: replace curvechain --- src/openrct2/ride/RideConstruction.cpp | 9 +++++++-- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 8abc33ef60..de236b4520 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -87,6 +87,7 @@ RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; Direction gRideEntranceExitPlaceDirection; using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; static int32_t ride_check_if_construction_allowed(Ride* ride) { @@ -626,6 +627,8 @@ void ride_construction_set_default_next_piece() CoordsXYE xyElement; TileElement* tileElement; _currentTrackPrice = MONEY32_UNDEFINED; + + TrackElementDescriptor teDescriptor; switch (_rideConstructionState) { case RideConstructionState::Front: @@ -654,7 +657,8 @@ void ride_construction_set_default_next_piece() } } - curve = gTrackCurveChain[trackType].next; + teDescriptor = GetTrackElementDescriptor(trackType); + curve = teDescriptor.CurveChain.next; bank = TrackDefinitions[trackType].bank_end; slope = TrackDefinitions[trackType].vangle_end; @@ -699,7 +703,8 @@ void ride_construction_set_default_next_piece() } } - curve = gTrackCurveChain[trackType].previous; + teDescriptor = GetTrackElementDescriptor(trackType); + curve = teDescriptor.CurveChain.previous; bank = TrackDefinitions[trackType].bank_start; slope = TrackDefinitions[trackType].vangle_start; diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 7b867db264..ce4d221e2d 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -3087,7 +3087,7 @@ const uint8_t TrackPieceLengths[TrackElemType::Count] = { }; // rct2: 0x00998C95 -const track_curve_chain gTrackCurveChain[TrackElemType::Count] = { +const static track_curve_chain gTrackCurveChain[TrackElemType::Count] = { { TRACK_CURVE_NONE, TRACK_CURVE_NONE }, { RideConstructionSpecialPieceSelected | TrackElemType::EndStation, RideConstructionSpecialPieceSelected | TrackElemType::EndStation }, { RideConstructionSpecialPieceSelected | TrackElemType::EndStation, RideConstructionSpecialPieceSelected | TrackElemType::EndStation }, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index f7ef28b4af..4f819deeb3 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -29,8 +29,6 @@ struct track_curve_chain int32_t previous; }; -extern const track_curve_chain gTrackCurveChain[TrackElemType::Count]; - struct track_descriptor { bool starts_diagonal; From 1bfa26e4c5ba2a4150a1d88fb7502c840a4fd0cf Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 09:59:09 -0400 Subject: [PATCH 211/681] Part of #13874: replace flags table --- src/openrct2/actions/TrackPlaceAction.cpp | 12 ++++++++---- src/openrct2/ride/Ride.cpp | 6 ++++-- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- src/openrct2/ride/Vehicle.cpp | 6 ++++-- src/openrct2/windows/_legacy.cpp | 4 ++-- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index ec4ce6cb29..b961f6ffda 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -19,6 +19,7 @@ #include "../world/Surface.h" #include "RideSetSettingAction.h" +using namespace OpenRCT2::TrackMetaData; TrackPlaceActionResult::TrackPlaceActionResult() : GameActions::Result(GameActions::Status::Ok, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE) { @@ -146,7 +147,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if ((_trackPlaceFlags & CONSTRUCTION_LIFT_HILL_SELECTED) && !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack) { - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_IS_STEEP_UP) + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + if (teDescriptor.Flags & TRACK_ELEM_FLAG_IS_STEEP_UP) { return std::make_unique(GameActions::Status::Disallowed, STR_TOO_STEEP_FOR_LIFT_HILL); } @@ -176,7 +178,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } if (!gCheatsAllowTrackPlaceInvalidHeights) { - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + if (teDescriptor.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) { if ((_origin.z & 0x0F) != 8) { @@ -260,7 +263,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const res->GroundFlags = mapGroundFlags; - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + if (teDescriptor.Flags & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) { if (res->GroundFlags & ELEMENT_IS_UNDERGROUND) { @@ -269,7 +273,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_ONLY_UNDERWATER) + if (teDescriptor.Flags & TRACK_ELEM_FLAG_ONLY_UNDERWATER) { // No element has this flag if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) { diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index b6b7ba338a..3bbf94cb01 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2663,7 +2663,8 @@ static bool ride_check_track_contains_inversions(CoordsXYE* input, CoordsXYE* ou while (track_circuit_iterator_next(&it)) { auto trackType = it.current.element->AsTrack()->GetTrackType(); - if (TrackFlags[trackType] & TRACK_ELEM_FLAG_INVERSION_TO_NORMAL) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.Flags & TRACK_ELEM_FLAG_INVERSION_TO_NORMAL) { *output = it.current; return true; @@ -2721,7 +2722,8 @@ static bool ride_check_track_contains_banked(CoordsXYE* input, CoordsXYE* output while (track_circuit_iterator_next(&it)) { auto trackType = output->element->AsTrack()->GetTrackType(); - if (TrackFlags[trackType] & TRACK_ELEM_FLAG_BANKED) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.Flags & TRACK_ELEM_FLAG_BANKED) { *output = it.current; return true; diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index ce4d221e2d..068f01035a 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4858,7 +4858,7 @@ const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequ }; /** rct2: 0x0099423C */ -const uint16_t TrackFlags[TrackElemType::Count] = { +const static uint16_t TrackFlags[TrackElemType::Count] = { /* TrackElemType::Flat */ TRACK_ELEM_FLAG_ALLOW_LIFT_HILL, /* TrackElemType::EndStation */ 0, /* TrackElemType::BeginStation */ 0, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 4f819deeb3..d96d777677 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -68,8 +68,6 @@ extern const uint32_t TrackHeightMarkerPositions[TrackElemType::Count]; extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; -extern const uint16_t TrackFlags[TrackElemType::Count]; - struct TrackElementDescriptor { rct_track_coordinates Coordinates; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 7b25234d35..aaa9e37770 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1707,7 +1707,8 @@ void Vehicle::UpdateMeasurements() } } - uint16_t trackFlags = TrackFlags[trackElemType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackElemType); + uint16_t trackFlags = teDescriptor.Flags; uint32_t testingFlags = curRide->testing_flags; if (testingFlags & RIDE_TESTING_TURN_LEFT && trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) @@ -8545,7 +8546,8 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(uint16_t trackType, Ride* cu if (next_vehicle_on_train == SPRITE_INDEX_NULL) { trackType = tileElement->AsTrack()->GetTrackType(); - if (!(TrackFlags[trackType] & TRACK_ELEM_FLAG_DOWN)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.Flags & TRACK_ELEM_FLAG_DOWN)) { _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_9; } diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 15ff0447f5..dd0313d2fb 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -349,13 +349,13 @@ bool window_ride_construction_update_state( bool turnOffLiftHill = false; if (!(_enabledRidePieces & (1ULL << TRACK_LIFT_HILL_CURVE))) { - if (TrackFlags[trackType] & TRACK_ELEM_FLAG_CURVE_ALLOWS_LIFT) + if (teDescriptor.Flags & TRACK_ELEM_FLAG_CURVE_ALLOWS_LIFT) { turnOffLiftHill = true; } } - if (!(TrackFlags[trackType] & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) + if (!(teDescriptor.Flags & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) { turnOffLiftHill = true; } From 72e6f9a69481c913ffc19ea325674f93d405e288 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:01:30 -0400 Subject: [PATCH 212/681] Part of #13874: replace height markers positions tables --- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- src/openrct2/ride/TrackPaint.cpp | 5 ++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 068f01035a..cce0d3f73b 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4316,7 +4316,7 @@ const track_type_t TrackElementMirrorMap[TrackElemType::Count] = { }; /** rct2: 0x00999694 */ -const uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { +const static uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { (1 << 0), // TrackElemType::Flat (1 << 0), // TrackElemType::EndStation (1 << 0), // TrackElemType::BeginStation diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index d96d777677..60cb33e6e2 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -64,8 +64,6 @@ constexpr const dodgems_track_size DodgemsTrackSize(track_type_t type) } extern const track_type_t TrackElementMirrorMap[TrackElemType::Count]; -extern const uint32_t TrackHeightMarkerPositions[TrackElemType::Count]; - extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; struct TrackElementDescriptor diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index bde96b1845..875506f6ed 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -27,6 +27,8 @@ #include "TrackData.h" #include "TrackDesign.h" +using namespace OpenRCT2::TrackMetaData; + // clang-format off /* rct2: 0x007667AC */ static constexpr TileCoordsXY EntranceOffsetEdgeNE[] = { @@ -2202,7 +2204,8 @@ void PaintTrack(paint_session* session, Direction direction, int32_t height, con if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_TRACK_HEIGHTS)) { session->InteractionType = ViewportInteractionItem::None; - if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.HeightMarkerPositions & (1 << trackSequence)) { uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset; // 0x1689 represents 0 height there are -127 to 128 heights above and below it From 716dd3dcb622a1fc438b2f56e775c6b017d940b8 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:09:23 -0400 Subject: [PATCH 213/681] Part of #13874: Replace mirror maps --- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 1 - src/openrct2/ride/TrackDesign.cpp | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index cce0d3f73b..af506c423b 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4045,7 +4045,7 @@ const money32 TrackPricing[TrackElemType::Count] = { }; /** rct2: 0x0099EA1C */ -const track_type_t TrackElementMirrorMap[TrackElemType::Count] = { +const static track_type_t TrackElementMirrorMap[TrackElemType::Count] = { TrackElemType::Flat, TrackElemType::EndStation, TrackElemType::BeginStation, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 60cb33e6e2..2a6dcf5bb7 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -62,7 +62,6 @@ constexpr const dodgems_track_size DodgemsTrackSize(track_type_t type) return { 4, 4, 59, 123 }; return { 0, 0, 0, 0 }; } -extern const track_type_t TrackElementMirrorMap[TrackElemType::Count]; extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index ef996c45ea..be6835567d 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -770,7 +770,8 @@ static void track_design_mirror_ride(TrackDesign* td6) { for (auto& track : td6->track_elements) { - track.type = TrackElementMirrorMap[track.type]; + const auto& teDescriptor = GetTrackElementDescriptor(track.type); + track.type = teDescriptor.MirrorMap; } for (auto& entrance : td6->entrance_elements) From 780eb4f287673bb47febe76d482b8e5505b994bc Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:11:52 -0400 Subject: [PATCH 214/681] Part of #13874: Replace piece lengths --- src/openrct2/ride/Ride.cpp | 3 ++- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 3bbf94cb01..75522a46d4 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -4909,7 +4909,8 @@ static int32_t ride_get_track_length(Ride* ride) while (track_circuit_iterator_next(&it)) { trackType = it.current.element->AsTrack()->GetTrackType(); - result += TrackPieceLengths[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + result += teDescriptor.PieceLength; moveSlowIt = !moveSlowIt; if (moveSlowIt) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index af506c423b..061f4077d2 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -2816,7 +2816,7 @@ const rct_preview_track *TrackBlocks[TrackElemType::Count] = { TrackBlocksFlatTrack3x3, }; -const uint8_t TrackPieceLengths[TrackElemType::Count] = { +const static uint8_t TrackPieceLengths[TrackElemType::Count] = { 32, // TrackElemType::Flat 32, // TrackElemType::EndStation 32, // TrackElemType::BeginStation diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 2a6dcf5bb7..e507487fa5 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -21,8 +21,6 @@ extern const uint8_t TrackSequenceProperties[TrackElemType::Count][MaxSequencesP extern const rct_preview_track* TrackBlocks[TrackElemType::Count]; -extern const uint8_t TrackPieceLengths[TrackElemType::Count]; - struct track_curve_chain { int32_t next; From b5219d76d879db999940059888220c026a86f4a2 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:18:37 -0400 Subject: [PATCH 215/681] Part of #13874: Replace pricing tables --- src/openrct2-ui/windows/NewRide.cpp | 5 ++++- src/openrct2/actions/MazePlaceTrackAction.cpp | 8 ++++++-- src/openrct2/actions/MazeSetTrackAction.cpp | 8 ++++++-- src/openrct2/actions/TrackPlaceAction.cpp | 6 ++++-- src/openrct2/actions/TrackRemoveAction.cpp | 8 ++++++-- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 6bdcc02b25..0e4868a487 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -33,6 +33,8 @@ #include #include +using namespace OpenRCT2::TrackMetaData; + static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; constexpr size_t AVAILABILITY_STRING_SIZE = 256; static constexpr const int32_t WH = 382; @@ -943,7 +945,8 @@ static void window_new_ride_paint_ride_information( // Get price of ride int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece; money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; - price *= TrackPricing[unk2]; + const auto& teDescriptor = GetTrackElementDescriptor(unk2); + price *= teDescriptor.Pricing; price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; // diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index aa394ea0ea..8e049bcd13 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -12,6 +12,8 @@ #include "../ride/RideData.h" #include "../ride/TrackData.h" +using namespace OpenRCT2::TrackMetaData; + MazePlaceTrackAction::MazePlaceTrackAction(const CoordsXYZ& location, NetworkRideId_t rideIndex, uint16_t mazeEntry) : _loc(location) , _rideIndex(rideIndex) @@ -113,7 +115,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const return res; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; return res; @@ -154,7 +157,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const return canBuild; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index d2755adb1c..f7f78114c3 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -21,6 +21,8 @@ #include "../world/Footpath.h" #include "../world/Park.h" +using namespace OpenRCT2::TrackMetaData; + MazeSetTrackAction::MazeSetTrackAction( const CoordsXYZD& location, bool initialPlacement, NetworkRideId_t rideIndex, uint8_t mode) : _loc(location) @@ -134,7 +136,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const return res; } - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); res->Cost = price / 2 * 10; return res; @@ -169,7 +172,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex); if (tileElement == nullptr) { - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16)); + const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); res->Cost = price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index b961f6ffda..5e335fd6ed 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -368,7 +368,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[_trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + price *= teDescriptor.Pricing; price >>= 16; res->Cost = cost + ((price / 2) * 10); @@ -656,7 +657,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[_trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + price *= teDescriptor.Pricing; price >>= 16; res->Cost = cost + ((price / 2) * 10); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 0165bb721f..aa20954400 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -19,6 +19,8 @@ #include "../world/Surface.h" #include "RideSetSettingAction.h" +using namespace OpenRCT2::TrackMetaData; + TrackRemoveAction::TrackRemoveAction(track_type_t trackType, int32_t sequence, const CoordsXYZD& origin) : _trackType(trackType) , _sequence(sequence) @@ -226,7 +228,8 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + price *= teDescriptor.Pricing; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) @@ -473,7 +476,8 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= TrackPricing[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + price *= teDescriptor.Pricing; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 061f4077d2..4a49ddc40c 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -3774,7 +3774,7 @@ const static track_type_t AlternativeTrackTypes[TrackElemType::Count] = { }; /** rct2: 0x0099DA34 */ -const money32 TrackPricing[TrackElemType::Count] = { +const static money32 TrackPricing[TrackElemType::Count] = { 65536, // TrackElemType::Flat 98304, // TrackElemType::EndStation 98304, // TrackElemType::BeginStation diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index e507487fa5..2664b8fc61 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -40,8 +40,6 @@ struct track_descriptor extern const track_descriptor gTrackDescriptors[142]; -extern const money32 TrackPricing[TrackElemType::Count]; - struct dodgems_track_size { uint8_t left; From 382315b2c3c20f94fa24665b5e5d3c5626d04716 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:44:17 -0400 Subject: [PATCH 216/681] Part of #13874: Replace block tables --- src/openrct2-ui/windows/RideConstruction.cpp | 20 ++++++++++++++------ src/openrct2-ui/windows/TrackDesignPlace.cpp | 7 ++++--- src/openrct2/actions/TrackPlaceAction.cpp | 19 ++++++++----------- src/openrct2/actions/TrackRemoveAction.cpp | 16 ++++++++-------- src/openrct2/actions/WallPlaceAction.cpp | 6 +++--- src/openrct2/ride/Ride.cpp | 14 +++++++------- src/openrct2/ride/RideConstruction.cpp | 6 ++++-- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- src/openrct2/ride/TrackDesign.cpp | 8 ++++---- src/openrct2/ride/Vehicle.cpp | 4 ++-- src/openrct2/world/TileInspector.cpp | 11 +++++++---- 12 files changed, 62 insertions(+), 53 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b5e470b26a..36530f15be 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -42,6 +42,8 @@ static constexpr const int32_t WH = 394; static constexpr const int32_t WW = 166; static constexpr const uint16_t ARROW_PULSE_DURATION = 200; +using namespace OpenRCT2::TrackMetaData; + #pragma region Widgets // clang-format off @@ -1924,7 +1926,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) return; } - const rct_preview_track* trackBlock = TrackBlocks[tileElement->AsTrack()->GetTrackType()]; + const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const rct_preview_track* trackBlock = teDescriptor.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; gGotoStartPlacementMode = true; } @@ -2345,7 +2348,8 @@ static void window_ride_construction_draw_track_piece( if (ride == nullptr) return; - auto trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + auto trackBlock = teDescriptor.Block; while ((trackBlock + 1)->index != 0xFF) trackBlock++; @@ -2399,7 +2403,8 @@ static void sub_6CBCE2( gMapSize = MAXIMUM_MAP_SIZE_TECHNICAL; - auto trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + auto trackBlock = teDescriptor.Block; while (trackBlock->index != 255) { auto quarterTile = trackBlock->var_08.Rotate(trackDirection); @@ -3292,7 +3297,8 @@ static void window_ride_construction_select_map_tiles( const rct_preview_track* trackBlock; - trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + trackBlock = teDescriptor.Block; trackDirection &= 3; gMapSelectionTiles.clear(); while (trackBlock->index != 255) @@ -3469,7 +3475,8 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) // z = map_get_highest_z(x >> 5, y >> 5); } // loc_6CC91B: - trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + trackBlock = teDescriptor.Block; int32_t bx = 0; do { @@ -3699,7 +3706,8 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (_trackPlaceZ == 0) { - const rct_preview_track* trackBlock = TrackBlocks[_currentTrackPieceType]; + const auto& teDescriptor = GetTrackElementDescriptor(_currentTrackPieceType); + const rct_preview_track* trackBlock = teDescriptor.Block; int32_t bx = 0; do { diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 2e2b25bbf9..5896be7fe1 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -32,6 +32,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; static constexpr const rct_string_id WINDOW_TITLE = STR_STRING; static constexpr const int32_t WH = 124; @@ -550,7 +551,8 @@ static void window_track_place_draw_mini_preview_track( } // Follow a single track piece shape - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = teDescriptor.Block; while (trackBlock->index != 255) { auto rotatedAndOffsetTrackBlock = curTrackStart + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(curTrackRotation); @@ -594,8 +596,7 @@ static void window_track_place_draw_mini_preview_track( // Change rotation and next position based on track curvature curTrackRotation &= 3; - using namespace OpenRCT2::TrackMetaData; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_track_coordinates* track_coordinate = &teDescriptor.Coordinates; curTrackStart += CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(curTrackRotation); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 5e335fd6ed..abc26b7e26 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -156,7 +156,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 cost = 0; - const rct_preview_track* trackBlock = TrackBlocks[_trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + const rct_preview_track* trackBlock = teDescriptor.Block; uint32_t numElements = 0; // First check if any of the track pieces are outside the park for (; trackBlock->index != 0xFF; trackBlock++) @@ -176,9 +177,9 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const log_warning("Not enough free map elements to place track."); return std::make_unique(GameActions::Status::NoFreeElements, STR_TILE_ELEMENT_LIMIT_REACHED); } + if (!gCheatsAllowTrackPlaceInvalidHeights) { - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); if (teDescriptor.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) { if ((_origin.z & 0x0F) != 8) @@ -198,7 +199,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } // If that is not the case, then perform the remaining checks - trackBlock = TrackBlocks[_trackType]; + trackBlock = teDescriptor.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { @@ -262,8 +263,6 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } res->GroundFlags = mapGroundFlags; - - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); if (teDescriptor.Flags & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) { if (res->GroundFlags & ELEMENT_IS_UNDERGROUND) @@ -368,7 +367,6 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); price *= teDescriptor.Pricing; price >>= 16; @@ -406,9 +404,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const wallEdges = &TrackSequenceElementAllowedWallEdges[_trackType]; money32 cost = 0; - const rct_preview_track* trackBlock = TrackBlocks[_trackType]; - - trackBlock = TrackBlocks[_trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + const rct_preview_track* trackBlock = teDescriptor.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { auto rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction), trackBlock->z }; @@ -657,7 +654,6 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); price *= teDescriptor.Pricing; price >>= 16; @@ -667,7 +663,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const bool TrackPlaceAction::CheckMapCapacity(int16_t numTiles) const { - for (const rct_preview_track* trackBlock = TrackBlocks[_trackType]; trackBlock->index != 0xFF; trackBlock++) + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) { auto rotatedTrack = CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index aa20954400..5db867f52b 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -122,7 +122,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); - auto trackType = tileElement->AsTrack()->GetTrackType(); + const auto trackType = tileElement->AsTrack()->GetTrackType(); auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -136,7 +136,8 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const log_warning("Ride type not found. ride type = %d.", ride->type); return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -152,7 +153,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const money32 cost = 0; - trackBlock = TrackBlocks[trackType]; + trackBlock = teDescriptor.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -228,7 +229,6 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); price *= teDescriptor.Pricing; price >>= 16; price = (price + cost) / 2; @@ -308,7 +308,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); - auto trackType = tileElement->AsTrack()->GetTrackType(); + const auto trackType = tileElement->AsTrack()->GetTrackType(); bool isLiftHill = tileElement->AsTrack()->HasChain(); auto ride = get_ride(rideIndex); @@ -317,7 +317,8 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const log_warning("Ride not found. ride index = %d.", rideIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -332,7 +333,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const res->Position.z = startLoc.z; money32 cost = 0; - trackBlock = TrackBlocks[trackType]; + trackBlock = teDescriptor.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrackLoc = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -476,7 +477,6 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); price *= teDescriptor.Pricing; price >>= 16; price = (price + cost) / 2; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 9c948c9439..a81bff4968 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -452,7 +452,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( direction = direction_reverse(trackElement->GetDirection()); if (direction == _edge) { - const rct_preview_track* trackBlock = &TrackBlocks[trackType][sequence]; + const rct_preview_track* trackBlock = &teDescriptor.Block[sequence]; z = teDescriptor.Coordinates.z_begin; z = trackElement->base_height + ((z - trackBlock->z) * 8); if (z == z0) @@ -464,7 +464,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( } } - const rct_preview_track* trackBlock = &TrackBlocks[trackType][sequence + 1]; + const rct_preview_track* trackBlock = &teDescriptor.Block[sequence + 1]; if (trackBlock->index != 0xFF) { return false; @@ -487,7 +487,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - trackBlock = &TrackBlocks[trackType][sequence]; + trackBlock = &teDescriptor.Block[sequence]; z = teDescriptor.Coordinates.z_end; z = trackElement->base_height + ((z - trackBlock->z) * 8); return z == z0; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 75522a46d4..c6dd1930de 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -480,7 +480,7 @@ bool track_block_get_next_from_zero( continue; const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); - auto nextTrackBlock = TrackBlocks[trackElement->GetTrackType()]; + auto nextTrackBlock = teDescriptor.Block; if (nextTrackBlock == nullptr) continue; @@ -530,7 +530,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; - auto trackBlock = TrackBlocks[inputElement->GetTrackType()]; + auto trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return false; @@ -598,11 +598,10 @@ bool track_block_get_previous_from_zero( if (trackElement->GetRideIndex() != ride->id) continue; - auto nextTrackBlock = TrackBlocks[trackElement->GetTrackType()]; + const auto& teDesc = GetTrackElementDescriptor(trackElement->GetTrackType()); + auto nextTrackBlock = teDesc.Block; if (nextTrackBlock == nullptr) continue; - - const auto& teDesc = GetTrackElementDescriptor(trackElement->GetTrackType()); auto nextTrackCoordinate = teDesc.Coordinates; nextTrackBlock += trackElement->GetSequenceIndex(); @@ -635,7 +634,8 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); - auto nextTrackBlock2 = TrackBlocks[trackElement->GetTrackType()]; + const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); + auto nextTrackBlock2 = teDescriptor.Block; if (nextTrackBlock2 == nullptr) continue; @@ -676,7 +676,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra if (ride == nullptr) return false; - auto trackBlock = TrackBlocks[trackElement->GetTrackType()]; + auto trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return false; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index de236b4520..8f0a5975f5 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -393,7 +393,8 @@ std::optional sub_6C683D( } // Possibly z should be & 0xF8 - auto trackBlock = TrackBlocks[type]; + const auto& teDescriptor = GetTrackElementDescriptor(type); + auto trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return std::nullopt; @@ -1499,7 +1500,8 @@ void sub_6CB945(Ride* ride) continue; } - const rct_preview_track* trackBlock = TrackBlocks[tileElement->AsTrack()->GetTrackType()]; + const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const rct_preview_track* trackBlock = teDescriptor.Block; while ((++trackBlock)->index != 0xFF) { CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 4a49ddc40c..e6dacd20f8 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -2545,7 +2545,7 @@ static constexpr const rct_preview_track TrackBlocksFlatTrack3x3[] = { }; // rct2: 0x00994638 -const rct_preview_track *TrackBlocks[TrackElemType::Count] = { +const static rct_preview_track *TrackBlocks[TrackElemType::Count] = { TrackBlocks000, TrackBlocks001, TrackBlocks002, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 2664b8fc61..e3c38f20fe 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -19,8 +19,6 @@ constexpr const uint8_t MaxSequencesPerPiece = 16; extern const uint8_t TrackSequenceProperties[TrackElemType::Count][MaxSequencesPerPiece]; -extern const rct_preview_track* TrackBlocks[TrackElemType::Count]; - struct track_curve_chain { int32_t next; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index be6835567d..5c22e095aa 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -185,7 +185,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) const auto& teDescriptor = GetTrackElementDescriptor(trackElement.element->AsTrack()->GetTrackType()); const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; - auto trackBlock = TrackBlocks[trackType]; + auto trackBlock = teDescriptor.Block; // Used in the following loop to know when we have // completed all of the elements and are back at the // start. @@ -1529,7 +1529,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co switch (_trackDesignPlaceOperation) { case PTD_OPERATION_DRAW_OUTLINES: - for (const rct_preview_track* trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) + for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) { auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); track_design_update_max_min_coordinates({ tile, newCoords.z }); @@ -1539,7 +1539,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co case PTD_OPERATION_REMOVE_GHOST: { const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const rct_preview_track* trackBlock = teDescriptor.Block; int32_t tempZ = newCoords.z - trackCoordinates->z_begin + trackBlock->z; auto trackRemoveAction = TrackRemoveAction( trackType, 0, { newCoords, tempZ, static_cast(rotation & 3) }); @@ -1611,7 +1611,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co case PTD_OPERATION_GET_PLACE_Z: { int32_t tempZ = newCoords.z - teDescriptor.Coordinates.z_begin; - for (const rct_preview_track* trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) + for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) { auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); if (!map_is_location_valid(tile)) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index aaa9e37770..6d50508bb5 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7496,7 +7496,7 @@ void Vehicle::UpdateSceneryDoor() const { auto trackType = GetTrackType(); const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const rct_preview_track* trackBlock = teDescriptor.Block; while ((trackBlock + 1)->index != 255) { trackBlock++; @@ -7594,7 +7594,7 @@ void Vehicle::UpdateSceneryDoorBackwards() const { auto trackType = GetTrackType(); const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = TrackBlocks[trackType]; + const rct_preview_track* trackBlock = teDescriptor.Block; const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; auto wallCoords = CoordsXYZ{ TrackLocation, TrackLocation.z - trackBlock->z + trackCoordinates->z_begin }; int32_t direction = (GetTrackDirection() + trackCoordinates->rotation_begin) & 3; diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index e4599bbbd5..f5e2632bce 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -37,6 +37,7 @@ TileCoordsXY windowTileInspectorTile; int32_t windowTileInspectorElementCount = 0; int32_t windowTileInspectorSelectedIndex; +using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::TileInspector { static bool SwapTileElements(const CoordsXY& loc, int16_t first, int16_t second) @@ -854,7 +855,8 @@ namespace OpenRCT2::TileInspector if (ride == nullptr) return std::make_unique(GameActions::Status::Unknown, STR_NONE); - auto trackBlock = TrackBlocks[type]; + const auto& teDescriptor = GetTrackElementDescriptor(type); + auto trackBlock = teDescriptor.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -866,7 +868,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = TrackBlocks[type]; + trackBlock = teDescriptor.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; @@ -937,7 +939,8 @@ namespace OpenRCT2::TileInspector if (ride == nullptr) return std::make_unique(GameActions::Status::Unknown, STR_NONE); - auto trackBlock = TrackBlocks[type]; + const auto& teDescriptor = GetTrackElementDescriptor(type); + auto trackBlock = teDescriptor.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -949,7 +952,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = TrackBlocks[type]; + trackBlock = teDescriptor.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; From a29b369ff8f21e7a3a1881d3d070db0566ef60b6 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 10:52:38 -0400 Subject: [PATCH 217/681] Part of #13874: Replace Sequence Element Wall table --- src/openrct2/actions/TrackPlaceAction.cpp | 7 +++---- src/openrct2/actions/WallPlaceAction.cpp | 4 +++- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index abc26b7e26..e6948a5619 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -400,11 +400,10 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags; - const uint8_t(*wallEdges)[16]; - wallEdges = &TrackSequenceElementAllowedWallEdges[_trackType]; + const auto& teDescriptor = GetTrackElementDescriptor(_trackType); + auto wallEdges = teDescriptor.SequenceElementAllowedWallEdges; money32 cost = 0; - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); const rct_preview_track* trackBlock = teDescriptor.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { @@ -452,7 +451,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const else { // Remove walls in the directions this track intersects - uint8_t intersectingDirections = (*wallEdges)[blockIndex]; + uint8_t intersectingDirections = wallEdges[blockIndex]; intersectingDirections ^= 0x0F; intersectingDirections = rol4(intersectingDirections, _origin.direction); for (int32_t i = 0; i < NumOrthogonalDirections; i++) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index a81bff4968..ed78773c68 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -20,6 +20,7 @@ #include "../world/Surface.h" #include "../world/Wall.h" +using namespace OpenRCT2::TrackMetaData; WallPlaceActionResult::WallPlaceActionResult() : GameActions::Result(GameActions::Status::Ok, STR_CANT_BUILD_THIS_HERE) { @@ -592,7 +593,8 @@ bool WallPlaceAction::TrackIsAllowedWallEdges( { if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_NO_WALLS)) { - if (TrackSequenceElementAllowedWallEdges[trackType][trackSequence] & (1 << direction)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.SequenceElementAllowedWallEdges[trackSequence] & (1 << direction)) { return true; } diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index e6dacd20f8..256db9beaa 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4587,7 +4587,7 @@ const static uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { }; /** rct2: 0x00999A94 */ -const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequencesPerPiece] = { +const static uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequencesPerPiece] = { { 0b1010, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::Flat { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::EndStation { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::BeginStation diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index e3c38f20fe..f95adeb9e2 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -57,8 +57,6 @@ constexpr const dodgems_track_size DodgemsTrackSize(track_type_t type) return { 0, 0, 0, 0 }; } -extern const uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][16]; - struct TrackElementDescriptor { rct_track_coordinates Coordinates; From 046c060e7497218df9c484c8122c04492f6da05b Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 22 Aug 2021 11:18:38 -0400 Subject: [PATCH 218/681] Part of #13874: Replace Track Sequence properties --- src/openrct2-ui/windows/Ride.cpp | 4 +++- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 6 ++--- src/openrct2/actions/TrackRemoveAction.cpp | 4 ++-- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/ride/Ride.cpp | 25 +++++++++++++------- src/openrct2/ride/RideConstruction.cpp | 24 ++++++++++++------- src/openrct2/ride/TrackData.cpp | 2 +- src/openrct2/ride/TrackData.h | 2 -- src/openrct2/ride/Vehicle.cpp | 6 +++-- src/openrct2/world/Footpath.cpp | 17 ++++++++----- 11 files changed, 57 insertions(+), 37 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 352c565272..5fc066517d 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -59,6 +59,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::TrackMetaData; static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; static constexpr const int32_t WH = 207; @@ -1368,7 +1369,8 @@ rct_window* window_ride_open_track(TileElement* tileElement) // Open ride window in station view auto trackElement = tileElement->AsTrack(); auto trackType = trackElement->GetTrackType(); - if (TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { auto stationIndex = trackElement->GetStationIndex(); return window_ride_open_station(ride, stationIndex); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 5896be7fe1..3ca11449c2 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -574,7 +574,7 @@ static void window_track_place_draw_mini_preview_track( auto bits = trackBlock->var_08.Rotate(curTrackRotation & 3).GetBaseQuarterOccupied(); // Station track is a lighter colour - uint8_t colour = (TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN) + uint8_t colour = (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) ? _PaletteIndexColourStation : _PaletteIndexColourTrack; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index e6948a5619..21131a1c3c 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -318,7 +318,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - int32_t entranceDirections = TrackSequenceProperties[_trackType][0]; + int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; if ((entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN) && trackBlock->index == 0) { if (!track_add_station_element({ mapLoc, baseZ, _origin.direction }, _rideIndex, 0, _fromTrackDesign)) @@ -538,7 +538,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const { if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND)) { - entranceDirections = TrackSequenceProperties[_trackType][0]; + entranceDirections = teDescriptor.TrackSequenceProperties[0]; } } @@ -597,7 +597,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } trackElement->SetColourScheme(_colour); - entranceDirections = TrackSequenceProperties[_trackType][0]; + entranceDirections = teDescriptor.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint8_t availableDirections = entranceDirections & 0x0F; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 5db867f52b..5e084b109d 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -203,7 +203,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = TrackSequenceProperties[trackType][0]; + int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) @@ -378,7 +378,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = TrackSequenceProperties[trackType][0]; + int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index ed78773c68..7aa2244383 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -441,7 +441,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( int32_t z; if (sequence == 0) { - if (TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) + if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) { return false; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index c6dd1930de..b55da43d9e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -410,10 +410,11 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) // Found a track piece for target ride // Check if it's not the station or ??? (but allow end piece of station) + const auto& teDescriptor = GetTrackElementDescriptor(it.element->AsTrack()->GetTrackType()); bool specialTrackPiece = (it.element->AsTrack()->GetTrackType() != TrackElemType::BeginStation && it.element->AsTrack()->GetTrackType() != TrackElemType::MiddleStation - && (TrackSequenceProperties[it.element->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)); + && (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); // Set result tile to this track piece if first found track or a ??? if (resultTileElement == nullptr || specialTrackPiece) @@ -2228,7 +2229,8 @@ static void ride_shop_connected(Ride* ride) return; } - uint8_t entrance_directions = TrackSequenceProperties[track_type][0] & 0xF; + const auto& teDescriptor = GetTrackElementDescriptor(track_type); + uint8_t entrance_directions = teDescriptor.TrackSequenceProperties[0] & 0xF; uint8_t tile_direction = trackElement->GetDirection(); entrance_directions = rol4(entrance_directions, tile_direction); @@ -2772,7 +2774,8 @@ static int32_t ride_check_station_length(CoordsXYE* input, CoordsXYE* output) do { - if (TrackSequenceProperties[output->element->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& teDescriptor = GetTrackElementDescriptor(output->element->AsTrack()->GetTrackType()); + if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { num_station_elements++; last_good_station = *output; @@ -2819,7 +2822,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check back of the track track_get_back(input, &trackBack); auto trackType = trackBack.element->AsTrack()->GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + auto teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -2828,7 +2832,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check front of the track track_get_front(input, &trackFront); trackType = trackFront.element->AsTrack()->GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -3539,7 +3544,8 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) if (tileElement->GetBaseZ() != location.z) continue; - if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { continue; } @@ -3771,8 +3777,8 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const continue; auto* trackElement = tileElement->AsTrack(); - - if (!(TrackSequenceProperties[trackElement->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (trackElement->GetRideIndex() == id) @@ -4878,7 +4884,8 @@ static int32_t ride_get_track_length(Ride* ride) continue; trackType = tileElement->AsTrack()->GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (tileElement->GetBaseZ() != trackStart.z) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 8f0a5975f5..5b3bb6a432 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -43,6 +43,7 @@ #include "TrainManager.h" #include "Vehicle.h" +using namespace OpenRCT2::TrackMetaData; bool gGotoStartPlacementMode = false; money16 gTotalRideValueForMoney; @@ -1253,7 +1254,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC { if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) { - if (TrackSequenceProperties[info.Element->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& teDescriptor = GetTrackElementDescriptor(info.Element->AsTrack()->GetTrackType()); + if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) { @@ -1343,9 +1345,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; - if (TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()] - [tileElement->AsTrack()->GetSequenceIndex()] - & (1 << eax)) + const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (teDescriptor.TrackSequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) { entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; @@ -1438,6 +1439,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC */ void sub_6CB945(Ride* ride) { + TrackElementDescriptor teDescriptor; if (ride->type != RIDE_TYPE_MAZE) { for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) @@ -1450,7 +1452,6 @@ void sub_6CB945(Ride* ride) bool specialTrack = false; TileElement* tileElement = nullptr; - while (true) { if (direction != INVALID_DIRECTION) @@ -1473,7 +1474,9 @@ void sub_6CB945(Ride* ride) continue; if (tileElement->AsTrack()->GetSequenceIndex() != 0) continue; - if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + + teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1500,7 +1503,7 @@ void sub_6CB945(Ride* ride) continue; } - const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); const rct_preview_track* trackBlock = teDescriptor.Block; while ((++trackBlock)->index != 0xFF) { @@ -1516,7 +1519,9 @@ void sub_6CB945(Ride* ride) continue; if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (!(TrackSequenceProperties[tileElement->AsTrack()->GetTrackType()][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + + teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1611,7 +1616,8 @@ void sub_6CB945(Ride* ride) Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - if (!(TrackSequenceProperties[trackType][trackSequence] & (1 << direction))) + teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << direction))) { continue; } diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 256db9beaa..0ab32b5984 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -287,7 +287,7 @@ const static rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { }; /** rct2: 0x0099BA64 */ -const uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { +const static uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { { 0 }, /* TrackElemType::EndStation */ { TRACK_SEQUENCE_FLAG_DIRECTION_1 | TRACK_SEQUENCE_FLAG_DIRECTION_3 | TRACK_SEQUENCE_FLAG_ORIGIN | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* TrackElemType::BeginStation */ { TRACK_SEQUENCE_FLAG_DIRECTION_1 | TRACK_SEQUENCE_FLAG_DIRECTION_3 | TRACK_SEQUENCE_FLAG_ORIGIN | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index f95adeb9e2..9e41660b5c 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -17,8 +17,6 @@ constexpr const uint8_t MaxSequencesPerPiece = 16; // 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3 -extern const uint8_t TrackSequenceProperties[TrackElemType::Count][MaxSequencesPerPiece]; - struct track_curve_chain { int32_t next; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 6d50508bb5..e4258fe342 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7933,7 +7933,8 @@ void Vehicle::Sub6DBF3E() } auto trackType = GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } @@ -9208,7 +9209,8 @@ loc_6DCE02: } { auto trackType = GetTrackType(); - if (!(TrackSequenceProperties[trackType][0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c155e3cc7d..33c520a3e6 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -38,6 +38,7 @@ #include #include +using namespace OpenRCT2::TrackMetaData; void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement); ProvisionalFootpath gProvisionalFootpath; @@ -880,13 +881,15 @@ static void loc_6A6D7E( const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); - if (!(TrackSequenceProperties[trackType][trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = direction_reverse( (direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (!(TrackSequenceProperties[trackType][trackSequence] & (1 << dx))) + + if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -962,12 +965,13 @@ static void loc_6A6C85( const auto trackType = tileElementPos.element->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElementPos.element->AsTrack()->GetSequenceIndex(); - if (!(TrackSequenceProperties[trackType][trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = (direction - tileElementPos.element->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; - if (!(TrackSequenceProperties[trackType][trackSequence] & (1 << dx))) + if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -2103,10 +2107,11 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); - if (TrackSequenceProperties[trackType][trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) + const auto& teDescriptor = GetTrackElementDescriptor(trackType); + if (teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint16_t dx = ((coords.direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (TrackSequenceProperties[trackType][trackSequence] & (1 << dx)) + if (teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx)) { // Track element has the flags required for the given direction return true; From 07ceec6b60ee3b9fb3c6bdcee41af5c4b084eda1 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Sun, 22 Aug 2021 23:39:58 +0300 Subject: [PATCH 219/681] Make all location types constexpr --- src/openrct2/world/Location.hpp | 152 ++++++++++++++++---------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 19e5ff9952..3558dd7663 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -29,43 +29,43 @@ struct ScreenCoordsXY int32_t x = 0; int32_t y = 0; - ScreenCoordsXY() = default; + constexpr ScreenCoordsXY() = default; constexpr ScreenCoordsXY(int32_t _x, int32_t _y) : x(_x) , y(_y) { } - const ScreenCoordsXY operator-(const ScreenCoordsXY& rhs) const + constexpr const ScreenCoordsXY operator-(const ScreenCoordsXY& rhs) const { return { x - rhs.x, y - rhs.y }; } - ScreenCoordsXY& operator+=(const ScreenCoordsXY& rhs) + constexpr ScreenCoordsXY& operator+=(const ScreenCoordsXY& rhs) { x += rhs.x; y += rhs.y; return *this; } - ScreenCoordsXY& operator-=(const ScreenCoordsXY& rhs) + constexpr ScreenCoordsXY& operator-=(const ScreenCoordsXY& rhs) { x -= rhs.x; y -= rhs.y; return *this; } - const ScreenCoordsXY operator+(const ScreenCoordsXY& rhs) const + constexpr const ScreenCoordsXY operator+(const ScreenCoordsXY& rhs) const { return { x + rhs.x, y + rhs.y }; } - bool operator==(const ScreenCoordsXY& other) const + constexpr bool operator==(const ScreenCoordsXY& other) const { return x == other.x && y == other.y; } - bool operator!=(const ScreenCoordsXY& other) const + constexpr bool operator!=(const ScreenCoordsXY& other) const { return !(*this == other); } @@ -76,19 +76,19 @@ struct ScreenSize int32_t width{}; int32_t height{}; - ScreenSize() = default; + constexpr ScreenSize() = default; constexpr ScreenSize(int32_t _width, int32_t _height) : width(_width) , height(_height) { } - bool operator==(const ScreenSize& other) const + constexpr bool operator==(const ScreenSize& other) const { return width == other.width && height == other.height; } - bool operator!=(const ScreenSize& other) const + constexpr bool operator!=(const ScreenSize& other) const { return !(*this == other); } @@ -103,7 +103,7 @@ struct CoordsXY int32_t x = 0; int32_t y = 0; - CoordsXY() = default; + constexpr CoordsXY() = default; constexpr CoordsXY(int32_t _x, int32_t _y) : x(_x) , y(_y) @@ -231,7 +231,7 @@ struct CoordsXYZ : public CoordsXY { int32_t z = 0; - CoordsXYZ() = default; + constexpr CoordsXYZ() = default; constexpr CoordsXYZ(int32_t _x, int32_t _y, int32_t _z) : CoordsXY(_x, _y) , z(_z) @@ -244,32 +244,32 @@ struct CoordsXYZ : public CoordsXY { } - const CoordsXYZ operator+(const CoordsXYZ& rhs) const + constexpr const CoordsXYZ operator+(const CoordsXYZ& rhs) const { return { x + rhs.x, y + rhs.y, z + rhs.z }; } - const CoordsXYZ operator-(const CoordsXYZ& rhs) const + constexpr const CoordsXYZ operator-(const CoordsXYZ& rhs) const { return { x - rhs.x, y - rhs.y, z - rhs.z }; } - bool operator==(const CoordsXYZ& other) const + constexpr bool operator==(const CoordsXYZ& other) const { return x == other.x && y == other.y && z == other.z; } - CoordsXYZ ToTileStart() const + constexpr CoordsXYZ ToTileStart() const { return { floor2(x, COORDS_XY_STEP), floor2(y, COORDS_XY_STEP), z }; } - CoordsXYZ ToTileCentre() const + constexpr CoordsXYZ ToTileCentre() const { return ToTileStart() + CoordsXYZ{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0 }; } - void setNull() + constexpr void setNull() { CoordsXY::setNull(); z = 0; @@ -281,7 +281,7 @@ struct CoordsXYRangedZ : public CoordsXY int32_t baseZ = 0; int32_t clearanceZ = 0; - CoordsXYRangedZ() = default; + constexpr CoordsXYRangedZ() = default; constexpr CoordsXYRangedZ(int32_t _x, int32_t _y, int32_t _baseZ, int32_t _clearanceZ) : CoordsXY(_x, _y) , baseZ(_baseZ) @@ -309,39 +309,39 @@ struct TileCoordsXY int32_t x = 0; int32_t y = 0; - TileCoordsXY() = default; + constexpr TileCoordsXY() = default; constexpr TileCoordsXY(int32_t x_, int32_t y_) : x(x_) , y(y_) { } - explicit TileCoordsXY(const CoordsXY& c) + constexpr explicit TileCoordsXY(const CoordsXY& c) : x(c.x / COORDS_XY_STEP) , y(c.y / COORDS_XY_STEP) { } - const TileCoordsXY operator+(const TileCoordsXY& rhs) const + constexpr const TileCoordsXY operator+(const TileCoordsXY& rhs) const { return { x + rhs.x, y + rhs.y }; } - TileCoordsXY& operator+=(const TileCoordsXY& rhs) + constexpr TileCoordsXY& operator+=(const TileCoordsXY& rhs) { x += rhs.x; y += rhs.y; return *this; } - TileCoordsXY& operator-=(const TileCoordsXY& rhs) + constexpr TileCoordsXY& operator-=(const TileCoordsXY& rhs) { x -= rhs.x; y -= rhs.y; return *this; } - CoordsXY ToCoordsXY() const + constexpr CoordsXY ToCoordsXY() const { if (isNull()) { @@ -353,7 +353,7 @@ struct TileCoordsXY return { x * COORDS_XY_STEP, y * COORDS_XY_STEP }; } - TileCoordsXY Rotate(int32_t direction) const + constexpr TileCoordsXY Rotate(int32_t direction) const { TileCoordsXY rotatedCoords; switch (direction & 3) @@ -380,22 +380,22 @@ struct TileCoordsXY return rotatedCoords; } - bool operator==(const TileCoordsXY& other) const + constexpr bool operator==(const TileCoordsXY& other) const { return x == other.x && y == other.y; } - bool operator!=(const TileCoordsXY& other) const + constexpr bool operator!=(const TileCoordsXY& other) const { return !(*this == other); } - bool isNull() const + constexpr bool isNull() const { return x == COORDS_NULL; }; - void setNull() + constexpr void setNull() { x = COORDS_NULL; y = 0; @@ -406,56 +406,56 @@ struct TileCoordsXYZ : public TileCoordsXY { int32_t z = 0; - TileCoordsXYZ() = default; + constexpr TileCoordsXYZ() = default; constexpr TileCoordsXYZ(int32_t x_, int32_t y_, int32_t z_) : TileCoordsXY(x_, y_) , z(z_) { } - TileCoordsXYZ(const TileCoordsXY& c, int32_t z_) + constexpr TileCoordsXYZ(const TileCoordsXY& c, int32_t z_) : TileCoordsXY(c.x, c.y) , z(z_) { } - TileCoordsXYZ(const CoordsXY& c, int32_t z_) + constexpr TileCoordsXYZ(const CoordsXY& c, int32_t z_) : TileCoordsXY(c) , z(z_) { } - explicit TileCoordsXYZ(const CoordsXYZ& c) + constexpr explicit TileCoordsXYZ(const CoordsXYZ& c) : TileCoordsXY(c) , z(c.z / COORDS_Z_STEP) { } - TileCoordsXYZ& operator+=(const TileCoordsXY& rhs) + constexpr TileCoordsXYZ& operator+=(const TileCoordsXY& rhs) { x += rhs.x; y += rhs.y; return *this; } - TileCoordsXYZ& operator-=(const TileCoordsXY& rhs) + constexpr TileCoordsXYZ& operator-=(const TileCoordsXY& rhs) { x -= rhs.x; y -= rhs.y; return *this; } - bool operator==(const TileCoordsXYZ& other) const + constexpr bool operator==(const TileCoordsXYZ& other) const { return x == other.x && y == other.y && z == other.z; } - bool operator!=(const TileCoordsXYZ& other) const + constexpr bool operator!=(const TileCoordsXYZ& other) const { return !(*this == other); } - CoordsXYZ ToCoordsXYZ() const + constexpr CoordsXYZ ToCoordsXYZ() const { if (isNull()) { @@ -466,7 +466,7 @@ struct TileCoordsXYZ : public TileCoordsXY return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP }; } - void setNull() + constexpr void setNull() { TileCoordsXY::setNull(); z = 0; @@ -549,7 +549,7 @@ struct CoordsXYZD : public CoordsXYZ { Direction direction = 0; - CoordsXYZD() = default; + constexpr CoordsXYZD() = default; constexpr CoordsXYZD(int32_t _x, int32_t _y, int32_t _z, Direction _d) : CoordsXYZ(_x, _y, _z) , direction(_d) @@ -568,49 +568,49 @@ struct CoordsXYZD : public CoordsXYZ { } - bool operator==(const CoordsXYZD& other) const + constexpr bool operator==(const CoordsXYZD& other) const { return x == other.x && y == other.y && z == other.z && direction == other.direction; } - bool operator!=(const CoordsXYZD& other) const + constexpr bool operator!=(const CoordsXYZD& other) const { return !(*this == other); } - CoordsXYZD& operator+=(const CoordsXY& rhs) + constexpr CoordsXYZD& operator+=(const CoordsXY& rhs) { x += rhs.x; y += rhs.y; return *this; } - const CoordsXYZD operator+(const CoordsXY& rhs) const + constexpr const CoordsXYZD operator+(const CoordsXY& rhs) const { return { x + rhs.x, y + rhs.y, z, direction }; } - const CoordsXYZD operator+(const CoordsXYZ& rhs) const + constexpr const CoordsXYZD operator+(const CoordsXYZ& rhs) const { return { x + rhs.x, y + rhs.y, z + rhs.z, direction }; } - const CoordsXYZD operator-(const CoordsXY& rhs) const + constexpr const CoordsXYZD operator-(const CoordsXY& rhs) const { return { x - rhs.x, y - rhs.y, z, direction }; } - const CoordsXYZD operator-(const CoordsXYZ& rhs) const + constexpr const CoordsXYZD operator-(const CoordsXYZ& rhs) const { return { x - rhs.x, y - rhs.y, z - rhs.z, direction }; } - CoordsXYZD ToTileStart() const + constexpr CoordsXYZD ToTileStart() const { return { floor2(x, COORDS_XY_STEP), floor2(y, COORDS_XY_STEP), z, direction }; } - CoordsXYZD ToTileCentre() const + constexpr CoordsXYZD ToTileCentre() const { return ToTileStart() + CoordsXYZD{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0, 0 }; } @@ -620,44 +620,44 @@ struct TileCoordsXYZD : public TileCoordsXYZ { Direction direction; - TileCoordsXYZD() = default; + constexpr TileCoordsXYZD() = default; constexpr TileCoordsXYZD(int32_t x_, int32_t y_, int32_t z_, Direction d_) : TileCoordsXYZ(x_, y_, z_) , direction(d_) { } - TileCoordsXYZD(const TileCoordsXYZ& t_, Direction d_) + constexpr TileCoordsXYZD(const TileCoordsXYZ& t_, Direction d_) : TileCoordsXYZ(t_) , direction(d_) { } - TileCoordsXYZD(const TileCoordsXY& t_, int32_t z_, Direction d_) + constexpr TileCoordsXYZD(const TileCoordsXY& t_, int32_t z_, Direction d_) : TileCoordsXYZ(t_, z_) , direction(d_) { } - TileCoordsXYZD(const CoordsXY& c_, int32_t z_, Direction d_) + constexpr TileCoordsXYZD(const CoordsXY& c_, int32_t z_, Direction d_) : TileCoordsXYZ(c_, z_) , direction(d_) { } - TileCoordsXYZD(const CoordsXYZ& c_, Direction d_) + constexpr TileCoordsXYZD(const CoordsXYZ& c_, Direction d_) : TileCoordsXYZ(c_) , direction(d_) { } - TileCoordsXYZD(const CoordsXYZD& c_) + constexpr TileCoordsXYZD(const CoordsXYZD& c_) : TileCoordsXYZ(c_) , direction(c_.direction) { } - CoordsXYZD ToCoordsXYZD() const + constexpr CoordsXYZD ToCoordsXYZD() const { if (isNull()) { @@ -668,7 +668,7 @@ struct TileCoordsXYZD : public TileCoordsXYZ return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction }; } - void setNull() + constexpr void setNull() { TileCoordsXYZ::setNull(); direction = INVALID_DIRECTION; @@ -683,30 +683,30 @@ template struct CoordsRange T Point1{ 0, 0 }; T Point2{ 0, 0 }; - int32_t GetX1() const + constexpr int32_t GetX1() const { return Point1.x; } - int32_t GetY1() const + constexpr int32_t GetY1() const { return Point1.y; } - int32_t GetX2() const + constexpr int32_t GetX2() const { return Point2.x; } - int32_t GetY2() const + constexpr int32_t GetY2() const { return Point2.y; } - CoordsRange() = default; - CoordsRange(int32_t x1, int32_t y1, int32_t x2, int32_t y2) + constexpr CoordsRange() = default; + constexpr CoordsRange(int32_t x1, int32_t y1, int32_t x2, int32_t y2) : CoordsRange({ x1, y1 }, { x2, y2 }) { } - CoordsRange(const T& pointOne, const T& pointTwo) + constexpr CoordsRange(const T& pointOne, const T& pointTwo) : Point1(pointOne) , Point2(pointTwo) { @@ -717,29 +717,29 @@ template struct RectRange : public CoordsRange { using CoordsRange::CoordsRange; - int32_t GetLeft() const + constexpr int32_t GetLeft() const { return CoordsRange::GetX1(); } - int32_t GetTop() const + constexpr int32_t GetTop() const { return CoordsRange::GetY1(); } - int32_t GetRight() const + constexpr int32_t GetRight() const { return CoordsRange::GetX2(); } - int32_t GetBottom() const + constexpr int32_t GetBottom() const { return CoordsRange::GetY2(); } - RectRange(int32_t left, int32_t top, int32_t right, int32_t bottom) + constexpr RectRange(int32_t left, int32_t top, int32_t right, int32_t bottom) : RectRange({ left, top }, { right, bottom }) { } - RectRange(const T& leftTop, const T& rightBottom) + constexpr RectRange(const T& leftTop, const T& rightBottom) : CoordsRange(leftTop, rightBottom) { } @@ -753,7 +753,7 @@ struct MapRange : public RectRange { using RectRange::RectRange; - MapRange Normalise() const + constexpr MapRange Normalise() const { auto result = MapRange( std::min(GetLeft(), GetRight()), std::min(GetTop(), GetBottom()), std::max(GetLeft(), GetRight()), @@ -768,7 +768,7 @@ struct MapRange : public RectRange struct ScreenLine : public CoordsRange { - ScreenLine(const ScreenCoordsXY& leftTop, const ScreenCoordsXY& rightBottom) + constexpr ScreenLine(const ScreenCoordsXY& leftTop, const ScreenCoordsXY& rightBottom) : CoordsRange(leftTop, rightBottom) { } @@ -782,15 +782,15 @@ struct ScreenRect : public RectRange { using RectRange::RectRange; - int32_t GetWidth() const + constexpr int32_t GetWidth() const { return GetRight() - GetLeft(); } - int32_t GetHeight() const + constexpr int32_t GetHeight() const { return GetBottom() - GetTop(); } - bool Contains(const ScreenCoordsXY& coords) const + constexpr bool Contains(const ScreenCoordsXY& coords) const { return coords.x >= GetLeft() && coords.x <= GetRight() && coords.y >= GetTop() && coords.y <= GetBottom(); } From c858f218450c5e5d91f9fa9c88c9d6818c39a901 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 23 Aug 2021 14:41:18 +0300 Subject: [PATCH 220/681] Default initialize members the same way across the file --- src/openrct2/world/Location.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 3558dd7663..560bcb91e8 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -26,8 +26,8 @@ constexpr int32_t COORDS_NULL = 0xFFFF8000; struct ScreenCoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; constexpr ScreenCoordsXY() = default; constexpr ScreenCoordsXY(int32_t _x, int32_t _y) @@ -100,8 +100,8 @@ struct ScreenSize */ struct CoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; constexpr CoordsXY() = default; constexpr CoordsXY(int32_t _x, int32_t _y) @@ -229,7 +229,7 @@ struct CoordsXY struct CoordsXYZ : public CoordsXY { - int32_t z = 0; + int32_t z{}; constexpr CoordsXYZ() = default; constexpr CoordsXYZ(int32_t _x, int32_t _y, int32_t _z) @@ -278,8 +278,8 @@ struct CoordsXYZ : public CoordsXY struct CoordsXYRangedZ : public CoordsXY { - int32_t baseZ = 0; - int32_t clearanceZ = 0; + int32_t baseZ{}; + int32_t clearanceZ{}; constexpr CoordsXYRangedZ() = default; constexpr CoordsXYRangedZ(int32_t _x, int32_t _y, int32_t _baseZ, int32_t _clearanceZ) @@ -306,8 +306,8 @@ struct CoordsXYRangedZ : public CoordsXY struct TileCoordsXY { - int32_t x = 0; - int32_t y = 0; + int32_t x{}; + int32_t y{}; constexpr TileCoordsXY() = default; constexpr TileCoordsXY(int32_t x_, int32_t y_) @@ -404,7 +404,7 @@ struct TileCoordsXY struct TileCoordsXYZ : public TileCoordsXY { - int32_t z = 0; + int32_t z{}; constexpr TileCoordsXYZ() = default; constexpr TileCoordsXYZ(int32_t x_, int32_t y_, int32_t z_) @@ -547,7 +547,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; struct CoordsXYZD : public CoordsXYZ { - Direction direction = 0; + Direction direction{}; constexpr CoordsXYZD() = default; constexpr CoordsXYZD(int32_t _x, int32_t _y, int32_t _z, Direction _d) @@ -618,7 +618,7 @@ struct CoordsXYZD : public CoordsXYZ struct TileCoordsXYZD : public TileCoordsXYZ { - Direction direction; + Direction direction{}; constexpr TileCoordsXYZD() = default; constexpr TileCoordsXYZD(int32_t x_, int32_t y_, int32_t z_, Direction d_) From 956e77f4c36b5ac10907ad73722e259ffab5c080 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 23 Aug 2021 20:09:43 +0200 Subject: [PATCH 221/681] Use [[nodiscard]] for allocator and RAII functions (#15244) --- src/openrct2-ui/UiContext.h | 6 +- src/openrct2-ui/audio/AudioContext.h | 2 +- .../drawing/engines/DrawingEngineFactory.hpp | 10 ++- src/openrct2-ui/title/TitleSequencePlayer.h | 2 +- src/openrct2/Context.h | 12 +-- src/openrct2/GameStateSnapshots.h | 2 +- src/openrct2/ParkImporter.h | 6 +- src/openrct2/PlatformEnvironment.h | 4 +- src/openrct2/ReplayManager.h | 2 +- src/openrct2/TrackImporter.h | 8 +- src/openrct2/audio/AudioContext.h | 2 +- src/openrct2/config/IniReader.hpp | 4 +- src/openrct2/config/IniWriter.hpp | 2 +- src/openrct2/core/Crypt.h | 8 +- src/openrct2/core/FileScanner.h | 4 +- src/openrct2/core/IStream.hpp | 2 +- src/openrct2/core/Zip.h | 18 ++-- src/openrct2/drawing/IDrawingEngine.h | 2 +- .../network/NetworkServerAdvertiser.h | 2 +- src/openrct2/network/Socket.h | 8 +- src/openrct2/network/network.h | 86 +++++++++---------- src/openrct2/object/ImageTable.h | 12 +-- src/openrct2/object/LargeSceneryObject.h | 10 +-- src/openrct2/object/Object.h | 6 +- src/openrct2/object/ObjectFactory.h | 11 +-- src/openrct2/object/ObjectManager.h | 12 +-- src/openrct2/object/ObjectRepository.h | 31 +++---- src/openrct2/peep/Peep.h | 14 +-- src/openrct2/rct12/SawyerChunkReader.h | 4 +- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/TrackDesign.h | 2 +- src/openrct2/ride/TrackDesignRepository.h | 11 +-- src/openrct2/scenario/ScenarioRepository.h | 12 +-- src/openrct2/scripting/ScriptEngine.h | 9 +- src/openrct2/title/TitleSequence.h | 6 +- src/openrct2/ui/UiContext.h | 4 +- src/openrct2/world/Map.h | 4 +- test/tests/sawyercoding_test.cpp | 24 ++++-- 38 files changed, 192 insertions(+), 174 deletions(-) diff --git a/src/openrct2-ui/UiContext.h b/src/openrct2-ui/UiContext.h index 4917703eae..1d84ee0a9a 100644 --- a/src/openrct2-ui/UiContext.h +++ b/src/openrct2-ui/UiContext.h @@ -46,9 +46,9 @@ namespace OpenRCT2 virtual bool HasFilePicker() const abstract; }; - std::unique_ptr CreateUiContext(const std::shared_ptr& env); - IPlatformUiContext* CreatePlatformUiContext(); + [[nodiscard]] std::unique_ptr CreateUiContext(const std::shared_ptr& env); + [[nodiscard]] IPlatformUiContext* CreatePlatformUiContext(); - InGameConsole& GetInGameConsole(); + [[nodiscard]] InGameConsole& GetInGameConsole(); } // namespace Ui } // namespace OpenRCT2 diff --git a/src/openrct2-ui/audio/AudioContext.h b/src/openrct2-ui/audio/AudioContext.h index 7f4a48ebd6..dd175aa7ea 100644 --- a/src/openrct2-ui/audio/AudioContext.h +++ b/src/openrct2-ui/audio/AudioContext.h @@ -79,6 +79,6 @@ namespace OpenRCT2::Audio IAudioMixer* Create(); } - std::unique_ptr CreateAudioContext(); + [[nodiscard]] std::unique_ptr CreateAudioContext(); } // namespace OpenRCT2::Audio diff --git a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp index 47b6868708..e746c966a5 100644 --- a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp +++ b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp @@ -21,16 +21,18 @@ namespace OpenRCT2 struct IUiContext; - std::unique_ptr CreateSoftwareDrawingEngine(const std::shared_ptr& uiContext); - std::unique_ptr CreateHardwareDisplayDrawingEngine(const std::shared_ptr& uiContext); + [[nodiscard]] std::unique_ptr CreateSoftwareDrawingEngine(const std::shared_ptr& uiContext); + [[nodiscard]] std::unique_ptr CreateHardwareDisplayDrawingEngine( + const std::shared_ptr& uiContext); #ifndef DISABLE_OPENGL - std::unique_ptr CreateOpenGLDrawingEngine(const std::shared_ptr& uiContext); + [[nodiscard]] std::unique_ptr CreateOpenGLDrawingEngine(const std::shared_ptr& uiContext); #endif class DrawingEngineFactory final : public IDrawingEngineFactory { public: - std::unique_ptr Create(DrawingEngine type, const std::shared_ptr& uiContext) override + [[nodiscard]] std::unique_ptr Create( + DrawingEngine type, const std::shared_ptr& uiContext) override { switch (type) { diff --git a/src/openrct2-ui/title/TitleSequencePlayer.h b/src/openrct2-ui/title/TitleSequencePlayer.h index 77699d47fa..1d38e714fc 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.h +++ b/src/openrct2-ui/title/TitleSequencePlayer.h @@ -20,4 +20,4 @@ namespace OpenRCT2 class GameState; } -std::unique_ptr CreateTitleSequencePlayer(OpenRCT2::GameState& gameState); +[[nodiscard]] std::unique_ptr CreateTitleSequencePlayer(OpenRCT2::GameState& gameState); diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 967ac662b7..4cac112caf 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -114,10 +114,10 @@ namespace OpenRCT2 { virtual ~IContext() = default; - virtual std::shared_ptr GetAudioContext() abstract; - virtual std::shared_ptr GetUiContext() abstract; + [[nodiscard]] virtual std::shared_ptr GetAudioContext() abstract; + [[nodiscard]] virtual std::shared_ptr GetUiContext() abstract; virtual GameState* GetGameState() abstract; - virtual std::shared_ptr GetPlatformEnvironment() abstract; + [[nodiscard]] virtual std::shared_ptr GetPlatformEnvironment() abstract; virtual Localisation::LocalisationService& GetLocalisationService() abstract; virtual IObjectManager& GetObjectManager() abstract; virtual IObjectRepository& GetObjectRepository() abstract; @@ -156,11 +156,11 @@ namespace OpenRCT2 virtual float GetTimeScale() const abstract; }; - std::unique_ptr CreateContext(); - std::unique_ptr CreateContext( + [[nodiscard]] std::unique_ptr CreateContext(); + [[nodiscard]] std::unique_ptr CreateContext( const std::shared_ptr& env, const std::shared_ptr& audioContext, const std::shared_ptr& uiContext); - IContext* GetContext(); + [[nodiscard]] IContext* GetContext(); } // namespace OpenRCT2 enum diff --git a/src/openrct2/GameStateSnapshots.h b/src/openrct2/GameStateSnapshots.h index f7490c953d..ed3df93176 100644 --- a/src/openrct2/GameStateSnapshots.h +++ b/src/openrct2/GameStateSnapshots.h @@ -110,4 +110,4 @@ struct IGameStateSnapshots virtual std::string GetCompareDataText(const GameStateCompareData_t& cmpData) const = 0; }; -std::unique_ptr CreateGameStateSnapshots(); +[[nodiscard]] std::unique_ptr CreateGameStateSnapshots(); diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index 1edcc8b146..ff2272dd8e 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -57,9 +57,9 @@ public: namespace ParkImporter { - std::unique_ptr Create(const std::string& hintPath); - std::unique_ptr CreateS4(); - std::unique_ptr CreateS6(IObjectRepository& objectRepository); + [[nodiscard]] std::unique_ptr Create(const std::string& hintPath); + [[nodiscard]] std::unique_ptr CreateS4(); + [[nodiscard]] std::unique_ptr CreateS6(IObjectRepository& objectRepository); bool ExtensionIsRCT1(const std::string& extension); bool ExtensionIsScenario(const std::string& extension); diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index 91f3a47779..0d539a0024 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -84,7 +84,7 @@ namespace OpenRCT2 virtual void SetBasePath(DIRBASE base, const std::string& path) abstract; }; - std::unique_ptr CreatePlatformEnvironment(DIRBASE_VALUES basePaths); - std::unique_ptr CreatePlatformEnvironment(); + [[nodiscard]] std::unique_ptr CreatePlatformEnvironment(DIRBASE_VALUES basePaths); + [[nodiscard]] std::unique_ptr CreatePlatformEnvironment(); } // namespace OpenRCT2 diff --git a/src/openrct2/ReplayManager.h b/src/openrct2/ReplayManager.h index d635147008..895a99fedd 100644 --- a/src/openrct2/ReplayManager.h +++ b/src/openrct2/ReplayManager.h @@ -65,6 +65,6 @@ namespace OpenRCT2 virtual bool NormaliseReplay(const std::string& inputFile, const std::string& outputFile) = 0; }; - std::unique_ptr CreateReplayManager(); + [[nodiscard]] std::unique_ptr CreateReplayManager(); } // namespace OpenRCT2 diff --git a/src/openrct2/TrackImporter.h b/src/openrct2/TrackImporter.h index 677228dc1a..fb5ffee743 100644 --- a/src/openrct2/TrackImporter.h +++ b/src/openrct2/TrackImporter.h @@ -28,14 +28,14 @@ public: virtual bool Load(const utf8* path) abstract; virtual bool LoadFromStream(OpenRCT2::IStream* stream) abstract; - virtual std::unique_ptr Import() abstract; + [[nodiscard]] virtual std::unique_ptr Import() abstract; }; namespace TrackImporter { - std::unique_ptr Create(const std::string& hintPath); - std::unique_ptr CreateTD4(); - std::unique_ptr CreateTD6(); + [[nodiscard]] std::unique_ptr Create(const std::string& hintPath); + [[nodiscard]] std::unique_ptr CreateTD4(); + [[nodiscard]] std::unique_ptr CreateTD6(); bool ExtensionIsRCT1(const std::string& extension); } // namespace TrackImporter diff --git a/src/openrct2/audio/AudioContext.h b/src/openrct2/audio/AudioContext.h index af7ab7bfdb..6b9ee914d2 100644 --- a/src/openrct2/audio/AudioContext.h +++ b/src/openrct2/audio/AudioContext.h @@ -55,6 +55,6 @@ namespace OpenRCT2::Audio virtual void StopVehicleSounds() abstract; }; - std::unique_ptr CreateDummyAudioContext(); + [[nodiscard]] std::unique_ptr CreateDummyAudioContext(); } // namespace OpenRCT2::Audio diff --git a/src/openrct2/config/IniReader.hpp b/src/openrct2/config/IniReader.hpp index 23329091cf..91f847d590 100644 --- a/src/openrct2/config/IniReader.hpp +++ b/src/openrct2/config/IniReader.hpp @@ -48,5 +48,5 @@ struct IIniReader utf8* GetCString(const std::string& name, const utf8* defaultValue) const; }; -std::unique_ptr CreateIniReader(OpenRCT2::IStream* stream); -std::unique_ptr CreateDefaultIniReader(); +[[nodiscard]] std::unique_ptr CreateIniReader(OpenRCT2::IStream* stream); +[[nodiscard]] std::unique_ptr CreateDefaultIniReader(); diff --git a/src/openrct2/config/IniWriter.hpp b/src/openrct2/config/IniWriter.hpp index ab5cd6f501..8f44e51e81 100644 --- a/src/openrct2/config/IniWriter.hpp +++ b/src/openrct2/config/IniWriter.hpp @@ -52,4 +52,4 @@ struct IIniWriter void WriteString(const std::string& name, const utf8* value); }; -std::unique_ptr CreateIniWriter(OpenRCT2::IStream* stream); +[[nodiscard]] std::unique_ptr CreateIniWriter(OpenRCT2::IStream* stream); diff --git a/src/openrct2/core/Crypt.h b/src/openrct2/core/Crypt.h index 468ca65780..18967bd875 100644 --- a/src/openrct2/core/Crypt.h +++ b/src/openrct2/core/Crypt.h @@ -50,10 +50,10 @@ namespace Crypt using Sha256Algorithm = HashAlgorithm<32>; // Factories - std::unique_ptr CreateSHA1(); - std::unique_ptr CreateSHA256(); - std::unique_ptr CreateRSA(); - std::unique_ptr CreateRSAKey(); + [[nodiscard]] std::unique_ptr CreateSHA1(); + [[nodiscard]] std::unique_ptr CreateSHA256(); + [[nodiscard]] std::unique_ptr CreateRSA(); + [[nodiscard]] std::unique_ptr CreateRSAKey(); inline Sha1Algorithm::Result SHA1(const void* data, size_t dataLen) { diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index 1e6c63d230..4cc17977bb 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -51,7 +51,7 @@ namespace Path * @param recurse Whether to scan sub directories or not. * @returns A new FileScanner, this must be deleted when no longer needed. */ - std::unique_ptr ScanDirectory(const std::string& pattern, bool recurse); + [[nodiscard]] std::unique_ptr ScanDirectory(const std::string& pattern, bool recurse); /** * Scans a directory and all sub directories @@ -60,5 +60,5 @@ namespace Path */ void QueryDirectory(QueryDirectoryResult* result, const std::string& pattern); - std::vector GetDirectories(const std::string& path); + [[nodiscard]] std::vector GetDirectories(const std::string& path); } // namespace Path diff --git a/src/openrct2/core/IStream.hpp b/src/openrct2/core/IStream.hpp index 6f751dc77c..815990d8dc 100644 --- a/src/openrct2/core/IStream.hpp +++ b/src/openrct2/core/IStream.hpp @@ -192,7 +192,7 @@ namespace OpenRCT2 Write(&value); } - template std::unique_ptr ReadArray(size_t count) + template[[nodiscard]] std::unique_ptr ReadArray(size_t count) { auto buffer = std::make_unique(count); Read(buffer.get(), sizeof(T) * count); diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index 01d5e8b17b..43d4beafc5 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -31,11 +31,11 @@ struct IZipArchive { } - virtual size_t GetNumFiles() const abstract; - virtual std::string GetFileName(size_t index) const abstract; - virtual uint64_t GetFileSize(size_t index) const abstract; - virtual std::vector GetFileData(std::string_view path) const abstract; - virtual std::unique_ptr GetFileStream(std::string_view path) const abstract; + [[nodiscard]] virtual size_t GetNumFiles() const abstract; + [[nodiscard]] virtual std::string GetFileName(size_t index) const abstract; + [[nodiscard]] virtual uint64_t GetFileSize(size_t index) const abstract; + [[nodiscard]] virtual std::vector GetFileData(std::string_view path) const abstract; + [[nodiscard]] virtual std::unique_ptr GetFileStream(std::string_view path) const abstract; /** * Creates or overwrites a file within the zip archive to the given data buffer. @@ -47,8 +47,8 @@ struct IZipArchive virtual void DeleteFile(std::string_view path) abstract; virtual void RenameFile(std::string_view path, std::string_view newPath) abstract; - std::optional GetIndexFromPath(std::string_view path) const; - bool Exists(std::string_view path) const; + [[nodiscard]] std::optional GetIndexFromPath(std::string_view path) const; + [[nodiscard]] bool Exists(std::string_view path) const; }; enum class ZIP_ACCESS @@ -59,6 +59,6 @@ enum class ZIP_ACCESS namespace Zip { - std::unique_ptr Open(std::string_view path, ZIP_ACCESS zipAccess); - std::unique_ptr TryOpen(std::string_view path, ZIP_ACCESS zipAccess); + [[nodiscard]] std::unique_ptr Open(std::string_view path, ZIP_ACCESS zipAccess); + [[nodiscard]] std::unique_ptr TryOpen(std::string_view path, ZIP_ACCESS zipAccess); } // namespace Zip diff --git a/src/openrct2/drawing/IDrawingEngine.h b/src/openrct2/drawing/IDrawingEngine.h index 0d679d2467..41c3adb383 100644 --- a/src/openrct2/drawing/IDrawingEngine.h +++ b/src/openrct2/drawing/IDrawingEngine.h @@ -79,7 +79,7 @@ namespace OpenRCT2::Drawing virtual ~IDrawingEngineFactory() { } - virtual std::unique_ptr Create( + [[nodiscard]] virtual std::unique_ptr Create( DrawingEngine type, const std::shared_ptr& uiContext) abstract; }; diff --git a/src/openrct2/network/NetworkServerAdvertiser.h b/src/openrct2/network/NetworkServerAdvertiser.h index b4581ca9f6..e49882d93f 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.h +++ b/src/openrct2/network/NetworkServerAdvertiser.h @@ -30,4 +30,4 @@ struct INetworkServerAdvertiser virtual void Update() abstract; }; -std::unique_ptr CreateServerAdvertiser(uint16_t port); +[[nodiscard]] std::unique_ptr CreateServerAdvertiser(uint16_t port); diff --git a/src/openrct2/network/Socket.h b/src/openrct2/network/Socket.h index 9100d959a9..81b6ea2911 100644 --- a/src/openrct2/network/Socket.h +++ b/src/openrct2/network/Socket.h @@ -60,7 +60,7 @@ public: virtual void Listen(uint16_t port) abstract; virtual void Listen(const std::string& address, uint16_t port) abstract; - virtual std::unique_ptr Accept() abstract; + [[nodiscard]] virtual std::unique_ptr Accept() abstract; virtual void Connect(const std::string& address, uint16_t port) abstract; virtual void ConnectAsync(const std::string& address, uint16_t port) abstract; @@ -98,9 +98,9 @@ public: virtual void Close() abstract; }; -std::unique_ptr CreateTcpSocket(); -std::unique_ptr CreateUdpSocket(); -std::vector> GetBroadcastAddresses(); +[[nodiscard]] std::unique_ptr CreateTcpSocket(); +[[nodiscard]] std::unique_ptr CreateUdpSocket(); +[[nodiscard]] std::vector> GetBroadcastAddresses(); namespace Convert { diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 2876339f21..9e590caf9c 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -47,8 +47,8 @@ void network_shutdown_client(); int32_t network_begin_client(const std::string& host, int32_t port); int32_t network_begin_server(int32_t port, const std::string& address); -int32_t network_get_mode(); -int32_t network_get_status(); +[[nodiscard]] int32_t network_get_mode(); +[[nodiscard]] int32_t network_get_status(); bool network_is_desynchronised(); bool network_check_desynchronisation(); void network_request_gamestate_snapshot(); @@ -58,46 +58,46 @@ void network_update(); void network_process_pending(); void network_flush(); -NetworkAuth network_get_authstatus(); -uint32_t network_get_server_tick(); -uint8_t network_get_current_player_id(); -int32_t network_get_num_players(); -const char* network_get_player_name(uint32_t index); -uint32_t network_get_player_flags(uint32_t index); -int32_t network_get_player_ping(uint32_t index); -int32_t network_get_player_id(uint32_t index); -money32 network_get_player_money_spent(uint32_t index); -std::string network_get_player_ip_address(uint32_t id); -std::string network_get_player_public_key_hash(uint32_t id); +[[nodiscard]] NetworkAuth network_get_authstatus(); +[[nodiscard]] uint32_t network_get_server_tick(); +[[nodiscard]] uint8_t network_get_current_player_id(); +[[nodiscard]] int32_t network_get_num_players(); +[[nodiscard]] const char* network_get_player_name(uint32_t index); +[[nodiscard]] uint32_t network_get_player_flags(uint32_t index); +[[nodiscard]] int32_t network_get_player_ping(uint32_t index); +[[nodiscard]] int32_t network_get_player_id(uint32_t index); +[[nodiscard]] money32 network_get_player_money_spent(uint32_t index); +[[nodiscard]] std::string network_get_player_ip_address(uint32_t id); +[[nodiscard]] std::string network_get_player_public_key_hash(uint32_t id); void network_add_player_money_spent(uint32_t index, money32 cost); -int32_t network_get_player_last_action(uint32_t index, int32_t time); +[[nodiscard]] int32_t network_get_player_last_action(uint32_t index, int32_t time); void network_set_player_last_action(uint32_t index, GameCommand command); -CoordsXYZ network_get_player_last_action_coord(uint32_t index); +[[nodiscard]] CoordsXYZ network_get_player_last_action_coord(uint32_t index); void network_set_player_last_action_coord(uint32_t index, const CoordsXYZ& coord); -uint32_t network_get_player_commands_ran(uint32_t index); -int32_t network_get_player_index(uint32_t id); -uint8_t network_get_player_group(uint32_t index); +[[nodiscard]] uint32_t network_get_player_commands_ran(uint32_t index); +[[nodiscard]] int32_t network_get_player_index(uint32_t id); +[[nodiscard]] uint8_t network_get_player_group(uint32_t index); void network_set_player_group(uint32_t index, uint32_t groupindex); -int32_t network_get_group_index(uint8_t id); -int32_t network_get_current_player_group_index(); -uint8_t network_get_group_id(uint32_t index); -int32_t network_get_num_groups(); -const char* network_get_group_name(uint32_t index); -std::unique_ptr network_set_player_group( +[[nodiscard]] int32_t network_get_group_index(uint8_t id); +[[nodiscard]] int32_t network_get_current_player_group_index(); +[[nodiscard]] uint8_t network_get_group_id(uint32_t index); +[[nodiscard]] int32_t network_get_num_groups(); +[[nodiscard]] const char* network_get_group_name(uint32_t index); +[[nodiscard]] std::unique_ptr network_set_player_group( NetworkPlayerId_t actionPlayerId, NetworkPlayerId_t playerId, uint8_t groupId, bool isExecuting); -std::unique_ptr network_modify_groups( +[[nodiscard]] std::unique_ptr network_modify_groups( NetworkPlayerId_t actionPlayerId, ModifyGroupType type, uint8_t groupId, const std::string& name, uint32_t permissionIndex, PermissionState permissionState, bool isExecuting); -std::unique_ptr network_kick_player(NetworkPlayerId_t playerId, bool isExecuting); -uint8_t network_get_default_group(); -int32_t network_get_num_actions(); -rct_string_id network_get_action_name_string_id(uint32_t index); -int32_t network_can_perform_action(uint32_t groupindex, NetworkPermission index); -int32_t network_can_perform_command(uint32_t groupindex, int32_t index); +[[nodiscard]] std::unique_ptr network_kick_player(NetworkPlayerId_t playerId, bool isExecuting); +[[nodiscard]] uint8_t network_get_default_group(); +[[nodiscard]] int32_t network_get_num_actions(); +[[nodiscard]] rct_string_id network_get_action_name_string_id(uint32_t index); +[[nodiscard]] int32_t network_can_perform_action(uint32_t groupindex, NetworkPermission index); +[[nodiscard]] int32_t network_can_perform_command(uint32_t groupindex, int32_t index); void network_set_pickup_peep(uint8_t playerid, Peep* peep); -Peep* network_get_pickup_peep(uint8_t playerid); +[[nodiscard]] Peep* network_get_pickup_peep(uint8_t playerid); void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x); -int32_t network_get_pickup_peep_old_x(uint8_t playerid); +[[nodiscard]] int32_t network_get_pickup_peep_old_x(uint8_t playerid); void network_send_map(); void network_send_chat(const char* text, const std::vector& playerIds = {}); @@ -110,15 +110,15 @@ void network_set_password(const char* password); void network_print_error(); void network_append_chat_log(const utf8* text); void network_append_server_log(const utf8* text); -const utf8* network_get_server_name(); -const utf8* network_get_server_description(); -const utf8* network_get_server_greeting(); -const utf8* network_get_server_provider_name(); -const utf8* network_get_server_provider_email(); -const utf8* network_get_server_provider_website(); +[[nodiscard]] const utf8* network_get_server_name(); +[[nodiscard]] const utf8* network_get_server_description(); +[[nodiscard]] const utf8* network_get_server_greeting(); +[[nodiscard]] const utf8* network_get_server_provider_name(); +[[nodiscard]] const utf8* network_get_server_provider_email(); +[[nodiscard]] const utf8* network_get_server_provider_website(); -std::string network_get_version(); +[[nodiscard]] std::string network_get_version(); -NetworkStats_t network_get_stats(); -NetworkServerState_t network_get_server_state(); -json_t network_get_server_info_as_json(); +[[nodiscard]] NetworkStats_t network_get_stats(); +[[nodiscard]] NetworkServerState_t network_get_server_state(); +[[nodiscard]] json_t network_get_server_info_as_json(); diff --git a/src/openrct2/object/ImageTable.h b/src/openrct2/object/ImageTable.h index acd6aeea0d..dcad67643f 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -32,15 +32,17 @@ private: * Container for a G1 image, additional information and RAII. Used by ReadJson */ struct RequiredImage; - static std::vector> ParseImages(IReadObjectContext* context, std::string s); + [[nodiscard]] static std::vector> ParseImages( + IReadObjectContext* context, std::string s); /** * @note root is deliberately left non-const: json_t behaviour changes when const */ - static std::vector> ParseImages(IReadObjectContext* context, json_t& el); - static std::vector> LoadObjectImages( + [[nodiscard]] static std::vector> ParseImages( + IReadObjectContext* context, json_t& el); + [[nodiscard]] static std::vector> LoadObjectImages( IReadObjectContext* context, const std::string& name, const std::vector& range); - static std::vector ParseRange(std::string s); - static std::string FindLegacyObject(const std::string& name); + [[nodiscard]] static std::vector ParseRange(std::string s); + [[nodiscard]] static std::string FindLegacyObject(const std::string& name); public: ImageTable() = default; diff --git a/src/openrct2/object/LargeSceneryObject.h b/src/openrct2/object/LargeSceneryObject.h index a39e387880..d1711336db 100644 --- a/src/openrct2/object/LargeSceneryObject.h +++ b/src/openrct2/object/LargeSceneryObject.h @@ -43,9 +43,9 @@ public: const rct_large_scenery_tile* GetTileForSequence(uint8_t SequenceIndex) const; private: - static std::vector ReadTiles(OpenRCT2::IStream* stream); - static std::vector ReadJsonTiles(json_t& jTiles); - static std::unique_ptr ReadJson3dFont(json_t& j3dFont); - static std::vector ReadJsonOffsets(json_t& jOffsets); - static std::vector ReadJsonGlyphs(json_t& jGlyphs); + [[nodiscard]] static std::vector ReadTiles(OpenRCT2::IStream* stream); + [[nodiscard]] static std::vector ReadJsonTiles(json_t& jTiles); + [[nodiscard]] static std::unique_ptr ReadJson3dFont(json_t& j3dFont); + [[nodiscard]] static std::vector ReadJsonOffsets(json_t& jOffsets); + [[nodiscard]] static std::vector ReadJsonGlyphs(json_t& jGlyphs); }; diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 0f3761986c..4f7ca3f8cf 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -222,9 +222,9 @@ public: { } - bool IsAvailable() const; - uint64_t GetSize() const; - std::unique_ptr GetStream() const; + [[nodiscard]] bool IsAvailable() const; + [[nodiscard]] uint64_t GetSize() const; + [[nodiscard]] std::unique_ptr GetStream() const; }; struct IReadObjectContext diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index 74ea1787c7..ecbdf9f611 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -20,11 +20,12 @@ struct rct_object_entry; namespace ObjectFactory { - std::unique_ptr CreateObjectFromLegacyFile(IObjectRepository& objectRepository, const utf8* path); - std::unique_ptr CreateObjectFromLegacyData( + [[nodiscard]] std::unique_ptr CreateObjectFromLegacyFile(IObjectRepository& objectRepository, const utf8* path); + [[nodiscard]] std::unique_ptr CreateObjectFromLegacyData( IObjectRepository& objectRepository, const rct_object_entry* entry, const void* data, size_t dataSize); - std::unique_ptr CreateObjectFromZipFile(IObjectRepository& objectRepository, std::string_view path); - std::unique_ptr CreateObject(const rct_object_entry& entry); + [[nodiscard]] std::unique_ptr CreateObjectFromZipFile(IObjectRepository& objectRepository, std::string_view path); + [[nodiscard]] std::unique_ptr CreateObject(const rct_object_entry& entry); - std::unique_ptr CreateObjectFromJsonFile(IObjectRepository& objectRepository, const std::string& path); + [[nodiscard]] std::unique_ptr CreateObjectFromJsonFile( + IObjectRepository& objectRepository, const std::string& path); } // namespace ObjectFactory diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 37f54cfb05..1dbf7fc2a5 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -43,13 +43,13 @@ struct IObjectManager virtual const std::vector& GetAllRideEntries(uint8_t rideType) abstract; }; -std::unique_ptr CreateObjectManager(IObjectRepository& objectRepository); +[[nodiscard]] std::unique_ptr CreateObjectManager(IObjectRepository& objectRepository); -Object* object_manager_get_loaded_object_by_index(size_t index); -Object* object_manager_get_loaded_object(const ObjectEntryDescriptor& entry); -ObjectEntryIndex object_manager_get_loaded_object_entry_index(const Object* loadedObject); -ObjectEntryIndex object_manager_get_loaded_object_entry_index(const ObjectEntryDescriptor& entry); +[[nodiscard]] Object* object_manager_get_loaded_object_by_index(size_t index); +[[nodiscard]] Object* object_manager_get_loaded_object(const ObjectEntryDescriptor& entry); +[[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const Object* loadedObject); +[[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const ObjectEntryDescriptor& entry); Object* object_manager_load_object(const rct_object_entry* entry); void object_manager_unload_objects(const std::vector& entries); void object_manager_unload_all_objects(); -rct_string_id object_manager_get_source_game_string(const ObjectSourceGame sourceGame); +[[nodiscard]] rct_string_id object_manager_get_source_game_string(const ObjectSourceGame sourceGame); diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index bf2af60b25..6fa5555f8d 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -55,7 +55,7 @@ struct ObjectRepositoryItem std::vector Entries; } SceneryGroupInfo; - ObjectSourceGame GetFirstSourceGame() const + [[nodiscard]] ObjectSourceGame GetFirstSourceGame() const { if (Sources.empty()) return ObjectSourceGame::Custom; @@ -70,14 +70,14 @@ struct IObjectRepository virtual void LoadOrConstruct(int32_t language) abstract; virtual void Construct(int32_t language) abstract; - virtual size_t GetNumObjects() const abstract; - virtual const ObjectRepositoryItem* GetObjects() const abstract; - virtual const ObjectRepositoryItem* FindObjectLegacy(std::string_view legacyIdentifier) const abstract; - virtual const ObjectRepositoryItem* FindObject(std::string_view identifier) const abstract; - virtual const ObjectRepositoryItem* FindObject(const rct_object_entry* objectEntry) const abstract; - virtual const ObjectRepositoryItem* FindObject(const ObjectEntryDescriptor& oed) const abstract; + [[nodiscard]] virtual size_t GetNumObjects() const abstract; + [[nodiscard]] virtual const ObjectRepositoryItem* GetObjects() const abstract; + [[nodiscard]] virtual const ObjectRepositoryItem* FindObjectLegacy(std::string_view legacyIdentifier) const abstract; + [[nodiscard]] virtual const ObjectRepositoryItem* FindObject(std::string_view identifier) const abstract; + [[nodiscard]] virtual const ObjectRepositoryItem* FindObject(const rct_object_entry* objectEntry) const abstract; + [[nodiscard]] virtual const ObjectRepositoryItem* FindObject(const ObjectEntryDescriptor& oed) const abstract; - virtual std::unique_ptr LoadObject(const ObjectRepositoryItem* ori) abstract; + [[nodiscard]] virtual std::unique_ptr LoadObject(const ObjectRepositoryItem* ori) abstract; virtual void RegisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; virtual void UnregisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; @@ -88,12 +88,13 @@ struct IObjectRepository virtual void WritePackedObjects(OpenRCT2::IStream* stream, std::vector& objects) abstract; }; -std::unique_ptr CreateObjectRepository(const std::shared_ptr& env); +[[nodiscard]] std::unique_ptr CreateObjectRepository( + const std::shared_ptr& env); -bool IsObjectCustom(const ObjectRepositoryItem* object); +[[nodiscard]] bool IsObjectCustom(const ObjectRepositoryItem* object); -size_t object_repository_get_items_count(); -const ObjectRepositoryItem* object_repository_get_items(); -const ObjectRepositoryItem* object_repository_find_object_by_entry(const rct_object_entry* entry); -const ObjectRepositoryItem* object_repository_find_object_by_name(const char* name); -std::unique_ptr object_repository_load_object(const rct_object_entry* objectEntry); +[[nodiscard]] size_t object_repository_get_items_count(); +[[nodiscard]] const ObjectRepositoryItem* object_repository_get_items(); +[[nodiscard]] const ObjectRepositoryItem* object_repository_find_object_by_entry(const rct_object_entry* entry); +[[nodiscard]] const ObjectRepositoryItem* object_repository_find_object_by_name(const char* name); +[[nodiscard]] std::unique_ptr object_repository_load_object(const rct_object_entry* objectEntry); diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 6f4bad1206..eb659b6760 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -625,18 +625,18 @@ public: // Peep void UpdateCurrentActionSpriteType(); void SwitchToSpecialSprite(uint8_t special_sprite_id); void StateReset(); - uint8_t GetNextDirection() const; + [[nodiscard]] uint8_t GetNextDirection() const; bool GetNextIsSloped() const; bool GetNextIsSurface() const; void SetNextFlags(uint8_t next_direction, bool is_sloped, bool is_surface); bool CanBePickedUp() const; void Pickup(); void PickupAbort(int32_t old_x); - std::unique_ptr Place(const TileCoordsXYZ& location, bool apply); + [[nodiscard]] std::unique_ptr Place(const TileCoordsXYZ& location, bool apply); void RemoveFromRide(); void FormatActionTo(Formatter&) const; void FormatNameTo(Formatter&) const; - std::string GetName() const; + [[nodiscard]] std::string GetName() const; bool SetName(std::string_view value); bool IsActionWalking() const; bool IsActionIdle() const; @@ -648,16 +648,16 @@ public: // Peep void SetDestination(const CoordsXY& coords); void SetDestination(const CoordsXY& coords, int32_t tolerance); - CoordsXY GetDestination() const; + [[nodiscard]] CoordsXY GetDestination() const; // TODO: Make these private again when done refactoring public: // Peep - bool CheckForPath(); + [[nodiscard]] bool CheckForPath(); void PerformNextAction(uint8_t& pathing_result); void PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result); - int32_t GetZOnSlope(int32_t tile_x, int32_t tile_y); + [[nodiscard]] int32_t GetZOnSlope(int32_t tile_x, int32_t tile_y); void SwitchNextActionSpriteType(); - PeepActionSpriteType GetActionSpriteType(); + [[nodiscard]] PeepActionSpriteType GetActionSpriteType(); private: void UpdateFalling(); diff --git a/src/openrct2/rct12/SawyerChunkReader.h b/src/openrct2/rct12/SawyerChunkReader.h index 0873c8b845..954447325e 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -57,12 +57,12 @@ public: /** * Reads the next chunk from the stream. */ - std::shared_ptr ReadChunk(); + [[nodiscard]] std::shared_ptr ReadChunk(); /** * As above but for chunks without a header */ - std::shared_ptr ReadChunkTrack(); + [[nodiscard]] std::shared_ptr ReadChunkTrack(); /** * Reads the next chunk from the stream and copies it directly to the diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 400507c89c..be14e2431a 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -450,7 +450,7 @@ public: static void UpdateAll(); static bool NameExists(std::string_view name, ride_id_t excludeRideId = RIDE_ID_NULL); - std::unique_ptr SaveToTrackDesign() const; + [[nodiscard]] std::unique_ptr SaveToTrackDesign() const; uint64_t GetAvailableModes() const; const RideTypeDescriptor& GetRideTypeDescriptor() const; diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index d9b69783ff..d459527365 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -199,7 +199,7 @@ extern bool _trackDesignPlaceStateSceneryUnavailable; extern bool gTrackDesignSaveMode; extern ride_id_t gTrackDesignSaveRideIndex; -std::unique_ptr track_design_open(const utf8* path); +[[nodiscard]] std::unique_ptr track_design_open(const utf8* path); void track_design_mirror(TrackDesign* td6); diff --git a/src/openrct2/ride/TrackDesignRepository.h b/src/openrct2/ride/TrackDesignRepository.h index 8e9c1f4085..aeefb83c52 100644 --- a/src/openrct2/ride/TrackDesignRepository.h +++ b/src/openrct2/ride/TrackDesignRepository.h @@ -31,9 +31,9 @@ struct ITrackDesignRepository { virtual ~ITrackDesignRepository() = default; - virtual size_t GetCount() const abstract; - virtual size_t GetCountForObjectEntry(uint8_t rideType, const std::string& entry) const abstract; - virtual std::vector GetItemsForObjectEntry( + [[nodiscard]] virtual size_t GetCount() const abstract; + [[nodiscard]] virtual size_t GetCountForObjectEntry(uint8_t rideType, const std::string& entry) const abstract; + [[nodiscard]] virtual std::vector GetItemsForObjectEntry( uint8_t rideType, const std::string& entry) const abstract; virtual void Scan(int32_t language) abstract; @@ -42,8 +42,9 @@ struct ITrackDesignRepository virtual std::string Install(const std::string& path, const std::string& name) abstract; }; -std::unique_ptr CreateTrackDesignRepository(const std::shared_ptr& env); -std::string GetNameFromTrackPath(const std::string& path); +[[nodiscard]] std::unique_ptr CreateTrackDesignRepository( + const std::shared_ptr& env); +[[nodiscard]] std::string GetNameFromTrackPath(const std::string& path); void track_repository_scan(); bool track_repository_delete(const utf8* path); diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index 0ee807a384..8d6898d464 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -74,11 +74,13 @@ struct IScenarioRepository int32_t language, const utf8* scenarioFileName, money64 companyValue, const utf8* name) abstract; }; -std::unique_ptr CreateScenarioRepository(const std::shared_ptr& env); -IScenarioRepository* GetScenarioRepository(); +[[nodiscard]] std::unique_ptr CreateScenarioRepository( + const std::shared_ptr& env); +[[nodiscard]] IScenarioRepository* GetScenarioRepository(); void scenario_repository_scan(); -size_t scenario_repository_get_count(); -const scenario_index_entry* scenario_repository_get_by_index(size_t index); -bool scenario_repository_try_record_highscore(const utf8* scenarioFileName, money64 companyValue, const utf8* name); +[[nodiscard]] size_t scenario_repository_get_count(); +[[nodiscard]] const scenario_index_entry* scenario_repository_get_by_index(size_t index); +[[nodiscard]] bool scenario_repository_try_record_highscore( + const utf8* scenarioFileName, money64 companyValue, const utf8* name); void scenario_translate(scenario_index_entry* scenarioEntry); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 9210a3622c..404e7daffd 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -220,12 +220,12 @@ namespace OpenRCT2::Scripting void AddNetworkPlugin(std::string_view code); - std::unique_ptr QueryOrExecuteCustomGameAction( + [[nodiscard]] std::unique_ptr QueryOrExecuteCustomGameAction( std::string_view id, std::string_view args, bool isExecute); bool RegisterCustomAction( const std::shared_ptr& plugin, std::string_view action, const DukValue& query, const DukValue& execute); void RunGameActionHooks(const GameAction& action, std::unique_ptr& result, bool isExecute); - std::unique_ptr CreateGameAction(const std::string& actionid, const DukValue& args); + [[nodiscard]] std::unique_ptr CreateGameAction(const std::string& actionid, const DukValue& args); void SaveSharedStorage(); @@ -249,8 +249,9 @@ namespace OpenRCT2::Scripting void AutoReloadPlugins(); void ProcessREPL(); void RemoveCustomGameActions(const std::shared_ptr& plugin); - std::unique_ptr DukToGameActionResult(const DukValue& d); - DukValue GameActionResultToDuk(const GameAction& action, const std::unique_ptr& result); + [[nodiscard]] std::unique_ptr DukToGameActionResult(const DukValue& d); + [[nodiscard]] DukValue GameActionResultToDuk( + const GameAction& action, const std::unique_ptr& result); static std::string_view ExpenditureTypeToString(ExpenditureType expenditureType); static ExpenditureType StringToExpenditureType(std::string_view expenditureType); diff --git a/src/openrct2/title/TitleSequence.h b/src/openrct2/title/TitleSequence.h index 447eef9390..62c64d1593 100644 --- a/src/openrct2/title/TitleSequence.h +++ b/src/openrct2/title/TitleSequence.h @@ -78,9 +78,9 @@ enum class TitleScript : uint8_t constexpr const utf8* TITLE_SEQUENCE_EXTENSION = ".parkseq"; constexpr uint8_t SAVE_INDEX_INVALID = UINT8_MAX; -std::unique_ptr CreateTitleSequence(); -std::unique_ptr LoadTitleSequence(const std::string& path); -std::unique_ptr TitleSequenceGetParkHandle(const TitleSequence& seq, size_t index); +[[nodiscard]] std::unique_ptr CreateTitleSequence(); +[[nodiscard]] std::unique_ptr LoadTitleSequence(const std::string& path); +[[nodiscard]] std::unique_ptr TitleSequenceGetParkHandle(const TitleSequence& seq, size_t index); bool TitleSequenceSave(const TitleSequence& seq); bool TitleSequenceAddPark(TitleSequence& seq, const utf8* path, const utf8* name); diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 0f557defef..c2f38d56ac 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -138,7 +138,7 @@ namespace OpenRCT2 virtual void SetKeysPressed(uint32_t keysym, uint8_t scancode) abstract; // Drawing - virtual std::shared_ptr GetDrawingEngineFactory() abstract; + [[nodiscard]] virtual std::shared_ptr GetDrawingEngineFactory() abstract; virtual void DrawWeatherAnimation( OpenRCT2::Drawing::IWeatherDrawer* weatherDrawer, rct_drawpixelinfo* dpi, OpenRCT2::Drawing::DrawWeatherFunc drawFunc) abstract; @@ -158,6 +158,6 @@ namespace OpenRCT2 virtual ITitleSequencePlayer* GetTitleSequencePlayer() abstract; }; - std::shared_ptr CreateDummyUiContext(); + [[nodiscard]] std::shared_ptr CreateDummyUiContext(); } // namespace Ui } // namespace OpenRCT2 diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index ed0bdb7275..9427e13bf9 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -242,10 +242,10 @@ using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coord int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); -std::unique_ptr MapCanConstructWithClearAt( +[[nodiscard]] std::unique_ptr MapCanConstructWithClearAt( const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode = CREATE_CROSSING_MODE_NONE, bool isTree = false); -std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); +[[nodiscard]] std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); struct tile_element_iterator { diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index 1a72af0ddb..c449699192 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -118,56 +118,64 @@ TEST_F(SawyerCodingTest, invalid1) { OpenRCT2::MemoryStream ms(invalid1, sizeof(invalid1)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid2) { OpenRCT2::MemoryStream ms(invalid2, sizeof(invalid2)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid3) { OpenRCT2::MemoryStream ms(invalid3, sizeof(invalid3)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid4) { OpenRCT2::MemoryStream ms(invalid4, sizeof(invalid4)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid5) { OpenRCT2::MemoryStream ms(invalid5, sizeof(invalid5)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid6) { OpenRCT2::MemoryStream ms(invalid6, sizeof(invalid6)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, invalid7) { OpenRCT2::MemoryStream ms(invalid7, sizeof(invalid7)); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), SawyerChunkException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), SawyerChunkException); } TEST_F(SawyerCodingTest, empty) { OpenRCT2::MemoryStream ms(empty, 0); SawyerChunkReader reader(&ms); - EXPECT_THROW(reader.ReadChunk(), IOException); + std::shared_ptr ptr; + EXPECT_THROW(ptr = reader.ReadChunk(), IOException); } // 1024 bytes of random data From e48dd2d32b312fc8733ebe9d76551963a2d8eb71 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 23 Aug 2021 21:18:25 +0200 Subject: [PATCH 222/681] Remove utf-8 BOM from source files (#15270) --- src/openrct2/Context.h | 2 +- src/openrct2/world/TileElementsView.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 4cac112caf..56740f30b9 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/***************************************************************************** * Copyright (c) 2014-2020 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md diff --git a/src/openrct2/world/TileElementsView.h b/src/openrct2/world/TileElementsView.h index d43e995999..5a357db762 100644 --- a/src/openrct2/world/TileElementsView.h +++ b/src/openrct2/world/TileElementsView.h @@ -1,4 +1,4 @@ -/***************************************************************************** +/***************************************************************************** * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md From 201a94f7e6db732d1b9dcf7e824fe7c05aa87446 Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 24 Aug 2021 16:26:52 +0100 Subject: [PATCH 223/681] Add overloads to take CoordsXYZ (#15253) --- src/openrct2/paint/Paint.h | 9 ++++++ src/openrct2/paint/PaintHelpers.cpp | 47 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 83db6e3c7b..7a6787d18e 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -295,6 +295,15 @@ paint_struct* PaintAddImageAsChildRotated( paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z); +paint_struct* PaintAddImageAsChildRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); +paint_struct* PaintAddImageAsParentRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize); +paint_struct* PaintAddImageAsParentRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, uint16_t height, uint8_t type); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index 994c306c57..1868ef8afa 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -48,6 +48,37 @@ paint_struct* PaintAddImageAsParentRotated( } } +paint_struct* PaintAddImageAsParentRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset) +{ + if (direction & 1) + { + return PaintAddImageAsParent( + session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, + { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); + } + else + { + return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, boundBoxOffset); + } +} + +paint_struct* PaintAddImageAsParentRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize) +{ + if (direction & 1) + { + return PaintAddImageAsParent( + session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }); + } + else + { + return PaintAddImageAsParent(session, image_id, offset, boundBoxSize); + } +} + paint_struct* PaintAddImageAsChildRotated( paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, @@ -67,6 +98,22 @@ paint_struct* PaintAddImageAsChildRotated( } } +paint_struct* PaintAddImageAsChildRotated( + paint_session* session, const uint8_t direction, const uint32_t image_id, const CoordsXYZ& offset, + const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset) +{ + if (direction & 1) + { + return PaintAddImageAsChild( + session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, + { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); + } + else + { + return PaintAddImageAsChild(session, image_id, offset, boundBoxSize, boundBoxOffset); + } +} + void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, uint16_t height, uint8_t type) { if (direction & 1) From d2aca03ff6e03420345fa3b7ba66f19e4e379597 Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 24 Aug 2021 19:12:05 +0100 Subject: [PATCH 224/681] Fix #15271. Use formatter to pass description args to text input (#15272) * Fix #15271. Use formatter to pass description args to text input Originally passed the variables via global vars which were not updated to 32bit during recent refactors. This removes the global and makes the interface cleaner and corrects the type * Fix size of arguments --- src/openrct2-ui/windows/Banner.cpp | 2 +- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2-ui/windows/ClearScenery.cpp | 7 +++-- src/openrct2-ui/windows/CustomCurrency.cpp | 4 +-- .../windows/EditorObjectiveOptions.cpp | 6 ++-- src/openrct2-ui/windows/Guest.cpp | 3 +- src/openrct2-ui/windows/GuestList.cpp | 2 +- src/openrct2-ui/windows/InstallTrack.cpp | 2 +- src/openrct2-ui/windows/Land.cpp | 7 +++-- src/openrct2-ui/windows/LandRights.cpp | 7 +++-- src/openrct2-ui/windows/LoadSave.cpp | 4 +-- src/openrct2-ui/windows/Map.cpp | 14 +++++---- src/openrct2-ui/windows/MapGen.cpp | 30 +++++++++++-------- src/openrct2-ui/windows/Multiplayer.cpp | 2 +- src/openrct2-ui/windows/NetworkStatus.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 4 +-- src/openrct2-ui/windows/Ride.cpp | 7 +++-- src/openrct2-ui/windows/SceneryScatter.cpp | 8 +++-- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/Sign.cpp | 3 +- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/TextInput.cpp | 16 +++++----- src/openrct2-ui/windows/Themes.cpp | 4 +-- src/openrct2-ui/windows/TitleEditor.cpp | 11 +++---- src/openrct2-ui/windows/TrackDesignManage.cpp | 4 +-- src/openrct2-ui/windows/Water.cpp | 7 +++-- src/openrct2-ui/windows/Window.h | 4 +-- src/openrct2/interface/Window.cpp | 1 - src/openrct2/interface/Window.h | 1 - 29 files changed, 91 insertions(+), 77 deletions(-) diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index eae4fac74f..2ec3a3e9a6 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -201,7 +201,7 @@ public: } case WIDX_BANNER_TEXT: window_text_input_raw_open( - this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, banner->GetText().c_str(), 32); + this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, {}, banner->GetText().c_str(), 32); break; case WIDX_BANNER_NO_ENTRY: { diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 5d5932ce5c..c763c26f2e 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -867,7 +867,7 @@ private: case WIDX_MONEY_SPINNER: money_to_string(_moneySpinnerValue, _moneySpinnerText, MONEY_STRING_MAXLENGTH, false); window_text_input_raw_open( - this, WIDX_MONEY_SPINNER, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, _moneySpinnerText, + this, WIDX_MONEY_SPINNER, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneySpinnerText, MONEY_STRING_MAXLENGTH); break; case WIDX_SET_MONEY: diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 822bcf7e71..597f50f22b 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -178,9 +178,10 @@ static void window_clear_scenery_textinput(rct_window* w, rct_widgetindex widget static void window_clear_scenery_inputsize(rct_window* w) { - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; - window_text_input_open(w, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, 3); + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + window_text_input_open(w, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); } /** diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 6f10d2101a..ce1fbf068f 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -134,7 +134,7 @@ static void custom_currency_window_mousedown(rct_window* w, rct_widgetindex widg case WIDX_SYMBOL_TEXT: window_text_input_raw_open( - w, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC, + w, 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; } @@ -146,7 +146,7 @@ static void custom_currency_window_mouseup(rct_window* w, rct_widgetindex widget { case WIDX_RATE: window_text_input_open( - w, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, STR_FORMAT_INTEGER, + w, 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; } diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 60fac3b0ee..bd3c0357ae 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -371,16 +371,16 @@ static void window_editor_objective_options_main_mouseup(rct_window* w, rct_widg case WIDX_PARK_NAME: { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - window_text_input_raw_open(w, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, park.Name.c_str(), 32); + window_text_input_raw_open(w, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), 32); break; } case WIDX_SCENARIO_NAME: window_text_input_raw_open( - w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gScenarioName.c_str(), 64); + w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, {}, gScenarioName.c_str(), 64); break; case WIDX_DETAILS: window_text_input_raw_open( - w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gScenarioDetails.c_str(), 256); + w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, {}, gScenarioDetails.c_str(), 256); break; } } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index b201bc6fb9..52da711226 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -602,7 +602,8 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex) case WIDX_RENAME: { auto peepName = peep->GetName(); - window_text_input_raw_open(w, widgetIndex, STR_GUEST_RENAME_TITLE, STR_GUEST_RENAME_PROMPT, peepName.c_str(), 32); + window_text_input_raw_open( + w, widgetIndex, STR_GUEST_RENAME_TITLE, STR_GUEST_RENAME_PROMPT, {}, peepName.c_str(), 32); break; } case WIDX_LOCATE: diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 3923ec3a47..d1b2d29c4b 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -301,7 +301,7 @@ public: else { window_text_input_raw_open( - this, WIDX_FILTER_BY_NAME, STR_GUESTS_FILTER_BY_NAME, STR_GUESTS_ENTER_NAME_TO_SEARCH, + this, WIDX_FILTER_BY_NAME, STR_GUESTS_FILTER_BY_NAME, STR_GUESTS_ENTER_NAME_TO_SEARCH, {}, _filterName.c_str(), 32); } break; diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 86007be17c..739e722b5f 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -445,7 +445,7 @@ static void window_install_track_design(rct_window* w) log_info("%s already exists, prompting user for a different track design name", destPath); context_show_error(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {}); window_text_input_raw_open( - w, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, + w, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, {}, _trackName.c_str(), 255); } else diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index ed9a67a473..70922089fc 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -59,9 +59,10 @@ private: void InputSize() { - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; - window_text_input_open(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, 3); + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + window_text_input_open(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); } public: diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 2f6025acb1..2f61248a42 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -203,9 +203,10 @@ static void window_land_rights_textinput(rct_window* w, rct_widgetindex widgetIn static void window_land_rights_inputsize(rct_window* w) { - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; - window_text_input_open(w, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, 3); + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + window_text_input_open(w, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); } static void window_land_rights_update(rct_window* w) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 7a26d65808..2da04b1186 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -450,12 +450,12 @@ static void window_loadsave_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_NEW_FILE: window_text_input_open( - w, WIDX_NEW_FILE, STR_NONE, STR_FILEBROWSER_FILE_NAME_PROMPT, STR_STRING, + w, WIDX_NEW_FILE, STR_NONE, STR_FILEBROWSER_FILE_NAME_PROMPT, {}, STR_STRING, reinterpret_cast(_defaultPath.c_str()), 64); break; case WIDX_NEW_FOLDER: - window_text_input_raw_open(w, WIDX_NEW_FOLDER, STR_NONE, STR_FILEBROWSER_FOLDER_NAME_PROMPT, "", 64); + window_text_input_raw_open(w, WIDX_NEW_FOLDER, STR_NONE, STR_FILEBROWSER_FOLDER_NAME_PROMPT, {}, "", 64); break; case WIDX_BROWSE: diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 4429b7d17a..2891a7eada 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -985,16 +985,18 @@ static void window_map_show_default_scenario_editor_buttons(rct_window* w) static void window_map_inputsize_land(rct_window* w) { - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; - window_text_input_open(w, WIDX_LAND_TOOL, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, 3); + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + window_text_input_open(w, WIDX_LAND_TOOL, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); } static void window_map_inputsize_map(rct_window* w) { - TextInputDescriptionArgs[0] = MINIMUM_MAP_SIZE_PRACTICAL; - TextInputDescriptionArgs[1] = MAXIMUM_MAP_SIZE_PRACTICAL; - window_text_input_open(w, WIDX_MAP_SIZE_SPINNER, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, STR_NONE, STR_NONE, 4); + Formatter ft; + ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); + ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); + window_text_input_open(w, WIDX_MAP_SIZE_SPINNER, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); } static void window_map_draw_tab_images(rct_window* w, rct_drawpixelinfo* dpi) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index bff808e558..7c18c563f7 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -494,7 +494,7 @@ static void window_mapgen_base_mouseup(rct_window* w, rct_widgetindex widgetInde window_mapgen_shared_mouseup(w, widgetIndex); mapgen_settings mapgenSettings; - + Formatter ft; switch (widgetIndex) { case WIDX_MAP_GENERATE: @@ -508,22 +508,23 @@ static void window_mapgen_base_mouseup(rct_window* w, rct_widgetindex widgetInde gfx_invalidate_screen(); break; case WIDX_MAP_SIZE: - TextInputDescriptionArgs[0] = MINIMUM_MAP_SIZE_PRACTICAL; - TextInputDescriptionArgs[1] = MAXIMUM_MAP_SIZE_PRACTICAL; + ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); + ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); // Practical map size is 2 lower than the technical map size - window_text_input_open(w, WIDX_MAP_SIZE, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, STR_FORMAT_INTEGER, _mapSize - 2, 4); + window_text_input_open( + w, WIDX_MAP_SIZE, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_FORMAT_INTEGER, _mapSize - 2, 4); break; case WIDX_BASE_HEIGHT: - TextInputDescriptionArgs[0] = static_cast((BASESIZE_MIN - 12) / 2); - TextInputDescriptionArgs[1] = static_cast((BASESIZE_MAX - 12) / 2); + ft.Add((BASESIZE_MIN - 12) / 2); + ft.Add((BASESIZE_MAX - 12) / 2); window_text_input_open( - w, WIDX_BASE_HEIGHT, STR_BASE_HEIGHT, STR_ENTER_BASE_HEIGHT, STR_FORMAT_INTEGER, (_baseHeight - 12) / 2, 3); + w, WIDX_BASE_HEIGHT, STR_BASE_HEIGHT, STR_ENTER_BASE_HEIGHT, ft, STR_FORMAT_INTEGER, (_baseHeight - 12) / 2, 3); break; case WIDX_WATER_LEVEL: - TextInputDescriptionArgs[0] = static_cast((WATERLEVEL_MIN - 12) / 2); - TextInputDescriptionArgs[1] = static_cast((WATERLEVEL_MAX - 12) / 2); + ft.Add((WATERLEVEL_MIN - 12) / 2); + ft.Add((WATERLEVEL_MAX - 12) / 2); window_text_input_open( - w, WIDX_WATER_LEVEL, STR_WATER_LEVEL, STR_ENTER_WATER_LEVEL, STR_FORMAT_INTEGER, (_waterLevel - 12) / 2, 3); + w, WIDX_WATER_LEVEL, STR_WATER_LEVEL, STR_ENTER_WATER_LEVEL, ft, STR_FORMAT_INTEGER, (_waterLevel - 12) / 2, 3); break; } } @@ -808,12 +809,15 @@ static void window_mapgen_simplex_mouseup(rct_window* w, rct_widgetindex widgetI switch (widgetIndex) { case WIDX_SIMPLEX_MAP_SIZE: - TextInputDescriptionArgs[0] = MINIMUM_MAP_SIZE_PRACTICAL; - TextInputDescriptionArgs[1] = MAXIMUM_MAP_SIZE_PRACTICAL; + { + 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 window_text_input_open( - w, WIDX_SIMPLEX_MAP_SIZE, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, STR_FORMAT_INTEGER, _mapSize - 2, 4); + w, WIDX_SIMPLEX_MAP_SIZE, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_FORMAT_INTEGER, _mapSize - 2, 4); break; + } case WIDX_SIMPLEX_GENERATE: mapgenSettings.mapSize = _mapSize; diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index bd0b16afd3..ed64397ffd 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -700,7 +700,7 @@ static void window_multiplayer_groups_mouseup(rct_window* w, rct_widgetindex wid case WIDX_RENAME_GROUP:; int32_t groupIndex = network_get_group_index(_selectedGroup); const utf8* groupName = network_get_group_name(groupIndex); - window_text_input_raw_open(w, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, groupName, 32); + window_text_input_raw_open(w, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, {}, groupName, 32); break; } } diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 5866110b8a..984a9458bc 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -95,7 +95,7 @@ rct_window* window_network_status_open_password() if (window == nullptr) return nullptr; - window_text_input_raw_open(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, _password, 32); + window_text_input_raw_open(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, {}, _password, 32); return window; } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 18d1f100fb..d4993fac98 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -516,7 +516,7 @@ static void window_park_entrance_mouseup(rct_window* w, rct_widgetindex widgetIn { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); window_text_input_raw_open( - w, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, park.Name.c_str(), USER_STRING_MAX_LENGTH); + w, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), USER_STRING_MAX_LENGTH); break; } case WIDX_CLOSE_LIGHT: @@ -1389,7 +1389,7 @@ static void window_park_objective_mouseup(rct_window* w, rct_widgetindex widgetI break; case WIDX_ENTER_NAME: window_text_input_open( - w, WIDX_ENTER_NAME, STR_ENTER_NAME, STR_PLEASE_ENTER_YOUR_NAME_FOR_THE_SCENARIO_CHART, 0, 0, 32); + w, WIDX_ENTER_NAME, STR_ENTER_NAME, STR_PLEASE_ENTER_YOUR_NAME_FOR_THE_SCENARIO_CHART, {}, 0, 0, 32); break; } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e44d140d7a..cf59a96752 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1719,7 +1719,7 @@ static void window_ride_rename(rct_window* w) { auto rideName = ride->GetName(); window_text_input_raw_open( - w, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, rideName.c_str(), 32); + w, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, {}, rideName.c_str(), 32); } } @@ -6433,7 +6433,8 @@ static void window_ride_income_mouseup(rct_window* w, rct_widgetindex widgetInde { money_to_string(static_cast(ride->price[0]), _moneyInputText, MONEY_STRING_MAXLENGTH, true); window_text_input_raw_open( - w, WIDX_PRIMARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, _moneyInputText, MONEY_STRING_MAXLENGTH); + w, WIDX_PRIMARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, + MONEY_STRING_MAXLENGTH); } break; } @@ -6446,7 +6447,7 @@ static void window_ride_income_mouseup(rct_window* w, rct_widgetindex widgetInde money_to_string(price32, _moneyInputText, MONEY_STRING_MAXLENGTH, true); window_text_input_raw_open( - w, WIDX_SECONDARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, _moneyInputText, MONEY_STRING_MAXLENGTH); + w, WIDX_SECONDARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, MONEY_STRING_MAXLENGTH); } break; case WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK: diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 0a6aba1bff..b2f9ff10f5 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -171,15 +171,17 @@ static void window_scenery_scatter_textinput(rct_window* w, rct_widgetindex widg static void window_scenery_scatter_inputsize(rct_window* w, rct_widgetindex widgetindex) { uint8_t maxlen = 0; + Formatter ft; + switch (widgetindex) { case WIDX_PREVIEW: - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); maxlen = 3; break; } - window_text_input_open(w, widgetindex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, maxlen); + window_text_input_open(w, widgetindex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, maxlen); } static void window_scenery_scatter_invalidate(rct_window* w) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index ffe97ff1a5..0a8556219b 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -194,7 +194,7 @@ static void window_server_list_mouseup(rct_window* w, rct_widgetindex widgetInde server_list_fetch_servers_begin(); break; case WIDX_ADD_SERVER: - window_text_input_open(w, widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, STR_NONE, 0, 128); + window_text_input_open(w, widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); break; case WIDX_START_SERVER: context_open_window(WC_SERVER_START); diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index f6efda0d8c..f9e62a7477 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -65,7 +65,8 @@ private: if (banner != nullptr) { auto bannerText = banner->GetText(); - window_text_input_raw_open(this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, bannerText.c_str(), 32); + window_text_input_raw_open( + this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, {}, bannerText.c_str(), 32); } } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index e52024d075..d67cfb5dea 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -440,7 +440,7 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex) { auto peepName = peep->GetName(); window_text_input_raw_open( - w, widgetIndex, STR_STAFF_TITLE_STAFF_MEMBER_NAME, STR_STAFF_PROMPT_ENTER_NAME, peepName.c_str(), 32); + w, widgetIndex, STR_STAFF_TITLE_STAFF_MEMBER_NAME, STR_STAFF_PROMPT_ENTER_NAME, {}, peepName.c_str(), 32); break; } } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index e942ecd3e9..da2c137154 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -47,6 +47,7 @@ private: std::string _description; rct_string_id _descriptionStringId = STR_NONE; + Formatter _descriptionArgs; std::function _callback; std::function _cancelCallback; @@ -89,10 +90,11 @@ public: } } - void SetTitle(rct_string_id title, rct_string_id description) + void SetTitle(rct_string_id title, rct_string_id description, const Formatter& decriptionArgs) { _titleStringId = title; _descriptionStringId = description; + _descriptionArgs = decriptionArgs; } void SetTitle(std::string_view title, std::string_view description) @@ -209,10 +211,8 @@ public: } else { - auto ft = Formatter(); - ft.Add(TextInputDescriptionArgs); DrawTextWrapped( - &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, ft, + &dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs, { colours[1], TextAlignment::CENTRE }); } @@ -373,7 +373,7 @@ private: void window_text_input_raw_open( rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const_utf8string existing_text, int32_t maxLength) + const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength) { window_close_by_class(WC_TEXTINPUT); @@ -382,7 +382,7 @@ void window_text_input_raw_open( if (w != nullptr) { w->SetParentWindow(call_w, call_widget); - w->SetTitle(title, description); + w->SetTitle(title, description, descriptionArgs); w->SetText(existing_text, maxLength); } } @@ -403,10 +403,10 @@ void window_text_input_open( void window_text_input_open( rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength) + const Formatter& descriptionArgs, rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength) { auto existingText = format_string(existing_text, &existing_args); - window_text_input_raw_open(call_w, call_widget, title, description, existingText.c_str(), maxLength); + window_text_input_raw_open(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); } void window_text_input_key(rct_window* w, char keychar) diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 6805425552..fed6d74985 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -359,7 +359,7 @@ static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex) activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); window_text_input_open( - w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING, + w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, reinterpret_cast(activeThemeName), 64); break; case WIDX_THEMES_DELETE_BUTTON: @@ -382,7 +382,7 @@ static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex) activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); window_text_input_open( - w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING, + w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, reinterpret_cast(activeThemeName), 64); } break; diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index 4b9e4fe2a8..fb29c329e9 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -280,14 +280,15 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd if (!commandEditorOpen) { window_text_input_open( - w, widgetIndex, STR_TITLE_EDITOR_ACTION_CREATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_NONE, 0, 64); + w, widgetIndex, STR_TITLE_EDITOR_ACTION_CREATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, {}, STR_NONE, 0, + 64); } break; case WIDX_TITLE_EDITOR_DUPLICATE_BUTTON: if (!commandEditorOpen && _editingTitleSequence != nullptr) { window_text_input_open( - w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_STRING, + w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, {}, STR_STRING, reinterpret_cast(_sequenceName), 64); } break; @@ -302,7 +303,7 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd if (window_title_editor_check_can_edit() && _editingTitleSequence != nullptr) { window_text_input_open( - w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, STR_STRING, + w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_TITLE_EDITOR_ENTER_NAME_FOR_SEQUENCE, {}, STR_STRING, reinterpret_cast(_sequenceName), 64); } break; @@ -338,7 +339,7 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd if (w->selected_list_item != -1) { window_text_input_open( - w, widgetIndex, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SAVE, STR_STRING, + w, widgetIndex, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_TITLE_EDITOR_ENTER_NAME_FOR_SAVE, {}, STR_STRING, reinterpret_cast(_editingTitleSequence->Saves[w->selected_list_item].c_str()), 52 - 1); } } @@ -1140,7 +1141,7 @@ static void window_title_editor_add_park_callback(int32_t result, const utf8* pa _renameSavePath = _strdup(filename); rct_window* w = window_find_by_class(WC_TITLE_EDITOR); window_text_input_open( - w, WIDX_TITLE_EDITOR_RENAME_SAVE, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_ERROR_EXISTING_NAME, STR_STRING, + w, WIDX_TITLE_EDITOR_RENAME_SAVE, STR_FILEBROWSER_RENAME_SAVE_TITLE, STR_ERROR_EXISTING_NAME, {}, STR_STRING, reinterpret_cast(_renameSavePath), 52 - 1); return; } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 26d3bf50d5..14696ba31d 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -138,8 +138,8 @@ static void window_track_manage_mouseup(rct_window* w, rct_widgetindex widgetInd break; case WIDX_RENAME: window_text_input_raw_open( - w, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, _trackDesignFileReference->name, - 127); + w, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, + _trackDesignFileReference->name, 127); break; case WIDX_DELETE: window_track_delete_prompt_open(); diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index d841579ac9..96b27f8e5a 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -177,9 +177,10 @@ public: private: void InputSize() { - TextInputDescriptionArgs[0] = MINIMUM_TOOL_SIZE; - TextInputDescriptionArgs[1] = MAXIMUM_TOOL_SIZE; - window_text_input_open(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, STR_NONE, STR_NONE, 3); + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + window_text_input_open(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); } }; diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 3e2f6dfca3..03844e94eb 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -154,10 +154,10 @@ void window_network_status_close(); void window_text_input_key(rct_window* w, char keychar); void window_text_input_open( rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength); + const Formatter& descriptionArgs, rct_string_id existing_text, uintptr_t existing_args, int32_t maxLength); void window_text_input_raw_open( rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, - const_utf8string existing_text, int32_t maxLength); + const Formatter& descriptionArgs, const_utf8string existing_text, int32_t maxLength); void window_text_input_open( std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 000d6e4d3b..4e2c6aa70d 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -41,7 +41,6 @@ std::list> g_window_list; rct_window* gWindowAudioExclusive; -uint16_t TextInputDescriptionArgs[4]; widget_identifier gCurrentTextBox = { { 255, 0 }, 0 }; char gTextBoxInput[TEXT_INPUT_SIZE] = { 0 }; int32_t gMaxTextBoxInputLength = 0; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 82aa4589f9..26102c41bb 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -41,7 +41,6 @@ enum class RideConstructionState : uint8_t; #define TEXT_INPUT_SIZE 1024 #define TOP_TOOLBAR_HEIGHT 27 -extern uint16_t TextInputDescriptionArgs[4]; extern char gTextBoxInput[TEXT_INPUT_SIZE]; extern int32_t gMaxTextBoxInputLength; extern int32_t gTextBoxFrameNo; From 55add9883f07d49f88b16fe764a897cdc24ba8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 24 Aug 2021 13:57:13 -0700 Subject: [PATCH 225/681] Implement DirectionFlipXAxis --- src/openrct2/interface/Viewport.cpp | 4 +--- src/openrct2/paint/Paint.cpp | 7 ++----- src/openrct2/world/Location.hpp | 8 ++++++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 6aa028ae56..4f68f8ba27 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -1148,11 +1148,9 @@ void rct_viewport::Invalidate() const CoordsXY viewport_coord_to_map_coord(const ScreenCoordsXY& coords, int32_t z) { - constexpr uint8_t inverseRotationMapping[NumOrthogonalDirections] = { 0, 3, 2, 1 }; - // Reverse of translate_3d_to_2d_with_z CoordsXY ret = { coords.y - coords.x / 2 + z, coords.y + coords.x / 2 + z }; - auto inverseRotation = inverseRotationMapping[get_current_rotation()]; + auto inverseRotation = DirectionFlipXAxis(get_current_rotation()); return ret.Rotate(inverseRotation); } diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 45b8a63e88..a27565383e 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -145,7 +145,7 @@ static paint_struct* CreateNormalPaintStruct( return nullptr; } - const uint8_t swappedRotation = (session->CurrentRotation * 3) % 4; // swaps 1 and 3 + const auto swappedRotation = DirectionFlipXAxis(session->CurrentRotation); auto swappedRotCoord = CoordsXYZ{ offset.Rotate(swappedRotation), offset.z }; swappedRotCoord += session->SpritePosition; @@ -231,10 +231,7 @@ template void PaintSessionGenerateRotate(paint_session* sessi void PaintSessionGenerate(paint_session* session) { session->CurrentRotation = get_current_rotation(); - - // Extracted from viewport_coord_to_map_coord - constexpr uint8_t inverseRotationMapping[NumOrthogonalDirections] = { 0, 3, 2, 1 }; - switch (inverseRotationMapping[session->CurrentRotation]) + switch (DirectionFlipXAxis(session->CurrentRotation)) { case 0: PaintSessionGenerateRotate<0>(session); diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 560bcb91e8..120cb502d7 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -545,6 +545,14 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; } } +/* + * Flips the X axis so 1 and 3 are swapped 0 and 2 will stay the same. + */ +inline constexpr Direction DirectionFlipXAxis(Direction direction) +{ + return (direction * 3) % 4; +} + struct CoordsXYZD : public CoordsXYZ { Direction direction{}; From eccbbdbe5942e372b6ffc89ec2a78ed30a1496f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 24 Aug 2021 15:07:25 -0700 Subject: [PATCH 226/681] Use inline for direction functions in Location.hpp --- src/openrct2/world/Location.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 120cb502d7..c9f90a921b 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -496,12 +496,12 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the direction that points the other way, * on the same axis. */ -[[maybe_unused]] static constexpr Direction direction_reverse(Direction dir) +inline constexpr Direction direction_reverse(Direction dir) { return dir ^ 2; } -[[maybe_unused]] static constexpr bool direction_valid(Direction dir) +inline constexpr bool direction_valid(Direction dir) { return dir < NumOrthogonalDirections; } @@ -510,7 +510,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the next cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -[[maybe_unused]] static constexpr Direction direction_next(Direction dir) +inline constexpr Direction direction_next(Direction dir) { return (dir + 1) & 0x03; } @@ -519,7 +519,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; * Given a direction, return the previous cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -[[maybe_unused]] static constexpr Direction direction_prev(Direction dir) +inline constexpr Direction direction_prev(Direction dir) { return (dir - 1) & 0x03; } @@ -527,7 +527,7 @@ constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; /** * Given two positions, return the cardinal direction which is closest to the direction from 'from' to 'to'. */ -[[maybe_unused]] static constexpr Direction DirectionFromTo(const CoordsXY& from, const CoordsXY& to) +inline constexpr Direction DirectionFromTo(const CoordsXY& from, const CoordsXY& to) { int16_t x_diff = to.x - from.x; int16_t y_diff = to.y - from.y; From 008f10624226fe63aefb0cf51855ae8b8e928ba9 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 25 Aug 2021 11:08:57 +0100 Subject: [PATCH 227/681] Add constants for golf flags (#15072) * Add constants for golf flags * Reorg SubPositionData for minigolf * Add enum for golf states * Add golf animation enum * Fix names of animations * Correct spleing * Revert stray change --- src/openrct2/peep/Guest.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 83 +- src/openrct2/ride/Vehicle.h | 38 +- src/openrct2/ride/VehicleSubpositionData.cpp | 2185 +++++++++--------- src/openrct2/ride/gentle/MiniGolf.cpp | 28 +- 9 files changed, 1197 insertions(+), 1149 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d57c25d151..fe53f8a73e 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -3905,7 +3905,7 @@ void Guest::UpdateRideFreeVehicleCheck() if (ride_entry->vehicles[0].flags & VEHICLE_ENTRY_FLAG_MINI_GOLF) { - vehicle->mini_golf_flags &= ~(1 << 5); + vehicle->mini_golf_flags &= ~MiniGolfFlag::Flag5; for (size_t i = 0; i < ride->num_vehicles; ++i) { @@ -3920,7 +3920,7 @@ void Guest::UpdateRideFreeVehicleCheck() if (second_vehicle->num_peeps == 0) continue; - if (second_vehicle->mini_golf_flags & (1 << 5)) + if (second_vehicle->mini_golf_flags & MiniGolfFlag::Flag5) continue; return; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 22b2015af1..19eabae6d7 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2771,7 +2771,7 @@ template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase SetVehicleColours(dst, src); - dst->mini_golf_current_animation = src->mini_golf_current_animation; + dst->mini_golf_current_animation = MiniGolfAnimation(src->mini_golf_current_animation); dst->mini_golf_flags = src->mini_golf_flags; dst->MoveTo({ src->x, src->y, src->z }); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 79d752261b..0639cde023 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1188,7 +1188,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle* dst->lost_time_out = src->lost_time_out; dst->vertical_drop_countdown = src->vertical_drop_countdown; dst->var_D3 = src->var_D3; - dst->mini_golf_current_animation = src->mini_golf_current_animation; + dst->mini_golf_current_animation = EnumValue(src->mini_golf_current_animation); dst->mini_golf_flags = src->mini_golf_flags; dst->ride_subtype = OpenRCT2EntryIndexToRCTEntryIndex(src->ride_subtype); dst->colours_extended = src->colours_extended; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 2717601fee..53986843d9 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1672,7 +1672,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->lost_time_out = src->lost_time_out; dst->vertical_drop_countdown = src->vertical_drop_countdown; dst->var_D3 = src->var_D3; - dst->mini_golf_current_animation = src->mini_golf_current_animation; + dst->mini_golf_current_animation = MiniGolfAnimation(src->mini_golf_current_animation); dst->mini_golf_flags = src->mini_golf_flags; dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->ride_subtype); dst->colours_extended = src->colours_extended; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index f979b1dacf..66f6867d3b 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3124,7 +3124,7 @@ static Vehicle* vehicle_create_car( { subposition = VehicleTrackSubposition::MiniGolfStart9; vehicle->var_D3 = 0; - vehicle->mini_golf_current_animation = 0; + vehicle->mini_golf_current_animation = MiniGolfAnimation::Walk; vehicle->mini_golf_flags = 0; } if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_REVERSER_BOGIE) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 5416990bb0..32e8995f08 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -8765,18 +8765,18 @@ loc_6DC462: goto loc_6DC985; loc_6DC476: - if (mini_golf_flags & (1 << 2)) + if (mini_golf_flags & MiniGolfFlag::Flag2) { uint8_t nextFrame = animation_frame + 1; - if (nextFrame < mini_golf_peep_animation_lengths[mini_golf_current_animation]) + if (nextFrame < mini_golf_peep_animation_lengths[EnumValue(mini_golf_current_animation)]) { animation_frame = nextFrame; goto loc_6DC985; } - mini_golf_flags &= ~(1 << 2); + mini_golf_flags &= ~MiniGolfFlag::Flag2; } - if (mini_golf_flags & (1 << 0)) + if (mini_golf_flags & MiniGolfFlag::Flag0) { auto vehicleIdx = IsHead() ? next_vehicle_on_ride : prev_vehicle_on_ride; Vehicle* vEDI = GetEntity(vehicleIdx); @@ -8784,7 +8784,7 @@ loc_6DC476: { return; } - if (!(vEDI->mini_golf_flags & (1 << 0)) || (vEDI->mini_golf_flags & (1 << 2))) + if (!(vEDI->mini_golf_flags & MiniGolfFlag::Flag0) || (vEDI->mini_golf_flags & MiniGolfFlag::Flag2)) { goto loc_6DC985; } @@ -8792,11 +8792,11 @@ loc_6DC476: { goto loc_6DC985; } - vEDI->mini_golf_flags &= ~(1 << 0); - mini_golf_flags &= ~(1 << 0); + vEDI->mini_golf_flags &= ~MiniGolfFlag::Flag0; + mini_golf_flags &= ~MiniGolfFlag::Flag0; } - if (mini_golf_flags & (1 << 1)) + if (mini_golf_flags & MiniGolfFlag::Flag1) { auto vehicleIdx = IsHead() ? next_vehicle_on_ride : prev_vehicle_on_ride; Vehicle* vEDI = GetEntity(vehicleIdx); @@ -8804,7 +8804,7 @@ loc_6DC476: { return; } - if (!(vEDI->mini_golf_flags & (1 << 1)) || (vEDI->mini_golf_flags & (1 << 2))) + if (!(vEDI->mini_golf_flags & MiniGolfFlag::Flag1) || (vEDI->mini_golf_flags & MiniGolfFlag::Flag2)) { goto loc_6DC985; } @@ -8812,11 +8812,11 @@ loc_6DC476: { goto loc_6DC985; } - vEDI->mini_golf_flags &= ~(1 << 1); - mini_golf_flags &= ~(1 << 1); + vEDI->mini_golf_flags &= ~MiniGolfFlag::Flag1; + mini_golf_flags &= ~MiniGolfFlag::Flag1; } - if (mini_golf_flags & (1 << 3)) + if (mini_golf_flags & MiniGolfFlag::Flag3) { Vehicle* vEDI = this; @@ -8829,15 +8829,15 @@ loc_6DC476: } if (vEDI->IsHead()) continue; - if (!(vEDI->mini_golf_flags & (1 << 4))) + if (!(vEDI->mini_golf_flags & MiniGolfFlag::Flag4)) continue; if (vEDI->TrackLocation != TrackLocation) continue; goto loc_6DC985; } - mini_golf_flags |= (1 << 4); - mini_golf_flags &= ~(1 << 3); + mini_golf_flags |= MiniGolfFlag::Flag4; + mini_golf_flags &= ~MiniGolfFlag::Flag3; } // There are two bytes before the move info list @@ -8921,12 +8921,12 @@ loc_6DC743: { break; } - switch (moveInfo->y) + switch (MiniGolfState(moveInfo->y)) { - case 0: // loc_6DC7B4 + case MiniGolfState::Unk0: // loc_6DC7B4 if (!IsHead()) { - mini_golf_flags |= (1 << 3); + mini_golf_flags |= MiniGolfFlag::Flag3; } else { @@ -8944,53 +8944,56 @@ loc_6DC743: } track_progress++; break; - case 1: // loc_6DC7ED + case MiniGolfState::Unk1: // loc_6DC7ED + log_error("Unused move info..."); + assert(false); var_D3 = static_cast(moveInfo->z); track_progress++; break; - case 2: // loc_6DC800 - mini_golf_flags |= (1 << 0); + case MiniGolfState::Unk2: // loc_6DC800 + mini_golf_flags |= MiniGolfFlag::Flag0; track_progress++; break; - case 3: // loc_6DC810 - mini_golf_flags |= (1 << 1); + case MiniGolfState::Unk3: // loc_6DC810 + mini_golf_flags |= MiniGolfFlag::Flag1; track_progress++; break; - case 4: // loc_6DC820 - trackPos.z = moveInfo->z; + case MiniGolfState::Unk4: // loc_6DC820 + { + auto animation = MiniGolfAnimation(moveInfo->z); // When the ride is closed occasionally the peep is removed // but the vehicle is still on the track. This will prevent // it from crashing in that situation. - if (peep[0] != SPRITE_INDEX_NULL) + auto* curPeep = TryGetEntity(peep[0]); + if (curPeep != nullptr) { - if (trackPos.z == 2) + if (animation == MiniGolfAnimation::SwingLeft) { - auto* curPeep = GetEntity(peep[0]); - if (curPeep != nullptr && curPeep->Id & 7) + if (curPeep->Id & 7) { - trackPos.z = 7; + animation = MiniGolfAnimation::Swing; } } - if (trackPos.z == 6) + if (animation == MiniGolfAnimation::PuttLeft) { - auto* curPeep = GetEntity(peep[0]); - if (curPeep != nullptr && curPeep->Id & 7) + if (curPeep->Id & 7) { - trackPos.z = 8; + animation = MiniGolfAnimation::Putt; } } } - mini_golf_current_animation = static_cast(trackPos.z); + mini_golf_current_animation = animation; animation_frame = 0; track_progress++; break; - case 5: // loc_6DC87A - mini_golf_flags |= (1 << 2); + } + case MiniGolfState::Unk5: // loc_6DC87A + mini_golf_flags |= MiniGolfFlag::Flag2; track_progress++; break; - case 6: // loc_6DC88A - mini_golf_flags &= ~(1 << 4); - mini_golf_flags |= (1 << 5); + case MiniGolfState::Unk6: // loc_6DC88A + mini_golf_flags &= ~MiniGolfFlag::Flag4; + mini_golf_flags |= MiniGolfFlag::Flag5; track_progress++; break; default: diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index dbfbd1b297..018ac852ea 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -51,6 +51,8 @@ struct SoundIdVolume; constexpr const uint16_t VehicleTrackDirectionMask = 0b0000000000000011; constexpr const uint16_t VehicleTrackTypeMask = 0b1111111111111100; +enum class MiniGolfAnimation : uint8_t; + struct Vehicle : SpriteBase { static constexpr auto cEntityType = EntityType::Vehicle; @@ -197,7 +199,7 @@ struct Vehicle : SpriteBase uint16_t lost_time_out; int8_t vertical_drop_countdown; uint8_t var_D3; - uint8_t mini_golf_current_animation; + MiniGolfAnimation mini_golf_current_animation; uint8_t mini_golf_flags; ObjectEntryIndex ride_subtype; uint8_t colours_extended; @@ -375,6 +377,40 @@ struct train_ref Vehicle* tail; }; +namespace MiniGolfFlag +{ + constexpr uint8_t Flag0 = (1 << 0); + constexpr uint8_t Flag1 = (1 << 1); + constexpr uint8_t Flag2 = (1 << 2); + constexpr uint8_t Flag3 = (1 << 3); + constexpr uint8_t Flag4 = (1 << 4); + constexpr uint8_t Flag5 = (1 << 5); // transitioning between hole +} // namespace MiniGolfFlag + +enum class MiniGolfState : int16_t +{ + Unk0, + Unk1, // Unused + Unk2, + Unk3, + Unk4, + Unk5, + Unk6, +}; + +enum class MiniGolfAnimation : uint8_t +{ + Walk, + PlaceBallDown, + SwingLeft, + PickupBall, + Jump, + PlaceBallUp, + PuttLeft, + Swing, + Putt, +}; + enum : uint32_t { VEHICLE_ENTRY_FLAG_POWERED_RIDE_UNRESTRICTED_GRAVITY = 1 diff --git a/src/openrct2/ride/VehicleSubpositionData.cpp b/src/openrct2/ride/VehicleSubpositionData.cpp index 66d99434e9..c2f43b5858 100644 --- a/src/openrct2/ride/VehicleSubpositionData.cpp +++ b/src/openrct2/ride/VehicleSubpositionData.cpp @@ -15,6 +15,15 @@ static constexpr const rct_vehicle_info VAR##_data[] = __VA_ARGS__; \ static constexpr const rct_vehicle_info_list VAR = { static_cast(std::size(VAR##_data)), VAR##_data }; +#define MINI_GOLF_STATE(STATE) \ + { \ + LOCATION_NULL, EnumValue(MiniGolfState::STATE), 0, 0, 0, 0 \ + } +#define MINI_GOLF_ANIMATION(VALUE) \ + { \ + LOCATION_NULL, EnumValue(MiniGolfState::Unk4), EnumValue(MiniGolfAnimation::VALUE), 0, 0, 0 \ + } + // clang-format off CREATE_VEHICLE_INFO(TrackVehicleInfo_8BE57A, { { 31, 16, 0, 0, 0, 0 }, { 30, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 28, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, @@ -18527,191 +18536,191 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9395FF, { }) CREATE_VEHICLE_INFO(TrackVehicleInfo_939691, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, - { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, - { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk6), { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, + { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93C082, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, - { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, - { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk6), { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, + { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93EA73, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, - { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, - { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk6), { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, + { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941464, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, - { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, - { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk6), { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, + { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93A46E, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, - { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { -27, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93CE5F, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, - { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 16, 58, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93F850, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, - { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 58, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_942241, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, - { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 15, -27, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93B2AE, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 5, 0, 0, 0 }, { 7, 16, 5, 0, 0, 0 }, { 5, 16, 5, 0, 0, 0 }, { 3, 16, 5, 0, 0, 0 }, { 1, 16, 5, 0, 0, 0 }, { -1, 16, 5, 0, 0, 0 }, { -3, 16, 5, 0, 0, 0 }, { -5, 16, 5, 0, 0, 0 }, { -7, 16, 5, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { -23, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), + { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93DC9F, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 5, 8, 0, 0 }, { 16, 24, 5, 8, 0, 0 }, { 16, 26, 5, 8, 0, 0 }, { 16, 28, 5, 8, 0, 0 }, { 16, 30, 5, 8, 0, 0 }, { 16, 32, 5, 8, 0, 0 }, { 16, 34, 5, 8, 0, 0 }, { 16, 36, 5, 8, 0, 0 }, { 16, 38, 5, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 16, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), + { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_940690, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 5, 16, 0, 0 }, { 24, 15, 5, 16, 0, 0 }, { 26, 15, 5, 16, 0, 0 }, { 28, 15, 5, 16, 0, 0 }, { 30, 15, 5, 16, 0, 0 }, { 32, 15, 5, 16, 0, 0 }, { 34, 15, 5, 16, 0, 0 }, { 36, 15, 5, 16, 0, 0 }, { 38, 15, 5, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 54, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), + { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_943081, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 5, 24, 0, 0 }, { 15, 7, 5, 24, 0, 0 }, { 15, 5, 5, 24, 0, 0 }, { 15, 3, 5, 24, 0, 0 }, { 15, 1, 5, 24, 0, 0 }, { 15, -1, 5, 24, 0, 0 }, { 15, -3, 5, 24, 0, 0 }, { 15, -5, 5, 24, 0, 0 }, { 15, -7, 5, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 15, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), + { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_943E56, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, @@ -18719,18 +18728,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_943E56, { { -3, 28, 0, 8, 0, 0 }, { -3, 30, 0, 8, 0, 0 }, { -3, 32, 0, 8, 0, 0 }, { -3, 34, 0, 8, 0, 0 }, { -3, 36, 0, 8, 0, 0 }, { -3, 38, 0, 8, 0, 0 }, { -3, 40, 0, 8, 0, 0 }, { -3, 42, 0, 8, 0, 0 }, { -3, 44, 0, 8, 0, 0 }, { -3, 46, 0, 8, 0, 0 }, { -3, 48, 0, 8, 0, 0 }, { -5, 48, 0, 0, 0, 0 }, { -7, 48, 0, 0, 0, 0 }, { -9, 48, 0, 0, 0, 0 }, { -11, 48, 0, 0, 0, 0 }, - { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -17, 49, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, { -17, 50, 0, 8, 0, 0 }, - { -17, 52, 0, 8, 0, 0 }, { -17, 54, 0, 8, 0, 0 }, { -17, 56, 0, 8, 0, 0 }, { -17, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -17, 49, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, 48, 0, 8, 0, 0 }, { -17, 50, 0, 8, 0, 0 }, + { -17, 52, 0, 8, 0, 0 }, { -17, 54, 0, 8, 0, 0 }, { -17, 56, 0, 8, 0, 0 }, { -17, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_946B14, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, @@ -18738,18 +18747,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_946B14, { { 28, 34, 0, 16, 0, 0 }, { 30, 34, 0, 16, 0, 0 }, { 32, 34, 0, 16, 0, 0 }, { 34, 34, 0, 16, 0, 0 }, { 36, 34, 0, 16, 0, 0 }, { 38, 34, 0, 16, 0, 0 }, { 40, 34, 0, 16, 0, 0 }, { 42, 34, 0, 16, 0, 0 }, { 44, 34, 0, 16, 0, 0 }, { 46, 34, 0, 16, 0, 0 }, { 48, 34, 0, 16, 0, 0 }, { 48, 36, 0, 8, 0, 0 }, { 48, 38, 0, 8, 0, 0 }, { 48, 40, 0, 8, 0, 0 }, { 48, 42, 0, 8, 0, 0 }, - { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 49, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, { 50, 48, 0, 16, 0, 0 }, - { 52, 48, 0, 16, 0, 0 }, { 54, 48, 0, 16, 0, 0 }, { 56, 48, 0, 16, 0, 0 }, { 58, 48, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 49, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 48, 0, 16, 0, 0 }, { 50, 48, 0, 16, 0, 0 }, + { 52, 48, 0, 16, 0, 0 }, { 54, 48, 0, 16, 0, 0 }, { 56, 48, 0, 16, 0, 0 }, { 58, 48, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9497D2, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, @@ -18757,18 +18766,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9497D2, { { 34, 3, 0, 24, 0, 0 }, { 34, 1, 0, 24, 0, 0 }, { 34, -1, 0, 24, 0, 0 }, { 34, -3, 0, 24, 0, 0 }, { 34, -5, 0, 24, 0, 0 }, { 34, -7, 0, 24, 0, 0 }, { 34, -9, 0, 24, 0, 0 }, { 34, -11, 0, 24, 0, 0 }, { 34, -13, 0, 24, 0, 0 }, { 34, -15, 0, 24, 0, 0 }, { 34, -17, 0, 24, 0, 0 }, { 36, -17, 0, 16, 0, 0 }, { 38, -17, 0, 16, 0, 0 }, { 40, -17, 0, 16, 0, 0 }, { 42, -17, 0, 16, 0, 0 }, - { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 48, -18, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, { 48, -19, 0, 24, 0, 0 }, - { 48, -21, 0, 24, 0, 0 }, { 48, -23, 0, 24, 0, 0 }, { 48, -25, 0, 24, 0, 0 }, { 48, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 48, -18, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, -17, 0, 24, 0, 0 }, { 48, -19, 0, 24, 0, 0 }, + { 48, -21, 0, 24, 0, 0 }, { 48, -23, 0, 24, 0, 0 }, { 48, -25, 0, 24, 0, 0 }, { 48, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94C490, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, @@ -18776,18 +18785,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94C490, { { 3, -3, 0, 0, 0, 0 }, { 1, -3, 0, 0, 0, 0 }, { -1, -3, 0, 0, 0, 0 }, { -3, -3, 0, 0, 0, 0 }, { -5, -3, 0, 0, 0, 0 }, { -7, -3, 0, 0, 0, 0 }, { -9, -3, 0, 0, 0, 0 }, { -11, -3, 0, 0, 0, 0 }, { -13, -3, 0, 0, 0, 0 }, { -15, -3, 0, 0, 0, 0 }, { -17, -3, 0, 0, 0, 0 }, { -17, -5, 0, 24, 0, 0 }, { -17, -7, 0, 24, 0, 0 }, { -17, -9, 0, 24, 0, 0 }, { -17, -11, 0, 24, 0, 0 }, - { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -18, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, { -19, -17, 0, 0, 0, 0 }, - { -21, -17, 0, 0, 0, 0 }, { -23, -17, 0, 0, 0, 0 }, { -25, -17, 0, 0, 0, 0 }, { -27, -17, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -18, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -17, 0, 0, 0, 0 }, { -19, -17, 0, 0, 0, 0 }, + { -21, -17, 0, 0, 0, 0 }, { -23, -17, 0, 0, 0, 0 }, { -25, -17, 0, 0, 0, 0 }, { -27, -17, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9454B5, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, @@ -18795,18 +18804,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9454B5, { { -3, 4, 0, 24, 0, 0 }, { -3, 2, 0, 24, 0, 0 }, { -3, 0, 0, 24, 0, 0 }, { -3, -2, 0, 24, 0, 0 }, { -3, -4, 0, 24, 0, 0 }, { -3, -6, 0, 24, 0, 0 }, { -3, -8, 0, 24, 0, 0 }, { -3, -10, 0, 24, 0, 0 }, { -3, -12, 0, 24, 0, 0 }, { -3, -14, 0, 24, 0, 0 }, { -3, -16, 0, 24, 0, 0 }, { -5, -16, 0, 0, 0, 0 }, { -7, -16, 0, 0, 0, 0 }, { -9, -16, 0, 0, 0, 0 }, { -11, -16, 0, 0, 0, 0 }, - { -13, -16, 0, 0, 0, 0 }, { -15, -16, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -17, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -16, 0, 24, 0, 0 }, { -17, -18, 0, 24, 0, 0 }, - { -17, -20, 0, 24, 0, 0 }, { -17, -22, 0, 24, 0, 0 }, { -17, -24, 0, 24, 0, 0 }, { -17, -26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -13, -16, 0, 0, 0, 0 }, { -15, -16, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -17, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -16, 0, 24, 0, 0 }, { -17, -18, 0, 24, 0, 0 }, + { -17, -20, 0, 24, 0, 0 }, { -17, -22, 0, 24, 0, 0 }, { -17, -24, 0, 24, 0, 0 }, { -17, -26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_948173, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, @@ -18814,18 +18823,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_948173, { { 4, 34, 0, 0, 0, 0 }, { 2, 34, 0, 0, 0, 0 }, { 0, 34, 0, 0, 0, 0 }, { -2, 34, 0, 0, 0, 0 }, { -4, 34, 0, 0, 0, 0 }, { -6, 34, 0, 0, 0, 0 }, { -8, 34, 0, 0, 0, 0 }, { -10, 34, 0, 0, 0, 0 }, { -12, 34, 0, 0, 0, 0 }, { -14, 34, 0, 0, 0, 0 }, { -16, 34, 0, 0, 0, 0 }, { -16, 36, 0, 8, 0, 0 }, { -16, 38, 0, 8, 0, 0 }, { -16, 40, 0, 8, 0, 0 }, { -16, 42, 0, 8, 0, 0 }, - { -16, 44, 0, 8, 0, 0 }, { -16, 46, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -17, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -16, 48, 0, 0, 0, 0 }, { -18, 48, 0, 0, 0, 0 }, - { -20, 48, 0, 0, 0, 0 }, { -22, 48, 0, 0, 0, 0 }, { -24, 48, 0, 0, 0, 0 }, { -26, 48, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -16, 44, 0, 8, 0, 0 }, { -16, 46, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -17, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -16, 48, 0, 0, 0, 0 }, { -18, 48, 0, 0, 0, 0 }, + { -20, 48, 0, 0, 0, 0 }, { -22, 48, 0, 0, 0, 0 }, { -24, 48, 0, 0, 0, 0 }, { -26, 48, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94AE31, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, @@ -18833,18 +18842,18 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94AE31, { { 34, 27, 0, 8, 0, 0 }, { 34, 29, 0, 8, 0, 0 }, { 34, 31, 0, 8, 0, 0 }, { 34, 33, 0, 8, 0, 0 }, { 34, 35, 0, 8, 0, 0 }, { 34, 37, 0, 8, 0, 0 }, { 34, 39, 0, 8, 0, 0 }, { 34, 41, 0, 8, 0, 0 }, { 34, 43, 0, 8, 0, 0 }, { 34, 45, 0, 8, 0, 0 }, { 34, 47, 0, 8, 0, 0 }, { 36, 47, 0, 16, 0, 0 }, { 38, 47, 0, 16, 0, 0 }, { 40, 47, 0, 16, 0, 0 }, { 42, 47, 0, 16, 0, 0 }, - { 44, 47, 0, 16, 0, 0 }, { 46, 47, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 48, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 47, 0, 8, 0, 0 }, { 48, 49, 0, 8, 0, 0 }, - { 48, 51, 0, 8, 0, 0 }, { 48, 53, 0, 8, 0, 0 }, { 48, 55, 0, 8, 0, 0 }, { 48, 57, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 44, 47, 0, 16, 0, 0 }, { 46, 47, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 48, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 47, 0, 8, 0, 0 }, { 48, 49, 0, 8, 0, 0 }, + { 48, 51, 0, 8, 0, 0 }, { 48, 53, 0, 8, 0, 0 }, { 48, 55, 0, 8, 0, 0 }, { 48, 57, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94DAEF, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 4, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(Jump), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, @@ -18852,15 +18861,15 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94DAEF, { { 27, -3, 0, 16, 0, 0 }, { 29, -3, 0, 16, 0, 0 }, { 31, -3, 0, 16, 0, 0 }, { 33, -3, 0, 16, 0, 0 }, { 35, -3, 0, 16, 0, 0 }, { 37, -3, 0, 16, 0, 0 }, { 39, -3, 0, 16, 0, 0 }, { 41, -3, 0, 16, 0, 0 }, { 43, -3, 0, 16, 0, 0 }, { 45, -3, 0, 16, 0, 0 }, { 47, -3, 0, 16, 0, 0 }, { 47, -5, 0, 24, 0, 0 }, { 47, -7, 0, 24, 0, 0 }, { 47, -9, 0, 24, 0, 0 }, { 47, -11, 0, 24, 0, 0 }, - { 47, -13, 0, 24, 0, 0 }, { 47, -15, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 48, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 47, -17, 0, 16, 0, 0 }, { 49, -17, 0, 16, 0, 0 }, - { 51, -17, 0, 16, 0, 0 }, { 53, -17, 0, 16, 0, 0 }, { 55, -17, 0, 16, 0, 0 }, { 57, -17, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 47, -13, 0, 24, 0, 0 }, { 47, -15, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 48, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 47, -17, 0, 16, 0, 0 }, { 49, -17, 0, 16, 0, 0 }, + { 51, -17, 0, 16, 0, 0 }, { 53, -17, 0, 16, 0, 0 }, { 55, -17, 0, 16, 0, 0 }, { 57, -17, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9398A6, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 16, 16, 0, 0, 0, 0 }, { 13, 17, 0, 0, 0, 0 }, { 10, 17, 0, 0, 0, 0 }, { 8, 17, 0, 0, 0, 0 }, { 6, 17, 0, 0, 0, 0 }, { 4, 17, 0, 0, 0, 0 }, { 2, 17, 0, 0, 0, 0 }, { 0, 18, 0, 0, 0, 0 }, { -2, 18, 0, 0, 0, 0 }, { -4, 18, 0, 0, 0, 0 }, { -6, 18, 0, 0, 0, 0 }, { -8, 18, 0, 0, 0, 0 }, { -10, 18, 0, 0, 0, 0 }, { -12, 18, 0, 0, 0, 0 }, { -14, 19, 0, 0, 0, 0 }, @@ -18868,13 +18877,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9398A6, { { -26, 19, 0, 0, 0, 0 }, { -28, 20, 0, 0, 0, 0 }, { -30, 20, 0, 0, 0, 0 }, { -29, 20, 0, 0, 0, 0 }, { -28, 20, 0, 0, 0, 0 }, { -27, 20, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, { -25, 19, 0, 0, 0, 0 }, { -24, 19, 0, 0, 0, 0 }, { -23, 18, 0, 0, 0, 0 }, { -22, 18, 0, 0, 0, 0 }, { -21, 18, 0, 0, 0, 0 }, { -20, 17, 0, 0, 0, 0 }, { -19, 17, 0, 0, 0, 0 }, { -18, 17, 0, 0, 0, 0 }, - { -17, 16, 0, 0, 0, 0 }, { -16, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -17, 16, 0, 0, 0, 0 }, { -16, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93C297, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 15, 0, 8, 0, 0 }, { 17, 18, 0, 8, 0, 0 }, { 17, 21, 0, 8, 0, 0 }, { 17, 23, 0, 8, 0, 0 }, { 17, 25, 0, 8, 0, 0 }, { 17, 27, 0, 8, 0, 0 }, { 17, 29, 0, 8, 0, 0 }, { 18, 31, 0, 8, 0, 0 }, { 18, 33, 0, 8, 0, 0 }, { 18, 35, 0, 8, 0, 0 }, { 18, 37, 0, 8, 0, 0 }, { 18, 39, 0, 8, 0, 0 }, { 18, 41, 0, 8, 0, 0 }, { 18, 43, 0, 8, 0, 0 }, { 19, 45, 0, 8, 0, 0 }, @@ -18882,13 +18891,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93C297, { { 19, 57, 0, 8, 0, 0 }, { 20, 59, 0, 8, 0, 0 }, { 20, 61, 0, 8, 0, 0 }, { 20, 60, 0, 8, 0, 0 }, { 20, 59, 0, 8, 0, 0 }, { 20, 58, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, { 19, 56, 0, 8, 0, 0 }, { 19, 55, 0, 8, 0, 0 }, { 18, 54, 0, 8, 0, 0 }, { 18, 53, 0, 8, 0, 0 }, { 18, 52, 0, 8, 0, 0 }, { 17, 51, 0, 8, 0, 0 }, { 17, 50, 0, 8, 0, 0 }, { 17, 49, 0, 8, 0, 0 }, - { 16, 48, 0, 8, 0, 0 }, { 16, 47, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 48, 0, 8, 0, 0 }, { 16, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93EC88, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 15, 15, 0, 16, 0, 0 }, { 18, 14, 0, 16, 0, 0 }, { 21, 14, 0, 16, 0, 0 }, { 23, 14, 0, 16, 0, 0 }, { 25, 14, 0, 16, 0, 0 }, { 27, 14, 0, 16, 0, 0 }, { 29, 14, 0, 16, 0, 0 }, { 31, 13, 0, 16, 0, 0 }, { 33, 13, 0, 16, 0, 0 }, { 35, 13, 0, 16, 0, 0 }, { 37, 13, 0, 16, 0, 0 }, { 39, 13, 0, 16, 0, 0 }, { 41, 13, 0, 16, 0, 0 }, { 43, 13, 0, 16, 0, 0 }, { 45, 12, 0, 16, 0, 0 }, @@ -18896,13 +18905,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93EC88, { { 57, 12, 0, 16, 0, 0 }, { 59, 11, 0, 16, 0, 0 }, { 61, 11, 0, 16, 0, 0 }, { 60, 11, 0, 16, 0, 0 }, { 59, 11, 0, 16, 0, 0 }, { 58, 11, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, { 56, 12, 0, 16, 0, 0 }, { 55, 12, 0, 16, 0, 0 }, { 54, 13, 0, 16, 0, 0 }, { 53, 13, 0, 16, 0, 0 }, { 52, 13, 0, 16, 0, 0 }, { 51, 14, 0, 16, 0, 0 }, { 50, 14, 0, 16, 0, 0 }, { 49, 14, 0, 16, 0, 0 }, - { 48, 15, 0, 16, 0, 0 }, { 47, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 48, 15, 0, 16, 0, 0 }, { 47, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941679, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 16, 0, 24, 0, 0 }, { 14, 13, 0, 24, 0, 0 }, { 14, 10, 0, 24, 0, 0 }, { 14, 8, 0, 24, 0, 0 }, { 14, 6, 0, 24, 0, 0 }, { 14, 4, 0, 24, 0, 0 }, { 14, 2, 0, 24, 0, 0 }, { 13, 0, 0, 24, 0, 0 }, { 13, -2, 0, 24, 0, 0 }, { 13, -4, 0, 24, 0, 0 }, { 13, -6, 0, 24, 0, 0 }, { 13, -8, 0, 24, 0, 0 }, { 13, -10, 0, 24, 0, 0 }, { 13, -12, 0, 24, 0, 0 }, { 12, -14, 0, 24, 0, 0 }, @@ -18910,13 +18919,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_941679, { { 12, -26, 0, 24, 0, 0 }, { 11, -28, 0, 24, 0, 0 }, { 11, -30, 0, 24, 0, 0 }, { 11, -29, 0, 24, 0, 0 }, { 11, -28, 0, 24, 0, 0 }, { 11, -27, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, { 12, -25, 0, 24, 0, 0 }, { 12, -24, 0, 24, 0, 0 }, { 13, -23, 0, 24, 0, 0 }, { 13, -22, 0, 24, 0, 0 }, { 13, -21, 0, 24, 0, 0 }, { 14, -20, 0, 24, 0, 0 }, { 14, -19, 0, 24, 0, 0 }, { 14, -18, 0, 24, 0, 0 }, - { 15, -17, 0, 24, 0, 0 }, { 15, -16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -17, 0, 24, 0, 0 }, { 15, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93A68C, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, { 16, 15, 0, 0, 0, 0 }, { 13, 14, 0, 0, 0, 0 }, { 10, 14, 0, 0, 0, 0 }, { 7, 13, 0, 0, 0, 0 }, { 4, 13, 0, 0, 0, 0 }, { 1, 12, 0, 0, 0, 0 }, { -2, 12, 0, 0, 0, 0 }, { -2, 15, 0, 0, 0, 0 }, { -2, 18, 0, 0, 0, 0 }, { -2, 21, 0, 0, 0, 0 }, { -2, 24, 0, 0, 0, 0 }, { -2, 26, 0, 0, 0, 0 }, { -4, 26, 0, 0, 0, 0 }, { -6, 26, 0, 0, 0, 0 }, { -8, 26, 0, 0, 0, 0 }, @@ -18925,13 +18934,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93A68C, { { -16, 13, 0, 0, 0, 0 }, { -18, 13, 0, 0, 0, 0 }, { -20, 14, 0, 0, 0, 0 }, { -22, 14, 0, 0, 0, 0 }, { -23, 14, 0, 0, 0, 0 }, { -24, 14, 0, 0, 0, 0 }, { -25, 14, 0, 0, 0, 0 }, { -26, 14, 0, 0, 0, 0 }, { -27, 14, 0, 0, 0, 0 }, { -28, 14, 0, 0, 0, 0 }, { -29, 14, 0, 0, 0, 0 }, { -30, 14, 0, 0, 0, 0 }, { -31, 14, 0, 0, 0, 0 }, { -30, 14, 0, 0, 0, 0 }, { -29, 14, 0, 0, 0, 0 }, - { -28, 15, 0, 0, 0, 0 }, { -27, 15, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -28, 15, 0, 0, 0, 0 }, { -27, 15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93D07D, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, { 15, 15, 0, 8, 0, 0 }, { 14, 18, 0, 8, 0, 0 }, { 14, 21, 0, 8, 0, 0 }, { 13, 24, 0, 8, 0, 0 }, { 13, 27, 0, 8, 0, 0 }, { 12, 30, 0, 8, 0, 0 }, { 12, 33, 0, 8, 0, 0 }, { 15, 33, 0, 8, 0, 0 }, { 18, 33, 0, 8, 0, 0 }, { 21, 33, 0, 8, 0, 0 }, { 24, 33, 0, 8, 0, 0 }, { 26, 33, 0, 8, 0, 0 }, { 26, 35, 0, 8, 0, 0 }, { 26, 37, 0, 8, 0, 0 }, { 26, 39, 0, 8, 0, 0 }, @@ -18940,13 +18949,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93D07D, { { 13, 47, 0, 8, 0, 0 }, { 13, 49, 0, 8, 0, 0 }, { 14, 51, 0, 8, 0, 0 }, { 14, 53, 0, 8, 0, 0 }, { 14, 54, 0, 8, 0, 0 }, { 14, 55, 0, 8, 0, 0 }, { 14, 56, 0, 8, 0, 0 }, { 14, 57, 0, 8, 0, 0 }, { 14, 58, 0, 8, 0, 0 }, { 14, 59, 0, 8, 0, 0 }, { 14, 60, 0, 8, 0, 0 }, { 14, 61, 0, 8, 0, 0 }, { 14, 62, 0, 8, 0, 0 }, { 14, 61, 0, 8, 0, 0 }, { 14, 60, 0, 8, 0, 0 }, - { 15, 59, 0, 8, 0, 0 }, { 15, 58, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 15, 59, 0, 8, 0, 0 }, { 15, 58, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93FA6E, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, { 15, 16, 0, 16, 0, 0 }, { 18, 17, 0, 16, 0, 0 }, { 21, 17, 0, 16, 0, 0 }, { 24, 18, 0, 16, 0, 0 }, { 27, 18, 0, 16, 0, 0 }, { 30, 19, 0, 16, 0, 0 }, { 33, 19, 0, 16, 0, 0 }, { 33, 16, 0, 16, 0, 0 }, { 33, 13, 0, 16, 0, 0 }, { 33, 10, 0, 16, 0, 0 }, { 33, 7, 0, 16, 0, 0 }, { 33, 5, 0, 16, 0, 0 }, { 35, 5, 0, 16, 0, 0 }, { 37, 5, 0, 16, 0, 0 }, { 39, 5, 0, 16, 0, 0 }, @@ -18955,13 +18964,13 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93FA6E, { { 47, 18, 0, 16, 0, 0 }, { 49, 18, 0, 16, 0, 0 }, { 51, 17, 0, 16, 0, 0 }, { 53, 17, 0, 16, 0, 0 }, { 54, 17, 0, 16, 0, 0 }, { 55, 17, 0, 16, 0, 0 }, { 56, 17, 0, 16, 0, 0 }, { 57, 17, 0, 16, 0, 0 }, { 58, 17, 0, 16, 0, 0 }, { 59, 17, 0, 16, 0, 0 }, { 60, 17, 0, 16, 0, 0 }, { 61, 17, 0, 16, 0, 0 }, { 62, 17, 0, 16, 0, 0 }, { 61, 17, 0, 16, 0, 0 }, { 60, 17, 0, 16, 0, 0 }, - { 59, 16, 0, 16, 0, 0 }, { 58, 16, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 59, 16, 0, 16, 0, 0 }, { 58, 16, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94245F, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, { 16, 16, 0, 24, 0, 0 }, { 17, 13, 0, 24, 0, 0 }, { 17, 10, 0, 24, 0, 0 }, { 18, 7, 0, 24, 0, 0 }, { 18, 4, 0, 24, 0, 0 }, { 19, 1, 0, 24, 0, 0 }, { 19, -2, 0, 24, 0, 0 }, { 16, -2, 0, 24, 0, 0 }, { 13, -2, 0, 24, 0, 0 }, { 10, -2, 0, 24, 0, 0 }, { 7, -2, 0, 24, 0, 0 }, { 5, -2, 0, 24, 0, 0 }, { 5, -4, 0, 24, 0, 0 }, { 5, -6, 0, 24, 0, 0 }, { 5, -8, 0, 24, 0, 0 }, @@ -18970,64 +18979,64 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94245F, { { 18, -16, 0, 24, 0, 0 }, { 18, -18, 0, 24, 0, 0 }, { 17, -20, 0, 24, 0, 0 }, { 17, -22, 0, 24, 0, 0 }, { 17, -23, 0, 24, 0, 0 }, { 17, -24, 0, 24, 0, 0 }, { 17, -25, 0, 24, 0, 0 }, { 17, -26, 0, 24, 0, 0 }, { 17, -27, 0, 24, 0, 0 }, { 17, -28, 0, 24, 0, 0 }, { 17, -29, 0, 24, 0, 0 }, { 17, -30, 0, 24, 0, 0 }, { 17, -31, 0, 24, 0, 0 }, { 17, -30, 0, 24, 0, 0 }, { 17, -29, 0, 24, 0, 0 }, - { 16, -28, 0, 24, 0, 0 }, { 16, -27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 16, -28, 0, 24, 0, 0 }, { 16, -27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93B4CC, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 18, 18, 0, 0, 0, 0 }, - { 15, 19, 0, 0, 0, 0 }, { 12, 19, 0, 0, 0, 0 }, { 10, 20, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 18, 18, 0, 0, 0, 0 }, + { 15, 19, 0, 0, 0, 0 }, { 12, 19, 0, 0, 0, 0 }, { 10, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 7, 20, 0, 0, 0, 0 }, { 5, 19, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 17, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, - { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -8, 16, 0, 0, 0, 0 }, { -10, 16, 0, 0, 0, 0 }, + { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -8, 16, 0, 0, 0, 0 }, { -10, 16, 0, 0, 0, 0 }, { -12, 16, 0, 0, 0, 0 }, { -14, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -16, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -20, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -22, 16, 0, 0, 0, 0 }, - { -23, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -23, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93DEBD, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 18, 13, 0, 8, 0, 0 }, - { 19, 16, 0, 8, 0, 0 }, { 19, 19, 0, 8, 0, 0 }, { 20, 21, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 18, 13, 0, 8, 0, 0 }, + { 19, 16, 0, 8, 0, 0 }, { 19, 19, 0, 8, 0, 0 }, { 20, 21, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 20, 24, 0, 8, 0, 0 }, { 19, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 17, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, - { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 39, 0, 8, 0, 0 }, { 16, 41, 0, 8, 0, 0 }, + { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 39, 0, 8, 0, 0 }, { 16, 41, 0, 8, 0, 0 }, { 16, 43, 0, 8, 0, 0 }, { 16, 45, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 47, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 51, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 53, 0, 8, 0, 0 }, - { 16, 54, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9408AE, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 13, 13, 0, 16, 0, 0 }, - { 16, 12, 0, 16, 0, 0 }, { 19, 12, 0, 16, 0, 0 }, { 21, 11, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 13, 13, 0, 16, 0, 0 }, + { 16, 12, 0, 16, 0, 0 }, { 19, 12, 0, 16, 0, 0 }, { 21, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 24, 11, 0, 16, 0, 0 }, { 26, 12, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 14, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, - { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 39, 15, 0, 16, 0, 0 }, { 41, 15, 0, 16, 0, 0 }, + { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 39, 15, 0, 16, 0, 0 }, { 41, 15, 0, 16, 0, 0 }, { 43, 15, 0, 16, 0, 0 }, { 45, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 47, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 51, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 53, 15, 0, 16, 0, 0 }, - { 54, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 54, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94329F, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 13, 18, 0, 24, 0, 0 }, - { 12, 15, 0, 24, 0, 0 }, { 12, 12, 0, 24, 0, 0 }, { 11, 10, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 13, 18, 0, 24, 0, 0 }, + { 12, 15, 0, 24, 0, 0 }, { 12, 12, 0, 24, 0, 0 }, { 11, 10, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 11, 7, 0, 24, 0, 0 }, { 12, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 14, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, - { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -8, 0, 24, 0, 0 }, { 15, -10, 0, 24, 0, 0 }, + { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -8, 0, 24, 0, 0 }, { 15, -10, 0, 24, 0, 0 }, { 15, -12, 0, 24, 0, 0 }, { 15, -14, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -16, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -20, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -22, 0, 24, 0, 0 }, - { 15, -23, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_944104, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 6, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, - { 0, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -6, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -12, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, + { 0, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -6, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -12, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 15, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, { -27, 11, 0, 0, 0, 0 }, { -28, 9, 0, 0, 0, 0 }, { -26, 7, 0, 0, 0, 0 }, { -24, 5, 1, 0, 0, 0 }, { -22, 3, 1, 0, 0, 0 }, { -20, 2, 1, 0, 0, 0 }, { -18, 2, 1, 0, 0, 0 }, { -16, 3, 2, 0, 0, 0 }, { -14, 3, 2, 0, 0, 0 }, { -14, 5, 2, 0, 0, 0 }, { -13, 7, 2, 0, 0, 0 }, { -12, 9, 3, 0, 0, 0 }, @@ -19036,16 +19045,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_944104, { { -14, 30, 3, 0, 0, 0 }, { -14, 31, 3, 0, 0, 0 }, { -15, 32, 3, 0, 0, 0 }, { -15, 33, 3, 0, 0, 0 }, { -15, 34, 3, 0, 0, 0 }, { -15, 35, 3, 0, 0, 0 }, { -15, 36, 3, 0, 0, 0 }, { -15, 38, 0, 0, 0, 0 }, { -16, 40, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -16, 42, 0, 0, 0, 0 }, { -16, 43, 0, 0, 0, 0 }, { -16, 44, 0, 0, 0, 0 }, { -16, 45, 0, 0, 0, 0 }, { -17, 46, 0, 0, 0, 0 }, - { -17, 47, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -17, 49, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -17, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, + { -17, 47, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -17, 49, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -17, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_946DC2, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 25, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, - { 16, 31, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 37, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 16, 43, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, + { 16, 31, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 37, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 16, 43, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 15, 56, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, { 11, 58, 0, 8, 0, 0 }, { 9, 59, 0, 8, 0, 0 }, { 7, 57, 0, 8, 0, 0 }, { 5, 55, 1, 8, 0, 0 }, { 3, 53, 1, 8, 0, 0 }, { 2, 51, 1, 8, 0, 0 }, { 2, 49, 1, 8, 0, 0 }, { 3, 47, 2, 8, 0, 0 }, { 3, 45, 2, 8, 0, 0 }, { 5, 45, 2, 8, 0, 0 }, { 7, 44, 2, 8, 0, 0 }, { 9, 43, 3, 8, 0, 0 }, @@ -19054,16 +19063,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_946DC2, { { 30, 45, 3, 8, 0, 0 }, { 31, 45, 3, 8, 0, 0 }, { 32, 46, 3, 8, 0, 0 }, { 33, 46, 3, 8, 0, 0 }, { 34, 46, 3, 8, 0, 0 }, { 35, 46, 3, 8, 0, 0 }, { 36, 46, 3, 8, 0, 0 }, { 38, 46, 0, 8, 0, 0 }, { 40, 47, 0, 8, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { 42, 47, 0, 8, 0, 0 }, { 43, 47, 0, 8, 0, 0 }, { 44, 47, 0, 8, 0, 0 }, { 45, 47, 0, 8, 0, 0 }, { 46, 48, 0, 8, 0, 0 }, - { 47, 48, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { 49, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 60, 48, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, + { 47, 48, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { 49, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 60, 48, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_949A80, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 25, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, - { 31, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 37, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 43, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, + { 31, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 37, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 43, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 16, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, { 58, 20, 0, 16, 0, 0 }, { 59, 22, 0, 16, 0, 0 }, { 57, 24, 0, 16, 0, 0 }, { 55, 26, 1, 16, 0, 0 }, { 53, 28, 1, 16, 0, 0 }, { 51, 29, 1, 16, 0, 0 }, { 49, 29, 1, 16, 0, 0 }, { 47, 28, 2, 16, 0, 0 }, { 45, 28, 2, 16, 0, 0 }, { 45, 26, 2, 16, 0, 0 }, { 44, 24, 2, 16, 0, 0 }, { 43, 22, 3, 16, 0, 0 }, @@ -19072,16 +19081,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_949A80, { { 45, 1, 3, 16, 0, 0 }, { 45, 0, 3, 16, 0, 0 }, { 46, -1, 3, 16, 0, 0 }, { 46, -2, 3, 16, 0, 0 }, { 46, -3, 3, 16, 0, 0 }, { 46, -4, 3, 16, 0, 0 }, { 46, -5, 3, 16, 0, 0 }, { 46, -7, 0, 16, 0, 0 }, { 47, -9, 0, 16, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { 47, -11, 0, 16, 0, 0 }, { 47, -12, 0, 16, 0, 0 }, { 47, -13, 0, 16, 0, 0 }, { 47, -14, 0, 16, 0, 0 }, { 48, -15, 0, 16, 0, 0 }, - { 48, -16, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { 48, -18, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 48, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, + { 48, -16, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { 48, -18, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 48, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94C73E, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 6, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, - { 15, 0, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -6, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 15, -12, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, + { 15, 0, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -6, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 15, -12, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 16, -25, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, { 20, -27, 0, 24, 0, 0 }, { 22, -28, 0, 24, 0, 0 }, { 24, -26, 0, 24, 0, 0 }, { 26, -24, 1, 24, 0, 0 }, { 28, -22, 1, 24, 0, 0 }, { 29, -20, 1, 24, 0, 0 }, { 29, -18, 1, 24, 0, 0 }, { 28, -16, 2, 24, 0, 0 }, { 28, -14, 2, 24, 0, 0 }, { 26, -14, 2, 24, 0, 0 }, { 24, -13, 2, 24, 0, 0 }, { 22, -12, 3, 24, 0, 0 }, @@ -19090,16 +19099,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94C73E, { { 1, -14, 3, 24, 0, 0 }, { 0, -14, 3, 24, 0, 0 }, { -1, -15, 3, 24, 0, 0 }, { -2, -15, 3, 24, 0, 0 }, { -3, -15, 3, 24, 0, 0 }, { -4, -15, 3, 24, 0, 0 }, { -5, -15, 3, 24, 0, 0 }, { -7, -15, 0, 24, 0, 0 }, { -9, -16, 0, 24, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -11, -16, 0, 24, 0, 0 }, { -12, -16, 0, 24, 0, 0 }, { -13, -16, 0, 24, 0, 0 }, { -14, -16, 0, 24, 0, 0 }, { -15, -17, 0, 24, 0, 0 }, - { -16, -17, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -18, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -29, -17, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, + { -16, -17, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -18, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -29, -17, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_945763, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 6, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, - { 0, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -6, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -12, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, + { 0, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -6, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -12, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 17, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, { -27, 21, 0, 0, 0, 0 }, { -28, 23, 0, 0, 0, 0 }, { -26, 25, 0, 0, 0, 0 }, { -24, 27, 1, 0, 0, 0 }, { -22, 29, 1, 0, 0, 0 }, { -20, 30, 1, 0, 0, 0 }, { -18, 30, 1, 0, 0, 0 }, { -16, 29, 2, 0, 0, 0 }, { -14, 29, 2, 0, 0, 0 }, { -14, 27, 2, 0, 0, 0 }, { -13, 25, 2, 0, 0, 0 }, { -12, 23, 3, 0, 0, 0 }, @@ -19108,16 +19117,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_945763, { { -14, 2, 3, 0, 0, 0 }, { -14, 1, 3, 0, 0, 0 }, { -15, 0, 3, 0, 0, 0 }, { -15, -1, 3, 0, 0, 0 }, { -15, -2, 3, 0, 0, 0 }, { -15, -3, 3, 0, 0, 0 }, { -15, -4, 3, 0, 0, 0 }, { -15, -6, 0, 0, 0, 0 }, { -16, -8, 0, 0, 0, 0 }, { -16, -9, 0, 0, 0, 0 }, { -16, -10, 0, 0, 0, 0 }, { -16, -11, 0, 0, 0, 0 }, { -16, -12, 0, 0, 0, 0 }, { -16, -13, 0, 0, 0, 0 }, { -17, -14, 0, 0, 0, 0 }, - { -17, -15, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -17, -28, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, + { -17, -15, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -17, -28, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_948421, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 25, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, - { 16, 31, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 37, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 16, 43, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, + { 16, 31, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 37, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 16, 43, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 17, 56, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, { 21, 58, 0, 8, 0, 0 }, { 23, 59, 0, 8, 0, 0 }, { 25, 57, 0, 8, 0, 0 }, { 27, 55, 1, 8, 0, 0 }, { 29, 53, 1, 8, 0, 0 }, { 30, 51, 1, 8, 0, 0 }, { 30, 49, 1, 8, 0, 0 }, { 29, 47, 2, 8, 0, 0 }, { 29, 45, 2, 8, 0, 0 }, { 27, 45, 2, 8, 0, 0 }, { 25, 44, 2, 8, 0, 0 }, { 23, 43, 3, 8, 0, 0 }, @@ -19126,16 +19135,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_948421, { { 2, 45, 3, 8, 0, 0 }, { 1, 45, 3, 8, 0, 0 }, { 0, 46, 3, 8, 0, 0 }, { -1, 46, 3, 8, 0, 0 }, { -2, 46, 3, 8, 0, 0 }, { -3, 46, 3, 8, 0, 0 }, { -4, 46, 3, 8, 0, 0 }, { -6, 46, 0, 8, 0, 0 }, { -8, 47, 0, 8, 0, 0 }, { -9, 47, 0, 8, 0, 0 }, { -10, 47, 0, 8, 0, 0 }, { -11, 47, 0, 8, 0, 0 }, { -12, 47, 0, 8, 0, 0 }, { -13, 47, 0, 8, 0, 0 }, { -14, 48, 0, 8, 0, 0 }, - { -15, 48, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -28, 48, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, + { -15, 48, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -28, 48, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94B0DF, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 25, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, - { 31, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 37, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 43, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, + { 31, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 37, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 43, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 14, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, { 58, 10, 0, 16, 0, 0 }, { 59, 8, 0, 16, 0, 0 }, { 57, 6, 0, 16, 0, 0 }, { 55, 4, 1, 16, 0, 0 }, { 53, 2, 1, 16, 0, 0 }, { 51, 1, 1, 16, 0, 0 }, { 49, 1, 1, 16, 0, 0 }, { 47, 2, 2, 16, 0, 0 }, { 45, 2, 2, 16, 0, 0 }, { 45, 4, 2, 16, 0, 0 }, { 44, 6, 2, 16, 0, 0 }, { 43, 8, 3, 16, 0, 0 }, @@ -19144,16 +19153,16 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94B0DF, { { 45, 29, 3, 16, 0, 0 }, { 45, 30, 3, 16, 0, 0 }, { 46, 31, 3, 16, 0, 0 }, { 46, 32, 3, 16, 0, 0 }, { 46, 33, 3, 16, 0, 0 }, { 46, 34, 3, 16, 0, 0 }, { 46, 35, 3, 16, 0, 0 }, { 46, 37, 0, 16, 0, 0 }, { 47, 39, 0, 16, 0, 0 }, { 47, 40, 0, 16, 0, 0 }, { 47, 41, 0, 16, 0, 0 }, { 47, 42, 0, 16, 0, 0 }, { 47, 43, 0, 16, 0, 0 }, { 47, 44, 0, 16, 0, 0 }, { 48, 45, 0, 16, 0, 0 }, - { 48, 46, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 48, 59, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, + { 48, 46, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 48, 59, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94DD9D, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 6, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, - { 15, 0, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -6, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 15, -12, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, + { 15, 0, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -6, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 15, -12, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 14, -25, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, { 10, -27, 0, 24, 0, 0 }, { 8, -28, 0, 24, 0, 0 }, { 6, -26, 0, 24, 0, 0 }, { 4, -24, 1, 24, 0, 0 }, { 2, -22, 1, 24, 0, 0 }, { 1, -20, 1, 24, 0, 0 }, { 1, -18, 1, 24, 0, 0 }, { 2, -16, 2, 24, 0, 0 }, { 2, -14, 2, 24, 0, 0 }, { 4, -14, 2, 24, 0, 0 }, { 6, -13, 2, 24, 0, 0 }, { 8, -12, 3, 24, 0, 0 }, @@ -19162,594 +19171,594 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94DD9D, { { 29, -14, 3, 24, 0, 0 }, { 30, -14, 3, 24, 0, 0 }, { 31, -15, 3, 24, 0, 0 }, { 32, -15, 3, 24, 0, 0 }, { 33, -15, 3, 24, 0, 0 }, { 34, -15, 3, 24, 0, 0 }, { 35, -15, 3, 24, 0, 0 }, { 37, -15, 0, 24, 0, 0 }, { 39, -16, 0, 24, 0, 0 }, { 40, -16, 0, 24, 0, 0 }, { 41, -16, 0, 24, 0, 0 }, { 42, -16, 0, 24, 0, 0 }, { 43, -16, 0, 24, 0, 0 }, { 44, -16, 0, 24, 0, 0 }, { 45, -17, 0, 24, 0, 0 }, - { 46, -17, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 59, -17, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, + { 46, -17, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 59, -17, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_939A85, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, - { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 3, 16, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 3, 16, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 3, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 3, 16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, + { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 3, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 3, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 3, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 3, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, - { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -15, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, - { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -15, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, + { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93C476, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, - { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 28, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 28, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 28, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 28, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, + { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 28, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 28, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 28, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 28, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, - { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 46, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, - { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 16, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, + { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93EE67, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, - { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 28, 15, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 28, 15, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 28, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 28, 15, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, + { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 28, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 28, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 28, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 28, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, - { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 46, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, - { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 46, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, + { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941858, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, - { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 3, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 3, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 3, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 3, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, + { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 3, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 3, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 3, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 3, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, - { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, -15, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, - { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 15, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, + { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93A898, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, - { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 2, 16, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 2, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 2, 16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, + { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 2, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 2, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 2, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -5, 18, 0, 8, 0, 0 }, { -5, 20, 0, 8, 0, 0 }, { -5, 22, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -4, 22, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -4, 22, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -4, 22, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -4, 22, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -4, 22, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -4, 22, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -5, 20, 0, 24, 0, 0 }, { -5, 18, 0, 24, 0, 0 }, { -5, 16, 0, 24, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, - { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -27, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93D289, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, - { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 29, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 29, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 29, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, + { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 29, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 29, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 29, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 18, 36, 0, 16, 0, 0 }, { 20, 36, 0, 16, 0, 0 }, { 22, 36, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 22, 35, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 22, 35, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 22, 35, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 22, 35, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 22, 35, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 22, 35, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 20, 36, 0, 0, 0, 0 }, { 18, 36, 0, 0, 0, 0 }, { 16, 36, 0, 0, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, - { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 58, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93FC7A, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, - { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 29, 15, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 29, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 29, 15, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, + { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 29, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 29, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 29, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 36, 13, 0, 24, 0, 0 }, { 36, 11, 0, 24, 0, 0 }, { 36, 9, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 35, 9, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 35, 9, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 35, 9, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 35, 9, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 35, 9, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 35, 9, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 36, 11, 0, 8, 0, 0 }, { 36, 13, 0, 8, 0, 0 }, { 36, 15, 0, 8, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, - { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 58, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94266B, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, - { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 2, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 2, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 2, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, + { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 2, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 2, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 2, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 13, -5, 0, 0, 0, 0 }, { 11, -5, 0, 0, 0, 0 }, { 9, -5, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 9, -4, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 9, -4, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 9, -4, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 9, -4, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 9, -4, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 9, -4, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 11, -5, 0, 16, 0, 0 }, { 13, -5, 0, 16, 0, 0 }, { 15, -5, 0, 16, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, - { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, -27, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93B648, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 5, 0, 0, 0 }, { 7, 16, 5, 0, 0, 0 }, { 5, 16, 5, 0, 0, 0 }, { 3, 16, 5, 0, 0, 0 }, { 1, 16, 5, 0, 0, 0 }, { -1, 16, 5, 0, 0, 0 }, { -3, 16, 5, 0, 0, 0 }, { -5, 16, 5, 0, 0, 0 }, { -7, 16, 5, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, - { -23, 16, 0, 0, 0, 0 }, { -23, 14, 0, 24, 0, 0 }, { -23, 12, 0, 24, 0, 0 }, { -23, 10, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -23, 10, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -23, 10, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -23, 10, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -23, 10, 0, 8, 0, 0 }, - { -23, 12, 0, 8, 0, 0 }, { -23, 14, 0, 8, 0, 0 }, { -23, 16, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -23, 16, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, - { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -23, 16, 0, 0, 0, 0 }, { -23, 14, 0, 24, 0, 0 }, { -23, 12, 0, 24, 0, 0 }, { -23, 10, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -23, 10, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { -23, 10, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { -23, 10, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -23, 10, 0, 8, 0, 0 }, + { -23, 12, 0, 8, 0, 0 }, { -23, 14, 0, 8, 0, 0 }, { -23, 16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -23, 16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, + { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93E039, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 5, 8, 0, 0 }, { 16, 24, 5, 8, 0, 0 }, { 16, 26, 5, 8, 0, 0 }, { 16, 28, 5, 8, 0, 0 }, { 16, 30, 5, 8, 0, 0 }, { 16, 32, 5, 8, 0, 0 }, { 16, 34, 5, 8, 0, 0 }, { 16, 36, 5, 8, 0, 0 }, { 16, 38, 5, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, - { 16, 54, 0, 8, 0, 0 }, { 14, 54, 0, 0, 0, 0 }, { 12, 54, 0, 0, 0, 0 }, { 10, 54, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 10, 54, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 10, 54, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 10, 54, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 10, 54, 0, 16, 0, 0 }, - { 12, 54, 0, 16, 0, 0 }, { 14, 54, 0, 16, 0, 0 }, { 16, 54, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 54, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, - { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 54, 0, 8, 0, 0 }, { 14, 54, 0, 0, 0, 0 }, { 12, 54, 0, 0, 0, 0 }, { 10, 54, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 10, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 10, 54, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 10, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 10, 54, 0, 16, 0, 0 }, + { 12, 54, 0, 16, 0, 0 }, { 14, 54, 0, 16, 0, 0 }, { 16, 54, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 16, 54, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, + { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_940A2A, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 5, 16, 0, 0 }, { 24, 15, 5, 16, 0, 0 }, { 26, 15, 5, 16, 0, 0 }, { 28, 15, 5, 16, 0, 0 }, { 30, 15, 5, 16, 0, 0 }, { 32, 15, 5, 16, 0, 0 }, { 34, 15, 5, 16, 0, 0 }, { 36, 15, 5, 16, 0, 0 }, { 38, 15, 5, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, - { 54, 15, 0, 16, 0, 0 }, { 54, 17, 0, 8, 0, 0 }, { 54, 19, 0, 8, 0, 0 }, { 54, 21, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 54, 21, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 54, 21, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 54, 21, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 54, 21, 0, 24, 0, 0 }, - { 54, 19, 0, 24, 0, 0 }, { 54, 17, 0, 24, 0, 0 }, { 54, 15, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 54, 15, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, - { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 54, 15, 0, 16, 0, 0 }, { 54, 17, 0, 8, 0, 0 }, { 54, 19, 0, 8, 0, 0 }, { 54, 21, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 54, 21, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 54, 21, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 54, 21, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 54, 21, 0, 24, 0, 0 }, + { 54, 19, 0, 24, 0, 0 }, { 54, 17, 0, 24, 0, 0 }, { 54, 15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 54, 15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, + { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94341B, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 5, 24, 0, 0 }, { 15, 7, 5, 24, 0, 0 }, { 15, 5, 5, 24, 0, 0 }, { 15, 3, 5, 24, 0, 0 }, { 15, 1, 5, 24, 0, 0 }, { 15, -1, 5, 24, 0, 0 }, { 15, -3, 5, 24, 0, 0 }, { 15, -5, 5, 24, 0, 0 }, { 15, -7, 5, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, - { 15, -23, 0, 24, 0, 0 }, { 17, -23, 0, 16, 0, 0 }, { 19, -23, 0, 16, 0, 0 }, { 21, -23, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 21, -23, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 21, -23, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 21, -23, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 21, -23, 0, 0, 0, 0 }, - { 19, -23, 0, 0, 0, 0 }, { 17, -23, 0, 0, 0, 0 }, { 15, -23, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, -23, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, - { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -23, 0, 24, 0, 0 }, { 17, -23, 0, 16, 0, 0 }, { 19, -23, 0, 16, 0, 0 }, { 21, -23, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 21, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 21, -23, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 21, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 21, -23, 0, 0, 0, 0 }, + { 19, -23, 0, 0, 0, 0 }, { 17, -23, 0, 0, 0, 0 }, { 15, -23, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 15, -23, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, + { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9443A0, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, - { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 18, 0, 8, 0, 0 }, { 15, 20, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 20, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 18, 0, 8, 0, 0 }, { 15, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 13, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, { 5, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 1, 20, 0, 0, 0, 0 }, { -1, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, { -3, 22, 0, 8, 0, 0 }, { -3, 24, 0, 8, 0, 0 }, { -3, 26, 0, 8, 0, 0 }, { -3, 28, 0, 8, 0, 0 }, { -3, 30, 0, 8, 0, 0 }, { -3, 32, 0, 8, 0, 0 }, { -3, 34, 0, 8, 0, 0 }, { -3, 36, 0, 8, 0, 0 }, { -3, 38, 0, 8, 0, 0 }, { -3, 40, 0, 8, 0, 0 }, { -3, 42, 0, 8, 0, 0 }, { -5, 42, 0, 0, 0, 0 }, { -7, 42, 0, 0, 0, 0 }, { -9, 42, 0, 0, 0, 0 }, { -11, 42, 0, 0, 0, 0 }, { -13, 42, 0, 0, 0, 0 }, { -15, 42, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -17, 43, 0, 8, 0, 0 }, { -17, 45, 0, 8, 0, 0 }, { -17, 47, 0, 8, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -17, 43, 0, 8, 0, 0 }, { -17, 45, 0, 8, 0, 0 }, { -17, 47, 0, 8, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, 48, 0, 8, 0, 0 }, { -17, 50, 0, 8, 0, 0 }, { -17, 52, 0, 8, 0, 0 }, { -17, 54, 0, 8, 0, 0 }, { -17, 56, 0, 8, 0, 0 }, { -17, 58, 0, 8, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94705E, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, - { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 16, 0, 16, 0, 0 }, { 20, 16, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 20, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 16, 0, 16, 0, 0 }, { 20, 16, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 20, 18, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, { 20, 26, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 30, 0, 8, 0, 0 }, { 20, 32, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, { 22, 34, 0, 16, 0, 0 }, { 24, 34, 0, 16, 0, 0 }, { 26, 34, 0, 16, 0, 0 }, { 28, 34, 0, 16, 0, 0 }, { 30, 34, 0, 16, 0, 0 }, { 32, 34, 0, 16, 0, 0 }, { 34, 34, 0, 16, 0, 0 }, { 36, 34, 0, 16, 0, 0 }, { 38, 34, 0, 16, 0, 0 }, { 40, 34, 0, 16, 0, 0 }, { 42, 34, 0, 16, 0, 0 }, { 42, 36, 0, 8, 0, 0 }, { 42, 38, 0, 8, 0, 0 }, { 42, 40, 0, 8, 0, 0 }, { 42, 42, 0, 8, 0, 0 }, { 42, 44, 0, 8, 0, 0 }, { 42, 46, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 43, 48, 0, 16, 0, 0 }, { 45, 48, 0, 16, 0, 0 }, { 47, 48, 0, 16, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 43, 48, 0, 16, 0, 0 }, { 45, 48, 0, 16, 0, 0 }, { 47, 48, 0, 16, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 49, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 48, 0, 16, 0, 0 }, { 50, 48, 0, 16, 0, 0 }, { 52, 48, 0, 16, 0, 0 }, { 54, 48, 0, 16, 0, 0 }, { 56, 48, 0, 16, 0, 0 }, { 58, 48, 0, 16, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_949D1C, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, - { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 13, 0, 24, 0, 0 }, { 16, 11, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 11, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 13, 0, 24, 0, 0 }, { 16, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 18, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, { 26, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 30, 11, 0, 16, 0, 0 }, { 32, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, { 34, 9, 0, 24, 0, 0 }, { 34, 7, 0, 24, 0, 0 }, { 34, 5, 0, 24, 0, 0 }, { 34, 3, 0, 24, 0, 0 }, { 34, 1, 0, 24, 0, 0 }, { 34, -1, 0, 24, 0, 0 }, { 34, -3, 0, 24, 0, 0 }, { 34, -5, 0, 24, 0, 0 }, { 34, -7, 0, 24, 0, 0 }, { 34, -9, 0, 24, 0, 0 }, { 34, -11, 0, 24, 0, 0 }, { 36, -11, 0, 16, 0, 0 }, { 38, -11, 0, 16, 0, 0 }, { 40, -11, 0, 16, 0, 0 }, { 42, -11, 0, 16, 0, 0 }, { 44, -11, 0, 16, 0, 0 }, { 46, -11, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 48, -12, 0, 24, 0, 0 }, { 48, -14, 0, 24, 0, 0 }, { 48, -16, 0, 24, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 48, -12, 0, 24, 0, 0 }, { 48, -14, 0, 24, 0, 0 }, { 48, -16, 0, 24, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, -17, 0, 24, 0, 0 }, { 48, -19, 0, 24, 0, 0 }, { 48, -21, 0, 24, 0, 0 }, { 48, -23, 0, 24, 0, 0 }, { 48, -25, 0, 24, 0, 0 }, { 48, -27, 0, 24, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94C9DA, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, - { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 15, 0, 0, 0, 0 }, { 11, 15, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 11, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 15, 0, 0, 0, 0 }, { 11, 15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 11, 13, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, { 11, 5, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 1, 0, 24, 0, 0 }, { 11, -1, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, { 9, -3, 0, 0, 0, 0 }, { 7, -3, 0, 0, 0, 0 }, { 5, -3, 0, 0, 0, 0 }, { 3, -3, 0, 0, 0, 0 }, { 1, -3, 0, 0, 0, 0 }, { -1, -3, 0, 0, 0, 0 }, { -3, -3, 0, 0, 0, 0 }, { -5, -3, 0, 0, 0, 0 }, { -7, -3, 0, 0, 0, 0 }, { -9, -3, 0, 0, 0, 0 }, { -11, -3, 0, 0, 0, 0 }, { -11, -5, 0, 24, 0, 0 }, { -11, -7, 0, 24, 0, 0 }, { -11, -9, 0, 24, 0, 0 }, { -11, -11, 0, 24, 0, 0 }, { -11, -13, 0, 24, 0, 0 }, { -11, -15, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -12, -17, 0, 0, 0, 0 }, { -14, -17, 0, 0, 0, 0 }, { -16, -17, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -12, -17, 0, 0, 0, 0 }, { -14, -17, 0, 0, 0, 0 }, { -16, -17, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -18, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -17, 0, 0, 0, 0 }, { -19, -17, 0, 0, 0, 0 }, { -21, -17, 0, 0, 0, 0 }, { -23, -17, 0, 0, 0, 0 }, { -25, -17, 0, 0, 0, 0 }, { -27, -17, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9459FF, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, - { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 14, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 12, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 14, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 13, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 5, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 1, 12, 0, 0, 0, 0 }, { -1, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, { -3, 10, 0, 24, 0, 0 }, { -3, 8, 0, 24, 0, 0 }, { -3, 6, 0, 24, 0, 0 }, { -3, 4, 0, 24, 0, 0 }, { -3, 2, 0, 24, 0, 0 }, { -3, 0, 0, 24, 0, 0 }, { -3, -2, 0, 24, 0, 0 }, { -3, -4, 0, 24, 0, 0 }, { -3, -6, 0, 24, 0, 0 }, { -3, -8, 0, 24, 0, 0 }, { -3, -10, 0, 24, 0, 0 }, { -5, -10, 0, 0, 0, 0 }, { -7, -10, 0, 0, 0, 0 }, { -9, -10, 0, 0, 0, 0 }, { -11, -10, 0, 0, 0, 0 }, { -13, -10, 0, 0, 0, 0 }, { -15, -10, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -17, -11, 0, 24, 0, 0 }, { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -17, -11, 0, 24, 0, 0 }, { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -16, 0, 24, 0, 0 }, { -17, -18, 0, 24, 0, 0 }, { -17, -20, 0, 24, 0, 0 }, { -17, -22, 0, 24, 0, 0 }, { -17, -24, 0, 24, 0, 0 }, { -17, -26, 0, 24, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9486BD, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, - { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 12, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 18, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 12, 26, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 30, 0, 8, 0, 0 }, { 12, 32, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, { 10, 34, 0, 0, 0, 0 }, { 8, 34, 0, 0, 0, 0 }, { 6, 34, 0, 0, 0, 0 }, { 4, 34, 0, 0, 0, 0 }, { 2, 34, 0, 0, 0, 0 }, { 0, 34, 0, 0, 0, 0 }, { -2, 34, 0, 0, 0, 0 }, { -4, 34, 0, 0, 0, 0 }, { -6, 34, 0, 0, 0, 0 }, { -8, 34, 0, 0, 0, 0 }, { -10, 34, 0, 0, 0, 0 }, { -10, 36, 0, 8, 0, 0 }, { -10, 38, 0, 8, 0, 0 }, { -10, 40, 0, 8, 0, 0 }, { -10, 42, 0, 8, 0, 0 }, { -10, 44, 0, 8, 0, 0 }, { -10, 46, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -11, 48, 0, 0, 0, 0 }, { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -16, 48, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -11, 48, 0, 0, 0, 0 }, { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, 48, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -16, 48, 0, 0, 0, 0 }, { -18, 48, 0, 0, 0, 0 }, { -20, 48, 0, 0, 0, 0 }, { -22, 48, 0, 0, 0, 0 }, { -24, 48, 0, 0, 0, 0 }, { -26, 48, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94B37B, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, - { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 17, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 19, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 17, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 18, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 26, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 30, 19, 0, 16, 0, 0 }, { 32, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, { 34, 21, 0, 8, 0, 0 }, { 34, 23, 0, 8, 0, 0 }, { 34, 25, 0, 8, 0, 0 }, { 34, 27, 0, 8, 0, 0 }, { 34, 29, 0, 8, 0, 0 }, { 34, 31, 0, 8, 0, 0 }, { 34, 33, 0, 8, 0, 0 }, { 34, 35, 0, 8, 0, 0 }, { 34, 37, 0, 8, 0, 0 }, { 34, 39, 0, 8, 0, 0 }, { 34, 41, 0, 8, 0, 0 }, { 36, 41, 0, 16, 0, 0 }, { 38, 41, 0, 16, 0, 0 }, { 40, 41, 0, 16, 0, 0 }, { 42, 41, 0, 16, 0, 0 }, { 44, 41, 0, 16, 0, 0 }, { 46, 41, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 48, 42, 0, 8, 0, 0 }, { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 47, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 48, 42, 0, 8, 0, 0 }, { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 47, 0, 8, 0, 0 }, { 48, 49, 0, 8, 0, 0 }, { 48, 51, 0, 8, 0, 0 }, { 48, 53, 0, 8, 0, 0 }, { 48, 55, 0, 8, 0, 0 }, { 48, 57, 0, 8, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94E039, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, - { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 19, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, 13, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 19, 5, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 1, 0, 24, 0, 0 }, { 19, -1, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, { 21, -3, 0, 16, 0, 0 }, { 23, -3, 0, 16, 0, 0 }, { 25, -3, 0, 16, 0, 0 }, { 27, -3, 0, 16, 0, 0 }, { 29, -3, 0, 16, 0, 0 }, { 31, -3, 0, 16, 0, 0 }, { 33, -3, 0, 16, 0, 0 }, { 35, -3, 0, 16, 0, 0 }, { 37, -3, 0, 16, 0, 0 }, { 39, -3, 0, 16, 0, 0 }, { 41, -3, 0, 16, 0, 0 }, { 41, -5, 0, 24, 0, 0 }, { 41, -7, 0, 24, 0, 0 }, { 41, -9, 0, 24, 0, 0 }, { 41, -11, 0, 24, 0, 0 }, { 41, -13, 0, 24, 0, 0 }, { 41, -15, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 42, -17, 0, 16, 0, 0 }, { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 47, -17, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 42, -17, 0, 16, 0, 0 }, { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, -17, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 47, -17, 0, 16, 0, 0 }, { 49, -17, 0, 16, 0, 0 }, { 51, -17, 0, 16, 0, 0 }, { 53, -17, 0, 16, 0, 0 }, { 55, -17, 0, 16, 0, 0 }, { 57, -17, 0, 16, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_939CD9, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 16, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 14, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 10, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 8, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 6, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, - { 4, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 2, 16, 0, 0, 0, 0 }, + { 4, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 2, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -4, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -6, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -8, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -10, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -12, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -14, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, - { -16, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -16, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93C6CA, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 15, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 17, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 21, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 23, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 25, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, - { 16, 27, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 29, 0, 8, 0, 0 }, + { 16, 27, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 16, 29, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 35, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 37, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 39, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 41, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 43, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 45, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, - { 16, 47, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93F0BB, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 15, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 17, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 21, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 23, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 25, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, - { 27, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 29, 15, 0, 16, 0, 0 }, + { 27, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 29, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 35, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 37, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 39, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 41, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 43, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 45, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, - { 47, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 47, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941AAC, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 16, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 14, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 10, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 8, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 6, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, - { 15, 4, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 2, 0, 24, 0, 0 }, + { 15, 4, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 15, 2, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -4, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -6, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -8, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -10, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -12, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -14, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, - { 15, -16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93AB73, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 22, 15, 0, 0, 0, 0 }, { 20, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 22, 15, 0, 0, 0, 0 }, { 20, 15, 0, 0, 0, 0 }, { 18, 15, 0, 0, 0, 0 }, { 16, 14, 0, 0, 0, 0 }, { 14, 14, 0, 0, 0, 0 }, { 12, 13, 0, 0, 0, 0 }, { 10, 13, 0, 0, 0, 0 }, { 8, 13, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 4, 12, 0, 0, 0, 0 }, { 2, 11, 0, 0, 0, 0 }, { 1, 11, 0, 0, 0, 0 }, { 0, 11, 0, 0, 0, 0 }, { 0, 12, 0, 0, 0, 0 }, { 0, 13, 0, 0, 0, 0 }, { 0, 14, 0, 0, 0, 0 }, { 1, 15, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -4, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -5, 17, 0, 0, 0, 0 }, { -5, 18, 0, 0, 0, 0 }, { -5, 19, 0, 0, 0, 0 }, - { -5, 20, 0, 0, 0, 0 }, { -5, 21, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -5, 22, 0, 0, 0, 0 }, + { -5, 20, 0, 0, 0, 0 }, { -5, 21, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -5, 22, 0, 0, 0, 0 }, { -7, 22, 0, 0, 0, 0 }, { -9, 21, 0, 0, 0, 0 }, { -11, 21, 0, 0, 0, 0 }, { -13, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, { -16, 20, 0, 0, 0, 0 }, { -17, 19, 0, 0, 0, 0 }, { -18, 19, 0, 0, 0, 0 }, { -19, 18, 0, 0, 0, 0 }, { -20, 18, 0, 0, 0, 0 }, { -21, 18, 0, 0, 0, 0 }, { -22, 17, 0, 0, 0, 0 }, { -23, 17, 0, 0, 0, 0 }, { -24, 17, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, - { -26, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93D564, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 15, 9, 0, 8, 0, 0 }, { 15, 11, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 15, 9, 0, 8, 0, 0 }, { 15, 11, 0, 8, 0, 0 }, { 15, 13, 0, 8, 0, 0 }, { 14, 15, 0, 8, 0, 0 }, { 14, 17, 0, 8, 0, 0 }, { 13, 19, 0, 8, 0, 0 }, { 13, 21, 0, 8, 0, 0 }, { 13, 23, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 27, 0, 8, 0, 0 }, { 11, 29, 0, 8, 0, 0 }, { 11, 30, 0, 8, 0, 0 }, { 11, 31, 0, 8, 0, 0 }, { 12, 31, 0, 8, 0, 0 }, { 13, 31, 0, 8, 0, 0 }, { 14, 31, 0, 8, 0, 0 }, { 15, 30, 0, 8, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 35, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 17, 36, 0, 8, 0, 0 }, { 18, 36, 0, 8, 0, 0 }, { 19, 36, 0, 8, 0, 0 }, - { 20, 36, 0, 8, 0, 0 }, { 21, 36, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 22, 36, 0, 8, 0, 0 }, + { 20, 36, 0, 8, 0, 0 }, { 21, 36, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 22, 36, 0, 8, 0, 0 }, { 22, 38, 0, 8, 0, 0 }, { 21, 40, 0, 8, 0, 0 }, { 21, 42, 0, 8, 0, 0 }, { 20, 44, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, { 20, 47, 0, 8, 0, 0 }, { 19, 48, 0, 8, 0, 0 }, { 19, 49, 0, 8, 0, 0 }, { 18, 50, 0, 8, 0, 0 }, { 18, 51, 0, 8, 0, 0 }, { 18, 52, 0, 8, 0, 0 }, { 17, 53, 0, 8, 0, 0 }, { 17, 54, 0, 8, 0, 0 }, { 17, 55, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, - { 16, 57, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 57, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93FF55, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 9, 16, 0, 16, 0, 0 }, { 11, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 9, 16, 0, 16, 0, 0 }, { 11, 16, 0, 16, 0, 0 }, { 13, 16, 0, 16, 0, 0 }, { 15, 17, 0, 16, 0, 0 }, { 17, 17, 0, 16, 0, 0 }, { 19, 18, 0, 16, 0, 0 }, { 21, 18, 0, 16, 0, 0 }, { 23, 18, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 27, 19, 0, 16, 0, 0 }, { 29, 20, 0, 16, 0, 0 }, { 30, 20, 0, 16, 0, 0 }, { 31, 20, 0, 16, 0, 0 }, { 31, 19, 0, 16, 0, 0 }, { 31, 18, 0, 16, 0, 0 }, { 31, 17, 0, 16, 0, 0 }, { 30, 16, 0, 16, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 35, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 36, 14, 0, 16, 0, 0 }, { 36, 13, 0, 16, 0, 0 }, { 36, 12, 0, 16, 0, 0 }, - { 36, 11, 0, 16, 0, 0 }, { 36, 10, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 36, 9, 0, 16, 0, 0 }, + { 36, 11, 0, 16, 0, 0 }, { 36, 10, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 36, 9, 0, 16, 0, 0 }, { 38, 9, 0, 16, 0, 0 }, { 40, 10, 0, 16, 0, 0 }, { 42, 10, 0, 16, 0, 0 }, { 44, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, { 47, 11, 0, 16, 0, 0 }, { 48, 12, 0, 16, 0, 0 }, { 49, 12, 0, 16, 0, 0 }, { 50, 13, 0, 16, 0, 0 }, { 51, 13, 0, 16, 0, 0 }, { 52, 13, 0, 16, 0, 0 }, { 53, 14, 0, 16, 0, 0 }, { 54, 14, 0, 16, 0, 0 }, { 55, 14, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, - { 57, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 57, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_942946, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 16, 22, 0, 24, 0, 0 }, { 16, 20, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 16, 22, 0, 24, 0, 0 }, { 16, 20, 0, 24, 0, 0 }, { 16, 18, 0, 24, 0, 0 }, { 17, 16, 0, 24, 0, 0 }, { 17, 14, 0, 24, 0, 0 }, { 18, 12, 0, 24, 0, 0 }, { 18, 10, 0, 24, 0, 0 }, { 18, 8, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 4, 0, 24, 0, 0 }, { 20, 2, 0, 24, 0, 0 }, { 20, 1, 0, 24, 0, 0 }, { 20, 0, 0, 24, 0, 0 }, { 19, 0, 0, 24, 0, 0 }, { 18, 0, 0, 24, 0, 0 }, { 17, 0, 0, 24, 0, 0 }, { 16, 1, 0, 24, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -4, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 14, -5, 0, 24, 0, 0 }, { 13, -5, 0, 24, 0, 0 }, { 12, -5, 0, 24, 0, 0 }, - { 11, -5, 0, 24, 0, 0 }, { 10, -5, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 9, -5, 0, 24, 0, 0 }, + { 11, -5, 0, 24, 0, 0 }, { 10, -5, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 9, -5, 0, 24, 0, 0 }, { 9, -7, 0, 24, 0, 0 }, { 10, -9, 0, 24, 0, 0 }, { 10, -11, 0, 24, 0, 0 }, { 11, -13, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, { 11, -16, 0, 24, 0, 0 }, { 12, -17, 0, 24, 0, 0 }, { 12, -18, 0, 24, 0, 0 }, { 13, -19, 0, 24, 0, 0 }, { 13, -20, 0, 24, 0, 0 }, { 13, -21, 0, 24, 0, 0 }, { 14, -22, 0, 24, 0, 0 }, { 14, -23, 0, 24, 0, 0 }, { 14, -24, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, - { 15, -26, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93B8DB, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, - { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, + { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 7, 15, 0, 0, 0, 0 }, { 5, 15, 0, 0, 0, 0 }, { 3, 14, 0, 0, 0, 0 }, { 1, 13, 0, 0, 0, 0 }, { -1, 13, 0, 0, 0, 0 }, - { -3, 12, 0, 0, 0, 0 }, { -5, 12, 0, 0, 0, 0 }, { -7, 11, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -8, 11, 0, 0, 0, 0 }, + { -3, 12, 0, 0, 0, 0 }, { -5, 12, 0, 0, 0, 0 }, { -7, 11, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -8, 11, 0, 0, 0, 0 }, { -9, 11, 0, 0, 0, 0 }, { -10, 11, 0, 0, 0, 0 }, { -11, 11, 0, 0, 0, 0 }, { -12, 11, 0, 0, 0, 0 }, { -13, 11, 0, 0, 0, 0 }, { -14, 11, 0, 0, 0, 0 }, { -15, 11, 0, 0, 0, 0 }, { -16, 11, 0, 0, 0, 0 }, { -17, 11, 0, 0, 0, 0 }, { -18, 11, 0, 0, 0, 0 }, - { -19, 11, 0, 0, 0, 0 }, { -20, 11, 0, 0, 0, 0 }, { -21, 11, 0, 0, 0, 0 }, { -22, 11, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -23, 11, 0, 0, 0, 0 }, { -23, 12, 0, 0, 0, 0 }, { -23, 13, 0, 0, 0, 0 }, { -23, 14, 0, 0, 0, 0 }, - { -23, 15, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, + { -19, 11, 0, 0, 0, 0 }, { -20, 11, 0, 0, 0, 0 }, { -21, 11, 0, 0, 0, 0 }, { -22, 11, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { -23, 11, 0, 0, 0, 0 }, { -23, 12, 0, 0, 0, 0 }, { -23, 13, 0, 0, 0, 0 }, { -23, 14, 0, 0, 0, 0 }, + { -23, 15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93E2CC, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, - { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, + { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 15, 24, 0, 8, 0, 0 }, { 15, 26, 0, 8, 0, 0 }, { 14, 28, 0, 8, 0, 0 }, { 13, 30, 0, 8, 0, 0 }, { 13, 32, 0, 8, 0, 0 }, - { 12, 34, 0, 8, 0, 0 }, { 12, 36, 0, 8, 0, 0 }, { 11, 38, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 11, 39, 0, 8, 0, 0 }, + { 12, 34, 0, 8, 0, 0 }, { 12, 36, 0, 8, 0, 0 }, { 11, 38, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 11, 39, 0, 8, 0, 0 }, { 11, 40, 0, 8, 0, 0 }, { 11, 41, 0, 8, 0, 0 }, { 11, 42, 0, 8, 0, 0 }, { 11, 43, 0, 8, 0, 0 }, { 11, 44, 0, 8, 0, 0 }, { 11, 45, 0, 8, 0, 0 }, { 11, 46, 0, 8, 0, 0 }, { 11, 47, 0, 8, 0, 0 }, { 11, 48, 0, 8, 0, 0 }, { 11, 49, 0, 8, 0, 0 }, - { 11, 50, 0, 8, 0, 0 }, { 11, 51, 0, 8, 0, 0 }, { 11, 52, 0, 8, 0, 0 }, { 11, 53, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 54, 0, 8, 0, 0 }, { 12, 54, 0, 8, 0, 0 }, { 13, 54, 0, 8, 0, 0 }, { 14, 54, 0, 8, 0, 0 }, - { 15, 54, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, + { 11, 50, 0, 8, 0, 0 }, { 11, 51, 0, 8, 0, 0 }, { 11, 52, 0, 8, 0, 0 }, { 11, 53, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, 54, 0, 8, 0, 0 }, { 12, 54, 0, 8, 0, 0 }, { 13, 54, 0, 8, 0, 0 }, { 14, 54, 0, 8, 0, 0 }, + { 15, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), }) CREATE_VEHICLE_INFO(TrackVehicleInfo_940CBD, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, - { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, + { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 24, 16, 0, 16, 0, 0 }, { 26, 16, 0, 16, 0, 0 }, { 28, 17, 0, 16, 0, 0 }, { 30, 18, 0, 16, 0, 0 }, { 32, 18, 0, 16, 0, 0 }, - { 34, 19, 0, 16, 0, 0 }, { 36, 19, 0, 16, 0, 0 }, { 38, 20, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 39, 20, 0, 16, 0, 0 }, + { 34, 19, 0, 16, 0, 0 }, { 36, 19, 0, 16, 0, 0 }, { 38, 20, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 39, 20, 0, 16, 0, 0 }, { 40, 20, 0, 16, 0, 0 }, { 41, 20, 0, 16, 0, 0 }, { 42, 20, 0, 16, 0, 0 }, { 43, 20, 0, 16, 0, 0 }, { 44, 20, 0, 16, 0, 0 }, { 45, 20, 0, 16, 0, 0 }, { 46, 20, 0, 16, 0, 0 }, { 47, 20, 0, 16, 0, 0 }, { 48, 20, 0, 16, 0, 0 }, { 49, 20, 0, 16, 0, 0 }, - { 50, 20, 0, 16, 0, 0 }, { 51, 20, 0, 16, 0, 0 }, { 52, 20, 0, 16, 0, 0 }, { 53, 20, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 54, 20, 0, 16, 0, 0 }, { 54, 19, 0, 16, 0, 0 }, { 54, 18, 0, 16, 0, 0 }, { 54, 17, 0, 16, 0, 0 }, - { 54, 16, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, + { 50, 20, 0, 16, 0, 0 }, { 51, 20, 0, 16, 0, 0 }, { 52, 20, 0, 16, 0, 0 }, { 53, 20, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 54, 20, 0, 16, 0, 0 }, { 54, 19, 0, 16, 0, 0 }, { 54, 18, 0, 16, 0, 0 }, { 54, 17, 0, 16, 0, 0 }, + { 54, 16, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9436AE, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, - { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, + { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 16, 7, 0, 24, 0, 0 }, { 16, 5, 0, 24, 0, 0 }, { 17, 3, 0, 24, 0, 0 }, { 18, 1, 0, 24, 0, 0 }, { 18, -1, 0, 24, 0, 0 }, - { 19, -3, 0, 24, 0, 0 }, { 19, -5, 0, 24, 0, 0 }, { 20, -7, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 20, -8, 0, 24, 0, 0 }, + { 19, -3, 0, 24, 0, 0 }, { 19, -5, 0, 24, 0, 0 }, { 20, -7, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 20, -8, 0, 24, 0, 0 }, { 20, -9, 0, 24, 0, 0 }, { 20, -10, 0, 24, 0, 0 }, { 20, -11, 0, 24, 0, 0 }, { 20, -12, 0, 24, 0, 0 }, { 20, -13, 0, 24, 0, 0 }, { 20, -14, 0, 24, 0, 0 }, { 20, -15, 0, 24, 0, 0 }, { 20, -16, 0, 24, 0, 0 }, { 20, -17, 0, 24, 0, 0 }, { 20, -18, 0, 24, 0, 0 }, - { 20, -19, 0, 24, 0, 0 }, { 20, -20, 0, 24, 0, 0 }, { 20, -21, 0, 24, 0, 0 }, { 20, -22, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, -23, 0, 24, 0, 0 }, { 19, -23, 0, 24, 0, 0 }, { 18, -23, 0, 24, 0, 0 }, { 17, -23, 0, 24, 0, 0 }, - { 16, -23, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, + { 20, -19, 0, 24, 0, 0 }, { 20, -20, 0, 24, 0, 0 }, { 20, -21, 0, 24, 0, 0 }, { 20, -22, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, -23, 0, 24, 0, 0 }, { 19, -23, 0, 24, 0, 0 }, { 18, -23, 0, 24, 0, 0 }, { 17, -23, 0, 24, 0, 0 }, + { 16, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9446DE, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 19, 17, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 19, 17, 0, 0, 0, 0 }, { 17, 17, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 18, 0, 0, 0, 0 }, { 11, 18, 0, 0, 0, 0 }, { 9, 18, 0, 0, 0, 0 }, { 7, 18, 0, 0, 0, 0 }, { 5, 18, 0, 0, 0, 0 }, { 4, 18, 0, 0, 0, 0 }, { 3, 19, 0, 0, 0, 0 }, { 2, 19, 0, 0, 0, 0 }, { 1, 19, 0, 0, 0, 0 }, { 0, 19, 0, 0, 0, 0 }, { -1, 19, 0, 0, 0, 0 }, { -2, 19, 0, 0, 0, 0 }, { -1, 19, 0, 0, 0, 0 }, { 0, 19, 0, 0, 0, 0 }, { 1, 19, 0, 0, 0, 0 }, { 2, 19, 0, 0, 0, 0 }, { 3, 19, 0, 0, 0, 0 }, { 4, 19, 0, 0, 0, 0 }, { 5, 19, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, { 8, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, - { 10, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, + { 10, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 0, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, { -6, 20, 0, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 15, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, { -27, 11, 0, 0, 0, 0 }, { -28, 9, 0, 0, 0, 0 }, { -26, 7, 0, 0, 0, 0 }, { -24, 5, 1, 0, 0, 0 }, { -22, 3, 1, 0, 0, 0 }, { -20, 2, 1, 0, 0, 0 }, { -18, 2, 1, 0, 0, 0 }, { -16, 3, 2, 0, 0, 0 }, { -14, 3, 2, 0, 0, 0 }, { -14, 5, 2, 0, 0, 0 }, { -13, 7, 2, 0, 0, 0 }, @@ -19757,24 +19766,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9446DE, { { -12, 19, 3, 0, 0, 0 }, { -13, 21, 3, 0, 0, 0 }, { -13, 23, 3, 0, 0, 0 }, { -13, 25, 3, 0, 0, 0 }, { -14, 27, 3, 0, 0, 0 }, { -14, 29, 3, 0, 0, 0 }, { -14, 30, 3, 0, 0, 0 }, { -14, 31, 3, 0, 0, 0 }, { -15, 32, 3, 0, 0, 0 }, { -15, 33, 3, 0, 0, 0 }, { -15, 34, 3, 0, 0, 0 }, { -15, 35, 3, 0, 0, 0 }, { -15, 36, 3, 0, 0, 0 }, { -15, 38, 0, 0, 0, 0 }, { -16, 40, 0, 0, 0, 0 }, - { -16, 41, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, 42, 0, 0, 0, 0 }, { -16, 43, 0, 0, 0, 0 }, + { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -16, 42, 0, 0, 0, 0 }, { -16, 43, 0, 0, 0, 0 }, { -16, 44, 0, 0, 0, 0 }, { -16, 45, 0, 0, 0, 0 }, { -17, 46, 0, 0, 0, 0 }, { -17, 47, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, - { -17, 49, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, + { -17, 49, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -17, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94739C, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 17, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 17, 12, 0, 8, 0, 0 }, { 17, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 18, 0, 8, 0, 0 }, { 18, 20, 0, 8, 0, 0 }, { 18, 22, 0, 8, 0, 0 }, { 18, 24, 0, 8, 0, 0 }, { 18, 26, 0, 8, 0, 0 }, { 18, 27, 0, 8, 0, 0 }, { 19, 28, 0, 8, 0, 0 }, { 19, 29, 0, 8, 0, 0 }, { 19, 30, 0, 8, 0, 0 }, { 19, 31, 0, 8, 0, 0 }, { 19, 32, 0, 8, 0, 0 }, { 19, 33, 0, 8, 0, 0 }, { 19, 32, 0, 8, 0, 0 }, { 19, 31, 0, 8, 0, 0 }, { 19, 30, 0, 8, 0, 0 }, { 19, 29, 0, 8, 0, 0 }, { 19, 28, 0, 8, 0, 0 }, { 19, 27, 0, 8, 0, 0 }, { 19, 26, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, { 20, 23, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, - { 20, 21, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, + { 20, 21, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 31, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, { 20, 37, 0, 8, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 15, 56, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, { 11, 58, 0, 8, 0, 0 }, { 9, 59, 0, 8, 0, 0 }, { 7, 57, 0, 8, 0, 0 }, { 5, 55, 1, 8, 0, 0 }, { 3, 53, 1, 8, 0, 0 }, { 2, 51, 1, 8, 0, 0 }, { 2, 49, 1, 8, 0, 0 }, { 3, 47, 2, 8, 0, 0 }, { 3, 45, 2, 8, 0, 0 }, { 5, 45, 2, 8, 0, 0 }, { 7, 44, 2, 8, 0, 0 }, @@ -19782,24 +19791,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94739C, { { 19, 43, 3, 8, 0, 0 }, { 21, 44, 3, 8, 0, 0 }, { 23, 44, 3, 8, 0, 0 }, { 25, 44, 3, 8, 0, 0 }, { 27, 45, 3, 8, 0, 0 }, { 29, 45, 3, 8, 0, 0 }, { 30, 45, 3, 8, 0, 0 }, { 31, 45, 3, 8, 0, 0 }, { 32, 46, 3, 8, 0, 0 }, { 33, 46, 3, 8, 0, 0 }, { 34, 46, 3, 8, 0, 0 }, { 35, 46, 3, 8, 0, 0 }, { 36, 46, 3, 8, 0, 0 }, { 38, 46, 0, 8, 0, 0 }, { 40, 47, 0, 8, 0, 0 }, - { 41, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 42, 47, 0, 8, 0, 0 }, { 43, 47, 0, 8, 0, 0 }, + { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 42, 47, 0, 8, 0, 0 }, { 43, 47, 0, 8, 0, 0 }, { 44, 47, 0, 8, 0, 0 }, { 45, 47, 0, 8, 0, 0 }, { 46, 48, 0, 8, 0, 0 }, { 47, 48, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, - { 49, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, + { 49, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 48, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94A05A, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 12, 14, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 12, 14, 0, 16, 0, 0 }, { 14, 14, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 13, 0, 16, 0, 0 }, { 20, 13, 0, 16, 0, 0 }, { 22, 13, 0, 16, 0, 0 }, { 24, 13, 0, 16, 0, 0 }, { 26, 13, 0, 16, 0, 0 }, { 27, 13, 0, 16, 0, 0 }, { 28, 12, 0, 16, 0, 0 }, { 29, 12, 0, 16, 0, 0 }, { 30, 12, 0, 16, 0, 0 }, { 31, 12, 0, 16, 0, 0 }, { 32, 12, 0, 16, 0, 0 }, { 33, 12, 0, 16, 0, 0 }, { 32, 12, 0, 16, 0, 0 }, { 31, 12, 0, 16, 0, 0 }, { 30, 12, 0, 16, 0, 0 }, { 29, 12, 0, 16, 0, 0 }, { 28, 12, 0, 16, 0, 0 }, { 27, 12, 0, 16, 0, 0 }, { 26, 12, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, { 23, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, - { 21, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, + { 21, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 31, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, { 37, 11, 0, 16, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 16, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, { 58, 20, 0, 16, 0, 0 }, { 59, 22, 0, 16, 0, 0 }, { 57, 24, 0, 16, 0, 0 }, { 55, 26, 1, 16, 0, 0 }, { 53, 28, 1, 16, 0, 0 }, { 51, 29, 1, 16, 0, 0 }, { 49, 29, 1, 16, 0, 0 }, { 47, 28, 2, 16, 0, 0 }, { 45, 28, 2, 16, 0, 0 }, { 45, 26, 2, 16, 0, 0 }, { 44, 24, 2, 16, 0, 0 }, @@ -19807,24 +19816,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94A05A, { { 43, 12, 3, 16, 0, 0 }, { 44, 10, 3, 16, 0, 0 }, { 44, 8, 3, 16, 0, 0 }, { 44, 6, 3, 16, 0, 0 }, { 45, 4, 3, 16, 0, 0 }, { 45, 2, 3, 16, 0, 0 }, { 45, 1, 3, 16, 0, 0 }, { 45, 0, 3, 16, 0, 0 }, { 46, -1, 3, 16, 0, 0 }, { 46, -2, 3, 16, 0, 0 }, { 46, -3, 3, 16, 0, 0 }, { 46, -4, 3, 16, 0, 0 }, { 46, -5, 3, 16, 0, 0 }, { 46, -7, 0, 16, 0, 0 }, { 47, -9, 0, 16, 0, 0 }, - { 47, -10, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, -11, 0, 16, 0, 0 }, { 47, -12, 0, 16, 0, 0 }, + { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 47, -11, 0, 16, 0, 0 }, { 47, -12, 0, 16, 0, 0 }, { 47, -13, 0, 16, 0, 0 }, { 47, -14, 0, 16, 0, 0 }, { 48, -15, 0, 16, 0, 0 }, { 48, -16, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, - { 48, -18, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, + { 48, -18, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 48, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94CD18, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 14, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 14, 19, 0, 24, 0, 0 }, { 14, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 13, 0, 24, 0, 0 }, { 13, 11, 0, 24, 0, 0 }, { 13, 9, 0, 24, 0, 0 }, { 13, 7, 0, 24, 0, 0 }, { 13, 5, 0, 24, 0, 0 }, { 13, 4, 0, 24, 0, 0 }, { 12, 3, 0, 24, 0, 0 }, { 12, 2, 0, 24, 0, 0 }, { 12, 1, 0, 24, 0, 0 }, { 12, 0, 0, 24, 0, 0 }, { 12, -1, 0, 24, 0, 0 }, { 12, -2, 0, 24, 0, 0 }, { 12, -1, 0, 24, 0, 0 }, { 12, 0, 0, 24, 0, 0 }, { 12, 1, 0, 24, 0, 0 }, { 12, 2, 0, 24, 0, 0 }, { 12, 3, 0, 24, 0, 0 }, { 12, 4, 0, 24, 0, 0 }, { 12, 5, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, { 11, 8, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, - { 11, 10, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, + { 11, 10, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 0, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, { 11, -6, 0, 24, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 16, -25, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, { 20, -27, 0, 24, 0, 0 }, { 22, -28, 0, 24, 0, 0 }, { 24, -26, 0, 24, 0, 0 }, { 26, -24, 1, 24, 0, 0 }, { 28, -22, 1, 24, 0, 0 }, { 29, -20, 1, 24, 0, 0 }, { 29, -18, 1, 24, 0, 0 }, { 28, -16, 2, 24, 0, 0 }, { 28, -14, 2, 24, 0, 0 }, { 26, -14, 2, 24, 0, 0 }, { 24, -13, 2, 24, 0, 0 }, @@ -19832,24 +19841,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94CD18, { { 12, -12, 3, 24, 0, 0 }, { 10, -13, 3, 24, 0, 0 }, { 8, -13, 3, 24, 0, 0 }, { 6, -13, 3, 24, 0, 0 }, { 4, -14, 3, 24, 0, 0 }, { 2, -14, 3, 24, 0, 0 }, { 1, -14, 3, 24, 0, 0 }, { 0, -14, 3, 24, 0, 0 }, { -1, -15, 3, 24, 0, 0 }, { -2, -15, 3, 24, 0, 0 }, { -3, -15, 3, 24, 0, 0 }, { -4, -15, 3, 24, 0, 0 }, { -5, -15, 3, 24, 0, 0 }, { -7, -15, 0, 24, 0, 0 }, { -9, -16, 0, 24, 0, 0 }, - { -10, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -11, -16, 0, 24, 0, 0 }, { -12, -16, 0, 24, 0, 0 }, + { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -11, -16, 0, 24, 0, 0 }, { -12, -16, 0, 24, 0, 0 }, { -13, -16, 0, 24, 0, 0 }, { -14, -16, 0, 24, 0, 0 }, { -15, -17, 0, 24, 0, 0 }, { -16, -17, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, - { -18, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, + { -18, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, -17, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_945D3D, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, { 17, 15, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 14, 0, 0, 0, 0 }, { 11, 14, 0, 0, 0, 0 }, { 9, 14, 0, 0, 0, 0 }, { 7, 14, 0, 0, 0, 0 }, { 5, 14, 0, 0, 0, 0 }, { 4, 14, 0, 0, 0, 0 }, { 3, 13, 0, 0, 0, 0 }, { 2, 13, 0, 0, 0, 0 }, { 1, 13, 0, 0, 0, 0 }, { 0, 13, 0, 0, 0, 0 }, { -1, 13, 0, 0, 0, 0 }, { -2, 13, 0, 0, 0, 0 }, { -1, 13, 0, 0, 0, 0 }, { 0, 13, 0, 0, 0, 0 }, { 1, 13, 0, 0, 0, 0 }, { 2, 13, 0, 0, 0, 0 }, { 3, 13, 0, 0, 0, 0 }, { 4, 13, 0, 0, 0, 0 }, { 5, 13, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 8, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, - { 10, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, + { 10, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 0, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, { -6, 12, 0, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 17, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, { -27, 21, 0, 0, 0, 0 }, { -28, 23, 0, 0, 0, 0 }, { -26, 25, 0, 0, 0, 0 }, { -24, 27, 1, 0, 0, 0 }, { -22, 29, 1, 0, 0, 0 }, { -20, 30, 1, 0, 0, 0 }, { -18, 30, 1, 0, 0, 0 }, { -16, 29, 2, 0, 0, 0 }, { -14, 29, 2, 0, 0, 0 }, { -14, 27, 2, 0, 0, 0 }, { -13, 25, 2, 0, 0, 0 }, @@ -19857,24 +19866,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_945D3D, { { -12, 13, 3, 0, 0, 0 }, { -13, 11, 3, 0, 0, 0 }, { -13, 9, 3, 0, 0, 0 }, { -13, 7, 3, 0, 0, 0 }, { -14, 5, 3, 0, 0, 0 }, { -14, 3, 3, 0, 0, 0 }, { -14, 2, 3, 0, 0, 0 }, { -14, 1, 3, 0, 0, 0 }, { -15, 0, 3, 0, 0, 0 }, { -15, -1, 3, 0, 0, 0 }, { -15, -2, 3, 0, 0, 0 }, { -15, -3, 3, 0, 0, 0 }, { -15, -4, 3, 0, 0, 0 }, { -15, -6, 0, 0, 0, 0 }, { -16, -8, 0, 0, 0, 0 }, - { -16, -9, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, -10, 0, 0, 0, 0 }, { -16, -11, 0, 0, 0, 0 }, + { -16, -9, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -16, -10, 0, 0, 0, 0 }, { -16, -11, 0, 0, 0, 0 }, { -16, -12, 0, 0, 0, 0 }, { -16, -13, 0, 0, 0, 0 }, { -17, -14, 0, 0, 0, 0 }, { -17, -15, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, - { -17, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, + { -17, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -17, -28, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9489FB, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, { 15, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 18, 0, 8, 0, 0 }, { 14, 20, 0, 8, 0, 0 }, { 14, 22, 0, 8, 0, 0 }, { 14, 24, 0, 8, 0, 0 }, { 14, 26, 0, 8, 0, 0 }, { 14, 27, 0, 8, 0, 0 }, { 13, 28, 0, 8, 0, 0 }, { 13, 29, 0, 8, 0, 0 }, { 13, 30, 0, 8, 0, 0 }, { 13, 31, 0, 8, 0, 0 }, { 13, 32, 0, 8, 0, 0 }, { 13, 33, 0, 8, 0, 0 }, { 13, 32, 0, 8, 0, 0 }, { 13, 31, 0, 8, 0, 0 }, { 13, 30, 0, 8, 0, 0 }, { 13, 29, 0, 8, 0, 0 }, { 13, 28, 0, 8, 0, 0 }, { 13, 27, 0, 8, 0, 0 }, { 13, 26, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 12, 23, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, - { 12, 21, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, + { 12, 21, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 31, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, { 12, 37, 0, 8, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 17, 56, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, { 21, 58, 0, 8, 0, 0 }, { 23, 59, 0, 8, 0, 0 }, { 25, 57, 0, 8, 0, 0 }, { 27, 55, 1, 8, 0, 0 }, { 29, 53, 1, 8, 0, 0 }, { 30, 51, 1, 8, 0, 0 }, { 30, 49, 1, 8, 0, 0 }, { 29, 47, 2, 8, 0, 0 }, { 29, 45, 2, 8, 0, 0 }, { 27, 45, 2, 8, 0, 0 }, { 25, 44, 2, 8, 0, 0 }, @@ -19882,24 +19891,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9489FB, { { 13, 43, 3, 8, 0, 0 }, { 11, 44, 3, 8, 0, 0 }, { 9, 44, 3, 8, 0, 0 }, { 7, 44, 3, 8, 0, 0 }, { 5, 45, 3, 8, 0, 0 }, { 3, 45, 3, 8, 0, 0 }, { 2, 45, 3, 8, 0, 0 }, { 1, 45, 3, 8, 0, 0 }, { 0, 46, 3, 8, 0, 0 }, { -1, 46, 3, 8, 0, 0 }, { -2, 46, 3, 8, 0, 0 }, { -3, 46, 3, 8, 0, 0 }, { -4, 46, 3, 8, 0, 0 }, { -6, 46, 0, 8, 0, 0 }, { -8, 47, 0, 8, 0, 0 }, - { -9, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -10, 47, 0, 8, 0, 0 }, { -11, 47, 0, 8, 0, 0 }, + { -9, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -10, 47, 0, 8, 0, 0 }, { -11, 47, 0, 8, 0, 0 }, { -12, 47, 0, 8, 0, 0 }, { -13, 47, 0, 8, 0, 0 }, { -14, 48, 0, 8, 0, 0 }, { -15, 48, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, - { -17, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, + { -17, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -28, 48, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94B6B9, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, { 14, 16, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 17, 0, 16, 0, 0 }, { 20, 17, 0, 16, 0, 0 }, { 22, 17, 0, 16, 0, 0 }, { 24, 17, 0, 16, 0, 0 }, { 26, 17, 0, 16, 0, 0 }, { 27, 17, 0, 16, 0, 0 }, { 28, 18, 0, 16, 0, 0 }, { 29, 18, 0, 16, 0, 0 }, { 30, 18, 0, 16, 0, 0 }, { 31, 18, 0, 16, 0, 0 }, { 32, 18, 0, 16, 0, 0 }, { 33, 18, 0, 16, 0, 0 }, { 32, 18, 0, 16, 0, 0 }, { 31, 18, 0, 16, 0, 0 }, { 30, 18, 0, 16, 0, 0 }, { 29, 18, 0, 16, 0, 0 }, { 28, 18, 0, 16, 0, 0 }, { 27, 18, 0, 16, 0, 0 }, { 26, 18, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 23, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, - { 21, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, + { 21, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 31, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, { 37, 19, 0, 16, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 14, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, { 58, 10, 0, 16, 0, 0 }, { 59, 8, 0, 16, 0, 0 }, { 57, 6, 0, 16, 0, 0 }, { 55, 4, 1, 16, 0, 0 }, { 53, 2, 1, 16, 0, 0 }, { 51, 1, 1, 16, 0, 0 }, { 49, 1, 1, 16, 0, 0 }, { 47, 2, 2, 16, 0, 0 }, { 45, 2, 2, 16, 0, 0 }, { 45, 4, 2, 16, 0, 0 }, { 44, 6, 2, 16, 0, 0 }, @@ -19907,24 +19916,24 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94B6B9, { { 43, 18, 3, 16, 0, 0 }, { 44, 20, 3, 16, 0, 0 }, { 44, 22, 3, 16, 0, 0 }, { 44, 24, 3, 16, 0, 0 }, { 45, 26, 3, 16, 0, 0 }, { 45, 28, 3, 16, 0, 0 }, { 45, 29, 3, 16, 0, 0 }, { 45, 30, 3, 16, 0, 0 }, { 46, 31, 3, 16, 0, 0 }, { 46, 32, 3, 16, 0, 0 }, { 46, 33, 3, 16, 0, 0 }, { 46, 34, 3, 16, 0, 0 }, { 46, 35, 3, 16, 0, 0 }, { 46, 37, 0, 16, 0, 0 }, { 47, 39, 0, 16, 0, 0 }, - { 47, 40, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, 41, 0, 16, 0, 0 }, { 47, 42, 0, 16, 0, 0 }, + { 47, 40, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 47, 41, 0, 16, 0, 0 }, { 47, 42, 0, 16, 0, 0 }, { 47, 43, 0, 16, 0, 0 }, { 47, 44, 0, 16, 0, 0 }, { 48, 45, 0, 16, 0, 0 }, { 48, 46, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, - { 48, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, + { 48, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 48, 59, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94E377, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, { 16, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 13, 0, 24, 0, 0 }, { 17, 11, 0, 24, 0, 0 }, { 17, 9, 0, 24, 0, 0 }, { 17, 7, 0, 24, 0, 0 }, { 17, 5, 0, 24, 0, 0 }, { 17, 4, 0, 24, 0, 0 }, { 18, 3, 0, 24, 0, 0 }, { 18, 2, 0, 24, 0, 0 }, { 18, 1, 0, 24, 0, 0 }, { 18, 0, 0, 24, 0, 0 }, { 18, -1, 0, 24, 0, 0 }, { 18, -2, 0, 24, 0, 0 }, { 18, -1, 0, 24, 0, 0 }, { 18, 0, 0, 24, 0, 0 }, { 18, 1, 0, 24, 0, 0 }, { 18, 2, 0, 24, 0, 0 }, { 18, 3, 0, 24, 0, 0 }, { 18, 4, 0, 24, 0, 0 }, { 18, 5, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 19, 8, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, - { 19, 10, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, + { 19, 10, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 0, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, { 19, -6, 0, 24, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 14, -25, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, { 10, -27, 0, 24, 0, 0 }, { 8, -28, 0, 24, 0, 0 }, { 6, -26, 0, 24, 0, 0 }, { 4, -24, 1, 24, 0, 0 }, { 2, -22, 1, 24, 0, 0 }, { 1, -20, 1, 24, 0, 0 }, { 1, -18, 1, 24, 0, 0 }, { 2, -16, 2, 24, 0, 0 }, { 2, -14, 2, 24, 0, 0 }, { 4, -14, 2, 24, 0, 0 }, { 6, -13, 2, 24, 0, 0 }, @@ -19932,515 +19941,515 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_94E377, { { 18, -12, 3, 24, 0, 0 }, { 20, -13, 3, 24, 0, 0 }, { 22, -13, 3, 24, 0, 0 }, { 24, -13, 3, 24, 0, 0 }, { 26, -14, 3, 24, 0, 0 }, { 28, -14, 3, 24, 0, 0 }, { 29, -14, 3, 24, 0, 0 }, { 30, -14, 3, 24, 0, 0 }, { 31, -15, 3, 24, 0, 0 }, { 32, -15, 3, 24, 0, 0 }, { 33, -15, 3, 24, 0, 0 }, { 34, -15, 3, 24, 0, 0 }, { 35, -15, 3, 24, 0, 0 }, { 37, -15, 0, 24, 0, 0 }, { 39, -16, 0, 24, 0, 0 }, - { 40, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 41, -16, 0, 24, 0, 0 }, { 42, -16, 0, 24, 0, 0 }, + { 40, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 41, -16, 0, 24, 0, 0 }, { 42, -16, 0, 24, 0, 0 }, { 43, -16, 0, 24, 0, 0 }, { 44, -16, 0, 24, 0, 0 }, { 45, -17, 0, 24, 0, 0 }, { 46, -17, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, - { 48, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, + { 48, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 59, -17, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_939EAF, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 18, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -9, 14, 0, 24, 0, 0 }, - { -9, 12, 0, 24, 0, 0 }, { -9, 11, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, - { -9, 11, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -9, 11, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -9, 11, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, { -11, 12, 0, 0, 0, 0 }, { -13, 12, 0, 0, 0, 0 }, + { -9, 12, 0, 24, 0, 0 }, { -9, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), + { -9, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { -9, 11, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + { -9, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -9, 12, 0, 0, 0, 0 }, { -11, 12, 0, 0, 0, 0 }, { -13, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, { -17, 12, 0, 0, 0, 0 }, { -19, 12, 0, 0, 0, 0 }, { -21, 12, 0, 0, 0, 0 }, { -23, 12, 0, 0, 0, 0 }, - { -25, 12, 0, 0, 0, 0 }, { -25, 14, 0, 8, 0, 0 }, { -25, 16, 0, 8, 0, 0 }, { -25, 18, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -25, 18, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -25, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -25, 18, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -23, 18, 0, 16, 0, 0 }, + { -25, 12, 0, 0, 0, 0 }, { -25, 14, 0, 8, 0, 0 }, { -25, 16, 0, 8, 0, 0 }, { -25, 18, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -25, 18, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { -25, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { -25, 18, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -23, 18, 0, 16, 0, 0 }, { -21, 18, 0, 16, 0, 0 }, { -19, 18, 0, 16, 0, 0 }, { -17, 18, 0, 16, 0, 0 }, { -15, 18, 0, 16, 0, 0 }, { -15, 16, 0, 8, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -15, 16, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { -15, 16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, - { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93C8A0, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 13, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 14, 40, 0, 0, 0, 0 }, - { 12, 40, 0, 0, 0, 0 }, { 11, 40, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, - { 11, 40, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 11, 40, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 11, 40, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, { 12, 42, 0, 8, 0, 0 }, { 12, 44, 0, 8, 0, 0 }, + { 12, 40, 0, 0, 0, 0 }, { 11, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), + { 11, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 11, 40, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + { 11, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 40, 0, 8, 0, 0 }, { 12, 42, 0, 8, 0, 0 }, { 12, 44, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, { 12, 48, 0, 8, 0, 0 }, { 12, 50, 0, 8, 0, 0 }, { 12, 52, 0, 8, 0, 0 }, { 12, 54, 0, 8, 0, 0 }, - { 12, 56, 0, 8, 0, 0 }, { 14, 56, 0, 16, 0, 0 }, { 16, 56, 0, 16, 0, 0 }, { 18, 56, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 18, 56, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 18, 56, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 18, 56, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 18, 54, 0, 24, 0, 0 }, + { 12, 56, 0, 8, 0, 0 }, { 14, 56, 0, 16, 0, 0 }, { 16, 56, 0, 16, 0, 0 }, { 18, 56, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 18, 56, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 18, 56, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 18, 56, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 18, 54, 0, 24, 0, 0 }, { 18, 52, 0, 24, 0, 0 }, { 18, 50, 0, 24, 0, 0 }, { 18, 48, 0, 24, 0, 0 }, { 18, 46, 0, 24, 0, 0 }, { 16, 46, 0, 16, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 46, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 16, 46, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, - { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93F291, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 13, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 40, 17, 0, 8, 0, 0 }, - { 40, 19, 0, 8, 0, 0 }, { 40, 20, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, - { 40, 20, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 40, 20, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 40, 20, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, { 42, 19, 0, 16, 0, 0 }, { 44, 19, 0, 16, 0, 0 }, + { 40, 19, 0, 8, 0, 0 }, { 40, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), + { 40, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 40, 20, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + { 40, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 40, 19, 0, 16, 0, 0 }, { 42, 19, 0, 16, 0, 0 }, { 44, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, { 48, 19, 0, 16, 0, 0 }, { 50, 19, 0, 16, 0, 0 }, { 52, 19, 0, 16, 0, 0 }, { 54, 19, 0, 16, 0, 0 }, - { 56, 19, 0, 16, 0, 0 }, { 56, 17, 0, 24, 0, 0 }, { 56, 15, 0, 24, 0, 0 }, { 56, 13, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 56, 13, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 56, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 56, 13, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 54, 13, 0, 0, 0, 0 }, + { 56, 19, 0, 16, 0, 0 }, { 56, 17, 0, 24, 0, 0 }, { 56, 15, 0, 24, 0, 0 }, { 56, 13, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 56, 13, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 56, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 56, 13, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 54, 13, 0, 0, 0, 0 }, { 52, 13, 0, 0, 0, 0 }, { 50, 13, 0, 0, 0, 0 }, { 48, 13, 0, 0, 0, 0 }, { 46, 13, 0, 0, 0, 0 }, { 46, 15, 0, 24, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 46, 15, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 46, 15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, - { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941C82, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 18, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 17, -9, 0, 16, 0, 0 }, - { 19, -9, 0, 16, 0, 0 }, { 20, -9, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, - { 20, -9, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 20, -9, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 20, -9, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, { 19, -11, 0, 24, 0, 0 }, { 19, -13, 0, 24, 0, 0 }, + { 19, -9, 0, 16, 0, 0 }, { 20, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), + { 20, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 20, -9, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + { 20, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, -9, 0, 24, 0, 0 }, { 19, -11, 0, 24, 0, 0 }, { 19, -13, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, { 19, -17, 0, 24, 0, 0 }, { 19, -19, 0, 24, 0, 0 }, { 19, -21, 0, 24, 0, 0 }, { 19, -23, 0, 24, 0, 0 }, - { 19, -25, 0, 24, 0, 0 }, { 17, -25, 0, 0, 0, 0 }, { 15, -25, 0, 0, 0, 0 }, { 13, -25, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 13, -25, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 13, -25, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 13, -25, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 13, -23, 0, 8, 0, 0 }, + { 19, -25, 0, 24, 0, 0 }, { 17, -25, 0, 0, 0, 0 }, { 15, -25, 0, 0, 0, 0 }, { 13, -25, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 13, -25, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 13, -25, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 13, -25, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 13, -23, 0, 8, 0, 0 }, { 13, -21, 0, 8, 0, 0 }, { 13, -19, 0, 8, 0, 0 }, { 13, -17, 0, 8, 0, 0 }, { 13, -15, 0, 8, 0, 0 }, { 15, -15, 0, 0, 0, 0 }, - { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, -15, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 15, -15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, - { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93ADA3, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 0, 0, 0, 0 }, { 7, 16, 0, 0, 0, 0 }, { 5, 16, 0, 0, 0, 0 }, { 3, 16, 0, 0, 0, 0 }, { 1, 16, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 16, 0, 0, 0, 0 }, { -5, 16, 0, 0, 0, 0 }, { -7, 16, 0, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -19, 14, 0, 24, 0, 0 }, - { -19, 12, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -19, 12, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -19, 12, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -19, 12, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -19, 14, 0, 8, 0, 0 }, { -19, 16, 0, 8, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, - { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -19, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -19, 12, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { -19, 12, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -19, 12, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { -19, 14, 0, 8, 0, 0 }, { -19, 16, 0, 8, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, + { -25, 16, 0, 0, 0, 0 }, { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { -27, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93D794, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 0, 8, 0, 0 }, { 16, 24, 0, 8, 0, 0 }, { 16, 26, 0, 8, 0, 0 }, { 16, 28, 0, 8, 0, 0 }, { 16, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 16, 34, 0, 8, 0, 0 }, { 16, 36, 0, 8, 0, 0 }, { 16, 38, 0, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 14, 50, 0, 0, 0, 0 }, - { 12, 50, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 12, 50, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 12, 50, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 12, 50, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 14, 50, 0, 16, 0, 0 }, { 16, 50, 0, 16, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, - { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 12, 50, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 12, 50, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 12, 50, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 12, 50, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 14, 50, 0, 16, 0, 0 }, { 16, 50, 0, 16, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, + { 16, 56, 0, 8, 0, 0 }, { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 16, 58, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_940185, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 0, 16, 0, 0 }, { 24, 15, 0, 16, 0, 0 }, { 26, 15, 0, 16, 0, 0 }, { 28, 15, 0, 16, 0, 0 }, { 30, 15, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 15, 0, 16, 0, 0 }, { 36, 15, 0, 16, 0, 0 }, { 38, 15, 0, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 50, 17, 0, 8, 0, 0 }, - { 50, 19, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 50, 19, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 50, 19, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 50, 19, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 50, 17, 0, 24, 0, 0 }, { 50, 15, 0, 24, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, - { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 50, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 50, 19, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 50, 19, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 50, 19, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 50, 17, 0, 24, 0, 0 }, { 50, 15, 0, 24, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, + { 56, 15, 0, 16, 0, 0 }, { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 58, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_942B76, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 0, 24, 0, 0 }, { 15, 7, 0, 24, 0, 0 }, { 15, 5, 0, 24, 0, 0 }, { 15, 3, 0, 24, 0, 0 }, { 15, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 15, -3, 0, 24, 0, 0 }, { 15, -5, 0, 24, 0, 0 }, { 15, -7, 0, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 17, -19, 0, 16, 0, 0 }, - { 19, -19, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 19, -19, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 19, -19, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 19, -19, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 17, -19, 0, 0, 0, 0 }, { 15, -19, 0, 0, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, - { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 19, -19, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 19, -19, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 19, -19, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 19, -19, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 17, -19, 0, 0, 0, 0 }, { 15, -19, 0, 0, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, + { 15, -25, 0, 24, 0, 0 }, { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), { 15, -27, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93BAB1, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, - { 20, 14, 0, 24, 0, 0 }, { 20, 12, 0, 24, 0, 0 }, { 20, 11, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 11, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 20, 11, 0, 24, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 20, 11, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, 12, 0, 8, 0, 0 }, { 19, 14, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, + { 20, 14, 0, 24, 0, 0 }, { 20, 12, 0, 24, 0, 0 }, { 20, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), + MINI_GOLF_STATE(Unk3), { 20, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 20, 11, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk2), { 20, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, 12, 0, 8, 0, 0 }, { 19, 14, 0, 8, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 16, 0, 0, 0, 0 }, { 11, 16, 0, 0, 0, 0 }, { 9, 16, 5, 0, 0, 0 }, { 7, 16, 5, 0, 0, 0 }, { 5, 16, 5, 0, 0, 0 }, { 3, 16, 5, 0, 0, 0 }, { 1, 16, 5, 0, 0, 0 }, { -1, 16, 5, 0, 0, 0 }, { -3, 16, 5, 0, 0, 0 }, { -5, 16, 5, 0, 0, 0 }, { -7, 16, 5, 0, 0, 0 }, { -9, 16, 0, 0, 0, 0 }, { -11, 16, 0, 0, 0, 0 }, { -13, 16, 0, 0, 0, 0 }, { -15, 16, 0, 0, 0, 0 }, { -17, 16, 0, 0, 0, 0 }, { -19, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -23, 18, 0, 8, 0, 0 }, { -23, 20, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -23, 21, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -23, 21, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -23, 21, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -23, 20, 0, 24, 0, 0 }, { -23, 18, 0, 24, 0, 0 }, { -23, 16, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -23, 16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, - { -27, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -23, 21, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -23, 21, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { -23, 21, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -23, 20, 0, 24, 0, 0 }, { -23, 18, 0, 24, 0, 0 }, { -23, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { -23, 16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -23, 16, 0, 0, 0, 0 }, { -25, 16, 0, 0, 0, 0 }, + { -27, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93E4A2, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, - { 14, 11, 0, 0, 0, 0 }, { 12, 11, 0, 0, 0, 0 }, { 11, 11, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 11, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 11, 11, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 11, 11, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 12, 0, 16, 0, 0 }, { 14, 12, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, + { 14, 11, 0, 0, 0, 0 }, { 12, 11, 0, 0, 0, 0 }, { 11, 11, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), + MINI_GOLF_STATE(Unk3), { 11, 11, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 11, 11, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk2), { 11, 11, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 12, 0, 16, 0, 0 }, { 14, 12, 0, 16, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 16, 18, 0, 8, 0, 0 }, { 16, 20, 0, 8, 0, 0 }, { 16, 22, 5, 8, 0, 0 }, { 16, 24, 5, 8, 0, 0 }, { 16, 26, 5, 8, 0, 0 }, { 16, 28, 5, 8, 0, 0 }, { 16, 30, 5, 8, 0, 0 }, { 16, 32, 5, 8, 0, 0 }, { 16, 34, 5, 8, 0, 0 }, { 16, 36, 5, 8, 0, 0 }, { 16, 38, 5, 8, 0, 0 }, { 16, 40, 0, 8, 0, 0 }, { 16, 42, 0, 8, 0, 0 }, { 16, 44, 0, 8, 0, 0 }, { 16, 46, 0, 8, 0, 0 }, { 16, 48, 0, 8, 0, 0 }, { 16, 50, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 18, 54, 0, 16, 0, 0 }, { 20, 54, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 21, 54, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 21, 54, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 21, 54, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 20, 54, 0, 0, 0, 0 }, { 18, 54, 0, 0, 0, 0 }, { 16, 54, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 54, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, - { 16, 58, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 21, 54, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 21, 54, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 21, 54, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 20, 54, 0, 0, 0, 0 }, { 18, 54, 0, 0, 0, 0 }, { 16, 54, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 16, 54, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 16, 54, 0, 8, 0, 0 }, { 16, 56, 0, 8, 0, 0 }, + { 16, 58, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_940E93, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, - { 11, 17, 0, 8, 0, 0 }, { 11, 19, 0, 8, 0, 0 }, { 11, 20, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 20, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 11, 20, 0, 8, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 11, 20, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 19, 0, 24, 0, 0 }, { 12, 17, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, + { 11, 17, 0, 8, 0, 0 }, { 11, 19, 0, 8, 0, 0 }, { 11, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), + MINI_GOLF_STATE(Unk3), { 11, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 11, 20, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk2), { 11, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 19, 0, 24, 0, 0 }, { 12, 17, 0, 24, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 15, 0, 16, 0, 0 }, { 20, 15, 0, 16, 0, 0 }, { 22, 15, 5, 16, 0, 0 }, { 24, 15, 5, 16, 0, 0 }, { 26, 15, 5, 16, 0, 0 }, { 28, 15, 5, 16, 0, 0 }, { 30, 15, 5, 16, 0, 0 }, { 32, 15, 5, 16, 0, 0 }, { 34, 15, 5, 16, 0, 0 }, { 36, 15, 5, 16, 0, 0 }, { 38, 15, 5, 16, 0, 0 }, { 40, 15, 0, 16, 0, 0 }, { 42, 15, 0, 16, 0, 0 }, { 44, 15, 0, 16, 0, 0 }, { 46, 15, 0, 16, 0, 0 }, { 48, 15, 0, 16, 0, 0 }, { 50, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 54, 13, 0, 24, 0, 0 }, { 54, 11, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 54, 10, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 54, 10, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 54, 10, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 54, 11, 0, 8, 0, 0 }, { 54, 13, 0, 8, 0, 0 }, { 54, 15, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 54, 15, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, - { 58, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 54, 10, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 54, 10, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 54, 10, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 54, 11, 0, 8, 0, 0 }, { 54, 13, 0, 8, 0, 0 }, { 54, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 54, 15, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 54, 15, 0, 16, 0, 0 }, { 56, 15, 0, 16, 0, 0 }, + { 58, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_943884, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, - { 17, 20, 0, 16, 0, 0 }, { 19, 20, 0, 16, 0, 0 }, { 20, 20, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 20, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 20, 20, 0, 16, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 20, 20, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, 19, 0, 0, 0, 0 }, { 17, 19, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, + { 17, 20, 0, 16, 0, 0 }, { 19, 20, 0, 16, 0, 0 }, { 20, 20, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), + MINI_GOLF_STATE(Unk3), { 20, 20, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 20, 20, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk2), { 20, 20, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, 19, 0, 0, 0, 0 }, { 17, 19, 0, 0, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 15, 13, 0, 24, 0, 0 }, { 15, 11, 0, 24, 0, 0 }, { 15, 9, 5, 24, 0, 0 }, { 15, 7, 5, 24, 0, 0 }, { 15, 5, 5, 24, 0, 0 }, { 15, 3, 5, 24, 0, 0 }, { 15, 1, 5, 24, 0, 0 }, { 15, -1, 5, 24, 0, 0 }, { 15, -3, 5, 24, 0, 0 }, { 15, -5, 5, 24, 0, 0 }, { 15, -7, 5, 24, 0, 0 }, { 15, -9, 0, 24, 0, 0 }, { 15, -11, 0, 24, 0, 0 }, { 15, -13, 0, 24, 0, 0 }, { 15, -15, 0, 24, 0, 0 }, { 15, -17, 0, 24, 0, 0 }, { 15, -19, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 13, -23, 0, 0, 0, 0 }, { 11, -23, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 10, -23, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 10, -23, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 10, -23, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 11, -23, 0, 16, 0, 0 }, { 13, -23, 0, 16, 0, 0 }, { 15, -23, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, -23, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, - { 15, -27, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 10, -23, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 10, -23, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 10, -23, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 11, -23, 0, 16, 0, 0 }, { 13, -23, 0, 16, 0, 0 }, { 15, -23, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), MINI_GOLF_STATE(Unk5), + { 15, -23, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 15, -23, 0, 24, 0, 0 }, { 15, -25, 0, 24, 0, 0 }, + { 15, -27, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_944AA3, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, - { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 18, 0, 8, 0, 0 }, { 15, 20, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 20, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 20, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 20, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 18, 0, 8, 0, 0 }, { 15, 20, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 20, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 13, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, { 5, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 1, 20, 0, 0, 0, 0 }, { -1, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, { -3, 22, 0, 8, 0, 0 }, { -3, 24, 0, 8, 0, 0 }, { -3, 26, 0, 8, 0, 0 }, { -3, 28, 0, 8, 0, 0 }, { -3, 30, 0, 8, 0, 0 }, { -3, 32, 0, 8, 0, 0 }, { -3, 34, 0, 8, 0, 0 }, { -3, 36, 0, 8, 0, 0 }, { -3, 38, 0, 8, 0, 0 }, { -3, 40, 0, 8, 0, 0 }, { -3, 42, 0, 8, 0, 0 }, { -5, 42, 0, 0, 0, 0 }, { -7, 42, 0, 0, 0, 0 }, { -9, 42, 0, 0, 0, 0 }, { -11, 42, 0, 0, 0, 0 }, { -13, 42, 0, 0, 0, 0 }, { -15, 42, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -17, 43, 0, 8, 0, 0 }, { -17, 45, 0, 8, 0, 0 }, { -17, 47, 0, 8, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -17, 43, 0, 8, 0, 0 }, { -17, 45, 0, 8, 0, 0 }, { -17, 47, 0, 8, 0, 0 }, { -17, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, 48, 0, 8, 0, 0 }, { -17, 50, 0, 8, 0, 0 }, { -17, 52, 0, 8, 0, 0 }, { -17, 54, 0, 8, 0, 0 }, { -17, 56, 0, 8, 0, 0 }, { -17, 58, 0, 8, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_947761, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, - { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 16, 0, 16, 0, 0 }, { 20, 16, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 20, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 20, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 20, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 16, 0, 16, 0, 0 }, { 20, 16, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 20, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 20, 18, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, { 20, 26, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 30, 0, 8, 0, 0 }, { 20, 32, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, { 22, 34, 0, 16, 0, 0 }, { 24, 34, 0, 16, 0, 0 }, { 26, 34, 0, 16, 0, 0 }, { 28, 34, 0, 16, 0, 0 }, { 30, 34, 0, 16, 0, 0 }, { 32, 34, 0, 16, 0, 0 }, { 34, 34, 0, 16, 0, 0 }, { 36, 34, 0, 16, 0, 0 }, { 38, 34, 0, 16, 0, 0 }, { 40, 34, 0, 16, 0, 0 }, { 42, 34, 0, 16, 0, 0 }, { 42, 36, 0, 8, 0, 0 }, { 42, 38, 0, 8, 0, 0 }, { 42, 40, 0, 8, 0, 0 }, { 42, 42, 0, 8, 0, 0 }, { 42, 44, 0, 8, 0, 0 }, { 42, 46, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 43, 48, 0, 16, 0, 0 }, { 45, 48, 0, 16, 0, 0 }, { 47, 48, 0, 16, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 43, 48, 0, 16, 0, 0 }, { 45, 48, 0, 16, 0, 0 }, { 47, 48, 0, 16, 0, 0 }, { 49, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 49, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 48, 0, 16, 0, 0 }, { 50, 48, 0, 16, 0, 0 }, { 52, 48, 0, 16, 0, 0 }, { 54, 48, 0, 16, 0, 0 }, { 56, 48, 0, 16, 0, 0 }, { 58, 48, 0, 16, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94A41F, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, - { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 13, 0, 24, 0, 0 }, { 16, 11, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 11, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 11, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 11, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 13, 0, 24, 0, 0 }, { 16, 11, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 11, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 18, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, { 26, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 30, 11, 0, 16, 0, 0 }, { 32, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, { 34, 9, 0, 24, 0, 0 }, { 34, 7, 0, 24, 0, 0 }, { 34, 5, 0, 24, 0, 0 }, { 34, 3, 0, 24, 0, 0 }, { 34, 1, 0, 24, 0, 0 }, { 34, -1, 0, 24, 0, 0 }, { 34, -3, 0, 24, 0, 0 }, { 34, -5, 0, 24, 0, 0 }, { 34, -7, 0, 24, 0, 0 }, { 34, -9, 0, 24, 0, 0 }, { 34, -11, 0, 24, 0, 0 }, { 36, -11, 0, 16, 0, 0 }, { 38, -11, 0, 16, 0, 0 }, { 40, -11, 0, 16, 0, 0 }, { 42, -11, 0, 16, 0, 0 }, { 44, -11, 0, 16, 0, 0 }, { 46, -11, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 48, -12, 0, 24, 0, 0 }, { 48, -14, 0, 24, 0, 0 }, { 48, -16, 0, 24, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 48, -12, 0, 24, 0, 0 }, { 48, -14, 0, 24, 0, 0 }, { 48, -16, 0, 24, 0, 0 }, { 48, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, -17, 0, 24, 0, 0 }, { 48, -19, 0, 24, 0, 0 }, { 48, -21, 0, 24, 0, 0 }, { 48, -23, 0, 24, 0, 0 }, { 48, -25, 0, 24, 0, 0 }, { 48, -27, 0, 24, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94D0DD, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, - { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 15, 0, 0, 0, 0 }, { 11, 15, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 11, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 11, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 11, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 15, 0, 0, 0, 0 }, { 11, 15, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 11, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 11, 13, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, { 11, 5, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 1, 0, 24, 0, 0 }, { 11, -1, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, { 9, -3, 0, 0, 0, 0 }, { 7, -3, 0, 0, 0, 0 }, { 5, -3, 0, 0, 0, 0 }, { 3, -3, 0, 0, 0, 0 }, { 1, -3, 0, 0, 0, 0 }, { -1, -3, 0, 0, 0, 0 }, { -3, -3, 0, 0, 0, 0 }, { -5, -3, 0, 0, 0, 0 }, { -7, -3, 0, 0, 0, 0 }, { -9, -3, 0, 0, 0, 0 }, { -11, -3, 0, 0, 0, 0 }, { -11, -5, 0, 24, 0, 0 }, { -11, -7, 0, 24, 0, 0 }, { -11, -9, 0, 24, 0, 0 }, { -11, -11, 0, 24, 0, 0 }, { -11, -13, 0, 24, 0, 0 }, { -11, -15, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -12, -17, 0, 0, 0, 0 }, { -14, -17, 0, 0, 0, 0 }, { -16, -17, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -12, -17, 0, 0, 0, 0 }, { -14, -17, 0, 0, 0, 0 }, { -16, -17, 0, 0, 0, 0 }, { -18, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -18, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -17, 0, 0, 0, 0 }, { -19, -17, 0, 0, 0, 0 }, { -21, -17, 0, 0, 0, 0 }, { -23, -17, 0, 0, 0, 0 }, { -25, -17, 0, 0, 0, 0 }, { -27, -17, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_946102, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 27, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 27, 16, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, - { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 14, 0, 24, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 12, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 12, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, { 29, 16, 0, 0, 0, 0 }, { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 27, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 27, 16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 27, 16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 25, 16, 0, 0, 0, 0 }, { 23, 16, 0, 0, 0, 0 }, { 21, 16, 0, 0, 0, 0 }, { 19, 16, 0, 0, 0, 0 }, + { 17, 16, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 15, 14, 0, 24, 0, 0 }, { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 13, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 5, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 1, 12, 0, 0, 0, 0 }, { -1, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, { -3, 10, 0, 24, 0, 0 }, { -3, 8, 0, 24, 0, 0 }, { -3, 6, 0, 24, 0, 0 }, { -3, 4, 0, 24, 0, 0 }, { -3, 2, 0, 24, 0, 0 }, { -3, 0, 0, 24, 0, 0 }, { -3, -2, 0, 24, 0, 0 }, { -3, -4, 0, 24, 0, 0 }, { -3, -6, 0, 24, 0, 0 }, { -3, -8, 0, 24, 0, 0 }, { -3, -10, 0, 24, 0, 0 }, { -5, -10, 0, 0, 0, 0 }, { -7, -10, 0, 0, 0, 0 }, { -9, -10, 0, 0, 0, 0 }, { -11, -10, 0, 0, 0, 0 }, { -13, -10, 0, 0, 0, 0 }, { -15, -10, 0, 0, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -16, -9, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -17, -11, 0, 24, 0, 0 }, { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -17, -16, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { -16, -9, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -17, -11, 0, 24, 0, 0 }, { -17, -13, 0, 24, 0, 0 }, { -17, -15, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -17, -16, 0, 24, 0, 0 }, { -17, -18, 0, 24, 0, 0 }, { -17, -20, 0, 24, 0, 0 }, { -17, -22, 0, 24, 0, 0 }, { -17, -24, 0, 24, 0, 0 }, { -17, -26, 0, 24, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_948DC0, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 4, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 4, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, - { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 16, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 12, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 12, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, { 16, 2, 0, 8, 0, 0 }, { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 16, 4, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 16, 4, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 4, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 16, 6, 0, 8, 0, 0 }, { 16, 8, 0, 8, 0, 0 }, { 16, 10, 0, 8, 0, 0 }, { 16, 12, 0, 8, 0, 0 }, + { 16, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 16, 0, 0, 0, 0 }, { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 12, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 18, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 12, 26, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 30, 0, 8, 0, 0 }, { 12, 32, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, { 10, 34, 0, 0, 0, 0 }, { 8, 34, 0, 0, 0, 0 }, { 6, 34, 0, 0, 0, 0 }, { 4, 34, 0, 0, 0, 0 }, { 2, 34, 0, 0, 0, 0 }, { 0, 34, 0, 0, 0, 0 }, { -2, 34, 0, 0, 0, 0 }, { -4, 34, 0, 0, 0, 0 }, { -6, 34, 0, 0, 0, 0 }, { -8, 34, 0, 0, 0, 0 }, { -10, 34, 0, 0, 0, 0 }, { -10, 36, 0, 8, 0, 0 }, { -10, 38, 0, 8, 0, 0 }, { -10, 40, 0, 8, 0, 0 }, { -10, 42, 0, 8, 0, 0 }, { -10, 44, 0, 8, 0, 0 }, { -10, 46, 0, 8, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -9, 47, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -11, 48, 0, 0, 0, 0 }, { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -16, 48, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { -9, 47, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -11, 48, 0, 0, 0, 0 }, { -13, 48, 0, 0, 0, 0 }, { -15, 48, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { -17, 48, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { -16, 48, 0, 0, 0, 0 }, { -18, 48, 0, 0, 0, 0 }, { -20, 48, 0, 0, 0, 0 }, { -22, 48, 0, 0, 0, 0 }, { -24, 48, 0, 0, 0, 0 }, { -26, 48, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94BA7E, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 4, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 4, 15, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, - { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 17, 0, 8, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 19, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 16, 19, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, { 2, 15, 0, 16, 0, 0 }, { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 4, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 4, 15, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 4, 15, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 6, 15, 0, 16, 0, 0 }, { 8, 15, 0, 16, 0, 0 }, { 10, 15, 0, 16, 0, 0 }, { 12, 15, 0, 16, 0, 0 }, + { 14, 15, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 16, 17, 0, 8, 0, 0 }, { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 19, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 18, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 26, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 30, 19, 0, 16, 0, 0 }, { 32, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, { 34, 21, 0, 8, 0, 0 }, { 34, 23, 0, 8, 0, 0 }, { 34, 25, 0, 8, 0, 0 }, { 34, 27, 0, 8, 0, 0 }, { 34, 29, 0, 8, 0, 0 }, { 34, 31, 0, 8, 0, 0 }, { 34, 33, 0, 8, 0, 0 }, { 34, 35, 0, 8, 0, 0 }, { 34, 37, 0, 8, 0, 0 }, { 34, 39, 0, 8, 0, 0 }, { 34, 41, 0, 8, 0, 0 }, { 36, 41, 0, 16, 0, 0 }, { 38, 41, 0, 16, 0, 0 }, { 40, 41, 0, 16, 0, 0 }, { 42, 41, 0, 16, 0, 0 }, { 44, 41, 0, 16, 0, 0 }, { 46, 41, 0, 16, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 47, 40, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 48, 42, 0, 8, 0, 0 }, { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 48, 47, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 47, 40, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 48, 42, 0, 8, 0, 0 }, { 48, 44, 0, 8, 0, 0 }, { 48, 46, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 48, 47, 0, 8, 0, 0 }, { 48, 49, 0, 8, 0, 0 }, { 48, 51, 0, 8, 0, 0 }, { 48, 53, 0, 8, 0, 0 }, { 48, 55, 0, 8, 0, 0 }, { 48, 57, 0, 8, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94E73C, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 5, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 15, 27, 0, 24, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 27, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, - { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 15, 0, 16, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 19, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 4, 2, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, - { 19, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, { 15, 29, 0, 24, 0, 0 }, { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk2), { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallUp), MINI_GOLF_STATE(Unk5), + { 15, 27, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), { 15, 27, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 27, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 15, 25, 0, 24, 0, 0 }, { 15, 23, 0, 24, 0, 0 }, { 15, 21, 0, 24, 0, 0 }, { 15, 19, 0, 24, 0, 0 }, + { 15, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 15, 0, 16, 0, 0 }, { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_ANIMATION(SwingLeft), + MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), MINI_GOLF_STATE(Unk5), + { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 19, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, 13, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 19, 5, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 1, 0, 24, 0, 0 }, { 19, -1, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, { 21, -3, 0, 16, 0, 0 }, { 23, -3, 0, 16, 0, 0 }, { 25, -3, 0, 16, 0, 0 }, { 27, -3, 0, 16, 0, 0 }, { 29, -3, 0, 16, 0, 0 }, { 31, -3, 0, 16, 0, 0 }, { 33, -3, 0, 16, 0, 0 }, { 35, -3, 0, 16, 0, 0 }, { 37, -3, 0, 16, 0, 0 }, { 39, -3, 0, 16, 0, 0 }, { 41, -3, 0, 16, 0, 0 }, { 41, -5, 0, 24, 0, 0 }, { 41, -7, 0, 24, 0, 0 }, { 41, -9, 0, 24, 0, 0 }, { 41, -11, 0, 24, 0, 0 }, { 41, -13, 0, 24, 0, 0 }, { 41, -15, 0, 24, 0, 0 }, - { -32768, 4, 2, 0, 0, 0 }, { -32768, 5, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 4, 6, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 40, -16, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 42, -17, 0, 16, 0, 0 }, { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { -32768, 4, 3, 0, 0, 0 }, - { -32768, 5, 0, 0, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { 47, -17, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(SwingLeft), MINI_GOLF_STATE(Unk5), MINI_GOLF_STATE(Unk3), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PuttLeft), + MINI_GOLF_STATE(Unk5), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 40, -16, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 42, -17, 0, 16, 0, 0 }, { 44, -17, 0, 16, 0, 0 }, { 46, -17, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PickupBall), + MINI_GOLF_STATE(Unk5), { 48, -17, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk6), { 47, -17, 0, 16, 0, 0 }, { 49, -17, 0, 16, 0, 0 }, { 51, -17, 0, 16, 0, 0 }, { 53, -17, 0, 16, 0, 0 }, { 55, -17, 0, 16, 0, 0 }, { 57, -17, 0, 16, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93A1F6, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 23, 15, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 23, 15, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 19, 14, 0, 0, 0, 0 }, { 17, 13, 0, 0, 0, 0 }, { 15, 13, 0, 0, 0, 0 }, { 14, 13, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 10, 11, 0, 0, 0, 0 }, { 9, 11, 0, 0, 0, 0 }, { 8, 11, 0, 0, 0, 0 }, { 7, 10, 0, 0, 0, 0 }, { 6, 10, 0, 0, 0, 0 }, { 5, 10, 0, 0, 0, 0 }, { 4, 9, 0, 0, 0, 0 }, { 3, 9, 0, 0, 0, 0 }, { 2, 9, 0, 0, 0, 0 }, { 1, 8, 0, 0, 0, 0 }, { 0, 8, 0, 0, 0, 0 }, { 0, 8, 0, 0, 0, 0 }, { -1, 9, 0, 0, 0, 0 }, { -2, 9, 0, 0, 0, 0 }, { -3, 9, 0, 0, 0, 0 }, { -4, 10, 0, 0, 0, 0 }, { -5, 10, 0, 0, 0, 0 }, { -6, 10, 0, 0, 0, 0 }, - { -7, 11, 0, 0, 0, 0 }, { -8, 11, 0, 0, 0, 0 }, { -9, 11, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -7, 11, 0, 0, 0, 0 }, { -8, 11, 0, 0, 0, 0 }, { -9, 11, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -10, 11, 0, 0, 0, 0 }, { -11, 11, 0, 0, 0, 0 }, { -13, 12, 0, 0, 0, 0 }, { -14, 13, 0, 0, 0, 0 }, { -15, 13, 0, 0, 0, 0 }, { -16, 14, 0, 0, 0, 0 }, { -17, 14, 0, 0, 0, 0 }, { -18, 15, 0, 0, 0, 0 }, { -19, 15, 0, 0, 0, 0 }, { -20, 16, 0, 0, 0, 0 }, - { -21, 16, 0, 0, 0, 0 }, { -22, 17, 0, 0, 0, 0 }, { -23, 17, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -21, 16, 0, 0, 0, 0 }, { -22, 17, 0, 0, 0, 0 }, { -23, 17, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -24, 18, 0, 0, 0, 0 }, { -23, 18, 0, 0, 0, 0 }, { -22, 18, 0, 0, 0, 0 }, { -21, 18, 0, 0, 0, 0 }, { -20, 18, 0, 0, 0, 0 }, - { -19, 18, 0, 0, 0, 0 }, { -18, 18, 0, 0, 0, 0 }, { -17, 18, 0, 0, 0, 0 }, { -16, 18, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -19, 18, 0, 0, 0, 0 }, { -18, 18, 0, 0, 0, 0 }, { -17, 18, 0, 0, 0, 0 }, { -16, 18, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93CBE7, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 15, 8, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 15, 8, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 14, 12, 0, 8, 0, 0 }, { 13, 14, 0, 8, 0, 0 }, { 13, 16, 0, 8, 0, 0 }, { 13, 17, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 11, 21, 0, 8, 0, 0 }, { 11, 22, 0, 8, 0, 0 }, { 11, 23, 0, 8, 0, 0 }, { 10, 24, 0, 8, 0, 0 }, { 10, 25, 0, 8, 0, 0 }, { 10, 26, 0, 8, 0, 0 }, { 9, 27, 0, 8, 0, 0 }, { 9, 28, 0, 8, 0, 0 }, { 9, 29, 0, 8, 0, 0 }, { 8, 30, 0, 8, 0, 0 }, { 8, 31, 0, 8, 0, 0 }, { 8, 31, 0, 8, 0, 0 }, { 9, 32, 0, 8, 0, 0 }, { 9, 33, 0, 8, 0, 0 }, { 9, 34, 0, 8, 0, 0 }, { 10, 35, 0, 8, 0, 0 }, { 10, 36, 0, 8, 0, 0 }, { 10, 37, 0, 8, 0, 0 }, - { 11, 38, 0, 8, 0, 0 }, { 11, 39, 0, 8, 0, 0 }, { 11, 40, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 11, 38, 0, 8, 0, 0 }, { 11, 39, 0, 8, 0, 0 }, { 11, 40, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 11, 41, 0, 8, 0, 0 }, { 11, 42, 0, 8, 0, 0 }, { 12, 44, 0, 8, 0, 0 }, { 13, 45, 0, 8, 0, 0 }, { 13, 46, 0, 8, 0, 0 }, { 14, 47, 0, 8, 0, 0 }, { 14, 48, 0, 8, 0, 0 }, { 15, 49, 0, 8, 0, 0 }, { 15, 50, 0, 8, 0, 0 }, { 16, 51, 0, 8, 0, 0 }, - { 16, 52, 0, 8, 0, 0 }, { 17, 53, 0, 8, 0, 0 }, { 17, 54, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 16, 52, 0, 8, 0, 0 }, { 17, 53, 0, 8, 0, 0 }, { 17, 54, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 18, 55, 0, 8, 0, 0 }, { 18, 54, 0, 8, 0, 0 }, { 18, 53, 0, 8, 0, 0 }, { 18, 52, 0, 8, 0, 0 }, { 18, 51, 0, 8, 0, 0 }, - { 18, 50, 0, 8, 0, 0 }, { 18, 49, 0, 8, 0, 0 }, { 18, 48, 0, 8, 0, 0 }, { 18, 47, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 18, 50, 0, 8, 0, 0 }, { 18, 49, 0, 8, 0, 0 }, { 18, 48, 0, 8, 0, 0 }, { 18, 47, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93F5D8, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 8, 16, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 8, 16, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 12, 17, 0, 16, 0, 0 }, { 14, 18, 0, 16, 0, 0 }, { 16, 18, 0, 16, 0, 0 }, { 17, 18, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 21, 20, 0, 16, 0, 0 }, { 22, 20, 0, 16, 0, 0 }, { 23, 20, 0, 16, 0, 0 }, { 24, 21, 0, 16, 0, 0 }, { 25, 21, 0, 16, 0, 0 }, { 26, 21, 0, 16, 0, 0 }, { 27, 22, 0, 16, 0, 0 }, { 28, 22, 0, 16, 0, 0 }, { 29, 22, 0, 16, 0, 0 }, { 30, 23, 0, 16, 0, 0 }, { 31, 23, 0, 16, 0, 0 }, { 31, 23, 0, 16, 0, 0 }, { 32, 22, 0, 16, 0, 0 }, { 33, 22, 0, 16, 0, 0 }, { 34, 22, 0, 16, 0, 0 }, { 35, 21, 0, 16, 0, 0 }, { 36, 21, 0, 16, 0, 0 }, { 37, 21, 0, 16, 0, 0 }, - { 38, 20, 0, 16, 0, 0 }, { 39, 20, 0, 16, 0, 0 }, { 40, 20, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 38, 20, 0, 16, 0, 0 }, { 39, 20, 0, 16, 0, 0 }, { 40, 20, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 41, 20, 0, 16, 0, 0 }, { 42, 20, 0, 16, 0, 0 }, { 44, 19, 0, 16, 0, 0 }, { 45, 18, 0, 16, 0, 0 }, { 46, 18, 0, 16, 0, 0 }, { 47, 17, 0, 16, 0, 0 }, { 48, 17, 0, 16, 0, 0 }, { 49, 16, 0, 16, 0, 0 }, { 50, 16, 0, 16, 0, 0 }, { 51, 15, 0, 16, 0, 0 }, - { 52, 15, 0, 16, 0, 0 }, { 53, 14, 0, 16, 0, 0 }, { 54, 14, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 52, 15, 0, 16, 0, 0 }, { 53, 14, 0, 16, 0, 0 }, { 54, 14, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 55, 13, 0, 16, 0, 0 }, { 54, 13, 0, 16, 0, 0 }, { 53, 13, 0, 16, 0, 0 }, { 52, 13, 0, 16, 0, 0 }, { 51, 13, 0, 16, 0, 0 }, - { 50, 13, 0, 16, 0, 0 }, { 49, 13, 0, 16, 0, 0 }, { 48, 13, 0, 16, 0, 0 }, { 47, 13, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 50, 13, 0, 16, 0, 0 }, { 49, 13, 0, 16, 0, 0 }, { 48, 13, 0, 16, 0, 0 }, { 47, 13, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_941FC9, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 16, 23, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 16, 23, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 17, 19, 0, 24, 0, 0 }, { 18, 17, 0, 24, 0, 0 }, { 18, 15, 0, 24, 0, 0 }, { 18, 14, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 20, 10, 0, 24, 0, 0 }, { 20, 9, 0, 24, 0, 0 }, { 20, 8, 0, 24, 0, 0 }, { 21, 7, 0, 24, 0, 0 }, { 21, 6, 0, 24, 0, 0 }, { 21, 5, 0, 24, 0, 0 }, { 22, 4, 0, 24, 0, 0 }, { 22, 3, 0, 24, 0, 0 }, { 22, 2, 0, 24, 0, 0 }, { 23, 1, 0, 24, 0, 0 }, { 23, 0, 0, 24, 0, 0 }, { 23, 0, 0, 24, 0, 0 }, { 22, -1, 0, 24, 0, 0 }, { 22, -2, 0, 24, 0, 0 }, { 22, -3, 0, 24, 0, 0 }, { 21, -4, 0, 24, 0, 0 }, { 21, -5, 0, 24, 0, 0 }, { 21, -6, 0, 24, 0, 0 }, - { 20, -7, 0, 24, 0, 0 }, { 20, -8, 0, 24, 0, 0 }, { 20, -9, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 20, -7, 0, 24, 0, 0 }, { 20, -8, 0, 24, 0, 0 }, { 20, -9, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 20, -10, 0, 24, 0, 0 }, { 20, -11, 0, 24, 0, 0 }, { 19, -13, 0, 24, 0, 0 }, { 18, -14, 0, 24, 0, 0 }, { 18, -15, 0, 24, 0, 0 }, { 17, -16, 0, 24, 0, 0 }, { 17, -17, 0, 24, 0, 0 }, { 16, -18, 0, 24, 0, 0 }, { 16, -19, 0, 24, 0, 0 }, { 15, -20, 0, 24, 0, 0 }, - { 15, -21, 0, 24, 0, 0 }, { 14, -22, 0, 24, 0, 0 }, { 14, -23, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 15, -21, 0, 24, 0, 0 }, { 14, -22, 0, 24, 0, 0 }, { 14, -23, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 13, -24, 0, 24, 0, 0 }, { 13, -23, 0, 24, 0, 0 }, { 13, -22, 0, 24, 0, 0 }, { 13, -21, 0, 24, 0, 0 }, { 13, -20, 0, 24, 0, 0 }, - { 13, -19, 0, 24, 0, 0 }, { 13, -18, 0, 24, 0, 0 }, { 13, -17, 0, 24, 0, 0 }, { 13, -16, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 13, -19, 0, 24, 0, 0 }, { 13, -18, 0, 24, 0, 0 }, { 13, -17, 0, 24, 0, 0 }, { 13, -16, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93B01B, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 25, 16, 0, 0, 0, 0 }, { 22, 16, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, { 16, 15, 0, 0, 0, 0 }, { 13, 14, 0, 0, 0, 0 }, { 10, 14, 0, 0, 0, 0 }, { 7, 13, 0, 0, 0, 0 }, { 4, 13, 0, 0, 0, 0 }, { 1, 12, 0, 0, 0, 0 }, { -2, 12, 0, 0, 0, 0 }, { -2, 15, 0, 0, 0, 0 }, { -2, 18, 0, 0, 0, 0 }, { -2, 21, 0, 0, 0, 0 }, { -2, 24, 0, 0, 0, 0 }, { -2, 26, 0, 0, 0, 0 }, { -4, 26, 0, 0, 0, 0 }, { -6, 26, 0, 0, 0, 0 }, { -8, 26, 0, 0, 0, 0 }, @@ -20450,15 +20459,15 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93B01B, { { -24, 14, 0, 0, 0, 0 }, { -25, 14, 0, 0, 0, 0 }, { -26, 14, 0, 0, 0, 0 }, { -27, 14, 0, 0, 0, 0 }, { -28, 14, 0, 0, 0, 0 }, { -29, 14, 0, 0, 0, 0 }, { -30, 14, 0, 0, 0, 0 }, { -31, 14, 0, 0, 0, 0 }, { -30, 14, 0, 0, 0, 0 }, { -29, 14, 0, 0, 0, 0 }, { -28, 14, 0, 0, 0, 0 }, { -27, 13, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, { -25, 13, 0, 0, 0, 0 }, { -24, 13, 0, 0, 0, 0 }, - { -23, 13, 0, 0, 0, 0 }, { -22, 12, 0, 0, 0, 0 }, { -21, 12, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -23, 13, 0, 0, 0, 0 }, { -22, 12, 0, 0, 0, 0 }, { -21, 12, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -20, 12, 0, 0, 0, 0 }, { -21, 12, 0, 0, 0, 0 }, { -22, 13, 0, 0, 0, 0 }, { -23, 14, 0, 0, 0, 0 }, { -24, 14, 0, 0, 0, 0 }, - { -25, 15, 0, 0, 0, 0 }, { -26, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -25, 15, 0, 0, 0, 0 }, { -26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93DA0C, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 6, 0, 8, 0, 0 }, { 16, 9, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, { 15, 15, 0, 8, 0, 0 }, { 14, 18, 0, 8, 0, 0 }, { 14, 21, 0, 8, 0, 0 }, { 13, 24, 0, 8, 0, 0 }, { 13, 27, 0, 8, 0, 0 }, { 12, 30, 0, 8, 0, 0 }, { 12, 33, 0, 8, 0, 0 }, { 15, 33, 0, 8, 0, 0 }, { 18, 33, 0, 8, 0, 0 }, { 21, 33, 0, 8, 0, 0 }, { 24, 33, 0, 8, 0, 0 }, { 26, 33, 0, 8, 0, 0 }, { 26, 35, 0, 8, 0, 0 }, { 26, 37, 0, 8, 0, 0 }, { 26, 39, 0, 8, 0, 0 }, @@ -20468,15 +20477,15 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_93DA0C, { { 14, 55, 0, 8, 0, 0 }, { 14, 56, 0, 8, 0, 0 }, { 14, 57, 0, 8, 0, 0 }, { 14, 58, 0, 8, 0, 0 }, { 14, 59, 0, 8, 0, 0 }, { 14, 60, 0, 8, 0, 0 }, { 14, 61, 0, 8, 0, 0 }, { 14, 62, 0, 8, 0, 0 }, { 14, 61, 0, 8, 0, 0 }, { 14, 60, 0, 8, 0, 0 }, { 14, 59, 0, 8, 0, 0 }, { 13, 58, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, { 13, 56, 0, 8, 0, 0 }, { 13, 55, 0, 8, 0, 0 }, - { 13, 54, 0, 8, 0, 0 }, { 12, 53, 0, 8, 0, 0 }, { 12, 52, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 13, 54, 0, 8, 0, 0 }, { 12, 53, 0, 8, 0, 0 }, { 12, 52, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 12, 51, 0, 8, 0, 0 }, { 12, 52, 0, 8, 0, 0 }, { 13, 53, 0, 8, 0, 0 }, { 14, 54, 0, 8, 0, 0 }, { 14, 55, 0, 8, 0, 0 }, - { 15, 56, 0, 8, 0, 0 }, { 16, 57, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 15, 56, 0, 8, 0, 0 }, { 16, 57, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9403FD, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 6, 15, 0, 16, 0, 0 }, { 9, 15, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, { 15, 16, 0, 16, 0, 0 }, { 18, 17, 0, 16, 0, 0 }, { 21, 17, 0, 16, 0, 0 }, { 24, 18, 0, 16, 0, 0 }, { 27, 18, 0, 16, 0, 0 }, { 30, 19, 0, 16, 0, 0 }, { 33, 19, 0, 16, 0, 0 }, { 33, 16, 0, 16, 0, 0 }, { 33, 13, 0, 16, 0, 0 }, { 33, 10, 0, 16, 0, 0 }, { 33, 7, 0, 16, 0, 0 }, { 33, 5, 0, 16, 0, 0 }, { 35, 5, 0, 16, 0, 0 }, { 37, 5, 0, 16, 0, 0 }, { 39, 5, 0, 16, 0, 0 }, @@ -20486,15 +20495,15 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_9403FD, { { 55, 17, 0, 16, 0, 0 }, { 56, 17, 0, 16, 0, 0 }, { 57, 17, 0, 16, 0, 0 }, { 58, 17, 0, 16, 0, 0 }, { 59, 17, 0, 16, 0, 0 }, { 60, 17, 0, 16, 0, 0 }, { 61, 17, 0, 16, 0, 0 }, { 62, 17, 0, 16, 0, 0 }, { 61, 17, 0, 16, 0, 0 }, { 60, 17, 0, 16, 0, 0 }, { 59, 17, 0, 16, 0, 0 }, { 58, 18, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, { 56, 18, 0, 16, 0, 0 }, { 55, 18, 0, 16, 0, 0 }, - { 54, 18, 0, 16, 0, 0 }, { 53, 19, 0, 16, 0, 0 }, { 52, 19, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 54, 18, 0, 16, 0, 0 }, { 53, 19, 0, 16, 0, 0 }, { 52, 19, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 51, 19, 0, 16, 0, 0 }, { 52, 19, 0, 16, 0, 0 }, { 53, 18, 0, 16, 0, 0 }, { 54, 17, 0, 16, 0, 0 }, { 55, 17, 0, 16, 0, 0 }, - { 56, 16, 0, 16, 0, 0 }, { 57, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 56, 16, 0, 16, 0, 0 }, { 57, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_942DEE, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 25, 0, 24, 0, 0 }, { 15, 22, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, { 16, 16, 0, 24, 0, 0 }, { 17, 13, 0, 24, 0, 0 }, { 17, 10, 0, 24, 0, 0 }, { 18, 7, 0, 24, 0, 0 }, { 18, 4, 0, 24, 0, 0 }, { 19, 1, 0, 24, 0, 0 }, { 19, -2, 0, 24, 0, 0 }, { 16, -2, 0, 24, 0, 0 }, { 13, -2, 0, 24, 0, 0 }, { 10, -2, 0, 24, 0, 0 }, { 7, -2, 0, 24, 0, 0 }, { 5, -2, 0, 24, 0, 0 }, { 5, -4, 0, 24, 0, 0 }, { 5, -6, 0, 24, 0, 0 }, { 5, -8, 0, 24, 0, 0 }, @@ -20504,406 +20513,406 @@ CREATE_VEHICLE_INFO(TrackVehicleInfo_942DEE, { { 17, -24, 0, 24, 0, 0 }, { 17, -25, 0, 24, 0, 0 }, { 17, -26, 0, 24, 0, 0 }, { 17, -27, 0, 24, 0, 0 }, { 17, -28, 0, 24, 0, 0 }, { 17, -29, 0, 24, 0, 0 }, { 17, -30, 0, 24, 0, 0 }, { 17, -31, 0, 24, 0, 0 }, { 17, -30, 0, 24, 0, 0 }, { 17, -29, 0, 24, 0, 0 }, { 17, -28, 0, 24, 0, 0 }, { 18, -27, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, { 18, -25, 0, 24, 0, 0 }, { 18, -24, 0, 24, 0, 0 }, - { 18, -23, 0, 24, 0, 0 }, { 19, -22, 0, 24, 0, 0 }, { 19, -21, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 18, -23, 0, 24, 0, 0 }, { 19, -22, 0, 24, 0, 0 }, { 19, -21, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 19, -20, 0, 24, 0, 0 }, { 19, -21, 0, 24, 0, 0 }, { 18, -22, 0, 24, 0, 0 }, { 17, -23, 0, 24, 0, 0 }, { 17, -24, 0, 24, 0, 0 }, - { 16, -25, 0, 24, 0, 0 }, { 15, -26, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, - { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 16, -25, 0, 24, 0, 0 }, { 15, -26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93BDCB, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 18, 14, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 18, 14, 0, 0, 0, 0 }, { 16, 14, 0, 0, 0, 0 }, { 14, 14, 0, 0, 0, 0 }, { 12, 13, 0, 0, 0, 0 }, { 10, 13, 0, 0, 0, 0 }, { 9, 13, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, { 14, 12, 0, 0, 0, 0 }, { 15, 12, 0, 0, 0, 0 }, - { 16, 12, 0, 0, 0, 0 }, { 17, 11, 0, 0, 0, 0 }, { 18, 11, 0, 0, 0, 0 }, { 19, 11, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 11, 0, 0, 0, 0 }, { 18, 11, 0, 0, 0, 0 }, { 16, 11, 0, 0, 0, 0 }, { 14, 11, 0, 0, 0, 0 }, - { 12, 11, 0, 0, 0, 0 }, { 10, 11, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 5, 13, 0, 0, 0, 0 }, + { 16, 12, 0, 0, 0, 0 }, { 17, 11, 0, 0, 0, 0 }, { 18, 11, 0, 0, 0, 0 }, { 19, 11, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, 11, 0, 0, 0, 0 }, { 18, 11, 0, 0, 0, 0 }, { 16, 11, 0, 0, 0, 0 }, { 14, 11, 0, 0, 0, 0 }, + { 12, 11, 0, 0, 0, 0 }, { 10, 11, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 7, 12, 0, 0, 0, 0 }, { 5, 13, 0, 0, 0, 0 }, { 3, 14, 0, 0, 0, 0 }, { 1, 15, 0, 0, 0, 0 }, { -1, 16, 0, 0, 0, 0 }, { -3, 17, 0, 0, 0, 0 }, { -5, 18, 0, 0, 0, 0 }, - { -7, 20, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, { -11, 20, 0, 0, 0, 0 }, { -13, 20, 0, 0, 0, 0 }, + { -7, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -9, 20, 0, 0, 0, 0 }, { -11, 20, 0, 0, 0, 0 }, { -13, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, { -17, 20, 0, 0, 0, 0 }, { -19, 20, 0, 0, 0, 0 }, { -21, 20, 0, 0, 0, 0 }, { -22, 20, 0, 0, 0, 0 }, { -23, 20, 0, 0, 0, 0 }, { -24, 20, 0, 0, 0, 0 }, { -25, 20, 0, 0, 0, 0 }, { -26, 20, 0, 0, 0, 0 }, { -27, 20, 0, 0, 0, 0 }, { -28, 20, 0, 0, 0, 0 }, { -29, 20, 0, 0, 0, 0 }, { -30, 20, 0, 0, 0, 0 }, { -29, 20, 0, 0, 0, 0 }, { -28, 20, 0, 0, 0, 0 }, - { -27, 20, 0, 0, 0, 0 }, { -26, 20, 0, 0, 0, 0 }, { -25, 20, 0, 0, 0, 0 }, { -24, 20, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -23, 20, 0, 0, 0, 0 }, { -23, 19, 0, 0, 0, 0 }, { -23, 18, 0, 0, 0, 0 }, { -23, 17, 0, 0, 0, 0 }, - { -23, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { -29, 16, 0, 0, 0, 0 }, + { -27, 20, 0, 0, 0, 0 }, { -26, 20, 0, 0, 0, 0 }, { -25, 20, 0, 0, 0, 0 }, { -24, 20, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { -23, 20, 0, 0, 0, 0 }, { -23, 19, 0, 0, 0, 0 }, { -23, 18, 0, 0, 0, 0 }, { -23, 17, 0, 0, 0, 0 }, + { -23, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { -29, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { -29, 16, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_93E7BC, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 14, 13, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 14, 13, 0, 8, 0, 0 }, { 14, 15, 0, 8, 0, 0 }, { 14, 17, 0, 8, 0, 0 }, { 13, 19, 0, 8, 0, 0 }, { 13, 21, 0, 8, 0, 0 }, { 13, 22, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, { 12, 17, 0, 8, 0, 0 }, { 12, 16, 0, 8, 0, 0 }, - { 12, 15, 0, 8, 0, 0 }, { 11, 14, 0, 8, 0, 0 }, { 11, 13, 0, 8, 0, 0 }, { 11, 12, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 11, 0, 8, 0, 0 }, { 11, 13, 0, 8, 0, 0 }, { 11, 15, 0, 8, 0, 0 }, { 11, 17, 0, 8, 0, 0 }, - { 11, 19, 0, 8, 0, 0 }, { 11, 21, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 13, 26, 0, 8, 0, 0 }, + { 12, 15, 0, 8, 0, 0 }, { 11, 14, 0, 8, 0, 0 }, { 11, 13, 0, 8, 0, 0 }, { 11, 12, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, 11, 0, 8, 0, 0 }, { 11, 13, 0, 8, 0, 0 }, { 11, 15, 0, 8, 0, 0 }, { 11, 17, 0, 8, 0, 0 }, + { 11, 19, 0, 8, 0, 0 }, { 11, 21, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 24, 0, 8, 0, 0 }, { 13, 26, 0, 8, 0, 0 }, { 14, 28, 0, 8, 0, 0 }, { 15, 30, 0, 8, 0, 0 }, { 16, 32, 0, 8, 0, 0 }, { 17, 34, 0, 8, 0, 0 }, { 18, 36, 0, 8, 0, 0 }, - { 20, 38, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, { 20, 42, 0, 8, 0, 0 }, { 20, 44, 0, 8, 0, 0 }, + { 20, 38, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 20, 40, 0, 8, 0, 0 }, { 20, 42, 0, 8, 0, 0 }, { 20, 44, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, { 20, 48, 0, 8, 0, 0 }, { 20, 50, 0, 8, 0, 0 }, { 20, 52, 0, 8, 0, 0 }, { 20, 53, 0, 8, 0, 0 }, { 20, 54, 0, 8, 0, 0 }, { 20, 55, 0, 8, 0, 0 }, { 20, 56, 0, 8, 0, 0 }, { 20, 57, 0, 8, 0, 0 }, { 20, 58, 0, 8, 0, 0 }, { 20, 59, 0, 8, 0, 0 }, { 20, 60, 0, 8, 0, 0 }, { 20, 61, 0, 8, 0, 0 }, { 20, 60, 0, 8, 0, 0 }, { 20, 59, 0, 8, 0, 0 }, - { 20, 58, 0, 8, 0, 0 }, { 20, 57, 0, 8, 0, 0 }, { 20, 56, 0, 8, 0, 0 }, { 20, 55, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 54, 0, 8, 0, 0 }, { 19, 54, 0, 8, 0, 0 }, { 18, 54, 0, 8, 0, 0 }, { 17, 54, 0, 8, 0, 0 }, - { 16, 54, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 16, 60, 0, 8, 0, 0 }, + { 20, 58, 0, 8, 0, 0 }, { 20, 57, 0, 8, 0, 0 }, { 20, 56, 0, 8, 0, 0 }, { 20, 55, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, 54, 0, 8, 0, 0 }, { 19, 54, 0, 8, 0, 0 }, { 18, 54, 0, 8, 0, 0 }, { 17, 54, 0, 8, 0, 0 }, + { 16, 54, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 16, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 16, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_9411AD, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 13, 17, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 13, 17, 0, 16, 0, 0 }, { 15, 17, 0, 16, 0, 0 }, { 17, 17, 0, 16, 0, 0 }, { 19, 18, 0, 16, 0, 0 }, { 21, 18, 0, 16, 0, 0 }, { 22, 18, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, { 17, 19, 0, 16, 0, 0 }, { 16, 19, 0, 16, 0, 0 }, - { 15, 19, 0, 16, 0, 0 }, { 14, 20, 0, 16, 0, 0 }, { 13, 20, 0, 16, 0, 0 }, { 12, 20, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 20, 0, 16, 0, 0 }, { 13, 20, 0, 16, 0, 0 }, { 15, 20, 0, 16, 0, 0 }, { 17, 20, 0, 16, 0, 0 }, - { 19, 20, 0, 16, 0, 0 }, { 21, 20, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 26, 18, 0, 16, 0, 0 }, + { 15, 19, 0, 16, 0, 0 }, { 14, 20, 0, 16, 0, 0 }, { 13, 20, 0, 16, 0, 0 }, { 12, 20, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, 20, 0, 16, 0, 0 }, { 13, 20, 0, 16, 0, 0 }, { 15, 20, 0, 16, 0, 0 }, { 17, 20, 0, 16, 0, 0 }, + { 19, 20, 0, 16, 0, 0 }, { 21, 20, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 24, 19, 0, 16, 0, 0 }, { 26, 18, 0, 16, 0, 0 }, { 28, 17, 0, 16, 0, 0 }, { 30, 16, 0, 16, 0, 0 }, { 32, 15, 0, 16, 0, 0 }, { 34, 14, 0, 16, 0, 0 }, { 36, 13, 0, 16, 0, 0 }, - { 38, 11, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, { 42, 11, 0, 16, 0, 0 }, { 44, 11, 0, 16, 0, 0 }, + { 38, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 40, 11, 0, 16, 0, 0 }, { 42, 11, 0, 16, 0, 0 }, { 44, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, { 48, 11, 0, 16, 0, 0 }, { 50, 11, 0, 16, 0, 0 }, { 52, 11, 0, 16, 0, 0 }, { 53, 11, 0, 16, 0, 0 }, { 54, 11, 0, 16, 0, 0 }, { 55, 11, 0, 16, 0, 0 }, { 56, 11, 0, 16, 0, 0 }, { 57, 11, 0, 16, 0, 0 }, { 58, 11, 0, 16, 0, 0 }, { 59, 11, 0, 16, 0, 0 }, { 60, 11, 0, 16, 0, 0 }, { 61, 11, 0, 16, 0, 0 }, { 60, 11, 0, 16, 0, 0 }, { 59, 11, 0, 16, 0, 0 }, - { 58, 11, 0, 16, 0, 0 }, { 57, 11, 0, 16, 0, 0 }, { 56, 11, 0, 16, 0, 0 }, { 55, 11, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 54, 11, 0, 16, 0, 0 }, { 54, 12, 0, 16, 0, 0 }, { 54, 13, 0, 16, 0, 0 }, { 54, 14, 0, 16, 0, 0 }, - { 54, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 60, 15, 0, 16, 0, 0 }, + { 58, 11, 0, 16, 0, 0 }, { 57, 11, 0, 16, 0, 0 }, { 56, 11, 0, 16, 0, 0 }, { 55, 11, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 54, 11, 0, 16, 0, 0 }, { 54, 12, 0, 16, 0, 0 }, { 54, 13, 0, 16, 0, 0 }, { 54, 14, 0, 16, 0, 0 }, + { 54, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 60, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 60, 15, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_943B9E, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 17, 18, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 17, 18, 0, 24, 0, 0 }, { 17, 16, 0, 24, 0, 0 }, { 17, 14, 0, 24, 0, 0 }, { 18, 12, 0, 24, 0, 0 }, { 18, 10, 0, 24, 0, 0 }, { 18, 9, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, { 19, 14, 0, 24, 0, 0 }, { 19, 15, 0, 24, 0, 0 }, - { 19, 16, 0, 24, 0, 0 }, { 20, 17, 0, 24, 0, 0 }, { 20, 18, 0, 24, 0, 0 }, { 20, 19, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 20, 0, 24, 0, 0 }, { 20, 18, 0, 24, 0, 0 }, { 20, 16, 0, 24, 0, 0 }, { 20, 14, 0, 24, 0, 0 }, - { 20, 12, 0, 24, 0, 0 }, { 20, 10, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 18, 5, 0, 24, 0, 0 }, + { 19, 16, 0, 24, 0, 0 }, { 20, 17, 0, 24, 0, 0 }, { 20, 18, 0, 24, 0, 0 }, { 20, 19, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, 20, 0, 24, 0, 0 }, { 20, 18, 0, 24, 0, 0 }, { 20, 16, 0, 24, 0, 0 }, { 20, 14, 0, 24, 0, 0 }, + { 20, 12, 0, 24, 0, 0 }, { 20, 10, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, 7, 0, 24, 0, 0 }, { 18, 5, 0, 24, 0, 0 }, { 17, 3, 0, 24, 0, 0 }, { 16, 1, 0, 24, 0, 0 }, { 15, -1, 0, 24, 0, 0 }, { 14, -3, 0, 24, 0, 0 }, { 13, -5, 0, 24, 0, 0 }, - { 11, -7, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, { 11, -11, 0, 24, 0, 0 }, { 11, -13, 0, 24, 0, 0 }, + { 11, -7, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 11, -9, 0, 24, 0, 0 }, { 11, -11, 0, 24, 0, 0 }, { 11, -13, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, { 11, -17, 0, 24, 0, 0 }, { 11, -19, 0, 24, 0, 0 }, { 11, -21, 0, 24, 0, 0 }, { 11, -22, 0, 24, 0, 0 }, { 11, -23, 0, 24, 0, 0 }, { 11, -24, 0, 24, 0, 0 }, { 11, -25, 0, 24, 0, 0 }, { 11, -26, 0, 24, 0, 0 }, { 11, -27, 0, 24, 0, 0 }, { 11, -28, 0, 24, 0, 0 }, { 11, -29, 0, 24, 0, 0 }, { 11, -30, 0, 24, 0, 0 }, { 11, -29, 0, 24, 0, 0 }, { 11, -28, 0, 24, 0, 0 }, - { 11, -27, 0, 24, 0, 0 }, { 11, -26, 0, 24, 0, 0 }, { 11, -25, 0, 24, 0, 0 }, { 11, -24, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, -23, 0, 24, 0, 0 }, { 12, -23, 0, 24, 0, 0 }, { 13, -23, 0, 24, 0, 0 }, { 14, -23, 0, 24, 0, 0 }, - { 15, -23, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 15, -29, 0, 24, 0, 0 }, + { 11, -27, 0, 24, 0, 0 }, { 11, -26, 0, 24, 0, 0 }, { 11, -25, 0, 24, 0, 0 }, { 11, -24, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, -23, 0, 24, 0, 0 }, { 12, -23, 0, 24, 0, 0 }, { 13, -23, 0, 24, 0, 0 }, { 14, -23, 0, 24, 0, 0 }, + { 15, -23, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), { 15, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), + MINI_GOLF_STATE(Unk3), { 15, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_944E3B, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 19, 17, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 17, 0, 0, 0, 0 }, { 19, 17, 0, 0, 0, 0 }, { 17, 17, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 18, 0, 0, 0, 0 }, { 11, 18, 0, 0, 0, 0 }, { 9, 18, 0, 0, 0, 0 }, { 7, 18, 0, 0, 0, 0 }, { 5, 18, 0, 0, 0, 0 }, { 4, 18, 0, 0, 0, 0 }, { 3, 19, 0, 0, 0, 0 }, { 2, 19, 0, 0, 0, 0 }, { 1, 19, 0, 0, 0, 0 }, { 0, 19, 0, 0, 0, 0 }, { -1, 19, 0, 0, 0, 0 }, { -2, 19, 0, 0, 0, 0 }, { -1, 19, 0, 0, 0, 0 }, { 0, 19, 0, 0, 0, 0 }, { 1, 19, 0, 0, 0, 0 }, { 2, 19, 0, 0, 0, 0 }, { 3, 19, 0, 0, 0, 0 }, { 4, 19, 0, 0, 0, 0 }, { 5, 19, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, { 8, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, - { 10, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, + { 10, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 13, 20, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 0, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, { -6, 20, 0, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 15, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, { -27, 11, 0, 0, 0, 0 }, { -28, 9, 0, 0, 0, 0 }, { -26, 7, 0, 0, 0, 0 }, { -25, 6, 0, 0, 0, 0 }, { -24, 5, 1, 0, 0, 0 }, { -23, 4, 1, 0, 0, 0 }, { -22, 3, 1, 0, 0, 0 }, { -21, 2, 1, 0, 0, 0 }, { -20, 2, 1, 0, 0, 0 }, { -19, 2, 1, 0, 0, 0 }, { -18, 2, 1, 0, 0, 0 }, { -17, 2, 1, 0, 0, 0 }, { -17, 2, 1, 0, 0, 0 }, { -17, 2, 1, 0, 0, 0 }, { -18, 2, 1, 0, 0, 0 }, { -19, 2, 1, 0, 0, 0 }, { -20, 2, 1, 0, 0, 0 }, { -21, 2, 1, 0, 0, 0 }, { -22, 3, 1, 0, 0, 0 }, { -23, 4, 1, 0, 0, 0 }, { -24, 5, 1, 0, 0, 0 }, { -25, 6, 0, 0, 0, 0 }, { -26, 7, 0, 0, 0, 0 }, { -28, 9, 0, 0, 0, 0 }, { -27, 11, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, - { -25, 15, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -15, 20, 0, 0, 0, 0 }, { -12, 20, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, { -8, 20, 0, 0, 0, 0 }, + { -25, 15, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -15, 20, 0, 0, 0, 0 }, { -12, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -9, 20, 0, 0, 0, 0 }, { -8, 20, 0, 0, 0, 0 }, { -7, 20, 0, 0, 0, 0 }, { -6, 20, 0, 0, 0, 0 }, { -5, 20, 0, 0, 0, 0 }, { -4, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, { -2, 20, 0, 0, 0, 0 }, { -1, 20, 0, 0, 0, 0 }, { 0, 20, 0, 0, 0, 0 }, { 1, 20, 0, 0, 0, 0 }, { 2, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 4, 20, 0, 0, 0, 0 }, { 5, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 7, 20, 0, 0, 0, 0 }, { 8, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 10, 20, 0, 0, 0, 0 }, { 11, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, - { 13, 20, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, + { 13, 20, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 14, 20, 0, 0, 0, 0 }, { 12, 20, 0, 0, 0, 0 }, { 9, 20, 0, 0, 0, 0 }, { 6, 20, 0, 0, 0, 0 }, { 3, 20, 0, 0, 0, 0 }, { 0, 20, 0, 0, 0, 0 }, { -3, 20, 0, 0, 0, 0 }, - { -6, 20, 0, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 15, 0, 0, 0, 0 }, + { -6, 20, 0, 0, 0, 0 }, { -9, 20, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -12, 20, 0, 0, 0, 0 }, { -15, 20, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 15, 0, 0, 0, 0 }, { -26, 13, 0, 0, 0, 0 }, { -27, 11, 0, 0, 0, 0 }, { -28, 9, 0, 0, 0, 0 }, { -26, 7, 0, 0, 0, 0 }, { -24, 5, 1, 0, 0, 0 }, { -22, 3, 1, 0, 0, 0 }, { -20, 2, 1, 0, 0, 0 }, { -18, 2, 1, 0, 0, 0 }, { -16, 3, 2, 0, 0, 0 }, { -14, 3, 2, 0, 0, 0 }, { -14, 5, 2, 0, 0, 0 }, { -13, 7, 2, 0, 0, 0 }, { -12, 9, 3, 0, 0, 0 }, { -12, 11, 3, 0, 0, 0 }, { -11, 13, 3, 0, 0, 0 }, { -12, 15, 3, 0, 0, 0 }, { -12, 17, 3, 0, 0, 0 }, { -12, 19, 3, 0, 0, 0 }, { -13, 21, 3, 0, 0, 0 }, { -13, 23, 3, 0, 0, 0 }, { -13, 25, 3, 0, 0, 0 }, { -14, 27, 3, 0, 0, 0 }, { -14, 29, 3, 0, 0, 0 }, { -14, 30, 3, 0, 0, 0 }, { -14, 31, 3, 0, 0, 0 }, { -15, 32, 3, 0, 0, 0 }, { -15, 33, 3, 0, 0, 0 }, { -15, 34, 3, 0, 0, 0 }, { -15, 35, 3, 0, 0, 0 }, { -15, 36, 3, 0, 0, 0 }, - { -15, 38, 0, 0, 0, 0 }, { -16, 40, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -15, 38, 0, 0, 0, 0 }, { -16, 40, 0, 0, 0, 0 }, { -16, 41, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -16, 42, 0, 0, 0, 0 }, { -16, 43, 0, 0, 0, 0 }, { -16, 44, 0, 0, 0, 0 }, { -16, 45, 0, 0, 0, 0 }, { -17, 46, 0, 0, 0, 0 }, - { -17, 47, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -17, 49, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -17, 60, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -17, 60, 0, 8, 0, 0 }, + { -17, 47, 0, 0, 0, 0 }, { -17, 48, 0, 0, 0, 0 }, { -17, 49, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -17, 60, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -17, 60, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_947AF9, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 17, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 17, 10, 0, 8, 0, 0 }, { 17, 12, 0, 8, 0, 0 }, { 17, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 18, 18, 0, 8, 0, 0 }, { 18, 20, 0, 8, 0, 0 }, { 18, 22, 0, 8, 0, 0 }, { 18, 24, 0, 8, 0, 0 }, { 18, 26, 0, 8, 0, 0 }, { 18, 27, 0, 8, 0, 0 }, { 19, 28, 0, 8, 0, 0 }, { 19, 29, 0, 8, 0, 0 }, { 19, 30, 0, 8, 0, 0 }, { 19, 31, 0, 8, 0, 0 }, { 19, 32, 0, 8, 0, 0 }, { 19, 33, 0, 8, 0, 0 }, { 19, 32, 0, 8, 0, 0 }, { 19, 31, 0, 8, 0, 0 }, { 19, 30, 0, 8, 0, 0 }, { 19, 29, 0, 8, 0, 0 }, { 19, 28, 0, 8, 0, 0 }, { 19, 27, 0, 8, 0, 0 }, { 19, 26, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, { 20, 23, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, - { 20, 21, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, + { 20, 21, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 31, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, { 20, 37, 0, 8, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 15, 56, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, { 11, 58, 0, 8, 0, 0 }, { 9, 59, 0, 8, 0, 0 }, { 7, 57, 0, 8, 0, 0 }, { 6, 56, 0, 8, 0, 0 }, { 5, 55, 1, 8, 0, 0 }, { 4, 54, 1, 8, 0, 0 }, { 3, 53, 1, 8, 0, 0 }, { 2, 52, 1, 8, 0, 0 }, { 2, 51, 1, 8, 0, 0 }, { 2, 50, 1, 8, 0, 0 }, { 2, 49, 1, 8, 0, 0 }, { 2, 48, 1, 8, 0, 0 }, { 2, 48, 1, 8, 0, 0 }, { 2, 48, 1, 8, 0, 0 }, { 2, 49, 1, 8, 0, 0 }, { 2, 50, 1, 8, 0, 0 }, { 2, 51, 1, 8, 0, 0 }, { 2, 52, 1, 8, 0, 0 }, { 3, 53, 1, 8, 0, 0 }, { 4, 54, 1, 8, 0, 0 }, { 5, 55, 1, 8, 0, 0 }, { 6, 56, 0, 8, 0, 0 }, { 7, 57, 0, 8, 0, 0 }, { 9, 59, 0, 8, 0, 0 }, { 11, 58, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, - { 15, 56, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 20, 46, 0, 8, 0, 0 }, { 20, 43, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, { 20, 39, 0, 8, 0, 0 }, + { 15, 56, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 20, 46, 0, 8, 0, 0 }, { 20, 43, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 20, 40, 0, 8, 0, 0 }, { 20, 39, 0, 8, 0, 0 }, { 20, 38, 0, 8, 0, 0 }, { 20, 37, 0, 8, 0, 0 }, { 20, 36, 0, 8, 0, 0 }, { 20, 35, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, { 20, 33, 0, 8, 0, 0 }, { 20, 32, 0, 8, 0, 0 }, { 20, 31, 0, 8, 0, 0 }, { 20, 30, 0, 8, 0, 0 }, { 20, 29, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 27, 0, 8, 0, 0 }, { 20, 26, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 24, 0, 8, 0, 0 }, { 20, 23, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 21, 0, 8, 0, 0 }, { 20, 20, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, - { 20, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, + { 20, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 20, 17, 0, 8, 0, 0 }, { 20, 19, 0, 8, 0, 0 }, { 20, 22, 0, 8, 0, 0 }, { 20, 25, 0, 8, 0, 0 }, { 20, 28, 0, 8, 0, 0 }, { 20, 31, 0, 8, 0, 0 }, { 20, 34, 0, 8, 0, 0 }, - { 20, 37, 0, 8, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 15, 56, 0, 8, 0, 0 }, + { 20, 37, 0, 8, 0, 0 }, { 20, 40, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 20, 43, 0, 8, 0, 0 }, { 20, 46, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 15, 56, 0, 8, 0, 0 }, { 13, 57, 0, 8, 0, 0 }, { 11, 58, 0, 8, 0, 0 }, { 9, 59, 0, 8, 0, 0 }, { 7, 57, 0, 8, 0, 0 }, { 5, 55, 1, 8, 0, 0 }, { 3, 53, 1, 8, 0, 0 }, { 2, 51, 1, 8, 0, 0 }, { 2, 49, 1, 8, 0, 0 }, { 3, 47, 2, 8, 0, 0 }, { 3, 45, 2, 8, 0, 0 }, { 5, 45, 2, 8, 0, 0 }, { 7, 44, 2, 8, 0, 0 }, { 9, 43, 3, 8, 0, 0 }, { 11, 43, 3, 8, 0, 0 }, { 13, 42, 3, 8, 0, 0 }, { 15, 43, 3, 8, 0, 0 }, { 17, 43, 3, 8, 0, 0 }, { 19, 43, 3, 8, 0, 0 }, { 21, 44, 3, 8, 0, 0 }, { 23, 44, 3, 8, 0, 0 }, { 25, 44, 3, 8, 0, 0 }, { 27, 45, 3, 8, 0, 0 }, { 29, 45, 3, 8, 0, 0 }, { 30, 45, 3, 8, 0, 0 }, { 31, 45, 3, 8, 0, 0 }, { 32, 46, 3, 8, 0, 0 }, { 33, 46, 3, 8, 0, 0 }, { 34, 46, 3, 8, 0, 0 }, { 35, 46, 3, 8, 0, 0 }, { 36, 46, 3, 8, 0, 0 }, - { 38, 46, 0, 8, 0, 0 }, { 40, 47, 0, 8, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 38, 46, 0, 8, 0, 0 }, { 40, 47, 0, 8, 0, 0 }, { 41, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 42, 47, 0, 8, 0, 0 }, { 43, 47, 0, 8, 0, 0 }, { 44, 47, 0, 8, 0, 0 }, { 45, 47, 0, 8, 0, 0 }, { 46, 48, 0, 8, 0, 0 }, - { 47, 48, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { 49, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 60, 48, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 60, 48, 0, 16, 0, 0 }, + { 47, 48, 0, 8, 0, 0 }, { 48, 48, 0, 8, 0, 0 }, { 49, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 60, 48, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 60, 48, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94A7B7, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 12, 14, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 14, 0, 16, 0, 0 }, { 12, 14, 0, 16, 0, 0 }, { 14, 14, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 13, 0, 16, 0, 0 }, { 20, 13, 0, 16, 0, 0 }, { 22, 13, 0, 16, 0, 0 }, { 24, 13, 0, 16, 0, 0 }, { 26, 13, 0, 16, 0, 0 }, { 27, 13, 0, 16, 0, 0 }, { 28, 12, 0, 16, 0, 0 }, { 29, 12, 0, 16, 0, 0 }, { 30, 12, 0, 16, 0, 0 }, { 31, 12, 0, 16, 0, 0 }, { 32, 12, 0, 16, 0, 0 }, { 33, 12, 0, 16, 0, 0 }, { 32, 12, 0, 16, 0, 0 }, { 31, 12, 0, 16, 0, 0 }, { 30, 12, 0, 16, 0, 0 }, { 29, 12, 0, 16, 0, 0 }, { 28, 12, 0, 16, 0, 0 }, { 27, 12, 0, 16, 0, 0 }, { 26, 12, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, { 23, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, - { 21, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, + { 21, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 18, 11, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 31, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, { 37, 11, 0, 16, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 16, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, { 58, 20, 0, 16, 0, 0 }, { 59, 22, 0, 16, 0, 0 }, { 57, 24, 0, 16, 0, 0 }, { 56, 25, 0, 16, 0, 0 }, { 55, 26, 1, 16, 0, 0 }, { 54, 27, 1, 16, 0, 0 }, { 53, 28, 1, 16, 0, 0 }, { 52, 29, 1, 16, 0, 0 }, { 51, 29, 1, 16, 0, 0 }, { 50, 29, 1, 16, 0, 0 }, { 49, 29, 1, 16, 0, 0 }, { 48, 29, 1, 16, 0, 0 }, { 48, 29, 1, 16, 0, 0 }, { 48, 29, 1, 16, 0, 0 }, { 49, 29, 1, 16, 0, 0 }, { 50, 29, 1, 16, 0, 0 }, { 51, 29, 1, 16, 0, 0 }, { 52, 29, 1, 16, 0, 0 }, { 53, 28, 1, 16, 0, 0 }, { 54, 27, 1, 16, 0, 0 }, { 55, 26, 1, 16, 0, 0 }, { 56, 25, 0, 16, 0, 0 }, { 57, 24, 0, 16, 0, 0 }, { 59, 22, 0, 16, 0, 0 }, { 58, 20, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, - { 56, 16, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 46, 11, 0, 16, 0, 0 }, { 43, 11, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, { 39, 11, 0, 16, 0, 0 }, + { 56, 16, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 46, 11, 0, 16, 0, 0 }, { 43, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 40, 11, 0, 16, 0, 0 }, { 39, 11, 0, 16, 0, 0 }, { 38, 11, 0, 16, 0, 0 }, { 37, 11, 0, 16, 0, 0 }, { 36, 11, 0, 16, 0, 0 }, { 35, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, { 33, 11, 0, 16, 0, 0 }, { 32, 11, 0, 16, 0, 0 }, { 31, 11, 0, 16, 0, 0 }, { 30, 11, 0, 16, 0, 0 }, { 29, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 27, 11, 0, 16, 0, 0 }, { 26, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 24, 11, 0, 16, 0, 0 }, { 23, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 21, 11, 0, 16, 0, 0 }, { 20, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, - { 18, 11, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, + { 18, 11, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 17, 11, 0, 16, 0, 0 }, { 19, 11, 0, 16, 0, 0 }, { 22, 11, 0, 16, 0, 0 }, { 25, 11, 0, 16, 0, 0 }, { 28, 11, 0, 16, 0, 0 }, { 31, 11, 0, 16, 0, 0 }, { 34, 11, 0, 16, 0, 0 }, - { 37, 11, 0, 16, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 16, 0, 16, 0, 0 }, + { 37, 11, 0, 16, 0, 0 }, { 40, 11, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 43, 11, 0, 16, 0, 0 }, { 46, 11, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 16, 0, 16, 0, 0 }, { 57, 18, 0, 16, 0, 0 }, { 58, 20, 0, 16, 0, 0 }, { 59, 22, 0, 16, 0, 0 }, { 57, 24, 0, 16, 0, 0 }, { 55, 26, 1, 16, 0, 0 }, { 53, 28, 1, 16, 0, 0 }, { 51, 29, 1, 16, 0, 0 }, { 49, 29, 1, 16, 0, 0 }, { 47, 28, 2, 16, 0, 0 }, { 45, 28, 2, 16, 0, 0 }, { 45, 26, 2, 16, 0, 0 }, { 44, 24, 2, 16, 0, 0 }, { 43, 22, 3, 16, 0, 0 }, { 43, 20, 3, 16, 0, 0 }, { 42, 18, 3, 16, 0, 0 }, { 43, 16, 3, 16, 0, 0 }, { 43, 14, 3, 16, 0, 0 }, { 43, 12, 3, 16, 0, 0 }, { 44, 10, 3, 16, 0, 0 }, { 44, 8, 3, 16, 0, 0 }, { 44, 6, 3, 16, 0, 0 }, { 45, 4, 3, 16, 0, 0 }, { 45, 2, 3, 16, 0, 0 }, { 45, 1, 3, 16, 0, 0 }, { 45, 0, 3, 16, 0, 0 }, { 46, -1, 3, 16, 0, 0 }, { 46, -2, 3, 16, 0, 0 }, { 46, -3, 3, 16, 0, 0 }, { 46, -4, 3, 16, 0, 0 }, { 46, -5, 3, 16, 0, 0 }, - { 46, -7, 0, 16, 0, 0 }, { 47, -9, 0, 16, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 46, -7, 0, 16, 0, 0 }, { 47, -9, 0, 16, 0, 0 }, { 47, -10, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 47, -11, 0, 16, 0, 0 }, { 47, -12, 0, 16, 0, 0 }, { 47, -13, 0, 16, 0, 0 }, { 47, -14, 0, 16, 0, 0 }, { 48, -15, 0, 16, 0, 0 }, - { 48, -16, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { 48, -18, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 48, -29, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 48, -29, 0, 24, 0, 0 }, + { 48, -16, 0, 16, 0, 0 }, { 48, -17, 0, 16, 0, 0 }, { 48, -18, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 48, -29, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 48, -29, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94D475, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 14, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 14, 21, 0, 24, 0, 0 }, { 14, 19, 0, 24, 0, 0 }, { 14, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 13, 13, 0, 24, 0, 0 }, { 13, 11, 0, 24, 0, 0 }, { 13, 9, 0, 24, 0, 0 }, { 13, 7, 0, 24, 0, 0 }, { 13, 5, 0, 24, 0, 0 }, { 13, 4, 0, 24, 0, 0 }, { 12, 3, 0, 24, 0, 0 }, { 12, 2, 0, 24, 0, 0 }, { 12, 1, 0, 24, 0, 0 }, { 12, 0, 0, 24, 0, 0 }, { 12, -1, 0, 24, 0, 0 }, { 12, -2, 0, 24, 0, 0 }, { 12, -1, 0, 24, 0, 0 }, { 12, 0, 0, 24, 0, 0 }, { 12, 1, 0, 24, 0, 0 }, { 12, 2, 0, 24, 0, 0 }, { 12, 3, 0, 24, 0, 0 }, { 12, 4, 0, 24, 0, 0 }, { 12, 5, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, { 11, 8, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, - { 11, 10, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, + { 11, 10, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 0, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, { 11, -6, 0, 24, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 16, -25, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, { 20, -27, 0, 24, 0, 0 }, { 22, -28, 0, 24, 0, 0 }, { 24, -26, 0, 24, 0, 0 }, { 25, -25, 0, 24, 0, 0 }, { 26, -24, 1, 24, 0, 0 }, { 27, -23, 1, 24, 0, 0 }, { 28, -22, 1, 24, 0, 0 }, { 29, -21, 1, 24, 0, 0 }, { 29, -20, 1, 24, 0, 0 }, { 29, -19, 1, 24, 0, 0 }, { 29, -18, 1, 24, 0, 0 }, { 29, -17, 1, 24, 0, 0 }, { 29, -17, 1, 24, 0, 0 }, { 29, -17, 1, 24, 0, 0 }, { 29, -18, 1, 24, 0, 0 }, { 29, -19, 1, 24, 0, 0 }, { 29, -20, 1, 24, 0, 0 }, { 29, -21, 1, 24, 0, 0 }, { 28, -22, 1, 24, 0, 0 }, { 27, -23, 1, 24, 0, 0 }, { 26, -24, 1, 24, 0, 0 }, { 25, -25, 0, 24, 0, 0 }, { 24, -26, 0, 24, 0, 0 }, { 22, -28, 0, 24, 0, 0 }, { 20, -27, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, - { 16, -25, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 11, -15, 0, 24, 0, 0 }, { 11, -12, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, { 11, -8, 0, 24, 0, 0 }, + { 16, -25, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 11, -15, 0, 24, 0, 0 }, { 11, -12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 11, -9, 0, 24, 0, 0 }, { 11, -8, 0, 24, 0, 0 }, { 11, -7, 0, 24, 0, 0 }, { 11, -6, 0, 24, 0, 0 }, { 11, -5, 0, 24, 0, 0 }, { 11, -4, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, { 11, -2, 0, 24, 0, 0 }, { 11, -1, 0, 24, 0, 0 }, { 11, 0, 0, 24, 0, 0 }, { 11, 1, 0, 24, 0, 0 }, { 11, 2, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 4, 0, 24, 0, 0 }, { 11, 5, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 7, 0, 24, 0, 0 }, { 11, 8, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 10, 0, 24, 0, 0 }, { 11, 11, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, - { 11, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, + { 11, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 11, 14, 0, 24, 0, 0 }, { 11, 12, 0, 24, 0, 0 }, { 11, 9, 0, 24, 0, 0 }, { 11, 6, 0, 24, 0, 0 }, { 11, 3, 0, 24, 0, 0 }, { 11, 0, 0, 24, 0, 0 }, { 11, -3, 0, 24, 0, 0 }, - { 11, -6, 0, 24, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 16, -25, 0, 24, 0, 0 }, + { 11, -6, 0, 24, 0, 0 }, { 11, -9, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 11, -12, 0, 24, 0, 0 }, { 11, -15, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 16, -25, 0, 24, 0, 0 }, { 18, -26, 0, 24, 0, 0 }, { 20, -27, 0, 24, 0, 0 }, { 22, -28, 0, 24, 0, 0 }, { 24, -26, 0, 24, 0, 0 }, { 26, -24, 1, 24, 0, 0 }, { 28, -22, 1, 24, 0, 0 }, { 29, -20, 1, 24, 0, 0 }, { 29, -18, 1, 24, 0, 0 }, { 28, -16, 2, 24, 0, 0 }, { 28, -14, 2, 24, 0, 0 }, { 26, -14, 2, 24, 0, 0 }, { 24, -13, 2, 24, 0, 0 }, { 22, -12, 3, 24, 0, 0 }, { 20, -12, 3, 24, 0, 0 }, { 18, -11, 3, 24, 0, 0 }, { 16, -12, 3, 24, 0, 0 }, { 14, -12, 3, 24, 0, 0 }, { 12, -12, 3, 24, 0, 0 }, { 10, -13, 3, 24, 0, 0 }, { 8, -13, 3, 24, 0, 0 }, { 6, -13, 3, 24, 0, 0 }, { 4, -14, 3, 24, 0, 0 }, { 2, -14, 3, 24, 0, 0 }, { 1, -14, 3, 24, 0, 0 }, { 0, -14, 3, 24, 0, 0 }, { -1, -15, 3, 24, 0, 0 }, { -2, -15, 3, 24, 0, 0 }, { -3, -15, 3, 24, 0, 0 }, { -4, -15, 3, 24, 0, 0 }, { -5, -15, 3, 24, 0, 0 }, - { -7, -15, 0, 24, 0, 0 }, { -9, -16, 0, 24, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -7, -15, 0, 24, 0, 0 }, { -9, -16, 0, 24, 0, 0 }, { -10, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -11, -16, 0, 24, 0, 0 }, { -12, -16, 0, 24, 0, 0 }, { -13, -16, 0, 24, 0, 0 }, { -14, -16, 0, 24, 0, 0 }, { -15, -17, 0, 24, 0, 0 }, - { -16, -17, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -18, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -29, -17, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -29, -17, 0, 0, 0, 0 }, + { -16, -17, 0, 24, 0, 0 }, { -17, -17, 0, 24, 0, 0 }, { -18, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -29, -17, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -29, -17, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94649A, { - { -32768, 0, 0, 0, 0, 0 }, { 31, 16, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 26, 16, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 26, 16, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 31, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 26, 16, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk3), { 24, 16, 0, 0, 0, 0 }, { 21, 15, 0, 0, 0, 0 }, { 19, 15, 0, 0, 0, 0 }, { 17, 15, 0, 0, 0, 0 }, { 15, 16, 0, 0, 0, 0 }, { 13, 14, 0, 0, 0, 0 }, { 11, 14, 0, 0, 0, 0 }, { 9, 14, 0, 0, 0, 0 }, { 7, 14, 0, 0, 0, 0 }, { 5, 14, 0, 0, 0, 0 }, { 4, 14, 0, 0, 0, 0 }, { 3, 13, 0, 0, 0, 0 }, { 2, 13, 0, 0, 0, 0 }, { 1, 13, 0, 0, 0, 0 }, { 0, 13, 0, 0, 0, 0 }, { -1, 13, 0, 0, 0, 0 }, { -2, 13, 0, 0, 0, 0 }, { -1, 13, 0, 0, 0, 0 }, { 0, 13, 0, 0, 0, 0 }, { 1, 13, 0, 0, 0, 0 }, { 2, 13, 0, 0, 0, 0 }, { 3, 13, 0, 0, 0, 0 }, { 4, 13, 0, 0, 0, 0 }, { 5, 13, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 8, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, - { 10, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, + { 10, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 13, 12, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 0, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, { -6, 12, 0, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 17, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, { -27, 21, 0, 0, 0, 0 }, { -28, 23, 0, 0, 0, 0 }, { -26, 25, 0, 0, 0, 0 }, { -25, 26, 0, 0, 0, 0 }, { -24, 27, 1, 0, 0, 0 }, { -23, 28, 1, 0, 0, 0 }, { -22, 29, 1, 0, 0, 0 }, { -21, 30, 1, 0, 0, 0 }, { -20, 30, 1, 0, 0, 0 }, { -19, 30, 1, 0, 0, 0 }, { -18, 30, 1, 0, 0, 0 }, { -17, 30, 1, 0, 0, 0 }, { -17, 30, 1, 0, 0, 0 }, { -17, 30, 1, 0, 0, 0 }, { -18, 30, 1, 0, 0, 0 }, { -19, 30, 1, 0, 0, 0 }, { -20, 30, 1, 0, 0, 0 }, { -21, 30, 1, 0, 0, 0 }, { -22, 29, 1, 0, 0, 0 }, { -23, 28, 1, 0, 0, 0 }, { -24, 27, 1, 0, 0, 0 }, { -25, 26, 0, 0, 0, 0 }, { -26, 25, 0, 0, 0, 0 }, { -28, 23, 0, 0, 0, 0 }, { -27, 21, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, - { -25, 17, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { -15, 12, 0, 0, 0, 0 }, { -12, 12, 0, 0, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, { -8, 12, 0, 0, 0, 0 }, + { -25, 17, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { -15, 12, 0, 0, 0, 0 }, { -12, 12, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { -9, 12, 0, 0, 0, 0 }, { -8, 12, 0, 0, 0, 0 }, { -7, 12, 0, 0, 0, 0 }, { -6, 12, 0, 0, 0, 0 }, { -5, 12, 0, 0, 0, 0 }, { -4, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, { -2, 12, 0, 0, 0, 0 }, { -1, 12, 0, 0, 0, 0 }, { 0, 12, 0, 0, 0, 0 }, { 1, 12, 0, 0, 0, 0 }, { 2, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 4, 12, 0, 0, 0, 0 }, { 5, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 7, 12, 0, 0, 0, 0 }, { 8, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 10, 12, 0, 0, 0, 0 }, { 11, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, - { 13, 12, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, + { 13, 12, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 14, 12, 0, 0, 0, 0 }, { 12, 12, 0, 0, 0, 0 }, { 9, 12, 0, 0, 0, 0 }, { 6, 12, 0, 0, 0, 0 }, { 3, 12, 0, 0, 0, 0 }, { 0, 12, 0, 0, 0, 0 }, { -3, 12, 0, 0, 0, 0 }, - { -6, 12, 0, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 17, 0, 0, 0, 0 }, + { -6, 12, 0, 0, 0, 0 }, { -9, 12, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { -12, 12, 0, 0, 0, 0 }, { -15, 12, 0, 0, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { -18, 16, 0, 0, 0, 0 }, { -21, 16, 0, 0, 0, 0 }, { -24, 16, 0, 0, 0, 0 }, { -25, 17, 0, 0, 0, 0 }, { -26, 19, 0, 0, 0, 0 }, { -27, 21, 0, 0, 0, 0 }, { -28, 23, 0, 0, 0, 0 }, { -26, 25, 0, 0, 0, 0 }, { -24, 27, 1, 0, 0, 0 }, { -22, 29, 1, 0, 0, 0 }, { -20, 30, 1, 0, 0, 0 }, { -18, 30, 1, 0, 0, 0 }, { -16, 30, 2, 0, 0, 0 }, { -14, 29, 2, 0, 0, 0 }, { -14, 27, 2, 0, 0, 0 }, { -13, 25, 2, 0, 0, 0 }, { -12, 23, 3, 0, 0, 0 }, { -12, 21, 3, 0, 0, 0 }, { -11, 19, 3, 0, 0, 0 }, { -12, 17, 3, 0, 0, 0 }, { -12, 15, 3, 0, 0, 0 }, { -12, 13, 3, 0, 0, 0 }, { -13, 11, 3, 0, 0, 0 }, { -13, 9, 3, 0, 0, 0 }, { -13, 7, 3, 0, 0, 0 }, { -14, 5, 3, 0, 0, 0 }, { -14, 3, 3, 0, 0, 0 }, { -14, 2, 3, 0, 0, 0 }, { -14, 1, 3, 0, 0, 0 }, { -15, 0, 3, 0, 0, 0 }, { -15, -1, 3, 0, 0, 0 }, { -15, -2, 3, 0, 0, 0 }, { -15, -3, 3, 0, 0, 0 }, { -15, -4, 3, 0, 0, 0 }, - { -15, -6, 0, 0, 0, 0 }, { -16, -8, 0, 0, 0, 0 }, { -16, -9, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -15, -6, 0, 0, 0, 0 }, { -16, -8, 0, 0, 0, 0 }, { -16, -9, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -16, -10, 0, 0, 0, 0 }, { -16, -11, 0, 0, 0, 0 }, { -16, -12, 0, 0, 0, 0 }, { -16, -13, 0, 0, 0, 0 }, { -17, -14, 0, 0, 0, 0 }, - { -17, -15, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -17, -28, 0, 24, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -17, -28, 0, 24, 0, 0 }, + { -17, -15, 0, 0, 0, 0 }, { -17, -16, 0, 0, 0, 0 }, { -17, -17, 0, 0, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -17, -28, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -17, -28, 0, 24, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_949158, { - { -32768, 0, 0, 0, 0, 0 }, { 16, 0, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 16, 5, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 16, 5, 0, 8, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 16, 0, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 16, 5, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk3), { 16, 7, 0, 8, 0, 0 }, { 15, 10, 0, 8, 0, 0 }, { 15, 12, 0, 8, 0, 0 }, { 15, 14, 0, 8, 0, 0 }, { 16, 16, 0, 8, 0, 0 }, { 14, 18, 0, 8, 0, 0 }, { 14, 20, 0, 8, 0, 0 }, { 14, 22, 0, 8, 0, 0 }, { 14, 24, 0, 8, 0, 0 }, { 14, 26, 0, 8, 0, 0 }, { 14, 27, 0, 8, 0, 0 }, { 13, 28, 0, 8, 0, 0 }, { 13, 29, 0, 8, 0, 0 }, { 13, 30, 0, 8, 0, 0 }, { 13, 31, 0, 8, 0, 0 }, { 13, 32, 0, 8, 0, 0 }, { 13, 33, 0, 8, 0, 0 }, { 13, 32, 0, 8, 0, 0 }, { 13, 31, 0, 8, 0, 0 }, { 13, 30, 0, 8, 0, 0 }, { 13, 29, 0, 8, 0, 0 }, { 13, 28, 0, 8, 0, 0 }, { 13, 27, 0, 8, 0, 0 }, { 13, 26, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 12, 23, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, - { 12, 21, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, + { 12, 21, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 31, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, { 12, 37, 0, 8, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 17, 56, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, { 21, 58, 0, 8, 0, 0 }, { 23, 59, 0, 8, 0, 0 }, { 25, 57, 0, 8, 0, 0 }, { 26, 56, 0, 8, 0, 0 }, { 27, 55, 1, 8, 0, 0 }, { 28, 54, 1, 8, 0, 0 }, { 29, 53, 1, 8, 0, 0 }, { 30, 52, 1, 8, 0, 0 }, { 30, 51, 1, 8, 0, 0 }, { 30, 50, 1, 8, 0, 0 }, { 30, 49, 1, 8, 0, 0 }, { 30, 48, 1, 8, 0, 0 }, { 30, 48, 1, 8, 0, 0 }, { 30, 48, 1, 8, 0, 0 }, { 30, 49, 1, 8, 0, 0 }, { 30, 50, 1, 8, 0, 0 }, { 30, 51, 1, 8, 0, 0 }, { 30, 52, 1, 8, 0, 0 }, { 29, 53, 1, 8, 0, 0 }, { 28, 54, 1, 8, 0, 0 }, { 27, 55, 1, 8, 0, 0 }, { 26, 56, 0, 8, 0, 0 }, { 25, 57, 0, 8, 0, 0 }, { 23, 59, 0, 8, 0, 0 }, { 21, 58, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, - { 17, 56, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 12, 46, 0, 8, 0, 0 }, { 12, 43, 0, 8, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, { 12, 39, 0, 8, 0, 0 }, + { 17, 56, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 12, 46, 0, 8, 0, 0 }, { 12, 43, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 12, 40, 0, 8, 0, 0 }, { 12, 39, 0, 8, 0, 0 }, { 12, 38, 0, 8, 0, 0 }, { 12, 37, 0, 8, 0, 0 }, { 12, 36, 0, 8, 0, 0 }, { 12, 35, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, { 12, 33, 0, 8, 0, 0 }, { 12, 32, 0, 8, 0, 0 }, { 12, 31, 0, 8, 0, 0 }, { 12, 30, 0, 8, 0, 0 }, { 12, 29, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 27, 0, 8, 0, 0 }, { 12, 26, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 24, 0, 8, 0, 0 }, { 12, 23, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 21, 0, 8, 0, 0 }, { 12, 20, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, - { 12, 18, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, + { 12, 18, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 12, 17, 0, 8, 0, 0 }, { 12, 19, 0, 8, 0, 0 }, { 12, 22, 0, 8, 0, 0 }, { 12, 25, 0, 8, 0, 0 }, { 12, 28, 0, 8, 0, 0 }, { 12, 31, 0, 8, 0, 0 }, { 12, 34, 0, 8, 0, 0 }, - { 12, 37, 0, 8, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 17, 56, 0, 8, 0, 0 }, + { 12, 37, 0, 8, 0, 0 }, { 12, 40, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 12, 43, 0, 8, 0, 0 }, { 12, 46, 0, 8, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 16, 49, 0, 8, 0, 0 }, { 16, 52, 0, 8, 0, 0 }, { 16, 55, 0, 8, 0, 0 }, { 17, 56, 0, 8, 0, 0 }, { 19, 57, 0, 8, 0, 0 }, { 21, 58, 0, 8, 0, 0 }, { 23, 59, 0, 8, 0, 0 }, { 25, 57, 0, 8, 0, 0 }, { 27, 55, 1, 8, 0, 0 }, { 29, 53, 1, 8, 0, 0 }, { 30, 51, 1, 8, 0, 0 }, { 30, 49, 1, 8, 0, 0 }, { 30, 47, 2, 8, 0, 0 }, { 29, 45, 2, 8, 0, 0 }, { 27, 45, 2, 8, 0, 0 }, { 25, 44, 2, 8, 0, 0 }, { 23, 43, 3, 8, 0, 0 }, { 21, 43, 3, 8, 0, 0 }, { 19, 42, 3, 8, 0, 0 }, { 17, 43, 3, 8, 0, 0 }, { 15, 43, 3, 8, 0, 0 }, { 13, 43, 3, 8, 0, 0 }, { 11, 44, 3, 8, 0, 0 }, { 9, 44, 3, 8, 0, 0 }, { 7, 44, 3, 8, 0, 0 }, { 5, 45, 3, 8, 0, 0 }, { 3, 45, 3, 8, 0, 0 }, { 2, 45, 3, 8, 0, 0 }, { 1, 45, 3, 8, 0, 0 }, { 0, 46, 3, 8, 0, 0 }, { -1, 46, 3, 8, 0, 0 }, { -2, 46, 3, 8, 0, 0 }, { -3, 46, 3, 8, 0, 0 }, { -4, 46, 3, 8, 0, 0 }, - { -6, 46, 0, 8, 0, 0 }, { -8, 47, 0, 8, 0, 0 }, { -9, 47, 0, 8, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { -6, 46, 0, 8, 0, 0 }, { -8, 47, 0, 8, 0, 0 }, { -9, 47, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { -10, 47, 0, 8, 0, 0 }, { -11, 47, 0, 8, 0, 0 }, { -12, 47, 0, 8, 0, 0 }, { -13, 47, 0, 8, 0, 0 }, { -14, 48, 0, 8, 0, 0 }, - { -15, 48, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -28, 48, 0, 0, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { -28, 48, 0, 0, 0, 0 }, + { -15, 48, 0, 8, 0, 0 }, { -16, 48, 0, 8, 0, 0 }, { -17, 48, 0, 8, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { -28, 48, 0, 0, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { -28, 48, 0, 0, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94BE16, { - { -32768, 0, 0, 0, 0, 0 }, { 0, 15, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 5, 15, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 5, 15, 0, 16, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 0, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 5, 15, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk3), { 7, 15, 0, 16, 0, 0 }, { 10, 16, 0, 16, 0, 0 }, { 12, 16, 0, 16, 0, 0 }, { 14, 16, 0, 16, 0, 0 }, { 16, 15, 0, 16, 0, 0 }, { 18, 17, 0, 16, 0, 0 }, { 20, 17, 0, 16, 0, 0 }, { 22, 17, 0, 16, 0, 0 }, { 24, 17, 0, 16, 0, 0 }, { 26, 17, 0, 16, 0, 0 }, { 27, 17, 0, 16, 0, 0 }, { 28, 18, 0, 16, 0, 0 }, { 29, 18, 0, 16, 0, 0 }, { 30, 18, 0, 16, 0, 0 }, { 31, 18, 0, 16, 0, 0 }, { 32, 18, 0, 16, 0, 0 }, { 33, 18, 0, 16, 0, 0 }, { 32, 18, 0, 16, 0, 0 }, { 31, 18, 0, 16, 0, 0 }, { 30, 18, 0, 16, 0, 0 }, { 29, 18, 0, 16, 0, 0 }, { 28, 18, 0, 16, 0, 0 }, { 27, 18, 0, 16, 0, 0 }, { 26, 18, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 23, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, - { 21, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, + { 21, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 18, 19, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 31, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, { 37, 19, 0, 16, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 14, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, { 58, 10, 0, 16, 0, 0 }, { 59, 8, 0, 16, 0, 0 }, { 57, 6, 0, 16, 0, 0 }, { 56, 5, 0, 16, 0, 0 }, { 55, 4, 1, 16, 0, 0 }, { 54, 3, 1, 16, 0, 0 }, { 53, 2, 1, 16, 0, 0 }, { 52, 1, 1, 16, 0, 0 }, { 51, 1, 1, 16, 0, 0 }, { 50, 1, 1, 16, 0, 0 }, { 49, 1, 1, 16, 0, 0 }, { 48, 1, 1, 16, 0, 0 }, { 48, 1, 1, 16, 0, 0 }, { 48, 1, 1, 16, 0, 0 }, { 49, 1, 1, 16, 0, 0 }, { 50, 1, 1, 16, 0, 0 }, { 51, 1, 1, 16, 0, 0 }, { 52, 1, 1, 16, 0, 0 }, { 53, 2, 1, 16, 0, 0 }, { 54, 3, 1, 16, 0, 0 }, { 55, 4, 1, 16, 0, 0 }, { 56, 5, 0, 16, 0, 0 }, { 57, 6, 0, 16, 0, 0 }, { 59, 8, 0, 16, 0, 0 }, { 58, 10, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, - { 56, 14, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 46, 19, 0, 16, 0, 0 }, { 43, 19, 0, 16, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, { 39, 19, 0, 16, 0, 0 }, + { 56, 14, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 46, 19, 0, 16, 0, 0 }, { 43, 19, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 40, 19, 0, 16, 0, 0 }, { 39, 19, 0, 16, 0, 0 }, { 38, 19, 0, 16, 0, 0 }, { 37, 19, 0, 16, 0, 0 }, { 36, 19, 0, 16, 0, 0 }, { 35, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, { 33, 19, 0, 16, 0, 0 }, { 32, 19, 0, 16, 0, 0 }, { 31, 19, 0, 16, 0, 0 }, { 30, 19, 0, 16, 0, 0 }, { 29, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 27, 19, 0, 16, 0, 0 }, { 26, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 24, 19, 0, 16, 0, 0 }, { 23, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 21, 19, 0, 16, 0, 0 }, { 20, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, - { 18, 19, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, + { 18, 19, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 17, 19, 0, 16, 0, 0 }, { 19, 19, 0, 16, 0, 0 }, { 22, 19, 0, 16, 0, 0 }, { 25, 19, 0, 16, 0, 0 }, { 28, 19, 0, 16, 0, 0 }, { 31, 19, 0, 16, 0, 0 }, { 34, 19, 0, 16, 0, 0 }, - { 37, 19, 0, 16, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 14, 0, 16, 0, 0 }, + { 37, 19, 0, 16, 0, 0 }, { 40, 19, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 43, 19, 0, 16, 0, 0 }, { 46, 19, 0, 16, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 49, 15, 0, 16, 0, 0 }, { 52, 15, 0, 16, 0, 0 }, { 55, 15, 0, 16, 0, 0 }, { 56, 14, 0, 16, 0, 0 }, { 57, 12, 0, 16, 0, 0 }, { 58, 10, 0, 16, 0, 0 }, { 59, 8, 0, 16, 0, 0 }, { 57, 6, 0, 16, 0, 0 }, { 55, 4, 1, 16, 0, 0 }, { 53, 2, 1, 16, 0, 0 }, { 51, 1, 1, 16, 0, 0 }, { 49, 1, 1, 16, 0, 0 }, { 47, 1, 2, 16, 0, 0 }, { 45, 2, 2, 16, 0, 0 }, { 45, 4, 2, 16, 0, 0 }, { 44, 6, 2, 16, 0, 0 }, { 43, 8, 3, 16, 0, 0 }, { 43, 10, 3, 16, 0, 0 }, { 42, 12, 3, 16, 0, 0 }, { 43, 14, 3, 16, 0, 0 }, { 43, 16, 3, 16, 0, 0 }, { 43, 18, 3, 16, 0, 0 }, { 44, 20, 3, 16, 0, 0 }, { 44, 22, 3, 16, 0, 0 }, { 44, 24, 3, 16, 0, 0 }, { 45, 26, 3, 16, 0, 0 }, { 45, 28, 3, 16, 0, 0 }, { 45, 29, 3, 16, 0, 0 }, { 45, 30, 3, 16, 0, 0 }, { 46, 31, 3, 16, 0, 0 }, { 46, 32, 3, 16, 0, 0 }, { 46, 33, 3, 16, 0, 0 }, { 46, 34, 3, 16, 0, 0 }, { 46, 35, 3, 16, 0, 0 }, - { 46, 37, 0, 16, 0, 0 }, { 47, 39, 0, 16, 0, 0 }, { 47, 40, 0, 16, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 46, 37, 0, 16, 0, 0 }, { 47, 39, 0, 16, 0, 0 }, { 47, 40, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 47, 41, 0, 16, 0, 0 }, { 47, 42, 0, 16, 0, 0 }, { 47, 43, 0, 16, 0, 0 }, { 47, 44, 0, 16, 0, 0 }, { 48, 45, 0, 16, 0, 0 }, - { 48, 46, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 48, 59, 0, 8, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 48, 59, 0, 8, 0, 0 }, + { 48, 46, 0, 16, 0, 0 }, { 48, 47, 0, 16, 0, 0 }, { 48, 48, 0, 16, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 48, 59, 0, 8, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 48, 59, 0, 8, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_94EAD4, { - { -32768, 0, 0, 0, 0, 0 }, { 15, 31, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { 15, 26, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, - { 15, 26, 0, 24, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, + MINI_GOLF_STATE(Unk0), { 15, 31, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), + { 15, 26, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk3), { 15, 24, 0, 24, 0, 0 }, { 16, 21, 0, 24, 0, 0 }, { 16, 19, 0, 24, 0, 0 }, { 16, 17, 0, 24, 0, 0 }, { 15, 15, 0, 24, 0, 0 }, { 17, 13, 0, 24, 0, 0 }, { 17, 11, 0, 24, 0, 0 }, { 17, 9, 0, 24, 0, 0 }, { 17, 7, 0, 24, 0, 0 }, { 17, 5, 0, 24, 0, 0 }, { 17, 4, 0, 24, 0, 0 }, { 18, 3, 0, 24, 0, 0 }, { 18, 2, 0, 24, 0, 0 }, { 18, 1, 0, 24, 0, 0 }, { 18, 0, 0, 24, 0, 0 }, { 18, -1, 0, 24, 0, 0 }, { 18, -2, 0, 24, 0, 0 }, { 18, -1, 0, 24, 0, 0 }, { 18, 0, 0, 24, 0, 0 }, { 18, 1, 0, 24, 0, 0 }, { 18, 2, 0, 24, 0, 0 }, { 18, 3, 0, 24, 0, 0 }, { 18, 4, 0, 24, 0, 0 }, { 18, 5, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 19, 8, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, - { 19, 10, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { -32768, 3, 0, 0, 0, 0 }, { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, + { 19, 10, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), + MINI_GOLF_STATE(Unk3), { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 0, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, { 19, -6, 0, 24, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, - { -32768, 4, 0, 0, 0, 0 }, { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(Walk), { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 14, -25, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, { 10, -27, 0, 24, 0, 0 }, { 8, -28, 0, 24, 0, 0 }, { 6, -26, 0, 24, 0, 0 }, { 5, -25, 0, 24, 0, 0 }, { 4, -24, 1, 24, 0, 0 }, { 3, -23, 1, 24, 0, 0 }, { 2, -22, 1, 24, 0, 0 }, { 1, -21, 1, 24, 0, 0 }, { 1, -20, 1, 24, 0, 0 }, { 1, -19, 1, 24, 0, 0 }, { 1, -18, 1, 24, 0, 0 }, { 1, -17, 1, 24, 0, 0 }, { 1, -17, 1, 24, 0, 0 }, { 1, -17, 1, 24, 0, 0 }, { 1, -18, 1, 24, 0, 0 }, { 1, -19, 1, 24, 0, 0 }, { 1, -20, 1, 24, 0, 0 }, { 1, -21, 1, 24, 0, 0 }, { 2, -22, 1, 24, 0, 0 }, { 3, -23, 1, 24, 0, 0 }, { 4, -24, 1, 24, 0, 0 }, { 5, -25, 0, 24, 0, 0 }, { 6, -26, 0, 24, 0, 0 }, { 8, -28, 0, 24, 0, 0 }, { 10, -27, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, - { 14, -25, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, - { 19, -15, 0, 24, 0, 0 }, { 19, -12, 0, 24, 0, 0 }, { -32768, 4, 1, 0, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, { 19, -8, 0, 24, 0, 0 }, + { 14, -25, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), + { 19, -15, 0, 24, 0, 0 }, { 19, -12, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(PlaceBallDown), { 19, -9, 0, 24, 0, 0 }, { 19, -8, 0, 24, 0, 0 }, { 19, -7, 0, 24, 0, 0 }, { 19, -6, 0, 24, 0, 0 }, { 19, -5, 0, 24, 0, 0 }, { 19, -4, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, { 19, -2, 0, 24, 0, 0 }, { 19, -1, 0, 24, 0, 0 }, { 19, 0, 0, 24, 0, 0 }, { 19, 1, 0, 24, 0, 0 }, { 19, 2, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 4, 0, 24, 0, 0 }, { 19, 5, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 7, 0, 24, 0, 0 }, { 19, 8, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 10, 0, 24, 0, 0 }, { 19, 11, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, - { 19, 13, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, + { 19, 13, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 19, 14, 0, 24, 0, 0 }, { 19, 12, 0, 24, 0, 0 }, { 19, 9, 0, 24, 0, 0 }, { 19, 6, 0, 24, 0, 0 }, { 19, 3, 0, 24, 0, 0 }, { 19, 0, 0, 24, 0, 0 }, { 19, -3, 0, 24, 0, 0 }, - { 19, -6, 0, 24, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, - { -32768, 4, 1, 0, 0, 0 }, { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 14, -25, 0, 24, 0, 0 }, + { 19, -6, 0, 24, 0, 0 }, { 19, -9, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), { 19, -12, 0, 24, 0, 0 }, { 19, -15, 0, 24, 0, 0 }, + MINI_GOLF_ANIMATION(PlaceBallDown), { 15, -18, 0, 24, 0, 0 }, { 15, -21, 0, 24, 0, 0 }, { 15, -24, 0, 24, 0, 0 }, { 14, -25, 0, 24, 0, 0 }, { 12, -26, 0, 24, 0, 0 }, { 10, -27, 0, 24, 0, 0 }, { 8, -28, 0, 24, 0, 0 }, { 6, -26, 0, 24, 0, 0 }, { 4, -24, 1, 24, 0, 0 }, { 2, -22, 1, 24, 0, 0 }, { 1, -20, 1, 24, 0, 0 }, { 1, -18, 1, 24, 0, 0 }, { 1, -16, 2, 24, 0, 0 }, { 2, -14, 2, 24, 0, 0 }, { 4, -14, 2, 24, 0, 0 }, { 6, -13, 2, 24, 0, 0 }, { 8, -12, 3, 24, 0, 0 }, { 10, -12, 3, 24, 0, 0 }, { 12, -11, 3, 24, 0, 0 }, { 14, -12, 3, 24, 0, 0 }, { 16, -12, 3, 24, 0, 0 }, { 18, -12, 3, 24, 0, 0 }, { 20, -13, 3, 24, 0, 0 }, { 22, -13, 3, 24, 0, 0 }, { 24, -13, 3, 24, 0, 0 }, { 26, -14, 3, 24, 0, 0 }, { 28, -14, 3, 24, 0, 0 }, { 29, -14, 3, 24, 0, 0 }, { 30, -14, 3, 24, 0, 0 }, { 31, -15, 3, 24, 0, 0 }, { 32, -15, 3, 24, 0, 0 }, { 33, -15, 3, 24, 0, 0 }, { 34, -15, 3, 24, 0, 0 }, { 35, -15, 3, 24, 0, 0 }, - { 37, -15, 0, 24, 0, 0 }, { 39, -16, 0, 24, 0, 0 }, { 40, -16, 0, 24, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, + { 37, -15, 0, 24, 0, 0 }, { 39, -16, 0, 24, 0, 0 }, { 40, -16, 0, 24, 0, 0 }, MINI_GOLF_STATE(Unk2), MINI_GOLF_STATE(Unk3), { 41, -16, 0, 24, 0, 0 }, { 42, -16, 0, 24, 0, 0 }, { 43, -16, 0, 24, 0, 0 }, { 44, -16, 0, 24, 0, 0 }, { 45, -17, 0, 24, 0, 0 }, - { 46, -17, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, { -32768, 4, 0, 0, 0, 0 }, { -32768, 2, 0, 0, 0, 0 }, - { 59, -17, 0, 16, 0, 0 }, { -32768, 6, 0, 0, 0, 0 }, { -32768, 3, 0, 0, 0, 0 }, { 59, -17, 0, 16, 0, 0 }, + { 46, -17, 0, 24, 0, 0 }, { 47, -17, 0, 24, 0, 0 }, { 48, -17, 0, 24, 0, 0 }, MINI_GOLF_ANIMATION(Walk), MINI_GOLF_STATE(Unk2), + { 59, -17, 0, 16, 0, 0 }, MINI_GOLF_STATE(Unk6), MINI_GOLF_STATE(Unk3), { 59, -17, 0, 16, 0, 0 }, }) CREATE_VEHICLE_INFO(TrackVehicleInfo_95275E, { diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 88cadb74d8..0983862082 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -393,7 +393,7 @@ static constexpr const uint8_t mini_golf_peep_animation_frames_swing_left[] = { }; /** rct2: 0x0093348D */ -static constexpr const uint8_t mini_golf_peep_animation_frames_place_ball_upwards[] = { +static constexpr const uint8_t mini_golf_peep_animation_frames_pickup_ball[] = { 12, 13, 14, 15, 14, 13, 12, }; @@ -403,17 +403,17 @@ static constexpr const uint8_t mini_golf_peep_animation_frames_jump[] = { }; /** rct2: 0x009334A5 */ -static constexpr const uint8_t mini_golf_peep_animation_frames_pickup_ball[] = { +static constexpr const uint8_t mini_golf_peep_animation_frames_place_ball_upwards[] = { 15, 14, 13, 12, }; /** rct2: 0x009334C5 */ -static constexpr const uint8_t mini_golf_peep_animation_frames_put[] = { +static constexpr const uint8_t mini_golf_peep_animation_frames_putt[] = { 35, 36, 36, 36, 36, 36, 35, 35, 35, 35, }; /** rct2: 0x009334AA */ -static constexpr const uint8_t mini_golf_peep_animation_frames_put_left[] = { +static constexpr const uint8_t mini_golf_peep_animation_frames_putt_left[] = { 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, }; @@ -422,24 +422,24 @@ static constexpr const uint8_t* mini_golf_peep_animation_frames[] = { mini_golf_peep_animation_frames_walk, mini_golf_peep_animation_frames_place_ball_downwards, mini_golf_peep_animation_frames_swing_left, - mini_golf_peep_animation_frames_place_ball_upwards, - mini_golf_peep_animation_frames_jump, mini_golf_peep_animation_frames_pickup_ball, - mini_golf_peep_animation_frames_put_left, + mini_golf_peep_animation_frames_jump, + mini_golf_peep_animation_frames_place_ball_upwards, + mini_golf_peep_animation_frames_putt_left, mini_golf_peep_animation_frames_swing, - mini_golf_peep_animation_frames_put, + mini_golf_peep_animation_frames_putt, }; const size_t mini_golf_peep_animation_lengths[] = { std::size(mini_golf_peep_animation_frames_walk), std::size(mini_golf_peep_animation_frames_place_ball_downwards), std::size(mini_golf_peep_animation_frames_swing_left), - std::size(mini_golf_peep_animation_frames_place_ball_upwards), - std::size(mini_golf_peep_animation_frames_jump), std::size(mini_golf_peep_animation_frames_pickup_ball), - std::size(mini_golf_peep_animation_frames_put_left), + std::size(mini_golf_peep_animation_frames_jump), + std::size(mini_golf_peep_animation_frames_place_ball_upwards), + std::size(mini_golf_peep_animation_frames_putt_left), std::size(mini_golf_peep_animation_frames_swing), - std::size(mini_golf_peep_animation_frames_put), + std::size(mini_golf_peep_animation_frames_putt), }; // clang-format on @@ -1237,7 +1237,7 @@ void vehicle_visual_mini_golf_player( if (peep == nullptr) return; - uint8_t frame = mini_golf_peep_animation_frames[vehicle->mini_golf_current_animation][vehicle->animation_frame]; + uint8_t frame = mini_golf_peep_animation_frames[EnumValue(vehicle->mini_golf_current_animation)][vehicle->animation_frame]; uint32_t ebx = (frame << 2) + (imageDirection >> 3); uint32_t image_id = rideEntry->vehicles[0].base_image_id + 1 + ebx; @@ -1251,7 +1251,7 @@ void vehicle_visual_mini_golf_player( void vehicle_visual_mini_golf_ball( paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle) { - if (vehicle->mini_golf_current_animation != 1) + if (vehicle->mini_golf_current_animation != MiniGolfAnimation::PlaceBallDown) { return; } From 8fa4823055760d44d786f48fc85e79eb3c0e975b Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 25 Aug 2021 15:37:44 +0300 Subject: [PATCH 228/681] Pass rct_drawpixelinfo as explicit argument, make DrawSpriteArgs const --- src/openrct2/CmdlineSprite.cpp | 4 +-- src/openrct2/drawing/Drawing.Sprite.BMP.cpp | 34 +++++++++--------- src/openrct2/drawing/Drawing.Sprite.RLE.cpp | 38 ++++++++++----------- src/openrct2/drawing/Drawing.Sprite.cpp | 10 +++--- src/openrct2/drawing/Drawing.h | 14 ++++---- 5 files changed, 48 insertions(+), 52 deletions(-) diff --git a/src/openrct2/CmdlineSprite.cpp b/src/openrct2/CmdlineSprite.cpp index a0ecfed2db..1d2459f7ee 100644 --- a/src/openrct2/CmdlineSprite.cpp +++ b/src/openrct2/CmdlineSprite.cpp @@ -199,8 +199,8 @@ static bool SpriteImageExport(const rct_g1_element& spriteElement, const char* o dpi.zoom_level = 0; DrawSpriteArgs args( - &dpi, ImageId(), PaletteMap::GetDefault(), spriteElement, 0, 0, spriteElement.width, spriteElement.height, pixels); - gfx_sprite_to_buffer(args); + ImageId(), PaletteMap::GetDefault(), spriteElement, 0, 0, spriteElement.width, spriteElement.height, pixels); + gfx_sprite_to_buffer(dpi, args); auto const pixels8 = dpi.bits; auto const pixelsLen = (dpi.width + dpi.pitch) * dpi.height; diff --git a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp index 8c4f1d6e75..3a2925f09c 100644 --- a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp @@ -9,16 +9,15 @@ #include "Drawing.h" -template static void FASTCALL DrawBMPSpriteMagnify(DrawSpriteArgs& args) +template static void FASTCALL DrawBMPSpriteMagnify(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { auto& g1 = args.SourceImage; auto src = g1.offset + ((static_cast(g1.width) * args.SrcY) + args.SrcX); auto dst = args.DestinationBits; auto& paletteMap = args.PalMap; - auto dpi = args.DPI; - auto zoomLevel = dpi->zoom_level; + auto zoomLevel = dpi.zoom_level; size_t srcLineWidth = g1.width; - size_t dstLineWidth = (static_cast(dpi->width) / zoomLevel) + dpi->pitch; + size_t dstLineWidth = (static_cast(dpi.width) / zoomLevel) + dpi.pitch; uint8_t zoom = 1 / zoomLevel; auto width = args.Width / zoomLevel; auto height = args.Height / zoomLevel; @@ -36,7 +35,7 @@ template static void FASTCALL DrawBMPSpriteMagnify(DrawSpr } } -template static void FASTCALL DrawBMPSpriteMinify(DrawSpriteArgs& args) +template static void FASTCALL DrawBMPSpriteMinify(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { auto& g1 = args.SourceImage; auto src = g1.offset + ((static_cast(g1.width) * args.SrcY) + args.SrcX); @@ -44,10 +43,9 @@ template static void FASTCALL DrawBMPSpriteMinify(DrawSpri auto& paletteMap = args.PalMap; auto width = args.Width; auto height = args.Height; - auto dpi = args.DPI; - auto zoomLevel = dpi->zoom_level; + auto zoomLevel = dpi.zoom_level; size_t srcLineWidth = g1.width * zoomLevel; - size_t dstLineWidth = (static_cast(dpi->width) / zoomLevel) + dpi->pitch; + size_t dstLineWidth = (static_cast(dpi.width) / zoomLevel) + dpi.pitch; uint8_t zoom = 1 * zoomLevel; for (; height > 0; height -= zoom) { @@ -62,15 +60,15 @@ template static void FASTCALL DrawBMPSpriteMinify(DrawSpri } } -template static void FASTCALL DrawBMPSprite(DrawSpriteArgs& args) +template static void FASTCALL DrawBMPSprite(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { - if (args.DPI->zoom_level < 0) + if (dpi.zoom_level < 0) { - DrawBMPSpriteMagnify(args); + DrawBMPSpriteMagnify(dpi, args); } else { - DrawBMPSpriteMinify(args); + DrawBMPSpriteMinify(dpi, args); } } @@ -80,7 +78,7 @@ template static void FASTCALL DrawBMPSprite(DrawSpriteArgs * rct2: 0x0067A690 * @param imageId Only flags are used. */ -void FASTCALL gfx_bmp_sprite_to_buffer(DrawSpriteArgs& args) +void FASTCALL gfx_bmp_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { auto imageId = args.Image; @@ -90,29 +88,29 @@ void FASTCALL gfx_bmp_sprite_to_buffer(DrawSpriteArgs& args) if (imageId.IsBlended()) { // Copy non-transparent bitmap data but blend src and dst pixel using the palette map. - DrawBMPSprite(args); + DrawBMPSprite(dpi, args); } else { // Copy non-transparent bitmap data but re-colour using the palette map. - DrawBMPSprite(args); + DrawBMPSprite(dpi, args); } } else if (imageId.IsBlended()) { // Image is only a transparency mask. Just colour the pixels using the palette map. // Used for glass. - DrawBMPSprite(args); + DrawBMPSprite(dpi, args); return; } else if (!(args.SourceImage.flags & G1_FLAG_BMP)) { // Copy raw bitmap data to target - DrawBMPSprite(args); + DrawBMPSprite(dpi, args); } else { // Copy raw bitmap data to target but exclude transparent pixels - DrawBMPSprite(args); + DrawBMPSprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp index 1e5d49a712..45e27c8e96 100644 --- a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp @@ -12,9 +12,9 @@ #include #include -template static void FASTCALL DrawRLESpriteMagnify(DrawSpriteArgs& args) +template +static void FASTCALL DrawRLESpriteMagnify(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { - auto dpi = args.DPI; auto src0 = args.SourceImage.offset; auto dst0 = args.DestinationBits; auto srcX = args.SrcX; @@ -23,7 +23,7 @@ template static void FASTCALL DrawRLESpriteM auto height = args.Height; auto& paletteMap = args.PalMap; auto zoom = 1 << TZoom; - auto dstLineWidth = (static_cast(dpi->width) << TZoom) + dpi->pitch; + auto dstLineWidth = (static_cast(dpi.width) << TZoom) + dpi.pitch; // Move up to the first line of the image if source_y_start is negative. Why does this even occur? if (srcY < 0) @@ -83,9 +83,9 @@ template static void FASTCALL DrawRLESpriteM } } -template static void FASTCALL DrawRLESpriteMinify(DrawSpriteArgs& args) +template +static void FASTCALL DrawRLESpriteMinify(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { - auto dpi = args.DPI; auto src0 = args.SourceImage.offset; auto dst0 = args.DestinationBits; auto srcX = args.SrcX; @@ -93,7 +93,7 @@ template static void FASTCALL DrawRLESpriteM auto width = args.Width; auto height = args.Height; auto zoom = 1 << TZoom; - auto dstLineWidth = (static_cast(dpi->width) >> TZoom) + dpi->pitch; + auto dstLineWidth = (static_cast(dpi.width) >> TZoom) + dpi.pitch; // Move up to the first line of the image if source_y_start is negative. Why does this even occur? if (srcY < 0) @@ -178,28 +178,28 @@ template static void FASTCALL DrawRLESpriteM } } -template static void FASTCALL DrawRLESprite(DrawSpriteArgs& args) +template static void FASTCALL DrawRLESprite(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { - auto zoom_level = static_cast(args.DPI->zoom_level); + auto zoom_level = static_cast(dpi.zoom_level); switch (zoom_level) { case -2: - DrawRLESpriteMagnify(args); + DrawRLESpriteMagnify(dpi, args); break; case -1: - DrawRLESpriteMagnify(args); + DrawRLESpriteMagnify(dpi, args); break; case 0: - DrawRLESpriteMinify(args); + DrawRLESpriteMinify(dpi, args); break; case 1: - DrawRLESpriteMinify(args); + DrawRLESpriteMinify(dpi, args); break; case 2: - DrawRLESpriteMinify(args); + DrawRLESpriteMinify(dpi, args); break; case 3: - DrawRLESpriteMinify(args); + DrawRLESpriteMinify(dpi, args); break; default: assert(false); @@ -213,25 +213,25 @@ template static void FASTCALL DrawRLESprite(DrawSpriteArgs * rct2: 0x0067AA18 * @param imageId Only flags are used. */ -void FASTCALL gfx_rle_sprite_to_buffer(DrawSpriteArgs& args) +void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { if (args.Image.HasPrimary()) { if (args.Image.IsBlended()) { - DrawRLESprite(args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(args); + DrawRLESprite(dpi, args); } } else if (args.Image.IsBlended()) { - DrawRLESprite(args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(args); + DrawRLESprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 50fe767c8b..786ec46fba 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -575,19 +575,19 @@ void FASTCALL gfx_draw_sprite_palette_set_software( // Move the pointer to the start point of the destination dest_pointer += ((dpi->width / zoom_level) + dpi->pitch) * dest_start_y + dest_start_x; - DrawSpriteArgs args(dpi, imageId, paletteMap, *g1, source_start_x, source_start_y, width, height, dest_pointer); - gfx_sprite_to_buffer(args); + DrawSpriteArgs args(imageId, paletteMap, *g1, source_start_x, source_start_y, width, height, dest_pointer); + gfx_sprite_to_buffer(*dpi, args); } -void FASTCALL gfx_sprite_to_buffer(DrawSpriteArgs& args) +void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args) { if (args.SourceImage.flags & G1_FLAG_RLE_COMPRESSION) { - gfx_rle_sprite_to_buffer(args); + gfx_rle_sprite_to_buffer(dpi, args); } else if (!(args.SourceImage.flags & G1_FLAG_1)) { - gfx_bmp_sprite_to_buffer(args); + gfx_bmp_sprite_to_buffer(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 1ea01e08e7..47cb785d20 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -543,7 +543,6 @@ public: struct DrawSpriteArgs { - rct_drawpixelinfo* DPI; ImageId Image; const PaletteMap& PalMap; const rct_g1_element& SourceImage; @@ -554,10 +553,9 @@ struct DrawSpriteArgs uint8_t* DestinationBits; DrawSpriteArgs( - rct_drawpixelinfo* dpi, ImageId image, const PaletteMap& palMap, const rct_g1_element& sourceImage, int32_t srcX, - int32_t srcY, int32_t width, int32_t height, uint8_t* destinationBits) - : DPI(dpi) - , Image(image) + ImageId image, const PaletteMap& palMap, const rct_g1_element& sourceImage, int32_t srcX, int32_t srcY, int32_t width, + int32_t height, uint8_t* destinationBits) + : Image(image) , PalMap(palMap) , SourceImage(sourceImage) , SrcX(srcX) @@ -713,9 +711,9 @@ void gfx_object_free_images(uint32_t baseImageId, uint32_t count); void gfx_object_check_all_images_freed(); size_t ImageListGetUsedCount(); size_t ImageListGetMaximum(); -void FASTCALL gfx_sprite_to_buffer(DrawSpriteArgs& args); -void FASTCALL gfx_bmp_sprite_to_buffer(DrawSpriteArgs& args); -void FASTCALL gfx_rle_sprite_to_buffer(DrawSpriteArgs& args); +void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args); +void FASTCALL gfx_bmp_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args); +void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args); void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, ImageId image_id, const ScreenCoordsXY& coords); void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, int32_t image_id, const ScreenCoordsXY& coords, uint32_t tertiary_colour); void FASTCALL From c209021229a32109e0909daac563e8cab7c78a94 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 25 Aug 2021 14:03:48 +0100 Subject: [PATCH 229/681] Remove unused serialiser trait (#15279) --- src/openrct2/core/DataSerialiserTraits.h | 28 ------------------------ 1 file changed, 28 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 7284f69851..3953709582 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -584,34 +584,6 @@ template<> struct DataSerializerTraits_t stream->Write(msg, strlen(msg)); } }; -template<> struct DataSerializerTraits_t -{ - static void encode(OpenRCT2::IStream* stream, const rct12_xyzd8& coord) - { - stream->WriteValue(ByteSwapBE(coord.x)); - stream->WriteValue(ByteSwapBE(coord.y)); - stream->WriteValue(ByteSwapBE(coord.z)); - stream->WriteValue(ByteSwapBE(coord.direction)); - } - - static void decode(OpenRCT2::IStream* stream, rct12_xyzd8& coord) - { - auto x = ByteSwapBE(stream->ReadValue()); - auto y = ByteSwapBE(stream->ReadValue()); - auto z = ByteSwapBE(stream->ReadValue()); - auto d = ByteSwapBE(stream->ReadValue()); - coord = rct12_xyzd8{ x, y, z, d }; - } - - static void log(OpenRCT2::IStream* stream, const rct12_xyzd8& coord) - { - char msg[128] = {}; - snprintf( - msg, sizeof(msg), "rct12_xyzd8(x = %d, y = %d, z = %d, direction = %d)", coord.x, coord.y, coord.z, - coord.direction); - stream->Write(msg, strlen(msg)); - } -}; template<> struct DataSerializerTraits_t { From b97c46421ea5059d4aba07c9ed38d58fcc5c38d5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 25 Aug 2021 20:44:24 +0100 Subject: [PATCH 230/681] Move all RCT1 to RCT1 namespace (#15283) --- src/openrct2/config/Config.cpp | 2 +- src/openrct2/rct1/RCT1.h | 2407 ++++++------- src/openrct2/rct1/S4Importer.cpp | 5449 +++++++++++++++--------------- src/openrct2/rct1/T4Importer.cpp | 478 +-- src/openrct2/rct1/Tables.cpp | 18 +- src/openrct2/sprites.h | 2 +- 6 files changed, 4185 insertions(+), 4171 deletions(-) diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 783697a7b7..84baec7c5e 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -1001,7 +1001,7 @@ bool RCT1DataPresentAtLocation(const utf8* path) bool CsgIsUsable(const rct_gx& csg) { - return csg.header.total_size == RCT1_LL_CSG1_DAT_FILE_SIZE && csg.header.num_entries == RCT1_NUM_LL_CSG_ENTRIES; + return csg.header.total_size == RCT1::RCT1_LL_CSG1_DAT_FILE_SIZE && csg.header.num_entries == RCT1::RCT1_NUM_LL_CSG_ENTRIES; } bool CsgAtLocationIsUsable(const utf8* path) diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index a516081618..e2b0293b91 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -18,1273 +18,1276 @@ #include "../world/Climate.h" #include "../world/MapAnimation.h" -constexpr const uint16_t RCT1_MAX_TILE_ELEMENTS = 0xC000; -constexpr const uint16_t RCT1_MAX_SPRITES = 5000; -constexpr const uint8_t RCT1_MAX_TRAINS_PER_RIDE = 12; -constexpr const uint8_t RCT1_MAX_MAP_SIZE = 128; -constexpr const uint8_t RCT1_MAX_STAFF = 116; -constexpr const uint8_t RCT1_RESEARCH_FLAGS_SEPARATOR = 0xFF; -constexpr const uint16_t RCT1_MAX_ANIMATED_OBJECTS = 1000; -constexpr const uint8_t RCT1_MAX_BANNERS = 100; -constexpr int32_t RCT1_COORDS_Z_STEP = 4; -constexpr const uint32_t RCT1_NUM_LL_CSG_ENTRIES = 69917; -constexpr const uint32_t RCT1_LL_CSG1_DAT_FILE_SIZE = 41402869; -constexpr const uint32_t RCT1_NUM_TERRAIN_SURFACES = 16; -constexpr const uint32_t RCT1_NUM_TERRAIN_EDGES = 15; - -struct ParkLoadResult; +namespace RCT1 +{ + constexpr const uint16_t RCT1_MAX_TILE_ELEMENTS = 0xC000; + constexpr const uint16_t RCT1_MAX_SPRITES = 5000; + constexpr const uint8_t RCT1_MAX_TRAINS_PER_RIDE = 12; + constexpr const uint8_t RCT1_MAX_MAP_SIZE = 128; + constexpr const uint8_t RCT1_MAX_STAFF = 116; + constexpr const uint8_t RCT1_RESEARCH_FLAGS_SEPARATOR = 0xFF; + constexpr const uint16_t RCT1_MAX_ANIMATED_OBJECTS = 1000; + constexpr const uint8_t RCT1_MAX_BANNERS = 100; + constexpr int32_t RCT1_COORDS_Z_STEP = 4; + constexpr const uint32_t RCT1_NUM_LL_CSG_ENTRIES = 69917; + constexpr const uint32_t RCT1_LL_CSG1_DAT_FILE_SIZE = 41402869; + constexpr const uint32_t RCT1_NUM_TERRAIN_SURFACES = 16; + constexpr const uint32_t RCT1_NUM_TERRAIN_EDGES = 15; #pragma pack(push, 1) -struct rct1_entrance -{ - uint16_t x; - uint16_t y; - uint16_t z; - uint8_t direction; -}; -assert_struct_size(rct1_entrance, 7); - -/** - * RCT1 ride structure - * size: 0x260 - */ -struct rct1_ride -{ - uint8_t type; // 0x000 - uint8_t vehicle_type; // 0x001 - uint16_t lifecycle_flags; // 0x002 - uint8_t operating_mode; // 0x004 - uint8_t colour_scheme; // 0x005 - struct + struct rct1_entrance { - colour_t body; - colour_t trim; - } vehicle_colours[RCT1_MAX_TRAINS_PER_RIDE]; // 0x006 - colour_t track_primary_colour; // 0x01E - colour_t track_secondary_colour; // 0x01F - colour_t track_support_colour; // 0x020 - uint8_t status; // 0x021 - uint16_t name; // 0x022 - uint16_t name_argument_ride; // 0x024 - uint16_t name_argument_number; // 0x026 - RCT12xy8 overall_view; // 0x028 - RCT12xy8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x02A - uint8_t station_height[RCT12_MAX_STATIONS_PER_RIDE]; // 0x032 - uint8_t station_length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x036 - uint8_t station_light[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03A - uint8_t station_depart[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03E - RCT12xy8 entrance[RCT12_MAX_STATIONS_PER_RIDE]; // 0x042 - RCT12xy8 exit[RCT12_MAX_STATIONS_PER_RIDE]; // 0x04A - uint16_t last_peep_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x052 - uint8_t num_peeps_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x05A - uint16_t vehicles[RCT1_MAX_TRAINS_PER_RIDE]; // 0x05E - uint8_t depart_flags; // 0x076 - uint8_t num_stations; // 0x077 - uint8_t num_trains; // 0x078 - uint8_t num_cars_per_train; // 0x079 - uint8_t proposed_num_vehicles; // 0x07A - uint8_t proposed_num_cars_per_train; // 0x07B - uint8_t max_trains; // 0x07C - uint8_t min_max_cars_per_train; // 0x07D - uint8_t min_waiting_time; // 0x07E - uint8_t max_waiting_time; // 0x07F - uint8_t operation_option; // 0x080 - uint8_t boat_hire_return_direction; // 0x081 - RCT12xy8 boat_hire_return_position; // 0x082 - uint8_t data_logging_index; // 0x084 - uint8_t special_track_elements; // 0x085 - uint16_t unk_86; // 0x086 - int32_t max_speed; // 0x088 - int32_t average_speed; // 0x08C - uint8_t current_test_segment; // 0x090 - uint8_t average_speed_test_timeout; // 0x091 - uint8_t pad_0E2[0x2]; // 0x092 - int32_t length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x094 - uint16_t time[RCT12_MAX_STATIONS_PER_RIDE]; // 0x0A4 - fixed16_2dp max_positive_vertical_g; // 0x0AC - fixed16_2dp max_negative_vertical_g; // 0x0AE - fixed16_2dp max_lateral_g; // 0x0B0 - fixed16_2dp previous_vertical_g; // 0x0B2 - fixed16_2dp previous_lateral_g; // 0x0B4 - uint8_t pad_B6[0x2]; // 0x0B6 - uint32_t testing_flags; // 0x0B8 - // x y map location of the current track piece during a test - // this is to prevent counting special tracks multiple times - RCT12xy8 cur_test_track_location; // 0x0BC - // Next 3 variables are related (XXXX XYYY ZZZa aaaa) - uint16_t turn_count_default; // 0x0BE X = current turn count - uint16_t turn_count_banked; // 0x0C0 - uint16_t turn_count_sloped; // 0x0C2 X = number turns > 3 elements - union - { - uint8_t num_inversions; // 0x0C4 - uint8_t num_holes; + uint16_t x; + uint16_t y; + uint16_t z; + uint8_t direction; }; - uint8_t num_drops; // 0x0C5 - uint8_t start_drop_height; // 0x0C6 - uint8_t highest_drop_height; // 0x0C7 - int32_t sheltered_length; // 0x0C8 - uint8_t unk_CC[2]; // 0x0CC - uint8_t num_sheltered_sections; // 0x0CE - // see cur_test_track_location - uint8_t cur_test_track_z; // 0x0CF - int16_t unk_D0; // 0x0D0 - int16_t unk_D2; // 0x0D2 - // Customer count in the last 10 * 960 game ticks (sliding window) - uint16_t num_customers[CUSTOMER_HISTORY_SIZE]; // 0xD4 - money16 price; // 0x0E8 - RCT12xy8 chairlift_bullwheel_location[2]; // 0x0EA - uint8_t chairlift_bullwheel_z[2]; // 0x0EE - union + assert_struct_size(rct1_entrance, 7); + + /** + * RCT1 ride structure + * size: 0x260 + */ + struct rct1_ride { - RatingTuple ratings; + uint8_t type; // 0x000 + uint8_t vehicle_type; // 0x001 + uint16_t lifecycle_flags; // 0x002 + uint8_t operating_mode; // 0x004 + uint8_t colour_scheme; // 0x005 struct { - ride_rating excitement; // 0x0F0 - ride_rating intensity; // 0x0F2 - ride_rating nausea; // 0x0F4 - }; - }; - uint16_t value; // 0x0F6 - uint16_t chairlift_bullwheel_rotation; // 0x0F8 - uint8_t satisfaction; // 0x0FA - uint8_t satisfaction_time_out; // 0x0FB - uint8_t satisfaction_next; // 0x0FC - uint8_t window_invalidate_flags; // 0x0FD - uint8_t unk_FE[2]; // 0x0FE - uint32_t total_customers; // 0x100 - money32 total_profit; // 0x104 - uint8_t popularity; // 0x108 - uint8_t popularity_time_out; // 0x109 - uint8_t popularity_next; // 0x10A - uint8_t num_riders; // 0x10B - uint8_t music_tune_id; // 0x10C - uint8_t slide_in_use; // 0x10D - union - { - uint16_t slide_peep; // 0x10E - uint16_t maze_tiles; // 0x10E - }; - uint8_t pad_110[0xE]; // 0x110 - uint8_t slide_peep_t_shirt_colour; // 0x11E - uint8_t pad_11F[0x7]; // 0x11F - uint8_t spiral_slide_progress; // 0x126 - uint8_t pad_127[0x9]; // 0x127 - int16_t build_date; // 0x130 - money16 upkeep_cost; // 0x131 - uint16_t race_winner; // 0x132 - uint8_t unk_134[2]; // 0x134 - uint32_t music_position; // 0x138 - uint8_t breakdown_reason_pending; // 0x13C - uint8_t mechanic_status; // 0x13D - uint16_t mechanic; // 0x13E - uint8_t inspection_station; // 0x140 - uint8_t broken_vehicle; // 0x141 - uint8_t broken_car; // 0x142 - uint8_t breakdown_reason; // 0x143 - money16 price_secondary; // 0x144 - union - { - struct + colour_t body; + colour_t trim; + } vehicle_colours[RCT1_MAX_TRAINS_PER_RIDE]; // 0x006 + colour_t track_primary_colour; // 0x01E + colour_t track_secondary_colour; // 0x01F + colour_t track_support_colour; // 0x020 + uint8_t status; // 0x021 + uint16_t name; // 0x022 + uint16_t name_argument_ride; // 0x024 + uint16_t name_argument_number; // 0x026 + RCT12xy8 overall_view; // 0x028 + RCT12xy8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x02A + uint8_t station_height[RCT12_MAX_STATIONS_PER_RIDE]; // 0x032 + uint8_t station_length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x036 + uint8_t station_light[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03A + uint8_t station_depart[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03E + RCT12xy8 entrance[RCT12_MAX_STATIONS_PER_RIDE]; // 0x042 + RCT12xy8 exit[RCT12_MAX_STATIONS_PER_RIDE]; // 0x04A + uint16_t last_peep_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x052 + uint8_t num_peeps_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x05A + uint16_t vehicles[RCT1_MAX_TRAINS_PER_RIDE]; // 0x05E + uint8_t depart_flags; // 0x076 + uint8_t num_stations; // 0x077 + uint8_t num_trains; // 0x078 + uint8_t num_cars_per_train; // 0x079 + uint8_t proposed_num_vehicles; // 0x07A + uint8_t proposed_num_cars_per_train; // 0x07B + uint8_t max_trains; // 0x07C + uint8_t min_max_cars_per_train; // 0x07D + uint8_t min_waiting_time; // 0x07E + uint8_t max_waiting_time; // 0x07F + uint8_t operation_option; // 0x080 + uint8_t boat_hire_return_direction; // 0x081 + RCT12xy8 boat_hire_return_position; // 0x082 + uint8_t data_logging_index; // 0x084 + uint8_t special_track_elements; // 0x085 + uint16_t unk_86; // 0x086 + int32_t max_speed; // 0x088 + int32_t average_speed; // 0x08C + uint8_t current_test_segment; // 0x090 + uint8_t average_speed_test_timeout; // 0x091 + uint8_t pad_0E2[0x2]; // 0x092 + int32_t length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x094 + uint16_t time[RCT12_MAX_STATIONS_PER_RIDE]; // 0x0A4 + fixed16_2dp max_positive_vertical_g; // 0x0AC + fixed16_2dp max_negative_vertical_g; // 0x0AE + fixed16_2dp max_lateral_g; // 0x0B0 + fixed16_2dp previous_vertical_g; // 0x0B2 + fixed16_2dp previous_lateral_g; // 0x0B4 + uint8_t pad_B6[0x2]; // 0x0B6 + uint32_t testing_flags; // 0x0B8 + // x y map location of the current track piece during a test + // this is to prevent counting special tracks multiple times + RCT12xy8 cur_test_track_location; // 0x0BC + // Next 3 variables are related (XXXX XYYY ZZZa aaaa) + uint16_t turn_count_default; // 0x0BE X = current turn count + uint16_t turn_count_banked; // 0x0C0 + uint16_t turn_count_sloped; // 0x0C2 X = number turns > 3 elements + union { - uint8_t reliability_subvalue; // 0x146, 0 - 255, acts like the decimals for reliability_percentage - uint8_t reliability_percentage; // 0x147, Starts at 100 and decreases from there. + uint8_t num_inversions; // 0x0C4 + uint8_t num_holes; }; - uint16_t reliability; // 0x146 - }; - uint8_t unreliability_factor; // 0x148 - uint8_t downtime; // 0x149 - uint8_t inspection_interval; // 0x14A - uint8_t last_inspection; // 0x14B - uint8_t unk_14C[20]; // 0x14C - money32 income_per_hour; // 0x160 - money32 profit; // 0x164 - uint8_t queue_time[RCT12_MAX_STATIONS_PER_RIDE]; // 0x168 - colour_t track_colour_main[4]; // 0x16C - colour_t track_colour_additional[4]; // 0x170 - colour_t track_colour_supports[4]; // 0x174 - uint8_t music; // 0x178 - uint8_t entrance_style; // 0x179 - uint8_t unk_17A[230]; // 0x17A -}; -assert_struct_size(rct1_ride, 0x260); - -struct rct1_unk_sprite : RCT12SpriteBase -{ - uint8_t pad_1F[3]; // 0x1f - rct_string_id name_string_idx; // 0x22 - uint16_t var_24; - uint16_t frame; // 0x26 - uint8_t var_28[3]; - uint8_t var_2B; - uint8_t pad_2C[0x45]; - uint8_t var_71; -}; - -struct rct1_vehicle : RCT12SpriteBase -{ - uint8_t Pitch; // 0x1F - uint8_t bank_rotation; // 0x20 - uint8_t pad_21[3]; - int32_t remaining_distance; // 0x24 - int32_t velocity; // 0x28 - int32_t acceleration; // 0x2C - uint8_t ride; // 0x30 - uint8_t vehicle_type; // 0x31 - rct_vehicle_colour colours; // 0x32 - union - { - uint16_t track_progress; // 0x34 - struct + uint8_t num_drops; // 0x0C5 + uint8_t start_drop_height; // 0x0C6 + uint8_t highest_drop_height; // 0x0C7 + int32_t sheltered_length; // 0x0C8 + uint8_t unk_CC[2]; // 0x0CC + uint8_t num_sheltered_sections; // 0x0CE + // see cur_test_track_location + uint8_t cur_test_track_z; // 0x0CF + int16_t unk_D0; // 0x0D0 + int16_t unk_D2; // 0x0D2 + // Customer count in the last 10 * 960 game ticks (sliding window) + uint16_t num_customers[CUSTOMER_HISTORY_SIZE]; // 0xD4 + money16 price; // 0x0E8 + RCT12xy8 chairlift_bullwheel_location[2]; // 0x0EA + uint8_t chairlift_bullwheel_z[2]; // 0x0EE + union { - int8_t var_34; - uint8_t var_35; + RatingTuple ratings; + struct + { + ride_rating excitement; // 0x0F0 + ride_rating intensity; // 0x0F2 + ride_rating nausea; // 0x0F4 + }; }; - }; - union - { - int16_t TrackTypeAndDirection; // 0x36 - RCT12xy8 boat_location; // 0x36 - }; - uint16_t track_x; // 0x38 - uint16_t track_y; // 0x3A - uint16_t track_z; // 0x3C - uint16_t next_vehicle_on_train; // 0x3E - - // The previous vehicle on the same train or the last vehicle on the previous or only train. - uint16_t prev_vehicle_on_ride; // 0x40 - - // The next vehicle on the same train or the first vehicle on the next or only train - uint16_t next_vehicle_on_ride; // 0x42 - - uint16_t var_44; - uint16_t mass; // 0x46 - uint16_t update_flags; // 0x48 - uint8_t SwingSprite; - uint8_t current_station; // 0x4B - union - { - int16_t SwingPosition; // 0x4C - int16_t current_time; // 0x4C - struct + uint16_t value; // 0x0F6 + uint16_t chairlift_bullwheel_rotation; // 0x0F8 + uint8_t satisfaction; // 0x0FA + uint8_t satisfaction_time_out; // 0x0FB + uint8_t satisfaction_next; // 0x0FC + uint8_t window_invalidate_flags; // 0x0FD + uint8_t unk_FE[2]; // 0x0FE + uint32_t total_customers; // 0x100 + money32 total_profit; // 0x104 + uint8_t popularity; // 0x108 + uint8_t popularity_time_out; // 0x109 + uint8_t popularity_next; // 0x10A + uint8_t num_riders; // 0x10B + uint8_t music_tune_id; // 0x10C + uint8_t slide_in_use; // 0x10D + union { - int8_t ferris_wheel_var_0; // 0x4C - int8_t ferris_wheel_var_1; // 0x4D + uint16_t slide_peep; // 0x10E + uint16_t maze_tiles; // 0x10E }; - }; - int16_t SwingSpeed; - uint8_t status; // 0x50 - uint8_t sub_state; // 0x51 - uint16_t peep[32]; // 0x52 - uint8_t peep_tshirt_colours[32]; // 0x92 - uint8_t num_seats; // 0xB2 - uint8_t num_peeps; // 0xB3 - uint8_t next_free_seat; // 0xB4 - uint8_t restraints_position; // 0xB5 0 == Close, 255 == Open - int16_t spin_speed; - uint16_t sound2_flags; - uint8_t spin_sprite; - uint8_t sound1_id; // 0xBB - uint8_t sound1_volume; // 0xBC - uint8_t sound2_id; // 0xBD - uint8_t sound2_volume; // 0xBE - int8_t sound_vector_factor; - union - { - uint16_t var_C0; - uint16_t time_waiting; // 0xC0 - uint16_t cable_lift_target; // 0xC0 - }; - uint8_t speed; // 0xC2 - uint8_t powered_acceleration; // 0xC3 - uint8_t var_C4; - uint8_t animation_frame; - uint8_t pad_C6[0x2]; - uint16_t animationState; - uint16_t var_CA; - uint8_t scream_sound_id; // 0xCC - uint8_t TrackSubposition; - union - { - uint8_t var_CE; - uint8_t num_laps; // 0xCE - }; - union - { - uint8_t var_CF; - uint8_t brake_speed; // 0xCF - }; - uint16_t lost_time_out; // 0xD0 - int8_t vertical_drop_countdown; // 0xD1 - uint8_t var_D3; - uint8_t mini_golf_current_animation; - uint8_t mini_golf_flags; // 0xD5 - uint8_t ride_subtype; // 0xD6 - uint8_t colours_extended; // 0xD7 - - uint16_t GetTrackType() const - { - return TrackTypeAndDirection >> 2; - } - - uint8_t GetTrackDirection() const - { - return TrackTypeAndDirection & RCT12VehicleTrackDirectionMask; - } -}; - -struct rct1_peep : RCT12SpriteBase -{ - uint8_t pad_1F[3]; - rct_string_id name_string_idx; // 0x22 - uint16_t next_x; // 0x24 - uint16_t next_y; // 0x26 - uint8_t next_z; // 0x28 - uint8_t next_flags; // 0x29 - uint8_t outside_of_park; // 0x2A - uint8_t state; // 0x2B - uint8_t sub_state; // 0x2C - uint8_t sprite_type; // 0x2D - uint8_t type; // 0x2E - union - { - uint8_t staff_type; // 0x2F - uint8_t no_of_rides; // 0x2F - }; - uint8_t tshirt_colour; // 0x30 - uint8_t trousers_colour; // 0x31 - uint16_t destination_x; // 0x32 Location that the peep is trying to get to - uint16_t destination_y; // 0x34 - uint8_t destination_tolerance; // 0x36 How close to destination before next action/state 0 = exact - uint8_t var_37; - uint8_t energy; // 0x38 - uint8_t energy_target; // 0x39 - uint8_t happiness; // 0x3A - uint8_t happiness_target; // 0x3B - uint8_t nausea; // 0x3C - uint8_t nausea_target; // 0x3D - uint8_t hunger; // 0x3E - uint8_t thirst; // 0x3F - uint8_t toilet; // 0x40 - uint8_t mass; // 0x41 - uint8_t time_to_consume; - uint8_t intensity; // 0x43 The max intensity is stored in the first 4 bits, and the min intensity in the second 4 bits - uint8_t nausea_tolerance; // 0x44 - uint8_t window_invalidate_flags; // 0x45 - money16 paid_on_drink; // 0x46 - uint8_t ride_types_been_on[16]; // 0x48 - uint8_t pad_5F[0x10]; // 0x58 - RCT12RideId current_ride; // 0x68 - uint8_t current_ride_station; // 0x69 - uint8_t current_train; // 0x6A - union - { - struct + uint8_t pad_110[0xE]; // 0x110 + uint8_t slide_peep_t_shirt_colour; // 0x11E + uint8_t pad_11F[0x7]; // 0x11F + uint8_t spiral_slide_progress; // 0x126 + uint8_t pad_127[0x9]; // 0x127 + int16_t build_date; // 0x130 + money16 upkeep_cost; // 0x131 + uint16_t race_winner; // 0x132 + uint8_t unk_134[2]; // 0x134 + uint32_t music_position; // 0x138 + uint8_t breakdown_reason_pending; // 0x13C + uint8_t mechanic_status; // 0x13D + uint16_t mechanic; // 0x13E + uint8_t inspection_station; // 0x140 + uint8_t broken_vehicle; // 0x141 + uint8_t broken_car; // 0x142 + uint8_t breakdown_reason; // 0x143 + money16 price_secondary; // 0x144 + union { - uint8_t current_car; // 0x6B - uint8_t current_seat; // 0x6C + struct + { + uint8_t reliability_subvalue; // 0x146, 0 - 255, acts like the decimals for reliability_percentage + uint8_t reliability_percentage; // 0x147, Starts at 100 and decreases from there. + }; + uint16_t reliability; // 0x146 }; - uint16_t time_to_sitdown; // 0x6B - struct + uint8_t unreliability_factor; // 0x148 + uint8_t downtime; // 0x149 + uint8_t inspection_interval; // 0x14A + uint8_t last_inspection; // 0x14B + uint8_t unk_14C[20]; // 0x14C + money32 income_per_hour; // 0x160 + money32 profit; // 0x164 + uint8_t queue_time[RCT12_MAX_STATIONS_PER_RIDE]; // 0x168 + colour_t track_colour_main[4]; // 0x16C + colour_t track_colour_additional[4]; // 0x170 + colour_t track_colour_supports[4]; // 0x174 + uint8_t music; // 0x178 + uint8_t entrance_style; // 0x179 + uint8_t unk_17A[230]; // 0x17A + }; + assert_struct_size(rct1_ride, 0x260); + + struct rct1_unk_sprite : RCT12SpriteBase + { + uint8_t pad_1F[3]; // 0x1f + rct_string_id name_string_idx; // 0x22 + uint16_t var_24; + uint16_t frame; // 0x26 + uint8_t var_28[3]; + uint8_t var_2B; + uint8_t pad_2C[0x45]; + uint8_t var_71; + }; + + struct rct1_vehicle : RCT12SpriteBase + { + uint8_t Pitch; // 0x1F + uint8_t bank_rotation; // 0x20 + uint8_t pad_21[3]; + int32_t remaining_distance; // 0x24 + int32_t velocity; // 0x28 + int32_t acceleration; // 0x2C + uint8_t ride; // 0x30 + uint8_t vehicle_type; // 0x31 + rct_vehicle_colour colours; // 0x32 + union { - uint8_t time_to_stand; // 0x6B - uint8_t standing_flags; // 0x6C + uint16_t track_progress; // 0x34 + struct + { + int8_t var_34; + uint8_t var_35; + }; }; + union + { + int16_t TrackTypeAndDirection; // 0x36 + RCT12xy8 boat_location; // 0x36 + }; + uint16_t track_x; // 0x38 + uint16_t track_y; // 0x3A + uint16_t track_z; // 0x3C + uint16_t next_vehicle_on_train; // 0x3E + + // The previous vehicle on the same train or the last vehicle on the previous or only train. + uint16_t prev_vehicle_on_ride; // 0x40 + + // The next vehicle on the same train or the first vehicle on the next or only train + uint16_t next_vehicle_on_ride; // 0x42 + + uint16_t var_44; + uint16_t mass; // 0x46 + uint16_t update_flags; // 0x48 + uint8_t SwingSprite; + uint8_t current_station; // 0x4B + union + { + int16_t SwingPosition; // 0x4C + int16_t current_time; // 0x4C + struct + { + int8_t ferris_wheel_var_0; // 0x4C + int8_t ferris_wheel_var_1; // 0x4D + }; + }; + int16_t SwingSpeed; + uint8_t status; // 0x50 + uint8_t sub_state; // 0x51 + uint16_t peep[32]; // 0x52 + uint8_t peep_tshirt_colours[32]; // 0x92 + uint8_t num_seats; // 0xB2 + uint8_t num_peeps; // 0xB3 + uint8_t next_free_seat; // 0xB4 + uint8_t restraints_position; // 0xB5 0 == Close, 255 == Open + int16_t spin_speed; + uint16_t sound2_flags; + uint8_t spin_sprite; + uint8_t sound1_id; // 0xBB + uint8_t sound1_volume; // 0xBC + uint8_t sound2_id; // 0xBD + uint8_t sound2_volume; // 0xBE + int8_t sound_vector_factor; + union + { + uint16_t var_C0; + uint16_t time_waiting; // 0xC0 + uint16_t cable_lift_target; // 0xC0 + }; + uint8_t speed; // 0xC2 + uint8_t powered_acceleration; // 0xC3 + uint8_t var_C4; + uint8_t animation_frame; + uint8_t pad_C6[0x2]; + uint16_t animationState; + uint16_t var_CA; + uint8_t scream_sound_id; // 0xCC + uint8_t TrackSubposition; + union + { + uint8_t var_CE; + uint8_t num_laps; // 0xCE + }; + union + { + uint8_t var_CF; + uint8_t brake_speed; // 0xCF + }; + uint16_t lost_time_out; // 0xD0 + int8_t vertical_drop_countdown; // 0xD1 + uint8_t var_D3; + uint8_t mini_golf_current_animation; + uint8_t mini_golf_flags; // 0xD5 + uint8_t ride_subtype; // 0xD6 + uint8_t colours_extended; // 0xD7 + + uint16_t GetTrackType() const + { + return TrackTypeAndDirection >> 2; + } + + uint8_t GetTrackDirection() const + { + return TrackTypeAndDirection & RCT12VehicleTrackDirectionMask; + } }; - // Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower - uint8_t special_sprite; // 0x6D - uint8_t action_sprite_type; // 0x6E - // Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which reads this - // again - uint8_t next_action_sprite_type; // 0x6F - uint8_t action_sprite_image_offset; // 0x70 - uint8_t action; // 0x71 - uint8_t action_frame; // 0x72 - uint8_t step_progress; - union + + struct rct1_peep : RCT12SpriteBase { - uint16_t mechanic_time_since_call; // time getting to ride to fix - uint16_t next_in_queue; // 0x74 + uint8_t pad_1F[3]; + rct_string_id name_string_idx; // 0x22 + uint16_t next_x; // 0x24 + uint16_t next_y; // 0x26 + uint8_t next_z; // 0x28 + uint8_t next_flags; // 0x29 + uint8_t outside_of_park; // 0x2A + uint8_t state; // 0x2B + uint8_t sub_state; // 0x2C + uint8_t sprite_type; // 0x2D + uint8_t type; // 0x2E + union + { + uint8_t staff_type; // 0x2F + uint8_t no_of_rides; // 0x2F + }; + uint8_t tshirt_colour; // 0x30 + uint8_t trousers_colour; // 0x31 + uint16_t destination_x; // 0x32 Location that the peep is trying to get to + uint16_t destination_y; // 0x34 + uint8_t destination_tolerance; // 0x36 How close to destination before next action/state 0 = exact + uint8_t var_37; + uint8_t energy; // 0x38 + uint8_t energy_target; // 0x39 + uint8_t happiness; // 0x3A + uint8_t happiness_target; // 0x3B + uint8_t nausea; // 0x3C + uint8_t nausea_target; // 0x3D + uint8_t hunger; // 0x3E + uint8_t thirst; // 0x3F + uint8_t toilet; // 0x40 + uint8_t mass; // 0x41 + uint8_t time_to_consume; + uint8_t intensity; // 0x43 The max intensity is stored in the first 4 bits, and the min intensity in the second 4 bits + uint8_t nausea_tolerance; // 0x44 + uint8_t window_invalidate_flags; // 0x45 + money16 paid_on_drink; // 0x46 + uint8_t ride_types_been_on[16]; // 0x48 + uint8_t pad_5F[0x10]; // 0x58 + RCT12RideId current_ride; // 0x68 + uint8_t current_ride_station; // 0x69 + uint8_t current_train; // 0x6A + union + { + struct + { + uint8_t current_car; // 0x6B + uint8_t current_seat; // 0x6C + }; + uint16_t time_to_sitdown; // 0x6B + struct + { + uint8_t time_to_stand; // 0x6B + uint8_t standing_flags; // 0x6C + }; + }; + // Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower + uint8_t special_sprite; // 0x6D + uint8_t action_sprite_type; // 0x6E + // Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which reads + // this again + uint8_t next_action_sprite_type; // 0x6F + uint8_t action_sprite_image_offset; // 0x70 + uint8_t action; // 0x71 + uint8_t action_frame; // 0x72 + uint8_t step_progress; + union + { + uint16_t mechanic_time_since_call; // time getting to ride to fix + uint16_t next_in_queue; // 0x74 + }; + uint8_t pad_76; + uint8_t pad_77; + union + { + uint8_t maze_last_edge; // 0x78 + uint8_t direction; // Direction ? + }; + RCT12RideId interaction_ride_index; + uint16_t time_in_queue; // 0x7A + uint8_t rides_been_on[32]; // 0x7C + // 255 bit bitmap of every ride the peep has been on see + // window_peep_rides_update for how to use. + uint32_t id; // 0x9C + money32 cash_in_pocket; // 0xA0 + money32 cash_spent; // 0xA4 + int32_t park_entry_time; // 0xA8 + int8_t rejoin_queue_timeout; // 0xAC + RCT12RideId previous_ride; // 0xAD + uint16_t previous_ride_time_out; // 0xAE + RCT12PeepThought thoughts[RCT12_PEEP_MAX_THOUGHTS]; // 0xB0 + uint8_t pad_C4; + union + { + uint8_t staff_id; // 0xC5 + RCT12RideId guest_heading_to_ride_id; // 0xC5 + }; + union + { + uint8_t staff_orders; // 0xC6 + uint8_t peep_is_lost_countdown; // 0xC6 + }; + RCT12RideId photo1_ride_ref; // 0xC7 + uint32_t peep_flags; // 0xC8 + rct12_xyzd8 pathfind_goal; // 0xCC + rct12_xyzd8 pathfind_history[4]; // 0xD0 + uint8_t no_action_frame_num; // 0xE0 + // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc + uint8_t litter_count; // 0xE1 + union + { + uint8_t time_on_ride; // 0xE2 + uint8_t staff_mowing_timeout; // 0xE2 + }; + // 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc + uint8_t disgusting_count; // 0xE3 + money16 paid_to_enter; // 0xE4 + money16 paid_on_rides; // 0xE6 + money16 paid_on_food; // 0xE8 + money16 paid_on_souvenirs; // 0xEA + uint8_t no_of_food; // 0xEC + uint8_t no_of_drinks; // 0xED + uint8_t no_of_souvenirs; // 0xEE + uint8_t vandalism_seen; // 0xEF + uint8_t voucher_type; // 0xF0 + RCT12RideId voucher_arguments; // 0xF1 ride_id or string_offset_id + uint8_t surroundings_thought_timeout; // 0xF2 + uint8_t angriness; // 0xF3 + uint8_t time_lost; + uint8_t days_in_queue; // 0xF5 + uint8_t balloon_colour; // 0xF6 + uint8_t umbrella_colour; // 0xF7 + uint8_t hat_colour; // 0xF8 + RCT12RideId favourite_ride; // 0xF9 + uint8_t favourite_ride_rating; // 0xFA + uint8_t pad_FB; + uint32_t item_standard_flags; // 0xFC + uint64_t GetItemFlags() const + { + return item_standard_flags; + } }; - uint8_t pad_76; - uint8_t pad_77; - union + assert_struct_size(rct1_peep, 0x100); + + enum RCT1_PEEP_SPRITE_TYPE { - uint8_t maze_last_edge; // 0x78 - uint8_t direction; // Direction ? + RCT1_PEEP_SPRITE_TYPE_NORMAL = 0, + RCT1_PEEP_SPRITE_TYPE_HANDYMAN = 1, + RCT1_PEEP_SPRITE_TYPE_MECHANIC = 2, + RCT1_PEEP_SPRITE_TYPE_SECURITY = 3, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_PANDA = 4, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_TIGER = 5, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ELEPHANT = 6, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ROMAN = 7, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_GORILLA = 8, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_SNOWMAN = 9, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_KNIGHT = 10, + RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ASTRONAUT = 11, + + RCT1_PEEP_SPRITE_TYPE_BALLOON = 16, + RCT1_PEEP_SPRITE_TYPE_CANDYFLOSS = 17, + RCT1_PEEP_SPRITE_TYPE_UMBRELLA = 18, + RCT1_PEEP_SPRITE_TYPE_PIZZA = 19, // Unsure + RCT1_PEEP_SPRITE_TYPE_SECURITY_ALT = 20, // Unknown + RCT1_PEEP_SPRITE_TYPE_POPCORN = 21, + RCT1_PEEP_SPRITE_TYPE_ARMS_CROSSED = 22, + RCT1_PEEP_SPRITE_TYPE_HEAD_DOWN = 23, + RCT1_PEEP_SPRITE_TYPE_NAUSEOUS = 24, + RCT1_PEEP_SPRITE_TYPE_VERY_NAUSEOUS = 25, + RCT1_PEEP_SPRITE_TYPE_REQUIRE_TOILET = 26, + RCT1_PEEP_SPRITE_TYPE_HAT = 27, + RCT1_PEEP_SPRITE_TYPE_BURGER = 28, + RCT1_PEEP_SPRITE_TYPE_TENTACLE = 29, + RCT1_PEEP_SPRITE_TYPE_TOFFEE_APPLE = 30 }; - RCT12RideId interaction_ride_index; - uint16_t time_in_queue; // 0x7A - uint8_t rides_been_on[32]; // 0x7C - // 255 bit bitmap of every ride the peep has been on see - // window_peep_rides_update for how to use. - uint32_t id; // 0x9C - money32 cash_in_pocket; // 0xA0 - money32 cash_spent; // 0xA4 - int32_t park_entry_time; // 0xA8 - int8_t rejoin_queue_timeout; // 0xAC - RCT12RideId previous_ride; // 0xAD - uint16_t previous_ride_time_out; // 0xAE - RCT12PeepThought thoughts[RCT12_PEEP_MAX_THOUGHTS]; // 0xB0 - uint8_t pad_C4; - union + + union rct1_sprite { - uint8_t staff_id; // 0xC5 - RCT12RideId guest_heading_to_ride_id; // 0xC5 + uint8_t pad_00[0x100]; + rct1_unk_sprite unknown; + rct1_vehicle vehicle; + rct1_peep peep; + RCT12SpriteLitter litter; + RCT12SpriteBalloon balloon; + RCT12SpriteDuck duck; + RCT12SpriteJumpingFountain jumping_fountain; + RCT12SpriteMoneyEffect money_effect; + RCT12SpriteCrashedVehicleParticle crashed_vehicle_particle; + RCT12SpriteCrashSplash crash_splash; + RCT12SpriteSteamParticle steam_particle; }; - union + assert_struct_size(rct1_sprite, 0x100); + + struct rct1_research_item { - uint8_t staff_orders; // 0xC6 - uint8_t peep_is_lost_countdown; // 0xC6 + uint8_t item; + uint8_t related_ride; + uint8_t type; + uint8_t flags; + uint8_t category; }; - RCT12RideId photo1_ride_ref; // 0xC7 - uint32_t peep_flags; // 0xC8 - rct12_xyzd8 pathfind_goal; // 0xCC - rct12_xyzd8 pathfind_history[4]; // 0xD0 - uint8_t no_action_frame_num; // 0xE0 - // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc - uint8_t litter_count; // 0xE1 - union + assert_struct_size(rct1_research_item, 5); + + /** + * RCT1,AA,LL scenario / saved game structure. + * size: 0x1F850C + */ + struct rct1_s4 { - uint8_t time_on_ride; // 0xE2 - uint8_t staff_mowing_timeout; // 0xE2 + uint16_t month; + uint16_t day; + uint32_t ticks; + uint32_t random_a; + uint32_t random_b; + RCT12TileElement tile_elements[RCT1_MAX_TILE_ELEMENTS]; + uint32_t unk_counter; + rct1_sprite sprites[RCT1_MAX_SPRITES]; + uint16_t next_sprite_index; + uint16_t first_vehicle_sprite_index; + uint16_t first_peep_sprite_index; + uint16_t first_duck_sprite_index; + uint16_t first_litter_sprite_index; + uint16_t first_oversized_ride_car_sprite_index; + uint16_t sprites_available; + uint16_t num_vehicle_sprites; + uint16_t num_peep_sprites; + uint16_t num_duck_sprites; + uint16_t num_litter_sprites; + uint16_t num_oversized_ride_car_sprites; + uint32_t park_name_string_index; + uint32_t unk_198830; + money32 cash; + money32 loan; + uint32_t park_flags; + money16 park_entrance_fee; + rct1_entrance park_entrance; + uint8_t unk_198849; + rct12_peep_spawn peep_spawn[RCT12_MAX_PEEP_SPAWNS]; + uint8_t unk_198856; + uint8_t research_level; + uint32_t unk_198858; + uint32_t available_rides[8]; + uint32_t available_vehicles[8]; + uint32_t ride_feature_1[128]; + uint32_t ride_feature_2[128]; + uint16_t guests_in_park; + uint16_t unk_198C9E; + money32 expenditure[RCT12_EXPENDITURE_TABLE_MONTH_COUNT][RCT12_EXPENDITURE_TYPE_COUNT]; + uint32_t guests_in_park_2; + uint8_t unk_199024; + colour_t handman_colour; + colour_t mechanic_colour; + colour_t security_guard_colour; + uint8_t available_scenery[128]; + uint16_t available_banners; + uint8_t unk_1990AA[94]; + uint16_t park_rating; + uint8_t park_rating_history[32]; + uint8_t guests_in_park_history[32]; + uint8_t research_priority; + uint8_t research_progress_stage; + uint8_t last_research_item; + uint8_t last_research_ride; + uint8_t last_research_type; + uint8_t last_research_flags; + rct1_research_item research_items[200]; + uint8_t next_research_item; + uint8_t next_research_ride; + uint8_t next_research_type; + uint8_t next_research_flags; + uint16_t research_progress; + uint8_t next_research_category; + uint8_t next_research_expected_day; + uint8_t next_research_expected_month; + uint8_t guest_initial_happiness; + uint16_t park_size; + uint16_t guest_generation_probability; + money16 total_ride_value_for_money; + money32 max_loan; + money16 guest_initial_cash; + uint8_t guest_initial_hunger; + uint8_t guest_initial_thirst; + uint8_t scenario_objective_type; + uint8_t scenario_objective_years; + uint16_t unk_199552; + money32 scenario_objective_currency; + uint16_t scenario_objective_num_guests; + uint8_t marketing_status[20]; + uint8_t marketing_assoc[20]; + uint8_t unk_199582[2]; + money32 cash_history[RCT12_FINANCE_GRAPH_SIZE]; + money32 total_expenditure; + money32 profit; + uint8_t unk_199788[8]; + money32 weekly_profit_history[RCT12_FINANCE_GRAPH_SIZE]; + money32 park_value; + money32 park_value_history[RCT12_FINANCE_GRAPH_SIZE]; + money32 completed_company_value; + uint32_t num_admissions; + money32 admission_total_income; + money32 company_value; + uint8_t thought_timer[16]; + rct12_award awards[RCT12_MAX_AWARDS]; + money16 land_price; + money16 construction_rights_price; + uint16_t unk_199BCC; + uint16_t unk_199BCE; + uint32_t unk_199BD0; + char username[64]; + uint32_t game_version; + money32 objective_completion_company_value; + uint32_t finance_checksum; + uint16_t num_rides; + uint16_t cheat_detection_neg_num_rides; + uint16_t cheat_detection_max_owned_tiles; + uint16_t cheat_detection_neg_max_owned_tiles; + uint32_t finance_checksum_3; + uint32_t scenario_slot_index_checksum; + char scenario_winner[32]; + uint32_t finance_checksum_2; + char copyright_notice[40]; + uint16_t cheat_detection_sv6_sc4[4]; + uint16_t unk_199C84; + uint16_t unk_199C86; + uint16_t map_size_units; + uint16_t map_size_unk_b; + uint16_t map_size; + uint16_t map_size_max_xy; + uint32_t same_price_flags; + uint16_t unk_199C94; + uint8_t unk_199C96[3]; + uint8_t water_colour; + uint16_t unk_199C9A; + rct1_research_item research_items_LL[180]; + uint8_t unk_19A020[5468]; + RCT12Banner banners[RCT1_MAX_BANNERS]; + char string_table[RCT12_MAX_USER_STRINGS][RCT12_USER_STRING_MAX_LENGTH]; + uint32_t game_time_counter; + rct1_ride rides[RCT12_MAX_RIDES_IN_PARK]; + uint16_t unk_game_time_counter; + int16_t view_x; + int16_t view_y; + uint8_t view_zoom; + uint8_t view_rotation; + RCT12MapAnimation map_animations[RCT1_MAX_ANIMATED_OBJECTS]; + uint32_t num_map_animations; + uint8_t unk_1CADBC[12]; + uint16_t scrolling_text_step; + uint32_t unk_1CADCA; + uint16_t unk_1CADCE; + uint8_t unk_1CADD0[116]; + RCT12RideMeasurement ride_measurements[8]; + uint32_t next_guest_index; + uint16_t game_counter_5; + uint8_t patrol_areas[(RCT1_MAX_STAFF + RCT12_STAFF_TYPE_COUNT) * RCT12_PATROL_AREA_SIZE]; + uint8_t staff_modes[RCT1_MAX_STAFF]; + uint8_t unk_1F431E[4]; + uint8_t unk_1F4322[8]; + uint8_t climate; + uint8_t unk_1F432B; + uint16_t climate_timer; + uint8_t weather; + uint8_t target_weather; + uint8_t temperature; + uint8_t target_temperature; + uint8_t thunder_frequency; + uint8_t target_thunder_frequency; + uint8_t weather_gloom; + uint8_t target_weather_gloom; + uint8_t rain; + uint8_t target_rain; + rct12_news_item messages[RCT12_MAX_NEWS_ITEMS]; + char scenario_name[62]; + uint16_t scenario_slot_index; + uint32_t scenario_flags; + uint8_t unk_1F8358[432]; + uint32_t expansion_pack_checksum; }; - // 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc - uint8_t disgusting_count; // 0xE3 - money16 paid_to_enter; // 0xE4 - money16 paid_on_rides; // 0xE6 - money16 paid_on_food; // 0xE8 - money16 paid_on_souvenirs; // 0xEA - uint8_t no_of_food; // 0xEC - uint8_t no_of_drinks; // 0xED - uint8_t no_of_souvenirs; // 0xEE - uint8_t vandalism_seen; // 0xEF - uint8_t voucher_type; // 0xF0 - RCT12RideId voucher_arguments; // 0xF1 ride_id or string_offset_id - uint8_t surroundings_thought_timeout; // 0xF2 - uint8_t angriness; // 0xF3 - uint8_t time_lost; - uint8_t days_in_queue; // 0xF5 - uint8_t balloon_colour; // 0xF6 - uint8_t umbrella_colour; // 0xF7 - uint8_t hat_colour; // 0xF8 - RCT12RideId favourite_ride; // 0xF9 - uint8_t favourite_ride_rating; // 0xFA - uint8_t pad_FB; - uint32_t item_standard_flags; // 0xFC - uint64_t GetItemFlags() const + assert_struct_size(rct1_s4, 0x1F850C); + + /** + * Track design structure. Only for base RCT1 + * size: 0x2006 + */ + struct rct_track_td4 { - return item_standard_flags; - } -}; -assert_struct_size(rct1_peep, 0x100); - -enum RCT1_PEEP_SPRITE_TYPE -{ - RCT1_PEEP_SPRITE_TYPE_NORMAL = 0, - RCT1_PEEP_SPRITE_TYPE_HANDYMAN = 1, - RCT1_PEEP_SPRITE_TYPE_MECHANIC = 2, - RCT1_PEEP_SPRITE_TYPE_SECURITY = 3, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_PANDA = 4, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_TIGER = 5, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ELEPHANT = 6, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ROMAN = 7, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_GORILLA = 8, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_SNOWMAN = 9, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_KNIGHT = 10, - RCT1_PEEP_SPRITE_TYPE_ENTERTAINER_ASTRONAUT = 11, - - RCT1_PEEP_SPRITE_TYPE_BALLOON = 16, - RCT1_PEEP_SPRITE_TYPE_CANDYFLOSS = 17, - RCT1_PEEP_SPRITE_TYPE_UMBRELLA = 18, - RCT1_PEEP_SPRITE_TYPE_PIZZA = 19, // Unsure - RCT1_PEEP_SPRITE_TYPE_SECURITY_ALT = 20, // Unknown - RCT1_PEEP_SPRITE_TYPE_POPCORN = 21, - RCT1_PEEP_SPRITE_TYPE_ARMS_CROSSED = 22, - RCT1_PEEP_SPRITE_TYPE_HEAD_DOWN = 23, - RCT1_PEEP_SPRITE_TYPE_NAUSEOUS = 24, - RCT1_PEEP_SPRITE_TYPE_VERY_NAUSEOUS = 25, - RCT1_PEEP_SPRITE_TYPE_REQUIRE_TOILET = 26, - RCT1_PEEP_SPRITE_TYPE_HAT = 27, - RCT1_PEEP_SPRITE_TYPE_BURGER = 28, - RCT1_PEEP_SPRITE_TYPE_TENTACLE = 29, - RCT1_PEEP_SPRITE_TYPE_TOFFEE_APPLE = 30 -}; - -union rct1_sprite -{ - uint8_t pad_00[0x100]; - rct1_unk_sprite unknown; - rct1_vehicle vehicle; - rct1_peep peep; - RCT12SpriteLitter litter; - RCT12SpriteBalloon balloon; - RCT12SpriteDuck duck; - RCT12SpriteJumpingFountain jumping_fountain; - RCT12SpriteMoneyEffect money_effect; - RCT12SpriteCrashedVehicleParticle crashed_vehicle_particle; - RCT12SpriteCrashSplash crash_splash; - RCT12SpriteSteamParticle steam_particle; -}; -assert_struct_size(rct1_sprite, 0x100); - -struct rct1_research_item -{ - uint8_t item; - uint8_t related_ride; - uint8_t type; - uint8_t flags; - uint8_t category; -}; -assert_struct_size(rct1_research_item, 5); - -/** - * RCT1,AA,LL scenario / saved game structure. - * size: 0x1F850C - */ -struct rct1_s4 -{ - uint16_t month; - uint16_t day; - uint32_t ticks; - uint32_t random_a; - uint32_t random_b; - RCT12TileElement tile_elements[RCT1_MAX_TILE_ELEMENTS]; - uint32_t unk_counter; - rct1_sprite sprites[RCT1_MAX_SPRITES]; - uint16_t next_sprite_index; - uint16_t first_vehicle_sprite_index; - uint16_t first_peep_sprite_index; - uint16_t first_duck_sprite_index; - uint16_t first_litter_sprite_index; - uint16_t first_oversized_ride_car_sprite_index; - uint16_t sprites_available; - uint16_t num_vehicle_sprites; - uint16_t num_peep_sprites; - uint16_t num_duck_sprites; - uint16_t num_litter_sprites; - uint16_t num_oversized_ride_car_sprites; - uint32_t park_name_string_index; - uint32_t unk_198830; - money32 cash; - money32 loan; - uint32_t park_flags; - money16 park_entrance_fee; - rct1_entrance park_entrance; - uint8_t unk_198849; - rct12_peep_spawn peep_spawn[RCT12_MAX_PEEP_SPAWNS]; - uint8_t unk_198856; - uint8_t research_level; - uint32_t unk_198858; - uint32_t available_rides[8]; - uint32_t available_vehicles[8]; - uint32_t ride_feature_1[128]; - uint32_t ride_feature_2[128]; - uint16_t guests_in_park; - uint16_t unk_198C9E; - money32 expenditure[RCT12_EXPENDITURE_TABLE_MONTH_COUNT][RCT12_EXPENDITURE_TYPE_COUNT]; - uint32_t guests_in_park_2; - uint8_t unk_199024; - colour_t handman_colour; - colour_t mechanic_colour; - colour_t security_guard_colour; - uint8_t available_scenery[128]; - uint16_t available_banners; - uint8_t unk_1990AA[94]; - uint16_t park_rating; - uint8_t park_rating_history[32]; - uint8_t guests_in_park_history[32]; - uint8_t research_priority; - uint8_t research_progress_stage; - uint8_t last_research_item; - uint8_t last_research_ride; - uint8_t last_research_type; - uint8_t last_research_flags; - rct1_research_item research_items[200]; - uint8_t next_research_item; - uint8_t next_research_ride; - uint8_t next_research_type; - uint8_t next_research_flags; - uint16_t research_progress; - uint8_t next_research_category; - uint8_t next_research_expected_day; - uint8_t next_research_expected_month; - uint8_t guest_initial_happiness; - uint16_t park_size; - uint16_t guest_generation_probability; - money16 total_ride_value_for_money; - money32 max_loan; - money16 guest_initial_cash; - uint8_t guest_initial_hunger; - uint8_t guest_initial_thirst; - uint8_t scenario_objective_type; - uint8_t scenario_objective_years; - uint16_t unk_199552; - money32 scenario_objective_currency; - uint16_t scenario_objective_num_guests; - uint8_t marketing_status[20]; - uint8_t marketing_assoc[20]; - uint8_t unk_199582[2]; - money32 cash_history[RCT12_FINANCE_GRAPH_SIZE]; - money32 total_expenditure; - money32 profit; - uint8_t unk_199788[8]; - money32 weekly_profit_history[RCT12_FINANCE_GRAPH_SIZE]; - money32 park_value; - money32 park_value_history[RCT12_FINANCE_GRAPH_SIZE]; - money32 completed_company_value; - uint32_t num_admissions; - money32 admission_total_income; - money32 company_value; - uint8_t thought_timer[16]; - rct12_award awards[RCT12_MAX_AWARDS]; - money16 land_price; - money16 construction_rights_price; - uint16_t unk_199BCC; - uint16_t unk_199BCE; - uint32_t unk_199BD0; - char username[64]; - uint32_t game_version; - money32 objective_completion_company_value; - uint32_t finance_checksum; - uint16_t num_rides; - uint16_t cheat_detection_neg_num_rides; - uint16_t cheat_detection_max_owned_tiles; - uint16_t cheat_detection_neg_max_owned_tiles; - uint32_t finance_checksum_3; - uint32_t scenario_slot_index_checksum; - char scenario_winner[32]; - uint32_t finance_checksum_2; - char copyright_notice[40]; - uint16_t cheat_detection_sv6_sc4[4]; - uint16_t unk_199C84; - uint16_t unk_199C86; - uint16_t map_size_units; - uint16_t map_size_unk_b; - uint16_t map_size; - uint16_t map_size_max_xy; - uint32_t same_price_flags; - uint16_t unk_199C94; - uint8_t unk_199C96[3]; - uint8_t water_colour; - uint16_t unk_199C9A; - rct1_research_item research_items_LL[180]; - uint8_t unk_19A020[5468]; - RCT12Banner banners[RCT1_MAX_BANNERS]; - char string_table[RCT12_MAX_USER_STRINGS][RCT12_USER_STRING_MAX_LENGTH]; - uint32_t game_time_counter; - rct1_ride rides[RCT12_MAX_RIDES_IN_PARK]; - uint16_t unk_game_time_counter; - int16_t view_x; - int16_t view_y; - uint8_t view_zoom; - uint8_t view_rotation; - RCT12MapAnimation map_animations[RCT1_MAX_ANIMATED_OBJECTS]; - uint32_t num_map_animations; - uint8_t unk_1CADBC[12]; - uint16_t scrolling_text_step; - uint32_t unk_1CADCA; - uint16_t unk_1CADCE; - uint8_t unk_1CADD0[116]; - RCT12RideMeasurement ride_measurements[8]; - uint32_t next_guest_index; - uint16_t game_counter_5; - uint8_t patrol_areas[(RCT1_MAX_STAFF + RCT12_STAFF_TYPE_COUNT) * RCT12_PATROL_AREA_SIZE]; - uint8_t staff_modes[RCT1_MAX_STAFF]; - uint8_t unk_1F431E[4]; - uint8_t unk_1F4322[8]; - uint8_t climate; - uint8_t unk_1F432B; - uint16_t climate_timer; - uint8_t weather; - uint8_t target_weather; - uint8_t temperature; - uint8_t target_temperature; - uint8_t thunder_frequency; - uint8_t target_thunder_frequency; - uint8_t weather_gloom; - uint8_t target_weather_gloom; - uint8_t rain; - uint8_t target_rain; - rct12_news_item messages[RCT12_MAX_NEWS_ITEMS]; - char scenario_name[62]; - uint16_t scenario_slot_index; - uint32_t scenario_flags; - uint8_t unk_1F8358[432]; - uint32_t expansion_pack_checksum; -}; -assert_struct_size(rct1_s4, 0x1F850C); - -/** - * Track design structure. Only for base RCT1 - * size: 0x2006 - */ -struct rct_track_td4 -{ - uint8_t type; // 0x00 - uint8_t vehicle_type; - uint32_t flags; // 0x02 - uint8_t mode; // 0x06 - uint8_t version_and_colour_scheme; // 0x07 0b0000_VVCC - rct_vehicle_colour vehicle_colours[RCT1_MAX_TRAINS_PER_RIDE]; // 0x08 - uint8_t track_spine_colour_v0; // 0x20 - uint8_t track_rail_colour_v0; // 0x21 - uint8_t track_support_colour_v0; // 0x22 - uint8_t depart_flags; // 0x23 - uint8_t number_of_trains; // 0x24 - uint8_t number_of_cars_per_train; // 0x25 - uint8_t min_waiting_time; // 0x26 - uint8_t max_waiting_time; // 0x27 - union - { - uint8_t operation_setting; - uint8_t launch_speed; - uint8_t num_laps; - uint8_t max_people; + uint8_t type; // 0x00 + uint8_t vehicle_type; + uint32_t flags; // 0x02 + uint8_t mode; // 0x06 + uint8_t version_and_colour_scheme; // 0x07 0b0000_VVCC + rct_vehicle_colour vehicle_colours[RCT1_MAX_TRAINS_PER_RIDE]; // 0x08 + uint8_t track_spine_colour_v0; // 0x20 + uint8_t track_rail_colour_v0; // 0x21 + uint8_t track_support_colour_v0; // 0x22 + uint8_t depart_flags; // 0x23 + uint8_t number_of_trains; // 0x24 + uint8_t number_of_cars_per_train; // 0x25 + uint8_t min_waiting_time; // 0x26 + uint8_t max_waiting_time; // 0x27 + union + { + uint8_t operation_setting; + uint8_t launch_speed; + uint8_t num_laps; + uint8_t max_people; + }; + int8_t max_speed; // 0x29 + int8_t average_speed; // 0x2A + uint16_t ride_length; // 0x2B + uint8_t max_positive_vertical_g; // 0x2D + int8_t max_negative_vertical_g; // 0x2C + uint8_t max_lateral_g; // 0x2F + union + { + uint8_t num_inversions; // 0x30 + uint8_t num_holes; // 0x30 + }; + uint8_t num_drops; // 0x31 + uint8_t highest_drop_height; // 0x32 + uint8_t excitement; // 0x33 + uint8_t intensity; // 0x34 + uint8_t nausea; // 0x35 + money16 upkeep_cost; // 0x36 }; - int8_t max_speed; // 0x29 - int8_t average_speed; // 0x2A - uint16_t ride_length; // 0x2B - uint8_t max_positive_vertical_g; // 0x2D - int8_t max_negative_vertical_g; // 0x2C - uint8_t max_lateral_g; // 0x2F - union + + assert_struct_size(rct_track_td4, 0x38); + + /** + * Track design structure for Added Attractions / Loopy Landscapes + * size: 0x2006 + */ + struct rct_track_td4_aa : public rct_track_td4 { - uint8_t num_inversions; // 0x30 - uint8_t num_holes; // 0x30 + uint8_t track_spine_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x38 + uint8_t track_rail_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x3C + uint8_t track_support_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x40 + uint8_t flags2; // 0x44 + + uint8_t pad_45[0x7F]; // 0x45 }; - uint8_t num_drops; // 0x31 - uint8_t highest_drop_height; // 0x32 - uint8_t excitement; // 0x33 - uint8_t intensity; // 0x34 - uint8_t nausea; // 0x35 - money16 upkeep_cost; // 0x36 -}; -assert_struct_size(rct_track_td4, 0x38); - -/** - * Track design structure for Added Attractions / Loopy Landscapes - * size: 0x2006 - */ -struct rct_track_td4_aa : public rct_track_td4 -{ - uint8_t track_spine_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x38 - uint8_t track_rail_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x3C - uint8_t track_support_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x40 - uint8_t flags2; // 0x44 - - uint8_t pad_45[0x7F]; // 0x45 -}; - -assert_struct_size(rct_track_td4_aa, 0xC4); + assert_struct_size(rct_track_td4_aa, 0xC4); #pragma pack(pop) -enum -{ - RCT1_RIDE_TYPE_NULL = 255, - RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER = 0, - RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER, - RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_RAILWAY, - RCT1_RIDE_TYPE_MONORAIL, - RCT1_RIDE_TYPE_SUSPENDED_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_BOAT_HIRE, - RCT1_RIDE_TYPE_WOODEN_CRAZY_RODENT_ROLLER_COASTER, - RCT1_RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_CAR_RIDE, - RCT1_RIDE_TYPE_LAUNCHED_FREEFALL, - RCT1_RIDE_TYPE_BOBSLED_ROLLER_COASTER, - RCT1_RIDE_TYPE_OBSERVATION_TOWER, - RCT1_RIDE_TYPE_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_SLIDE, - RCT1_RIDE_TYPE_MINE_TRAIN_ROLLER_COASTER, - RCT1_RIDE_TYPE_CHAIRLIFT, - RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEDGE_MAZE, - RCT1_RIDE_TYPE_SPIRAL_SLIDE, - RCT1_RIDE_TYPE_GO_KARTS, - RCT1_RIDE_TYPE_LOG_FLUME, - RCT1_RIDE_TYPE_RIVER_RAPIDS, - RCT1_RIDE_TYPE_DODGEMS, - RCT1_RIDE_TYPE_SWINGING_SHIP, - RCT1_RIDE_TYPE_SWINGING_INVERTER_SHIP, - RCT1_RIDE_TYPE_ICE_CREAM_STALL, - RCT1_RIDE_TYPE_CHIPS_STALL, - RCT1_RIDE_TYPE_DRINK_STALL, - RCT1_RIDE_TYPE_CANDYFLOSS_STALL, - RCT1_RIDE_TYPE_BURGER_BAR, - RCT1_RIDE_TYPE_MERRY_GO_ROUND, - RCT1_RIDE_TYPE_BALLOON_STALL, - RCT1_RIDE_TYPE_INFORMATION_KIOSK, - RCT1_RIDE_TYPE_TOILETS, - RCT1_RIDE_TYPE_FERRIS_WHEEL, - RCT1_RIDE_TYPE_MOTION_SIMULATOR, - RCT1_RIDE_TYPE_3D_CINEMA, - RCT1_RIDE_TYPE_TOP_SPIN, - RCT1_RIDE_TYPE_SPACE_RINGS, - RCT1_RIDE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SOUVENIR_STALL, - RCT1_RIDE_TYPE_VERTICAL_ROLLER_COASTER, - RCT1_RIDE_TYPE_PIZZA_STALL, - RCT1_RIDE_TYPE_TWIST, - RCT1_RIDE_TYPE_HAUNTED_HOUSE, - RCT1_RIDE_TYPE_POPCORN_STALL, - RCT1_RIDE_TYPE_CIRCUS, - RCT1_RIDE_TYPE_GHOST_TRAIN, - RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_SIDE_FRICTION_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_WILD_MOUSE_ROLLER_COASTER, - RCT1_RIDE_TYPE_HOT_DOG_STALL, - RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL, - RCT1_RIDE_TYPE_HAT_STALL, - RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL, - RCT1_RIDE_TYPE_VIRGINIA_REEL, - RCT1_RIDE_TYPE_RIVER_RIDE, - RCT1_RIDE_TYPE_CYCLE_MONORAIL, - RCT1_RIDE_TYPE_FLYING_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_MONORAIL, - RCT1_RIDE_TYPE_40, - RCT1_RIDE_TYPE_WOODEN_REVERSER_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEARTLINE_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_GOLF, - RCT1_RIDE_TYPE_44, - RCT1_RIDE_TYPE_ROTO_DROP, - RCT1_RIDE_TYPE_FLYING_SAUCERS, - RCT1_RIDE_TYPE_CROOKED_HOUSE, - RCT1_RIDE_TYPE_CYCLE_RAILWAY, - RCT1_RIDE_TYPE_SUSPENDED_LOOPING_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_COASTER, - RCT1_RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, - RCT1_RIDE_TYPE_INVERTED_WILD_MOUSE_COASTER, - RCT1_RIDE_TYPE_JET_SKIS, - RCT1_RIDE_TYPE_T_SHIRT_STALL, - RCT1_RIDE_TYPE_RAFT_RIDE, - RCT1_RIDE_TYPE_DOUGHNUT_SHOP, - RCT1_RIDE_TYPE_ENTERPRISE, - RCT1_RIDE_TYPE_COFFEE_SHOP, - RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL, - RCT1_RIDE_TYPE_LEMONADE_STALL, + enum + { + RCT1_RIDE_TYPE_NULL = 255, + RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER = 0, + RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER, + RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER, + RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER, + RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER, + RCT1_RIDE_TYPE_MINIATURE_RAILWAY, + RCT1_RIDE_TYPE_MONORAIL, + RCT1_RIDE_TYPE_SUSPENDED_SINGLE_RAIL_ROLLER_COASTER, + RCT1_RIDE_TYPE_BOAT_HIRE, + RCT1_RIDE_TYPE_WOODEN_CRAZY_RODENT_ROLLER_COASTER, + RCT1_RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, + RCT1_RIDE_TYPE_CAR_RIDE, + RCT1_RIDE_TYPE_LAUNCHED_FREEFALL, + RCT1_RIDE_TYPE_BOBSLED_ROLLER_COASTER, + RCT1_RIDE_TYPE_OBSERVATION_TOWER, + RCT1_RIDE_TYPE_STEEL_ROLLER_COASTER, + RCT1_RIDE_TYPE_WATER_SLIDE, + RCT1_RIDE_TYPE_MINE_TRAIN_ROLLER_COASTER, + RCT1_RIDE_TYPE_CHAIRLIFT, + RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER, + RCT1_RIDE_TYPE_HEDGE_MAZE, + RCT1_RIDE_TYPE_SPIRAL_SLIDE, + RCT1_RIDE_TYPE_GO_KARTS, + RCT1_RIDE_TYPE_LOG_FLUME, + RCT1_RIDE_TYPE_RIVER_RAPIDS, + RCT1_RIDE_TYPE_DODGEMS, + RCT1_RIDE_TYPE_SWINGING_SHIP, + RCT1_RIDE_TYPE_SWINGING_INVERTER_SHIP, + RCT1_RIDE_TYPE_ICE_CREAM_STALL, + RCT1_RIDE_TYPE_CHIPS_STALL, + RCT1_RIDE_TYPE_DRINK_STALL, + RCT1_RIDE_TYPE_CANDYFLOSS_STALL, + RCT1_RIDE_TYPE_BURGER_BAR, + RCT1_RIDE_TYPE_MERRY_GO_ROUND, + RCT1_RIDE_TYPE_BALLOON_STALL, + RCT1_RIDE_TYPE_INFORMATION_KIOSK, + RCT1_RIDE_TYPE_TOILETS, + RCT1_RIDE_TYPE_FERRIS_WHEEL, + RCT1_RIDE_TYPE_MOTION_SIMULATOR, + RCT1_RIDE_TYPE_3D_CINEMA, + RCT1_RIDE_TYPE_TOP_SPIN, + RCT1_RIDE_TYPE_SPACE_RINGS, + RCT1_RIDE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER, + RCT1_RIDE_TYPE_SOUVENIR_STALL, + RCT1_RIDE_TYPE_VERTICAL_ROLLER_COASTER, + RCT1_RIDE_TYPE_PIZZA_STALL, + RCT1_RIDE_TYPE_TWIST, + RCT1_RIDE_TYPE_HAUNTED_HOUSE, + RCT1_RIDE_TYPE_POPCORN_STALL, + RCT1_RIDE_TYPE_CIRCUS, + RCT1_RIDE_TYPE_GHOST_TRAIN, + RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_WOODEN_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_WOODEN_SIDE_FRICTION_ROLLER_COASTER, + RCT1_RIDE_TYPE_STEEL_WILD_MOUSE_ROLLER_COASTER, + RCT1_RIDE_TYPE_HOT_DOG_STALL, + RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL, + RCT1_RIDE_TYPE_HAT_STALL, + RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL, + RCT1_RIDE_TYPE_VIRGINIA_REEL, + RCT1_RIDE_TYPE_RIVER_RIDE, + RCT1_RIDE_TYPE_CYCLE_MONORAIL, + RCT1_RIDE_TYPE_FLYING_ROLLER_COASTER, + RCT1_RIDE_TYPE_SUSPENDED_MONORAIL, + RCT1_RIDE_TYPE_40, + RCT1_RIDE_TYPE_WOODEN_REVERSER_ROLLER_COASTER, + RCT1_RIDE_TYPE_HEARTLINE_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_MINIATURE_GOLF, + RCT1_RIDE_TYPE_44, + RCT1_RIDE_TYPE_ROTO_DROP, + RCT1_RIDE_TYPE_FLYING_SAUCERS, + RCT1_RIDE_TYPE_CROOKED_HOUSE, + RCT1_RIDE_TYPE_CYCLE_RAILWAY, + RCT1_RIDE_TYPE_SUSPENDED_LOOPING_ROLLER_COASTER, + RCT1_RIDE_TYPE_WATER_COASTER, + RCT1_RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, + RCT1_RIDE_TYPE_INVERTED_WILD_MOUSE_COASTER, + RCT1_RIDE_TYPE_JET_SKIS, + RCT1_RIDE_TYPE_T_SHIRT_STALL, + RCT1_RIDE_TYPE_RAFT_RIDE, + RCT1_RIDE_TYPE_DOUGHNUT_SHOP, + RCT1_RIDE_TYPE_ENTERPRISE, + RCT1_RIDE_TYPE_COFFEE_SHOP, + RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL, + RCT1_RIDE_TYPE_LEMONADE_STALL, - RCT1_RIDE_TYPE_COUNT -}; + RCT1_RIDE_TYPE_COUNT + }; -enum -{ - RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN = 0, - RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN_BACKWARDS, - RCT1_VEHICLE_TYPE_WOODEN_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_INVERTED_COASTER_TRAIN, // Not in RCT2 - RCT1_VEHICLE_TYPE_SUSPENDED_SWINGING_CARS, - RCT1_VEHICLE_TYPE_LADYBIRD_CARS, - RCT1_VEHICLE_TYPE_STANDUP_ROLLER_COASTER_CARS, - RCT1_VEHICLE_TYPE_SPINNING_CARS, - RCT1_VEHICLE_TYPE_SINGLE_PERSON_SWINGING_CHAIRS, - RCT1_VEHICLE_TYPE_SWANS_PEDAL_BOATS, - RCT1_VEHICLE_TYPE_LARGE_MONORAIL_TRAIN, - RCT1_VEHICLE_TYPE_CANOES, - RCT1_VEHICLE_TYPE_ROWING_BOATS, - RCT1_VEHICLE_TYPE_STEAM_TRAIN, - RCT1_VEHICLE_TYPE_WOODEN_MOUSE_CARS, - RCT1_VEHICLE_TYPE_BUMPER_BOATS, - RCT1_VEHICLE_TYPE_WOODEN_ROLLER_COASTER_TRAIN_BACKWARDS, - RCT1_VEHICLE_TYPE_ROCKET_CARS, - RCT1_VEHICLE_TYPE_HORSES, // Steeplechase - RCT1_VEHICLE_TYPE_SPORTSCARS, - RCT1_VEHICLE_TYPE_LYING_DOWN_SWINGING_CARS, // Inverted single-rail - RCT1_VEHICLE_TYPE_WOODEN_MINE_CARS, - RCT1_VEHICLE_TYPE_SUSPENDED_SWINGING_AIRPLANE_CARS, - RCT1_VEHICLE_TYPE_SMALL_MONORAIL_CARS, - RCT1_VEHICLE_TYPE_WATER_TRICYCLES, - RCT1_VEHICLE_TYPE_LAUNCHED_FREEFALL_CAR, - RCT1_VEHICLE_TYPE_BOBSLEIGH_CARS, - RCT1_VEHICLE_TYPE_DINGHIES, - RCT1_VEHICLE_TYPE_ROTATING_CABIN, - RCT1_VEHICLE_TYPE_MINE_TRAIN, - RCT1_VEHICLE_TYPE_CHAIRLIFT_CARS, - RCT1_VEHICLE_TYPE_CORKSCREW_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_MOTORBIKES, - RCT1_VEHICLE_TYPE_RACING_CARS, - RCT1_VEHICLE_TYPE_TRUCKS, - RCT1_VEHICLE_TYPE_GO_KARTS, - RCT1_VEHICLE_TYPE_RAPIDS_BOATS, - RCT1_VEHICLE_TYPE_LOG_FLUME_BOATS, - RCT1_VEHICLE_TYPE_DODGEMS, - RCT1_VEHICLE_TYPE_SWINGING_SHIP, - RCT1_VEHICLE_TYPE_SWINGING_INVERTER_SHIP, - RCT1_VEHICLE_TYPE_MERRY_GO_ROUND, - RCT1_VEHICLE_TYPE_FERRIS_WHEEL, - RCT1_VEHICLE_TYPE_SIMULATOR_POD, - RCT1_VEHICLE_TYPE_CINEMA_BUILDING, - RCT1_VEHICLE_TYPE_TOPSPIN_CAR, - RCT1_VEHICLE_TYPE_SPACE_RINGS, - RCT1_VEHICLE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER_CAR, - RCT1_VEHICLE_TYPE_VERTICAL_ROLLER_COASTER_CARS, - RCT1_VEHICLE_TYPE_CAT_CARS, - RCT1_VEHICLE_TYPE_TWIST_ARMS_AND_CARS, - RCT1_VEHICLE_TYPE_HAUNTED_HOUSE_BUILDING, - RCT1_VEHICLE_TYPE_LOG_CARS, - RCT1_VEHICLE_TYPE_CIRCUS_TENT, - RCT1_VEHICLE_TYPE_GHOST_TRAIN_CARS, - RCT1_VEHICLE_TYPE_STEEL_TWISTER_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_WOODEN_TWISTER_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_WOODEN_SIDE_FRICTION_CARS, - RCT1_VEHICLE_TYPE_VINTAGE_CARS, - RCT1_VEHICLE_TYPE_STEAM_TRAIN_COVERED_CARS, - RCT1_VEHICLE_TYPE_STAND_UP_STEEL_TWISTER_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_FLOORLESS_STEEL_TWISTER_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_STEEL_MOUSE_CARS, - RCT1_VEHICLE_TYPE_CHAIRLIFT_CARS_ALTERNATIVE, - RCT1_VEHICLE_TYPE_SUSPENDED_MONORAIL_TRAIN, - RCT1_VEHICLE_TYPE_HELICOPTER_CARS, - RCT1_VEHICLE_TYPE_VIRGINIA_REEL_TUBS, - RCT1_VEHICLE_TYPE_REVERSER_CARS, - RCT1_VEHICLE_TYPE_GOLFERS, - RCT1_VEHICLE_TYPE_RIVER_RIDE_BOATS, - RCT1_VEHICLE_TYPE_FLYING_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_HEARTLINE_TWISTER_CARS, - RCT1_VEHICLE_TYPE_HEARTLINE_TWISTER_CARS_REVERSED, - RCT1_VEHICLE_TYPE_RESERVED, - RCT1_VEHICLE_TYPE_ROTODROP_CAR, - RCT1_VEHICLE_TYPE_FLYING_SAUCERS, - RCT1_VEHICLE_TYPE_CROOKED_HOUSE_BUILDING, - RCT1_VEHICLE_TYPE_BICYCLES, - RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN, - RCT1_VEHICLE_TYPE_4_ACROSS_INVERTED_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_WATER_COASTER_BOATS, - RCT1_VEHICLE_TYPE_FACEOFF_CARS, - RCT1_VEHICLE_TYPE_JET_SKIS, - RCT1_VEHICLE_TYPE_RAFT_BOATS, - RCT1_VEHICLE_TYPE_AMERICAN_STYLE_STEAM_TRAIN, - RCT1_VEHICLE_TYPE_AIR_POWERED_COASTER_TRAIN, - RCT1_VEHICLE_TYPE_SUSPENDED_WILD_MOUSE_CARS, // Inverted Hairpin in RCT2 - RCT1_VEHICLE_TYPE_ENTERPRISE_WHEEL, + enum + { + RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN = 0, + RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN_BACKWARDS, + RCT1_VEHICLE_TYPE_WOODEN_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_INVERTED_COASTER_TRAIN, // Not in RCT2 + RCT1_VEHICLE_TYPE_SUSPENDED_SWINGING_CARS, + RCT1_VEHICLE_TYPE_LADYBIRD_CARS, + RCT1_VEHICLE_TYPE_STANDUP_ROLLER_COASTER_CARS, + RCT1_VEHICLE_TYPE_SPINNING_CARS, + RCT1_VEHICLE_TYPE_SINGLE_PERSON_SWINGING_CHAIRS, + RCT1_VEHICLE_TYPE_SWANS_PEDAL_BOATS, + RCT1_VEHICLE_TYPE_LARGE_MONORAIL_TRAIN, + RCT1_VEHICLE_TYPE_CANOES, + RCT1_VEHICLE_TYPE_ROWING_BOATS, + RCT1_VEHICLE_TYPE_STEAM_TRAIN, + RCT1_VEHICLE_TYPE_WOODEN_MOUSE_CARS, + RCT1_VEHICLE_TYPE_BUMPER_BOATS, + RCT1_VEHICLE_TYPE_WOODEN_ROLLER_COASTER_TRAIN_BACKWARDS, + RCT1_VEHICLE_TYPE_ROCKET_CARS, + RCT1_VEHICLE_TYPE_HORSES, // Steeplechase + RCT1_VEHICLE_TYPE_SPORTSCARS, + RCT1_VEHICLE_TYPE_LYING_DOWN_SWINGING_CARS, // Inverted single-rail + RCT1_VEHICLE_TYPE_WOODEN_MINE_CARS, + RCT1_VEHICLE_TYPE_SUSPENDED_SWINGING_AIRPLANE_CARS, + RCT1_VEHICLE_TYPE_SMALL_MONORAIL_CARS, + RCT1_VEHICLE_TYPE_WATER_TRICYCLES, + RCT1_VEHICLE_TYPE_LAUNCHED_FREEFALL_CAR, + RCT1_VEHICLE_TYPE_BOBSLEIGH_CARS, + RCT1_VEHICLE_TYPE_DINGHIES, + RCT1_VEHICLE_TYPE_ROTATING_CABIN, + RCT1_VEHICLE_TYPE_MINE_TRAIN, + RCT1_VEHICLE_TYPE_CHAIRLIFT_CARS, + RCT1_VEHICLE_TYPE_CORKSCREW_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_MOTORBIKES, + RCT1_VEHICLE_TYPE_RACING_CARS, + RCT1_VEHICLE_TYPE_TRUCKS, + RCT1_VEHICLE_TYPE_GO_KARTS, + RCT1_VEHICLE_TYPE_RAPIDS_BOATS, + RCT1_VEHICLE_TYPE_LOG_FLUME_BOATS, + RCT1_VEHICLE_TYPE_DODGEMS, + RCT1_VEHICLE_TYPE_SWINGING_SHIP, + RCT1_VEHICLE_TYPE_SWINGING_INVERTER_SHIP, + RCT1_VEHICLE_TYPE_MERRY_GO_ROUND, + RCT1_VEHICLE_TYPE_FERRIS_WHEEL, + RCT1_VEHICLE_TYPE_SIMULATOR_POD, + RCT1_VEHICLE_TYPE_CINEMA_BUILDING, + RCT1_VEHICLE_TYPE_TOPSPIN_CAR, + RCT1_VEHICLE_TYPE_SPACE_RINGS, + RCT1_VEHICLE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER_CAR, + RCT1_VEHICLE_TYPE_VERTICAL_ROLLER_COASTER_CARS, + RCT1_VEHICLE_TYPE_CAT_CARS, + RCT1_VEHICLE_TYPE_TWIST_ARMS_AND_CARS, + RCT1_VEHICLE_TYPE_HAUNTED_HOUSE_BUILDING, + RCT1_VEHICLE_TYPE_LOG_CARS, + RCT1_VEHICLE_TYPE_CIRCUS_TENT, + RCT1_VEHICLE_TYPE_GHOST_TRAIN_CARS, + RCT1_VEHICLE_TYPE_STEEL_TWISTER_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_WOODEN_TWISTER_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_WOODEN_SIDE_FRICTION_CARS, + RCT1_VEHICLE_TYPE_VINTAGE_CARS, + RCT1_VEHICLE_TYPE_STEAM_TRAIN_COVERED_CARS, + RCT1_VEHICLE_TYPE_STAND_UP_STEEL_TWISTER_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_FLOORLESS_STEEL_TWISTER_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_STEEL_MOUSE_CARS, + RCT1_VEHICLE_TYPE_CHAIRLIFT_CARS_ALTERNATIVE, + RCT1_VEHICLE_TYPE_SUSPENDED_MONORAIL_TRAIN, + RCT1_VEHICLE_TYPE_HELICOPTER_CARS, + RCT1_VEHICLE_TYPE_VIRGINIA_REEL_TUBS, + RCT1_VEHICLE_TYPE_REVERSER_CARS, + RCT1_VEHICLE_TYPE_GOLFERS, + RCT1_VEHICLE_TYPE_RIVER_RIDE_BOATS, + RCT1_VEHICLE_TYPE_FLYING_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_HEARTLINE_TWISTER_CARS, + RCT1_VEHICLE_TYPE_HEARTLINE_TWISTER_CARS_REVERSED, + RCT1_VEHICLE_TYPE_RESERVED, + RCT1_VEHICLE_TYPE_ROTODROP_CAR, + RCT1_VEHICLE_TYPE_FLYING_SAUCERS, + RCT1_VEHICLE_TYPE_CROOKED_HOUSE_BUILDING, + RCT1_VEHICLE_TYPE_BICYCLES, + RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN, + RCT1_VEHICLE_TYPE_4_ACROSS_INVERTED_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_WATER_COASTER_BOATS, + RCT1_VEHICLE_TYPE_FACEOFF_CARS, + RCT1_VEHICLE_TYPE_JET_SKIS, + RCT1_VEHICLE_TYPE_RAFT_BOATS, + RCT1_VEHICLE_TYPE_AMERICAN_STYLE_STEAM_TRAIN, + RCT1_VEHICLE_TYPE_AIR_POWERED_COASTER_TRAIN, + RCT1_VEHICLE_TYPE_SUSPENDED_WILD_MOUSE_CARS, // Inverted Hairpin in RCT2 + RCT1_VEHICLE_TYPE_ENTERPRISE_WHEEL, - RCT1_VEHICLE_TYPE_COUNT -}; + RCT1_VEHICLE_TYPE_COUNT + }; -enum -{ - RCT1_TRACK_ELEM_BOOSTER = 100 -}; + enum + { + RCT1_TRACK_ELEM_BOOSTER = 100 + }; -enum -{ - RCT1_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE = 2, - RCT1_RIDE_MODE_POWERED_LAUNCH = 3, -}; + enum + { + RCT1_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE = 2, + RCT1_RIDE_MODE_POWERED_LAUNCH = 3, + }; -enum -{ - RCT1_RIDE_DEPART_PLAY_MUSIC = 1 << 5, -}; + enum + { + RCT1_RIDE_DEPART_PLAY_MUSIC = 1 << 5, + }; -enum -{ - RCT1_SCENERY_THEME_GENERAL, - RCT1_SCENERY_THEME_MINE, - RCT1_SCENERY_THEME_CLASSICAL_ROMAN, - RCT1_SCENERY_THEME_EGYPTIAN, - RCT1_SCENERY_THEME_MARTIAN, - RCT1_SCENERY_THEME_JUMPING_FOUNTAINS, // Single researchable scenery item - RCT1_SCENERY_THEME_WONDERLAND, - RCT1_SCENERY_THEME_JURASSIC, - RCT1_SCENERY_THEME_SPOOKY, - RCT1_SCENERY_THEME_JUNGLE, - RCT1_SCENERY_THEME_ABSTRACT, - RCT1_SCENERY_THEME_GARDEN_CLOCK, // Single researchable scenery item - RCT1_SCENERY_THEME_SNOW_ICE, - RCT1_SCENERY_THEME_MEDIEVAL, - RCT1_SCENERY_THEME_SPACE, - RCT1_SCENERY_THEME_CREEPY, - RCT1_SCENERY_THEME_URBAN, - RCT1_SCENERY_THEME_PAGODA, -}; + enum + { + RCT1_SCENERY_THEME_GENERAL, + RCT1_SCENERY_THEME_MINE, + RCT1_SCENERY_THEME_CLASSICAL_ROMAN, + RCT1_SCENERY_THEME_EGYPTIAN, + RCT1_SCENERY_THEME_MARTIAN, + RCT1_SCENERY_THEME_JUMPING_FOUNTAINS, // Single researchable scenery item + RCT1_SCENERY_THEME_WONDERLAND, + RCT1_SCENERY_THEME_JURASSIC, + RCT1_SCENERY_THEME_SPOOKY, + RCT1_SCENERY_THEME_JUNGLE, + RCT1_SCENERY_THEME_ABSTRACT, + RCT1_SCENERY_THEME_GARDEN_CLOCK, // Single researchable scenery item + RCT1_SCENERY_THEME_SNOW_ICE, + RCT1_SCENERY_THEME_MEDIEVAL, + RCT1_SCENERY_THEME_SPACE, + RCT1_SCENERY_THEME_CREEPY, + RCT1_SCENERY_THEME_URBAN, + RCT1_SCENERY_THEME_PAGODA, + }; -enum -{ - RCT1_FOOTPATH_TYPE_QUEUE_BLUE, - RCT1_FOOTPATH_TYPE_QUEUE_RED, - RCT1_FOOTPATH_TYPE_QUEUE_YELLOW, - RCT1_FOOTPATH_TYPE_QUEUE_GREEN, + enum + { + RCT1_FOOTPATH_TYPE_QUEUE_BLUE, + RCT1_FOOTPATH_TYPE_QUEUE_RED, + RCT1_FOOTPATH_TYPE_QUEUE_YELLOW, + RCT1_FOOTPATH_TYPE_QUEUE_GREEN, - RCT1_FOOTPATH_TYPE_TARMAC_GRAY, - RCT1_FOOTPATH_TYPE_TARMAC_RED, - RCT1_FOOTPATH_TYPE_TARMAC_BROWN, - RCT1_FOOTPATH_TYPE_TARMAC_GREEN, + RCT1_FOOTPATH_TYPE_TARMAC_GRAY, + RCT1_FOOTPATH_TYPE_TARMAC_RED, + RCT1_FOOTPATH_TYPE_TARMAC_BROWN, + RCT1_FOOTPATH_TYPE_TARMAC_GREEN, - RCT1_FOOTPATH_TYPE_DIRT_RED, - RCT1_FOOTPATH_TYPE_DIRT_BLACK, + RCT1_FOOTPATH_TYPE_DIRT_RED, + RCT1_FOOTPATH_TYPE_DIRT_BLACK, - RCT1_FOOTPATH_TYPE_CRAZY_PAVING = 12, + RCT1_FOOTPATH_TYPE_CRAZY_PAVING = 12, - RCT1_FOOTPATH_TYPE_ROADS = 16, + RCT1_FOOTPATH_TYPE_ROADS = 16, - RCT1_FOOTPATH_TYPE_TILE_PINK = 20, - RCT1_FOOTPATH_TYPE_TILE_GRAY, - RCT1_FOOTPATH_TYPE_TILE_RED, - RCT1_FOOTPATH_TYPE_TILE_GREEN, -}; + RCT1_FOOTPATH_TYPE_TILE_PINK = 20, + RCT1_FOOTPATH_TYPE_TILE_GRAY, + RCT1_FOOTPATH_TYPE_TILE_RED, + RCT1_FOOTPATH_TYPE_TILE_GREEN, + }; -enum -{ - FOOTPATH_SUPPORTS_WOODEN_TRUSS, - FOOTPATH_SUPPORTS_WOOD, - FOOTPATH_SUPPORTS_STEEL, - FOOTPATH_SUPPORTS_BAMBOO, -}; + enum + { + FOOTPATH_SUPPORTS_WOODEN_TRUSS, + FOOTPATH_SUPPORTS_WOOD, + FOOTPATH_SUPPORTS_STEEL, + FOOTPATH_SUPPORTS_BAMBOO, + }; -enum -{ - RCT1_PATH_ADDITION_NONE, - RCT1_PATH_ADDITION_LAMP_1, - RCT1_PATH_ADDITION_LAMP_2, - RCT1_PATH_ADDITION_BIN, - RCT1_PATH_ADDITION_BENCH, - RCT1_PATH_ADDITION_JUMPING_FOUNTAIN, - RCT1_PATH_ADDITION_LAMP_3, - RCT1_PATH_ADDITION_LAMP_4, - RCT1_PATH_ADDITION_BROKEN_LAMP_1, - RCT1_PATH_ADDITION_BROKEN_LAMP_2, - RCT1_PATH_ADDITION_BROKEN_BIN, - RCT1_PATH_ADDITION_BROKEN_BENCH, - RCT1_PATH_ADDITION_BROKEN_LAMP_3, - RCT1_PATH_ADDITION_BROKEN_LAMP_4, - RCT1_PATH_ADDITION_JUMPING_SNOW, -}; + enum + { + RCT1_PATH_ADDITION_NONE, + RCT1_PATH_ADDITION_LAMP_1, + RCT1_PATH_ADDITION_LAMP_2, + RCT1_PATH_ADDITION_BIN, + RCT1_PATH_ADDITION_BENCH, + RCT1_PATH_ADDITION_JUMPING_FOUNTAIN, + RCT1_PATH_ADDITION_LAMP_3, + RCT1_PATH_ADDITION_LAMP_4, + RCT1_PATH_ADDITION_BROKEN_LAMP_1, + RCT1_PATH_ADDITION_BROKEN_LAMP_2, + RCT1_PATH_ADDITION_BROKEN_BIN, + RCT1_PATH_ADDITION_BROKEN_BENCH, + RCT1_PATH_ADDITION_BROKEN_LAMP_3, + RCT1_PATH_ADDITION_BROKEN_LAMP_4, + RCT1_PATH_ADDITION_JUMPING_SNOW, + }; -enum -{ - RCT1_WALL_TYPE_MESH_FENCE = 0, - RCT1_WALL_TYPE_MESH_FENCE_WITH_GATE = 1, - RCT1_WALL_TYPE_ROMAN = 2, - RCT1_WALL_TYPE_EGYPTIAN = 3, - RCT1_WALL_TYPE_HEDGE = 4, - RCT1_WALL_TYPE_HEDGE_WITH_GATE = 5, - RCT1_WALL_TYPE_BLUE_PLAYING_CARDS = 6, - RCT1_WALL_TYPE_RED_PLAYING_CARDS = 7, - RCT1_WALL_TYPE_WHITE_RAILING = 8, - RCT1_WALL_TYPE_WHITE_RAILING_WITH_GATE = 9, - RCT1_WALL_TYPE_MARTIAN = 10, - RCT1_WALL_TYPE_GLASS_SMOOTH = 11, - RCT1_WALL_TYPE_WOODEN_PANEL_FENCE = 12, - RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_GATE = 13, - RCT1_WALL_TYPE_WOODEN_POST_FENCE = 14, - RCT1_WALL_TYPE_RED_WOODEN_POST_FENCE = 15, - RCT1_WALL_TYPE_BARBED_WIRE = 16, - RCT1_WALL_TYPE_BARBED_WIRE_WITH_GATE = 17, - RCT1_WALL_TYPE_PRIMITIVE_TALL_WOOD_FENCE = 18, - RCT1_WALL_TYPE_PRIMITIVE_SHORT_WOOD_FENCE = 19, - RCT1_WALL_TYPE_IRON_RAILING = 20, - RCT1_WALL_TYPE_IRON_RAILING_WITH_GATE = 21, - RCT1_WALL_TYPE_GLASS_PANELS = 22, - RCT1_WALL_TYPE_BONE_FENCE = 23, - RCT1_WALL_TYPE_BRICK = 24, - RCT1_WALL_TYPE_BRICK_WITH_GATE = 25, - RCT1_WALL_TYPE_WHITE_WOODEN_PANEL_FENCE = 26, - RCT1_WALL_TYPE_RED_WOODEN_PANEL_FENCE = 27, - RCT1_WALL_TYPE_STONE = 28, - RCT1_WALL_TYPE_STONE_WITH_GATE = 29, - RCT1_WALL_TYPE_WOODEN_FENCE = 30, - RCT1_WALL_TYPE_JUNGLE = 31, - RCT1_WALL_TYPE_CONIFER_HEDGE = 32, - RCT1_WALL_TYPE_CONIFER_HEDGE_WITH_GATE = 33, - RCT1_WALL_TYPE_SMALL_BROWN_CASTLE = 34, - RCT1_WALL_TYPE_SMALL_GREY_CASTLE = 35, - RCT1_WALL_TYPE_ROMAN_COLUMN = 36, - RCT1_WALL_TYPE_LARGE_BROWN_CASTLE = 37, - RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_CROSS = 38, - RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_GATE = 39, - RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_WINDOW = 40, - RCT1_WALL_TYPE_MEDIUM_BROWN_CASTLE = 41, - RCT1_WALL_TYPE_LARGE_GREY_CASTLE = 42, - RCT1_WALL_TYPE_LARGE_GREY_CASTLE_CROSS = 43, - RCT1_WALL_TYPE_LARGE_GREY_CASTLE_GATE = 44, - RCT1_WALL_TYPE_LARGE_GREY_CASTLE_WINDOW = 45, - RCT1_WALL_TYPE_MEDIUM_GREY_CASTLE = 46, - RCT1_WALL_TYPE_CREEPY = 47, - RCT1_WALL_TYPE_CREEPY_GATE = 48, - RCT1_WALL_TYPE_BARBED_WIRE_WITH_SNOW = 49, - RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_SNOW = 50, - RCT1_WALL_TYPE_WOODEN_POST_FENCE_WITH_SNOW = 51, -}; + enum + { + RCT1_WALL_TYPE_MESH_FENCE = 0, + RCT1_WALL_TYPE_MESH_FENCE_WITH_GATE = 1, + RCT1_WALL_TYPE_ROMAN = 2, + RCT1_WALL_TYPE_EGYPTIAN = 3, + RCT1_WALL_TYPE_HEDGE = 4, + RCT1_WALL_TYPE_HEDGE_WITH_GATE = 5, + RCT1_WALL_TYPE_BLUE_PLAYING_CARDS = 6, + RCT1_WALL_TYPE_RED_PLAYING_CARDS = 7, + RCT1_WALL_TYPE_WHITE_RAILING = 8, + RCT1_WALL_TYPE_WHITE_RAILING_WITH_GATE = 9, + RCT1_WALL_TYPE_MARTIAN = 10, + RCT1_WALL_TYPE_GLASS_SMOOTH = 11, + RCT1_WALL_TYPE_WOODEN_PANEL_FENCE = 12, + RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_GATE = 13, + RCT1_WALL_TYPE_WOODEN_POST_FENCE = 14, + RCT1_WALL_TYPE_RED_WOODEN_POST_FENCE = 15, + RCT1_WALL_TYPE_BARBED_WIRE = 16, + RCT1_WALL_TYPE_BARBED_WIRE_WITH_GATE = 17, + RCT1_WALL_TYPE_PRIMITIVE_TALL_WOOD_FENCE = 18, + RCT1_WALL_TYPE_PRIMITIVE_SHORT_WOOD_FENCE = 19, + RCT1_WALL_TYPE_IRON_RAILING = 20, + RCT1_WALL_TYPE_IRON_RAILING_WITH_GATE = 21, + RCT1_WALL_TYPE_GLASS_PANELS = 22, + RCT1_WALL_TYPE_BONE_FENCE = 23, + RCT1_WALL_TYPE_BRICK = 24, + RCT1_WALL_TYPE_BRICK_WITH_GATE = 25, + RCT1_WALL_TYPE_WHITE_WOODEN_PANEL_FENCE = 26, + RCT1_WALL_TYPE_RED_WOODEN_PANEL_FENCE = 27, + RCT1_WALL_TYPE_STONE = 28, + RCT1_WALL_TYPE_STONE_WITH_GATE = 29, + RCT1_WALL_TYPE_WOODEN_FENCE = 30, + RCT1_WALL_TYPE_JUNGLE = 31, + RCT1_WALL_TYPE_CONIFER_HEDGE = 32, + RCT1_WALL_TYPE_CONIFER_HEDGE_WITH_GATE = 33, + RCT1_WALL_TYPE_SMALL_BROWN_CASTLE = 34, + RCT1_WALL_TYPE_SMALL_GREY_CASTLE = 35, + RCT1_WALL_TYPE_ROMAN_COLUMN = 36, + RCT1_WALL_TYPE_LARGE_BROWN_CASTLE = 37, + RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_CROSS = 38, + RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_GATE = 39, + RCT1_WALL_TYPE_LARGE_BROWN_CASTLE_WINDOW = 40, + RCT1_WALL_TYPE_MEDIUM_BROWN_CASTLE = 41, + RCT1_WALL_TYPE_LARGE_GREY_CASTLE = 42, + RCT1_WALL_TYPE_LARGE_GREY_CASTLE_CROSS = 43, + RCT1_WALL_TYPE_LARGE_GREY_CASTLE_GATE = 44, + RCT1_WALL_TYPE_LARGE_GREY_CASTLE_WINDOW = 45, + RCT1_WALL_TYPE_MEDIUM_GREY_CASTLE = 46, + RCT1_WALL_TYPE_CREEPY = 47, + RCT1_WALL_TYPE_CREEPY_GATE = 48, + RCT1_WALL_TYPE_BARBED_WIRE_WITH_SNOW = 49, + RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_SNOW = 50, + RCT1_WALL_TYPE_WOODEN_POST_FENCE_WITH_SNOW = 51, + }; -enum -{ - RCT1_RESEARCH_END_AVAILABLE = 0xFF, - RCT1_RESEARCH_END_RESEARCHABLE = 0xFE, - RCT1_RESEARCH_END = 0xFD, -}; + enum + { + RCT1_RESEARCH_END_AVAILABLE = 0xFF, + RCT1_RESEARCH_END_RESEARCHABLE = 0xFE, + RCT1_RESEARCH_END = 0xFD, + }; -enum -{ - RCT1_RESEARCH_TYPE_THEME, - RCT1_RESEARCH_TYPE_RIDE, - RCT1_RESEARCH_TYPE_VEHICLE, - RCT1_RESEARCH_TYPE_SPECIAL, -}; + enum + { + RCT1_RESEARCH_TYPE_THEME, + RCT1_RESEARCH_TYPE_RIDE, + RCT1_RESEARCH_TYPE_VEHICLE, + RCT1_RESEARCH_TYPE_SPECIAL, + }; -enum -{ - RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS = 1 << 0, - RCT1_RESEARCH_CATEGORY_THRILL_RIDES = 1 << 1, - RCT1_RESEARCH_CATEGORY_GENTLE_TRANSPORT_RIDES = 1 << 2, - RCT1_RESEARCH_CATEGORY_SHOPS = 1 << 3, - RCT1_RESEARCH_CATEGORY_SCENERY_THEMING = 1 << 4, - RCT1_RESEARCH_CATEGORY_RIDE_IMPROVEMENTS = 1 << 5, -}; + enum + { + RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS = 1 << 0, + RCT1_RESEARCH_CATEGORY_THRILL_RIDES = 1 << 1, + RCT1_RESEARCH_CATEGORY_GENTLE_TRANSPORT_RIDES = 1 << 2, + RCT1_RESEARCH_CATEGORY_SHOPS = 1 << 3, + RCT1_RESEARCH_CATEGORY_SCENERY_THEMING = 1 << 4, + RCT1_RESEARCH_CATEGORY_RIDE_IMPROVEMENTS = 1 << 5, + }; -// Unconfirmed special track elements for research -enum -{ - RCT1_RESEARCH_SPECIAL_BANKED_CURVES = 0x06, - RCT1_RESEARCH_SPECIAL_VERTICAL_LOOP = 0x07, - RCT1_RESEARCH_SPECIAL_STEEP_TWIST = 0x0C, - RCT1_RESEARCH_SPECIAL_INLINE_TWIST = 0x11, - RCT1_RESEARCH_SPECIAL_HALF_LOOP = 0x12, - RCT1_RESEARCH_SPECIAL_CORKSCREW = 0x13, - RCT1_RESEARCH_SPECIAL_BANKED_HELIX_A = 0x15, - RCT1_RESEARCH_SPECIAL_BANKED_HELIX_B = 0x16, - RCT1_RESEARCH_SPECIAL_HELIX = 0x17, - RCT1_RESEARCH_SPECIAL_ON_RIDE_PHOTO = 0x1A, - RCT1_RESEARCH_SPECIAL_WATER_SPLASH = 0x1B, - RCT1_RESEARCH_SPECIAL_VERTICAL_DROP = 0x1C, - RCT1_RESEARCH_SPECIAL_BARREL_ROLL = 0x1D, - RCT1_RESEARCH_SPECIAL_LAUNCHED_LIFT_HILL = 0x1E, - RCT1_RESEARCH_SPECIAL_LARGE_LOOP_AND_HALF = 0x1F, - RCT1_RESEARCH_SPECIAL_REVERSER_TURNTABLE = 0x21, - RCT1_RESEARCH_SPECIAL_HEARTLINE_ROLL = 0x22, - RCT1_RESEARCH_SPECIAL_REVERSING_SECTIONS = 0x23, -}; + // Unconfirmed special track elements for research + enum + { + RCT1_RESEARCH_SPECIAL_BANKED_CURVES = 0x06, + RCT1_RESEARCH_SPECIAL_VERTICAL_LOOP = 0x07, + RCT1_RESEARCH_SPECIAL_STEEP_TWIST = 0x0C, + RCT1_RESEARCH_SPECIAL_INLINE_TWIST = 0x11, + RCT1_RESEARCH_SPECIAL_HALF_LOOP = 0x12, + RCT1_RESEARCH_SPECIAL_CORKSCREW = 0x13, + RCT1_RESEARCH_SPECIAL_BANKED_HELIX_A = 0x15, + RCT1_RESEARCH_SPECIAL_BANKED_HELIX_B = 0x16, + RCT1_RESEARCH_SPECIAL_HELIX = 0x17, + RCT1_RESEARCH_SPECIAL_ON_RIDE_PHOTO = 0x1A, + RCT1_RESEARCH_SPECIAL_WATER_SPLASH = 0x1B, + RCT1_RESEARCH_SPECIAL_VERTICAL_DROP = 0x1C, + RCT1_RESEARCH_SPECIAL_BARREL_ROLL = 0x1D, + RCT1_RESEARCH_SPECIAL_LAUNCHED_LIFT_HILL = 0x1E, + RCT1_RESEARCH_SPECIAL_LARGE_LOOP_AND_HALF = 0x1F, + RCT1_RESEARCH_SPECIAL_REVERSER_TURNTABLE = 0x21, + RCT1_RESEARCH_SPECIAL_HEARTLINE_ROLL = 0x22, + RCT1_RESEARCH_SPECIAL_REVERSING_SECTIONS = 0x23, + }; -enum -{ - RCT1_SCENARIO_FLAG_0 = 1 << 0, - RCT1_SCENARIO_FLAG_1 = 1 << 1, - RCT1_SCENARIO_FLAG_2 = 1 << 2, - RCT1_SCENARIO_FLAG_3 = 1 << 3, - RCT1_SCENARIO_FLAG_ENABLE_BANNERS = 1 << 4, - RCT1_SCENARIO_FLAG_5 = 1 << 5, - RCT1_SCENARIO_FLAG_6 = 1 << 6, - RCT1_SCENARIO_FLAG_7 = 1 << 7, - RCT1_SCENARIO_FLAG_CUSTOM_PARK_ENTRANCE_PATH = 1 << 8, - RCT1_SCENARIO_FLAG_NO_CASH_RESET = 1 << 9, - RCT1_SCENARIO_FLAG_10 = 1 << 10, - RCT1_SCENARIO_FLAG_11 = 1 << 11, - RCT1_SCENARIO_FLAG_12 = 1 << 12, - RCT1_SCENARIO_FLAG_CUSTOM_MAP_SIZE = 1 << 13, - RCT1_SCENARIO_FLAG_14 = 1 << 14, - RCT1_SCENARIO_FLAG_15 = 1 << 15, - RCT1_SCENARIO_FLAG_16 = 1 << 16, - RCT1_SCENARIO_FLAG_17 = 1 << 17, - RCT1_SCENARIO_FLAG_18 = 1 << 18, - RCT1_SCENARIO_FLAG_19 = 1 << 19, -}; + enum + { + RCT1_SCENARIO_FLAG_0 = 1 << 0, + RCT1_SCENARIO_FLAG_1 = 1 << 1, + RCT1_SCENARIO_FLAG_2 = 1 << 2, + RCT1_SCENARIO_FLAG_3 = 1 << 3, + RCT1_SCENARIO_FLAG_ENABLE_BANNERS = 1 << 4, + RCT1_SCENARIO_FLAG_5 = 1 << 5, + RCT1_SCENARIO_FLAG_6 = 1 << 6, + RCT1_SCENARIO_FLAG_7 = 1 << 7, + RCT1_SCENARIO_FLAG_CUSTOM_PARK_ENTRANCE_PATH = 1 << 8, + RCT1_SCENARIO_FLAG_NO_CASH_RESET = 1 << 9, + RCT1_SCENARIO_FLAG_10 = 1 << 10, + RCT1_SCENARIO_FLAG_11 = 1 << 11, + RCT1_SCENARIO_FLAG_12 = 1 << 12, + RCT1_SCENARIO_FLAG_CUSTOM_MAP_SIZE = 1 << 13, + RCT1_SCENARIO_FLAG_14 = 1 << 14, + RCT1_SCENARIO_FLAG_15 = 1 << 15, + RCT1_SCENARIO_FLAG_16 = 1 << 16, + RCT1_SCENARIO_FLAG_17 = 1 << 17, + RCT1_SCENARIO_FLAG_18 = 1 << 18, + RCT1_SCENARIO_FLAG_19 = 1 << 19, + }; -enum -{ - RCT1_PARK_FLAGS_PARK_OPEN = (1 << 0), - RCT1_PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT = (1 << 1), - RCT1_PARK_FLAGS_FORBID_LANDSCAPE_CHANGES = (1 << 2), - RCT1_PARK_FLAGS_FORBID_TREE_REMOVAL = (1 << 3), - RCT1_PARK_FLAGS_SHOW_REAL_GUEST_NAMES = (1 << 4), - RCT1_PARK_FLAGS_FORBID_HIGH_CONSTRUCTION = (1 << 5), // Below tree height - RCT1_PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6), - RCT1_PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7), - RCT1_PARK_FLAGS_ANTI_CHEAT_DEPRECATED = (1 << 8), // Not used anymore, used for cheat detection - RCT1_PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 9), - RCT1_PARK_FLAGS_NO_MONEY = (1 << 11), // Used for both scenarios and saved games, unlike RCT2 - RCT1_PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12), - RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE = (1 << 13), // Off: rides and park entry chargeable. On: only rides chargeable. - RCT1_PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14), - RCT1_PARK_FLAGS_LOCK_REAL_NAMES_OPTION_DEPRECATED = (1 << 15), // Deprecated now we use a persistent 'real names' setting -}; + enum + { + RCT1_PARK_FLAGS_PARK_OPEN = (1 << 0), + RCT1_PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT = (1 << 1), + RCT1_PARK_FLAGS_FORBID_LANDSCAPE_CHANGES = (1 << 2), + RCT1_PARK_FLAGS_FORBID_TREE_REMOVAL = (1 << 3), + RCT1_PARK_FLAGS_SHOW_REAL_GUEST_NAMES = (1 << 4), + RCT1_PARK_FLAGS_FORBID_HIGH_CONSTRUCTION = (1 << 5), // Below tree height + RCT1_PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6), + RCT1_PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7), + RCT1_PARK_FLAGS_ANTI_CHEAT_DEPRECATED = (1 << 8), // Not used anymore, used for cheat detection + RCT1_PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 9), + RCT1_PARK_FLAGS_NO_MONEY = (1 << 11), // Used for both scenarios and saved games, unlike RCT2 + RCT1_PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12), + RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE = (1 << 13), // Off: rides and park entry chargeable. On: only rides + // chargeable. + RCT1_PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14), + RCT1_PARK_FLAGS_LOCK_REAL_NAMES_OPTION_DEPRECATED = (1 << 15), // Deprecated now we use a persistent 'real names' + // setting + }; -enum -{ - STEEL_RC_FRONT = 0, - STEEL_RC_CARRIAGE = 1, - WOODEN_RC_TRAIN = 2, - MONORAIL_CARRIAGE = 10, - MONORAIL_FRONT = 11, - MONORAIL_BACK = 12, - MINIATURE_RAILWAY_TENDER = 15, - MINIATURE_RAILWAY_LOCOMOTIVE = 16, - MINIATURE_RAILWAY_CARRIAGE = 17, - MINE_TRAIN_FRONT = 35, - MINE_TRAIN_CARRIAGE = 36, - CORKSCREW_RC_FRONT = 38, - CORKSCREW_RC_CARRIAGE = 39, - GHOST_TRAIN_CAR = 63, - TWISTER_RC_SPOILER = 64, - TWISTER_RC_CARRIAGE = 65, - GHOST_TRAIN_INVISIBLE = 66, - ARTICULATED_RC_FRONT = 67, - ARTICULATED_RC_CARRIAGE = 68, - MINIATURE_RAILWAY_CARRIAGE_COVERED = 71, - STANDUP_TWISTER_RC_CARRIAGE = 72, - REVERSER_RC_CAR = 79, - REVERSER_RC_BOGIE = 80, - MINIGOLF_PLAYER = 81, - MINIGOLF_BALL = 82, - SPLASH_BOAT = 83, - SPLASH_BOAT_INVISIBLE = 84, - HYPERCOASTER_FRONT = 96, - HYPERCOASTER_CARRIAGE = 97, - INVERTED_4_ACROSS_CARRIAGE = 98, - WATER_COASTER_BOAT = 99, - WATER_COASTER_INVISIBLE = 101, - RIVER_RAFT = 103, - MINIATURE_RAILWAY_AMERICAN_TENDER = 104, - MINIATURE_RAILWAY_AMERICAN_LOCOMOTIVE = 105, -}; + enum + { + STEEL_RC_FRONT = 0, + STEEL_RC_CARRIAGE = 1, + WOODEN_RC_TRAIN = 2, + MONORAIL_CARRIAGE = 10, + MONORAIL_FRONT = 11, + MONORAIL_BACK = 12, + MINIATURE_RAILWAY_TENDER = 15, + MINIATURE_RAILWAY_LOCOMOTIVE = 16, + MINIATURE_RAILWAY_CARRIAGE = 17, + MINE_TRAIN_FRONT = 35, + MINE_TRAIN_CARRIAGE = 36, + CORKSCREW_RC_FRONT = 38, + CORKSCREW_RC_CARRIAGE = 39, + GHOST_TRAIN_CAR = 63, + TWISTER_RC_SPOILER = 64, + TWISTER_RC_CARRIAGE = 65, + GHOST_TRAIN_INVISIBLE = 66, + ARTICULATED_RC_FRONT = 67, + ARTICULATED_RC_CARRIAGE = 68, + MINIATURE_RAILWAY_CARRIAGE_COVERED = 71, + STANDUP_TWISTER_RC_CARRIAGE = 72, + REVERSER_RC_CAR = 79, + REVERSER_RC_BOGIE = 80, + MINIGOLF_PLAYER = 81, + MINIGOLF_BALL = 82, + SPLASH_BOAT = 83, + SPLASH_BOAT_INVISIBLE = 84, + HYPERCOASTER_FRONT = 96, + HYPERCOASTER_CARRIAGE = 97, + INVERTED_4_ACROSS_CARRIAGE = 98, + WATER_COASTER_BOAT = 99, + WATER_COASTER_INVISIBLE = 101, + RIVER_RAFT = 103, + MINIATURE_RAILWAY_AMERICAN_TENDER = 104, + MINIATURE_RAILWAY_AMERICAN_LOCOMOTIVE = 105, + }; -enum -{ - COPY_COLOUR_1 = -1, - COPY_COLOUR_2 = -2, -}; + enum + { + COPY_COLOUR_1 = -1, + COPY_COLOUR_2 = -2, + }; -enum -{ - RCT1_WATER_CYAN, - RCT1_WATER_ORANGE -}; + enum + { + RCT1_WATER_CYAN, + RCT1_WATER_ORANGE + }; -enum -{ - RCT1_SCENERY_TULIPS_1 = 65, - RCT1_SCENERY_TULIPS_2 = 68, + enum + { + RCT1_SCENERY_TULIPS_1 = 65, + RCT1_SCENERY_TULIPS_2 = 68, - RCT1_SCENERY_GEOMETRIC_SCULPTURE_1 = 157, // TGE1 - RCT1_SCENERY_GEOMETRIC_SCULPTURE_2 = 162, // TGE2 - RCT1_SCENERY_GEOMETRIC_SCULPTURE_3 = 168, // TGE3 - RCT1_SCENERY_GEOMETRIC_SCULPTURE_4 = 170, // TGE4 - RCT1_SCENERY_GEOMETRIC_SCULPTURE_5 = 171, // TGE5 + RCT1_SCENERY_GEOMETRIC_SCULPTURE_1 = 157, // TGE1 + RCT1_SCENERY_GEOMETRIC_SCULPTURE_2 = 162, // TGE2 + RCT1_SCENERY_GEOMETRIC_SCULPTURE_3 = 168, // TGE3 + RCT1_SCENERY_GEOMETRIC_SCULPTURE_4 = 170, // TGE4 + RCT1_SCENERY_GEOMETRIC_SCULPTURE_5 = 171, // TGE5 - RCT1_SCENERY_SMALL_RED_GARDENS = 176, // TG19 -}; + RCT1_SCENERY_SMALL_RED_GARDENS = 176, // TG19 + }; -enum -{ - RCT1_LANDSCAPE_DOOR_CLOSED = 0, - RCT1_LANDSCAPE_DOOR_HALF_OPEN = 2, - RCT1_LANDSCAPE_DOOR_OPEN = 3, -}; + enum + { + RCT1_LANDSCAPE_DOOR_CLOSED = 0, + RCT1_LANDSCAPE_DOOR_HALF_OPEN = 2, + RCT1_LANDSCAPE_DOOR_OPEN = 3, + }; -enum -{ - RCT1_PATH_SUPPORT_TYPE_TRUSS, - RCT1_PATH_SUPPORT_TYPE_COATED_WOOD, - RCT1_PATH_SUPPORT_TYPE_SPACE, - RCT1_PATH_SUPPORT_TYPE_BAMBOO, -}; + enum + { + RCT1_PATH_SUPPORT_TYPE_TRUSS, + RCT1_PATH_SUPPORT_TYPE_COATED_WOOD, + RCT1_PATH_SUPPORT_TYPE_SPACE, + RCT1_PATH_SUPPORT_TYPE_BAMBOO, + }; + + track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType); +} // namespace RCT1 void load_from_sv4(const char* path); void load_from_sc4(const char* path); - -track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 19eabae6d7..bc4e621ef5 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -75,2983 +75,2990 @@ static constexpr const ObjectEntryIndex OBJECT_ENTRY_INDEX_IGNORE = 254; using namespace OpenRCT2; -class EntryList +namespace RCT1 { -private: - std::vector _entries; - -public: - size_t GetCount() const + class EntryList { - return _entries.size(); - } + private: + std::vector _entries; - const std::vector& GetEntries() const - { - return _entries; - } - - ObjectEntryIndex GetOrAddEntry(const char* entryName) - { - auto entryIndex = Collections::IndexOf(_entries, entryName, true); - if (entryIndex == SIZE_MAX) + public: + size_t GetCount() const { - entryIndex = _entries.size(); - _entries.push_back(entryName); - } - return static_cast(entryIndex); - } - - void AddRange(std::initializer_list initializerList) - { - for (auto entry : initializerList) - { - GetOrAddEntry(entry); - } - } -}; - -class S4Importer final : public IParkImporter -{ -private: - std::string _s4Path; - rct1_s4 _s4 = {}; - uint8_t _gameVersion = 0; - uint8_t _parkValueConversionFactor = 0; - bool _isScenario = false; - - // Lists of dynamic object entries - EntryList _rideEntries; - EntryList _smallSceneryEntries; - EntryList _largeSceneryEntries; - EntryList _wallEntries; - EntryList _pathEntries; - EntryList _pathAdditionEntries; - EntryList _sceneryGroupEntries; - EntryList _waterEntry; - - // Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries - ObjectEntryIndex _rideTypeToRideEntryMap[RCT1_RIDE_TYPE_COUNT]{}; - ObjectEntryIndex _vehicleTypeToRideEntryMap[RCT1_VEHICLE_TYPE_COUNT]{}; - ObjectEntryIndex _smallSceneryTypeToEntryMap[256]{}; - ObjectEntryIndex _largeSceneryTypeToEntryMap[256]{}; - ObjectEntryIndex _wallTypeToEntryMap[256]{}; - ObjectEntryIndex _pathTypeToEntryMap[24]{}; - ObjectEntryIndex _pathAdditionTypeToEntryMap[16]{}; - ObjectEntryIndex _sceneryThemeTypeToEntryMap[24]{}; - - // Research - std::bitset _researchRideEntryUsed{}; - std::bitset _researchRideTypeUsed{}; - - // Scenario repository - used for determining scenario name - IScenarioRepository* _scenarioRepository = GetScenarioRepository(); - -public: - ParkLoadResult Load(const utf8* path) override - { - const utf8* extension = Path::GetExtension(path); - if (String::Equals(extension, ".sc4", true)) - { - return LoadScenario(path); - } - else if (String::Equals(extension, ".sv4", true)) - { - return LoadSavedGame(path); - } - else - { - throw std::runtime_error("Invalid RCT1 park extension."); - } - } - - ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) override - { - auto fs = FileStream(path, FILE_MODE_OPEN); - auto result = LoadFromStream(&fs, false, skipObjectCheck, path); - return result; - } - - ParkLoadResult LoadScenario(const utf8* path, bool skipObjectCheck = false) override - { - auto fs = FileStream(path, FILE_MODE_OPEN); - auto result = LoadFromStream(&fs, true, skipObjectCheck, path); - return result; - } - - ParkLoadResult LoadFromStream( - IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck, const utf8* path) override - { - _s4 = *ReadAndDecodeS4(stream, isScenario); - _s4Path = path; - _isScenario = isScenario; - _gameVersion = sawyercoding_detect_rct1_version(_s4.game_version) & FILE_VERSION_MASK; - - // Only determine what objects we required to import this saved game - InitialiseEntryMaps(); - CreateAvailableObjectMappings(); - return ParkLoadResult(GetRequiredObjects()); - } - - void Import() override - { - Initialise(); - - CreateAvailableObjectMappings(); - LoadObjects(); - - ImportRides(); - ImportRideMeasurements(); - ImportSprites(); - ImportTileElements(); - ImportPeepSpawns(); - ImportFinance(); - ImportResearch(); - ImportParkName(); - ImportParkFlags(); - ImportClimate(); - ImportScenarioNameDetails(); - ImportScenarioObjective(); - ImportSavedView(); - FixLandOwnership(); - FixUrbanPark(); - CountBlockSections(); - SetDefaultNames(); - determine_ride_entrance_and_exit_locations(); - - map_count_remaining_land_rights(); - research_determine_first_of_type(); - } - - bool GetDetails(scenario_index_entry* dst) override - { - *dst = {}; - - source_desc desc; - // If no entry is found, this is a custom scenario. - bool isOfficial = ScenarioSources::TryGetById(_s4.scenario_slot_index, &desc); - - dst->category = desc.category; - dst->source_game = ScenarioSource{ desc.source }; - dst->source_index = desc.index; - dst->sc_id = desc.id; - - dst->objective_type = _s4.scenario_objective_type; - dst->objective_arg_1 = _s4.scenario_objective_years; - // RCT1 used another way of calculating park value. - if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) - dst->objective_arg_2 = CorrectRCT1ParkValue(_s4.scenario_objective_currency); - else - dst->objective_arg_2 = _s4.scenario_objective_currency; - dst->objective_arg_3 = _s4.scenario_objective_num_guests; - // This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead. - if (_s4.scenario_objective_type == OBJECTIVE_BUILD_THE_BEST) - { - dst->objective_arg_3 = GetBuildTheBestRideId(); + return _entries.size(); } - auto name = rct2_to_utf8(_s4.scenario_name, RCT2LanguageId::EnglishUK); - std::string details; - - // TryGetById won't set this property if the scenario is not recognised, - // but localisation needs it. - if (!isOfficial) + const std::vector& GetEntries() const { - desc.title = name.c_str(); + return _entries; } - String::Set(dst->internal_name, sizeof(dst->internal_name), desc.title); - - rct_string_id localisedStringIds[3]; - if (language_get_localised_scenario_strings(desc.title, localisedStringIds)) + ObjectEntryIndex GetOrAddEntry(const char* entryName) { - if (localisedStringIds[0] != STR_NONE) + auto entryIndex = Collections::IndexOf(_entries, entryName, true); + if (entryIndex == SIZE_MAX) { - name = String::ToStd(language_get_string(localisedStringIds[0])); + entryIndex = _entries.size(); + _entries.push_back(entryName); } - if (localisedStringIds[2] != STR_NONE) + return static_cast(entryIndex); + } + + void AddRange(std::initializer_list initializerList) + { + for (auto entry : initializerList) { - details = String::ToStd(language_get_string(localisedStringIds[2])); + GetOrAddEntry(entry); } } + }; - String::Set(dst->name, sizeof(dst->name), name.c_str()); - String::Set(dst->details, sizeof(dst->details), details.c_str()); - - return true; - } - - money32 CorrectRCT1ParkValue(money32 oldParkValue) + class S4Importer final : public IParkImporter { - if (oldParkValue == MONEY32_UNDEFINED) - { - return MONEY32_UNDEFINED; - } + private: + std::string _s4Path; + rct1_s4 _s4 = {}; + uint8_t _gameVersion = 0; + uint8_t _parkValueConversionFactor = 0; + bool _isScenario = false; - if (_parkValueConversionFactor == 0) + // Lists of dynamic object entries + EntryList _rideEntries; + EntryList _smallSceneryEntries; + EntryList _largeSceneryEntries; + EntryList _wallEntries; + EntryList _pathEntries; + EntryList _pathAdditionEntries; + EntryList _sceneryGroupEntries; + EntryList _waterEntry; + + // Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries + ObjectEntryIndex _rideTypeToRideEntryMap[RCT1_RIDE_TYPE_COUNT]{}; + ObjectEntryIndex _vehicleTypeToRideEntryMap[RCT1_VEHICLE_TYPE_COUNT]{}; + ObjectEntryIndex _smallSceneryTypeToEntryMap[256]{}; + ObjectEntryIndex _largeSceneryTypeToEntryMap[256]{}; + ObjectEntryIndex _wallTypeToEntryMap[256]{}; + ObjectEntryIndex _pathTypeToEntryMap[24]{}; + ObjectEntryIndex _pathAdditionTypeToEntryMap[16]{}; + ObjectEntryIndex _sceneryThemeTypeToEntryMap[24]{}; + + // Research + std::bitset _researchRideEntryUsed{}; + std::bitset _researchRideTypeUsed{}; + + // Scenario repository - used for determining scenario name + IScenarioRepository* _scenarioRepository = GetScenarioRepository(); + + public: + ParkLoadResult Load(const utf8* path) override { - if (_s4.park_value != 0) + const utf8* extension = Path::GetExtension(path); + if (String::Equals(extension, ".sc4", true)) { - // Use the ratio between the old and new park value to calcute the ratio to - // use for the park value history and the goal. - auto& park = GetContext()->GetGameState()->GetPark(); - _parkValueConversionFactor = (park.CalculateParkValue() * 10) / _s4.park_value; + return LoadScenario(path); + } + else if (String::Equals(extension, ".sv4", true)) + { + return LoadSavedGame(path); } else { - // In new games, the park value isn't set. - _parkValueConversionFactor = 100; + throw std::runtime_error("Invalid RCT1 park extension."); } } - return (oldParkValue * _parkValueConversionFactor) / 10; - } - -private: - std::unique_ptr ReadAndDecodeS4(IStream* stream, bool isScenario) - { - auto s4 = std::make_unique(); - size_t dataSize = stream->GetLength() - stream->GetPosition(); - auto data = stream->ReadArray(dataSize); - auto decodedData = std::make_unique(sizeof(rct1_s4)); - - size_t decodedSize; - int32_t fileType = sawyercoding_detect_file_type(data.get(), dataSize); - if (isScenario && (fileType & FILE_VERSION_MASK) != FILE_VERSION_RCT1) + ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) override { - decodedSize = sawyercoding_decode_sc4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); - } - else - { - decodedSize = sawyercoding_decode_sv4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); + auto fs = FileStream(path, FILE_MODE_OPEN); + auto result = LoadFromStream(&fs, false, skipObjectCheck, path); + return result; } - if (decodedSize == sizeof(rct1_s4)) + ParkLoadResult LoadScenario(const utf8* path, bool skipObjectCheck = false) override { - std::memcpy(s4.get(), decodedData.get(), sizeof(rct1_s4)); - return s4; + auto fs = FileStream(path, FILE_MODE_OPEN); + auto result = LoadFromStream(&fs, true, skipObjectCheck, path); + return result; } - else + + ParkLoadResult LoadFromStream( + IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck, const utf8* path) override { - throw std::runtime_error("Unable to decode park."); + _s4 = *ReadAndDecodeS4(stream, isScenario); + _s4Path = path; + _isScenario = isScenario; + _gameVersion = sawyercoding_detect_rct1_version(_s4.game_version) & FILE_VERSION_MASK; + + // Only determine what objects we required to import this saved game + InitialiseEntryMaps(); + CreateAvailableObjectMappings(); + return ParkLoadResult(GetRequiredObjects()); } - } - void Initialise() - { - // Avoid reusing the value used for last import - _parkValueConversionFactor = 0; - - uint16_t mapSize = _s4.map_size == 0 ? RCT1_MAX_MAP_SIZE : _s4.map_size; - - String::Set(gScenarioFileName, sizeof(gScenarioFileName), GetRCT1ScenarioName().c_str()); - - // Do map initialisation, same kind of stuff done when loading scenario editor - auto context = OpenRCT2::GetContext(); - context->GetObjectManager().UnloadAll(); - context->GetGameState()->InitAll(mapSize); - gEditorStep = EditorStep::ObjectSelection; - gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; - gScenarioCategory = SCENARIO_CATEGORY_OTHER; - } - - std::string GetRCT1ScenarioName() - { - const scenario_index_entry* scenarioEntry = _scenarioRepository->GetByInternalName(_s4.scenario_name); - if (scenarioEntry == nullptr) + void Import() override { - return ""; + Initialise(); + + CreateAvailableObjectMappings(); + LoadObjects(); + + ImportRides(); + ImportRideMeasurements(); + ImportSprites(); + ImportTileElements(); + ImportPeepSpawns(); + ImportFinance(); + ImportResearch(); + ImportParkName(); + ImportParkFlags(); + ImportClimate(); + ImportScenarioNameDetails(); + ImportScenarioObjective(); + ImportSavedView(); + FixLandOwnership(); + FixUrbanPark(); + CountBlockSections(); + SetDefaultNames(); + determine_ride_entrance_and_exit_locations(); + + map_count_remaining_land_rights(); + research_determine_first_of_type(); } - else + + bool GetDetails(scenario_index_entry* dst) override { - return path_get_filename(scenarioEntry->path); - } - } + *dst = {}; - void InitialiseEntryMaps() - { - std::fill(std::begin(_rideTypeToRideEntryMap), std::end(_rideTypeToRideEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_vehicleTypeToRideEntryMap), std::end(_vehicleTypeToRideEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_smallSceneryTypeToEntryMap), std::end(_smallSceneryTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_largeSceneryTypeToEntryMap), std::end(_largeSceneryTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_wallTypeToEntryMap), std::end(_wallTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_pathTypeToEntryMap), std::end(_pathTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_pathAdditionTypeToEntryMap), std::end(_pathAdditionTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - std::fill(std::begin(_sceneryThemeTypeToEntryMap), std::end(_sceneryThemeTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); - } + source_desc desc; + // If no entry is found, this is a custom scenario. + bool isOfficial = ScenarioSources::TryGetById(_s4.scenario_slot_index, &desc); - /** - * Scans the map and research list for all the object types used and builds lists and - * lookup tables for converting from hard coded RCT1 object types to dynamic object entries. - */ - void CreateAvailableObjectMappings() - { - AddDefaultEntries(); - AddAvailableEntriesFromResearchList(); - AddAvailableEntriesFromMap(); - AddAvailableEntriesFromRides(); - AddAvailableEntriesFromSceneryGroups(); - AddEntryForWater(); - } + dst->category = desc.category; + dst->source_game = ScenarioSource{ desc.source }; + dst->source_index = desc.index; + dst->sc_id = desc.id; - void AddDefaultEntries() - { - // Add default scenery groups - _sceneryGroupEntries.AddRange({ - "SCGTREES", - "SCGSHRUB", - "SCGGARDN", - "SCGFENCE", - "SCGWALLS", - "SCGPATHX", - }); - - // Add default footpaths - _pathEntries.AddRange({ - "TARMAC ", - "TARMACG ", - "TARMACB ", - "PATHCRZY", - "PATHSPCE", - "PATHDIRT", - "PATHASH ", - "ROAD ", - }); - } - - void AddAvailableEntriesFromResearchList() - { - size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); - std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( - researchList, researchListCount); - for (size_t i = 0; i < researchListCount; i++) - { - const rct1_research_item* researchItem = &researchList[i]; - - if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + dst->objective_type = _s4.scenario_objective_type; + dst->objective_arg_1 = _s4.scenario_objective_years; + // RCT1 used another way of calculating park value. + if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) + dst->objective_arg_2 = CorrectRCT1ParkValue(_s4.scenario_objective_currency); + else + dst->objective_arg_2 = _s4.scenario_objective_currency; + dst->objective_arg_3 = _s4.scenario_objective_num_guests; + // This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead. + if (_s4.scenario_objective_type == OBJECTIVE_BUILD_THE_BEST) { - if (researchItem->item == RCT1_RESEARCH_END) + dst->objective_arg_3 = GetBuildTheBestRideId(); + } + + auto name = rct2_to_utf8(_s4.scenario_name, RCT2LanguageId::EnglishUK); + std::string details; + + // TryGetById won't set this property if the scenario is not recognised, + // but localisation needs it. + if (!isOfficial) + { + desc.title = name.c_str(); + } + + String::Set(dst->internal_name, sizeof(dst->internal_name), desc.title); + + rct_string_id localisedStringIds[3]; + if (language_get_localised_scenario_strings(desc.title, localisedStringIds)) + { + if (localisedStringIds[0] != STR_NONE) { - break; + name = String::ToStd(language_get_string(localisedStringIds[0])); } - if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) + if (localisedStringIds[2] != STR_NONE) { - continue; + details = String::ToStd(language_get_string(localisedStringIds[2])); } } - switch (researchItem->type) - { - case RCT1_RESEARCH_TYPE_THEME: - AddEntriesForSceneryTheme(researchItem->item); - break; - case RCT1_RESEARCH_TYPE_RIDE: - AddEntryForRideType(researchItem->item); - break; - case RCT1_RESEARCH_TYPE_VEHICLE: - // For some bizarre reason, RCT1 research lists contain vehicles that aren't actually researched. - // Extra bizarrely, this does not seem to apply to Loopy Landscapes saves/scenarios. - if (rideTypeInResearch[researchItem->related_ride] || _gameVersion == FILE_VERSION_RCT1_LL) - { - AddEntryForVehicleType(researchItem->related_ride, researchItem->item); - } - break; - } + String::Set(dst->name, sizeof(dst->name), name.c_str()); + String::Set(dst->details, sizeof(dst->details), details.c_str()); + + return true; } - } - void AddAvailableEntriesFromMap() - { - size_t maxTiles = RCT1_MAX_MAP_SIZE * RCT1_MAX_MAP_SIZE; - size_t tileIndex = 0; - RCT12TileElement* tileElement = _s4.tile_elements; - - while (tileIndex < maxTiles) + money32 CorrectRCT1ParkValue(money32 oldParkValue) { - switch (tileElement->GetType()) + if (oldParkValue == MONEY32_UNDEFINED) { - case TILE_ELEMENT_TYPE_PATH: - { - uint8_t pathType = tileElement->AsPath()->GetRCT1PathType(); - uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition(); - - AddEntryForPath(pathType); - AddEntryForPathAddition(pathAdditionsType); - break; - } - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - AddEntryForSmallScenery(tileElement->AsSmallScenery()->GetEntryIndex()); - break; - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - AddEntryForLargeScenery(tileElement->AsLargeScenery()->GetEntryIndex()); - break; - case TILE_ELEMENT_TYPE_WALL: - { - for (int32_t edge = 0; edge < 4; edge++) - { - int32_t type = tileElement->AsWall()->GetRCT1WallType(edge); - - if (type != -1) - { - AddEntryForWall(type); - } - } - break; - } + return MONEY32_UNDEFINED; } - if ((tileElement++)->IsLastForTile()) + if (_parkValueConversionFactor == 0) { - tileIndex++; - } - } - } - - void AddAvailableEntriesFromRides() - { - for (size_t i = 0; i < std::size(_s4.rides); i++) - { - auto ride = &_s4.rides[i]; - if (ride->type != RCT1_RIDE_TYPE_NULL) - { - if (RCT1::RideTypeUsesVehicles(ride->type)) - AddEntryForVehicleType(ride->type, ride->vehicle_type); + if (_s4.park_value != 0) + { + // Use the ratio between the old and new park value to calcute the ratio to + // use for the park value history and the goal. + auto& park = GetContext()->GetGameState()->GetPark(); + _parkValueConversionFactor = (park.CalculateParkValue() * 10) / _s4.park_value; + } else - AddEntryForRideType(ride->type); + { + // In new games, the park value isn't set. + _parkValueConversionFactor = 100; + } + } + + return (oldParkValue * _parkValueConversionFactor) / 10; + } + + private: + std::unique_ptr ReadAndDecodeS4(IStream* stream, bool isScenario) + { + auto s4 = std::make_unique(); + size_t dataSize = stream->GetLength() - stream->GetPosition(); + auto data = stream->ReadArray(dataSize); + auto decodedData = std::make_unique(sizeof(rct1_s4)); + + size_t decodedSize; + int32_t fileType = sawyercoding_detect_file_type(data.get(), dataSize); + if (isScenario && (fileType & FILE_VERSION_MASK) != FILE_VERSION_RCT1) + { + decodedSize = sawyercoding_decode_sc4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); + } + else + { + decodedSize = sawyercoding_decode_sv4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); + } + + if (decodedSize == sizeof(rct1_s4)) + { + std::memcpy(s4.get(), decodedData.get(), sizeof(rct1_s4)); + return s4; + } + else + { + throw std::runtime_error("Unable to decode park."); } } - } - void AddAvailableEntriesFromSceneryGroups() - { - for (int32_t sceneryTheme = 0; sceneryTheme <= RCT1_SCENERY_THEME_PAGODA; sceneryTheme++) + void Initialise() { - if (sceneryTheme != 0 && _sceneryThemeTypeToEntryMap[sceneryTheme] == OBJECT_ENTRY_INDEX_NULL) - continue; + // Avoid reusing the value used for last import + _parkValueConversionFactor = 0; - std::vector objects = RCT1::GetSceneryObjects(sceneryTheme); - for (const char* objectName : objects) + uint16_t mapSize = _s4.map_size == 0 ? RCT1_MAX_MAP_SIZE : _s4.map_size; + + String::Set(gScenarioFileName, sizeof(gScenarioFileName), GetRCT1ScenarioName().c_str()); + + // Do map initialisation, same kind of stuff done when loading scenario editor + auto context = OpenRCT2::GetContext(); + context->GetObjectManager().UnloadAll(); + context->GetGameState()->InitAll(mapSize); + gEditorStep = EditorStep::ObjectSelection; + gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; + gScenarioCategory = SCENARIO_CATEGORY_OTHER; + } + + std::string GetRCT1ScenarioName() + { + const scenario_index_entry* scenarioEntry = _scenarioRepository->GetByInternalName(_s4.scenario_name); + if (scenarioEntry == nullptr) { - auto& objectRepository = OpenRCT2::GetContext()->GetObjectRepository(); - auto foundObject = objectRepository.FindObjectLegacy(objectName); - if (foundObject != nullptr) - { - ObjectType objectType = foundObject->ObjectEntry.GetType(); - switch (objectType) - { - case ObjectType::SmallScenery: - case ObjectType::LargeScenery: - case ObjectType::Walls: - case ObjectType::Paths: - case ObjectType::PathBits: - { - EntryList* entries = GetEntryList(objectType); + return ""; + } + else + { + return path_get_filename(scenarioEntry->path); + } + } - // Check if there are spare entries available - size_t maxEntries = static_cast(object_entry_group_counts[EnumValue(objectType)]); - if (entries != nullptr && entries->GetCount() < maxEntries) + void InitialiseEntryMaps() + { + std::fill(std::begin(_rideTypeToRideEntryMap), std::end(_rideTypeToRideEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_vehicleTypeToRideEntryMap), std::end(_vehicleTypeToRideEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_smallSceneryTypeToEntryMap), std::end(_smallSceneryTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_largeSceneryTypeToEntryMap), std::end(_largeSceneryTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_wallTypeToEntryMap), std::end(_wallTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_pathTypeToEntryMap), std::end(_pathTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_pathAdditionTypeToEntryMap), std::end(_pathAdditionTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + std::fill(std::begin(_sceneryThemeTypeToEntryMap), std::end(_sceneryThemeTypeToEntryMap), OBJECT_ENTRY_INDEX_NULL); + } + + /** + * Scans the map and research list for all the object types used and builds lists and + * lookup tables for converting from hard coded RCT1 object types to dynamic object entries. + */ + void CreateAvailableObjectMappings() + { + AddDefaultEntries(); + AddAvailableEntriesFromResearchList(); + AddAvailableEntriesFromMap(); + AddAvailableEntriesFromRides(); + AddAvailableEntriesFromSceneryGroups(); + AddEntryForWater(); + } + + void AddDefaultEntries() + { + // Add default scenery groups + _sceneryGroupEntries.AddRange({ + "SCGTREES", + "SCGSHRUB", + "SCGGARDN", + "SCGFENCE", + "SCGWALLS", + "SCGPATHX", + }); + + // Add default footpaths + _pathEntries.AddRange({ + "TARMAC ", + "TARMACG ", + "TARMACB ", + "PATHCRZY", + "PATHSPCE", + "PATHDIRT", + "PATHASH ", + "ROAD ", + }); + } + + void AddAvailableEntriesFromResearchList() + { + size_t researchListCount; + const rct1_research_item* researchList = GetResearchList(&researchListCount); + std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( + researchList, researchListCount); + for (size_t i = 0; i < researchListCount; i++) + { + const rct1_research_item* researchItem = &researchList[i]; + + if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + { + if (researchItem->item == RCT1_RESEARCH_END) + { + break; + } + if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE + || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) + { + continue; + } + } + + switch (researchItem->type) + { + case RCT1_RESEARCH_TYPE_THEME: + AddEntriesForSceneryTheme(researchItem->item); + break; + case RCT1_RESEARCH_TYPE_RIDE: + AddEntryForRideType(researchItem->item); + break; + case RCT1_RESEARCH_TYPE_VEHICLE: + // For some bizarre reason, RCT1 research lists contain vehicles that aren't actually researched. + // Extra bizarrely, this does not seem to apply to Loopy Landscapes saves/scenarios. + if (rideTypeInResearch[researchItem->related_ride] || _gameVersion == FILE_VERSION_RCT1_LL) + { + AddEntryForVehicleType(researchItem->related_ride, researchItem->item); + } + break; + } + } + } + + void AddAvailableEntriesFromMap() + { + size_t maxTiles = RCT1_MAX_MAP_SIZE * RCT1_MAX_MAP_SIZE; + size_t tileIndex = 0; + RCT12TileElement* tileElement = _s4.tile_elements; + + while (tileIndex < maxTiles) + { + switch (tileElement->GetType()) + { + case TILE_ELEMENT_TYPE_PATH: + { + uint8_t pathType = tileElement->AsPath()->GetRCT1PathType(); + uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition(); + + AddEntryForPath(pathType); + AddEntryForPathAddition(pathAdditionsType); + break; + } + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + AddEntryForSmallScenery(tileElement->AsSmallScenery()->GetEntryIndex()); + break; + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + AddEntryForLargeScenery(tileElement->AsLargeScenery()->GetEntryIndex()); + break; + case TILE_ELEMENT_TYPE_WALL: + { + for (int32_t edge = 0; edge < 4; edge++) + { + int32_t type = tileElement->AsWall()->GetRCT1WallType(edge); + + if (type != -1) { - entries->GetOrAddEntry(objectName); + AddEntryForWall(type); } - break; + } + break; + } + } + + if ((tileElement++)->IsLastForTile()) + { + tileIndex++; + } + } + } + + void AddAvailableEntriesFromRides() + { + for (size_t i = 0; i < std::size(_s4.rides); i++) + { + auto ride = &_s4.rides[i]; + if (ride->type != RCT1_RIDE_TYPE_NULL) + { + if (RCT1::RideTypeUsesVehicles(ride->type)) + AddEntryForVehicleType(ride->type, ride->vehicle_type); + else + AddEntryForRideType(ride->type); + } + } + } + + void AddAvailableEntriesFromSceneryGroups() + { + for (int32_t sceneryTheme = 0; sceneryTheme <= RCT1_SCENERY_THEME_PAGODA; sceneryTheme++) + { + if (sceneryTheme != 0 && _sceneryThemeTypeToEntryMap[sceneryTheme] == OBJECT_ENTRY_INDEX_NULL) + continue; + + std::vector objects = RCT1::GetSceneryObjects(sceneryTheme); + for (const char* objectName : objects) + { + auto& objectRepository = OpenRCT2::GetContext()->GetObjectRepository(); + auto foundObject = objectRepository.FindObjectLegacy(objectName); + if (foundObject != nullptr) + { + ObjectType objectType = foundObject->ObjectEntry.GetType(); + switch (objectType) + { + case ObjectType::SmallScenery: + case ObjectType::LargeScenery: + case ObjectType::Walls: + case ObjectType::Paths: + case ObjectType::PathBits: + { + EntryList* entries = GetEntryList(objectType); + + // Check if there are spare entries available + size_t maxEntries = static_cast(object_entry_group_counts[EnumValue(objectType)]); + if (entries != nullptr && entries->GetCount() < maxEntries) + { + entries->GetOrAddEntry(objectName); + } + break; + } + default: + // This switch processes only ObjectTypes valid for scenery + break; } - default: - // This switch processes only ObjectTypes valid for scenery - break; } } } } - } - void AddEntryForWater() - { - const char* entryName; - - if (_gameVersion < FILE_VERSION_RCT1_LL) + void AddEntryForWater() { - entryName = RCT1::GetWaterObject(RCT1_WATER_CYAN); - } - else - { - entryName = RCT1::GetWaterObject(_s4.water_colour); - } + const char* entryName; - _waterEntry.GetOrAddEntry(entryName); - } - - void AddEntryForRideType(uint8_t rideType) - { - assert(rideType < std::size(_rideTypeToRideEntryMap)); - if (_rideTypeToRideEntryMap[rideType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetRideTypeObject(rideType); - if (!String::Equals(entryName, " ")) + if (_gameVersion < FILE_VERSION_RCT1_LL) { - auto entryIndex = _rideEntries.GetOrAddEntry(entryName); - _rideTypeToRideEntryMap[rideType] = entryIndex; - } - } - } - - void AddEntryForVehicleType(uint8_t rideType, uint8_t vehicleType) - { - assert(vehicleType < std::size(_vehicleTypeToRideEntryMap)); - if (_vehicleTypeToRideEntryMap[vehicleType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetVehicleObject(vehicleType); - if (!String::Equals(entryName, " ")) - { - auto entryIndex = _rideEntries.GetOrAddEntry(entryName); - _vehicleTypeToRideEntryMap[vehicleType] = entryIndex; - - if (rideType != RIDE_TYPE_NULL) - AddEntryForRideType(rideType); - } - } - } - - void AddEntryForSmallScenery(ObjectEntryIndex smallSceneryType) - { - assert(smallSceneryType < std::size(_smallSceneryTypeToEntryMap)); - if (_smallSceneryTypeToEntryMap[smallSceneryType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetSmallSceneryObject(smallSceneryType); - auto entryIndex = _smallSceneryEntries.GetOrAddEntry(entryName); - - _smallSceneryTypeToEntryMap[smallSceneryType] = entryIndex; - } - } - - void AddEntryForLargeScenery(ObjectEntryIndex largeSceneryType) - { - assert(largeSceneryType < std::size(_largeSceneryTypeToEntryMap)); - if (_largeSceneryTypeToEntryMap[largeSceneryType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetLargeSceneryObject(largeSceneryType); - auto entryIndex = _largeSceneryEntries.GetOrAddEntry(entryName); - - _largeSceneryTypeToEntryMap[largeSceneryType] = entryIndex; - } - } - - void AddEntryForWall(ObjectEntryIndex wallType) - { - assert(wallType < std::size(_wallTypeToEntryMap)); - if (_wallTypeToEntryMap[wallType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetWallObject(wallType); - auto entryIndex = _wallEntries.GetOrAddEntry(entryName); - - _wallTypeToEntryMap[wallType] = entryIndex; - } - } - - void AddEntryForPath(ObjectEntryIndex pathType) - { - assert(pathType < std::size(_pathTypeToEntryMap)); - if (_pathTypeToEntryMap[pathType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetPathObject(pathType); - if (!String::Equals(entryName, " ")) - { - auto entryIndex = _pathEntries.GetOrAddEntry(entryName); - _pathTypeToEntryMap[pathType] = entryIndex; - } - } - } - - void AddEntryForPathAddition(ObjectEntryIndex pathAdditionType) - { - if (pathAdditionType == RCT1_PATH_ADDITION_NONE) - return; - - if (_pathAdditionTypeToEntryMap[pathAdditionType] == OBJECT_ENTRY_INDEX_NULL) - { - uint8_t normalisedPathAdditionType = RCT1::NormalisePathAddition(pathAdditionType); - if (_pathAdditionTypeToEntryMap[normalisedPathAdditionType] == OBJECT_ENTRY_INDEX_NULL) - { - const char* entryName = RCT1::GetPathAddtionObject(normalisedPathAdditionType); - auto entryIndex = _pathAdditionEntries.GetOrAddEntry(entryName); - - _pathAdditionTypeToEntryMap[normalisedPathAdditionType] = entryIndex; - } - - _pathAdditionTypeToEntryMap[pathAdditionType] = _pathAdditionTypeToEntryMap[normalisedPathAdditionType]; - } - } - - void AddEntriesForSceneryTheme(ObjectEntryIndex sceneryThemeType) - { - if (sceneryThemeType == RCT1_SCENERY_THEME_GENERAL || sceneryThemeType == RCT1_SCENERY_THEME_JUMPING_FOUNTAINS - || sceneryThemeType == RCT1_SCENERY_THEME_GARDEN_CLOCK) - { - _sceneryThemeTypeToEntryMap[sceneryThemeType] = OBJECT_ENTRY_INDEX_IGNORE; - } - else - { - const char* entryName = RCT1::GetSceneryGroupObject(sceneryThemeType); - if (_sceneryGroupEntries.GetCount() >= MAX_SCENERY_GROUP_OBJECTS) - { - Console::WriteLine("Warning: More than %d (max scenery groups) in RCT1 park.", MAX_SCENERY_GROUP_OBJECTS); - Console::WriteLine(" [%s] scenery group not added.", entryName); + entryName = RCT1::GetWaterObject(RCT1_WATER_CYAN); } else { - auto entryIndex = _sceneryGroupEntries.GetOrAddEntry(entryName); - _sceneryThemeTypeToEntryMap[sceneryThemeType] = entryIndex; + entryName = RCT1::GetWaterObject(_s4.water_colour); } - } - } - void ImportRides() - { - for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + _waterEntry.GetOrAddEntry(entryName); + } + + void AddEntryForRideType(uint8_t rideType) { - if (_s4.rides[i].type != RIDE_TYPE_NULL) + assert(rideType < std::size(_rideTypeToRideEntryMap)); + if (_rideTypeToRideEntryMap[rideType] == OBJECT_ENTRY_INDEX_NULL) { - ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); + const char* entryName = RCT1::GetRideTypeObject(rideType); + if (!String::Equals(entryName, " ")) + { + auto entryIndex = _rideEntries.GetOrAddEntry(entryName); + _rideTypeToRideEntryMap[rideType] = entryIndex; + } } } - } - void ImportRide(Ride* dst, rct1_ride* src, ride_id_t rideIndex) - { - *dst = {}; - dst->id = rideIndex; + void AddEntryForVehicleType(uint8_t rideType, uint8_t vehicleType) + { + assert(vehicleType < std::size(_vehicleTypeToRideEntryMap)); + if (_vehicleTypeToRideEntryMap[vehicleType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetVehicleObject(vehicleType); + if (!String::Equals(entryName, " ")) + { + auto entryIndex = _rideEntries.GetOrAddEntry(entryName); + _vehicleTypeToRideEntryMap[vehicleType] = entryIndex; - // This is a peculiarity of this exact version number, which only Heide-Park seems to use. - if (_s4.game_version == 110018 && src->type == RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER) - { - dst->type = RIDE_TYPE_COMPACT_INVERTED_COASTER; - } - else - { - dst->type = RCT1::GetRideType(src->type, src->vehicle_type); + if (rideType != RIDE_TYPE_NULL) + AddEntryForRideType(rideType); + } + } } - if (RCT1::RideTypeUsesVehicles(src->type)) + void AddEntryForSmallScenery(ObjectEntryIndex smallSceneryType) { - dst->subtype = _vehicleTypeToRideEntryMap[src->vehicle_type]; - } - else - { - dst->subtype = _rideTypeToRideEntryMap[src->type]; + assert(smallSceneryType < std::size(_smallSceneryTypeToEntryMap)); + if (_smallSceneryTypeToEntryMap[smallSceneryType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetSmallSceneryObject(smallSceneryType); + auto entryIndex = _smallSceneryEntries.GetOrAddEntry(entryName); + + _smallSceneryTypeToEntryMap[smallSceneryType] = entryIndex; + } } - rct_ride_entry* rideEntry = get_ride_entry(dst->subtype); - // This can happen with hacked parks - if (rideEntry == nullptr) + void AddEntryForLargeScenery(ObjectEntryIndex largeSceneryType) { - log_warning("Discarding ride with invalid ride entry"); - dst->type = RIDE_TYPE_NULL; - return; + assert(largeSceneryType < std::size(_largeSceneryTypeToEntryMap)); + if (_largeSceneryTypeToEntryMap[largeSceneryType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetLargeSceneryObject(largeSceneryType); + auto entryIndex = _largeSceneryEntries.GetOrAddEntry(entryName); + + _largeSceneryTypeToEntryMap[largeSceneryType] = entryIndex; + } } - // Ride name - if (is_user_string_id(src->name)) + void AddEntryForWall(ObjectEntryIndex wallType) { - dst->custom_name = GetUserString(src->name); + assert(wallType < std::size(_wallTypeToEntryMap)); + if (_wallTypeToEntryMap[wallType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetWallObject(wallType); + auto entryIndex = _wallEntries.GetOrAddEntry(entryName); + + _wallTypeToEntryMap[wallType] = entryIndex; + } } - dst->status = static_cast(src->status); - - // Flags - dst->lifecycle_flags = src->lifecycle_flags; - // These flags were not in the base game - if (_gameVersion == FILE_VERSION_RCT1) + void AddEntryForPath(ObjectEntryIndex pathType) { - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_MUSIC; - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE; - dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; + assert(pathType < std::size(_pathTypeToEntryMap)); + if (_pathTypeToEntryMap[pathType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetPathObject(pathType); + if (!String::Equals(entryName, " ")) + { + auto entryIndex = _pathEntries.GetOrAddEntry(entryName); + _pathTypeToEntryMap[pathType] = entryIndex; + } + } } - // Station - if (src->overall_view.isNull()) + void AddEntryForPathAddition(ObjectEntryIndex pathAdditionType) { - dst->overall_view.setNull(); - } - else - { - dst->overall_view = TileCoordsXY{ src->overall_view.x, src->overall_view.y }.ToCoordsXY(); + if (pathAdditionType == RCT1_PATH_ADDITION_NONE) + return; + + if (_pathAdditionTypeToEntryMap[pathAdditionType] == OBJECT_ENTRY_INDEX_NULL) + { + uint8_t normalisedPathAdditionType = RCT1::NormalisePathAddition(pathAdditionType); + if (_pathAdditionTypeToEntryMap[normalisedPathAdditionType] == OBJECT_ENTRY_INDEX_NULL) + { + const char* entryName = RCT1::GetPathAddtionObject(normalisedPathAdditionType); + auto entryIndex = _pathAdditionEntries.GetOrAddEntry(entryName); + + _pathAdditionTypeToEntryMap[normalisedPathAdditionType] = entryIndex; + } + + _pathAdditionTypeToEntryMap[pathAdditionType] = _pathAdditionTypeToEntryMap[normalisedPathAdditionType]; + } } - for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) + void AddEntriesForSceneryTheme(ObjectEntryIndex sceneryThemeType) { - if (src->station_starts[i].isNull()) + if (sceneryThemeType == RCT1_SCENERY_THEME_GENERAL || sceneryThemeType == RCT1_SCENERY_THEME_JUMPING_FOUNTAINS + || sceneryThemeType == RCT1_SCENERY_THEME_GARDEN_CLOCK) + { + _sceneryThemeTypeToEntryMap[sceneryThemeType] = OBJECT_ENTRY_INDEX_IGNORE; + } + else + { + const char* entryName = RCT1::GetSceneryGroupObject(sceneryThemeType); + if (_sceneryGroupEntries.GetCount() >= MAX_SCENERY_GROUP_OBJECTS) + { + Console::WriteLine("Warning: More than %d (max scenery groups) in RCT1 park.", MAX_SCENERY_GROUP_OBJECTS); + Console::WriteLine(" [%s] scenery group not added.", entryName); + } + else + { + auto entryIndex = _sceneryGroupEntries.GetOrAddEntry(entryName); + _sceneryThemeTypeToEntryMap[sceneryThemeType] = entryIndex; + } + } + } + + void ImportRides() + { + for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + { + if (_s4.rides[i].type != RIDE_TYPE_NULL) + { + ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); + } + } + } + + void ImportRide(Ride* dst, rct1_ride* src, ride_id_t rideIndex) + { + *dst = {}; + dst->id = rideIndex; + + // This is a peculiarity of this exact version number, which only Heide-Park seems to use. + if (_s4.game_version == 110018 && src->type == RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER) + { + dst->type = RIDE_TYPE_COMPACT_INVERTED_COASTER; + } + else + { + dst->type = RCT1::GetRideType(src->type, src->vehicle_type); + } + + if (RCT1::RideTypeUsesVehicles(src->type)) + { + dst->subtype = _vehicleTypeToRideEntryMap[src->vehicle_type]; + } + else + { + dst->subtype = _rideTypeToRideEntryMap[src->type]; + } + + rct_ride_entry* rideEntry = get_ride_entry(dst->subtype); + // This can happen with hacked parks + if (rideEntry == nullptr) + { + log_warning("Discarding ride with invalid ride entry"); + dst->type = RIDE_TYPE_NULL; + return; + } + + // Ride name + if (is_user_string_id(src->name)) + { + dst->custom_name = GetUserString(src->name); + } + + dst->status = static_cast(src->status); + + // Flags + dst->lifecycle_flags = src->lifecycle_flags; + // These flags were not in the base game + if (_gameVersion == FILE_VERSION_RCT1) + { + dst->lifecycle_flags &= ~RIDE_LIFECYCLE_MUSIC; + dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE; + dst->lifecycle_flags &= ~RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK; + } + + // Station + if (src->overall_view.isNull()) + { + dst->overall_view.setNull(); + } + else + { + dst->overall_view = TileCoordsXY{ src->overall_view.x, src->overall_view.y }.ToCoordsXY(); + } + + for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) + { + if (src->station_starts[i].isNull()) + { + dst->stations[i].Start.setNull(); + } + else + { + auto tileStartLoc = TileCoordsXY{ src->station_starts[i].x, src->station_starts[i].y }; + dst->stations[i].Start = tileStartLoc.ToCoordsXY(); + } + dst->stations[i].SetBaseZ(src->station_height[i] * RCT1_COORDS_Z_STEP); + dst->stations[i].Length = src->station_length[i]; + dst->stations[i].Depart = src->station_light[i]; + + dst->stations[i].TrainAtStation = src->station_depart[i]; + + // Direction is fixed later. + if (src->entrance[i].isNull()) + ride_clear_entrance_location(dst, i); + else + ride_set_entrance_location( + dst, i, { src->entrance[i].x, src->entrance[i].y, src->station_height[i] / 2, 0 }); + + if (src->exit[i].isNull()) + ride_clear_exit_location(dst, i); + else + ride_set_exit_location(dst, i, { src->exit[i].x, src->exit[i].y, src->station_height[i] / 2, 0 }); + + dst->stations[i].QueueTime = src->queue_time[i]; + dst->stations[i].LastPeepInQueue = src->last_peep_in_queue[i]; + dst->stations[i].QueueLength = src->num_peeps_in_queue[i]; + + dst->stations[i].SegmentTime = src->time[i]; + dst->stations[i].SegmentLength = src->length[i]; + } + // All other values take 0 as their default. Since they're already memset to that, no need to do it again. + for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++) { dst->stations[i].Start.setNull(); - } - else - { - auto tileStartLoc = TileCoordsXY{ src->station_starts[i].x, src->station_starts[i].y }; - dst->stations[i].Start = tileStartLoc.ToCoordsXY(); - } - dst->stations[i].SetBaseZ(src->station_height[i] * RCT1_COORDS_Z_STEP); - dst->stations[i].Length = src->station_length[i]; - dst->stations[i].Depart = src->station_light[i]; - - dst->stations[i].TrainAtStation = src->station_depart[i]; - - // Direction is fixed later. - if (src->entrance[i].isNull()) + dst->stations[i].TrainAtStation = RideStation::NO_TRAIN; ride_clear_entrance_location(dst, i); - else - ride_set_entrance_location(dst, i, { src->entrance[i].x, src->entrance[i].y, src->station_height[i] / 2, 0 }); - - if (src->exit[i].isNull()) ride_clear_exit_location(dst, i); + dst->stations[i].LastPeepInQueue = SPRITE_INDEX_NULL; + } + + dst->num_stations = src->num_stations; + + // Vehicle links (indexes converted later) + for (int32_t i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) + { + dst->vehicles[i] = src->vehicles[i]; + } + for (int32_t i = RCT1_MAX_TRAINS_PER_RIDE; i <= MAX_VEHICLES_PER_RIDE; i++) + { + dst->vehicles[i] = SPRITE_INDEX_NULL; + } + + dst->num_vehicles = src->num_trains; + dst->num_cars_per_train = src->num_cars_per_train + rideEntry->zero_cars; + dst->proposed_num_vehicles = src->num_trains; + dst->max_trains = src->max_trains; + dst->proposed_num_cars_per_train = src->num_cars_per_train + rideEntry->zero_cars; + dst->special_track_elements = src->special_track_elements; + dst->num_sheltered_sections = src->num_sheltered_sections; + dst->sheltered_length = src->sheltered_length; + + // Operation + dst->depart_flags = src->depart_flags; + dst->min_waiting_time = src->min_waiting_time; + dst->max_waiting_time = src->max_waiting_time; + dst->operation_option = src->operation_option; + dst->num_circuits = 1; + dst->SetMinCarsPerTrain(rideEntry->min_cars_in_train); + dst->SetMaxCarsPerTrain(rideEntry->max_cars_in_train); + + // RCT1 used 5mph / 8 km/h for every lift hill + dst->lift_hill_speed = 5; + + if (_gameVersion == FILE_VERSION_RCT1) + { + // Original RCT had no music settings, take default style + dst->music = GetRideTypeDescriptor(dst->type).DefaultMusic; + + // Only merry-go-round and dodgems had music and used + // the same flag as synchronise stations for the option to enable it + if (src->type == RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RCT1_RIDE_TYPE_DODGEMS) + { + if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) + { + dst->depart_flags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; + dst->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + } + } + } else - ride_set_exit_location(dst, i, { src->exit[i].x, src->exit[i].y, src->station_height[i] / 2, 0 }); - - dst->stations[i].QueueTime = src->queue_time[i]; - dst->stations[i].LastPeepInQueue = src->last_peep_in_queue[i]; - dst->stations[i].QueueLength = src->num_peeps_in_queue[i]; - - dst->stations[i].SegmentTime = src->time[i]; - dst->stations[i].SegmentLength = src->length[i]; - } - // All other values take 0 as their default. Since they're already memset to that, no need to do it again. - for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++) - { - dst->stations[i].Start.setNull(); - dst->stations[i].TrainAtStation = RideStation::NO_TRAIN; - ride_clear_entrance_location(dst, i); - ride_clear_exit_location(dst, i); - dst->stations[i].LastPeepInQueue = SPRITE_INDEX_NULL; - } - - dst->num_stations = src->num_stations; - - // Vehicle links (indexes converted later) - for (int32_t i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) - { - dst->vehicles[i] = src->vehicles[i]; - } - for (int32_t i = RCT1_MAX_TRAINS_PER_RIDE; i <= MAX_VEHICLES_PER_RIDE; i++) - { - dst->vehicles[i] = SPRITE_INDEX_NULL; - } - - dst->num_vehicles = src->num_trains; - dst->num_cars_per_train = src->num_cars_per_train + rideEntry->zero_cars; - dst->proposed_num_vehicles = src->num_trains; - dst->max_trains = src->max_trains; - dst->proposed_num_cars_per_train = src->num_cars_per_train + rideEntry->zero_cars; - dst->special_track_elements = src->special_track_elements; - dst->num_sheltered_sections = src->num_sheltered_sections; - dst->sheltered_length = src->sheltered_length; - - // Operation - dst->depart_flags = src->depart_flags; - dst->min_waiting_time = src->min_waiting_time; - dst->max_waiting_time = src->max_waiting_time; - dst->operation_option = src->operation_option; - dst->num_circuits = 1; - dst->SetMinCarsPerTrain(rideEntry->min_cars_in_train); - dst->SetMaxCarsPerTrain(rideEntry->max_cars_in_train); - - // RCT1 used 5mph / 8 km/h for every lift hill - dst->lift_hill_speed = 5; - - if (_gameVersion == FILE_VERSION_RCT1) - { - // Original RCT had no music settings, take default style - dst->music = GetRideTypeDescriptor(dst->type).DefaultMusic; - - // Only merry-go-round and dodgems had music and used - // the same flag as synchronise stations for the option to enable it - if (src->type == RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RCT1_RIDE_TYPE_DODGEMS) { - if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) - { - dst->depart_flags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; - dst->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; - } + dst->music = src->music; } - } - else - { - dst->music = src->music; - } - if (src->operating_mode == RCT1_RIDE_MODE_POWERED_LAUNCH) - { - // Launched rides never passed through the station in RCT1. - dst->mode = RideMode::PoweredLaunch; - } - else - { - dst->mode = static_cast(src->operating_mode); - } - - SetRideColourScheme(dst, src); - - // Maintenance - dst->build_date = static_cast(src->build_date); - dst->inspection_interval = src->inspection_interval; - dst->last_inspection = src->last_inspection; - dst->reliability = src->reliability; - dst->unreliability_factor = src->unreliability_factor; - dst->downtime = src->downtime; - dst->breakdown_reason = src->breakdown_reason; - dst->mechanic_status = src->mechanic_status; - dst->mechanic = src->mechanic; - dst->breakdown_reason_pending = src->breakdown_reason_pending; - dst->inspection_station = src->inspection_station; - dst->broken_car = src->broken_car; - dst->broken_vehicle = src->broken_vehicle; - - // Measurement data - dst->excitement = src->excitement; - dst->intensity = src->intensity; - dst->nausea = src->nausea; - - dst->max_speed = src->max_speed; - dst->average_speed = src->average_speed; - - dst->max_positive_vertical_g = src->max_positive_vertical_g; - dst->max_negative_vertical_g = src->max_negative_vertical_g; - dst->max_lateral_g = src->max_lateral_g; - dst->previous_lateral_g = src->previous_lateral_g; - dst->previous_vertical_g = src->previous_vertical_g; - dst->turn_count_banked = src->turn_count_banked; - dst->turn_count_default = src->turn_count_default; - dst->turn_count_sloped = src->turn_count_sloped; - dst->drops = src->num_drops; - dst->start_drop_height = src->start_drop_height / 2; - dst->highest_drop_height = src->highest_drop_height / 2; - if (dst->type == RIDE_TYPE_MINI_GOLF) - dst->holes = src->num_inversions & 0x1F; - else - dst->inversions = src->num_inversions & 0x1F; - dst->sheltered_eighths = src->num_inversions >> 5; - dst->boat_hire_return_direction = src->boat_hire_return_direction; - dst->boat_hire_return_position = { src->boat_hire_return_position.x, src->boat_hire_return_position.y }; - dst->chairlift_bullwheel_rotation = src->chairlift_bullwheel_rotation; - for (int i = 0; i < 2; i++) - { - dst->ChairliftBullwheelLocation[i] = { src->chairlift_bullwheel_location[i].x, - src->chairlift_bullwheel_location[i].y, src->chairlift_bullwheel_z[i] / 2 }; - } - - if (src->cur_test_track_location.isNull()) - { - dst->CurTestTrackLocation.setNull(); - } - else - { - dst->CurTestTrackLocation = { src->cur_test_track_location.x, src->cur_test_track_location.y, - src->cur_test_track_z / 2 }; - } - dst->testing_flags = src->testing_flags; - dst->current_test_segment = src->current_test_segment; - dst->current_test_station = STATION_INDEX_NULL; - dst->average_speed_test_timeout = src->average_speed_test_timeout; - dst->slide_in_use = src->slide_in_use; - dst->slide_peep_t_shirt_colour = RCT1::GetColour(src->slide_peep_t_shirt_colour); - dst->spiral_slide_progress = src->spiral_slide_progress; - // Doubles as slide_peep - dst->maze_tiles = src->maze_tiles; - - // Finance / customers - dst->upkeep_cost = src->upkeep_cost; - dst->price[0] = src->price; - dst->price[1] = src->price_secondary; - dst->income_per_hour = ToMoney64(src->income_per_hour); - dst->total_customers = src->total_customers; - dst->profit = ToMoney64(src->profit); - dst->total_profit = ToMoney64(src->total_profit); - dst->value = src->value; - for (size_t i = 0; i < std::size(src->num_customers); i++) - { - dst->num_customers[i] = src->num_customers[i]; - } - - dst->satisfaction = src->satisfaction; - dst->satisfaction_time_out = src->satisfaction_time_out; - dst->satisfaction_next = src->satisfaction_next; - dst->popularity = src->popularity; - dst->popularity_next = src->popularity_next; - dst->popularity_time_out = src->popularity_time_out; - - dst->num_riders = src->num_riders; - - dst->music_tune_id = 255; - } - - void SetRideColourScheme(Ride* dst, rct1_ride* src) - { - // Colours - dst->colour_scheme_type = src->colour_scheme; - if (_gameVersion == FILE_VERSION_RCT1) - { - dst->track_colour[0].main = RCT1::GetColour(src->track_primary_colour); - dst->track_colour[0].additional = RCT1::GetColour(src->track_secondary_colour); - dst->track_colour[0].supports = RCT1::GetColour(src->track_support_colour); - - // Balloons were always blue in the original RCT. - if (src->type == RCT1_RIDE_TYPE_BALLOON_STALL) + if (src->operating_mode == RCT1_RIDE_MODE_POWERED_LAUNCH) { - dst->track_colour[0].main = COLOUR_LIGHT_BLUE; + // Launched rides never passed through the station in RCT1. + dst->mode = RideMode::PoweredLaunch; } - else if (src->type == RCT1_RIDE_TYPE_RIVER_RAPIDS) - { - dst->track_colour[0].main = COLOUR_WHITE; - } - } - else - { - for (int i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) - { - dst->track_colour[i].main = RCT1::GetColour(src->track_colour_main[i]); - dst->track_colour[i].additional = RCT1::GetColour(src->track_colour_additional[i]); - dst->track_colour[i].supports = RCT1::GetColour(src->track_colour_supports[i]); - } - // Entrance styles were introduced with AA. They correspond directly with those in RCT2. - dst->entrance_style = src->entrance_style; - } - - if (_gameVersion < FILE_VERSION_RCT1_LL && dst->type == RIDE_TYPE_MERRY_GO_ROUND) - { - // The merry-go-round in pre-LL versions was always yellow with red - dst->vehicle_colours[0].Body = COLOUR_YELLOW; - dst->vehicle_colours[0].Trim = COLOUR_BRIGHT_RED; - } - else - { - for (int i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) - { - // RCT1 had no third colour - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( - src->vehicle_type); - if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) - { - dst->vehicle_colours[i].Body = RCT1::GetColour(src->vehicle_colours[i].body); - } - else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) - { - dst->vehicle_colours[i].Body = RCT1::GetColour(src->vehicle_colours[i].trim); - } - else - { - dst->vehicle_colours[i].Body = colourSchemeCopyDescriptor.colour1; - } - - if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) - { - dst->vehicle_colours[i].Trim = RCT1::GetColour(src->vehicle_colours[i].body); - } - else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) - { - dst->vehicle_colours[i].Trim = RCT1::GetColour(src->vehicle_colours[i].trim); - } - else - { - dst->vehicle_colours[i].Trim = colourSchemeCopyDescriptor.colour2; - } - - if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) - { - dst->vehicle_colours[i].Ternary = RCT1::GetColour(src->vehicle_colours[i].body); - } - else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) - { - dst->vehicle_colours[i].Ternary = RCT1::GetColour(src->vehicle_colours[i].trim); - } - else - { - dst->vehicle_colours[i].Ternary = colourSchemeCopyDescriptor.colour3; - } - } - } - - // In RCT1 and AA, the maze was always hedges. - // LL has 4 types, like RCT2. For LL, only guard against invalid values. - if (dst->type == RIDE_TYPE_MAZE) - { - if (_gameVersion < FILE_VERSION_RCT1_LL || src->track_colour_supports[0] > 3) - dst->track_colour[0].supports = MAZE_WALL_TYPE_HEDGE; else - dst->track_colour[0].supports = src->track_colour_supports[0]; - } - } - - void ImportRideMeasurements() - { - for (const auto& src : _s4.ride_measurements) - { - if (src.ride_index != RCT12_RIDE_ID_NULL) { - auto ride = get_ride(RCT12RideIdToOpenRCT2RideId(src.ride_index)); - if (ride != nullptr) + dst->mode = static_cast(src->operating_mode); + } + + SetRideColourScheme(dst, src); + + // Maintenance + dst->build_date = static_cast(src->build_date); + dst->inspection_interval = src->inspection_interval; + dst->last_inspection = src->last_inspection; + dst->reliability = src->reliability; + dst->unreliability_factor = src->unreliability_factor; + dst->downtime = src->downtime; + dst->breakdown_reason = src->breakdown_reason; + dst->mechanic_status = src->mechanic_status; + dst->mechanic = src->mechanic; + dst->breakdown_reason_pending = src->breakdown_reason_pending; + dst->inspection_station = src->inspection_station; + dst->broken_car = src->broken_car; + dst->broken_vehicle = src->broken_vehicle; + + // Measurement data + dst->excitement = src->excitement; + dst->intensity = src->intensity; + dst->nausea = src->nausea; + + dst->max_speed = src->max_speed; + dst->average_speed = src->average_speed; + + dst->max_positive_vertical_g = src->max_positive_vertical_g; + dst->max_negative_vertical_g = src->max_negative_vertical_g; + dst->max_lateral_g = src->max_lateral_g; + dst->previous_lateral_g = src->previous_lateral_g; + dst->previous_vertical_g = src->previous_vertical_g; + dst->turn_count_banked = src->turn_count_banked; + dst->turn_count_default = src->turn_count_default; + dst->turn_count_sloped = src->turn_count_sloped; + dst->drops = src->num_drops; + dst->start_drop_height = src->start_drop_height / 2; + dst->highest_drop_height = src->highest_drop_height / 2; + if (dst->type == RIDE_TYPE_MINI_GOLF) + dst->holes = src->num_inversions & 0x1F; + else + dst->inversions = src->num_inversions & 0x1F; + dst->sheltered_eighths = src->num_inversions >> 5; + dst->boat_hire_return_direction = src->boat_hire_return_direction; + dst->boat_hire_return_position = { src->boat_hire_return_position.x, src->boat_hire_return_position.y }; + dst->chairlift_bullwheel_rotation = src->chairlift_bullwheel_rotation; + for (int i = 0; i < 2; i++) + { + dst->ChairliftBullwheelLocation[i] = { src->chairlift_bullwheel_location[i].x, + src->chairlift_bullwheel_location[i].y, + src->chairlift_bullwheel_z[i] / 2 }; + } + + if (src->cur_test_track_location.isNull()) + { + dst->CurTestTrackLocation.setNull(); + } + else + { + dst->CurTestTrackLocation = { src->cur_test_track_location.x, src->cur_test_track_location.y, + src->cur_test_track_z / 2 }; + } + dst->testing_flags = src->testing_flags; + dst->current_test_segment = src->current_test_segment; + dst->current_test_station = STATION_INDEX_NULL; + dst->average_speed_test_timeout = src->average_speed_test_timeout; + dst->slide_in_use = src->slide_in_use; + dst->slide_peep_t_shirt_colour = RCT1::GetColour(src->slide_peep_t_shirt_colour); + dst->spiral_slide_progress = src->spiral_slide_progress; + // Doubles as slide_peep + dst->maze_tiles = src->maze_tiles; + + // Finance / customers + dst->upkeep_cost = src->upkeep_cost; + dst->price[0] = src->price; + dst->price[1] = src->price_secondary; + dst->income_per_hour = ToMoney64(src->income_per_hour); + dst->total_customers = src->total_customers; + dst->profit = ToMoney64(src->profit); + dst->total_profit = ToMoney64(src->total_profit); + dst->value = src->value; + for (size_t i = 0; i < std::size(src->num_customers); i++) + { + dst->num_customers[i] = src->num_customers[i]; + } + + dst->satisfaction = src->satisfaction; + dst->satisfaction_time_out = src->satisfaction_time_out; + dst->satisfaction_next = src->satisfaction_next; + dst->popularity = src->popularity; + dst->popularity_next = src->popularity_next; + dst->popularity_time_out = src->popularity_time_out; + + dst->num_riders = src->num_riders; + + dst->music_tune_id = 255; + } + + void SetRideColourScheme(Ride* dst, rct1_ride* src) + { + // Colours + dst->colour_scheme_type = src->colour_scheme; + if (_gameVersion == FILE_VERSION_RCT1) + { + dst->track_colour[0].main = RCT1::GetColour(src->track_primary_colour); + dst->track_colour[0].additional = RCT1::GetColour(src->track_secondary_colour); + dst->track_colour[0].supports = RCT1::GetColour(src->track_support_colour); + + // Balloons were always blue in the original RCT. + if (src->type == RCT1_RIDE_TYPE_BALLOON_STALL) { - ride->measurement = std::make_unique(); - ImportRideMeasurement(*ride->measurement, src); + dst->track_colour[0].main = COLOUR_LIGHT_BLUE; + } + else if (src->type == RCT1_RIDE_TYPE_RIVER_RAPIDS) + { + dst->track_colour[0].main = COLOUR_WHITE; + } + } + else + { + for (int i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) + { + dst->track_colour[i].main = RCT1::GetColour(src->track_colour_main[i]); + dst->track_colour[i].additional = RCT1::GetColour(src->track_colour_additional[i]); + dst->track_colour[i].supports = RCT1::GetColour(src->track_colour_supports[i]); + } + // Entrance styles were introduced with AA. They correspond directly with those in RCT2. + dst->entrance_style = src->entrance_style; + } + + if (_gameVersion < FILE_VERSION_RCT1_LL && dst->type == RIDE_TYPE_MERRY_GO_ROUND) + { + // The merry-go-round in pre-LL versions was always yellow with red + dst->vehicle_colours[0].Body = COLOUR_YELLOW; + dst->vehicle_colours[0].Trim = COLOUR_BRIGHT_RED; + } + else + { + for (int i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) + { + // RCT1 had no third colour + RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1:: + GetColourSchemeCopyDescriptor(src->vehicle_type); + if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) + { + dst->vehicle_colours[i].Body = RCT1::GetColour(src->vehicle_colours[i].body); + } + else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) + { + dst->vehicle_colours[i].Body = RCT1::GetColour(src->vehicle_colours[i].trim); + } + else + { + dst->vehicle_colours[i].Body = colourSchemeCopyDescriptor.colour1; + } + + if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) + { + dst->vehicle_colours[i].Trim = RCT1::GetColour(src->vehicle_colours[i].body); + } + else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) + { + dst->vehicle_colours[i].Trim = RCT1::GetColour(src->vehicle_colours[i].trim); + } + else + { + dst->vehicle_colours[i].Trim = colourSchemeCopyDescriptor.colour2; + } + + if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) + { + dst->vehicle_colours[i].Ternary = RCT1::GetColour(src->vehicle_colours[i].body); + } + else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) + { + dst->vehicle_colours[i].Ternary = RCT1::GetColour(src->vehicle_colours[i].trim); + } + else + { + dst->vehicle_colours[i].Ternary = colourSchemeCopyDescriptor.colour3; + } + } + } + + // In RCT1 and AA, the maze was always hedges. + // LL has 4 types, like RCT2. For LL, only guard against invalid values. + if (dst->type == RIDE_TYPE_MAZE) + { + if (_gameVersion < FILE_VERSION_RCT1_LL || src->track_colour_supports[0] > 3) + dst->track_colour[0].supports = MAZE_WALL_TYPE_HEDGE; + else + dst->track_colour[0].supports = src->track_colour_supports[0]; + } + } + + void ImportRideMeasurements() + { + for (const auto& src : _s4.ride_measurements) + { + if (src.ride_index != RCT12_RIDE_ID_NULL) + { + auto ride = get_ride(RCT12RideIdToOpenRCT2RideId(src.ride_index)); + if (ride != nullptr) + { + ride->measurement = std::make_unique(); + ImportRideMeasurement(*ride->measurement, src); + } } } } - } - void ImportRideMeasurement(RideMeasurement& dst, const RCT12RideMeasurement& src) - { - dst.flags = src.flags; - dst.last_use_tick = src.last_use_tick; - dst.num_items = src.num_items; - dst.current_item = src.current_item; - dst.vehicle_index = src.vehicle_index; - dst.current_station = src.current_station; - for (size_t i = 0; i < std::size(src.velocity); i++) + void ImportRideMeasurement(RideMeasurement& dst, const RCT12RideMeasurement& src) { - dst.velocity[i] = src.velocity[i] / 2; - dst.altitude[i] = src.altitude[i] / 2; - dst.vertical[i] = src.vertical[i] / 2; - dst.lateral[i] = src.lateral[i] / 2; - } - } - - void ImportEntity(const RCT12SpriteBase& src); - template void ImportEntity(const RCT12SpriteBase& src); - - void ImportSprites() - { - for (int i = 0; i < RCT1_MAX_SPRITES; i++) - { - ImportEntity(_s4.sprites[i].unknown); - } - FixImportStaff(); - } - - void SetVehicleColours(Vehicle* dst, const rct1_vehicle* src) - { - rct1_ride* srcRide = &_s4.rides[src->ride]; - uint8_t vehicleTypeIndex = srcRide->vehicle_type; - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( - vehicleTypeIndex); - - // RCT1 had no third colour - if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) - { - dst->colours.body_colour = RCT1::GetColour(src->colours.body_colour); - } - else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) - { - dst->colours.body_colour = RCT1::GetColour(src->colours.trim_colour); - } - else - { - dst->colours.body_colour = colourSchemeCopyDescriptor.colour1; - } - - if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) - { - dst->colours.trim_colour = RCT1::GetColour(src->colours.body_colour); - } - else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) - { - dst->colours.trim_colour = RCT1::GetColour(src->colours.trim_colour); - } - else - { - dst->colours.trim_colour = colourSchemeCopyDescriptor.colour2; - } - - if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) - { - dst->colours_extended = RCT1::GetColour(src->colours.body_colour); - } - else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) - { - dst->colours_extended = RCT1::GetColour(src->colours.trim_colour); - } - else - { - dst->colours_extended = colourSchemeCopyDescriptor.colour3; - } - } - - void FixImportStaff() - { - // The RCT2/OpenRCT2 structures are bigger than in RCT1, so initialise them to zero - std::fill(std::begin(gStaffModes), std::end(gStaffModes), StaffMode::None); - std::fill(std::begin(gStaffPatrolAreas), std::end(gStaffPatrolAreas), 0); - - for (int32_t i = 0; i < RCT1_MAX_STAFF; i++) - { - gStaffModes[i] = static_cast(_s4.staff_modes[i]); - } - - for (auto peep : EntityList()) - { - ImportStaffPatrolArea(peep); - } - // Only the individual patrol areas have been converted, so generate the combined patrol areas of each staff type - staff_update_greyed_patrol_areas(); - } - - void ImportPeep(Peep* dst, const rct1_peep* src) - { - // Peep vs. staff (including which kind) - dst->SpriteType = RCT1::GetPeepSpriteType(src->sprite_type); - dst->Action = static_cast(src->action); - dst->SpecialSprite = src->special_sprite; - dst->NextActionSpriteType = static_cast(src->next_action_sprite_type); - dst->ActionSpriteImageOffset = src->action_sprite_image_offset; - dst->WalkingFrameNum = src->no_action_frame_num; - dst->ActionSpriteType = static_cast(src->action_sprite_type); - dst->ActionFrame = src->action_frame; - - const rct_sprite_bounds* spriteBounds = &GetSpriteBounds(dst->SpriteType, dst->ActionSpriteType); - dst->sprite_width = spriteBounds->sprite_width; - dst->sprite_height_negative = spriteBounds->sprite_height_negative; - dst->sprite_height_positive = spriteBounds->sprite_height_positive; - - dst->MoveTo({ src->x, src->y, src->z }); - - dst->sprite_direction = src->sprite_direction; - - // Peep name - if (is_user_string_id(src->name_string_idx)) - { - dst->SetName(GetUserString(src->name_string_idx)); - } - - dst->State = static_cast(src->state); - dst->SubState = src->sub_state; - dst->NextLoc = { src->next_x, src->next_y, src->next_z * RCT1_COORDS_Z_STEP }; - dst->NextFlags = src->next_flags; - dst->Var37 = src->var_37; - dst->StepProgress = src->step_progress; - dst->TshirtColour = RCT1::GetColour(src->tshirt_colour); - dst->TrousersColour = RCT1::GetColour(src->trousers_colour); - dst->DestinationX = src->destination_x; - dst->DestinationY = src->destination_y; - dst->DestinationTolerance = src->destination_tolerance; - dst->PeepDirection = src->direction; - dst->Energy = src->energy; - dst->EnergyTarget = src->energy_target; - dst->Mass = src->mass; - dst->WindowInvalidateFlags = 0; - dst->CurrentRide = RCT12RideIdToOpenRCT2RideId(src->current_ride); - dst->CurrentRideStation = src->current_ride_station; - dst->CurrentTrain = src->current_train; - dst->CurrentCar = src->current_car; - dst->CurrentSeat = src->current_seat; - dst->InteractionRideIndex = RCT12RideIdToOpenRCT2RideId(src->interaction_ride_index); - dst->Id = src->id; - dst->PathCheckOptimisation = 0; - dst->PeepFlags = 0; - dst->PathfindGoal.x = 0xFF; - dst->PathfindGoal.y = 0xFF; - dst->PathfindGoal.z = 0xFF; - dst->PathfindGoal.direction = INVALID_DIRECTION; - } - - void ImportStaffPatrolArea(Staff* staffmember) - { - // The patrol areas in RCT1 are encoded as follows, for coordinates x and y, separately for every staff member: - // - Chop off the 7 lowest bits of the x and y coordinates, which leaves 5 bits per coordinate. - // This step also "produces" the 4x4 patrol squares. - // - Append the two bitstrings to a 10-bit value like so: yyyyyxxxxx - // - Use this 10-bit value as an index into an 8-bit array. The array is sized such that every 4x4 square - // used for the patrols on the map has a bit in that array. If a bit is 1, that square is part of the patrol. - // The correct bit position in that array is found like this: yyyyyxx|xxx - // index in the array ----^ ^--- bit position in the 8-bit value - // We do the opposite in this function to recover the x and y values. - - int32_t peepOffset = staffmember->StaffId * RCT12_PATROL_AREA_SIZE; - for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++) - { - if (_s4.patrol_areas[peepOffset + i] == 0) + dst.flags = src.flags; + dst.last_use_tick = src.last_use_tick; + dst.num_items = src.num_items; + dst.current_item = src.current_item; + dst.vehicle_index = src.vehicle_index; + dst.current_station = src.current_station; + for (size_t i = 0; i < std::size(src.velocity); i++) { - // No patrol for this area - continue; + dst.velocity[i] = src.velocity[i] / 2; + dst.altitude[i] = src.altitude[i] / 2; + dst.vertical[i] = src.vertical[i] / 2; + dst.lateral[i] = src.lateral[i] / 2; + } + } + + void ImportEntity(const RCT12SpriteBase& src); + template void ImportEntity(const RCT12SpriteBase& src); + + void ImportSprites() + { + for (int i = 0; i < RCT1_MAX_SPRITES; i++) + { + ImportEntity(_s4.sprites[i].unknown); + } + FixImportStaff(); + } + + void SetVehicleColours(Vehicle* dst, const rct1_vehicle* src) + { + rct1_ride* srcRide = &_s4.rides[src->ride]; + uint8_t vehicleTypeIndex = srcRide->vehicle_type; + RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( + vehicleTypeIndex); + + // RCT1 had no third colour + if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) + { + dst->colours.body_colour = RCT1::GetColour(src->colours.body_colour); + } + else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) + { + dst->colours.body_colour = RCT1::GetColour(src->colours.trim_colour); + } + else + { + dst->colours.body_colour = colourSchemeCopyDescriptor.colour1; } - // Loop over the bits of the uint8_t - for (int32_t j = 0; j < 8; j++) + if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) { - int8_t bit = (_s4.patrol_areas[peepOffset + i] >> j) & 1; - if (bit == 0) + dst->colours.trim_colour = RCT1::GetColour(src->colours.body_colour); + } + else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) + { + dst->colours.trim_colour = RCT1::GetColour(src->colours.trim_colour); + } + else + { + dst->colours.trim_colour = colourSchemeCopyDescriptor.colour2; + } + + if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) + { + dst->colours_extended = RCT1::GetColour(src->colours.body_colour); + } + else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) + { + dst->colours_extended = RCT1::GetColour(src->colours.trim_colour); + } + else + { + dst->colours_extended = colourSchemeCopyDescriptor.colour3; + } + } + + void FixImportStaff() + { + // The RCT2/OpenRCT2 structures are bigger than in RCT1, so initialise them to zero + std::fill(std::begin(gStaffModes), std::end(gStaffModes), StaffMode::None); + std::fill(std::begin(gStaffPatrolAreas), std::end(gStaffPatrolAreas), 0); + + for (int32_t i = 0; i < RCT1_MAX_STAFF; i++) + { + gStaffModes[i] = static_cast(_s4.staff_modes[i]); + } + + for (auto peep : EntityList()) + { + ImportStaffPatrolArea(peep); + } + // Only the individual patrol areas have been converted, so generate the combined patrol areas of each staff type + staff_update_greyed_patrol_areas(); + } + + void ImportPeep(Peep* dst, const rct1_peep* src) + { + // Peep vs. staff (including which kind) + dst->SpriteType = RCT1::GetPeepSpriteType(src->sprite_type); + dst->Action = static_cast(src->action); + dst->SpecialSprite = src->special_sprite; + dst->NextActionSpriteType = static_cast(src->next_action_sprite_type); + dst->ActionSpriteImageOffset = src->action_sprite_image_offset; + dst->WalkingFrameNum = src->no_action_frame_num; + dst->ActionSpriteType = static_cast(src->action_sprite_type); + dst->ActionFrame = src->action_frame; + + const rct_sprite_bounds* spriteBounds = &GetSpriteBounds(dst->SpriteType, dst->ActionSpriteType); + dst->sprite_width = spriteBounds->sprite_width; + dst->sprite_height_negative = spriteBounds->sprite_height_negative; + dst->sprite_height_positive = spriteBounds->sprite_height_positive; + + dst->MoveTo({ src->x, src->y, src->z }); + + dst->sprite_direction = src->sprite_direction; + + // Peep name + if (is_user_string_id(src->name_string_idx)) + { + dst->SetName(GetUserString(src->name_string_idx)); + } + + dst->State = static_cast(src->state); + dst->SubState = src->sub_state; + dst->NextLoc = { src->next_x, src->next_y, src->next_z * RCT1_COORDS_Z_STEP }; + dst->NextFlags = src->next_flags; + dst->Var37 = src->var_37; + dst->StepProgress = src->step_progress; + dst->TshirtColour = RCT1::GetColour(src->tshirt_colour); + dst->TrousersColour = RCT1::GetColour(src->trousers_colour); + dst->DestinationX = src->destination_x; + dst->DestinationY = src->destination_y; + dst->DestinationTolerance = src->destination_tolerance; + dst->PeepDirection = src->direction; + dst->Energy = src->energy; + dst->EnergyTarget = src->energy_target; + dst->Mass = src->mass; + dst->WindowInvalidateFlags = 0; + dst->CurrentRide = RCT12RideIdToOpenRCT2RideId(src->current_ride); + dst->CurrentRideStation = src->current_ride_station; + dst->CurrentTrain = src->current_train; + dst->CurrentCar = src->current_car; + dst->CurrentSeat = src->current_seat; + dst->InteractionRideIndex = RCT12RideIdToOpenRCT2RideId(src->interaction_ride_index); + dst->Id = src->id; + dst->PathCheckOptimisation = 0; + dst->PeepFlags = 0; + dst->PathfindGoal.x = 0xFF; + dst->PathfindGoal.y = 0xFF; + dst->PathfindGoal.z = 0xFF; + dst->PathfindGoal.direction = INVALID_DIRECTION; + } + + void ImportStaffPatrolArea(Staff* staffmember) + { + // The patrol areas in RCT1 are encoded as follows, for coordinates x and y, separately for every staff member: + // - Chop off the 7 lowest bits of the x and y coordinates, which leaves 5 bits per coordinate. + // This step also "produces" the 4x4 patrol squares. + // - Append the two bitstrings to a 10-bit value like so: yyyyyxxxxx + // - Use this 10-bit value as an index into an 8-bit array. The array is sized such that every 4x4 square + // used for the patrols on the map has a bit in that array. If a bit is 1, that square is part of the patrol. + // The correct bit position in that array is found like this: yyyyyxx|xxx + // index in the array ----^ ^--- bit position in the 8-bit value + // We do the opposite in this function to recover the x and y values. + + int32_t peepOffset = staffmember->StaffId * RCT12_PATROL_AREA_SIZE; + for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++) + { + if (_s4.patrol_areas[peepOffset + i] == 0) { // No patrol for this area continue; } - // val contains the 5 highest bits of both the x and y coordinates - int32_t val = j | (i << 3); - int32_t x = val & 0x1F; - x <<= 7; - int32_t y = val & 0x3E0; - y <<= 2; - staff_set_patrol_area(staffmember->StaffId, { x, y }, true); - } - } - } - void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src) - { - dst->sprite_direction = src->sprite_direction; - dst->sprite_width = src->sprite_width; - dst->sprite_height_negative = src->sprite_height_negative; - dst->sprite_height_positive = src->sprite_height_positive; - dst->x = src->x; - dst->y = src->y; - dst->z = src->z; - } - - void ImportPeepSpawns() - { - gPeepSpawns.clear(); - for (size_t i = 0; i < RCT12_MAX_PEEP_SPAWNS; i++) - { - if (_s4.peep_spawn[i].x != RCT12_PEEP_SPAWN_UNDEFINED) - { - PeepSpawn spawn = { _s4.peep_spawn[i].x, _s4.peep_spawn[i].y, _s4.peep_spawn[i].z * 16, - _s4.peep_spawn[i].direction }; - gPeepSpawns.push_back(spawn); - } - } - } - - void ImportFinance() - { - gParkEntranceFee = _s4.park_entrance_fee; - gLandPrice = _s4.land_price; - gConstructionRightsPrice = _s4.construction_rights_price; - - gCash = ToMoney64(_s4.cash); - gBankLoan = ToMoney64(_s4.loan); - gMaxBankLoan = ToMoney64(_s4.max_loan); - // It's more like 1.33%, but we can only use integers. Can be fixed once we have our own save format. - gBankLoanInterestRate = 1; - gInitialCash = ToMoney64(_s4.cash); - - gCompanyValue = ToMoney64(_s4.company_value); - gParkValue = ToMoney64(CorrectRCT1ParkValue(_s4.park_value)); - gCurrentProfit = ToMoney64(_s4.profit); - - for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) - { - gCashHistory[i] = ToMoney64(_s4.cash_history[i]); - gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); - gWeeklyProfitHistory[i] = ToMoney64(_s4.weekly_profit_history[i]); - } - - for (size_t i = 0; i < RCT12_EXPENDITURE_TABLE_MONTH_COUNT; i++) - { - for (size_t j = 0; j < RCT12_EXPENDITURE_TYPE_COUNT; j++) - { - gExpenditureTable[i][j] = ToMoney64(_s4.expenditure[i][j]); - } - } - gCurrentExpenditure = ToMoney64(_s4.total_expenditure); - - gScenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s4.completed_company_value); - gTotalAdmissions = _s4.num_admissions; - gTotalIncomeFromAdmissions = ToMoney64(_s4.admission_total_income); - - // TODO marketing campaigns not working - static_assert( - std::numeric_limits::max() > ADVERTISING_CAMPAIGN_COUNT, - "Advertising enum bigger than capacity of iterator"); - for (uint8_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) - { - if (_s4.marketing_status[i] & CAMPAIGN_ACTIVE_FLAG) - { - MarketingCampaign campaign; - campaign.Type = i; - campaign.WeeksLeft = _s4.marketing_status[i] & ~CAMPAIGN_ACTIVE_FLAG; - if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) + // Loop over the bits of the uint8_t + for (int32_t j = 0; j < 8; j++) { - campaign.RideId = RCT12RideIdToOpenRCT2RideId(_s4.marketing_assoc[i]); - } - else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) - { - campaign.ShopItemType = ShopItem(_s4.marketing_assoc[i]); - } - gMarketingCampaigns.push_back(campaign); - } - } - } - - void LoadObjects() - { - auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); - objectManager.LoadDefaultObjects(); - - LoadObjects(ObjectType::Ride, _rideEntries); - LoadObjects(ObjectType::SmallScenery, _smallSceneryEntries); - LoadObjects(ObjectType::LargeScenery, _largeSceneryEntries); - LoadObjects(ObjectType::Walls, _wallEntries); - LoadObjects(ObjectType::Paths, _pathEntries); - LoadObjects(ObjectType::PathBits, _pathAdditionEntries); - LoadObjects(ObjectType::SceneryGroup, _sceneryGroupEntries); - LoadObjects( - ObjectType::Banners, - std::vector({ - "BN1 ", - "BN2 ", - "BN3 ", - "BN4 ", - "BN5 ", - "BN6 ", - "BN7 ", - "BN8 ", - "BN9 ", - })); - LoadObjects(ObjectType::ParkEntrance, std::vector({ "PKENT1 " })); - LoadObjects(ObjectType::Water, _waterEntry); - } - - void LoadObjects(ObjectType objectType, const EntryList& entries) - { - LoadObjects(objectType, entries.GetEntries()); - } - - void LoadObjects(ObjectType objectType, const std::vector& entries) - { - auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); - - uint32_t entryIndex = 0; - for (const char* objectName : entries) - { - rct_object_entry entry; - entry.flags = 0x00008000 + EnumValue(objectType); - std::copy_n(objectName, 8, entry.name); - entry.checksum = 0; - - Object* object = objectManager.LoadObject(&entry); - if (object == nullptr && objectType != ObjectType::SceneryGroup) - { - log_error("Failed to load %s.", objectName); - throw std::runtime_error("Failed to load object."); - } - - entryIndex++; - } - } - - void AppendRequiredObjects(std::vector& entries, ObjectType objectType, const EntryList& entryList) - { - AppendRequiredObjects(entries, objectType, entryList.GetEntries()); - } - - void AppendRequiredObjects( - std::vector& entries, ObjectType objectType, const std::vector& objectNames) - { - for (const auto objectName : objectNames) - { - rct_object_entry entry{}; - entry.flags = ((static_cast(ObjectSourceGame::RCT2) << 4) & 0xF0) | (EnumValue(objectType) & 0x0F); - entry.SetName(objectName); - entries.push_back(entry); - } - } - - std::vector GetRequiredObjects() - { - std::vector result; - AppendRequiredObjects(result, ObjectType::Ride, _rideEntries); - AppendRequiredObjects(result, ObjectType::SmallScenery, _smallSceneryEntries); - AppendRequiredObjects(result, ObjectType::LargeScenery, _largeSceneryEntries); - AppendRequiredObjects(result, ObjectType::Walls, _wallEntries); - AppendRequiredObjects(result, ObjectType::Paths, _pathEntries); - AppendRequiredObjects(result, ObjectType::PathBits, _pathAdditionEntries); - AppendRequiredObjects(result, ObjectType::SceneryGroup, _sceneryGroupEntries); - AppendRequiredObjects( - result, ObjectType::Banners, - std::vector({ - "BN1 ", - "BN2 ", - "BN3 ", - "BN4 ", - "BN5 ", - "BN6 ", - "BN7 ", - "BN8 ", - "BN9 ", - })); - AppendRequiredObjects(result, ObjectType::ParkEntrance, std::vector({ "PKENT1 " })); - AppendRequiredObjects(result, ObjectType::Water, _waterEntry); - return result; - } - - void ImportTileElements() - { - gMapBaseZ = 7; - - // Build tile pointer cache (needed to get the first element at a certain location) - auto tilePointerIndex = TilePointerIndex(RCT1_MAX_MAP_SIZE, _s4.tile_elements); - - std::vector tileElements; - for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) - { - for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) - { - if (coords.x >= RCT1_MAX_MAP_SIZE || coords.y >= RCT1_MAX_MAP_SIZE) - { - auto& dstElement = tileElements.emplace_back(); - dstElement.ClearAs(TILE_ELEMENT_TYPE_SURFACE); - dstElement.SetLastForTile(true); - } - else - { - // This is the equivalent of map_get_first_element_at(x, y), but on S4 data. - RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); - do + int8_t bit = (_s4.patrol_areas[peepOffset + i] >> j) & 1; + if (bit == 0) { - if (srcElement->base_height == RCT12_MAX_ELEMENT_HEIGHT) - continue; - - // Reserve 8 elements for import - auto originalSize = tileElements.size(); - tileElements.resize(originalSize + 16); - auto dstElement = tileElements.data() + originalSize; - auto numAddedElements = ImportTileElement(dstElement, srcElement); - tileElements.resize(originalSize + numAddedElements); - } while (!(srcElement++)->IsLastForTile()); - - // Set last element flag in case the original last element was never added - if (tileElements.size() > 0) - { - tileElements.back().SetLastForTile(true); - } - } - } - } - - SetTileElements(std::move(tileElements)); - FixEntrancePositions(); - } - - size_t ImportTileElement(TileElement* dst, const RCT12TileElement* src) - { - // Todo: allow for changing definition of OpenRCT2 tile element types - replace with a map - uint8_t tileElementType = src->GetType(); - dst->ClearAs(tileElementType); - dst->SetDirection(src->GetDirection()); - - // All saved in "flags" - dst->SetOccupiedQuadrants(src->GetOccupiedQuadrants()); - // Skipping IsGhost, which appears to use a different flag in RCT1. - // This flag will be set by the caller. - dst->SetLastForTile(false); - - dst->SetBaseZ(src->base_height * RCT1_COORDS_Z_STEP); - dst->SetClearanceZ(src->clearance_height * RCT1_COORDS_Z_STEP); - - switch (tileElementType) - { - case TILE_ELEMENT_TYPE_SURFACE: - { - auto dst2 = dst->AsSurface(); - auto src2 = src->AsSurface(); - - dst2->SetSlope(src2->GetSlope()); - dst2->SetSurfaceStyle(RCT1::GetTerrain(src2->GetSurfaceStyle())); - dst2->SetEdgeStyle(RCT1::GetTerrainEdge(src2->GetEdgeStyle())); - dst2->SetGrassLength(src2->GetGrassLength()); - dst2->SetOwnership(src2->GetOwnership()); - dst2->SetParkFences(src2->GetParkFences()); - dst2->SetWaterHeight(src2->GetWaterHeight()); - dst2->SetHasTrackThatNeedsWater(src2->HasTrackThatNeedsWater()); - - return 1; - } - case TILE_ELEMENT_TYPE_PATH: - { - auto dst2 = dst->AsPath(); - auto src2 = src->AsPath(); - - dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection()); - dst2->SetSloped(src2->IsSloped()); - dst2->SetSlopeDirection(src2->GetSlopeDirection()); - dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); - dst2->SetStationIndex(src2->GetStationIndex()); - dst2->SetWide(src2->IsWide()); - dst2->SetHasQueueBanner(src2->HasQueueBanner()); - dst2->SetEdges(src2->GetEdges()); - dst2->SetCorners(src2->GetCorners()); - dst2->SetAddition(src2->GetAddition()); - dst2->SetAdditionIsGhost(false); - dst2->SetAdditionStatus(src2->GetAdditionStatus()); - - // Type - uint8_t pathType = src2->GetRCT1PathType(); - auto entryIndex = _pathTypeToEntryMap[pathType]; - - dst2->SetDirection(0); - dst2->SetIsBroken(false); - dst2->SetIsBlockedByVehicle(false); - - dst2->SetSurfaceEntryIndex(entryIndex); - dst2->SetShouldDrawPathOverSupports(true); - if (RCT1::PathIsQueue(pathType)) - { - dst2->SetIsQueue(true); - } - if (_gameVersion != FILE_VERSION_RCT1_LL) - { - dst2->SetRailingEntryIndex(0); - } - else - { - ObjectEntryIndex railingsEntryIndex; - switch (src2->GetRCT1SupportType()) - { - case RCT1_PATH_SUPPORT_TYPE_COATED_WOOD: - railingsEntryIndex = 3; - break; - case RCT1_PATH_SUPPORT_TYPE_SPACE: - railingsEntryIndex = 4; - break; - case RCT1_PATH_SUPPORT_TYPE_BAMBOO: - railingsEntryIndex = 5; - break; - case RCT1_PATH_SUPPORT_TYPE_TRUSS: - default: - railingsEntryIndex = 0; - } - dst2->SetRailingEntryIndex(railingsEntryIndex); - } - - // Additions - ObjectEntryIndex additionType = dst2->GetAddition(); - if (additionType != RCT1_PATH_ADDITION_NONE) - { - ObjectEntryIndex normalisedType = RCT1::NormalisePathAddition(additionType); - entryIndex = _pathAdditionTypeToEntryMap[normalisedType]; - if (additionType != normalisedType) - { - dst2->SetIsBroken(true); - } - dst2->SetAddition(entryIndex + 1); - } - return 1; - } - case TILE_ELEMENT_TYPE_TRACK: - { - auto dst2 = dst->AsTrack(); - auto src2 = src->AsTrack(); - const auto* ride = get_ride(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); - auto rideType = (ride != nullptr) ? ride->type : RIDE_TYPE_NULL; - - dst2->SetTrackType(RCT1TrackTypeToOpenRCT2(src2->GetTrackType(), rideType)); - dst2->SetSequenceIndex(src2->GetSequenceIndex()); - dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); - dst2->SetColourScheme(src2->GetColourScheme()); - dst2->SetHasChain(src2->HasChain()); - dst2->SetHasCableLift(false); - dst2->SetInverted(src2->IsInverted()); - dst2->SetStationIndex(src2->GetStationIndex()); - dst2->SetHasGreenLight(src2->HasGreenLight()); - dst2->SetIsIndestructible(src2->IsIndestructible()); - if (rideType == RIDE_TYPE_GHOST_TRAIN) - { - dst2->SetDoorAState(src2->GetDoorAState()); - dst2->SetDoorBState(src2->GetDoorBState()); - } - else - { - dst2->SetSeatRotation(DEFAULT_SEAT_ROTATION); - } - // Skipping IsHighlighted() - - auto trackType = dst2->GetTrackType(); - if (TrackTypeHasSpeedSetting(trackType)) - { - dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); - } - else if (trackType == TrackElemType::OnRidePhoto) - { - dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); - } - - // This has to be done last, since the maze entry shares fields with the colour and sequence fields. - if (rideType == RIDE_TYPE_MAZE) - { - dst2->SetMazeEntry(src2->GetMazeEntry()); - } - - return 1; - } - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto dst2 = dst->AsSmallScenery(); - auto src2 = src->AsSmallScenery(); - - auto entryIndex = _smallSceneryTypeToEntryMap[src2->GetEntryIndex()]; - dst2->SetEntryIndex(entryIndex); - dst2->SetAge(src2->GetAge()); - dst2->SetSceneryQuadrant(src2->GetSceneryQuadrant()); - dst2->SetPrimaryColour(RCT1::GetColour(src2->GetPrimaryColour())); - if (src2->NeedsSupports()) - dst2->SetNeedsSupports(); - - // Copied from [rct2: 0x006A2956] - switch (src2->GetEntryIndex()) - { - case RCT1_SCENERY_GEOMETRIC_SCULPTURE_1: - case RCT1_SCENERY_GEOMETRIC_SCULPTURE_2: - case RCT1_SCENERY_GEOMETRIC_SCULPTURE_3: - case RCT1_SCENERY_GEOMETRIC_SCULPTURE_4: - case RCT1_SCENERY_GEOMETRIC_SCULPTURE_5: - dst2->SetSecondaryColour(COLOUR_WHITE); - break; - case RCT1_SCENERY_TULIPS_1: - case RCT1_SCENERY_TULIPS_2: - dst2->SetPrimaryColour(COLOUR_BRIGHT_RED); - dst2->SetSecondaryColour(COLOUR_YELLOW); - break; - case RCT1_SCENERY_SMALL_RED_GARDENS: - dst2->SetPrimaryColour(COLOUR_BRIGHT_RED); - break; - } - - return 1; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - { - auto dst2 = dst->AsEntrance(); - auto src2 = src->AsEntrance(); - - dst2->SetEntranceType(src2->GetEntranceType()); - dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); - dst2->SetStationIndex(src2->GetStationIndex()); - dst2->SetSequenceIndex(src2->GetSequenceIndex()); - - if (src2->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) - { - auto pathType = src2->GetPathType(); - if (pathType == 0) - { - pathType = RCT1_FOOTPATH_TYPE_TARMAC_GRAY; - } - auto entryIndex = _pathTypeToEntryMap[pathType]; - dst2->SetPathType(entryIndex & 0x7F); - } - - return 1; - } - case TILE_ELEMENT_TYPE_WALL: - { - auto src2 = src->AsWall(); - auto slope = src2->GetRCT1Slope(); - size_t numAddedElements = 0; - - for (int32_t edge = 0; edge < 4; edge++) - { - int32_t type = src2->GetRCT1WallType(edge); - if (type == -1) + // No patrol for this area continue; - - colour_t colourA = RCT1::GetColour(src2->GetRCT1WallColour()); - colour_t colourB = COLOUR_BLACK; - colour_t colourC = COLOUR_BLACK; - ConvertWall(type, &colourA, &colourB); - - type = _wallTypeToEntryMap[type]; - auto baseZ = src->base_height * RCT1_COORDS_Z_STEP; - auto clearanceZ = src->clearance_height * RCT1_COORDS_Z_STEP; - auto edgeSlope = LandSlopeToWallSlope[slope][edge & 3]; - if (edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS)) - { - clearanceZ += LAND_HEIGHT_STEP; } - if (edgeSlope & EDGE_SLOPE_ELEVATED) + // val contains the 5 highest bits of both the x and y coordinates + int32_t val = j | (i << 3); + int32_t x = val & 0x1F; + x <<= 7; + int32_t y = val & 0x3E0; + y <<= 2; + staff_set_patrol_area(staffmember->StaffId, { x, y }, true); + } + } + } + + void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src) + { + dst->sprite_direction = src->sprite_direction; + dst->sprite_width = src->sprite_width; + dst->sprite_height_negative = src->sprite_height_negative; + dst->sprite_height_positive = src->sprite_height_positive; + dst->x = src->x; + dst->y = src->y; + dst->z = src->z; + } + + void ImportPeepSpawns() + { + gPeepSpawns.clear(); + for (size_t i = 0; i < RCT12_MAX_PEEP_SPAWNS; i++) + { + if (_s4.peep_spawn[i].x != RCT12_PEEP_SPAWN_UNDEFINED) + { + PeepSpawn spawn = { _s4.peep_spawn[i].x, _s4.peep_spawn[i].y, _s4.peep_spawn[i].z * 16, + _s4.peep_spawn[i].direction }; + gPeepSpawns.push_back(spawn); + } + } + } + + void ImportFinance() + { + gParkEntranceFee = _s4.park_entrance_fee; + gLandPrice = _s4.land_price; + gConstructionRightsPrice = _s4.construction_rights_price; + + gCash = ToMoney64(_s4.cash); + gBankLoan = ToMoney64(_s4.loan); + gMaxBankLoan = ToMoney64(_s4.max_loan); + // It's more like 1.33%, but we can only use integers. Can be fixed once we have our own save format. + gBankLoanInterestRate = 1; + gInitialCash = ToMoney64(_s4.cash); + + gCompanyValue = ToMoney64(_s4.company_value); + gParkValue = ToMoney64(CorrectRCT1ParkValue(_s4.park_value)); + gCurrentProfit = ToMoney64(_s4.profit); + + for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) + { + gCashHistory[i] = ToMoney64(_s4.cash_history[i]); + gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); + gWeeklyProfitHistory[i] = ToMoney64(_s4.weekly_profit_history[i]); + } + + for (size_t i = 0; i < RCT12_EXPENDITURE_TABLE_MONTH_COUNT; i++) + { + for (size_t j = 0; j < RCT12_EXPENDITURE_TYPE_COUNT; j++) + { + gExpenditureTable[i][j] = ToMoney64(_s4.expenditure[i][j]); + } + } + gCurrentExpenditure = ToMoney64(_s4.total_expenditure); + + gScenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s4.completed_company_value); + gTotalAdmissions = _s4.num_admissions; + gTotalIncomeFromAdmissions = ToMoney64(_s4.admission_total_income); + + // TODO marketing campaigns not working + static_assert( + std::numeric_limits::max() > ADVERTISING_CAMPAIGN_COUNT, + "Advertising enum bigger than capacity of iterator"); + for (uint8_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) + { + if (_s4.marketing_status[i] & CAMPAIGN_ACTIVE_FLAG) + { + MarketingCampaign campaign; + campaign.Type = i; + campaign.WeeksLeft = _s4.marketing_status[i] & ~CAMPAIGN_ACTIVE_FLAG; + if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) { - edgeSlope &= ~EDGE_SLOPE_ELEVATED; - baseZ += LAND_HEIGHT_STEP; - clearanceZ += LAND_HEIGHT_STEP; + campaign.RideId = RCT12RideIdToOpenRCT2RideId(_s4.marketing_assoc[i]); } + else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) + { + campaign.ShopItemType = ShopItem(_s4.marketing_assoc[i]); + } + gMarketingCampaigns.push_back(campaign); + } + } + } - dst->SetType(TILE_ELEMENT_TYPE_WALL); - dst->SetDirection(edge); - dst->SetBaseZ(baseZ); - dst->SetClearanceZ(clearanceZ); - // Will be set later. - dst->SetLastForTile(false); + void LoadObjects() + { + auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); + objectManager.LoadDefaultObjects(); - auto* wallElement = dst->AsWall(); - wallElement->SetEntryIndex(type); - wallElement->SetPrimaryColour(colourA); - wallElement->SetSecondaryColour(colourB); - wallElement->SetTertiaryColour(colourC); - wallElement->SetBannerIndex(BANNER_INDEX_NULL); - wallElement->SetAcrossTrack(false); - wallElement->SetAnimationIsBackwards(false); - wallElement->SetSlope(edgeSlope); + LoadObjects(ObjectType::Ride, _rideEntries); + LoadObjects(ObjectType::SmallScenery, _smallSceneryEntries); + LoadObjects(ObjectType::LargeScenery, _largeSceneryEntries); + LoadObjects(ObjectType::Walls, _wallEntries); + LoadObjects(ObjectType::Paths, _pathEntries); + LoadObjects(ObjectType::PathBits, _pathAdditionEntries); + LoadObjects(ObjectType::SceneryGroup, _sceneryGroupEntries); + LoadObjects( + ObjectType::Banners, + std::vector({ + "BN1 ", + "BN2 ", + "BN3 ", + "BN4 ", + "BN5 ", + "BN6 ", + "BN7 ", + "BN8 ", + "BN9 ", + })); + LoadObjects(ObjectType::ParkEntrance, std::vector({ "PKENT1 " })); + LoadObjects(ObjectType::Water, _waterEntry); + } - dst++; - numAddedElements++; + void LoadObjects(ObjectType objectType, const EntryList& entries) + { + LoadObjects(objectType, entries.GetEntries()); + } + + void LoadObjects(ObjectType objectType, const std::vector& entries) + { + auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); + + uint32_t entryIndex = 0; + for (const char* objectName : entries) + { + rct_object_entry entry; + entry.flags = 0x00008000 + EnumValue(objectType); + std::copy_n(objectName, 8, entry.name); + entry.checksum = 0; + + Object* object = objectManager.LoadObject(&entry); + if (object == nullptr && objectType != ObjectType::SceneryGroup) + { + log_error("Failed to load %s.", objectName); + throw std::runtime_error("Failed to load object."); } - return numAddedElements; + entryIndex++; } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: + } + + void AppendRequiredObjects(std::vector& entries, ObjectType objectType, const EntryList& entryList) + { + AppendRequiredObjects(entries, objectType, entryList.GetEntries()); + } + + void AppendRequiredObjects( + std::vector& entries, ObjectType objectType, const std::vector& objectNames) + { + for (const auto objectName : objectNames) { - auto dst2 = dst->AsLargeScenery(); - auto src2 = src->AsLargeScenery(); - - auto type = src2->GetEntryIndex(); - dst2->SetEntryIndex(_largeSceneryTypeToEntryMap[type]); - dst2->SetSequenceIndex(src2->GetSequenceIndex()); - dst2->SetPrimaryColour(RCT1::GetColour(src2->GetPrimaryColour())); - dst2->SetSecondaryColour(RCT1::GetColour(src2->GetSecondaryColour())); - - return 1; + rct_object_entry entry{}; + entry.flags = ((static_cast(ObjectSourceGame::RCT2) << 4) & 0xF0) | (EnumValue(objectType) & 0x0F); + entry.SetName(objectName); + entries.push_back(entry); } - case TILE_ELEMENT_TYPE_BANNER: + } + + std::vector GetRequiredObjects() + { + std::vector result; + AppendRequiredObjects(result, ObjectType::Ride, _rideEntries); + AppendRequiredObjects(result, ObjectType::SmallScenery, _smallSceneryEntries); + AppendRequiredObjects(result, ObjectType::LargeScenery, _largeSceneryEntries); + AppendRequiredObjects(result, ObjectType::Walls, _wallEntries); + AppendRequiredObjects(result, ObjectType::Paths, _pathEntries); + AppendRequiredObjects(result, ObjectType::PathBits, _pathAdditionEntries); + AppendRequiredObjects(result, ObjectType::SceneryGroup, _sceneryGroupEntries); + AppendRequiredObjects( + result, ObjectType::Banners, + std::vector({ + "BN1 ", + "BN2 ", + "BN3 ", + "BN4 ", + "BN5 ", + "BN6 ", + "BN7 ", + "BN8 ", + "BN9 ", + })); + AppendRequiredObjects(result, ObjectType::ParkEntrance, std::vector({ "PKENT1 " })); + AppendRequiredObjects(result, ObjectType::Water, _waterEntry); + return result; + } + + void ImportTileElements() + { + gMapBaseZ = 7; + + // Build tile pointer cache (needed to get the first element at a certain location) + auto tilePointerIndex = TilePointerIndex(RCT1_MAX_MAP_SIZE, _s4.tile_elements); + + std::vector tileElements; + for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) { - auto dst2 = dst->AsBanner(); - auto src2 = src->AsBanner(); - - dst2->SetPosition(src2->GetPosition()); - dst2->SetAllowedEdges(src2->GetAllowedEdges()); - - auto index = src2->GetIndex(); - if (index < std::size(_s4.banners)) + for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) { - auto srcBanner = &_s4.banners[index]; - auto dstBanner = GetOrCreateBanner(index); - if (dstBanner == nullptr) + if (coords.x >= RCT1_MAX_MAP_SIZE || coords.y >= RCT1_MAX_MAP_SIZE) { - dst2->SetIndex(BANNER_INDEX_NULL); + auto& dstElement = tileElements.emplace_back(); + dstElement.ClearAs(TILE_ELEMENT_TYPE_SURFACE); + dstElement.SetLastForTile(true); } else { - ImportBanner(dstBanner, srcBanner); - dst2->SetIndex(index); + // This is the equivalent of map_get_first_element_at(x, y), but on S4 data. + RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); + do + { + if (srcElement->base_height == RCT12_MAX_ELEMENT_HEIGHT) + continue; + + // Reserve 8 elements for import + auto originalSize = tileElements.size(); + tileElements.resize(originalSize + 16); + auto dstElement = tileElements.data() + originalSize; + auto numAddedElements = ImportTileElement(dstElement, srcElement); + tileElements.resize(originalSize + numAddedElements); + } while (!(srcElement++)->IsLastForTile()); + + // Set last element flag in case the original last element was never added + if (tileElements.size() > 0) + { + tileElements.back().SetLastForTile(true); + } } } + } + + SetTileElements(std::move(tileElements)); + FixEntrancePositions(); + } + + size_t ImportTileElement(TileElement* dst, const RCT12TileElement* src) + { + // Todo: allow for changing definition of OpenRCT2 tile element types - replace with a map + uint8_t tileElementType = src->GetType(); + dst->ClearAs(tileElementType); + dst->SetDirection(src->GetDirection()); + + // All saved in "flags" + dst->SetOccupiedQuadrants(src->GetOccupiedQuadrants()); + // Skipping IsGhost, which appears to use a different flag in RCT1. + // This flag will be set by the caller. + dst->SetLastForTile(false); + + dst->SetBaseZ(src->base_height * RCT1_COORDS_Z_STEP); + dst->SetClearanceZ(src->clearance_height * RCT1_COORDS_Z_STEP); + + switch (tileElementType) + { + case TILE_ELEMENT_TYPE_SURFACE: + { + auto dst2 = dst->AsSurface(); + auto src2 = src->AsSurface(); + + dst2->SetSlope(src2->GetSlope()); + dst2->SetSurfaceStyle(RCT1::GetTerrain(src2->GetSurfaceStyle())); + dst2->SetEdgeStyle(RCT1::GetTerrainEdge(src2->GetEdgeStyle())); + dst2->SetGrassLength(src2->GetGrassLength()); + dst2->SetOwnership(src2->GetOwnership()); + dst2->SetParkFences(src2->GetParkFences()); + dst2->SetWaterHeight(src2->GetWaterHeight()); + dst2->SetHasTrackThatNeedsWater(src2->HasTrackThatNeedsWater()); + + return 1; + } + case TILE_ELEMENT_TYPE_PATH: + { + auto dst2 = dst->AsPath(); + auto src2 = src->AsPath(); + + dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection()); + dst2->SetSloped(src2->IsSloped()); + dst2->SetSlopeDirection(src2->GetSlopeDirection()); + dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); + dst2->SetStationIndex(src2->GetStationIndex()); + dst2->SetWide(src2->IsWide()); + dst2->SetHasQueueBanner(src2->HasQueueBanner()); + dst2->SetEdges(src2->GetEdges()); + dst2->SetCorners(src2->GetCorners()); + dst2->SetAddition(src2->GetAddition()); + dst2->SetAdditionIsGhost(false); + dst2->SetAdditionStatus(src2->GetAdditionStatus()); + + // Type + uint8_t pathType = src2->GetRCT1PathType(); + auto entryIndex = _pathTypeToEntryMap[pathType]; + + dst2->SetDirection(0); + dst2->SetIsBroken(false); + dst2->SetIsBlockedByVehicle(false); + + dst2->SetSurfaceEntryIndex(entryIndex); + dst2->SetShouldDrawPathOverSupports(true); + if (RCT1::PathIsQueue(pathType)) + { + dst2->SetIsQueue(true); + } + if (_gameVersion != FILE_VERSION_RCT1_LL) + { + dst2->SetRailingEntryIndex(0); + } + else + { + ObjectEntryIndex railingsEntryIndex; + switch (src2->GetRCT1SupportType()) + { + case RCT1_PATH_SUPPORT_TYPE_COATED_WOOD: + railingsEntryIndex = 3; + break; + case RCT1_PATH_SUPPORT_TYPE_SPACE: + railingsEntryIndex = 4; + break; + case RCT1_PATH_SUPPORT_TYPE_BAMBOO: + railingsEntryIndex = 5; + break; + case RCT1_PATH_SUPPORT_TYPE_TRUSS: + default: + railingsEntryIndex = 0; + } + dst2->SetRailingEntryIndex(railingsEntryIndex); + } + + // Additions + ObjectEntryIndex additionType = dst2->GetAddition(); + if (additionType != RCT1_PATH_ADDITION_NONE) + { + ObjectEntryIndex normalisedType = RCT1::NormalisePathAddition(additionType); + entryIndex = _pathAdditionTypeToEntryMap[normalisedType]; + if (additionType != normalisedType) + { + dst2->SetIsBroken(true); + } + dst2->SetAddition(entryIndex + 1); + } + return 1; + } + case TILE_ELEMENT_TYPE_TRACK: + { + auto dst2 = dst->AsTrack(); + auto src2 = src->AsTrack(); + const auto* ride = get_ride(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); + auto rideType = (ride != nullptr) ? ride->type : RIDE_TYPE_NULL; + + dst2->SetTrackType(RCT1TrackTypeToOpenRCT2(src2->GetTrackType(), rideType)); + dst2->SetSequenceIndex(src2->GetSequenceIndex()); + dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); + dst2->SetColourScheme(src2->GetColourScheme()); + dst2->SetHasChain(src2->HasChain()); + dst2->SetHasCableLift(false); + dst2->SetInverted(src2->IsInverted()); + dst2->SetStationIndex(src2->GetStationIndex()); + dst2->SetHasGreenLight(src2->HasGreenLight()); + dst2->SetIsIndestructible(src2->IsIndestructible()); + if (rideType == RIDE_TYPE_GHOST_TRAIN) + { + dst2->SetDoorAState(src2->GetDoorAState()); + dst2->SetDoorBState(src2->GetDoorBState()); + } + else + { + dst2->SetSeatRotation(DEFAULT_SEAT_ROTATION); + } + // Skipping IsHighlighted() + + auto trackType = dst2->GetTrackType(); + if (TrackTypeHasSpeedSetting(trackType)) + { + dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); + } + else if (trackType == TrackElemType::OnRidePhoto) + { + dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); + } + + // This has to be done last, since the maze entry shares fields with the colour and sequence fields. + if (rideType == RIDE_TYPE_MAZE) + { + dst2->SetMazeEntry(src2->GetMazeEntry()); + } + + return 1; + } + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto dst2 = dst->AsSmallScenery(); + auto src2 = src->AsSmallScenery(); + + auto entryIndex = _smallSceneryTypeToEntryMap[src2->GetEntryIndex()]; + dst2->SetEntryIndex(entryIndex); + dst2->SetAge(src2->GetAge()); + dst2->SetSceneryQuadrant(src2->GetSceneryQuadrant()); + dst2->SetPrimaryColour(RCT1::GetColour(src2->GetPrimaryColour())); + if (src2->NeedsSupports()) + dst2->SetNeedsSupports(); + + // Copied from [rct2: 0x006A2956] + switch (src2->GetEntryIndex()) + { + case RCT1_SCENERY_GEOMETRIC_SCULPTURE_1: + case RCT1_SCENERY_GEOMETRIC_SCULPTURE_2: + case RCT1_SCENERY_GEOMETRIC_SCULPTURE_3: + case RCT1_SCENERY_GEOMETRIC_SCULPTURE_4: + case RCT1_SCENERY_GEOMETRIC_SCULPTURE_5: + dst2->SetSecondaryColour(COLOUR_WHITE); + break; + case RCT1_SCENERY_TULIPS_1: + case RCT1_SCENERY_TULIPS_2: + dst2->SetPrimaryColour(COLOUR_BRIGHT_RED); + dst2->SetSecondaryColour(COLOUR_YELLOW); + break; + case RCT1_SCENERY_SMALL_RED_GARDENS: + dst2->SetPrimaryColour(COLOUR_BRIGHT_RED); + break; + } + + return 1; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + { + auto dst2 = dst->AsEntrance(); + auto src2 = src->AsEntrance(); + + dst2->SetEntranceType(src2->GetEntranceType()); + dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); + dst2->SetStationIndex(src2->GetStationIndex()); + dst2->SetSequenceIndex(src2->GetSequenceIndex()); + + if (src2->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + { + auto pathType = src2->GetPathType(); + if (pathType == 0) + { + pathType = RCT1_FOOTPATH_TYPE_TARMAC_GRAY; + } + auto entryIndex = _pathTypeToEntryMap[pathType]; + dst2->SetPathType(entryIndex & 0x7F); + } + + return 1; + } + case TILE_ELEMENT_TYPE_WALL: + { + auto src2 = src->AsWall(); + auto slope = src2->GetRCT1Slope(); + size_t numAddedElements = 0; + + for (int32_t edge = 0; edge < 4; edge++) + { + int32_t type = src2->GetRCT1WallType(edge); + if (type == -1) + continue; + + colour_t colourA = RCT1::GetColour(src2->GetRCT1WallColour()); + colour_t colourB = COLOUR_BLACK; + colour_t colourC = COLOUR_BLACK; + ConvertWall(type, &colourA, &colourB); + + type = _wallTypeToEntryMap[type]; + auto baseZ = src->base_height * RCT1_COORDS_Z_STEP; + auto clearanceZ = src->clearance_height * RCT1_COORDS_Z_STEP; + auto edgeSlope = LandSlopeToWallSlope[slope][edge & 3]; + if (edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS)) + { + clearanceZ += LAND_HEIGHT_STEP; + } + if (edgeSlope & EDGE_SLOPE_ELEVATED) + { + edgeSlope &= ~EDGE_SLOPE_ELEVATED; + baseZ += LAND_HEIGHT_STEP; + clearanceZ += LAND_HEIGHT_STEP; + } + + dst->SetType(TILE_ELEMENT_TYPE_WALL); + dst->SetDirection(edge); + dst->SetBaseZ(baseZ); + dst->SetClearanceZ(clearanceZ); + // Will be set later. + dst->SetLastForTile(false); + + auto* wallElement = dst->AsWall(); + wallElement->SetEntryIndex(type); + wallElement->SetPrimaryColour(colourA); + wallElement->SetSecondaryColour(colourB); + wallElement->SetTertiaryColour(colourC); + wallElement->SetBannerIndex(BANNER_INDEX_NULL); + wallElement->SetAcrossTrack(false); + wallElement->SetAnimationIsBackwards(false); + wallElement->SetSlope(edgeSlope); + + dst++; + numAddedElements++; + } + + return numAddedElements; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto dst2 = dst->AsLargeScenery(); + auto src2 = src->AsLargeScenery(); + + auto type = src2->GetEntryIndex(); + dst2->SetEntryIndex(_largeSceneryTypeToEntryMap[type]); + dst2->SetSequenceIndex(src2->GetSequenceIndex()); + dst2->SetPrimaryColour(RCT1::GetColour(src2->GetPrimaryColour())); + dst2->SetSecondaryColour(RCT1::GetColour(src2->GetSecondaryColour())); + + return 1; + } + case TILE_ELEMENT_TYPE_BANNER: + { + auto dst2 = dst->AsBanner(); + auto src2 = src->AsBanner(); + + dst2->SetPosition(src2->GetPosition()); + dst2->SetAllowedEdges(src2->GetAllowedEdges()); + + auto index = src2->GetIndex(); + if (index < std::size(_s4.banners)) + { + auto srcBanner = &_s4.banners[index]; + auto dstBanner = GetOrCreateBanner(index); + if (dstBanner == nullptr) + { + dst2->SetIndex(BANNER_INDEX_NULL); + } + else + { + ImportBanner(dstBanner, srcBanner); + dst2->SetIndex(index); + } + } + else + { + dst2->SetIndex(BANNER_INDEX_NULL); + } + return 1; + } + default: + assert(false); + } + + return 0; + } + + void ImportResearch() + { + // All available objects must be loaded before this method is called as it + // requires them to correctly insert objects into the research list + + research_reset_items(); + + size_t researchListCount; + const rct1_research_item* researchList = GetResearchList(&researchListCount); + + // Initialise the "seen" tables + _researchRideEntryUsed.reset(); + _researchRideTypeUsed.reset(); + + // The first six scenery groups are always available + for (uint8_t i = 0; i < 6; i++) + { + research_insert_scenery_group_entry(i, true); + } + + bool researched = true; + std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( + researchList, researchListCount); + std::vector vehiclesWithMissingRideTypes; + for (size_t i = 0; i < researchListCount; i++) + { + const rct1_research_item* researchItem = &researchList[i]; + if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + { + if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE) + { + researched = false; + continue; + } + // We don't import the random items yet. + else if (researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE || researchItem->item == RCT1_RESEARCH_END) + { + break; + } + } + + switch (researchItem->type) + { + case RCT1_RESEARCH_TYPE_THEME: + { + uint8_t rct1SceneryTheme = researchItem->item; + auto sceneryGroupEntryIndex = _sceneryThemeTypeToEntryMap[rct1SceneryTheme]; + if (sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_IGNORE + && sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_NULL) + { + research_insert_scenery_group_entry(sceneryGroupEntryIndex, researched); + } + break; + } + case RCT1_RESEARCH_TYPE_RIDE: + { + uint8_t rct1RideType = researchItem->item; + _researchRideTypeUsed[rct1RideType] = true; + + auto ownRideEntryIndex = _rideTypeToRideEntryMap[rct1RideType]; + Guard::Assert( + ownRideEntryIndex != OBJECT_ENTRY_INDEX_NULL, "ownRideEntryIndex was OBJECT_ENTRY_INDEX_NULL"); + + bool foundOwnType = false; + // If the ride type does not use vehicles, no point looking for them in the research list. + if (RCT1::RideTypeUsesVehicles(rct1RideType)) + { + // Add all vehicles for this ride type that are researched or before this research item + for (size_t j = 0; j < researchListCount; j++) + { + const rct1_research_item* researchItem2 = &researchList[j]; + if (researchItem2->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + { + if (researchItem2->item == RCT1_RESEARCH_END_RESEARCHABLE + || researchItem2->item == RCT1_RESEARCH_END) + { + break; + } + + continue; + } + + if (researchItem2->type == RCT1_RESEARCH_TYPE_VEHICLE + && researchItem2->related_ride == rct1RideType) + { + auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2->item]; + bool isOwnType = (ownRideEntryIndex == rideEntryIndex2); + if (isOwnType) + { + foundOwnType = true; + } + + // Only add the vehicles that were listed before this ride, otherwise we might + // change the research order + if (j < i && (researched || isOwnType)) + { + InsertResearchVehicle(researchItem2, researched); + } + } + } + } + + if (!foundOwnType) + { + if (!_researchRideEntryUsed[ownRideEntryIndex]) + { + _researchRideEntryUsed[ownRideEntryIndex] = true; + research_insert_ride_entry(ownRideEntryIndex, researched); + } + } + + break; + } + case RCT1_RESEARCH_TYPE_VEHICLE: + { + // Only add vehicle if the related ride has been seen, this to make sure that vehicles + // are researched only after the ride has been researched. Otherwise, remove them from the research + // list, so that they are automatically co-invented when their master ride is invented. + if (_researchRideTypeUsed[researchItem->related_ride]) + { + InsertResearchVehicle(researchItem, researched); + } + else if (!rideTypeInResearch[researchItem->related_ride] && _gameVersion == FILE_VERSION_RCT1_LL) + { + vehiclesWithMissingRideTypes.push_back(*researchItem); + } + + break; + } + case RCT1_RESEARCH_TYPE_SPECIAL: + // Not supported + break; + } + } + for (const rct1_research_item& researchItem : vehiclesWithMissingRideTypes) + { + InsertResearchVehicle(&researchItem, false); + } + + // Research funding / priority + uint8_t activeResearchTypes = 0; + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS) + { + activeResearchTypes |= EnumToFlag(ResearchCategory::Rollercoaster); + } + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_THRILL_RIDES) + { + activeResearchTypes |= EnumToFlag(ResearchCategory::Thrill); + activeResearchTypes |= EnumToFlag(ResearchCategory::Water); + } + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_GENTLE_TRANSPORT_RIDES) + { + activeResearchTypes |= EnumToFlag(ResearchCategory::Gentle); + activeResearchTypes |= EnumToFlag(ResearchCategory::Transport); + } + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_SHOPS) + { + activeResearchTypes |= EnumToFlag(ResearchCategory::Shop); + } + if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_SCENERY_THEMING) + { + activeResearchTypes |= EnumToFlag(ResearchCategory::SceneryGroup); + } + gResearchPriorities = activeResearchTypes; + gResearchFundingLevel = _s4.research_level; + + // This will mark items as researched/unresearched according to the research list. + // This needs to be called before importing progress, as it will reset it. + research_reset_current_item(); + + // Research history + gResearchProgress = _s4.research_progress; + gResearchProgressStage = _s4.research_progress_stage; + gResearchExpectedDay = _s4.next_research_expected_day; + gResearchExpectedMonth = _s4.next_research_expected_month; + + if (_s4.last_research_flags == 0xFF) + { + gResearchLastItem = std::nullopt; + } + else + { + ResearchItem researchItem = {}; + ConvertResearchEntry(&researchItem, _s4.last_research_item, _s4.last_research_type); + gResearchLastItem = researchItem; + } + + if (_s4.next_research_flags == 0xFF) + { + gResearchNextItem = std::nullopt; + gResearchProgressStage = RESEARCH_STAGE_INITIAL_RESEARCH; + gResearchProgress = 0; + } + else + { + ResearchItem researchItem = {}; + ConvertResearchEntry(&researchItem, _s4.next_research_item, _s4.next_research_type); + gResearchNextItem = researchItem; + } + } + + static std::bitset GetRideTypesPresentInResearchList( + const rct1_research_item* researchList, size_t researchListCount) + { + std::bitset ret = {}; + + for (size_t i = 0; i < researchListCount; i++) + { + const rct1_research_item* researchItem = &researchList[i]; + if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + { + if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE + || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) + { + continue; + } + else if (researchItem->item == RCT1_RESEARCH_END) + { + break; + } + } + + if (researchItem->type == RCT1_RESEARCH_TYPE_RIDE) + { + ret[researchItem->item] = true; + } + } + + return ret; + } + + void InsertResearchVehicle(const rct1_research_item* researchItem, bool researched) + { + uint8_t vehicle = researchItem->item; + auto rideEntryIndex = _vehicleTypeToRideEntryMap[vehicle]; + + if (!_researchRideEntryUsed[rideEntryIndex]) + { + _researchRideEntryUsed[rideEntryIndex] = true; + research_insert_ride_entry(rideEntryIndex, researched); + } + } + + void ImportParkName() + { + std::string parkName = std::string(_s4.scenario_name); + if (is_user_string_id(static_cast(_s4.park_name_string_index))) + { + std::string userString = GetUserString(_s4.park_name_string_index); + if (!userString.empty()) + { + parkName = userString; + } + } + + auto& park = GetContext()->GetGameState()->GetPark(); + park.Name = parkName; + } + + void ImportParkFlags() + { + // Date and srand + gScenarioTicks = _s4.ticks; + scenario_rand_seed(_s4.random_a, _s4.random_b); + gDateMonthsElapsed = static_cast(_s4.month); + gDateMonthTicks = _s4.day; + + // Park rating + gParkRating = _s4.park_rating; + for (size_t i = 0; i < 32; i++) + { + gParkRatingHistory[i] = _s4.park_rating_history[i]; + } + + // Awards + for (int32_t i = 0; i < RCT12_MAX_AWARDS; i++) + { + rct12_award* src = &_s4.awards[i]; + Award* dst = &gCurrentAwards[i]; + dst->Time = src->time; + dst->Type = src->type; + } + + // Number of guests history + for (size_t i = 0; i < 32; i++) + { + gGuestsInParkHistory[i] = _s4.guests_in_park_history[i]; + } + + // News items + for (size_t i = 0; i < RCT12_MAX_NEWS_ITEMS; i++) + { + const rct12_news_item* src = &_s4.messages[i]; + News::Item* dst = &gNewsItems[i]; + + dst->Type = static_cast(src->Type); + dst->Flags = src->Flags; + dst->Ticks = src->Ticks; + dst->MonthYear = src->MonthYear; + dst->Day = src->Day; + dst->Text = ConvertFormattedStringToOpenRCT2(std::string_view(src->Text, sizeof(src->Text))); + + if (dst->Type == News::ItemType::Research) + { + uint8_t researchItem = src->Assoc & 0x000000FF; + uint8_t researchType = (src->Assoc & 0x00FF0000) >> 16; + + ResearchItem tmpResearchItem = {}; + ConvertResearchEntry(&tmpResearchItem, researchItem, researchType); + dst->Assoc = tmpResearchItem.rawValue; + } else { - dst2->SetIndex(BANNER_INDEX_NULL); - } - return 1; - } - default: - assert(false); - } - - return 0; - } - - void ImportResearch() - { - // All available objects must be loaded before this method is called as it - // requires them to correctly insert objects into the research list - - research_reset_items(); - - size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); - - // Initialise the "seen" tables - _researchRideEntryUsed.reset(); - _researchRideTypeUsed.reset(); - - // The first six scenery groups are always available - for (uint8_t i = 0; i < 6; i++) - { - research_insert_scenery_group_entry(i, true); - } - - bool researched = true; - std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( - researchList, researchListCount); - std::vector vehiclesWithMissingRideTypes; - for (size_t i = 0; i < researchListCount; i++) - { - const rct1_research_item* researchItem = &researchList[i]; - if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) - { - if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE) - { - researched = false; - continue; - } - // We don't import the random items yet. - else if (researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE || researchItem->item == RCT1_RESEARCH_END) - { - break; + dst->Assoc = src->Assoc; } } - switch (researchItem->type) + // Initial guest status + gGuestInitialCash = _s4.guest_initial_cash; + gGuestInitialHunger = _s4.guest_initial_hunger; + gGuestInitialThirst = _s4.guest_initial_thirst; + gGuestInitialHappiness = _s4.guest_initial_happiness; + + _guestGenerationProbability = _s4.guest_generation_probability; + + // Staff colours + gStaffHandymanColour = RCT1::GetColour(_s4.handman_colour); + gStaffMechanicColour = RCT1::GetColour(_s4.mechanic_colour); + gStaffSecurityColour = RCT1::GetColour(_s4.security_guard_colour); + + // Flags + gParkFlags = _s4.park_flags; + gParkFlags &= ~PARK_FLAGS_ANTI_CHEAT_DEPRECATED; + // Loopy Landscape parks can set a flag to lock the entry price to free. + // If this flag is not set, the player can ask money for both rides and entry. + if (!(_s4.park_flags & RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE)) { - case RCT1_RESEARCH_TYPE_THEME: + gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES; + } + + // RCT2 uses two flags for no money (due to the scenario editor). RCT1 used only one. + // Copy its value to make no money scenarios such as Arid Heights work properly. + if (_s4.park_flags & RCT1_PARK_FLAGS_NO_MONEY) + { + gParkFlags |= PARK_FLAGS_NO_MONEY_SCENARIO; + } + + gParkSize = _s4.park_size; + gTotalRideValueForMoney = _s4.total_ride_value_for_money; + } + + void ConvertResearchEntry(ResearchItem* dst, uint8_t srcItem, uint8_t srcType) + { + dst->SetNull(); + if (srcType == RCT1_RESEARCH_TYPE_RIDE) + { + auto entryIndex = _rideTypeToRideEntryMap[srcItem]; + + if (entryIndex != OBJECT_ENTRY_INDEX_NULL) { - uint8_t rct1SceneryTheme = researchItem->item; - auto sceneryGroupEntryIndex = _sceneryThemeTypeToEntryMap[rct1SceneryTheme]; - if (sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_IGNORE - && sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_NULL) + rct_ride_entry* rideEntry = get_ride_entry(entryIndex); + + if (rideEntry != nullptr) { - research_insert_scenery_group_entry(sceneryGroupEntryIndex, researched); + auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + dst->entryIndex = entryIndex; + dst->baseRideType = rideType; + dst->type = Research::EntryType::Ride; + dst->flags = 0; + dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); } - break; } - case RCT1_RESEARCH_TYPE_RIDE: + } + else if (srcType == RCT1_RESEARCH_TYPE_VEHICLE) + { + auto entryIndex = _vehicleTypeToRideEntryMap[srcItem]; + + if (entryIndex != OBJECT_ENTRY_INDEX_NULL) { - uint8_t rct1RideType = researchItem->item; - _researchRideTypeUsed[rct1RideType] = true; + rct_ride_entry* rideEntry = get_ride_entry(entryIndex); - auto ownRideEntryIndex = _rideTypeToRideEntryMap[rct1RideType]; - Guard::Assert( - ownRideEntryIndex != OBJECT_ENTRY_INDEX_NULL, "ownRideEntryIndex was OBJECT_ENTRY_INDEX_NULL"); - - bool foundOwnType = false; - // If the ride type does not use vehicles, no point looking for them in the research list. - if (RCT1::RideTypeUsesVehicles(rct1RideType)) + if (rideEntry != nullptr) { - // Add all vehicles for this ride type that are researched or before this research item - for (size_t j = 0; j < researchListCount; j++) + auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + dst->entryIndex = entryIndex; + dst->baseRideType = rideType; + dst->type = Research::EntryType::Ride; + dst->flags = 0; + dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); + } + } + } + else if (srcType == RCT1_RESEARCH_TYPE_THEME) + { + auto entryIndex = _sceneryThemeTypeToEntryMap[srcItem]; + + if (entryIndex != OBJECT_ENTRY_INDEX_IGNORE && entryIndex != OBJECT_ENTRY_INDEX_NULL) + { + dst->entryIndex = entryIndex; + dst->type = Research::EntryType::Scenery; + dst->category = ResearchCategory::SceneryGroup; + dst->flags = 0; + } + } + } + + void ImportClimate() + { + gClimate = ClimateType{ _s4.climate }; + gClimateUpdateTimer = _s4.climate_timer; + gClimateCurrent.Temperature = _s4.temperature; + gClimateCurrent.Weather = WeatherType{ _s4.weather }; + gClimateCurrent.WeatherEffect = WeatherEffectType::None; + gClimateCurrent.WeatherGloom = _s4.weather_gloom; + gClimateCurrent.Level = static_cast(_s4.rain); + gClimateNext.Temperature = _s4.target_temperature; + gClimateNext.Weather = WeatherType{ _s4.target_weather }; + gClimateNext.WeatherEffect = WeatherEffectType::None; + gClimateNext.WeatherGloom = _s4.target_weather_gloom; + gClimateNext.Level = static_cast(_s4.target_rain); + } + + void ImportScenarioNameDetails() + { + std::string name = String::ToStd(_s4.scenario_name); + std::string details; + + int32_t scNumber = _s4.scenario_slot_index; + if (scNumber != -1) + { + source_desc sourceDesc; + if (ScenarioSources::TryGetById(scNumber, &sourceDesc)) + { + rct_string_id localisedStringIds[3]; + if (language_get_localised_scenario_strings(sourceDesc.title, localisedStringIds)) + { + if (localisedStringIds[0] != STR_NONE) { - const rct1_research_item* researchItem2 = &researchList[j]; - if (researchItem2->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) - { - if (researchItem2->item == RCT1_RESEARCH_END_RESEARCHABLE - || researchItem2->item == RCT1_RESEARCH_END) - { - break; - } - - continue; - } - - if (researchItem2->type == RCT1_RESEARCH_TYPE_VEHICLE - && researchItem2->related_ride == rct1RideType) - { - auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2->item]; - bool isOwnType = (ownRideEntryIndex == rideEntryIndex2); - if (isOwnType) - { - foundOwnType = true; - } - - // Only add the vehicles that were listed before this ride, otherwise we might - // change the research order - if (j < i && (researched || isOwnType)) - { - InsertResearchVehicle(researchItem2, researched); - } - } + name = String::ToStd(language_get_string(localisedStringIds[0])); + } + if (localisedStringIds[2] != STR_NONE) + { + details = String::ToStd(language_get_string(localisedStringIds[2])); } } - - if (!foundOwnType) - { - if (!_researchRideEntryUsed[ownRideEntryIndex]) - { - _researchRideEntryUsed[ownRideEntryIndex] = true; - research_insert_ride_entry(ownRideEntryIndex, researched); - } - } - - break; } - case RCT1_RESEARCH_TYPE_VEHICLE: - { - // Only add vehicle if the related ride has been seen, this to make sure that vehicles - // are researched only after the ride has been researched. Otherwise, remove them from the research list, - // so that they are automatically co-invented when their master ride is invented. - if (_researchRideTypeUsed[researchItem->related_ride]) - { - InsertResearchVehicle(researchItem, researched); - } - else if (!rideTypeInResearch[researchItem->related_ride] && _gameVersion == FILE_VERSION_RCT1_LL) - { - vehiclesWithMissingRideTypes.push_back(*researchItem); - } + } + gScenarioName = name; + gScenarioDetails = details; + } + + void ImportScenarioObjective() + { + gScenarioObjective.Type = _s4.scenario_objective_type; + gScenarioObjective.Year = _s4.scenario_objective_years; + gScenarioObjective.NumGuests = _s4.scenario_objective_num_guests; + + // RCT1 used a different way of calculating the park value. + // This is corrected here, but since scenario_objective_currency doubles as minimum excitement rating, + // we need to check the goal to avoid affecting scenarios like Volcania. + if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) + gScenarioObjective.Currency = ToMoney64(CorrectRCT1ParkValue(_s4.scenario_objective_currency)); + else + gScenarioObjective.Currency = ToMoney64(_s4.scenario_objective_currency); + + // This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead. + if (_s4.scenario_objective_type == OBJECTIVE_BUILD_THE_BEST) + gScenarioObjective.RideId = GetBuildTheBestRideId(); + } + + void ImportSavedView() + { + gSavedView = ScreenCoordsXY{ _s4.view_x, _s4.view_y }; + gSavedViewZoom = _s4.view_zoom; + gSavedViewRotation = _s4.view_rotation; + } + + void ConvertWall(const int32_t& type, colour_t* colourA, colour_t* colourB) + { + switch (type) + { + case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE: + *colourA = COLOUR_DARK_BROWN; break; - } - case RCT1_RESEARCH_TYPE_SPECIAL: - // Not supported + case RCT1_WALL_TYPE_WHITE_WOODEN_PANEL_FENCE: + *colourA = COLOUR_WHITE; + break; + case RCT1_WALL_TYPE_RED_WOODEN_PANEL_FENCE: + *colourA = COLOUR_SALMON_PINK; + break; + case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_SNOW: + *colourA = COLOUR_DARK_BROWN; + break; + case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_GATE: + *colourB = *colourA; + *colourA = COLOUR_DARK_BROWN; + break; + case RCT1_WALL_TYPE_GLASS_SMOOTH: + case RCT1_WALL_TYPE_GLASS_PANELS: + *colourB = COLOUR_WHITE; + break; + case RCT1_WALL_TYPE_SMALL_GREY_CASTLE: + case RCT1_WALL_TYPE_LARGE_GREY_CASTLE: + case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_CROSS: + case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_GATE: + case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_WINDOW: + case RCT1_WALL_TYPE_MEDIUM_GREY_CASTLE: + *colourA = COLOUR_GREY; break; } } - for (const rct1_research_item& researchItem : vehiclesWithMissingRideTypes) - { - InsertResearchVehicle(&researchItem, false); - } - // Research funding / priority - uint8_t activeResearchTypes = 0; - if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_ROLLERCOASTERS) + void ImportBanner(Banner* dst, const RCT12Banner* src) { - activeResearchTypes |= EnumToFlag(ResearchCategory::Rollercoaster); - } - if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_THRILL_RIDES) - { - activeResearchTypes |= EnumToFlag(ResearchCategory::Thrill); - activeResearchTypes |= EnumToFlag(ResearchCategory::Water); - } - if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_GENTLE_TRANSPORT_RIDES) - { - activeResearchTypes |= EnumToFlag(ResearchCategory::Gentle); - activeResearchTypes |= EnumToFlag(ResearchCategory::Transport); - } - if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_SHOPS) - { - activeResearchTypes |= EnumToFlag(ResearchCategory::Shop); - } - if (_s4.research_priority & RCT1_RESEARCH_CATEGORY_SCENERY_THEMING) - { - activeResearchTypes |= EnumToFlag(ResearchCategory::SceneryGroup); - } - gResearchPriorities = activeResearchTypes; - gResearchFundingLevel = _s4.research_level; + *dst = {}; + dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->type); - // This will mark items as researched/unresearched according to the research list. - // This needs to be called before importing progress, as it will reset it. - research_reset_current_item(); - - // Research history - gResearchProgress = _s4.research_progress; - gResearchProgressStage = _s4.research_progress_stage; - gResearchExpectedDay = _s4.next_research_expected_day; - gResearchExpectedMonth = _s4.next_research_expected_month; - - if (_s4.last_research_flags == 0xFF) - { - gResearchLastItem = std::nullopt; - } - else - { - ResearchItem researchItem = {}; - ConvertResearchEntry(&researchItem, _s4.last_research_item, _s4.last_research_type); - gResearchLastItem = researchItem; - } - - if (_s4.next_research_flags == 0xFF) - { - gResearchNextItem = std::nullopt; - gResearchProgressStage = RESEARCH_STAGE_INITIAL_RESEARCH; - gResearchProgress = 0; - } - else - { - ResearchItem researchItem = {}; - ConvertResearchEntry(&researchItem, _s4.next_research_item, _s4.next_research_type); - gResearchNextItem = researchItem; - } - } - - static std::bitset GetRideTypesPresentInResearchList( - const rct1_research_item* researchList, size_t researchListCount) - { - std::bitset ret = {}; - - for (size_t i = 0; i < researchListCount; i++) - { - const rct1_research_item* researchItem = &researchList[i]; - if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + dst->flags = 0; + if (src->flags & BANNER_FLAG_NO_ENTRY) { - if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) - { + dst->flags |= BANNER_FLAG_NO_ENTRY; + } + + if (is_user_string_id(src->string_idx)) + { + dst->text = GetUserString(src->string_idx); + } + + dst->colour = RCT1::GetColour(src->colour); + dst->text_colour = src->text_colour; + dst->position.x = src->x; + dst->position.y = src->y; + } + + void FixEntrancePositions() + { + gParkEntrances.clear(); + tile_element_iterator it; + tile_element_iterator_begin(&it); + while (tile_element_iterator_next(&it) && gParkEntrances.size() < RCT12_MAX_PARK_ENTRANCES) + { + TileElement* element = it.element; + + if (element->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) continue; - } - else if (researchItem->item == RCT1_RESEARCH_END) - { + if (element->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) + continue; + if ((element->AsEntrance()->GetSequenceIndex()) != 0) + continue; + + CoordsXYZD entrance = { TileCoordsXY(it.x, it.y).ToCoordsXY(), element->GetBaseZ(), element->GetDirection() }; + gParkEntrances.push_back(entrance); + } + } + + EntryList* GetEntryList(ObjectType objectType) + { + switch (objectType) + { + case ObjectType::Ride: + return &_rideEntries; + case ObjectType::SmallScenery: + return &_smallSceneryEntries; + case ObjectType::LargeScenery: + return &_largeSceneryEntries; + case ObjectType::Walls: + return &_wallEntries; + case ObjectType::Paths: + return &_pathEntries; + case ObjectType::PathBits: + return &_pathAdditionEntries; + case ObjectType::SceneryGroup: + return &_sceneryGroupEntries; + case ObjectType::Water: + return &_waterEntry; + default: + // This switch processes only ObjectType for for Entries break; - } } + return nullptr; + } - if (researchItem->type == RCT1_RESEARCH_TYPE_RIDE) + const rct1_research_item* GetResearchList(size_t* count) + { + // Loopy Landscapes stores research items in a different place + if (_gameVersion == FILE_VERSION_RCT1_LL) { - ret[researchItem->item] = true; - } - } - - return ret; - } - - void InsertResearchVehicle(const rct1_research_item* researchItem, bool researched) - { - uint8_t vehicle = researchItem->item; - auto rideEntryIndex = _vehicleTypeToRideEntryMap[vehicle]; - - if (!_researchRideEntryUsed[rideEntryIndex]) - { - _researchRideEntryUsed[rideEntryIndex] = true; - research_insert_ride_entry(rideEntryIndex, researched); - } - } - - void ImportParkName() - { - std::string parkName = std::string(_s4.scenario_name); - if (is_user_string_id(static_cast(_s4.park_name_string_index))) - { - std::string userString = GetUserString(_s4.park_name_string_index); - if (!userString.empty()) - { - parkName = userString; - } - } - - auto& park = GetContext()->GetGameState()->GetPark(); - park.Name = parkName; - } - - void ImportParkFlags() - { - // Date and srand - gScenarioTicks = _s4.ticks; - scenario_rand_seed(_s4.random_a, _s4.random_b); - gDateMonthsElapsed = static_cast(_s4.month); - gDateMonthTicks = _s4.day; - - // Park rating - gParkRating = _s4.park_rating; - for (size_t i = 0; i < 32; i++) - { - gParkRatingHistory[i] = _s4.park_rating_history[i]; - } - - // Awards - for (int32_t i = 0; i < RCT12_MAX_AWARDS; i++) - { - rct12_award* src = &_s4.awards[i]; - Award* dst = &gCurrentAwards[i]; - dst->Time = src->time; - dst->Type = src->type; - } - - // Number of guests history - for (size_t i = 0; i < 32; i++) - { - gGuestsInParkHistory[i] = _s4.guests_in_park_history[i]; - } - - // News items - for (size_t i = 0; i < RCT12_MAX_NEWS_ITEMS; i++) - { - const rct12_news_item* src = &_s4.messages[i]; - News::Item* dst = &gNewsItems[i]; - - dst->Type = static_cast(src->Type); - dst->Flags = src->Flags; - dst->Ticks = src->Ticks; - dst->MonthYear = src->MonthYear; - dst->Day = src->Day; - dst->Text = ConvertFormattedStringToOpenRCT2(std::string_view(src->Text, sizeof(src->Text))); - - if (dst->Type == News::ItemType::Research) - { - uint8_t researchItem = src->Assoc & 0x000000FF; - uint8_t researchType = (src->Assoc & 0x00FF0000) >> 16; - - ResearchItem tmpResearchItem = {}; - ConvertResearchEntry(&tmpResearchItem, researchItem, researchType); - dst->Assoc = tmpResearchItem.rawValue; + *count = std::size(_s4.research_items_LL); + return _s4.research_items_LL; } else { - dst->Assoc = src->Assoc; + *count = std::size(_s4.research_items); + return _s4.research_items; } } - // Initial guest status - gGuestInitialCash = _s4.guest_initial_cash; - gGuestInitialHunger = _s4.guest_initial_hunger; - gGuestInitialThirst = _s4.guest_initial_thirst; - gGuestInitialHappiness = _s4.guest_initial_happiness; - - _guestGenerationProbability = _s4.guest_generation_probability; - - // Staff colours - gStaffHandymanColour = RCT1::GetColour(_s4.handman_colour); - gStaffMechanicColour = RCT1::GetColour(_s4.mechanic_colour); - gStaffSecurityColour = RCT1::GetColour(_s4.security_guard_colour); - - // Flags - gParkFlags = _s4.park_flags; - gParkFlags &= ~PARK_FLAGS_ANTI_CHEAT_DEPRECATED; - // Loopy Landscape parks can set a flag to lock the entry price to free. - // If this flag is not set, the player can ask money for both rides and entry. - if (!(_s4.park_flags & RCT1_PARK_FLAGS_PARK_ENTRY_LOCKED_AT_FREE)) + std::string GetUserString(rct_string_id stringId) { - gParkFlags |= PARK_FLAGS_UNLOCK_ALL_PRICES; + const auto originalString = _s4.string_table[(stringId - USER_STRING_START) % 1024]; + auto originalStringView = std::string_view( + originalString, GetRCT2StringBufferLen(originalString, USER_STRING_MAX_LENGTH)); + auto asUtf8 = rct2_to_utf8(originalStringView, RCT2LanguageId::EnglishUK); + auto justText = RCT12RemoveFormattingUTF8(asUtf8); + return justText.data(); } - // RCT2 uses two flags for no money (due to the scenario editor). RCT1 used only one. - // Copy its value to make no money scenarios such as Arid Heights work properly. - if (_s4.park_flags & RCT1_PARK_FLAGS_NO_MONEY) + void FixLandOwnership() { - gParkFlags |= PARK_FLAGS_NO_MONEY_SCENARIO; - } - - gParkSize = _s4.park_size; - gTotalRideValueForMoney = _s4.total_ride_value_for_money; - } - - void ConvertResearchEntry(ResearchItem* dst, uint8_t srcItem, uint8_t srcType) - { - dst->SetNull(); - if (srcType == RCT1_RESEARCH_TYPE_RIDE) - { - auto entryIndex = _rideTypeToRideEntryMap[srcItem]; - - if (entryIndex != OBJECT_ENTRY_INDEX_NULL) + switch (_s4.scenario_slot_index) { - rct_ride_entry* rideEntry = get_ride_entry(entryIndex); + case SC_DYNAMITE_DUNES: + FixLandOwnershipTiles({ { 97, 18 }, { 99, 19 }, { 83, 34 } }); + break; + case SC_LEAFY_LAKE: + FixLandOwnershipTiles({ { 49, 66 } }); + break; + case SC_KATIES_DREAMLAND: + FixLandOwnershipTiles({ { 74, 70 }, { 75, 70 }, { 76, 70 }, { 77, 73 }, { 80, 77 } }); + break; + case SC_POKEY_PARK: + FixLandOwnershipTiles({ { 64, 102 } }); + break; + case SC_MYSTIC_MOUNTAIN: + FixLandOwnershipTiles({ { 98, 69 }, { 98, 70 }, { 103, 64 }, { 53, 79 }, { 86, 93 }, { 87, 93 } }); + break; + case SC_PACIFIC_PYRAMIDS: + FixLandOwnershipTiles({ { 93, 105 }, { 63, 34 }, { 76, 25 }, { 85, 31 }, { 96, 47 }, { 96, 48 } }); + break; + case SC_UTOPIA_PARK: + FixLandOwnershipTiles({ { 85, 73 } }); + break; + case SC_URBAN_PARK: + FixLandOwnershipTiles({ { 64, 77 }, { 61, 66 }, { 61, 67 }, { 39, 20 } }); + break; + } + } - if (rideEntry != nullptr) + /** + * In Urban Park, the entrance and exit of the merry-go-round are the wrong way round. This code fixes that. + * To avoid messing up saves (in which this problem is most likely solved by the user), only carry out this + * fix when loading from a scenario. + */ + void FixUrbanPark() + { + if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) + { + // First, make the queuing peep exit + for (auto peep : EntityList()) { - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); - dst->entryIndex = entryIndex; - dst->baseRideType = rideType; - dst->type = Research::EntryType::Ride; - dst->flags = 0; - dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); - } - } - } - else if (srcType == RCT1_RESEARCH_TYPE_VEHICLE) - { - auto entryIndex = _vehicleTypeToRideEntryMap[srcItem]; - - if (entryIndex != OBJECT_ENTRY_INDEX_NULL) - { - rct_ride_entry* rideEntry = get_ride_entry(entryIndex); - - if (rideEntry != nullptr) - { - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); - dst->entryIndex = entryIndex; - dst->baseRideType = rideType; - dst->type = Research::EntryType::Ride; - dst->flags = 0; - dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory(); - } - } - } - else if (srcType == RCT1_RESEARCH_TYPE_THEME) - { - auto entryIndex = _sceneryThemeTypeToEntryMap[srcItem]; - - if (entryIndex != OBJECT_ENTRY_INDEX_IGNORE && entryIndex != OBJECT_ENTRY_INDEX_NULL) - { - dst->entryIndex = entryIndex; - dst->type = Research::EntryType::Scenery; - dst->category = ResearchCategory::SceneryGroup; - dst->flags = 0; - } - } - } - - void ImportClimate() - { - gClimate = ClimateType{ _s4.climate }; - gClimateUpdateTimer = _s4.climate_timer; - gClimateCurrent.Temperature = _s4.temperature; - gClimateCurrent.Weather = WeatherType{ _s4.weather }; - gClimateCurrent.WeatherEffect = WeatherEffectType::None; - gClimateCurrent.WeatherGloom = _s4.weather_gloom; - gClimateCurrent.Level = static_cast(_s4.rain); - gClimateNext.Temperature = _s4.target_temperature; - gClimateNext.Weather = WeatherType{ _s4.target_weather }; - gClimateNext.WeatherEffect = WeatherEffectType::None; - gClimateNext.WeatherGloom = _s4.target_weather_gloom; - gClimateNext.Level = static_cast(_s4.target_rain); - } - - void ImportScenarioNameDetails() - { - std::string name = String::ToStd(_s4.scenario_name); - std::string details; - - int32_t scNumber = _s4.scenario_slot_index; - if (scNumber != -1) - { - source_desc sourceDesc; - if (ScenarioSources::TryGetById(scNumber, &sourceDesc)) - { - rct_string_id localisedStringIds[3]; - if (language_get_localised_scenario_strings(sourceDesc.title, localisedStringIds)) - { - if (localisedStringIds[0] != STR_NONE) + if (peep->State == PeepState::QueuingFront && peep->CurrentRide == 0) { - name = String::ToStd(language_get_string(localisedStringIds[0])); - } - if (localisedStringIds[2] != STR_NONE) - { - details = String::ToStd(language_get_string(localisedStringIds[2])); + peep->RemoveFromQueue(); + peep->SetState(PeepState::Falling); + break; } } + + // Now, swap the entrance and exit. + auto ride = get_ride(0); + if (ride != nullptr) + { + auto entranceCoords = ride->stations[0].Exit; + auto exitCoords = ride->stations[0].Entrance; + ride->stations[0].Entrance = entranceCoords; + ride->stations[0].Exit = exitCoords; + + auto entranceElement = map_get_ride_exit_element_at(entranceCoords.ToCoordsXYZD(), false); + entranceElement->SetEntranceType(ENTRANCE_TYPE_RIDE_ENTRANCE); + auto exitElement = map_get_ride_entrance_element_at(exitCoords.ToCoordsXYZD(), false); + exitElement->SetEntranceType(ENTRANCE_TYPE_RIDE_EXIT); + + // Trigger footpath update + footpath_queue_chain_reset(); + footpath_connect_edges( + entranceCoords.ToCoordsXY(), reinterpret_cast(entranceElement), + GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + footpath_update_queue_chains(); + } } } - gScenarioName = name; - gScenarioDetails = details; - } - - void ImportScenarioObjective() - { - gScenarioObjective.Type = _s4.scenario_objective_type; - gScenarioObjective.Year = _s4.scenario_objective_years; - gScenarioObjective.NumGuests = _s4.scenario_objective_num_guests; - - // RCT1 used a different way of calculating the park value. - // This is corrected here, but since scenario_objective_currency doubles as minimum excitement rating, - // we need to check the goal to avoid affecting scenarios like Volcania. - if (_s4.scenario_objective_type == OBJECTIVE_PARK_VALUE_BY) - gScenarioObjective.Currency = ToMoney64(CorrectRCT1ParkValue(_s4.scenario_objective_currency)); - else - gScenarioObjective.Currency = ToMoney64(_s4.scenario_objective_currency); - - // This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead. - if (_s4.scenario_objective_type == OBJECTIVE_BUILD_THE_BEST) - gScenarioObjective.RideId = GetBuildTheBestRideId(); - } - - void ImportSavedView() - { - gSavedView = ScreenCoordsXY{ _s4.view_x, _s4.view_y }; - gSavedViewZoom = _s4.view_zoom; - gSavedViewRotation = _s4.view_rotation; - } - - void ConvertWall(const int32_t& type, colour_t* colourA, colour_t* colourB) - { - switch (type) + /** + * Counts the block sections. The reason this iterates over the map is to avoid getting into infinite loops, + * which can happen with hacked parks. + */ + void CountBlockSections() { - case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE: - *colourA = COLOUR_DARK_BROWN; - break; - case RCT1_WALL_TYPE_WHITE_WOODEN_PANEL_FENCE: - *colourA = COLOUR_WHITE; - break; - case RCT1_WALL_TYPE_RED_WOODEN_PANEL_FENCE: - *colourA = COLOUR_SALMON_PINK; - break; - case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_SNOW: - *colourA = COLOUR_DARK_BROWN; - break; - case RCT1_WALL_TYPE_WOODEN_PANEL_FENCE_WITH_GATE: - *colourB = *colourA; - *colourA = COLOUR_DARK_BROWN; - break; - case RCT1_WALL_TYPE_GLASS_SMOOTH: - case RCT1_WALL_TYPE_GLASS_PANELS: - *colourB = COLOUR_WHITE; - break; - case RCT1_WALL_TYPE_SMALL_GREY_CASTLE: - case RCT1_WALL_TYPE_LARGE_GREY_CASTLE: - case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_CROSS: - case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_GATE: - case RCT1_WALL_TYPE_LARGE_GREY_CASTLE_WINDOW: - case RCT1_WALL_TYPE_MEDIUM_GREY_CASTLE: - *colourA = COLOUR_GREY; - break; - } - } + for (int32_t x = 0; x < RCT1_MAX_MAP_SIZE; x++) + { + for (int32_t y = 0; y < RCT1_MAX_MAP_SIZE; y++) + { + TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + if (tileElement == nullptr) + continue; + do + { + if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + { + // Lift hill tops are the only pieces present in RCT1 that can count as a block brake. + if (!tileElement->AsTrack()->HasChain()) + continue; - void ImportBanner(Banner* dst, const RCT12Banner* src) - { - *dst = {}; - dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->type); + auto trackType = tileElement->AsTrack()->GetTrackType(); + switch (trackType) + { + case TrackElemType::Up25ToFlat: + case TrackElemType::Up60ToFlat: + case TrackElemType::DiagUp25ToFlat: + case TrackElemType::DiagUp60ToFlat: + break; + default: + continue; + } - dst->flags = 0; - if (src->flags & BANNER_FLAG_NO_ENTRY) - { - dst->flags |= BANNER_FLAG_NO_ENTRY; + ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); + auto ride = get_ride(rideIndex); + if (ride != nullptr) + { + ride->num_block_brakes++; + } + } + } while (!(tileElement++)->IsLastForTile()); + } + } } - if (is_user_string_id(src->string_idx)) + /** + * This has to be done after importing tile elements, because it needs those to detect if a pre-existing ride + * name should be considered reserved. + */ + void SetDefaultNames() { - dst->text = GetUserString(src->string_idx); + for (auto& ride : GetRideManager()) + { + if (ride.custom_name.empty()) + { + ride.SetNameToDefault(); + } + } } - dst->colour = RCT1::GetColour(src->colour); - dst->text_colour = src->text_colour; - dst->position.x = src->x; - dst->position.y = src->y; - } - - void FixEntrancePositions() - { - gParkEntrances.clear(); - tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it) && gParkEntrances.size() < RCT12_MAX_PARK_ENTRANCES) + ObjectEntryIndex GetBuildTheBestRideId() { - TileElement* element = it.element; + size_t researchListCount; + const rct1_research_item* researchList = GetResearchList(&researchListCount); + for (size_t i = 0; i < researchListCount; i++) + { + if (researchList[i].flags == 0xFF) + { + break; + } - if (element->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) - continue; - if (element->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) - continue; - if ((element->AsEntrance()->GetSequenceIndex()) != 0) - continue; + if (researchList[i].type == RCT1_RESEARCH_TYPE_RIDE) + { + return RCT1::GetRideType(researchList[i].item, 0); + } + } - CoordsXYZD entrance = { TileCoordsXY(it.x, it.y).ToCoordsXY(), element->GetBaseZ(), element->GetDirection() }; - gParkEntrances.push_back(entrance); + return RIDE_TYPE_NULL; } - } + }; - EntryList* GetEntryList(ObjectType objectType) + // Very similar but not the same as S6Importer version (due to peeps) + constexpr EntityType GetEntityTypeFromRCT1Sprite(const RCT12SpriteBase& src) { - switch (objectType) + EntityType output = EntityType::Null; + switch (src.sprite_identifier) { - case ObjectType::Ride: - return &_rideEntries; - case ObjectType::SmallScenery: - return &_smallSceneryEntries; - case ObjectType::LargeScenery: - return &_largeSceneryEntries; - case ObjectType::Walls: - return &_wallEntries; - case ObjectType::Paths: - return &_pathEntries; - case ObjectType::PathBits: - return &_pathAdditionEntries; - case ObjectType::SceneryGroup: - return &_sceneryGroupEntries; - case ObjectType::Water: - return &_waterEntry; + case RCT12SpriteIdentifier::Vehicle: + output = EntityType::Vehicle; + break; + case RCT12SpriteIdentifier::Peep: + if (RCT12PeepType(static_cast(&src)->type) == RCT12PeepType::Guest) + { + output = EntityType::Guest; + } + else + { + output = EntityType::Staff; + } + break; + case RCT12SpriteIdentifier::Misc: + + switch (RCT12MiscEntityType(src.type)) + { + case RCT12MiscEntityType::SteamParticle: + output = EntityType::SteamParticle; + break; + case RCT12MiscEntityType::MoneyEffect: + output = EntityType::MoneyEffect; + break; + case RCT12MiscEntityType::CrashedVehicleParticle: + output = EntityType::CrashedVehicleParticle; + break; + case RCT12MiscEntityType::ExplosionCloud: + output = EntityType::ExplosionCloud; + break; + case RCT12MiscEntityType::CrashSplash: + output = EntityType::CrashSplash; + break; + case RCT12MiscEntityType::ExplosionFlare: + output = EntityType::ExplosionFlare; + break; + case RCT12MiscEntityType::JumpingFountainWater: + case RCT12MiscEntityType::JumpingFountainSnow: + output = EntityType::JumpingFountain; + break; + case RCT12MiscEntityType::Balloon: + output = EntityType::Balloon; + break; + case RCT12MiscEntityType::Duck: + output = EntityType::Duck; + break; + default: + break; + } + break; + case RCT12SpriteIdentifier::Litter: + output = EntityType::Litter; + break; default: - // This switch processes only ObjectType for for Entries break; } - return nullptr; + return output; } - const rct1_research_item* GetResearchList(size_t* count) + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - // Loopy Landscapes stores research items in a different place + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + const auto* ride = get_ride(src->ride); + if (ride == nullptr) + return; + + uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); + + dst->ride = src->ride; + dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); + + dst->vehicle_type = vehicleEntryIndex; + dst->SubType = Vehicle::Type(src->type); + dst->var_44 = src->var_44; + dst->remaining_distance = src->remaining_distance; + + // Properties from vehicle entry + dst->sprite_width = src->sprite_width; + dst->sprite_height_negative = src->sprite_height_negative; + dst->sprite_height_positive = src->sprite_height_positive; + dst->sprite_direction = src->sprite_direction; + + dst->sprite_left = src->sprite_left; + dst->sprite_top = src->sprite_top; + dst->sprite_right = src->sprite_right; + dst->sprite_bottom = src->sprite_bottom; + + dst->mass = src->mass; + dst->num_seats = src->num_seats; + dst->speed = src->speed; + dst->powered_acceleration = src->powered_acceleration; + dst->brake_speed = src->brake_speed; + + dst->velocity = src->velocity; + dst->acceleration = src->acceleration; + dst->SwingSprite = src->SwingSprite; + dst->SwingPosition = src->SwingPosition; + dst->SwingSpeed = src->SwingSpeed; + dst->restraints_position = src->restraints_position; + dst->spin_sprite = src->spin_sprite; + dst->sound_vector_factor = src->sound_vector_factor; + dst->spin_speed = src->spin_speed; + dst->sound2_flags = src->sound2_flags; + dst->sound1_id = OpenRCT2::Audio::SoundId::Null; + dst->sound2_id = OpenRCT2::Audio::SoundId::Null; + dst->var_C0 = src->var_C0; + dst->var_C4 = src->var_C4; + dst->animation_frame = src->animation_frame; + dst->animationState = src->animationState; + dst->var_CA = src->var_CA; + dst->var_CE = src->var_CE; + dst->var_D3 = src->var_D3; + dst->scream_sound_id = OpenRCT2::Audio::SoundId::Null; + dst->Pitch = src->Pitch; + dst->bank_rotation = src->bank_rotation; + + // Seat rotation was not in RCT1 + dst->target_seat_rotation = DEFAULT_SEAT_ROTATION; + dst->seat_rotation = DEFAULT_SEAT_ROTATION; + + // Vehicle links (indexes converted later) + dst->prev_vehicle_on_ride = src->prev_vehicle_on_ride; + dst->next_vehicle_on_ride = src->next_vehicle_on_ride; + dst->next_vehicle_on_train = src->next_vehicle_on_train; + + // Guests (indexes converted later) + for (int i = 0; i < 32; i++) + { + uint16_t spriteIndex = src->peep[i]; + dst->peep[i] = spriteIndex; + if (spriteIndex != SPRITE_INDEX_NULL) + { + dst->peep_tshirt_colours[i] = RCT1::GetColour(src->peep_tshirt_colours[i]); + } + } + + Vehicle::Status statusSrc = Vehicle::Status::MovingToEndOfStation; + if (src->status <= static_cast(Vehicle::Status::StoppedByBlockBrakes)) + { + statusSrc = static_cast(src->status); + } + dst->status = statusSrc; + dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; + dst->TrackLocation = { src->track_x, src->track_y, src->track_z }; + dst->current_station = src->current_station; + if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != Vehicle::Status::TravellingBoat) + { + dst->BoatLocation.setNull(); + dst->SetTrackDirection(src->GetTrackDirection()); + dst->SetTrackType(RCT1TrackTypeToOpenRCT2(src->GetTrackType(), ride->type)); + } + else + { + dst->BoatLocation = TileCoordsXY{ src->boat_location.x, src->boat_location.y }.ToCoordsXY(); + dst->SetTrackDirection(0); + dst->SetTrackType(0); + } + dst->track_progress = src->track_progress; + dst->vertical_drop_countdown = src->vertical_drop_countdown; + dst->sub_state = src->sub_state; + dst->update_flags = src->update_flags; + + SetVehicleColours(dst, src); + + dst->mini_golf_current_animation = MiniGolfAnimation(src->mini_golf_current_animation); + dst->mini_golf_flags = src->mini_golf_flags; + + dst->MoveTo({ src->x, src->y, src->z }); + + dst->num_peeps = src->num_peeps; + dst->next_free_seat = src->next_free_seat; + dst->IsCrashedVehicle = src->flags & RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportPeep(dst, src); + + dst->OutsideOfPark = static_cast(src->outside_of_park); + dst->TimeToConsume = src->time_to_consume; + dst->VandalismSeen = src->vandalism_seen; + dst->UmbrellaColour = RCT1::GetColour(src->umbrella_colour); + dst->HatColour = RCT1::GetColour(src->hat_colour); + + // Balloons were always blue in RCT1 without AA/LL + if (_gameVersion == FILE_VERSION_RCT1) + { + dst->BalloonColour = COLOUR_LIGHT_BLUE; + } + else + { + dst->BalloonColour = RCT1::GetColour(src->balloon_colour); + } + dst->Happiness = src->happiness; + dst->HappinessTarget = src->happiness_target; + dst->Nausea = src->nausea; + dst->NauseaTarget = src->nausea_target; + dst->Hunger = src->hunger; + dst->Thirst = src->thirst; + dst->Toilet = src->toilet; + dst->LitterCount = src->litter_count; + dst->DisgustingCount = src->disgusting_count; + dst->Intensity = static_cast(src->intensity); + dst->NauseaTolerance = static_cast(src->nausea_tolerance); + dst->GuestTimeOnRide = src->time_on_ride; + dst->DaysInQueue = src->days_in_queue; + dst->CashInPocket = src->cash_in_pocket; + dst->CashSpent = src->cash_spent; + dst->ParkEntryTime = src->park_entry_time; + dst->GuestNumRides = src->no_of_rides; + dst->AmountOfDrinks = src->no_of_drinks; + dst->AmountOfFood = src->no_of_food; + dst->AmountOfSouvenirs = src->no_of_souvenirs; + dst->PaidToEnter = src->paid_to_enter; + dst->PaidOnRides = src->paid_on_rides; + dst->PaidOnDrink = src->paid_on_drink; + dst->PaidOnFood = src->paid_on_food; + dst->PaidOnSouvenirs = src->paid_on_souvenirs; + dst->VoucherRideId = RCT12RideIdToOpenRCT2RideId(src->voucher_arguments); + dst->VoucherType = src->voucher_type; + dst->SurroundingsThoughtTimeout = src->surroundings_thought_timeout; + dst->Angriness = src->angriness; + dst->TimeLost = src->time_lost; + + OpenRCT2::RideUse::GetHistory().Set(dst->sprite_index, RCT12GetRidesBeenOn(src)); + OpenRCT2::RideUse::GetTypeHistory().Set(dst->sprite_index, RCT12GetRideTypesBeenOn(src)); + + dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->photo1_ride_ref); + + for (size_t i = 0; i < std::size(src->thoughts); i++) + { + auto srcThought = &src->thoughts[i]; + auto dstThought = &dst->Thoughts[i]; + dstThought->type = static_cast(srcThought->type); + dstThought->item = srcThought->item; + dstThought->freshness = srcThought->freshness; + dstThought->fresh_timeout = srcThought->fresh_timeout; + } + + dst->PreviousRide = RCT12RideIdToOpenRCT2RideId(src->previous_ride); + dst->PreviousRideTimeOut = src->previous_ride_time_out; + dst->GuestHeadingToRideId = RCT12RideIdToOpenRCT2RideId(src->guest_heading_to_ride_id); + dst->GuestIsLostCountdown = src->peep_is_lost_countdown; + dst->GuestNextInQueue = src->next_in_queue; + // Guests' favourite ride was only saved in LL. + // Set it to N/A if the save comes from the original or AA. if (_gameVersion == FILE_VERSION_RCT1_LL) { - *count = std::size(_s4.research_items_LL); - return _s4.research_items_LL; + dst->FavouriteRide = RCT12RideIdToOpenRCT2RideId(src->favourite_ride); + dst->FavouriteRideRating = src->favourite_ride_rating; } else { - *count = std::size(_s4.research_items); - return _s4.research_items; + dst->FavouriteRide = RIDE_ID_NULL; + dst->FavouriteRideRating = 0; } - } - std::string GetUserString(rct_string_id stringId) - { - const auto originalString = _s4.string_table[(stringId - USER_STRING_START) % 1024]; - auto originalStringView = std::string_view( - originalString, GetRCT2StringBufferLen(originalString, USER_STRING_MAX_LENGTH)); - auto asUtf8 = rct2_to_utf8(originalStringView, RCT2LanguageId::EnglishUK); - auto justText = RCT12RemoveFormattingUTF8(asUtf8); - return justText.data(); - } + dst->SetItemFlags(src->GetItemFlags()); - void FixLandOwnership() - { - switch (_s4.scenario_slot_index) + if (dst->OutsideOfPark && dst->State != PeepState::LeavingPark) { - case SC_DYNAMITE_DUNES: - FixLandOwnershipTiles({ { 97, 18 }, { 99, 19 }, { 83, 34 } }); - break; - case SC_LEAFY_LAKE: - FixLandOwnershipTiles({ { 49, 66 } }); - break; - case SC_KATIES_DREAMLAND: - FixLandOwnershipTiles({ { 74, 70 }, { 75, 70 }, { 76, 70 }, { 77, 73 }, { 80, 77 } }); - break; - case SC_POKEY_PARK: - FixLandOwnershipTiles({ { 64, 102 } }); - break; - case SC_MYSTIC_MOUNTAIN: - FixLandOwnershipTiles({ { 98, 69 }, { 98, 70 }, { 103, 64 }, { 53, 79 }, { 86, 93 }, { 87, 93 } }); - break; - case SC_PACIFIC_PYRAMIDS: - FixLandOwnershipTiles({ { 93, 105 }, { 63, 34 }, { 76, 25 }, { 85, 31 }, { 96, 47 }, { 96, 48 } }); - break; - case SC_UTOPIA_PARK: - FixLandOwnershipTiles({ { 85, 73 } }); - break; - case SC_URBAN_PARK: - FixLandOwnershipTiles({ { 64, 77 }, { 61, 66 }, { 61, 67 }, { 39, 20 } }); - break; + increment_guests_heading_for_park(); } - } - - /** - * In Urban Park, the entrance and exit of the merry-go-round are the wrong way round. This code fixes that. - * To avoid messing up saves (in which this problem is most likely solved by the user), only carry out this - * fix when loading from a scenario. - */ - void FixUrbanPark() - { - if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) + else { - // First, make the queuing peep exit - for (auto peep : EntityList()) - { - if (peep->State == PeepState::QueuingFront && peep->CurrentRide == 0) - { - peep->RemoveFromQueue(); - peep->SetState(PeepState::Falling); - break; - } - } - - // Now, swap the entrance and exit. - auto ride = get_ride(0); - if (ride != nullptr) - { - auto entranceCoords = ride->stations[0].Exit; - auto exitCoords = ride->stations[0].Entrance; - ride->stations[0].Entrance = entranceCoords; - ride->stations[0].Exit = exitCoords; - - auto entranceElement = map_get_ride_exit_element_at(entranceCoords.ToCoordsXYZD(), false); - entranceElement->SetEntranceType(ENTRANCE_TYPE_RIDE_ENTRANCE); - auto exitElement = map_get_ride_entrance_element_at(exitCoords.ToCoordsXYZD(), false); - exitElement->SetEntranceType(ENTRANCE_TYPE_RIDE_EXIT); - - // Trigger footpath update - footpath_queue_chain_reset(); - footpath_connect_edges( - entranceCoords.ToCoordsXY(), reinterpret_cast(entranceElement), - GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - footpath_update_queue_chains(); - } + increment_guests_in_park(); } } - /** - * Counts the block sections. The reason this iterates over the map is to avoid getting into infinite loops, - * which can happen with hacked parks. - */ - void CountBlockSections() + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - for (int32_t x = 0; x < RCT1_MAX_MAP_SIZE; x++) + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportPeep(dst, src); + dst->AssignedStaffType = StaffType(src->staff_type); + dst->MechanicTimeSinceCall = src->mechanic_time_since_call; + dst->HireDate = src->park_entry_time; + dst->StaffId = src->staff_id; + dst->StaffOrders = src->staff_orders; + dst->StaffMowingTimeout = src->staff_mowing_timeout; + dst->StaffLawnsMown = src->paid_to_enter; + dst->StaffGardensWatered = src->paid_on_rides; + dst->StaffLitterSwept = src->paid_on_food; + dst->StaffBinsEmptied = src->paid_on_souvenirs; + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + + dst->SubType = Litter::Type(src->type); + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + dst->frame = src->frame; + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + dst->MoveDelay = src->move_delay; + dst->NumMovements = src->num_movements; + dst->Value = src->value; + dst->OffsetX = src->offset_x; + dst->Wiggle = src->wiggle; + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + ImportEntityCommonProperties(dst, src); + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + dst->FountainFlags = src->fountain_flags; + dst->Iteration = src->iteration; + dst->NumTicksAlive = src->num_ticks_alive; + dst->frame = src->frame; + dst->FountainType = JumpingFountainType::Water; + } + + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + { + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + // Balloons were always blue in RCT1 without AA/LL + if (_gameVersion == FILE_VERSION_RCT1) { - for (int32_t y = 0; y < RCT1_MAX_MAP_SIZE; y++) - { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - if (tileElement == nullptr) - continue; - do - { - if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) - { - // Lift hill tops are the only pieces present in RCT1 that can count as a block brake. - if (!tileElement->AsTrack()->HasChain()) - continue; - - auto trackType = tileElement->AsTrack()->GetTrackType(); - switch (trackType) - { - case TrackElemType::Up25ToFlat: - case TrackElemType::Up60ToFlat: - case TrackElemType::DiagUp25ToFlat: - case TrackElemType::DiagUp60ToFlat: - break; - default: - continue; - } - - ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); - auto ride = get_ride(rideIndex); - if (ride != nullptr) - { - ride->num_block_brakes++; - } - } - } while (!(tileElement++)->IsLastForTile()); - } + dst->colour = COLOUR_LIGHT_BLUE; + } + else + { + dst->colour = RCT1::GetColour(src->colour); } } - /** - * This has to be done after importing tile elements, because it needs those to detect if a pre-existing ride - * name should be considered reserved. - */ - void SetDefaultNames() + template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { - for (auto& ride : GetRideManager()) - { - if (ride.custom_name.empty()) - { - ride.SetNameToDefault(); - } - } + auto* dst = CreateEntityAt(srcBase.sprite_index); + auto* src = static_cast(&srcBase); + + ImportEntityCommonProperties(dst, src); + dst->frame = src->frame; + dst->state = static_cast(src->state); } - ObjectEntryIndex GetBuildTheBestRideId() + void S4Importer::ImportEntity(const RCT12SpriteBase& src) { - size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); - for (size_t i = 0; i < researchListCount; i++) + switch (GetEntityTypeFromRCT1Sprite(src)) { - if (researchList[i].flags == 0xFF) - { + case EntityType::Vehicle: + ImportEntity(src); + break; + case EntityType::Guest: + ImportEntity(src); + break; + case EntityType::Staff: + ImportEntity(src); + break; + case EntityType::SteamParticle: + ImportEntity(src); + break; + case EntityType::MoneyEffect: + ImportEntity(src); + break; + case EntityType::CrashedVehicleParticle: + ImportEntity(src); + break; + case EntityType::ExplosionCloud: + ImportEntity(src); + break; + case EntityType::ExplosionFlare: + ImportEntity(src); + break; + case EntityType::CrashSplash: + ImportEntity(src); + break; + case EntityType::JumpingFountain: + ImportEntity(src); + break; + case EntityType::Balloon: + ImportEntity(src); + break; + case EntityType::Duck: + ImportEntity(src); + break; + case EntityType::Litter: + ImportEntity(src); + break; + default: + // Null elements do not need imported break; - } - - if (researchList[i].type == RCT1_RESEARCH_TYPE_RIDE) - { - return RCT1::GetRideType(researchList[i].item, 0); - } - } - - return RIDE_TYPE_NULL; - } -}; - -// Very similar but not the same as S6Importer version (due to peeps) -constexpr EntityType GetEntityTypeFromRCT1Sprite(const RCT12SpriteBase& src) -{ - EntityType output = EntityType::Null; - switch (src.sprite_identifier) - { - case RCT12SpriteIdentifier::Vehicle: - output = EntityType::Vehicle; - break; - case RCT12SpriteIdentifier::Peep: - if (RCT12PeepType(static_cast(&src)->type) == RCT12PeepType::Guest) - { - output = EntityType::Guest; - } - else - { - output = EntityType::Staff; - } - break; - case RCT12SpriteIdentifier::Misc: - - switch (RCT12MiscEntityType(src.type)) - { - case RCT12MiscEntityType::SteamParticle: - output = EntityType::SteamParticle; - break; - case RCT12MiscEntityType::MoneyEffect: - output = EntityType::MoneyEffect; - break; - case RCT12MiscEntityType::CrashedVehicleParticle: - output = EntityType::CrashedVehicleParticle; - break; - case RCT12MiscEntityType::ExplosionCloud: - output = EntityType::ExplosionCloud; - break; - case RCT12MiscEntityType::CrashSplash: - output = EntityType::CrashSplash; - break; - case RCT12MiscEntityType::ExplosionFlare: - output = EntityType::ExplosionFlare; - break; - case RCT12MiscEntityType::JumpingFountainWater: - case RCT12MiscEntityType::JumpingFountainSnow: - output = EntityType::JumpingFountain; - break; - case RCT12MiscEntityType::Balloon: - output = EntityType::Balloon; - break; - case RCT12MiscEntityType::Duck: - output = EntityType::Duck; - break; - default: - break; - } - break; - case RCT12SpriteIdentifier::Litter: - output = EntityType::Litter; - break; - default: - break; - } - return output; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - const auto* ride = get_ride(src->ride); - if (ride == nullptr) - return; - - uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); - - dst->ride = src->ride; - dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); - - dst->vehicle_type = vehicleEntryIndex; - dst->SubType = Vehicle::Type(src->type); - dst->var_44 = src->var_44; - dst->remaining_distance = src->remaining_distance; - - // Properties from vehicle entry - dst->sprite_width = src->sprite_width; - dst->sprite_height_negative = src->sprite_height_negative; - dst->sprite_height_positive = src->sprite_height_positive; - dst->sprite_direction = src->sprite_direction; - - dst->sprite_left = src->sprite_left; - dst->sprite_top = src->sprite_top; - dst->sprite_right = src->sprite_right; - dst->sprite_bottom = src->sprite_bottom; - - dst->mass = src->mass; - dst->num_seats = src->num_seats; - dst->speed = src->speed; - dst->powered_acceleration = src->powered_acceleration; - dst->brake_speed = src->brake_speed; - - dst->velocity = src->velocity; - dst->acceleration = src->acceleration; - dst->SwingSprite = src->SwingSprite; - dst->SwingPosition = src->SwingPosition; - dst->SwingSpeed = src->SwingSpeed; - dst->restraints_position = src->restraints_position; - dst->spin_sprite = src->spin_sprite; - dst->sound_vector_factor = src->sound_vector_factor; - dst->spin_speed = src->spin_speed; - dst->sound2_flags = src->sound2_flags; - dst->sound1_id = OpenRCT2::Audio::SoundId::Null; - dst->sound2_id = OpenRCT2::Audio::SoundId::Null; - dst->var_C0 = src->var_C0; - dst->var_C4 = src->var_C4; - dst->animation_frame = src->animation_frame; - dst->animationState = src->animationState; - dst->var_CA = src->var_CA; - dst->var_CE = src->var_CE; - dst->var_D3 = src->var_D3; - dst->scream_sound_id = OpenRCT2::Audio::SoundId::Null; - dst->Pitch = src->Pitch; - dst->bank_rotation = src->bank_rotation; - - // Seat rotation was not in RCT1 - dst->target_seat_rotation = DEFAULT_SEAT_ROTATION; - dst->seat_rotation = DEFAULT_SEAT_ROTATION; - - // Vehicle links (indexes converted later) - dst->prev_vehicle_on_ride = src->prev_vehicle_on_ride; - dst->next_vehicle_on_ride = src->next_vehicle_on_ride; - dst->next_vehicle_on_train = src->next_vehicle_on_train; - - // Guests (indexes converted later) - for (int i = 0; i < 32; i++) - { - uint16_t spriteIndex = src->peep[i]; - dst->peep[i] = spriteIndex; - if (spriteIndex != SPRITE_INDEX_NULL) - { - dst->peep_tshirt_colours[i] = RCT1::GetColour(src->peep_tshirt_colours[i]); } } - - Vehicle::Status statusSrc = Vehicle::Status::MovingToEndOfStation; - if (src->status <= static_cast(Vehicle::Status::StoppedByBlockBrakes)) - { - statusSrc = static_cast(src->status); - } - dst->status = statusSrc; - dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; - dst->TrackLocation = { src->track_x, src->track_y, src->track_z }; - dst->current_station = src->current_station; - if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != Vehicle::Status::TravellingBoat) - { - dst->BoatLocation.setNull(); - dst->SetTrackDirection(src->GetTrackDirection()); - dst->SetTrackType(RCT1TrackTypeToOpenRCT2(src->GetTrackType(), ride->type)); - } - else - { - dst->BoatLocation = TileCoordsXY{ src->boat_location.x, src->boat_location.y }.ToCoordsXY(); - dst->SetTrackDirection(0); - dst->SetTrackType(0); - } - dst->track_progress = src->track_progress; - dst->vertical_drop_countdown = src->vertical_drop_countdown; - dst->sub_state = src->sub_state; - dst->update_flags = src->update_flags; - - SetVehicleColours(dst, src); - - dst->mini_golf_current_animation = MiniGolfAnimation(src->mini_golf_current_animation); - dst->mini_golf_flags = src->mini_golf_flags; - - dst->MoveTo({ src->x, src->y, src->z }); - - dst->num_peeps = src->num_peeps; - dst->next_free_seat = src->next_free_seat; - dst->IsCrashedVehicle = src->flags & RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportPeep(dst, src); - - dst->OutsideOfPark = static_cast(src->outside_of_park); - dst->TimeToConsume = src->time_to_consume; - dst->VandalismSeen = src->vandalism_seen; - dst->UmbrellaColour = RCT1::GetColour(src->umbrella_colour); - dst->HatColour = RCT1::GetColour(src->hat_colour); - - // Balloons were always blue in RCT1 without AA/LL - if (_gameVersion == FILE_VERSION_RCT1) - { - dst->BalloonColour = COLOUR_LIGHT_BLUE; - } - else - { - dst->BalloonColour = RCT1::GetColour(src->balloon_colour); - } - dst->Happiness = src->happiness; - dst->HappinessTarget = src->happiness_target; - dst->Nausea = src->nausea; - dst->NauseaTarget = src->nausea_target; - dst->Hunger = src->hunger; - dst->Thirst = src->thirst; - dst->Toilet = src->toilet; - dst->LitterCount = src->litter_count; - dst->DisgustingCount = src->disgusting_count; - dst->Intensity = static_cast(src->intensity); - dst->NauseaTolerance = static_cast(src->nausea_tolerance); - dst->GuestTimeOnRide = src->time_on_ride; - dst->DaysInQueue = src->days_in_queue; - dst->CashInPocket = src->cash_in_pocket; - dst->CashSpent = src->cash_spent; - dst->ParkEntryTime = src->park_entry_time; - dst->GuestNumRides = src->no_of_rides; - dst->AmountOfDrinks = src->no_of_drinks; - dst->AmountOfFood = src->no_of_food; - dst->AmountOfSouvenirs = src->no_of_souvenirs; - dst->PaidToEnter = src->paid_to_enter; - dst->PaidOnRides = src->paid_on_rides; - dst->PaidOnDrink = src->paid_on_drink; - dst->PaidOnFood = src->paid_on_food; - dst->PaidOnSouvenirs = src->paid_on_souvenirs; - dst->VoucherRideId = RCT12RideIdToOpenRCT2RideId(src->voucher_arguments); - dst->VoucherType = src->voucher_type; - dst->SurroundingsThoughtTimeout = src->surroundings_thought_timeout; - dst->Angriness = src->angriness; - dst->TimeLost = src->time_lost; - - OpenRCT2::RideUse::GetHistory().Set(dst->sprite_index, RCT12GetRidesBeenOn(src)); - OpenRCT2::RideUse::GetTypeHistory().Set(dst->sprite_index, RCT12GetRideTypesBeenOn(src)); - - dst->Photo1RideRef = RCT12RideIdToOpenRCT2RideId(src->photo1_ride_ref); - - for (size_t i = 0; i < std::size(src->thoughts); i++) - { - auto srcThought = &src->thoughts[i]; - auto dstThought = &dst->Thoughts[i]; - dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; - dstThought->freshness = srcThought->freshness; - dstThought->fresh_timeout = srcThought->fresh_timeout; - } - - dst->PreviousRide = RCT12RideIdToOpenRCT2RideId(src->previous_ride); - dst->PreviousRideTimeOut = src->previous_ride_time_out; - dst->GuestHeadingToRideId = RCT12RideIdToOpenRCT2RideId(src->guest_heading_to_ride_id); - dst->GuestIsLostCountdown = src->peep_is_lost_countdown; - dst->GuestNextInQueue = src->next_in_queue; - // Guests' favourite ride was only saved in LL. - // Set it to N/A if the save comes from the original or AA. - if (_gameVersion == FILE_VERSION_RCT1_LL) - { - dst->FavouriteRide = RCT12RideIdToOpenRCT2RideId(src->favourite_ride); - dst->FavouriteRideRating = src->favourite_ride_rating; - } - else - { - dst->FavouriteRide = RIDE_ID_NULL; - dst->FavouriteRideRating = 0; - } - - dst->SetItemFlags(src->GetItemFlags()); - - if (dst->OutsideOfPark && dst->State != PeepState::LeavingPark) - { - increment_guests_heading_for_park(); - } - else - { - increment_guests_in_park(); - } -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportPeep(dst, src); - dst->AssignedStaffType = StaffType(src->staff_type); - dst->MechanicTimeSinceCall = src->mechanic_time_since_call; - dst->HireDate = src->park_entry_time; - dst->StaffId = src->staff_id; - dst->StaffOrders = src->staff_orders; - dst->StaffMowingTimeout = src->staff_mowing_timeout; - dst->StaffLawnsMown = src->paid_to_enter; - dst->StaffGardensWatered = src->paid_on_rides; - dst->StaffLitterSwept = src->paid_on_food; - dst->StaffBinsEmptied = src->paid_on_souvenirs; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportEntityCommonProperties(dst, src); - - dst->SubType = Litter::Type(src->type); -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - - ImportEntityCommonProperties(dst, src); - dst->frame = src->frame; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - - ImportEntityCommonProperties(dst, src); - dst->MoveDelay = src->move_delay; - dst->NumMovements = src->num_movements; - dst->Value = src->value; - dst->OffsetX = src->offset_x; - dst->Wiggle = src->wiggle; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportEntityCommonProperties(dst, src); -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportEntityCommonProperties(dst, src); -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportEntityCommonProperties(dst, src); -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - ImportEntityCommonProperties(dst, src); -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - - ImportEntityCommonProperties(dst, src); - dst->FountainFlags = src->fountain_flags; - dst->Iteration = src->iteration; - dst->NumTicksAlive = src->num_ticks_alive; - dst->frame = src->frame; - dst->FountainType = JumpingFountainType::Water; -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - - ImportEntityCommonProperties(dst, src); - // Balloons were always blue in RCT1 without AA/LL - if (_gameVersion == FILE_VERSION_RCT1) - { - dst->colour = COLOUR_LIGHT_BLUE; - } - else - { - dst->colour = RCT1::GetColour(src->colour); - } -} - -template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) -{ - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); - - ImportEntityCommonProperties(dst, src); - dst->frame = src->frame; - dst->state = static_cast(src->state); -} - -void S4Importer::ImportEntity(const RCT12SpriteBase& src) -{ - switch (GetEntityTypeFromRCT1Sprite(src)) - { - case EntityType::Vehicle: - ImportEntity(src); - break; - case EntityType::Guest: - ImportEntity(src); - break; - case EntityType::Staff: - ImportEntity(src); - break; - case EntityType::SteamParticle: - ImportEntity(src); - break; - case EntityType::MoneyEffect: - ImportEntity(src); - break; - case EntityType::CrashedVehicleParticle: - ImportEntity(src); - break; - case EntityType::ExplosionCloud: - ImportEntity(src); - break; - case EntityType::ExplosionFlare: - ImportEntity(src); - break; - case EntityType::CrashSplash: - ImportEntity(src); - break; - case EntityType::JumpingFountain: - ImportEntity(src); - break; - case EntityType::Balloon: - ImportEntity(src); - break; - case EntityType::Duck: - ImportEntity(src); - break; - case EntityType::Litter: - ImportEntity(src); - break; - default: - // Null elements do not need imported - break; - } -} +} // namespace RCT1 std::unique_ptr ParkImporter::CreateS4() { - return std::make_unique(); + return std::make_unique(); } void load_from_sv4(const utf8* path) { auto& objectMgr = GetContext()->GetObjectManager(); - auto s4Importer = std::make_unique(); + auto s4Importer = std::make_unique(); auto result = s4Importer->LoadSavedGame(path); objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); s4Importer->Import(); @@ -3060,7 +3067,7 @@ void load_from_sv4(const utf8* path) void load_from_sc4(const utf8* path) { auto& objectMgr = GetContext()->GetObjectManager(); - auto s4Importer = std::make_unique(); + auto s4Importer = std::make_unique(); auto result = s4Importer->LoadScenario(path); objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); s4Importer->Import(); diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index dc11084497..d704c09083 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -22,274 +22,278 @@ #include "../ride/TrackDesign.h" #include "../ride/TrackDesignRepository.h" -/** - * Class to import RollerCoaster Tycoon 1 track designs (*.TD4). - */ -class TD4Importer final : public ITrackImporter +namespace RCT1 { -private: - OpenRCT2::MemoryStream _stream; - std::string _name; - -public: - TD4Importer() + /** + * Class to import RollerCoaster Tycoon 1 track designs (*.TD4). + */ + class TD4Importer final : public ITrackImporter { - } + private: + OpenRCT2::MemoryStream _stream; + std::string _name; - bool Load(const utf8* path) override - { - const utf8* extension = Path::GetExtension(path); - if (String::Equals(extension, ".td4", true)) + public: + TD4Importer() { - _name = GetNameFromTrackPath(path); - auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); - return LoadFromStream(&fs); - } - else - { - throw std::runtime_error("Invalid RCT1 track extension."); - } - } - - bool LoadFromStream(OpenRCT2::IStream* stream) override - { - auto checksumType = SawyerEncoding::ValidateTrackChecksum(stream); - if (!gConfigGeneral.allow_loading_with_incorrect_checksum && checksumType == RCT12TrackDesignVersion::unknown) - { - throw IOException("Invalid checksum."); } - auto chunkReader = SawyerChunkReader(stream); - auto data = chunkReader.ReadChunkTrack(); - _stream.WriteArray(reinterpret_cast(data->GetData()), data->GetLength()); - _stream.SetPosition(0); - return true; - } - - std::unique_ptr Import() override - { - std::unique_ptr td = std::make_unique(); - - _stream.SetPosition(7); - RCT12TrackDesignVersion version = static_cast(_stream.ReadValue() >> 2); - - if (version != RCT12TrackDesignVersion::TD4 && version != RCT12TrackDesignVersion::TD4_AA) + bool Load(const utf8* path) override { - throw IOException("Version number incorrect."); - } - _stream.SetPosition(0); - - if (version == RCT12TrackDesignVersion::TD4_AA) - { - return ImportAA(); - } - else - { - return ImportTD4(); - } - } - -private: - std::unique_ptr ImportAA() - { - std::unique_ptr td = std::make_unique(); - rct_track_td4_aa td4aa{}; - _stream.Read(&td4aa, sizeof(rct_track_td4_aa)); - - for (int32_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) - { - td->track_spine_colour[i] = RCT1::GetColour(td4aa.track_spine_colour[i]); - td->track_rail_colour[i] = RCT1::GetColour(td4aa.track_rail_colour[i]); - td->track_support_colour[i] = RCT1::GetColour(td4aa.track_support_colour[i]); - } - - td->flags2 = td4aa.flags2; - - return ImportTD4Base(std::move(td), td4aa); - } - - std::unique_ptr ImportTD4() - { - std::unique_ptr td = std::make_unique(); - rct_track_td4 td4{}; - _stream.Read(&td4, sizeof(rct_track_td4)); - for (int32_t i = 0; i < NUM_COLOUR_SCHEMES; i++) - { - td->track_spine_colour[i] = RCT1::GetColour(td4.track_spine_colour_v0); - td->track_rail_colour[i] = RCT1::GetColour(td4.track_rail_colour_v0); - td->track_support_colour[i] = RCT1::GetColour(td4.track_support_colour_v0); - - // Mazes were only hedges - switch (td4.type) + const utf8* extension = Path::GetExtension(path); + if (String::Equals(extension, ".td4", true)) { - case RCT1_RIDE_TYPE_HEDGE_MAZE: - td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; - break; - case RCT1_RIDE_TYPE_RIVER_RAPIDS: - td->track_spine_colour[i] = COLOUR_WHITE; - td->track_rail_colour[i] = COLOUR_WHITE; - break; - } - } - td->flags2 = 0; - return ImportTD4Base(std::move(td), td4); - } - - std::unique_ptr ImportTD4Base(std::unique_ptr td, rct_track_td4& td4Base) - { - td->type = RCT1::GetRideType(td4Base.type, td4Base.vehicle_type); - - // All TD4s that use powered launch use the type that doesn't pass the station. - td->ride_mode = static_cast(td4Base.mode); - if (td4Base.mode == RCT1_RIDE_MODE_POWERED_LAUNCH) - { - td->ride_mode = RideMode::PoweredLaunch; - } - - // Convert RCT1 vehicle type to RCT2 vehicle type. Initialise with a string consisting of 8 spaces. - rct_object_entry vehicleObject = { 0x80, " " }; - if (td4Base.type == RIDE_TYPE_MAZE) - { - const char* vehObjName = RCT1::GetRideTypeObject(td4Base.type); - assert(vehObjName != nullptr); - std::memcpy(vehicleObject.name, vehObjName, std::min(String::SizeOf(vehObjName), static_cast(8))); - } - else - { - const char* vehObjName = RCT1::GetVehicleObject(td4Base.vehicle_type); - assert(vehObjName != nullptr); - std::memcpy(vehicleObject.name, vehObjName, std::min(String::SizeOf(vehObjName), static_cast(8))); - } - std::memcpy(&td->vehicle_object, &vehicleObject, sizeof(rct_object_entry)); - td->vehicle_type = td4Base.vehicle_type; - - td->flags = td4Base.flags; - td->colour_scheme = td4Base.version_and_colour_scheme & 0x3; - - // Vehicle colours - for (int32_t i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) - { - // RCT1 had no third colour - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( - td4Base.vehicle_type); - if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) - { - td->vehicle_colours[i].body_colour = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); - } - else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) - { - td->vehicle_colours[i].body_colour = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); + _name = GetNameFromTrackPath(path); + auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); + return LoadFromStream(&fs); } else { - td->vehicle_colours[i].body_colour = colourSchemeCopyDescriptor.colour1; + throw std::runtime_error("Invalid RCT1 track extension."); + } + } + + bool LoadFromStream(OpenRCT2::IStream* stream) override + { + auto checksumType = SawyerEncoding::ValidateTrackChecksum(stream); + if (!gConfigGeneral.allow_loading_with_incorrect_checksum && checksumType == RCT12TrackDesignVersion::unknown) + { + throw IOException("Invalid checksum."); } - if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) + auto chunkReader = SawyerChunkReader(stream); + auto data = chunkReader.ReadChunkTrack(); + _stream.WriteArray(reinterpret_cast(data->GetData()), data->GetLength()); + _stream.SetPosition(0); + return true; + } + + std::unique_ptr Import() override + { + std::unique_ptr td = std::make_unique(); + + _stream.SetPosition(7); + RCT12TrackDesignVersion version = static_cast(_stream.ReadValue() >> 2); + + if (version != RCT12TrackDesignVersion::TD4 && version != RCT12TrackDesignVersion::TD4_AA) { - td->vehicle_colours[i].trim_colour = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); + throw IOException("Version number incorrect."); } - else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) + _stream.SetPosition(0); + + if (version == RCT12TrackDesignVersion::TD4_AA) { - td->vehicle_colours[i].trim_colour = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); + return ImportAA(); } else { - td->vehicle_colours[i].trim_colour = colourSchemeCopyDescriptor.colour2; - } - - if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) - { - td->vehicle_additional_colour[i] = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); - } - else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) - { - td->vehicle_additional_colour[i] = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); - } - else - { - td->vehicle_additional_colour[i] = colourSchemeCopyDescriptor.colour3; + return ImportTD4(); } } - // Set remaining vehicles to same colour as first vehicle - for (size_t i = RCT1_MAX_TRAINS_PER_RIDE; i < std::size(td->vehicle_colours); i++) - { - td->vehicle_colours[i] = td->vehicle_colours[0]; - td->vehicle_additional_colour[i] = td->vehicle_additional_colour[0]; - } - td->depart_flags = td4Base.depart_flags; - td->number_of_trains = td4Base.number_of_trains; - td->number_of_cars_per_train = td4Base.number_of_cars_per_train; - td->min_waiting_time = td4Base.min_waiting_time; - td->max_waiting_time = td4Base.max_waiting_time; - td->operation_setting = std::min(td4Base.operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue); - td->max_speed = td4Base.max_speed; - td->average_speed = td4Base.average_speed; - td->ride_length = td4Base.ride_length; - td->max_positive_vertical_g = td4Base.max_positive_vertical_g; - td->max_negative_vertical_g = td4Base.max_negative_vertical_g; - td->max_lateral_g = td4Base.max_lateral_g; - - if (td->type == RIDE_TYPE_MINI_GOLF) + private: + std::unique_ptr ImportAA() { - td->holes = td4Base.num_holes; - } - else - { - td->inversions = td4Base.num_inversions; - } + std::unique_ptr td = std::make_unique(); + rct_track_td4_aa td4aa{}; + _stream.Read(&td4aa, sizeof(rct_track_td4_aa)); - td->drops = td4Base.num_drops; - td->highest_drop_height = td4Base.highest_drop_height / 2; - td->excitement = td4Base.excitement; - td->intensity = td4Base.intensity; - td->nausea = td4Base.nausea; - td->upkeep_cost = td4Base.upkeep_cost; - td->space_required_x = 255; - td->space_required_y = 255; - td->lift_hill_speed = 5; - td->num_circuits = 0; - td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue); - - if (td->type == RIDE_TYPE_MAZE) - { - rct_td46_maze_element t4MazeElement{}; - t4MazeElement.all = !0; - while (t4MazeElement.all != 0) + for (int32_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) { - _stream.Read(&t4MazeElement, sizeof(rct_td46_maze_element)); - if (t4MazeElement.all != 0) + td->track_spine_colour[i] = RCT1::GetColour(td4aa.track_spine_colour[i]); + td->track_rail_colour[i] = RCT1::GetColour(td4aa.track_rail_colour[i]); + td->track_support_colour[i] = RCT1::GetColour(td4aa.track_support_colour[i]); + } + + td->flags2 = td4aa.flags2; + + return ImportTD4Base(std::move(td), td4aa); + } + + std::unique_ptr ImportTD4() + { + std::unique_ptr td = std::make_unique(); + rct_track_td4 td4{}; + _stream.Read(&td4, sizeof(rct_track_td4)); + for (int32_t i = 0; i < NUM_COLOUR_SCHEMES; i++) + { + td->track_spine_colour[i] = RCT1::GetColour(td4.track_spine_colour_v0); + td->track_rail_colour[i] = RCT1::GetColour(td4.track_rail_colour_v0); + td->track_support_colour[i] = RCT1::GetColour(td4.track_support_colour_v0); + + // Mazes were only hedges + switch (td4.type) { - TrackDesignMazeElement mazeElement{}; - mazeElement.x = t4MazeElement.x; - mazeElement.y = t4MazeElement.y; - mazeElement.direction = t4MazeElement.direction; - mazeElement.type = t4MazeElement.type; - td->maze_elements.push_back(mazeElement); + case RCT1_RIDE_TYPE_HEDGE_MAZE: + td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; + break; + case RCT1_RIDE_TYPE_RIVER_RAPIDS: + td->track_spine_colour[i] = COLOUR_WHITE; + td->track_rail_colour[i] = COLOUR_WHITE; + break; } } - } - else - { - rct_td46_track_element t4TrackElement{}; - for (uint8_t endFlag = _stream.ReadValue(); endFlag != 0xFF; endFlag = _stream.ReadValue()) - { - _stream.SetPosition(_stream.GetPosition() - 1); - _stream.Read(&t4TrackElement, sizeof(rct_td46_track_element)); - TrackDesignTrackElement trackElement{}; - trackElement.type = RCT1TrackTypeToOpenRCT2(t4TrackElement.type, td->type); - trackElement.flags = t4TrackElement.flags; - td->track_elements.push_back(trackElement); - } + td->flags2 = 0; + return ImportTD4Base(std::move(td), td4); } - td->name = _name; - return td; - } -}; + std::unique_ptr ImportTD4Base(std::unique_ptr td, rct_track_td4& td4Base) + { + td->type = RCT1::GetRideType(td4Base.type, td4Base.vehicle_type); + + // All TD4s that use powered launch use the type that doesn't pass the station. + td->ride_mode = static_cast(td4Base.mode); + if (td4Base.mode == RCT1_RIDE_MODE_POWERED_LAUNCH) + { + td->ride_mode = RideMode::PoweredLaunch; + } + + // Convert RCT1 vehicle type to RCT2 vehicle type. Initialise with a string consisting of 8 spaces. + rct_object_entry vehicleObject = { 0x80, " " }; + if (td4Base.type == RIDE_TYPE_MAZE) + { + const char* vehObjName = RCT1::GetRideTypeObject(td4Base.type); + assert(vehObjName != nullptr); + std::memcpy(vehicleObject.name, vehObjName, std::min(String::SizeOf(vehObjName), static_cast(8))); + } + else + { + const char* vehObjName = RCT1::GetVehicleObject(td4Base.vehicle_type); + assert(vehObjName != nullptr); + std::memcpy(vehicleObject.name, vehObjName, std::min(String::SizeOf(vehObjName), static_cast(8))); + } + std::memcpy(&td->vehicle_object, &vehicleObject, sizeof(rct_object_entry)); + td->vehicle_type = td4Base.vehicle_type; + + td->flags = td4Base.flags; + td->colour_scheme = td4Base.version_and_colour_scheme & 0x3; + + // Vehicle colours + for (int32_t i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) + { + // RCT1 had no third colour + RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( + td4Base.vehicle_type); + if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) + { + td->vehicle_colours[i].body_colour = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); + } + else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2) + { + td->vehicle_colours[i].body_colour = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); + } + else + { + td->vehicle_colours[i].body_colour = colourSchemeCopyDescriptor.colour1; + } + + if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1) + { + td->vehicle_colours[i].trim_colour = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); + } + else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2) + { + td->vehicle_colours[i].trim_colour = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); + } + else + { + td->vehicle_colours[i].trim_colour = colourSchemeCopyDescriptor.colour2; + } + + if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1) + { + td->vehicle_additional_colour[i] = RCT1::GetColour(td4Base.vehicle_colours[i].body_colour); + } + else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2) + { + td->vehicle_additional_colour[i] = RCT1::GetColour(td4Base.vehicle_colours[i].trim_colour); + } + else + { + td->vehicle_additional_colour[i] = colourSchemeCopyDescriptor.colour3; + } + } + // Set remaining vehicles to same colour as first vehicle + for (size_t i = RCT1_MAX_TRAINS_PER_RIDE; i < std::size(td->vehicle_colours); i++) + { + td->vehicle_colours[i] = td->vehicle_colours[0]; + td->vehicle_additional_colour[i] = td->vehicle_additional_colour[0]; + } + + td->depart_flags = td4Base.depart_flags; + td->number_of_trains = td4Base.number_of_trains; + td->number_of_cars_per_train = td4Base.number_of_cars_per_train; + td->min_waiting_time = td4Base.min_waiting_time; + td->max_waiting_time = td4Base.max_waiting_time; + td->operation_setting = std::min( + td4Base.operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue); + td->max_speed = td4Base.max_speed; + td->average_speed = td4Base.average_speed; + td->ride_length = td4Base.ride_length; + td->max_positive_vertical_g = td4Base.max_positive_vertical_g; + td->max_negative_vertical_g = td4Base.max_negative_vertical_g; + td->max_lateral_g = td4Base.max_lateral_g; + + if (td->type == RIDE_TYPE_MINI_GOLF) + { + td->holes = td4Base.num_holes; + } + else + { + td->inversions = td4Base.num_inversions; + } + + td->drops = td4Base.num_drops; + td->highest_drop_height = td4Base.highest_drop_height / 2; + td->excitement = td4Base.excitement; + td->intensity = td4Base.intensity; + td->nausea = td4Base.nausea; + td->upkeep_cost = td4Base.upkeep_cost; + td->space_required_x = 255; + td->space_required_y = 255; + td->lift_hill_speed = 5; + td->num_circuits = 0; + td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue); + + if (td->type == RIDE_TYPE_MAZE) + { + rct_td46_maze_element t4MazeElement{}; + t4MazeElement.all = !0; + while (t4MazeElement.all != 0) + { + _stream.Read(&t4MazeElement, sizeof(rct_td46_maze_element)); + if (t4MazeElement.all != 0) + { + TrackDesignMazeElement mazeElement{}; + mazeElement.x = t4MazeElement.x; + mazeElement.y = t4MazeElement.y; + mazeElement.direction = t4MazeElement.direction; + mazeElement.type = t4MazeElement.type; + td->maze_elements.push_back(mazeElement); + } + } + } + else + { + rct_td46_track_element t4TrackElement{}; + for (uint8_t endFlag = _stream.ReadValue(); endFlag != 0xFF; endFlag = _stream.ReadValue()) + { + _stream.SetPosition(_stream.GetPosition() - 1); + _stream.Read(&t4TrackElement, sizeof(rct_td46_track_element)); + TrackDesignTrackElement trackElement{}; + trackElement.type = RCT1TrackTypeToOpenRCT2(t4TrackElement.type, td->type); + trackElement.flags = t4TrackElement.flags; + td->track_elements.push_back(trackElement); + } + } + + td->name = _name; + return td; + } + }; +} // namespace RCT1 std::unique_ptr TrackImporter::CreateTD4() { - return std::make_unique(); + return std::make_unique(); } diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 586834a7c9..4fd6c5f436 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -1396,13 +1396,13 @@ namespace RCT1 }; return map[sceneryType]; } + // clang-format on + + track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType) + { + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + return RCT12FlatTrackTypeToOpenRCT2(origTrackType); + + return origTrackType; + } } // namespace RCT1 - -track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType) -{ - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) - return RCT12FlatTrackTypeToOpenRCT2(origTrackType); - - return origTrackType; -} -// clang-format on diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 991e0ef714..64d72de1cd 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -1089,7 +1089,7 @@ enum SPR_G2_END = SPR_G2_SINGLE_RAIL_END, SPR_CSG_BEGIN = SPR_G2_END, - SPR_CSG_END = SPR_CSG_BEGIN + RCT1_NUM_LL_CSG_ENTRIES, + SPR_CSG_END = SPR_CSG_BEGIN + RCT1::RCT1_NUM_LL_CSG_ENTRIES, SPR_SCROLLING_TEXT_START = SPR_CSG_END, SPR_SCROLLING_TEXT_END = SPR_SCROLLING_TEXT_START + OpenRCT2::MaxScrollingTextEntries, From cdf1c3b1b81d49bd76f5a43ebb56141d2b20f1c2 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 26 Aug 2021 12:44:26 +0100 Subject: [PATCH 231/681] Move s6 into rct2 header --- src/openrct2/rct2/RCT2.h | 251 +++++++++++++++++++++++++++++ src/openrct2/rct2/S6Exporter.cpp | 96 +++++++++++ src/openrct2/scenario/Scenario.cpp | 96 ----------- src/openrct2/scenario/Scenario.h | 249 ---------------------------- 4 files changed, 347 insertions(+), 345 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 85b4999605..14becf9d7d 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -15,6 +15,7 @@ #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" #include "../ride/VehicleColour.h" +#include "../world/EntityList.h" #include @@ -37,6 +38,8 @@ constexpr const uint8_t RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS = 8; // With 32 bit constexpr const uint8_t RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS = 56; constexpr const uint16_t RCT2_MAX_RESEARCHED_SCENERY_ITEMS = (RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS * 32); // There are 32 bits // per quad. +constexpr const uint16_t RCT2_MAX_RESEARCH_ITEMS = 500; + constexpr uint16_t TD6MaxTrackElements = 8192; constexpr const uint8_t RCT2_MAX_SMALL_SCENERY_OBJECTS = 252; @@ -786,6 +789,254 @@ struct RCT2RideRatingCalculationData }; assert_struct_size(RCT2RideRatingCalculationData, 76); +/** + * SV6/SC6 header chunk + * size: 0x20 + */ +struct rct_s6_header +{ + uint8_t type; // 0x00 + uint8_t classic_flag; // 0x01 + uint16_t num_packed_objects; // 0x02 + uint32_t version; // 0x04 + uint32_t magic_number; // 0x08 + uint8_t pad_0C[0x14]; +}; +assert_struct_size(rct_s6_header, 0x20); + +enum class EditorStep : uint8_t; + +/** + * SC6 information chunk + * size: 0x198 + */ +struct rct_s6_info +{ + EditorStep editor_step; + uint8_t category; // 0x01 + uint8_t objective_type; // 0x02 + uint8_t objective_arg_1; // 0x03 + int32_t objective_arg_2; // 0x04 + int16_t objective_arg_3; // 0x08 + uint8_t pad_00A[0x3E]; + char name[64]; // 0x48 + char details[256]; // 0x88 + rct_object_entry entry; // 0x188 +}; +assert_struct_size(rct_s6_info, 0x198); + +struct rct_s6_data +{ + // SC6[0] + rct_s6_header header; + + // SC6[1] + rct_s6_info info; + + // SC6[2] + // packed objects + + // SC6[3] + rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT]; + + // SC6[4] + uint16_t elapsed_months; + uint16_t current_day; + uint32_t scenario_ticks; + uint32_t scenario_srand_0; + uint32_t scenario_srand_1; + + // SC6[5] + RCT12TileElement tile_elements[RCT2_MAX_TILE_ELEMENTS]; + + // SC6[6] + uint32_t next_free_tile_element_pointer_index; + RCT2Sprite sprites[RCT2_MAX_SPRITES]; + uint16_t sprite_lists_head[static_cast(EntityListId::Count)]; + uint16_t sprite_lists_count[static_cast(EntityListId::Count)]; + rct_string_id park_name; + uint8_t pad_013573D6[2]; + uint32_t park_name_args; + money32 initial_cash; + money32 current_loan; + uint32_t park_flags; + money16 park_entrance_fee; + uint16_t rct1_park_entrance_x; + uint16_t rct1_park_entrance_y; + uint8_t pad_013573EE[2]; + uint8_t rct1_park_entrance_z; + uint8_t pad_013573F1; + rct12_peep_spawn peep_spawns[RCT12_MAX_PEEP_SPAWNS]; + uint8_t guest_count_change_modifier; + uint8_t current_research_level; + uint8_t pad_01357400[4]; + uint32_t researched_ride_types[RCT2_MAX_RESEARCHED_RIDE_TYPE_QUADS]; + uint32_t researched_ride_entries[RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS]; + uint32_t researched_track_types_a[128]; + uint32_t researched_track_types_b[128]; + + // SC6[7] + uint16_t guests_in_park; + uint16_t guests_heading_for_park; + + // Ignored in scenario + money32 expenditure_table[RCT12_EXPENDITURE_TABLE_MONTH_COUNT][RCT12_EXPENDITURE_TYPE_COUNT]; + + // SC6[8] + uint16_t last_guests_in_park; + uint8_t pad_01357BCA[3]; + uint8_t handyman_colour; + uint8_t mechanic_colour; + uint8_t security_colour; + + // Ignored in scenario + uint32_t researched_scenery_items[RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS]; + + // SC6[9] + uint16_t park_rating; + + // Ignored in scenario + uint8_t park_rating_history[32]; + uint8_t guests_in_park_history[32]; + + // SC6[10] + uint8_t active_research_types; + uint8_t research_progress_stage; + uint32_t last_researched_item_subject; + uint8_t pad_01357CF8[1000]; + uint32_t next_research_item; + uint16_t research_progress; + uint8_t next_research_category; + uint8_t next_research_expected_day; + uint8_t next_research_expected_month; + uint8_t guest_initial_happiness; + uint16_t park_size; + uint16_t guest_generation_probability; + uint16_t total_ride_value_for_money; + money32 maximum_loan; + money16 guest_initial_cash; + uint8_t guest_initial_hunger; + uint8_t guest_initial_thirst; + uint8_t objective_type; + uint8_t objective_year; + uint8_t pad_013580FA[2]; + money32 objective_currency; + uint16_t objective_guests; + uint8_t campaign_weeks_left[20]; + uint8_t campaign_ride_index[22]; + + // Ignored in scenario + money32 balance_history[RCT12_FINANCE_GRAPH_SIZE]; + + // SC6[11] + money32 current_expenditure; + money32 current_profit; + money32 weekly_profit_average_dividend; + uint16_t weekly_profit_average_divisor; + uint8_t pad_0135833A[2]; + + // Ignored in scenario + money32 weekly_profit_history[RCT12_FINANCE_GRAPH_SIZE]; + + // SC6[12] + money32 park_value; + + // Ignored in scenario + money32 park_value_history[RCT12_FINANCE_GRAPH_SIZE]; + + // SC6[13] + money32 completed_company_value; + uint32_t total_admissions; + money32 income_from_admissions; + money32 company_value; + uint8_t peep_warning_throttle[16]; + rct12_award awards[RCT12_MAX_AWARDS]; + money16 land_price; + money16 construction_rights_price; + uint16_t word_01358774; + uint8_t pad_01358776[2]; + uint32_t cd_key; + uint8_t pad_0135877C[64]; + uint32_t game_version_number; + money32 completed_company_value_record; + uint32_t loan_hash; + uint16_t ride_count; + uint8_t pad_013587CA[6]; + money32 historical_profit; + uint8_t pad_013587D4[4]; + char scenario_completed_name[32]; + money32 cash; + uint8_t pad_013587FC[50]; + uint16_t park_rating_casualty_penalty; + uint16_t map_size_units; + uint16_t map_size_minus_2; + uint16_t map_size; + uint16_t map_max_xy; + uint32_t same_price_throughout; + uint16_t suggested_max_guests; + uint16_t park_rating_warning_days; + uint8_t last_entrance_style; + uint8_t rct1_water_colour; + uint8_t pad_01358842[2]; + RCT12ResearchItem research_items[RCT2_MAX_RESEARCH_ITEMS]; + uint16_t map_base_z; + char scenario_name[64]; + char scenario_description[256]; + uint8_t current_interest_rate; + uint8_t pad_0135934B; + uint32_t same_price_throughout_extended; + int16_t park_entrance_x[RCT12_MAX_PARK_ENTRANCES]; + int16_t park_entrance_y[RCT12_MAX_PARK_ENTRANCES]; + int16_t park_entrance_z[RCT12_MAX_PARK_ENTRANCES]; + uint8_t park_entrance_direction[RCT12_MAX_PARK_ENTRANCES]; + char scenario_filename[256]; + uint8_t saved_expansion_pack_names[3256]; + RCT12Banner banners[RCT2_MAX_BANNERS_IN_PARK]; + char custom_strings[RCT12_MAX_USER_STRINGS][RCT12_USER_STRING_MAX_LENGTH]; + uint32_t game_ticks_1; + rct2_ride rides[RCT12_MAX_RIDES_IN_PARK]; + uint16_t saved_age; + int16_t saved_view_x; + int16_t saved_view_y; + uint8_t saved_view_zoom; + uint8_t saved_view_rotation; + RCT12MapAnimation map_animations[RCT2_MAX_ANIMATED_OBJECTS]; + uint16_t num_map_animations; + uint8_t pad_0138B582[2]; + RCT2RideRatingCalculationData ride_ratings_calc_data; + uint8_t pad_0138B5D0[60]; + RCT12RideMeasurement ride_measurements[8]; + uint32_t next_guest_index; + uint16_t grass_and_scenery_tilepos; + uint32_t patrol_areas[(RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT) * RCT12_PATROL_AREA_SIZE]; + uint8_t staff_modes[RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT]; + uint8_t pad_13CA73E; + uint8_t pad_13CA73F; + uint8_t byte_13CA740; + uint8_t pad_13CA741; + uint8_t byte_13CA742[4]; // unused + uint8_t climate; + uint8_t pad_013CA747; + uint16_t climate_update_timer; + uint8_t current_weather; + uint8_t next_weather; + uint8_t temperature; + uint8_t next_temperature; + uint8_t current_weather_effect; + uint8_t next_weather_effect; + uint8_t current_weather_gloom; + uint8_t next_weather_gloom; + uint8_t current_weather_level; + uint8_t next_weather_level; + rct12_news_item news_items[RCT12_MAX_NEWS_ITEMS]; + char rct1_scenario_name[62]; // Unused in RCT2 + uint16_t rct1_scenario_slot_index; // Unused in RCT2 + uint32_t rct1_scenario_flags; // Unused in RCT2 + uint16_t wide_path_tile_loop_x; + uint16_t wide_path_tile_loop_y; + uint8_t pad_13CE778[434]; +}; +assert_struct_size(rct_s6_data, 0x46b44a); #pragma pack(pop) std::vector DecryptSea(const fs::path& path); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 0639cde023..0f3dbd1aef 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -159,6 +159,102 @@ void S6Exporter::Save(OpenRCT2::IStream* stream, bool isScenario) stream->WriteValue(checksum); } +static void ride_all_has_any_track_elements(std::array& rideIndexArray) +{ + tile_element_iterator it; + tile_element_iterator_begin(&it); + while (tile_element_iterator_next(&it)) + { + if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + if (it.element->IsGhost()) + continue; + + rideIndexArray[it.element->AsTrack()->GetRideIndex()] = true; + } +} + +static void scenario_remove_trackless_rides(rct_s6_data* s6) +{ + std::array rideHasTrack{}; + ride_all_has_any_track_elements(rideHasTrack); + for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + { + auto ride = &s6->rides[i]; + if (rideHasTrack[i] || ride->type == RIDE_TYPE_NULL) + { + continue; + } + + ride->type = RIDE_TYPE_NULL; + if (is_user_string_id(ride->name)) + { + s6->custom_strings[(ride->name % RCT12_MAX_USER_STRINGS)][0] = 0; + } + } +} + +/** + * Modifies the given S6 data so that ghost elements, rides with no track elements or unused banners / user strings are saved. + */ +static void scenario_fix_ghosts(rct_s6_data* s6) +{ + // Build tile pointer cache (needed to get the first element at a certain location) + RCT12TileElement* tilePointers[MAX_TILE_TILE_ELEMENT_POINTERS]; + for (size_t i = 0; i < MAX_TILE_TILE_ELEMENT_POINTERS; i++) + { + tilePointers[i] = TILE_UNDEFINED_TILE_ELEMENT; + } + + RCT12TileElement* tileElement = s6->tile_elements; + RCT12TileElement** tile = tilePointers; + for (size_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + { + for (size_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + { + *tile++ = tileElement; + while (!(tileElement++)->IsLastForTile()) + ; + } + } + + // Remove all ghost elements + RCT12TileElement* destinationElement = s6->tile_elements; + + for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + { + for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + { + // This is the equivalent of map_get_first_element_at(x, y), but on S6 data. + RCT12TileElement* originalElement = tilePointers[x + y * MAXIMUM_MAP_SIZE_TECHNICAL]; + do + { + if (originalElement->IsGhost()) + { + uint8_t bannerIndex = originalElement->GetBannerIndex(); + if (bannerIndex != RCT12_BANNER_INDEX_NULL) + { + auto banner = &s6->banners[bannerIndex]; + if (banner->type != RCT12_OBJECT_ENTRY_INDEX_NULL) + { + banner->type = RCT12_OBJECT_ENTRY_INDEX_NULL; + if (is_user_string_id(banner->string_idx)) + s6->custom_strings[(banner->string_idx % RCT12_MAX_USER_STRINGS)][0] = 0; + } + } + } + else + { + *destinationElement++ = *originalElement; + } + } while (!(originalElement++)->IsLastForTile()); + + // Set last element flag in case the original last element was never added + (destinationElement - 1)->flags |= TILE_ELEMENT_FLAG_LAST_TILE; + } + } +} + void S6Exporter::Export() { _s6.info = {}; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 8f840df3f9..c6ce4644e7 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -598,102 +598,6 @@ bool scenario_prepare_for_save() return true; } -/** - * Modifies the given S6 data so that ghost elements, rides with no track elements or unused banners / user strings are saved. - */ -void scenario_fix_ghosts(rct_s6_data* s6) -{ - // Build tile pointer cache (needed to get the first element at a certain location) - RCT12TileElement* tilePointers[MAX_TILE_TILE_ELEMENT_POINTERS]; - for (size_t i = 0; i < MAX_TILE_TILE_ELEMENT_POINTERS; i++) - { - tilePointers[i] = TILE_UNDEFINED_TILE_ELEMENT; - } - - RCT12TileElement* tileElement = s6->tile_elements; - RCT12TileElement** tile = tilePointers; - for (size_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) - { - for (size_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) - { - *tile++ = tileElement; - while (!(tileElement++)->IsLastForTile()) - ; - } - } - - // Remove all ghost elements - RCT12TileElement* destinationElement = s6->tile_elements; - - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) - { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) - { - // This is the equivalent of map_get_first_element_at(x, y), but on S6 data. - RCT12TileElement* originalElement = tilePointers[x + y * MAXIMUM_MAP_SIZE_TECHNICAL]; - do - { - if (originalElement->IsGhost()) - { - uint8_t bannerIndex = originalElement->GetBannerIndex(); - if (bannerIndex != RCT12_BANNER_INDEX_NULL) - { - auto banner = &s6->banners[bannerIndex]; - if (banner->type != RCT12_OBJECT_ENTRY_INDEX_NULL) - { - banner->type = RCT12_OBJECT_ENTRY_INDEX_NULL; - if (is_user_string_id(banner->string_idx)) - s6->custom_strings[(banner->string_idx % RCT12_MAX_USER_STRINGS)][0] = 0; - } - } - } - else - { - *destinationElement++ = *originalElement; - } - } while (!(originalElement++)->IsLastForTile()); - - // Set last element flag in case the original last element was never added - (destinationElement - 1)->flags |= TILE_ELEMENT_FLAG_LAST_TILE; - } - } -} - -static void ride_all_has_any_track_elements(std::array& rideIndexArray) -{ - tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) - { - if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (it.element->IsGhost()) - continue; - - rideIndexArray[it.element->AsTrack()->GetRideIndex()] = true; - } -} - -void scenario_remove_trackless_rides(rct_s6_data* s6) -{ - std::array rideHasTrack{}; - ride_all_has_any_track_elements(rideHasTrack); - for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) - { - auto ride = &s6->rides[i]; - if (rideHasTrack[i] || ride->type == RIDE_TYPE_NULL) - { - continue; - } - - ride->type = RIDE_TYPE_NULL; - if (is_user_string_id(ride->name)) - { - s6->custom_strings[(ride->name % RCT12_MAX_USER_STRINGS)][0] = 0; - } - } -} - ObjectiveStatus Objective::CheckGuestsBy() const { auto parkRating = gParkRating; diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index d350236d5d..1c6727146e 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -31,39 +31,6 @@ enum class EditorStep : uint8_t; struct ParkLoadResult; #pragma pack(push, 1) -/** - * SV6/SC6 header chunk - * size: 0x20 - */ -struct rct_s6_header -{ - uint8_t type; // 0x00 - uint8_t classic_flag; // 0x01 - uint16_t num_packed_objects; // 0x02 - uint32_t version; // 0x04 - uint32_t magic_number; // 0x08 - uint8_t pad_0C[0x14]; -}; -assert_struct_size(rct_s6_header, 0x20); - -/** - * SC6 information chunk - * size: 0x198 - */ -struct rct_s6_info -{ - EditorStep editor_step; - uint8_t category; // 0x01 - uint8_t objective_type; // 0x02 - uint8_t objective_arg_1; // 0x03 - int32_t objective_arg_2; // 0x04 - int16_t objective_arg_3; // 0x08 - uint8_t pad_00A[0x3E]; - char name[64]; // 0x48 - char details[256]; // 0x88 - rct_object_entry entry; // 0x188 -}; -assert_struct_size(rct_s6_info, 0x198); enum class ScenarioSource : uint8_t { @@ -85,220 +52,6 @@ struct rct_stex_entry uint8_t var_06; }; assert_struct_size(rct_stex_entry, 7); - -// This will be useful for backwards compatibility -struct rct_s6_data -{ - // SC6[0] - rct_s6_header header; - - // SC6[1] - rct_s6_info info; - - // SC6[2] - // packed objects - - // SC6[3] - rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT]; - - // SC6[4] - uint16_t elapsed_months; - uint16_t current_day; - uint32_t scenario_ticks; - uint32_t scenario_srand_0; - uint32_t scenario_srand_1; - - // SC6[5] - RCT12TileElement tile_elements[RCT2_MAX_TILE_ELEMENTS]; - - // SC6[6] - uint32_t next_free_tile_element_pointer_index; - RCT2Sprite sprites[RCT2_MAX_SPRITES]; - uint16_t sprite_lists_head[static_cast(EntityListId::Count)]; - uint16_t sprite_lists_count[static_cast(EntityListId::Count)]; - rct_string_id park_name; - uint8_t pad_013573D6[2]; - uint32_t park_name_args; - money32 initial_cash; - money32 current_loan; - uint32_t park_flags; - money16 park_entrance_fee; - uint16_t rct1_park_entrance_x; - uint16_t rct1_park_entrance_y; - uint8_t pad_013573EE[2]; - uint8_t rct1_park_entrance_z; - uint8_t pad_013573F1; - rct12_peep_spawn peep_spawns[RCT12_MAX_PEEP_SPAWNS]; - uint8_t guest_count_change_modifier; - uint8_t current_research_level; - uint8_t pad_01357400[4]; - uint32_t researched_ride_types[RCT2_MAX_RESEARCHED_RIDE_TYPE_QUADS]; - uint32_t researched_ride_entries[RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS]; - uint32_t researched_track_types_a[128]; - uint32_t researched_track_types_b[128]; - - // SC6[7] - uint16_t guests_in_park; - uint16_t guests_heading_for_park; - - // Ignored in scenario - money32 expenditure_table[RCT12_EXPENDITURE_TABLE_MONTH_COUNT][RCT12_EXPENDITURE_TYPE_COUNT]; - - // SC6[8] - uint16_t last_guests_in_park; - uint8_t pad_01357BCA[3]; - uint8_t handyman_colour; - uint8_t mechanic_colour; - uint8_t security_colour; - - // Ignored in scenario - uint32_t researched_scenery_items[RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS]; - - // SC6[9] - uint16_t park_rating; - - // Ignored in scenario - uint8_t park_rating_history[32]; - uint8_t guests_in_park_history[32]; - - // SC6[10] - uint8_t active_research_types; - uint8_t research_progress_stage; - uint32_t last_researched_item_subject; - uint8_t pad_01357CF8[1000]; - uint32_t next_research_item; - uint16_t research_progress; - uint8_t next_research_category; - uint8_t next_research_expected_day; - uint8_t next_research_expected_month; - uint8_t guest_initial_happiness; - uint16_t park_size; - uint16_t guest_generation_probability; - uint16_t total_ride_value_for_money; - money32 maximum_loan; - money16 guest_initial_cash; - uint8_t guest_initial_hunger; - uint8_t guest_initial_thirst; - uint8_t objective_type; - uint8_t objective_year; - uint8_t pad_013580FA[2]; - money32 objective_currency; - uint16_t objective_guests; - uint8_t campaign_weeks_left[20]; - uint8_t campaign_ride_index[22]; - - // Ignored in scenario - money32 balance_history[RCT12_FINANCE_GRAPH_SIZE]; - - // SC6[11] - money32 current_expenditure; - money32 current_profit; - money32 weekly_profit_average_dividend; - uint16_t weekly_profit_average_divisor; - uint8_t pad_0135833A[2]; - - // Ignored in scenario - money32 weekly_profit_history[RCT12_FINANCE_GRAPH_SIZE]; - - // SC6[12] - money32 park_value; - - // Ignored in scenario - money32 park_value_history[RCT12_FINANCE_GRAPH_SIZE]; - - // SC6[13] - money32 completed_company_value; - uint32_t total_admissions; - money32 income_from_admissions; - money32 company_value; - uint8_t peep_warning_throttle[16]; - rct12_award awards[RCT12_MAX_AWARDS]; - money16 land_price; - money16 construction_rights_price; - uint16_t word_01358774; - uint8_t pad_01358776[2]; - uint32_t cd_key; - uint8_t pad_0135877C[64]; - uint32_t game_version_number; - money32 completed_company_value_record; - uint32_t loan_hash; - uint16_t ride_count; - uint8_t pad_013587CA[6]; - money32 historical_profit; - uint8_t pad_013587D4[4]; - char scenario_completed_name[32]; - money32 cash; - uint8_t pad_013587FC[50]; - uint16_t park_rating_casualty_penalty; - uint16_t map_size_units; - uint16_t map_size_minus_2; - uint16_t map_size; - uint16_t map_max_xy; - uint32_t same_price_throughout; - uint16_t suggested_max_guests; - uint16_t park_rating_warning_days; - uint8_t last_entrance_style; - uint8_t rct1_water_colour; - uint8_t pad_01358842[2]; - RCT12ResearchItem research_items[MAX_RESEARCH_ITEMS]; - uint16_t map_base_z; - char scenario_name[64]; - char scenario_description[256]; - uint8_t current_interest_rate; - uint8_t pad_0135934B; - uint32_t same_price_throughout_extended; - int16_t park_entrance_x[RCT12_MAX_PARK_ENTRANCES]; - int16_t park_entrance_y[RCT12_MAX_PARK_ENTRANCES]; - int16_t park_entrance_z[RCT12_MAX_PARK_ENTRANCES]; - uint8_t park_entrance_direction[RCT12_MAX_PARK_ENTRANCES]; - char scenario_filename[256]; - uint8_t saved_expansion_pack_names[3256]; - RCT12Banner banners[RCT2_MAX_BANNERS_IN_PARK]; - char custom_strings[RCT12_MAX_USER_STRINGS][RCT12_USER_STRING_MAX_LENGTH]; - uint32_t game_ticks_1; - rct2_ride rides[RCT12_MAX_RIDES_IN_PARK]; - uint16_t saved_age; - int16_t saved_view_x; - int16_t saved_view_y; - uint8_t saved_view_zoom; - uint8_t saved_view_rotation; - RCT12MapAnimation map_animations[RCT2_MAX_ANIMATED_OBJECTS]; - uint16_t num_map_animations; - uint8_t pad_0138B582[2]; - RCT2RideRatingCalculationData ride_ratings_calc_data; - uint8_t pad_0138B5D0[60]; - RCT12RideMeasurement ride_measurements[8]; - uint32_t next_guest_index; - uint16_t grass_and_scenery_tilepos; - uint32_t patrol_areas[(RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT) * RCT12_PATROL_AREA_SIZE]; - uint8_t staff_modes[RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT]; - uint8_t pad_13CA73E; - uint8_t pad_13CA73F; - uint8_t byte_13CA740; - uint8_t pad_13CA741; - uint8_t byte_13CA742[4]; // unused - uint8_t climate; - uint8_t pad_013CA747; - uint16_t climate_update_timer; - uint8_t current_weather; - uint8_t next_weather; - uint8_t temperature; - uint8_t next_temperature; - uint8_t current_weather_effect; - uint8_t next_weather_effect; - uint8_t current_weather_gloom; - uint8_t next_weather_gloom; - uint8_t current_weather_level; - uint8_t next_weather_level; - rct12_news_item news_items[RCT12_MAX_NEWS_ITEMS]; - char rct1_scenario_name[62]; // Unused in RCT2 - uint16_t rct1_scenario_slot_index; // Unused in RCT2 - uint32_t rct1_scenario_flags; // Unused in RCT2 - uint16_t wide_path_tile_loop_x; - uint16_t wide_path_tile_loop_y; - uint8_t pad_13CE778[434]; -}; -assert_struct_size(rct_s6_data, 0x46b44a); #pragma pack(pop) enum @@ -460,8 +213,6 @@ uint32_t scenario_rand_max(uint32_t max); bool scenario_prepare_for_save(); int32_t scenario_save(const utf8* path, int32_t flags); -void scenario_remove_trackless_rides(rct_s6_data* s6); -void scenario_fix_ghosts(rct_s6_data* s6); void scenario_failure(); void scenario_success(); void scenario_success_submit_name(const char* name); From eeb5c64119c0395d18ee55a020c47d9046aeae11 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 25 Aug 2021 17:29:15 +0300 Subject: [PATCH 232/681] Rename SpriteBase.h to EntityBase.h --- src/openrct2/libopenrct2.vcxproj | 2 +- src/openrct2/world/{SpriteBase.h => EntityBase.h} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/openrct2/world/{SpriteBase.h => EntityBase.h} (100%) diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 3d685e7517..8d336d6de6 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -474,7 +474,7 @@ - + diff --git a/src/openrct2/world/SpriteBase.h b/src/openrct2/world/EntityBase.h similarity index 100% rename from src/openrct2/world/SpriteBase.h rename to src/openrct2/world/EntityBase.h From 20d3b50771fe32abe6b66fc8e19825879e2596cf Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 25 Aug 2021 17:33:06 +0300 Subject: [PATCH 233/681] Correct includes for EntityBase.h --- src/openrct2/peep/Peep.h | 2 +- src/openrct2/ride/Vehicle.h | 2 +- src/openrct2/world/Balloon.h | 2 +- src/openrct2/world/Duck.h | 2 +- src/openrct2/world/Entity.h | 2 +- src/openrct2/world/EntityList.h | 2 +- src/openrct2/world/EntityTweener.h | 2 +- src/openrct2/world/Fountain.h | 2 +- src/openrct2/world/Litter.h | 2 +- src/openrct2/world/MoneyEffect.h | 2 +- src/openrct2/world/Particle.h | 2 +- src/openrct2/world/Sprite.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index eb659b6760..41d2660ab7 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -16,8 +16,8 @@ #include "../ride/RideTypes.h" #include "../ride/ShopItem.h" #include "../util/Util.h" +#include "../world/EntityBase.h" #include "../world/Location.hpp" -#include "../world/SpriteBase.h" #include #include diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 018ac852ea..d99463ae12 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -12,8 +12,8 @@ #include "../audio/audio.h" #include "../common.h" #include "../ride/RideTypes.h" +#include "../world/EntityBase.h" #include "../world/Location.hpp" -#include "../world/SpriteBase.h" #include "Station.h" #include "VehicleColour.h" #include "VehicleEntry.h" diff --git a/src/openrct2/world/Balloon.h b/src/openrct2/world/Balloon.h index 46cc2e611e..f7b95c15fd 100644 --- a/src/openrct2/world/Balloon.h +++ b/src/openrct2/world/Balloon.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXYZ; diff --git a/src/openrct2/world/Duck.h b/src/openrct2/world/Duck.h index feef90e15e..0eeb867f83 100644 --- a/src/openrct2/world/Duck.h +++ b/src/openrct2/world/Duck.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXY; diff --git a/src/openrct2/world/Entity.h b/src/openrct2/world/Entity.h index e2e6fd7cd4..6c1831232c 100644 --- a/src/openrct2/world/Entity.h +++ b/src/openrct2/world/Entity.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" constexpr uint16_t MAX_ENTITIES = 10000; diff --git a/src/openrct2/world/EntityList.h b/src/openrct2/world/EntityList.h index 2c43d33c9f..db09b04e6b 100644 --- a/src/openrct2/world/EntityList.h +++ b/src/openrct2/world/EntityList.h @@ -12,8 +12,8 @@ #include "../common.h" #include "../rct12/RCT12.h" #include "Entity.h" +#include "EntityBase.h" #include "Location.hpp" -#include "SpriteBase.h" #include #include diff --git a/src/openrct2/world/EntityTweener.h b/src/openrct2/world/EntityTweener.h index 7e6dfaf843..7d2c5da027 100644 --- a/src/openrct2/world/EntityTweener.h +++ b/src/openrct2/world/EntityTweener.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" #include diff --git a/src/openrct2/world/Fountain.h b/src/openrct2/world/Fountain.h index 068c9a0dcc..5f33fa54fd 100644 --- a/src/openrct2/world/Fountain.h +++ b/src/openrct2/world/Fountain.h @@ -10,8 +10,8 @@ #pragma once #include "../common.h" +#include "EntityBase.h" #include "Map.h" -#include "SpriteBase.h" class DataSerialiser; diff --git a/src/openrct2/world/Litter.h b/src/openrct2/world/Litter.h index b1cfe0a62f..84e8d01121 100644 --- a/src/openrct2/world/Litter.h +++ b/src/openrct2/world/Litter.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXYZ; diff --git a/src/openrct2/world/MoneyEffect.h b/src/openrct2/world/MoneyEffect.h index bd48992c51..1ea4647135 100644 --- a/src/openrct2/world/MoneyEffect.h +++ b/src/openrct2/world/MoneyEffect.h @@ -9,7 +9,7 @@ #pragma once -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXYZ; diff --git a/src/openrct2/world/Particle.h b/src/openrct2/world/Particle.h index 53ba024785..5eaa81b522 100644 --- a/src/openrct2/world/Particle.h +++ b/src/openrct2/world/Particle.h @@ -10,7 +10,7 @@ #pragma once #include "../ride/VehicleColour.h" -#include "SpriteBase.h" +#include "EntityBase.h" class DataSerialiser; struct CoordsXYZ; diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 14db05fa25..b2fd41374c 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "SpriteBase.h" +#include "EntityBase.h" #include From de364aa15a28df7b78aae0c1a75bc7fdb5076c95 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 25 Aug 2021 17:42:09 +0300 Subject: [PATCH 234/681] Rename type SpriteBase to EntityBase --- src/openrct2/GameStateSnapshots.cpp | 14 ++--- src/openrct2/drawing/LightFX.cpp | 2 +- src/openrct2/drawing/LightFX.h | 4 +- src/openrct2/interface/Viewport.h | 4 +- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/peep/Peep.h | 2 +- src/openrct2/peep/Staff.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 6 +- src/openrct2/rct2/S6Exporter.h | 4 +- src/openrct2/rct2/S6Importer.cpp | 4 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/Vehicle.h | 2 +- .../scripting/bindings/entity/ScEntity.hpp | 2 +- .../scripting/bindings/world/ScMap.cpp | 2 +- .../scripting/bindings/world/ScMap.hpp | 2 +- src/openrct2/world/Balloon.cpp | 2 +- src/openrct2/world/Duck.cpp | 2 +- src/openrct2/world/Entity.cpp | 2 +- src/openrct2/world/Entity.h | 12 ++-- src/openrct2/world/EntityBase.h | 4 +- src/openrct2/world/EntityList.h | 4 +- src/openrct2/world/EntityTweener.cpp | 2 +- src/openrct2/world/EntityTweener.h | 4 +- src/openrct2/world/Fountain.cpp | 2 +- src/openrct2/world/Litter.h | 2 +- src/openrct2/world/MoneyEffect.cpp | 2 +- src/openrct2/world/Particle.cpp | 4 +- src/openrct2/world/Sprite.cpp | 56 +++++++++---------- src/openrct2/world/Sprite.h | 10 ++-- 31 files changed, 83 insertions(+), 83 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index b372119ce4..a3bc1e024f 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -222,13 +222,13 @@ struct GameStateSnapshots final : public IGameStateSnapshots } void CompareSpriteDataCommon( - const SpriteBase& spriteBase, const SpriteBase& spriteCmp, GameStateSpriteChange_t& changeData) const + const EntityBase& spriteBase, const EntityBase& spriteCmp, GameStateSpriteChange_t& changeData) const { - COMPARE_FIELD(SpriteBase, Type); - COMPARE_FIELD(SpriteBase, sprite_index); - COMPARE_FIELD(SpriteBase, x); - COMPARE_FIELD(SpriteBase, y); - COMPARE_FIELD(SpriteBase, z); + COMPARE_FIELD(EntityBase, Type); + COMPARE_FIELD(EntityBase, sprite_index); + COMPARE_FIELD(EntityBase, x); + COMPARE_FIELD(EntityBase, y); + COMPARE_FIELD(EntityBase, z); /* Only relevant for rendering, does not affect game state. COMPARE_FIELD(SpriteBase, sprite_width); COMPARE_FIELD(SpriteBase, sprite_height_negative); @@ -238,7 +238,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(SpriteBase, sprite_right); COMPARE_FIELD(SpriteBase, sprite_bottom); */ - COMPARE_FIELD(SpriteBase, sprite_direction); + COMPARE_FIELD(EntityBase, sprite_direction); } void CompareSpriteDataPeep(const Peep& spriteBase, const Peep& spriteCmp, GameStateSpriteChange_t& changeData) const diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index c90abd7fed..837742d48b 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -684,7 +684,7 @@ static void LightfxAdd3DLight(const CoordsXYZ& loc, const LightType lightType) LightfxAdd3DLight(((loc.x << 16) | loc.y), LightFXQualifier::Map, loc.z, loc, lightType); } -void LightfxAdd3DLight(const SpriteBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType) +void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType) { LightfxAdd3DLight(entity.sprite_index, LightFXQualifier::Entity, id, loc, lightType); } diff --git a/src/openrct2/drawing/LightFX.h b/src/openrct2/drawing/LightFX.h index 1473bb418c..13a43ed141 100644 --- a/src/openrct2/drawing/LightFX.h +++ b/src/openrct2/drawing/LightFX.h @@ -18,7 +18,7 @@ struct Vehicle; struct rct_drawpixelinfo; struct GamePalette; struct CoordsXYZ; -struct SpriteBase; +struct EntityBase; enum class LightType : uint8_t { @@ -60,7 +60,7 @@ void lightfx_update_viewport_settings(); void* lightfx_get_front_buffer(); const GamePalette& lightfx_get_palette(); -void LightfxAdd3DLight(const SpriteBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType); +void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType); void lightfx_add_3d_light_magic_from_drawing_tile( const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, LightType lightType); diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 2212105dd2..3bd4f8880a 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -24,7 +24,7 @@ struct Peep; struct TileElement; struct rct_window; union paint_entry; -struct SpriteBase; +struct EntityBase; enum { @@ -77,7 +77,7 @@ struct InteractionInfo union { TileElement* Element = nullptr; - SpriteBase* Entity; + EntityBase* Entity; }; ViewportInteractionItem SpriteType = ViewportInteractionItem::None; }; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index fe53f8a73e..f85ef7f0b1 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -429,7 +429,7 @@ static void peep_head_for_nearest_ride_type(Guest* peep, int32_t rideType); static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags); bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement); -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Guest; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 36f9f1e6a8..48d9e7e7e8 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -127,7 +127,7 @@ const bool gSpriteTypeToSlowWalkMap[] = { // clang-format on -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Guest || Type == EntityType::Staff; } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 41d2660ab7..ceab4cbde7 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -548,7 +548,7 @@ public: } }; -struct Peep : SpriteBase +struct Peep : EntityBase { char* Name; CoordsXYZ NextLoc; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index c981d22b5e..423290e8fa 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -73,7 +73,7 @@ colour_t gStaffSecurityColour; // Maximum manhattan distance that litter can be for a handyman to seek to it const uint16_t MAX_LITTER_DISTANCE = 3 * COORDS_XY_STEP; -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Staff; } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index bc4e621ef5..794bb48311 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1294,7 +1294,7 @@ namespace RCT1 } } - void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src) + void ImportEntityCommonProperties(EntityBase* dst, const RCT12SpriteBase* src) { dst->sprite_direction = src->sprite_direction; dst->sprite_width = src->sprite_width; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 0639cde023..2d6ca37d9a 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1014,7 +1014,7 @@ void S6Exporter::RebuildEntityLinks() } } -constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const SpriteBase* src) +constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const EntityBase* src) { RCT12EntityLinkListOffset output = RCT12EntityLinkListOffset::Free; switch (src->Type) @@ -1056,7 +1056,7 @@ constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const SpriteBase* src) return output; } -constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const SpriteBase* src) +constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const EntityBase* src) { RCT12SpriteIdentifier output = RCT12SpriteIdentifier::Null; switch (src->Type) @@ -1088,7 +1088,7 @@ constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const SpriteBase* src) return output; } -void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const SpriteBase* src) +void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const EntityBase* src) { dst->sprite_identifier = GetRCT2SpriteIdentifier(src); dst->linked_list_type_offset = GetRCT2LinkListOffset(src); diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index bc673854b7..9970a7ef3e 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -27,7 +27,7 @@ struct Litter; struct ObjectRepositoryItem; struct RCT12SpriteBase; union rct_sprite; -struct SpriteBase; +struct EntityBase; /** * Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). @@ -50,7 +50,7 @@ public: void ExportRide(rct2_ride* dst, const Ride* src); void ExportEntities(); template void ExportEntity(RCT12_T* dst, const OpenRCT2_T* src); - void ExportEntityCommonProperties(RCT12SpriteBase* dst, const SpriteBase* src); + void ExportEntityCommonProperties(RCT12SpriteBase* dst, const EntityBase* src); void ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src); private: diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 53986843d9..114ccc6ef2 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1395,7 +1395,7 @@ public: return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == INVALID_DIRECTION; }; - ImportEntityCommonProperties(static_cast(dst), src); + ImportEntityCommonProperties(static_cast(dst), src); if (is_user_string_id(src->name_string_idx)) { dst->SetName(GetUserString(src->name_string_idx)); @@ -1520,7 +1520,7 @@ public: return output; } - void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src) + void ImportEntityCommonProperties(EntityBase* dst, const RCT12SpriteBase* src) { dst->Type = GetEntityTypeFromRCT2Sprite(src); dst->sprite_height_negative = src->sprite_height_negative; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 32e8995f08..8dcabb345e 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -735,7 +735,7 @@ static const struct // clang-format on -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Vehicle; } diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index d99463ae12..e8e84859f6 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -53,7 +53,7 @@ constexpr const uint16_t VehicleTrackTypeMask = 0b1111111111111100; enum class MiniGolfAnimation : uint8_t; -struct Vehicle : SpriteBase +struct Vehicle : EntityBase { static constexpr auto cEntityType = EntityType::Vehicle; diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 6531862fdf..30a9670412 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -190,7 +190,7 @@ namespace OpenRCT2::Scripting } } - SpriteBase* GetEntity() const + EntityBase* GetEntity() const { return ::GetEntity(_id); } diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index d354850606..ade039e148 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -253,7 +253,7 @@ namespace OpenRCT2::Scripting dukglue_register_method(ctx, &ScMap::createEntity, "createEntity"); } - DukValue ScMap::GetEntityAsDukValue(const SpriteBase* sprite) const + DukValue ScMap::GetEntityAsDukValue(const EntityBase* sprite) const { auto spriteId = sprite->sprite_index; switch (sprite->Type) diff --git a/src/openrct2/scripting/bindings/world/ScMap.hpp b/src/openrct2/scripting/bindings/world/ScMap.hpp index a2994fd04b..2d6ca62549 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.hpp +++ b/src/openrct2/scripting/bindings/world/ScMap.hpp @@ -47,7 +47,7 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx); private: - DukValue GetEntityAsDukValue(const SpriteBase* sprite) const; + DukValue GetEntityAsDukValue(const EntityBase* sprite) const; }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/world/Balloon.cpp index 4ea3655ada..1c7f2e1541 100644 --- a/src/openrct2/world/Balloon.cpp +++ b/src/openrct2/world/Balloon.cpp @@ -16,7 +16,7 @@ #include "../util/Util.h" #include "Sprite.h" -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Balloon; } diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/world/Duck.cpp index e6cf1a282f..f376846eca 100644 --- a/src/openrct2/world/Duck.cpp +++ b/src/openrct2/world/Duck.cpp @@ -67,7 +67,7 @@ static constexpr const uint8_t * DuckAnimations[] = }; // clang-format on -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Duck; } diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/world/Entity.cpp index 3f35c6a50f..bc1b1e0859 100644 --- a/src/openrct2/world/Entity.cpp +++ b/src/openrct2/world/Entity.cpp @@ -18,7 +18,7 @@ #include "MoneyEffect.h" #include "Particle.h" -static void EntityBaseSerialise(SpriteBase& base, DataSerialiser& stream) +static void EntityBaseSerialise(EntityBase& base, DataSerialiser& stream) { stream << base.Type; stream << base.sprite_index; diff --git a/src/openrct2/world/Entity.h b/src/openrct2/world/Entity.h index 6c1831232c..407f474afe 100644 --- a/src/openrct2/world/Entity.h +++ b/src/openrct2/world/Entity.h @@ -13,29 +13,29 @@ constexpr uint16_t MAX_ENTITIES = 10000; -SpriteBase* try_get_sprite(size_t spriteIndex); -SpriteBase* get_sprite(size_t sprite_idx); +EntityBase* try_get_sprite(size_t spriteIndex); +EntityBase* get_sprite(size_t sprite_idx); -template T* GetEntity(size_t sprite_idx) +template T* GetEntity(size_t sprite_idx) { auto spr = get_sprite(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } -template T* TryGetEntity(size_t sprite_idx) +template T* TryGetEntity(size_t sprite_idx) { auto spr = try_get_sprite(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } -SpriteBase* CreateEntity(EntityType type); +EntityBase* CreateEntity(EntityType type); template T* CreateEntity() { return static_cast(CreateEntity(T::cEntityType)); } // Use only with imports that must happen at a specified index -SpriteBase* CreateEntityAt(const uint16_t index, const EntityType type); +EntityBase* CreateEntityAt(const uint16_t index, const EntityType type); // Use only with imports that must happen at a specified index template T* CreateEntityAt(const uint16_t index) { diff --git a/src/openrct2/world/EntityBase.h b/src/openrct2/world/EntityBase.h index ee84d6d62c..294e0f6004 100644 --- a/src/openrct2/world/EntityBase.h +++ b/src/openrct2/world/EntityBase.h @@ -23,7 +23,7 @@ enum class EntityType : uint8_t Null = 255 }; -struct SpriteBase +struct EntityBase { EntityType Type; uint16_t sprite_index; @@ -74,7 +74,7 @@ struct SpriteBase } }; -struct MiscEntity : SpriteBase +struct MiscEntity : EntityBase { uint16_t frame; }; diff --git a/src/openrct2/world/EntityList.h b/src/openrct2/world/EntityList.h index db09b04e6b..19489ae49b 100644 --- a/src/openrct2/world/EntityList.h +++ b/src/openrct2/world/EntityList.h @@ -81,7 +81,7 @@ public: using iterator_category = std::forward_iterator_tag; }; -template class EntityTileList +template class EntityTileList { private: const std::vector& vec; @@ -153,7 +153,7 @@ public: using iterator_category = std::forward_iterator_tag; }; -template class EntityList +template class EntityList { private: using EntityListIterator_t = EntityListIterator; diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index aa77dd5a05..4261421971 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -57,7 +57,7 @@ void EntityTweener::PostTick() } } -void EntityTweener::RemoveEntity(SpriteBase* entity) +void EntityTweener::RemoveEntity(EntityBase* entity) { if (!entity->Is() && !entity->Is()) { diff --git a/src/openrct2/world/EntityTweener.h b/src/openrct2/world/EntityTweener.h index 7d2c5da027..d5a1026786 100644 --- a/src/openrct2/world/EntityTweener.h +++ b/src/openrct2/world/EntityTweener.h @@ -15,7 +15,7 @@ class EntityTweener { - std::vector Entities; + std::vector Entities; std::vector PrePos; std::vector PostPos; @@ -27,7 +27,7 @@ public: void PreTick(); void PostTick(); - void RemoveEntity(SpriteBase* entity); + void RemoveEntity(EntityBase* entity); void Tween(float alpha); void Restore(); void Reset(); diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 13cb54bb79..977e8e3ab7 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -70,7 +70,7 @@ const uint8_t _fountainPatternFlags[] = { FOUNTAIN_FLAG::FAST // FAST_RANDOM_CHASERS }; -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::JumpingFountain; } diff --git a/src/openrct2/world/Litter.h b/src/openrct2/world/Litter.h index 84e8d01121..2aafcfeecf 100644 --- a/src/openrct2/world/Litter.h +++ b/src/openrct2/world/Litter.h @@ -15,7 +15,7 @@ class DataSerialiser; struct CoordsXYZ; struct CoordsXYZD; -struct Litter : SpriteBase +struct Litter : EntityBase { enum class Type : uint8_t { diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 149231c19d..e001459036 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -20,7 +20,7 @@ static constexpr const CoordsXY _moneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, { -1, -1 } }; -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::MoneyEffect; } diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/world/Particle.cpp index 80d94b8765..9626b82802 100644 --- a/src/openrct2/world/Particle.cpp +++ b/src/openrct2/world/Particle.cpp @@ -15,12 +15,12 @@ #include -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::CrashedVehicleParticle; } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::CrashSplash; } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 7537acdc8d..7faafd75c5 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -44,7 +44,7 @@ constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex; -static void FreeEntity(SpriteBase* entity); +static void FreeEntity(EntityBase* entity); constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) { @@ -67,12 +67,12 @@ constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) } // Required for GetEntity to return a default -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return true; } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::Litter; } @@ -96,22 +96,22 @@ constexpr bool EntityTypeIsMiscEntity(const EntityType type) } } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return EntityTypeIsMiscEntity(Type); } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::SteamParticle; } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::ExplosionFlare; } -template<> bool SpriteBase::Is() const +template<> bool EntityBase::Is() const { return Type == EntityType::ExplosionCloud; } @@ -141,12 +141,12 @@ std::string rct_sprite_checksum::ToString() const return result; } -SpriteBase* try_get_sprite(size_t spriteIndex) +EntityBase* try_get_sprite(size_t spriteIndex) { return spriteIndex >= MAX_ENTITIES ? nullptr : &_spriteList[spriteIndex].base; } -SpriteBase* get_sprite(size_t spriteIndex) +EntityBase* get_sprite(size_t spriteIndex) { if (spriteIndex == SPRITE_INDEX_NULL) { @@ -161,7 +161,7 @@ const std::vector& GetEntityTileList(const CoordsXY& spritePos) return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos.x, spritePos.y)]; } -void SpriteBase::Invalidate() +void EntityBase::Invalidate() { if (sprite_left == LOCATION_NULL) return; @@ -249,7 +249,7 @@ void reset_sprite_list() reset_sprite_spatial_index(); } -static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc); +static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc); /** * @@ -307,7 +307,7 @@ rct_sprite_checksum sprite_checksum() #endif // DISABLE_NETWORK -static void sprite_reset(SpriteBase* sprite) +static void sprite_reset(EntityBase* sprite) { // Need to retain how the sprite is linked in lists uint16_t sprite_index = sprite->sprite_index; @@ -320,7 +320,7 @@ static void sprite_reset(SpriteBase* sprite) } static constexpr uint16_t MAX_MISC_SPRITES = 300; -static void AddToEntityList(SpriteBase* entity) +static void AddToEntityList(EntityBase* entity) { auto& list = gEntityLists[EnumValue(entity->Type)]; // Entity list must be in sprite_index order to prevent desync issues @@ -333,7 +333,7 @@ static void AddToFreeList(uint16_t index) _freeIdList.insert(std::upper_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index).base(), index); } -static void RemoveFromEntityList(SpriteBase* entity) +static void RemoveFromEntityList(EntityBase* entity) { auto& list = gEntityLists[EnumValue(entity->Type)]; auto ptr = std::lower_bound(std::begin(list), std::end(list), entity->sprite_index); @@ -355,7 +355,7 @@ uint16_t GetMiscEntityCount() return count; } -static void PrepareNewEntity(SpriteBase* base, const EntityType type) +static void PrepareNewEntity(EntityBase* base, const EntityType type) { // Need to reset all sprite data, as the uninitialised values // may contain garbage and cause a desync later on. @@ -375,7 +375,7 @@ static void PrepareNewEntity(SpriteBase* base, const EntityType type) SpriteSpatialInsert(base, { LOCATION_NULL, 0 }); } -SpriteBase* CreateEntity(EntityType type) +EntityBase* CreateEntity(EntityType type) { if (_freeIdList.size() == 0) { @@ -407,7 +407,7 @@ SpriteBase* CreateEntity(EntityType type) return entity; } -SpriteBase* CreateEntityAt(const uint16_t index, const EntityType type) +EntityBase* CreateEntityAt(const uint16_t index, const EntityType type) { auto id = std::lower_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index); if (id == std::rend(_freeIdList) || *id != index) @@ -452,7 +452,7 @@ void sprite_misc_update_all() } // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order -static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc) +static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) { size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y); auto& spatialVector = gSpriteSpatialIndex[newIndex]; @@ -460,7 +460,7 @@ static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc) spatialVector.insert(index, sprite->sprite_index); } -static void SpriteSpatialRemove(SpriteBase* sprite) +static void SpriteSpatialRemove(EntityBase* sprite) { size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y); auto& spatialVector = gSpriteSpatialIndex[currentIndex]; @@ -476,7 +476,7 @@ static void SpriteSpatialRemove(SpriteBase* sprite) } } -static void SpriteSpatialMove(SpriteBase* sprite, const CoordsXY& newLoc) +static void SpriteSpatialMove(EntityBase* sprite, const CoordsXY& newLoc) { size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y); size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y); @@ -487,7 +487,7 @@ static void SpriteSpatialMove(SpriteBase* sprite, const CoordsXY& newLoc) SpriteSpatialInsert(sprite, newLoc); } -void SpriteBase::MoveTo(const CoordsXYZ& newLocation) +void EntityBase::MoveTo(const CoordsXYZ& newLocation) { if (x != LOCATION_NULL) { @@ -517,19 +517,19 @@ void SpriteBase::MoveTo(const CoordsXYZ& newLocation) } } -CoordsXYZ SpriteBase::GetLocation() const +CoordsXYZ EntityBase::GetLocation() const { return { x, y, z }; } -void SpriteBase::SetLocation(const CoordsXYZ& newLocation) +void EntityBase::SetLocation(const CoordsXYZ& newLocation) { x = static_cast(newLocation.x); y = static_cast(newLocation.y); z = static_cast(newLocation.z); } -void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite) +void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite) { auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), spritePos); @@ -545,7 +545,7 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite) /** * Frees any dynamically attached memory to the entity, such as peep name. */ -static void FreeEntity(SpriteBase* entity) +static void FreeEntity(EntityBase* entity) { auto* guest = entity->As(); auto* staff = entity->As(); @@ -565,7 +565,7 @@ static void FreeEntity(SpriteBase* entity) * * rct2: 0x0069EDB6 */ -void sprite_remove(SpriteBase* sprite) +void sprite_remove(EntityBase* sprite) { FreeEntity(sprite); @@ -605,13 +605,13 @@ uint16_t remove_floating_sprites() return removed; } -void sprite_set_flashing(SpriteBase* sprite, bool flashing) +void sprite_set_flashing(EntityBase* sprite, bool flashing) { assert(sprite->sprite_index < MAX_ENTITIES); _spriteFlashingList[sprite->sprite_index] = flashing; } -bool sprite_get_flashing(SpriteBase* sprite) +bool sprite_get_flashing(EntityBase* sprite) { assert(sprite->sprite_index < MAX_ENTITIES); return _spriteFlashingList[sprite->sprite_index]; diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index b2fd41374c..3438888ea6 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -22,7 +22,7 @@ union rct_sprite { uint8_t pad_00[0x200]; - SpriteBase base; + EntityBase base; }; assert_struct_size(rct_sprite, 0x200); @@ -38,11 +38,11 @@ struct rct_sprite_checksum void reset_sprite_list(); void reset_sprite_spatial_index(); void sprite_misc_update_all(); -void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite); -void sprite_remove(SpriteBase* sprite); +void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite); +void sprite_remove(EntityBase* sprite); uint16_t remove_floating_sprites(); rct_sprite_checksum sprite_checksum(); -void sprite_set_flashing(SpriteBase* sprite, bool flashing); -bool sprite_get_flashing(SpriteBase* sprite); +void sprite_set_flashing(EntityBase* sprite, bool flashing); +bool sprite_get_flashing(EntityBase* sprite); From 6e2b79a8959a03821835e5daffc5abcce6aee313 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 3 Aug 2019 12:47:29 +0100 Subject: [PATCH 235/681] Get basic TTF support working in OpenGL co-authored-by: Michael Steenbeek --- .../engines/opengl/OpenGLDrawingEngine.cpp | 43 ++++++++++++++++++ .../drawing/engines/opengl/TextureCache.cpp | 45 +++++++++++++++++++ .../drawing/engines/opengl/TextureCache.h | 2 + src/openrct2/drawing/Drawing.String.cpp | 35 +++++++++++++++ src/openrct2/drawing/IDrawingContext.h | 7 ++- src/openrct2/drawing/X8DrawingEngine.h | 3 ++ 6 files changed, 131 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 3617123463..ad808f966f 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -109,6 +109,7 @@ public: void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) override; void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) override; + void DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) override; void FlushCommandBuffers(); @@ -922,6 +923,48 @@ void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const command.depth = _drawCount++; } +void OpenGLDrawingContext::DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) +{ + const auto texture = _textureCache->GetOrLoadBitmapTexture(image, pixels, width, height); + + int32_t drawOffsetX = 0; + int32_t drawOffsetY = 0; + int32_t drawWidth = static_cast(width); + int32_t drawHeight = static_cast(height); + + int32_t left = x + drawOffsetX; + int32_t top = y + drawOffsetY; + int32_t right = left + drawWidth; + int32_t bottom = top + drawHeight; + + if (left > right) + { + std::swap(left, right); + } + if (top > bottom) + { + std::swap(top, bottom); + } + + left += _offsetX; + top += _offsetY; + right += _offsetX; + bottom += _offsetY; + + DrawRectCommand& command = _commandBuffers.rects.allocate(); + + command.clip = { _clipLeft, _clipTop, _clipRight, _clipBottom }; + command.texColourAtlas = texture.index; + command.texColourBounds = texture.normalizedBounds; + command.texMaskAtlas = 0; + command.texMaskBounds = { 0.0f, 0.0f, 0.0f, 0.0f }; + command.palettes = { 0, 0, 0 }; + command.flags = 0; + command.colour = 0; + command.bounds = { left, top, right, bottom }; + command.depth = _drawCount++; +} + void OpenGLDrawingContext::FlushCommandBuffers() { glEnable(GL_DEPTH_TEST); diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index fbd919d337..b762f293ec 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -134,6 +134,40 @@ BasicTextureInfo TextureCache::GetOrLoadGlyphTexture(uint32_t image, const Palet return (*it.first).second; } +BasicTextureInfo TextureCache::GetOrLoadBitmapTexture(uint32_t image, const void* pixels, size_t width, size_t height) +{ + uint32_t index; + + image &= 0x7FFFF; + + // Try to read cached texture first. + { + shared_lock lock(_mutex); + + index = _indexMap[image]; + if (index != UNUSED_INDEX) + { + const auto& info = _textureCache[index]; + return { + info.index, + info.normalizedBounds, + }; + } + } + + // Load new texture. + unique_lock lock(_mutex); + + index = uint32_t(_textureCache.size()); + + AtlasTextureInfo info = LoadBitmapTexture(image, pixels, width, height); + + _textureCache.push_back(info); + _indexMap[image] = index; + + return info; +} + void TextureCache::CreateTextures() { if (!_initialized) @@ -270,6 +304,17 @@ AtlasTextureInfo TextureCache::LoadGlyphTexture(uint32_t image, const PaletteMap return cacheInfo; } +AtlasTextureInfo TextureCache::LoadBitmapTexture(uint32_t image, const void* pixels, size_t width, size_t height) +{ + auto cacheInfo = AllocateImage(int32_t(width), int32_t(height)); + cacheInfo.image = image; + glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture); + glTexSubImage3D( + GL_TEXTURE_2D_ARRAY, 0, cacheInfo.bounds.x, cacheInfo.bounds.y, cacheInfo.index, GLsizei(width), GLsizei(height), 1, + GL_RED_INTEGER, GL_UNSIGNED_BYTE, reinterpret_cast(pixels)); + return cacheInfo; +} + AtlasTextureInfo TextureCache::AllocateImage(int32_t imageWidth, int32_t imageHeight) { CreateTextures(); diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index f624da0df7..474092769a 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -221,6 +221,7 @@ public: void InvalidateImage(uint32_t image); BasicTextureInfo GetOrLoadImageTexture(uint32_t image); BasicTextureInfo GetOrLoadGlyphTexture(uint32_t image, const PaletteMap& paletteMap); + BasicTextureInfo GetOrLoadBitmapTexture(uint32_t image, const void* pixels, size_t width, size_t height); GLuint GetAtlasesTexture(); GLuint GetPaletteTexture(); @@ -233,6 +234,7 @@ private: AtlasTextureInfo LoadImageTexture(uint32_t image); AtlasTextureInfo LoadGlyphTexture(uint32_t image, const PaletteMap& paletteMap); AtlasTextureInfo AllocateImage(int32_t imageWidth, int32_t imageHeight); + AtlasTextureInfo LoadBitmapTexture(uint32_t image, const void* pixels, size_t width, size_t height); static rct_drawpixelinfo GetImageAsDPI(uint32_t image, uint32_t tertiaryColour); static rct_drawpixelinfo GetGlyphAsDPI(uint32_t image, const PaletteMap& paletteMap); void FreeTextures(); diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 4d8772ded8..934c26e62f 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -7,10 +7,13 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Context.h" #include "../common.h" #include "../config/Config.h" #include "../core/String.hpp" #include "../drawing/Drawing.h" +#include "../drawing/IDrawingContext.h" +#include "../drawing/IDrawingEngine.h" #include "../interface/Viewport.h" #include "../localisation/Formatting.h" #include "../localisation/Localisation.h" @@ -525,6 +528,7 @@ static void ttf_draw_string_raw_sprite(rct_drawpixelinfo* dpi, std::string_view #ifndef NO_TTF +static int _ttfGlId = 0; static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info) { if (!ttf_initialise()) @@ -554,6 +558,37 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex int32_t width = surface->w; int32_t height = surface->h; + if (OpenRCT2::GetContext()->GetDrawingEngineType() == DrawingEngine::OpenGL) + { + auto pixels = reinterpret_cast(const_cast(surface->pixels)); + auto pixelsLen = static_cast(surface->pitch) * surface->h; + for (size_t pp = 0; pp < pixelsLen; pp++) + { + if (pixels[pp] != 0) + { + pixels[pp] = colour; + } + else + { + pixels[pp] = PALETTE_INDEX_0; + } + } + + auto baseId = uint32_t(0x7FFFF) - 1024; + auto imageId = baseId + _ttfGlId; + auto drawingEngine = dpi->DrawingEngine; + auto drawingContext = drawingEngine->GetDrawingContext(dpi); + drawingEngine->InvalidateImage(imageId); + drawingContext->DrawBitmap(imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); + + _ttfGlId++; + if (_ttfGlId >= 1023) + { + _ttfGlId = 0; + } + return; + } + int32_t overflowX = (dpi->x + dpi->width) - (drawX + width); int32_t overflowY = (dpi->y + dpi->height) - (drawY + height); if (overflowX < 0) diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 2fe2aef713..e8fbadc702 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -18,10 +18,7 @@ namespace OpenRCT2::Drawing struct IDrawingContext { - virtual ~IDrawingContext() - { - } - + virtual ~IDrawingContext() = default; virtual OpenRCT2::Drawing::IDrawingEngine* GetEngine() abstract; virtual void Clear(uint8_t paletteIndex) abstract; @@ -32,5 +29,7 @@ namespace OpenRCT2::Drawing virtual void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) abstract; virtual void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) abstract; virtual void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) abstract; + virtual void DrawBitmap( + uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) abstract; }; } // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index e462871162..b655cac749 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -150,6 +150,9 @@ namespace OpenRCT2 void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) override; void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; + void DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) override + { + } void SetDPI(rct_drawpixelinfo* dpi); }; From 01c808c601c647a9121dd8e3b55e44cdcf35067d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 20:54:06 +0300 Subject: [PATCH 236/681] Remove unused argument of wooden_(a|b)_supports_paint_setup --- src/openrct2/paint/Supports.cpp | 33 +- src/openrct2/paint/Supports.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 4 +- .../paint/tile_element/Paint.LargeScenery.cpp | 2 +- .../paint/tile_element/Paint.SmallScenery.cpp | 4 +- src/openrct2/ride/TrackPaint.cpp | 2 +- .../coaster/AirPoweredVerticalCoaster.cpp | 27 +- .../ride/coaster/HeartlineTwisterCoaster.cpp | 252 +-- src/openrct2/ride/coaster/HybridCoaster.cpp | 1659 ++++++++--------- .../ride/coaster/MineTrainCoaster.cpp | 1482 +++++++-------- .../ride/coaster/ReverseFreefallCoaster.cpp | 17 +- .../ride/coaster/ReverserRollerCoaster.cpp | 278 +-- .../coaster/SideFrictionRollerCoaster.cpp | 610 +++--- src/openrct2/ride/coaster/VirginiaReel.cpp | 40 +- .../ride/coaster/WoodenRollerCoaster.cpp | 1550 ++++++++------- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 33 +- src/openrct2/ride/gentle/CarRide.cpp | 2 +- src/openrct2/ride/gentle/Circus.cpp | 2 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 2 +- 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 | 2 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 2 +- src/openrct2/ride/gentle/Maze.cpp | 2 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 2 +- src/openrct2/ride/gentle/MiniGolf.cpp | 12 +- src/openrct2/ride/gentle/ObservationTower.cpp | 2 +- src/openrct2/ride/gentle/SpaceRings.cpp | 2 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 2 +- src/openrct2/ride/shops/Facility.cpp | 3 +- src/openrct2/ride/shops/Shop.cpp | 3 +- src/openrct2/ride/thrill/3dCinema.cpp | 2 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/GoKarts.cpp | 30 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 2 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 2 +- src/openrct2/ride/thrill/RotoDrop.cpp | 2 +- src/openrct2/ride/thrill/SwingingShip.cpp | 2 +- src/openrct2/ride/thrill/TopSpin.cpp | 2 +- src/openrct2/ride/thrill/Twist.cpp | 2 +- src/openrct2/ride/transport/Chairlift.cpp | 4 +- .../ride/transport/MiniatureRailway.cpp | 52 +- src/openrct2/ride/water/RiverRapids.cpp | 36 +- src/openrct2/ride/water/SplashBoats.cpp | 52 +- 45 files changed, 2908 insertions(+), 3323 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 9ac36e4c81..754f687298 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -456,13 +456,8 @@ static constexpr const uint16_t word_97B3C4[] = { * @returns (al) true if any supports have been drawn, otherwise false. */ bool wooden_a_supports_paint_setup( - paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, bool* underground) + paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags) { - if (underground != nullptr) - { - *underground = false; - } - if (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) { return false; @@ -477,10 +472,6 @@ bool wooden_a_supports_paint_setup( height -= z; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } height /= 16; @@ -501,10 +492,6 @@ bool wooden_a_supports_paint_setup( height -= 2; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } @@ -531,10 +518,6 @@ bool wooden_a_supports_paint_setup( height--; if (height < 0) { - if (underground != nullptr) - { - *underground = true; - } return false; } @@ -636,21 +619,17 @@ bool wooden_a_supports_paint_setup( * @return (al) whether supports have been drawn */ bool wooden_b_supports_paint_setup( - paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, bool* underground) + paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags) { bool _9E32B1 = false; if (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) { - if (underground != nullptr) - *underground = false; // AND return false; } if (!(session->Unk141E9DB & PaintSessionFlags::IsPassedSurface)) { - if (underground != nullptr) - *underground = false; // AND return false; } @@ -659,8 +638,6 @@ bool wooden_b_supports_paint_setup( if (supportLength < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -677,8 +654,6 @@ bool wooden_b_supports_paint_setup( heightSteps -= 2; if (heightSteps < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -708,8 +683,6 @@ bool wooden_b_supports_paint_setup( heightSteps -= 1; if (heightSteps < 0) { - if (underground != nullptr) - *underground = true; // STC return false; } @@ -806,8 +779,6 @@ bool wooden_b_supports_paint_setup( } } - if (underground != nullptr) - *underground = false; // AND return _9E32B1; } diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 11982addc9..15f2d160ae 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -15,9 +15,9 @@ constexpr const uint8_t NumVanillaWoodenSupportTypes = 49; bool wooden_a_supports_paint_setup( - paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, bool* underground); + paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags); bool wooden_b_supports_paint_setup( - paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, bool* underground); + paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags); bool metal_a_supports_paint_setup( paint_session* session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, uint32_t imageColourFlags); bool metal_b_supports_paint_setup( diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 42b672386b..def51a9793 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -206,7 +206,7 @@ static void ride_entrance_exit_paint( { image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id, nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -332,7 +332,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 { image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id, nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(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 f813261996..5a332d641e 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -52,7 +52,7 @@ static void large_scenery_paint_supports( supportImageColourFlags = dword_F4387C; } - wooden_b_supports_paint_setup(session, (direction & 1), ax, supportHeight, supportImageColourFlags, nullptr); + wooden_b_supports_paint_setup(session, (direction & 1), ax, supportHeight, supportImageColourFlags); int32_t clearanceHeight = ceil2(tileElement.GetClearanceZ() + 15, 16); diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 1ba7d0bc2d..c8cfb5e302 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -360,11 +360,11 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height } if (direction & 1) { - wooden_b_supports_paint_setup(session, 1, ax, supportHeight, supportImageColourFlags, nullptr); + wooden_b_supports_paint_setup(session, 1, ax, supportHeight, supportImageColourFlags); } else { - wooden_b_supports_paint_setup(session, 0, ax, supportHeight, supportImageColourFlags, nullptr); + wooden_b_supports_paint_setup(session, 0, ax, supportHeight, supportImageColourFlags); } } } diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 35efa3bf9c..99daa1465a 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1534,7 +1534,7 @@ void track_paint_util_right_quarter_turn_5_tiles_wooden_supports( { 1, 0xFF, 3, 5, 0xFF, 3, 0 }, }; uint8_t supportType = supportTypes[direction][trackSequence]; - wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } } diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 8fa2a2c333..0e66c3e734 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -190,7 +190,7 @@ static void air_powered_vertical_rc_track_flat( uint32_t imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -216,7 +216,7 @@ static void air_powered_vertical_rc_track_station( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, trackElement); @@ -339,7 +339,7 @@ static void air_powered_vertical_rc_track_flat_to_left_bank( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 1, 26, height, 0, 27, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -368,7 +368,7 @@ static void air_powered_vertical_rc_track_flat_to_right_bank( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 1, 26, height, 0, 27, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -519,7 +519,7 @@ static void air_powered_vertical_rc_track_left_bank( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -548,7 +548,7 @@ static void air_powered_vertical_rc_track_brakes( uint32_t imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -660,7 +660,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsParentRotated(session, direction, supportsImageId, 0, 0, 20, 32, bbHeight, height, 0, 6, height); PaintAddImageAsChildRotated(session, direction, trackImageId, 0, 0, 20, 32, bbHeight, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -684,7 +684,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsChildRotated(session, direction, trackImageId, 0, 0, 32, 20, bbHeight, height, 0, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (trackSequence == 0) { @@ -708,13 +708,12 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsChildRotated(session, direction, supportsImageId, 0, 0, 32, 20, bbHeight, height, 0, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); break; case 5: - if (wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr)) + if (wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS])) { uint32_t floorImageId; if (direction & 1) @@ -746,7 +745,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsParentRotated(session, direction, trackImageId, 0, 0, 1, 20, 126, height, 27, 6, height); PaintAddImageAsChildRotated(session, direction, supportsImageId, 0, 0, 1, 20, 126, height, 27, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_vertical_tunnel(session, height + 240); @@ -918,7 +917,7 @@ static void air_powered_vertical_rc_track_booster( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -937,7 +936,7 @@ static void air_powered_vertical_rc_track_onride_photo( uint32_t imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index c6e2e0cbae..2562cdb072 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -32,28 +32,28 @@ static void heartline_twister_rc_track_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21354, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21356, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21355, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21357, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21358, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21360, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21359, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21361, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -67,7 +67,7 @@ static void heartline_twister_rc_track_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21294, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21296, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -75,7 +75,7 @@ static void heartline_twister_rc_track_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21295, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21297, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -121,28 +121,28 @@ static void heartline_twister_rc_track_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21378, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21382, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21379, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21383, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21380, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21384, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21381, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21385, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -155,28 +155,28 @@ static void heartline_twister_rc_track_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21322, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21326, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21323, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21327, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21324, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21328, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21325, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21329, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -206,28 +206,28 @@ static void heartline_twister_rc_track_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21402, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21406, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21403, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21407, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21404, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21408, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21405, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21409, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -240,28 +240,28 @@ static void heartline_twister_rc_track_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21346, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21350, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21347, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21351, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21348, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21352, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21349, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21353, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -291,28 +291,28 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21362, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21366, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21363, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21367, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21364, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21368, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21365, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21369, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -325,28 +325,28 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -376,28 +376,28 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21386, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21390, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21387, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21391, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21388, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21392, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21389, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21393, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -410,28 +410,28 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21330, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21334, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21331, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21335, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21332, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21336, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21333, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21337, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -461,28 +461,28 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21394, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21398, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21395, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21399, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21396, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21400, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21397, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21401, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -495,28 +495,28 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21338, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21342, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21339, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21343, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21340, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21344, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21341, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21345, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -546,28 +546,28 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21370, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21374, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21371, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21375, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21372, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21376, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21373, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21377, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -580,28 +580,28 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -681,7 +681,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -689,7 +689,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -697,7 +697,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -705,7 +705,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -735,7 +735,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 6, 5, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -750,7 +750,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 7, 6, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -765,7 +765,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 6, 7, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -780,7 +780,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 7, 8, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -795,7 +795,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21302, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -803,7 +803,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21303, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -811,7 +811,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21304, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -819,7 +819,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21305, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -945,7 +945,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 6, 5, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -960,7 +960,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 7, 6, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -975,7 +975,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 6, 7, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -990,7 +990,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(session, 7, 8, height + 8, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height + 8, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1005,7 +1005,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21302, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1013,7 +1013,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21303, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1021,7 +1021,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21304, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1029,7 +1029,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21305, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1044,7 +1044,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1052,7 +1052,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1060,7 +1060,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1068,7 +1068,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 20, 0, height, 0, 6, height + 23); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1101,7 +1101,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21422, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1109,7 +1109,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21425, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1117,7 +1117,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21428, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1125,7 +1125,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21431, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); @@ -1141,7 +1141,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21423, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1149,7 +1149,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21426, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1157,7 +1157,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21429, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1165,7 +1165,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21432, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1180,7 +1180,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21424, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1188,7 +1188,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21427, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1196,7 +1196,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21430, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1204,7 +1204,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21433, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1219,7 +1219,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21430, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1227,7 +1227,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21433, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1235,7 +1235,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21424, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1243,7 +1243,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21427, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1258,7 +1258,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21429, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1266,7 +1266,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21432, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1274,7 +1274,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21423, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1282,7 +1282,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21426, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1297,7 +1297,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21428, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1305,7 +1305,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21431, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1313,7 +1313,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21422, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1321,7 +1321,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21425, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); @@ -1347,7 +1347,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21446, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1355,7 +1355,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21449, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1363,7 +1363,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21452, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1371,7 +1371,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21455, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); @@ -1387,7 +1387,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21447, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1395,7 +1395,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21450, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1403,7 +1403,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21453, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1411,7 +1411,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21456, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1426,7 +1426,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21448, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1434,7 +1434,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21451, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1442,7 +1442,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21454, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1450,7 +1450,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21457, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1465,7 +1465,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21454, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1473,7 +1473,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21457, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1481,7 +1481,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21448, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1489,7 +1489,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21451, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1504,7 +1504,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21453, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1512,7 +1512,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21456, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1520,7 +1520,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21447, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1528,7 +1528,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21450, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1543,7 +1543,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21452, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1551,7 +1551,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21455, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1559,7 +1559,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21446, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1567,7 +1567,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21449, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 434343faa8..7ce3ae777e 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -51,7 +51,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_FLAT + (direction & 1)), 0, 0, 32, 20, 3, height, 0, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -81,7 +81,7 @@ namespace HybridRC height + 3); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 10, trackElement); @@ -107,8 +107,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE + direction + 8), 0, 0, 32, 20, 2, height, 0, 6, height + 3); } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -162,8 +161,7 @@ namespace HybridRC session->WoodenSupportsPrependTo = ps; } - wooden_a_supports_paint_setup( - session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -192,8 +190,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE + direction), 0, 0, 32, 20, 3, height, 0, 6, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -274,8 +271,7 @@ namespace HybridRC break; } } - wooden_a_supports_paint_setup( - session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -357,8 +353,7 @@ namespace HybridRC break; } } - wooden_a_supports_paint_setup( - session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -387,8 +382,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE + direction + 4), 0, 0, 32, 20, 2, height, 0, 6, height + 3); } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -518,8 +512,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | imageIds[direction], 0, 0, boundBoxLengths[direction].x, boundBoxLengths[direction].y, boundBoxLengths[direction].z, height, boundBoxOffsets[direction].x, boundBoxOffsets[direction].y, boundBoxOffsets[direction].z); - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -635,25 +628,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 3), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 6), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 9), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -673,25 +666,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 1), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 4), 0, 0, 16, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 7), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 10), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -706,25 +699,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 2), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 5), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 8), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE + 11), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -763,25 +756,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 5), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 10), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 15), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -803,25 +796,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 1), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 6), 0, 0, 36, 16, 3, height, 0, 4, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 11), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 16), 0, 0, 32, 14, 3, height, 0, 18, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -838,25 +831,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 2), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 7), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 12), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 17), 0, 0, 33, 33, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -879,25 +872,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 3), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 8), 0, 0, 16, 36, 3, height, 4, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 13), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 18), 0, 0, 14, 32, 3, height, 18, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -914,25 +907,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 4), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 9), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 14), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 19), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -971,25 +964,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 4), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 8), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 12), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1006,25 +999,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 1), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 5), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 9), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 13), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1037,25 +1030,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 2), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 6), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 10), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 14), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1065,16 +1058,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1123,25 +1116,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 16), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 20), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 24), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 28), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1158,25 +1151,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 17), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 21), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 25), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 29), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1189,25 +1182,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 18), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 22), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 26), 0, 0, 28, 28, 3, height, 4, 4, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE + 30), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1217,16 +1210,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1321,8 +1314,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_LIFT_TRACK_FLAT_DIAGONAL + 0), -16, -16, 32, 32, 3, height, -16, -16, height); - wooden_a_supports_paint_setup( - session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1340,16 +1332,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1381,16 +1373,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1483,20 +1475,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1528,20 +1516,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1634,20 +1618,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1679,20 +1659,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1785,16 +1761,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1826,16 +1802,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1928,20 +1904,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -1973,20 +1945,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2078,20 +2046,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2122,20 +2086,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2228,16 +2188,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2269,16 +2229,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2371,20 +2331,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2416,20 +2372,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2522,20 +2474,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2567,20 +2515,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2673,20 +2617,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2718,20 +2658,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2824,20 +2760,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2869,20 +2801,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -2975,20 +2903,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3020,20 +2944,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3126,20 +3046,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3171,20 +3087,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3252,7 +3164,7 @@ namespace HybridRC height, 0, 6, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -3291,7 +3203,7 @@ namespace HybridRC height, 0, 27, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -3344,8 +3256,7 @@ namespace HybridRC height, 0, 6, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -3391,8 +3302,7 @@ namespace HybridRC height, 0, 27, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -3438,8 +3348,7 @@ namespace HybridRC height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -3485,8 +3394,7 @@ namespace HybridRC height, 0, 27, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -3560,7 +3468,7 @@ namespace HybridRC height, 0, 6, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -3606,16 +3514,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3633,16 +3541,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3693,16 +3601,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3723,16 +3631,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3786,16 +3694,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3813,16 +3721,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3873,16 +3781,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3903,16 +3811,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3966,16 +3874,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -3993,16 +3901,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4053,16 +3961,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4083,16 +3991,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4146,20 +4054,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4177,20 +4081,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4241,20 +4141,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4275,20 +4171,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4341,20 +4233,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4371,20 +4259,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4434,20 +4318,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4467,20 +4347,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4534,16 +4410,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4561,16 +4437,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4621,16 +4497,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4651,16 +4527,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4714,16 +4590,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4741,16 +4617,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4801,16 +4677,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4831,16 +4707,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -4877,7 +4753,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 1), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4886,19 +4762,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 5), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 9), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 13), 0, 0, 26, 32, 3, height, 6, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4918,25 +4794,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 2), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 6), 0, 0, 16, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 10), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 14), 0, 0, 22, 22, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -4951,7 +4827,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 3), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4960,7 +4836,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 8), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4969,13 +4845,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 12), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 15), 0, 0, 32, 26, 3, height, 6, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5017,7 +4893,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 1), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5026,19 +4902,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 7), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 14), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 20), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5060,25 +4936,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 2), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 8), 0, 0, 48, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 15), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 21), 0, 0, 32, 14, 3, height, 0, 18, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5095,7 +4971,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 3), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5104,19 +4980,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 10), 0, 0, 16, 16, 1, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 16), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 22), 0, 0, 38, 38, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5139,25 +5015,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 4), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 11), 0, 0, 16, 48, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 17), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 23), 0, 0, 14, 32, 3, height, 18, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5174,7 +5050,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 5), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5183,7 +5059,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 13), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5192,13 +5068,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 19), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 24), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5240,7 +5116,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 1), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5249,19 +5125,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 6), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 12), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 16), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5278,7 +5154,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 2), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5287,19 +5163,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 8), 0, 0, 34, 16, 0, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 13), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 17), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5312,25 +5188,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 3), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 9), 0, 0, 16, 16, 0, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 14), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 18), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5340,16 +5216,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5401,13 +5277,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 20), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 24), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5416,7 +5292,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 29), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5425,7 +5301,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 36), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5442,13 +5318,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 21), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 25), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5457,13 +5333,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 31), 0, 0, 34, 16, 0, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 37), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5476,25 +5352,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 22), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 26), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 32), 0, 0, 28, 28, 0, height, 4, 4, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 38), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5504,16 +5380,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); @@ -5582,25 +5458,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 0), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 2), 0, 6, 34, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 4), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 6), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5617,16 +5493,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5641,25 +5517,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 1), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 3), 6, 0, 20, 34, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 5), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 7), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5690,25 +5566,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 8), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 10), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 12), 0, 6, 34, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 14), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5725,16 +5601,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5749,25 +5625,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 9), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 11), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 13), 6, 0, 20, 34, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 15), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5814,25 +5690,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 5), 0, 0, 34, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 10), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 15), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5854,25 +5730,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 1), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 6), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 11), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 16), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5889,25 +5765,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 2), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 7), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 12), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 17), 0, 0, 16, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5930,25 +5806,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 3), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 8), 0, 0, 16, 32, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 13), 0, 0, 16, 32, 3, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 18), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5965,25 +5841,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 4), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 9), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 14), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 19), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -6014,25 +5890,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 20), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 25), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 30), 0, 0, 34, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 35), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -6054,25 +5930,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 21), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 26), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 31), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 36), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -6089,25 +5965,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 22), 0, 0, 16, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 27), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 32), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 37), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -6130,25 +6006,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 23), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 28), 0, 0, 16, 32, 3, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 33), 0, 0, 16, 32, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 38), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -6165,25 +6041,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 24), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 29), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 34), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 39), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -6230,7 +6106,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 1), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6239,7 +6115,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 3), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6248,7 +6124,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 5), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6257,7 +6133,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 7), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); @@ -6278,7 +6154,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 9), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6287,7 +6163,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 11), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6296,7 +6172,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 13), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6305,7 +6181,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 15), 0, 0, 28, 28, 1, height, 2, 2, height + 99); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } track_paint_util_right_quarter_turn_1_tile_tunnel( @@ -6462,8 +6338,7 @@ namespace HybridRC 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6506,8 +6381,7 @@ namespace HybridRC 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6550,8 +6424,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6594,8 +6467,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6669,8 +6541,7 @@ namespace HybridRC 20, 3, height, 0, 6, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -6716,8 +6587,7 @@ namespace HybridRC 20, 3, height, 0, 6, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -6763,8 +6633,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -6810,8 +6679,7 @@ namespace HybridRC 34, height, 0, 27, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -6879,8 +6747,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6920,8 +6787,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -6978,8 +6844,7 @@ namespace HybridRC 20, 3, height, 0, 6, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -7022,8 +6887,7 @@ namespace HybridRC 20, 3, height, 0, 6, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -7066,8 +6930,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -7110,8 +6973,7 @@ namespace HybridRC 20, 2, height, 0, 6, height + 3); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -7165,7 +7027,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 0), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7174,19 +7036,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 3), 0, 6, 34, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 6), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 9), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7203,16 +7065,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7227,7 +7089,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 1), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7236,7 +7098,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 5), 6, 0, 1, 34, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7245,13 +7107,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 8), 6, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 10), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -7282,13 +7144,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 11), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 13), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7297,13 +7159,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 17), 0, 6, 34, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 20), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7320,16 +7182,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7344,7 +7206,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 12), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7353,7 +7215,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 15), 6, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7362,13 +7224,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 19), 6, 0, 1, 34, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 21), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -7415,7 +7277,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7424,19 +7286,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 6), 0, 0, 34, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 15), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 21), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7458,7 +7320,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 1), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7467,19 +7329,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 8), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 16), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 22), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7496,7 +7358,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 2), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7505,19 +7367,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 10), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 17), 0, 0, 1, 1, 3, height, 64, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 23), 0, 0, 16, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7540,7 +7402,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 3), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7549,19 +7411,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 12), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 18), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 24), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7578,7 +7440,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 4), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7587,7 +7449,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 14), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7596,13 +7458,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 20), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 25), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -7633,13 +7495,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 26), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 31), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7648,13 +7510,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 38), 0, 0, 34, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 47), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7676,13 +7538,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 27), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 32), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7691,13 +7553,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 40), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 48), 0, 0, 32, 16, 3, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7714,13 +7576,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 28), 0, 0, 16, 16, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 33), 0, 0, 1, 1, 3, height, 64, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7729,13 +7591,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 42), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 49), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7758,13 +7620,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 29), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 34), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7773,13 +7635,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 44), 0, 0, 1, 1, 34, height, 30, 30, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 50), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7796,7 +7658,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 30), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7805,7 +7667,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 36), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7814,13 +7676,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 46), 0, 0, 1, 32, 34, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 51), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -7867,25 +7729,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 4), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 3), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 7), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7902,25 +7764,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 1), 0, 0, 32, 26, 3, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 5), 0, 0, 34, 26, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 2), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 6), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7937,25 +7799,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 2), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 6), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 1), 0, 0, 32, 26, 3, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 5), 0, 0, 34, 26, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7972,25 +7834,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 3), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 7), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 0), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 4), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8021,25 +7883,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 8), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 12), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 11), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 15), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8056,25 +7918,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 9), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 13), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 10), 0, 0, 34, 26, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 14), 0, 0, 32, 26, 3, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8091,25 +7953,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 10), 0, 0, 34, 26, 3, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 14), 0, 0, 32, 26, 3, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 9), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 13), 0, 0, 32, 26, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8126,25 +7988,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 11), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 15), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 8), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_S_BEND + 12), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8178,7 +8040,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 1), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8187,19 +8049,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 5), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 9), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 13), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8213,16 +8075,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -8234,25 +8096,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 2), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 6), 0, 0, 16, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 10), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 14), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8267,7 +8129,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 3), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8276,7 +8138,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 8), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8285,13 +8147,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 12), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 15), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8313,7 +8175,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 13), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8322,7 +8184,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 1), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8331,13 +8193,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 5), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 9), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8356,16 +8218,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -8377,25 +8239,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 14), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 2), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 6), 0, 0, 16, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 10), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8410,13 +8272,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 15), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 3), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8425,7 +8287,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 8), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8434,7 +8296,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 12), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8460,13 +8322,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 16), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 19), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8475,7 +8337,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 24), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8484,7 +8346,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 29), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8498,16 +8360,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -8519,25 +8381,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 17), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 20), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 25), 0, 0, 16, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 30), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8552,7 +8414,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 18), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8561,7 +8423,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 22), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8570,13 +8432,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 27), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 31), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8598,7 +8460,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 19), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8607,7 +8469,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 24), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8616,13 +8478,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 29), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 16), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8641,16 +8503,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -8662,25 +8524,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 20), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 25), 0, 0, 16, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 30), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 17), 0, 0, 16, 16, 3, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8698,7 +8560,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 22), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8707,19 +8569,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 27), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 31), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_SMALL_HELIX + 18), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8774,7 +8636,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 1), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8783,19 +8645,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 7), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 14), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 20), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -8817,25 +8679,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 2), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 8), 0, 0, 33, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 15), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 21), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8852,7 +8714,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 3), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8861,19 +8723,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 10), 0, 0, 16, 16, 1, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 16), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 22), 0, 0, 34, 34, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8896,25 +8758,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 4), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 11), 0, 0, 16, 33, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 17), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 23), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -8931,7 +8793,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 5), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8940,7 +8802,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 13), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8949,13 +8811,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 19), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 24), 0, 0, 28, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -8977,7 +8839,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 20), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8986,7 +8848,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 1), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8995,13 +8857,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 7), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 14), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -9028,25 +8890,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 21), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 2), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 8), 0, 0, 16, 32, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 15), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9063,13 +8925,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 22), 0, 0, 16, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 3), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9078,13 +8940,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 10), 0, 0, 16, 16, 1, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 16), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9107,25 +8969,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 23), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 4), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 11), 0, 0, 32, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 17), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9142,13 +9004,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 24), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 5), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9157,7 +9019,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 13), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -9166,7 +9028,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 19), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -9192,13 +9054,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 25), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 30), 0, 0, 32, 32, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9207,7 +9069,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 37), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -9216,7 +9078,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 45), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -9238,25 +9100,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 26), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 31), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 38), 0, 0, 33, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 46), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9273,13 +9135,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 27), 0, 0, 34, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 32), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9288,13 +9150,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 40), 0, 0, 16, 16, 1, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 47), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9317,25 +9179,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 28), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 33), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 41), 0, 0, 16, 33, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 48), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9352,7 +9214,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 29), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9361,7 +9223,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 35), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9370,13 +9232,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 43), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 49), 0, 0, 32, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -9398,7 +9260,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 30), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9407,7 +9269,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 37), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9416,13 +9278,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 45), 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 25), 0, 0, 20, 32, 3, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -9449,25 +9311,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 31), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 38), 0, 0, 16, 32, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 46), 0, 0, 16, 32, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 26), 0, 0, 16, 32, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9484,7 +9346,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 32), 0, 0, 16, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9493,19 +9355,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 40), 0, 0, 16, 16, 1, height, 16, 16, height + 28); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 47), 0, 0, 16, 16, 3, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 27), 0, 0, 16, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9528,25 +9390,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 33), 0, 0, 32, 16, 3, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 41), 0, 0, 32, 16, 1, height, 0, 0, height + 28); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 48), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 28), 0, 0, 32, 16, 3, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -9566,7 +9428,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 35), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9575,19 +9437,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 43), 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 49), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_LARGE_HELIX + 29), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -9668,8 +9530,7 @@ namespace HybridRC 0, height, 0, 6, height + 40); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -9713,8 +9574,7 @@ namespace HybridRC 0, height, 0, 6, height + 40); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -9763,8 +9623,7 @@ namespace HybridRC paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -9813,8 +9672,7 @@ namespace HybridRC 0, height, 0, 6, height + 40); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -9858,8 +9716,7 @@ namespace HybridRC 0, height, 0, 6, height + 40); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -9899,8 +9756,7 @@ namespace HybridRC 0, height, 0, 6, height + 56); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: @@ -10011,8 +9867,7 @@ namespace HybridRC 64, height, 0, 32, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); break; @@ -10052,8 +9907,7 @@ namespace HybridRC 32, height, 0, 32, height); break; } - wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); @@ -10078,7 +9932,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BRAKE + (direction & 1)), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -10093,7 +9947,7 @@ namespace HybridRC session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_FLAT + (direction & 1)), 0, 0, 32, 20, 0, height, 0, 6, height + 3); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -10130,7 +9984,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 50 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 50 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -10163,7 +10017,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 54 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 54 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -10192,7 +10046,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 58 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 58 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 64, 0x20); break; @@ -10221,7 +10075,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 62 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 62 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: @@ -10268,7 +10122,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 66 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 66 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_7); @@ -10301,7 +10155,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 70 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 70 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 80, 0x20); break; @@ -10330,7 +10184,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 74 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 74 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 56, 0x20); break; @@ -10359,7 +10213,7 @@ namespace HybridRC break; } wooden_a_supports_paint_setup( - session, direction & 1, 78 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, direction & 1, 78 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: @@ -10396,7 +10250,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BLOCK_BRAKE + (direction & 1)), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -10409,7 +10263,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_BOOSTER + (direction & 1)), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -10422,8 +10276,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_POWERED_LIFT + direction), 0, 0, 32, 20, 3, height, 0, 6, height); - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -10449,7 +10302,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 0), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -10458,19 +10311,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 3), 0, 6, 34, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 5), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 7), 0, 6, 32, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -10487,16 +10340,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -10511,25 +10364,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 1), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 4), 6, 0, 20, 34, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 6), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 8), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -10560,13 +10413,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 9), 0, 6, 32, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 11), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10575,13 +10428,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 14), 0, 6, 34, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 16), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -10598,16 +10451,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -10622,25 +10475,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 10), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 12), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 15), 6, 0, 20, 34, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 17), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -10671,25 +10524,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 12), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 15), 0, 6, 34, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 17), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 10), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -10706,16 +10559,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -10730,7 +10583,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 11), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -10739,19 +10592,19 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 14), 6, 0, 1, 34, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 16), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 9), 6, 0, 32, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -10782,25 +10635,25 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 8), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 1), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 4), 0, 6, 34, 20, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 6), 0, 6, 32, 20, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -10817,16 +10670,16 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -10841,13 +10694,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 7), 6, 0, 32, 32, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 0), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10856,13 +10709,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 3), 6, 0, 1, 34, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session) | (SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 5), 6, 0, 20, 32, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index 104dbbc076..7b1539b5e5 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -42,22 +42,22 @@ static void mine_train_rc_track_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20054, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20055, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20056, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20057, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -69,13 +69,13 @@ static void mine_train_rc_track_flat( case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -131,22 +131,22 @@ static void mine_train_rc_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20102, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20103, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20104, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20105, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -157,22 +157,22 @@ static void mine_train_rc_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20074, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20075, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20076, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20077, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -198,22 +198,22 @@ static void mine_train_rc_track_60_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20090, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 21, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20091, 0, 0, 1, 32, 98, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 22, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20092, 0, 0, 1, 32, 98, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 23, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20093, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 24, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -240,22 +240,22 @@ static void mine_train_rc_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20094, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20095, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20096, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20097, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -266,22 +266,22 @@ static void mine_train_rc_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20066, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20067, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20068, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20069, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -307,26 +307,26 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20078, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 13, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20079, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20082, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 14, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20080, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20083, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 15, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20081, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 16, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -351,26 +351,26 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20084, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 17, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20085, 0, 0, 24, 1, 61, height, 4, 29, height - 16); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20088, 0, 0, 32, 2, 66, height, 0, 4, height); - wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 18, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: session->WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20086, 0, 0, 24, 1, 61, height, 4, 29, height - 16); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20089, 0, 0, 32, 2, 66, height, 0, 4, height); - wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 19, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20087, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 20, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -397,22 +397,22 @@ static void mine_train_rc_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20098, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20099, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20100, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20101, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -423,22 +423,22 @@ static void mine_train_rc_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20070, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20071, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20072, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20073, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -515,22 +515,22 @@ static void mine_train_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20155, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20160, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20165, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20150, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -551,24 +551,24 @@ static void mine_train_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20154, 0, 0, 32, 16, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20159, 0, 0, 32, 16, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20164, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20149, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -585,24 +585,24 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20153, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20158, 0, 0, 16, 16, 1, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20163, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20148, 0, 0, 16, 16, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -625,23 +625,23 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20152, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20157, 0, 0, 16, 32, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20162, 0, 0, 16, 32, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20147, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -657,22 +657,22 @@ static void mine_train_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20151, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20156, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20161, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20146, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -711,24 +711,24 @@ static void mine_train_rc_track_flat_to_left_bank( session, direction, session->TrackColours[SCHEME_TRACK] | 20106, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20114, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20107, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20115, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20108, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20109, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -746,26 +746,26 @@ static void mine_train_rc_track_flat_to_right_bank( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20110, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20111, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20112, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20116, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20113, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20117, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -785,24 +785,24 @@ static void mine_train_rc_track_left_bank_to_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 20112, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20116, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20113, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20117, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20110, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20111, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -820,26 +820,26 @@ static void mine_train_rc_track_right_bank_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20108, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20109, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20106, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20114, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20107, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20115, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -863,23 +863,23 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20186, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20180, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20185, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20170, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -900,25 +900,25 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20174, 0, 0, 32, 16, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20179, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20184, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20169, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -935,24 +935,24 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20173, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20183, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20168, 0, 0, 16, 16, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -975,24 +975,24 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20172, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20177, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20182, 0, 0, 16, 32, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20167, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1008,13 +1008,13 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20171, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20176, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1022,12 +1022,12 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20187, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20166, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1066,24 +1066,24 @@ static void mine_train_rc_track_left_bank_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 20118, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20122, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20119, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20123, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20120, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20121, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1108,26 +1108,26 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20124, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20125, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20126, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20128, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20127, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20129, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1154,24 +1154,24 @@ static void mine_train_rc_track_25_deg_up_to_left_bank( session, direction, session->TrackColours[SCHEME_TRACK] | 20130, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20134, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20131, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20135, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20132, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20133, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1196,26 +1196,26 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20136, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20137, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20138, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20140, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20139, 0, 0, 32, 20, 1, height, 0, 6, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20141, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1272,22 +1272,22 @@ static void mine_train_rc_track_left_bank( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20142, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20143, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20144, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20145, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -1316,22 +1316,22 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20250, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20255, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20260, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20265, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1352,24 +1352,24 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20251, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20256, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20261, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20266, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1386,24 +1386,24 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20252, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20257, 0, 0, 16, 16, 1, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20262, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20267, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1426,23 +1426,23 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20253, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20258, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20263, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20268, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1458,22 +1458,22 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20254, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20259, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20264, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20269, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1504,22 +1504,22 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20230, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20235, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20240, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20245, 0, 0, 32, 27, 1, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1541,23 +1541,23 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20231, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20236, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20241, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20246, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1573,25 +1573,25 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20232, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20237, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20242, 0, 0, 16, 16, 1, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20247, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1614,23 +1614,23 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20233, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20238, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20243, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20248, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1646,22 +1646,22 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20234, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20239, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20244, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20249, 0, 0, 27, 32, 1, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1710,22 +1710,22 @@ static void mine_train_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20270, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20274, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20273, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20277, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1741,22 +1741,22 @@ static void mine_train_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20271, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20275, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20272, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20276, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1772,22 +1772,22 @@ static void mine_train_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20272, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20276, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20271, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20275, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1803,22 +1803,22 @@ static void mine_train_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20273, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20277, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20270, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20274, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1849,22 +1849,22 @@ static void mine_train_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20278, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20282, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20281, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20285, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1880,22 +1880,22 @@ static void mine_train_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20279, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20283, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20280, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20284, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1911,22 +1911,22 @@ static void mine_train_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20280, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20284, 0, 0, 32, 26, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20279, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20283, 0, 0, 32, 26, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1942,22 +1942,22 @@ static void mine_train_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20281, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20285, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20278, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20282, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1988,22 +1988,22 @@ static void mine_train_rc_track_left_quarter_turn_3( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20193, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20196, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20199, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20190, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2017,16 +2017,16 @@ static void mine_train_rc_track_left_quarter_turn_3( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2064,22 +2064,22 @@ static void mine_train_rc_track_left_quarter_turn_3( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20191, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20194, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20197, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20188, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2122,23 +2122,23 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20212, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20208, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20211, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20202, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2152,16 +2152,16 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2200,13 +2200,13 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20203, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20206, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2214,12 +2214,12 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20213, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20200, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2259,22 +2259,22 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20225, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20227, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20229, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20223, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2288,16 +2288,16 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 56, 0x20); @@ -2313,22 +2313,22 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20224, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20226, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20228, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20222, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2359,22 +2359,22 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20214, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20216, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20218, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20220, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2388,16 +2388,16 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 56, 0x20); @@ -2413,22 +2413,22 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20215, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20217, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20219, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20221, 6, 0, 20, 32, 1, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2480,23 +2480,23 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20312, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20308, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20311, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20302, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2514,16 +2514,16 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2562,13 +2562,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20303, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20306, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2576,12 +2576,12 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20313, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20300, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2606,7 +2606,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20302, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2614,18 +2614,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20312, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20308, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20311, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2648,16 +2648,16 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2696,18 +2696,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20300, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20303, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20306, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2715,7 +2715,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20313, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2745,18 +2745,18 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20286, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20289, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20292, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2764,7 +2764,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20299, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2782,16 +2782,16 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2830,7 +2830,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20288, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2838,18 +2838,18 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20298, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20294, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20297, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2874,13 +2874,13 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20289, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20292, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2888,12 +2888,12 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20299, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20286, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2916,16 +2916,16 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -2967,23 +2967,23 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20298, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20294, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20297, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20288, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3046,23 +3046,23 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20356, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20350, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20355, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20340, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3087,25 +3087,25 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20344, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20349, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20354, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20339, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3122,7 +3122,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20343, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3131,18 +3131,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20353, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20338, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3163,7 +3163,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20342, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3172,18 +3172,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20177, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20352, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20337, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3199,13 +3199,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20341, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20346, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3213,12 +3213,12 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20357, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20336, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3243,7 +3243,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20340, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3251,18 +3251,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20356, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20350, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20355, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3293,24 +3293,24 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20339, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20344, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20349, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20354, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3326,13 +3326,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20338, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20343, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3341,13 +3341,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20353, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3368,13 +3368,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20337, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20342, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3383,12 +3383,12 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20177, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20352, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3404,18 +3404,18 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20336, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20341, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20346, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3423,7 +3423,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20357, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3453,18 +3453,18 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20314, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20319, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20324, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3472,7 +3472,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20335, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3498,24 +3498,24 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20315, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20320, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20325, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20330, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3531,25 +3531,25 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20316, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20321, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20326, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20331, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3570,24 +3570,24 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20317, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20322, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20327, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20332, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3603,7 +3603,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20318, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3611,18 +3611,18 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20334, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20328, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20333, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3647,13 +3647,13 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20319, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20324, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3661,12 +3661,12 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20335, 0, 0, 1, 32, 26, height, 27, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20314, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3697,24 +3697,24 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20320, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20325, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20330, 0, 0, 16, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20315, 0, 0, 16, 32, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3731,24 +3731,24 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20321, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20326, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20331, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20316, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3768,25 +3768,25 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20322, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20327, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20332, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20317, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -3805,23 +3805,23 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20334, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20328, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20333, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20318, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3879,13 +3879,13 @@ static void mine_train_rc_track_brakes( case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20058, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20059, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -3903,22 +3903,22 @@ static void mine_train_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } track_paint_util_onride_photo_paint(session, direction, height + 2, trackElement); @@ -3940,22 +3940,22 @@ static void mine_train_rc_track_left_eighth_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20452, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20456, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20460, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20464, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3971,24 +3971,24 @@ static void mine_train_rc_track_left_eighth_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20453, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20457, 0, 0, 34, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20461, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20465, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4001,24 +4001,24 @@ static void mine_train_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20454, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20458, 0, 0, 16, 16, 1, height, 16, 16, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20462, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20466, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4028,16 +4028,16 @@ static void mine_train_rc_track_left_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4085,22 +4085,22 @@ static void mine_train_rc_track_right_eighth_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20436, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20440, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20444, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20448, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4117,23 +4117,23 @@ static void mine_train_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20437, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20441, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20445, 0, 0, 34, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20449, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4145,24 +4145,24 @@ static void mine_train_rc_track_right_eighth_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20438, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20442, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20446, 0, 0, 28, 28, 1, height, 4, 4, height); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20450, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4172,16 +4172,16 @@ static void mine_train_rc_track_right_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4248,23 +4248,23 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20484, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20488, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20492, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20496, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4280,25 +4280,25 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20485, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20489, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20493, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20497, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4311,24 +4311,24 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20486, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20490, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20494, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20498, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4338,16 +4338,16 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4395,24 +4395,24 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20468, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20472, 0, 0, 32, 32, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20476, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20480, 0, 0, 32, 1, 26, height, 0, 27, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4429,24 +4429,24 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20469, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20473, 0, 0, 32, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20477, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20481, 0, 0, 32, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4458,25 +4458,25 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20470, 0, 0, 16, 16, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20474, 0, 0, 16, 16, 1, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20478, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20482, 0, 0, 16, 16, 1, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4486,16 +4486,16 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4590,16 +4590,16 @@ static void mine_train_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20386, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4611,16 +4611,16 @@ static void mine_train_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20358, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4633,19 +4633,19 @@ static void mine_train_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20388, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4654,19 +4654,19 @@ static void mine_train_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20360, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4744,20 +4744,16 @@ static void mine_train_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20398, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4769,20 +4765,16 @@ static void mine_train_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20370, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4795,23 +4787,19 @@ static void mine_train_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20400, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4820,23 +4808,19 @@ static void mine_train_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20372, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4898,16 +4882,16 @@ static void mine_train_rc_track_diag_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20382, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4917,19 +4901,19 @@ static void mine_train_rc_track_diag_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20384, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -4992,16 +4976,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20390, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5013,16 +4997,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20362, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5035,19 +5019,19 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20392, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5056,19 +5040,19 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20364, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5130,16 +5114,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20374, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5149,19 +5133,19 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20376, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5208,16 +5192,16 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20378, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5227,19 +5211,19 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20380, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5302,20 +5286,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20394, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5327,20 +5307,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20366, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5353,23 +5329,19 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20396, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5378,23 +5350,19 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20368, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5472,20 +5440,16 @@ static void mine_train_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20400, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5497,20 +5461,16 @@ static void mine_train_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20372, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5523,23 +5483,19 @@ static void mine_train_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20398, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5548,23 +5504,19 @@ static void mine_train_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20370, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5626,16 +5578,16 @@ static void mine_train_rc_track_diag_60_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20384, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5645,19 +5597,19 @@ static void mine_train_rc_track_diag_60_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20382, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5719,20 +5671,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20396, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5744,20 +5692,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20368, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5769,23 +5713,19 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20394, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5794,23 +5734,19 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20366, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup( - session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5872,16 +5808,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20380, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5891,19 +5827,19 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20378, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5950,16 +5886,16 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20376, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -5969,19 +5905,19 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20374, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6044,16 +5980,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20392, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6065,16 +6001,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20364, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6087,19 +6023,19 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20390, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6108,19 +6044,19 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20362, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6185,16 +6121,16 @@ static void mine_train_rc_track_diag_flat_to_left_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20410, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6204,19 +6140,19 @@ static void mine_train_rc_track_diag_flat_to_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20408, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6263,16 +6199,16 @@ static void mine_train_rc_track_diag_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20411, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6282,10 +6218,10 @@ static void mine_train_rc_track_diag_flat_to_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6294,10 +6230,10 @@ static void mine_train_rc_track_diag_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20415, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6347,16 +6283,16 @@ static void mine_train_rc_track_diag_left_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20415, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6366,19 +6302,19 @@ static void mine_train_rc_track_diag_left_bank_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20411, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6425,16 +6361,16 @@ static void mine_train_rc_track_diag_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20408, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6444,10 +6380,10 @@ static void mine_train_rc_track_diag_right_bank_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6456,10 +6392,10 @@ static void mine_train_rc_track_diag_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20410, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6509,16 +6445,16 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20430, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6528,19 +6464,19 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20428, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6587,16 +6523,16 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20431, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6606,10 +6542,10 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6618,10 +6554,10 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20435, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6671,16 +6607,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20420, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6690,19 +6626,19 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20418, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6749,16 +6685,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20421, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6768,10 +6704,10 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6780,10 +6716,10 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20425, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6831,16 +6767,16 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20425, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -6848,19 +6784,19 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20421, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -6904,16 +6840,16 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20418, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -6921,10 +6857,10 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 10, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 11, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6933,10 +6869,10 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20420, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 8, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 9, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -6985,16 +6921,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20435, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7004,19 +6940,19 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20431, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7063,16 +6999,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20428, -16, -16, 32, 32, 1, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7082,10 +7018,10 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7094,10 +7030,10 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20430, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7145,16 +7081,16 @@ static void mine_train_rc_track_diag_left_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20402, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7165,19 +7101,19 @@ static void mine_train_rc_track_diag_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20404, -16, -16, 32, 32, 3, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7227,16 +7163,16 @@ static void mine_train_rc_track_diag_right_bank( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20404, -16, -16, 32, 32, 3, height, -16, -16, height); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7247,19 +7183,19 @@ static void mine_train_rc_track_diag_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 10, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 11, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 20402, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 9, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -7291,7 +7227,7 @@ static void mine_train_rc_track_block_brakes( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | _MineTrainBlockBrakeImages[direction][isClosed], 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 8487a3aba5..e4c1c12cef 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -212,7 +212,7 @@ static void paint_reverse_freefall_rc_flat( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -233,8 +233,7 @@ static void paint_reverse_freefall_rc_station( imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup( - session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) @@ -247,8 +246,7 @@ static void paint_reverse_freefall_rc_station( imageId = reverse_freefall_rc_track_pieces_station[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsChild(session, imageId, 0, 0, 20, 32, 1, height, 6, 0, height); - wooden_a_supports_paint_setup( - session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1) ? 1 : 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } @@ -306,13 +304,12 @@ static void paint_reverse_freefall_rc_slope( PaintAddImageAsChildRotated(session, direction, supportsImageId, 0, 0, 32, 20, bbHeight, height, 0, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); break; case 5: - if (wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr)) + if (wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS])) { uint32_t floorImageId; if (direction & 1) @@ -348,7 +345,7 @@ static void paint_reverse_freefall_rc_slope( PaintAddImageAsParentRotated(session, direction, trackImageId, 0, 0, 1, 20, 126, height, 27, 6, height); PaintAddImageAsChildRotated(session, direction, supportsImageId, 0, 0, 1, 20, 126, height, 27, 6, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); break; @@ -411,7 +408,7 @@ static void paint_reverse_freefall_rc_onride_photo( uint32_t imageId = imageIds[direction] | colour; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index f601ccba74..aaabb4d2e2 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -58,13 +58,13 @@ static void reverser_rc_track_flat( case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21520, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21521, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -76,13 +76,13 @@ static void reverser_rc_track_flat( case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21504, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21505, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -107,7 +107,7 @@ static void reverser_rc_track_station( PaintAddImageAsChildRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -126,22 +126,22 @@ static void reverser_rc_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21530, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21531, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21532, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21533, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -152,22 +152,22 @@ static void reverser_rc_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21516, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21517, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21518, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21519, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -195,22 +195,22 @@ static void reverser_rc_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21522, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21523, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21524, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21525, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -221,22 +221,22 @@ static void reverser_rc_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21508, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21509, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21510, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21511, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -264,22 +264,22 @@ static void reverser_rc_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21526, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21527, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21528, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21529, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -290,22 +290,22 @@ static void reverser_rc_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21512, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21513, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21514, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21515, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -358,22 +358,22 @@ static void reverser_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21543, 0, 2, 32, 27, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21548, 0, 2, 32, 27, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21553, 0, 2, 32, 32, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21538, 0, 2, 32, 32, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -394,22 +394,22 @@ static void reverser_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21542, 0, 0, 32, 16, 2, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21547, 0, 0, 32, 16, 2, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21552, 0, 16, 32, 16, 2, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21537, 0, 16, 32, 16, 2, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -425,22 +425,22 @@ static void reverser_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21541, 0, 16, 16, 16, 2, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21546, 16, 16, 16, 16, 2, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21551, 16, 0, 16, 16, 2, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21536, 0, 0, 16, 16, 2, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -462,22 +462,22 @@ static void reverser_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21540, 16, 0, 16, 34, 2, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21545, 0, 0, 16, 32, 2, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21550, 0, 0, 16, 32, 2, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21535, 16, 0, 16, 32, 2, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -493,22 +493,22 @@ static void reverser_rc_track_left_quarter_turn_5( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21539, 2, 0, 32, 32, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21544, 2, 0, 27, 32, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21549, 2, 0, 27, 32, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21534, 2, 0, 32, 32, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -548,22 +548,22 @@ static void reverser_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21566, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21570, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21569, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21573, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -579,22 +579,22 @@ static void reverser_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21567, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21571, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21568, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21572, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -610,22 +610,22 @@ static void reverser_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21568, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21572, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21567, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21571, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -641,22 +641,22 @@ static void reverser_rc_track_s_bend_left( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21569, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21573, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21566, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21570, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -687,22 +687,22 @@ static void reverser_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21574, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21578, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21577, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21581, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -718,22 +718,22 @@ static void reverser_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21575, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21579, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21576, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21580, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -749,22 +749,22 @@ static void reverser_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21576, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21580, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21575, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21579, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -780,22 +780,22 @@ static void reverser_rc_track_s_bend_right( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21577, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21581, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21574, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21578, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -826,22 +826,22 @@ static void reverser_rc_track_left_quarter_turn_3( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21559, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21562, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21565, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21556, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -887,22 +887,22 @@ static void reverser_rc_track_left_quarter_turn_3( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21557, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21560, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21563, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21554, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -940,13 +940,13 @@ static void reverser_rc_track_brakes( case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21506, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21507, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -967,22 +967,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21582, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21588, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21594, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21600, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -998,22 +998,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21585, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21591, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21597, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21603, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1025,22 +1025,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21586, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21592, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21598, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21604, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1052,22 +1052,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21587, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21593, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21599, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21605, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1079,22 +1079,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21583, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21589, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21595, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21601, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1106,22 +1106,22 @@ static void reverser_rc_track_left_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21584, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21590, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21596, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21602, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1152,22 +1152,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21596, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21602, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21584, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21590, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1183,22 +1183,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21599, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21605, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21587, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21593, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1210,22 +1210,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21598, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21604, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21586, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21592, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1237,22 +1237,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21597, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21603, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21585, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21591, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1264,22 +1264,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21595, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21601, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21583, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21589, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1291,22 +1291,22 @@ static void reverser_rc_track_right_reverser( case 0: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21594, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21600, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21582, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21588, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index 9cf64bdcf9..da4d84a5b7 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -80,7 +80,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21664, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -88,7 +88,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21665, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -96,7 +96,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21668, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -104,7 +104,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21669, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -119,7 +119,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21608, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -128,7 +128,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21609, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -151,7 +151,7 @@ static void side_friction_rc_track_station( PaintAddImageAsParentRotated( session, direction, imageIds[direction] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -172,28 +172,28 @@ static void side_friction_rc_track_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21678, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21690, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21679, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21691, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21680, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21692, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21681, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21693, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -206,28 +206,28 @@ static void side_friction_rc_track_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21622, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21634, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21623, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21635, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21624, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21636, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21625, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21637, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -257,28 +257,28 @@ static void side_friction_rc_track_flat_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21670, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21682, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21671, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21683, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21672, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21684, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21673, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21685, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -291,28 +291,28 @@ static void side_friction_rc_track_flat_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | 21614, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21626, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21615, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21627, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21616, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21628, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21617, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21629, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -342,28 +342,28 @@ static void side_friction_rc_track_25_deg_up_to_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21674, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21686, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21675, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21687, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21676, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21688, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21677, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21689, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -376,28 +376,28 @@ static void side_friction_rc_track_25_deg_up_to_flat( session, direction, session->TrackColours[SCHEME_TRACK] | 21618, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21630, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21619, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21631, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21620, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21632, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21621, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21633, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -453,7 +453,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21747, 0, 2, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -461,7 +461,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21752, 0, 2, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -469,7 +469,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21757, 0, 2, 32, 32, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -477,7 +477,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21742, 0, 2, 32, 32, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -501,7 +501,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21746, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -509,7 +509,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21751, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -517,7 +517,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21756, 0, 16, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -525,7 +525,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21741, 0, 16, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -544,7 +544,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21745, 0, 16, 16, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -552,7 +552,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21750, 16, 16, 16, 16, 0, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -560,7 +560,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21755, 16, 0, 16, 16, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -568,7 +568,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21740, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -593,7 +593,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21744, 16, 0, 16, 34, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -601,7 +601,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21749, 0, 0, 16, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -609,7 +609,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21754, 0, 0, 16, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -617,7 +617,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21739, 16, 0, 16, 32, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -636,7 +636,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21743, 2, 0, 32, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -644,7 +644,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21748, 2, 0, 27, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -652,7 +652,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21753, 2, 0, 27, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -660,7 +660,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21738, 2, 0, 32, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -703,7 +703,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21904, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -711,7 +711,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21908, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -719,7 +719,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21907, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -727,7 +727,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21911, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -746,7 +746,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21905, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -754,7 +754,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21909, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -762,7 +762,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21906, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -770,7 +770,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21910, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -789,7 +789,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21906, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -797,7 +797,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21910, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -805,7 +805,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21905, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -813,7 +813,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21909, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -832,7 +832,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21907, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -840,7 +840,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21911, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -848,7 +848,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21904, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -856,7 +856,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21908, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -890,7 +890,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21912, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -898,7 +898,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21916, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -906,7 +906,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21915, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -914,7 +914,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21919, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -933,7 +933,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21913, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -941,7 +941,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21917, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -949,7 +949,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21914, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -957,7 +957,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21918, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -976,7 +976,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21914, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -984,7 +984,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21918, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -992,7 +992,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21913, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1000,7 +1000,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21917, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1019,7 +1019,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21915, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1027,7 +1027,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21919, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1035,7 +1035,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21912, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1043,7 +1043,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21916, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1077,7 +1077,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21711, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1085,7 +1085,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21714, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1093,7 +1093,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21717, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1101,7 +1101,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21708, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1162,7 +1162,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21709, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1170,7 +1170,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21712, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1178,7 +1178,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21715, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1186,7 +1186,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21706, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1226,7 +1226,7 @@ static void side_friction_rc_track_brakes( session, direction, session->TrackColours[SCHEME_TRACK] | 21610, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21612, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -1234,7 +1234,7 @@ static void side_friction_rc_track_brakes( session, direction, session->TrackColours[SCHEME_TRACK] | 21611, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21613, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -1258,7 +1258,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21806, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1266,7 +1266,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21810, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1274,7 +1274,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21814, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1282,7 +1282,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21818, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1301,7 +1301,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21807, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1309,7 +1309,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21811, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1318,7 +1318,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21815, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1327,7 +1327,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21819, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1343,7 +1343,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21808, 0, 0, 16, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1352,7 +1352,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21812, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1361,7 +1361,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21816, 0, 0, 16, 16, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1369,7 +1369,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21820, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1379,16 +1379,16 @@ static void side_friction_rc_track_left_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1451,7 +1451,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21774, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1459,7 +1459,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21778, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1467,7 +1467,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21782, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1475,7 +1475,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21786, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1495,7 +1495,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21775, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1504,7 +1504,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21779, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1512,7 +1512,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21783, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1520,7 +1520,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21787, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1535,7 +1535,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21776, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1544,7 +1544,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21780, 0, 0, 16, 16, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1552,7 +1552,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21784, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1561,7 +1561,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21788, 0, 0, 16, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1571,16 +1571,16 @@ static void side_friction_rc_track_right_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -1690,16 +1690,16 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21850, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1714,16 +1714,16 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21826, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1736,10 +1736,10 @@ static void side_friction_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1748,10 +1748,10 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21851, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1760,10 +1760,10 @@ static void side_friction_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1772,10 +1772,10 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21827, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1856,20 +1856,16 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21868, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1884,20 +1880,16 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21844, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1910,12 +1902,10 @@ static void side_friction_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1924,12 +1914,10 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21869, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1938,12 +1926,10 @@ static void side_friction_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1952,12 +1938,10 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21845, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2038,16 +2022,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21856, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2062,16 +2046,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21832, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2084,10 +2068,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2096,10 +2080,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2108,10 +2092,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2120,10 +2104,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21833, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2204,20 +2188,16 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21862, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2232,20 +2212,16 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21838, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2258,12 +2234,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2272,12 +2246,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21863, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2286,12 +2258,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2300,12 +2270,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21839, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2386,20 +2354,16 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21869, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2414,20 +2378,16 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21845, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2440,12 +2400,10 @@ static void side_friction_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2454,12 +2412,10 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21868, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2468,12 +2424,10 @@ static void side_friction_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2482,12 +2436,10 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21844, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2566,20 +2518,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21863, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2594,20 +2542,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21839, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2618,12 +2562,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2632,12 +2574,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21862, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2646,12 +2586,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2660,12 +2598,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21838, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2745,16 +2681,16 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2769,16 +2705,16 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21833, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2791,10 +2727,10 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2803,10 +2739,10 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21856, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2815,10 +2751,10 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2827,10 +2763,10 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 21832, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2879,7 +2815,7 @@ static void side_friction_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_DIR_0_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 21, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 21, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2890,7 +2826,7 @@ static void side_friction_rc_track_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_DIR_1_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 22, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 22, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2900,7 +2836,7 @@ static void side_friction_rc_track_60_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_DIR_2_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 23, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 23, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2909,7 +2845,7 @@ static void side_friction_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_DIR_3_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 24, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 24, height, session->TrackColours[SCHEME_SUPPORTS]); break; } @@ -2945,7 +2881,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_0_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 13, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 13, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2954,7 +2890,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_1_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 14, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 14, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2963,7 +2899,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_2_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 15, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 15, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2972,7 +2908,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_3_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 16, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 16, height, session->TrackColours[SCHEME_SUPPORTS]); break; } @@ -3008,7 +2944,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_0_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 17, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 17, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3017,7 +2953,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_1_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 18, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 18, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3026,7 +2962,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_2_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 19, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 19, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3035,7 +2971,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_3_B, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 20, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 20, height, session->TrackColours[SCHEME_SUPPORTS]); break; } @@ -3086,16 +3022,16 @@ static void side_friction_rc_track_diag_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_DIAG_60_DEG_UP_DIR_0_B, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } @@ -3106,10 +3042,10 @@ static void side_friction_rc_track_diag_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3118,10 +3054,10 @@ static void side_friction_rc_track_diag_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_DIAG_60_DEG_UP_DIR_2_B, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -3181,16 +3117,16 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_0_B, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -3200,10 +3136,10 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3214,10 +3150,10 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( session, direction, session->TrackColours[SCHEME_TRACK] | SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_2_B, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -3277,16 +3213,16 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 24033, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -3296,10 +3232,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3309,10 +3245,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | 24034, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index ab308cd268..ce07e71615 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -231,7 +231,7 @@ static void paint_virginia_reel_track_flat( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -268,19 +268,19 @@ static void paint_virginia_reel_track_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); break; } @@ -307,27 +307,27 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( case 0: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; case 1: ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); session->WoodenSupportsPrependTo = ps; - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); break; case 2: ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); session->WoodenSupportsPrependTo = ps; - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); break; case 3: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); break; } @@ -367,19 +367,19 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); break; case 2: - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); break; case 3: - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); break; } @@ -440,7 +440,7 @@ static void paint_virginia_reel_station( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -468,8 +468,8 @@ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( case 0: case 3: wooden_a_supports_paint_setup( - session, virginia_reel_left_quarter_turn_supports[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], - nullptr); + session, virginia_reel_left_quarter_turn_supports[direction], 0, height, + session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } @@ -501,18 +501,18 @@ static void paint_virginia_reel_track_left_quarter_turn_1_tile( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 56fb20dca3..2d4ccea959 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -458,7 +458,7 @@ static void wooden_rc_track_flat( wooden_rc_track_paint( session, imageIds[direction][isChained], railsImageIds[direction][isChained], direction, 0, 2, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -490,7 +490,7 @@ static void wooden_rc_track_station( session, stationImageIds[direction][0], stationImageIds[direction][1], direction, 0, 2, 32, 27, 2, height, 0, 2, height); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -531,8 +531,7 @@ static void wooden_rc_track_25_deg_up( session, imageIds[isChained][direction][2], imageIds[isChained][direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -569,8 +568,7 @@ static void wooden_rc_track_60_deg_up( session->WoodenSupportsPrependTo = wooden_rc_track_paint( session, imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 2, 24, 93, height, 28, 4, height - 16); } - wooden_a_supports_paint_setup( - session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -619,8 +617,7 @@ static void wooden_rc_track_flat_to_25_deg_up( session, imageIds[isChained][direction][2], imageIds[isChained][direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -661,8 +658,7 @@ static void wooden_rc_track_25_deg_up_to_60_deg_up( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -703,8 +699,7 @@ static void wooden_rc_track_60_deg_up_to_25_deg_up( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -753,8 +748,7 @@ static void wooden_rc_track_25_deg_up_to_flat( session, imageIds[isChained][direction][2], imageIds[isChained][direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -1029,7 +1023,7 @@ static void wooden_rc_track_right_quarter_turn_5( if (supportType[direction][trackSequence] != -1) { wooden_a_supports_paint_setup( - session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = 0; @@ -1092,7 +1086,7 @@ static void wooden_rc_track_flat_to_left_bank( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -1119,7 +1113,7 @@ static void wooden_rc_track_flat_to_right_bank( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -1353,7 +1347,7 @@ static void wooden_rc_track_banked_right_quarter_turn_5( if (supportType[direction][trackSequence] != -1) { wooden_a_supports_paint_setup( - session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = 0; @@ -1416,8 +1410,7 @@ static void wooden_rc_track_left_bank_to_25_deg_up( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -1451,8 +1444,7 @@ static void wooden_rc_track_right_bank_to_25_deg_up( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); @@ -1486,8 +1478,7 @@ static void wooden_rc_track_25_deg_up_to_left_bank( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -1521,8 +1512,7 @@ static void wooden_rc_track_25_deg_up_to_right_bank( wooden_rc_track_paint( session, imageIds[direction][2], imageIds[direction][3], direction, 0, 0, 32, 1, 9, height, 0, 26, height + 5); } - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); @@ -1581,7 +1571,7 @@ static void wooden_rc_track_left_bank( wooden_rc_track_paint( session, imageIds[direction][0], imageIds[direction][1], direction, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -1610,7 +1600,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23781, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24647, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1623,21 +1613,21 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24678, 0, 0, 32, 27, 0, height, 0, 2, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23791, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24657, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23796, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24662, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1660,7 +1650,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23782, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24648, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1673,7 +1663,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24679, 0, 0, 32, 16, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1682,7 +1672,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24658, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1697,7 +1687,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24685, 0, 0, 32, 16, 0, height, 0, 16, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1717,7 +1707,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24649, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1732,7 +1722,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24680, 0, 0, 16, 16, 0, height, 16, 16, height + 59); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1741,7 +1731,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24659, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1754,7 +1744,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24686, 0, 0, 16, 16, 0, height, 0, 0, height + 59); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1780,7 +1770,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24650, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1793,7 +1783,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24681, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1806,7 +1796,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24683, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1821,7 +1811,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24687, 0, 0, 16, 32, 0, height, 16, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -1839,7 +1829,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23785, 0, 0, 27, 32, 2, height, 2, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24651, 0, 0, 27, 32, 2, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1852,7 +1842,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24682, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1865,7 +1855,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24684, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1878,7 +1868,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24688, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -1911,14 +1901,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23761, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24627, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23766, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24632, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1931,14 +1921,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24673, 0, 0, 32, 27, 0, height, 0, 2, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23776, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24642, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -1969,7 +1959,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24667, 0, 0, 32, 16, 0, height, 0, 16, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1978,7 +1968,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24633, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1991,14 +1981,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24674, 0, 0, 32, 16, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23777, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24643, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2022,7 +2012,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24668, 0, 0, 16, 16, 0, height, 0, 0, height + 59); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2031,7 +2021,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24634, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2046,7 +2036,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24675, 0, 0, 16, 16, 0, height, 16, 16, height + 59); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2055,7 +2045,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24644, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2087,7 +2077,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24669, 0, 0, 16, 32, 0, height, 16, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2100,7 +2090,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24671, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2113,7 +2103,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24676, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2122,7 +2112,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24645, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2146,7 +2136,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24670, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2159,7 +2149,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24672, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2172,14 +2162,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24677, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23780, 0, 0, 27, 32, 2, height, 2, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24646, 0, 0, 27, 32, 2, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2230,7 +2220,7 @@ static void wooden_rc_track_s_bend_left( session, direction, wooden_rc_get_track_colour(session) | 23725, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24591, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2243,14 +2233,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24607, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23728, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24594, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2263,7 +2253,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24610, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2281,7 +2271,7 @@ static void wooden_rc_track_s_bend_left( session, direction, wooden_rc_get_track_colour(session) | 23726, 0, 0, 32, 26, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24592, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2294,14 +2284,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24608, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23727, 0, 0, 32, 26, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24593, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2314,7 +2304,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24609, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2332,7 +2322,7 @@ static void wooden_rc_track_s_bend_left( session, direction, wooden_rc_get_track_colour(session) | 23727, 0, 0, 32, 26, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24593, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2345,14 +2335,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24609, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23726, 0, 0, 32, 26, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24592, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2365,7 +2355,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24608, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2383,7 +2373,7 @@ static void wooden_rc_track_s_bend_left( session, direction, wooden_rc_get_track_colour(session) | 23728, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24594, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2396,14 +2386,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24610, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23725, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24591, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2416,7 +2406,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24607, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -2455,14 +2445,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24611, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23737, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24603, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2475,14 +2465,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24614, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23740, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24606, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -2506,14 +2496,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24612, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23738, 0, 0, 32, 26, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24604, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2526,14 +2516,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24613, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23739, 0, 0, 32, 26, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24605, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2557,14 +2547,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24613, 0, 0, 32, 26, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23739, 0, 0, 32, 26, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24605, 0, 0, 32, 26, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2577,14 +2567,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24612, 0, 0, 32, 26, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23738, 0, 0, 32, 26, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24604, 0, 0, 32, 26, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -2608,14 +2598,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24614, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23740, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24606, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2628,14 +2618,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24611, 0, 0, 32, 25, 0, height, 0, 3, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23737, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24603, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3150,7 +3140,7 @@ static void wooden_rc_track_left_quarter_turn_3( session, direction, wooden_rc_get_track_colour(session) | 23828, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24694, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3163,14 +3153,14 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24706, 0, 6, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23834, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24700, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3183,7 +3173,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24703, 0, 6, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3254,7 +3244,7 @@ static void wooden_rc_track_left_quarter_turn_3( session, direction, wooden_rc_get_track_colour(session) | 23826, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24692, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3267,14 +3257,14 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24704, 6, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23832, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24698, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3287,7 +3277,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24701, 6, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3329,7 +3319,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( session, direction, wooden_rc_get_track_colour(session) | 23846, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24712, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3342,14 +3332,14 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24724, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23852, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24718, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3362,7 +3352,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24721, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3433,7 +3423,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( session, direction, wooden_rc_get_track_colour(session) | 23844, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24710, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3446,14 +3436,14 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24722, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23850, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24716, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3466,7 +3456,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24719, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3508,7 +3498,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23906, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24772, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3521,14 +3511,14 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24785, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23910, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24776, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3541,7 +3531,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24783, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3567,7 +3557,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23905, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24771, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3580,7 +3570,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24784, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3593,7 +3583,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24786, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3606,7 +3596,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24782, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3645,14 +3635,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24777, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23897, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24763, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3665,14 +3655,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24780, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23901, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24767, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3704,7 +3694,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24778, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3717,7 +3707,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24779, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3730,14 +3720,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24781, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23902, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24768, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3788,7 +3778,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( session, direction, wooden_rc_get_track_colour(session) | 23882, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24748, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3801,14 +3791,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24760, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23888, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24754, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3821,7 +3811,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24757, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -3839,16 +3829,16 @@ static void wooden_rc_track_left_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -3911,7 +3901,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( session, direction, wooden_rc_get_track_colour(session) | 23880, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24746, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3924,14 +3914,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24758, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23886, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24752, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3944,7 +3934,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24755, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -3977,14 +3967,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24757, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23882, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24748, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3997,14 +3987,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24760, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23888, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24754, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -4027,16 +4017,16 @@ static void wooden_rc_track_left_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -4105,14 +4095,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24755, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23880, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24746, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4125,14 +4115,14 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24758, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23886, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24752, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4170,14 +4160,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24737, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23862, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24728, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4190,14 +4180,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24740, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23868, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24734, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4215,16 +4205,16 @@ static void wooden_rc_track_right_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -4293,14 +4283,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24739, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23864, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24730, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4313,14 +4303,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24742, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23870, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24736, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -4347,7 +4337,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( session, direction, wooden_rc_get_track_colour(session) | 23862, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24728, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4360,14 +4350,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24740, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23868, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24734, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4380,7 +4370,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24737, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -4403,16 +4393,16 @@ static void wooden_rc_track_right_half_banked_helix_up_small( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_general_support_height(session, height + 32, 0x20); @@ -4475,7 +4465,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( session, direction, wooden_rc_get_track_colour(session) | 23864, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24730, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4488,14 +4478,14 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24742, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23870, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24736, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4508,7 +4498,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24739, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4568,7 +4558,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23704, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24570, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4581,14 +4571,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24590, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23714, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24580, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4601,7 +4591,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24585, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -4628,7 +4618,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23703, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24569, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4641,7 +4631,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24589, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4650,7 +4640,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24579, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4665,7 +4655,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24584, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -4685,7 +4675,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24568, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4700,7 +4690,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24588, 0, 0, 16, 16, 0, height, 16, 16, height + 29); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4709,7 +4699,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24578, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4722,7 +4712,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24583, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -4746,7 +4736,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24567, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4759,14 +4749,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24587, 0, 0, 16, 32, 0, height, 0, 0, height + 33); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23711, 0, 0, 16, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24577, 0, 0, 16, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4781,7 +4771,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24582, 0, 0, 16, 32, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -4799,7 +4789,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23700, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24566, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4812,14 +4802,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24586, 0, 0, 27, 32, 0, height, 2, 0, height + 33); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23710, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24576, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4832,7 +4822,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24581, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -4865,14 +4855,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24585, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23704, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24570, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4885,14 +4875,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24590, 0, 0, 27, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23714, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24580, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -4932,14 +4922,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24584, 0, 0, 16, 32, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23703, 0, 0, 16, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24569, 0, 0, 16, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4952,7 +4942,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24589, 0, 0, 16, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4961,7 +4951,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24579, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -4985,7 +4975,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24583, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4994,7 +4984,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24568, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5009,7 +4999,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24588, 0, 0, 16, 16, 0, height, 16, 16, height + 29); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5018,7 +5008,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24578, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5048,7 +5038,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24582, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5057,7 +5047,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24567, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5070,14 +5060,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24587, 0, 0, 32, 16, 0, height, 0, 0, height + 33); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23711, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24577, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5101,14 +5091,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24581, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23700, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24566, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5121,14 +5111,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24586, 0, 0, 32, 27, 0, height, 0, 2, height + 33); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23710, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24576, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5166,14 +5156,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24551, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23670, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24536, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5186,14 +5176,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24556, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23680, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24546, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5228,7 +5218,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24552, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5237,7 +5227,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24537, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5250,14 +5240,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24557, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23681, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24547, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5281,7 +5271,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24553, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5290,7 +5280,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24538, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5305,7 +5295,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24558, 0, 0, 16, 16, 0, height, 16, 16, height + 29); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5314,7 +5304,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24548, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5344,14 +5334,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24554, 0, 0, 16, 32, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23673, 0, 0, 16, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24539, 0, 0, 16, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5364,7 +5354,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24559, 0, 0, 16, 32, 0, height, 0, 0, height + 33); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5373,7 +5363,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24549, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5397,14 +5387,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24555, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23674, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24540, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5417,14 +5407,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24560, 0, 0, 27, 32, 0, height, 2, 0, height + 33); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23684, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24550, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5451,7 +5441,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23670, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24536, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5464,14 +5454,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24556, 0, 0, 27, 32, 0, height, 2, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23680, 0, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24546, 0, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5484,7 +5474,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24551, 0, 0, 20, 32, 0, height, 6, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -5518,7 +5508,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24537, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5531,14 +5521,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24557, 0, 0, 16, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23681, 0, 0, 16, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24547, 0, 0, 16, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5553,7 +5543,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24552, 0, 0, 16, 32, 0, height, 16, 0, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5573,7 +5563,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24538, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5588,7 +5578,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24558, 0, 0, 16, 16, 0, height, 16, 16, height + 29); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5597,7 +5587,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24548, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5610,7 +5600,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24553, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5632,7 +5622,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23673, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24539, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5645,7 +5635,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24559, 0, 0, 32, 16, 0, height, 0, 0, height + 33); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5654,7 +5644,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24549, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5669,7 +5659,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24554, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -5687,7 +5677,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( session, direction, wooden_rc_get_track_colour(session) | 23674, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24540, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5700,14 +5690,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24560, 0, 0, 32, 27, 0, height, 0, 2, height + 33); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23684, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24550, 0, 0, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5720,7 +5710,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24555, 0, 0, 32, 20, 0, height, 0, 6, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5901,7 +5891,7 @@ static void wooden_rc_track_brakes( wooden_rc_track_paint( session, imageIds[direction][0], imageIds[direction][1], direction, 0, 2, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -5919,7 +5909,7 @@ static void wooden_rc_track_25_deg_up_left_banked( session, direction, wooden_rc_get_track_colour(session) | 24249, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25115, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5930,7 +5920,7 @@ static void wooden_rc_track_25_deg_up_left_banked( session, direction, wooden_rc_get_track_colour(session) | 24257, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25123, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5941,14 +5931,14 @@ static void wooden_rc_track_25_deg_up_left_banked( session, direction, wooden_rc_get_track_colour(session) | 24258, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25124, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24252, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25118, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -5975,7 +5965,7 @@ static void wooden_rc_track_25_deg_up_right_banked( session, direction, wooden_rc_get_track_colour(session) | 24253, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25119, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5986,7 +5976,7 @@ static void wooden_rc_track_25_deg_up_right_banked( session, direction, wooden_rc_get_track_colour(session) | 24259, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25125, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5997,14 +5987,14 @@ static void wooden_rc_track_25_deg_up_right_banked( session, direction, wooden_rc_get_track_colour(session) | 24260, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25126, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24256, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25122, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -6051,7 +6041,7 @@ static void wooden_rc_track_on_ride_photo( session, direction, wooden_rc_get_rails_colour(session) | 24620, 0, 2, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_onride_photo_small_paint(session, direction, height + 16, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6168,7 +6158,7 @@ static void wooden_rc_track_water_splash( session, direction, wooden_rc_get_rails_colour(session) | 24858, 0, 0, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -6257,7 +6247,7 @@ static void wooden_rc_track_water_splash( session, direction, wooden_rc_get_rails_colour(session) | 24846, 0, 0, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -6307,7 +6297,7 @@ static void wooden_rc_track_water_splash( session, direction, wooden_rc_get_rails_colour(session) | 24868, 0, 0, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -6395,7 +6385,7 @@ static void wooden_rc_track_water_splash( session, direction, wooden_rc_get_rails_colour(session) | 24848, 0, 0, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); break; @@ -6483,7 +6473,7 @@ static void wooden_rc_track_water_splash( session, direction, wooden_rc_get_rails_colour(session) | 24860, 0, 0, 32, 25, 2, height, 0, 3, height); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -6506,7 +6496,7 @@ static void wooden_rc_track_left_eighth_to_diag( session, direction, wooden_rc_get_track_colour(session) | 24137, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25003, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6519,14 +6509,14 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25019, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24145, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25011, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6539,7 +6529,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25023, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -6557,7 +6547,7 @@ static void wooden_rc_track_left_eighth_to_diag( session, direction, wooden_rc_get_track_colour(session) | 24138, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25004, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6570,7 +6560,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25020, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6579,7 +6569,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25012, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6594,7 +6584,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25024, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6610,7 +6600,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25005, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6625,7 +6615,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25021, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6634,7 +6624,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25013, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6647,7 +6637,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25025, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6657,16 +6647,16 @@ static void wooden_rc_track_left_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6745,14 +6735,14 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24995, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24117, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24983, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6765,14 +6755,14 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24999, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24125, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24991, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -6798,7 +6788,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24996, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6807,7 +6797,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24984, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6820,14 +6810,14 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25000, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24126, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24992, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6847,7 +6837,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24997, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6856,7 +6846,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24985, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6869,7 +6859,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25001, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6878,7 +6868,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24993, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6888,16 +6878,16 @@ static void wooden_rc_track_right_eighth_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -6988,7 +6978,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( session, direction, wooden_rc_get_track_colour(session) | 24185, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25051, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7001,14 +6991,14 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25067, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24193, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25059, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7021,7 +7011,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25071, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7039,7 +7029,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( session, direction, wooden_rc_get_track_colour(session) | 24186, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25052, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7052,7 +7042,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25068, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7061,7 +7051,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25060, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7076,7 +7066,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25072, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7092,7 +7082,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25053, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7107,7 +7097,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25069, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7116,7 +7106,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25061, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7129,7 +7119,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25073, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7139,16 +7129,16 @@ static void wooden_rc_track_left_eighth_bank_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7227,14 +7217,14 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25043, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24165, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25031, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7247,14 +7237,14 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25047, 0, 0, 32, 32, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24173, 0, 0, 32, 32, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25039, 0, 0, 32, 32, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -7280,7 +7270,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25044, 0, 0, 32, 16, 0, height, 0, 16, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7289,7 +7279,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25032, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7302,14 +7292,14 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25048, 0, 0, 32, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24174, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25040, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7329,7 +7319,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25045, 0, 0, 16, 16, 0, height, 0, 0, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7338,7 +7328,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25033, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7351,7 +7341,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25049, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7360,7 +7350,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25041, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7370,16 +7360,16 @@ static void wooden_rc_track_right_eighth_bank_to_diag( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7512,16 +7502,16 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24917, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7542,16 +7532,16 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24875, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7564,10 +7554,10 @@ static void wooden_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7582,10 +7572,10 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24918, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7594,10 +7584,10 @@ static void wooden_rc_track_diag_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7612,10 +7602,10 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24876, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7714,20 +7704,16 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24935, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7748,20 +7734,16 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24893, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7774,12 +7756,10 @@ static void wooden_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7794,12 +7774,10 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24936, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7808,12 +7786,10 @@ static void wooden_rc_track_diag_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7828,12 +7804,10 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24894, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7913,16 +7887,16 @@ static void wooden_rc_track_diag_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24911, -16, -16, 32, 32, 0, height, -16, -16, height + 91); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -7932,10 +7906,10 @@ static void wooden_rc_track_diag_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7950,10 +7924,10 @@ static void wooden_rc_track_diag_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24912, -16, -16, 32, 32, 0, height, -16, -16, height + 91); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8034,16 +8008,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24923, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8064,16 +8038,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24881, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8086,10 +8060,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8104,10 +8078,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24924, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8116,10 +8090,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8134,10 +8108,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24882, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8217,16 +8191,16 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24899, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8236,10 +8210,10 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8254,10 +8228,10 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24900, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8319,16 +8293,16 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24905, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8338,10 +8312,10 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8356,10 +8330,10 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24906, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8440,20 +8414,16 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24929, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8474,20 +8444,16 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24887, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8500,12 +8466,10 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8520,12 +8484,10 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24930, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8534,12 +8496,10 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8554,12 +8514,10 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24888, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8658,20 +8616,16 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24936, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8692,20 +8646,16 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24894, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8718,12 +8668,10 @@ static void wooden_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8738,12 +8686,10 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24935, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8752,12 +8698,10 @@ static void wooden_rc_track_diag_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8772,12 +8716,10 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24893, -16, -16, 32, 32, 0, height, -16, -16, height + 43); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8857,16 +8799,16 @@ static void wooden_rc_track_diag_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24912, -16, -16, 32, 32, 0, height, -16, -16, height + 91); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8876,10 +8818,10 @@ static void wooden_rc_track_diag_60_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8894,10 +8836,10 @@ static void wooden_rc_track_diag_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24911, -16, -16, 32, 32, 0, height, -16, -16, height + 91); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -8976,20 +8918,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24930, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9010,20 +8948,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24888, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9034,12 +8968,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9054,12 +8986,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24929, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9068,12 +8998,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup( - session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup( - session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9088,12 +9016,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24887, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup( - session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup( - session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9172,16 +9098,16 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24906, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9191,10 +9117,10 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9209,10 +9135,10 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24905, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9274,16 +9200,16 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24900, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9293,10 +9219,10 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9311,10 +9237,10 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24899, -16, -16, 32, 32, 0, height, -16, -16, height + 59); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9395,16 +9321,16 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24924, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9425,16 +9351,16 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24882, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9447,10 +9373,10 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9465,10 +9391,10 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24923, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9477,10 +9403,10 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9495,10 +9421,10 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24881, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9578,16 +9504,16 @@ static void wooden_rc_track_diag_flat_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24947, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9597,10 +9523,10 @@ static void wooden_rc_track_diag_flat_to_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9615,10 +9541,10 @@ static void wooden_rc_track_diag_flat_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24948, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9680,16 +9606,16 @@ static void wooden_rc_track_diag_flat_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24953, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9699,10 +9625,10 @@ static void wooden_rc_track_diag_flat_to_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9717,10 +9643,10 @@ static void wooden_rc_track_diag_flat_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24954, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9782,16 +9708,16 @@ static void wooden_rc_track_diag_left_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24954, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9801,10 +9727,10 @@ static void wooden_rc_track_diag_left_bank_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9819,10 +9745,10 @@ static void wooden_rc_track_diag_left_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24953, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9884,16 +9810,16 @@ static void wooden_rc_track_diag_right_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24948, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9903,10 +9829,10 @@ static void wooden_rc_track_diag_right_bank_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9921,10 +9847,10 @@ static void wooden_rc_track_diag_right_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24947, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -9986,16 +9912,16 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24971, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10005,10 +9931,10 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10023,10 +9949,10 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24972, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10088,16 +10014,16 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24977, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10107,10 +10033,10 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10125,10 +10051,10 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24978, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10190,16 +10116,16 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24959, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10209,10 +10135,10 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10227,10 +10153,10 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24960, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10292,16 +10218,16 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24965, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10311,10 +10237,10 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10329,10 +10255,10 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24966, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10392,16 +10318,16 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24966, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -10409,10 +10335,10 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10427,10 +10353,10 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24965, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -10489,16 +10415,16 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24960, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -10506,10 +10432,10 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 4, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 5, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10524,10 +10450,10 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24959, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 2, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_b_supports_paint_setup(session, 3, 0, height + 16, session->TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -10588,16 +10514,16 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24978, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10607,10 +10533,10 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10625,10 +10551,10 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24977, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10690,16 +10616,16 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24972, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10709,10 +10635,10 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10727,10 +10653,10 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24971, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10792,16 +10718,16 @@ static void wooden_rc_track_diag_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24941, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10811,10 +10737,10 @@ static void wooden_rc_track_diag_left_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10829,10 +10755,10 @@ static void wooden_rc_track_diag_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24942, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10894,16 +10820,16 @@ static void wooden_rc_track_diag_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24942, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10913,10 +10839,10 @@ static void wooden_rc_track_diag_right_bank( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10931,10 +10857,10 @@ static void wooden_rc_track_diag_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24941, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -10973,7 +10899,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23958, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24824, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -10986,14 +10912,14 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24837, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23962, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24828, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11006,7 +10932,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24835, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11032,7 +10958,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23957, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24823, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11045,7 +10971,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24836, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11058,7 +10984,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24838, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11071,7 +10997,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24834, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11110,14 +11036,14 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24829, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23949, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24815, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11130,14 +11056,14 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24832, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23953, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24819, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11169,7 +11095,7 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24830, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11182,7 +11108,7 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24831, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11195,14 +11121,14 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24833, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23954, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24820, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11241,7 +11167,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24831, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11254,14 +11180,14 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24833, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23954, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24820, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11274,7 +11200,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24830, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11300,7 +11226,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( session, direction, wooden_rc_get_track_colour(session) | 23949, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24815, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11313,14 +11239,14 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24832, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23953, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24819, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11333,7 +11259,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24829, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11372,14 +11298,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24834, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23957, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24823, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11392,7 +11318,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24836, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11405,7 +11331,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24838, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11437,14 +11363,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24835, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23958, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24824, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11457,14 +11383,14 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24837, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23962, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24828, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11491,7 +11417,7 @@ static void wooden_rc_track_block_brakes( : _wooden_rc_block_brakes_image_ids[direction][0]; wooden_rc_track_paint( session, brakeImg, _wooden_rc_block_brakes_image_ids[direction][2], direction, 0, 2, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -11512,7 +11438,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23932, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24798, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11525,14 +11451,14 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24811, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23936, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24802, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11545,7 +11471,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24809, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11571,7 +11497,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 23931, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24797, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11584,7 +11510,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24810, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11597,7 +11523,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24812, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11610,7 +11536,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24808, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11649,14 +11575,14 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24803, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23923, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24789, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11669,14 +11595,14 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24806, 0, 6, 32, 20, 0, height, 0, 6, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23927, 0, 6, 32, 20, 2, height, 0, 6, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24793, 0, 6, 32, 20, 2, height, 0, 6, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11708,7 +11634,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24804, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11721,7 +11647,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24805, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11734,14 +11660,14 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24807, 6, 0, 20, 32, 0, height, 6, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 23928, 6, 0, 20, 32, 2, height, 6, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 24794, 6, 0, 20, 32, 2, height, 6, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -11794,7 +11720,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24321, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25187, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11807,21 +11733,21 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25218, 0, 0, 32, 27, 0, height, 0, 2, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24331, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25197, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24336, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25202, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -11844,7 +11770,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24322, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25188, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11857,7 +11783,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25219, 0, 0, 32, 16, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11866,7 +11792,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25198, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11881,7 +11807,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25225, 0, 0, 32, 16, 0, height, 0, 16, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -11901,7 +11827,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25189, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11916,7 +11842,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25220, 0, 0, 16, 16, 0, height, 16, 16, height + 59); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11925,7 +11851,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25199, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11938,7 +11864,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25226, 0, 0, 16, 16, 0, height, 0, 0, height + 59); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -11964,7 +11890,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25190, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11977,7 +11903,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25221, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11990,7 +11916,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25223, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12005,7 +11931,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25227, 0, 0, 16, 32, 0, height, 16, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -12023,7 +11949,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24325, 0, 0, 27, 32, 2, height, 2, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25191, 0, 0, 27, 32, 2, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12036,7 +11962,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25222, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12049,7 +11975,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25224, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12062,7 +11988,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25228, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -12095,14 +12021,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24301, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25167, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24306, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25172, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12115,14 +12041,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25213, 0, 0, 32, 27, 0, height, 0, 2, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24316, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25182, 0, 0, 32, 27, 2, height, 0, 2, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12153,7 +12079,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25207, 0, 0, 32, 16, 0, height, 0, 16, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12162,7 +12088,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25173, 0, 0, 32, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12175,14 +12101,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25214, 0, 0, 32, 16, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24317, 0, 0, 32, 16, 2, height, 0, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25183, 0, 0, 32, 16, 2, height, 0, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -12206,7 +12132,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25208, 0, 0, 16, 16, 0, height, 0, 0, height + 59); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12215,7 +12141,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25174, 0, 0, 16, 16, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12230,7 +12156,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25215, 0, 0, 16, 16, 0, height, 16, 16, height + 59); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12239,7 +12165,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25184, 0, 0, 16, 16, 2, height, 0, 16, height); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -12271,7 +12197,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25209, 0, 0, 16, 32, 0, height, 16, 0, height + 67); - wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12284,7 +12210,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25211, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12297,7 +12223,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25216, 0, 0, 16, 32, 0, height, 0, 0, height + 67); - wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12306,7 +12232,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25185, 0, 0, 16, 32, 2, height, 16, 0, height); - wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } paint_util_set_segment_support_height( @@ -12330,7 +12256,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25210, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12343,7 +12269,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25212, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12356,14 +12282,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25217, 0, 0, 27, 32, 0, height, 2, 0, height + 67); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24320, 0, 0, 27, 32, 2, height, 2, 0, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25186, 0, 0, 27, 32, 2, height, 2, 0, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) @@ -12413,28 +12339,28 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24261, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25127, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24262, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25128, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24263, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25129, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24264, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25130, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12461,28 +12387,28 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24265, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25131, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24266, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25132, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24267, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25133, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24268, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25134, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12509,28 +12435,28 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24269, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25135, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24270, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25136, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24271, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25137, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24272, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25138, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12557,28 +12483,28 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24273, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25139, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24274, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25140, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24275, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25141, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24276, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25142, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12639,7 +12565,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24277, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25143, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12650,7 +12576,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24293, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25159, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12661,14 +12587,14 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24294, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25160, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24280, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25146, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12695,7 +12621,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24281, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25147, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12706,7 +12632,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24295, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25161, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12717,14 +12643,14 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24296, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25162, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24284, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25150, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12751,7 +12677,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24285, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25151, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12762,7 +12688,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24297, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25163, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12773,14 +12699,14 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24298, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25164, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24288, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25154, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12807,7 +12733,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24289, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25155, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12818,7 +12744,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24299, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25165, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12829,14 +12755,14 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( session, direction, wooden_rc_get_track_colour(session) | 24300, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25166, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24292, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25158, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12899,7 +12825,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24225, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25091, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12910,7 +12836,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24241, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25107, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12921,14 +12847,14 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24242, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25108, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24228, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25094, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -12955,7 +12881,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24229, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25095, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12966,7 +12892,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24243, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25109, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12977,14 +12903,14 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( session, direction, wooden_rc_get_track_colour(session) | 24244, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25110, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24232, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25098, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -13011,7 +12937,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24233, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25099, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13022,7 +12948,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24245, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25111, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13033,14 +12959,14 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24246, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25112, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24236, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25102, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -13067,7 +12993,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24237, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25103, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13078,7 +13004,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24247, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25113, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13089,14 +13015,14 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( session, direction, wooden_rc_get_track_colour(session) | 24248, 0, 0, 32, 1, 9, height, 0, 26, height + 5); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25114, 0, 0, 32, 1, 9, height, 0, 26, height + 5); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_track_colour(session) | 24240, 0, 0, 32, 25, 2, height, 0, 3, height); PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session) | 25106, 0, 0, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) @@ -13162,7 +13088,7 @@ static void wooden_rc_track_booster( wooden_rc_track_paint( session, imageIds[direction], railsImageIds[direction], direction, 0, 2, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index 282fb7bace..a0b05eb7f6 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -134,7 +134,7 @@ static void wooden_wild_mouse_track_flat( uint32_t imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 20, 1, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height( session, @@ -162,7 +162,7 @@ static void wooden_wild_mouse_track_station( PaintAddImageAsChildRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 0, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_station(session, ride, direction, height, trackElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); @@ -193,8 +193,7 @@ static void wooden_wild_mouse_track_25_deg_up( uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); - wooden_a_supports_paint_setup( - session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -241,8 +240,7 @@ static void wooden_wild_mouse_track_60_deg_up( session, direction, imageId, 0, 6, 2, 24, 93, height, 28, 4, height - 16); } - wooden_a_supports_paint_setup( - session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -281,8 +279,7 @@ static void wooden_wild_mouse_track_flat_to_25_deg_up( uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); - wooden_a_supports_paint_setup( - session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -333,8 +330,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -384,8 +380,7 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -424,8 +419,7 @@ static void wooden_wild_mouse_track_25_deg_up_to_flat( uint32_t imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); - wooden_a_supports_paint_setup( - session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -524,8 +518,7 @@ static void wooden_wild_mouse_track_right_quarter_turn_3( { case 0: case 3: - wooden_a_supports_paint_setup( - session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); break; } @@ -582,7 +575,7 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); break; } - wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -631,8 +624,7 @@ static void wooden_wild_mouse_track_flat_to_60_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 29 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 29 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -682,8 +674,7 @@ static void wooden_wild_mouse_track_60_deg_up_to_flat( PaintAddImageAsParentRotated(session, direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height); } - wooden_a_supports_paint_setup( - session, direction & 1, 33 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 33 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index b036fe3fe1..548a76ecd6 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -478,7 +478,7 @@ static void paint_car_ride_track_spinning_tunnel( paint_util_push_tunnel_right(session, height, TUNNEL_0); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 00ae90a9ed..a26a4bd67e 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -60,7 +60,7 @@ static void paint_circus( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index dad4dfda77..cb021b1f91 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -67,7 +67,7 @@ static void paint_crooked_house( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 98c4069b18..c960e9caf2 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -45,7 +45,7 @@ static void paint_dodgems( int32_t edges = edges_4x4[relativeTrackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index c3a0e0e1c6..104e032dfa 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -145,7 +145,7 @@ static void paint_ferris_wheel( edges = edges_1x4_ne_sw[relativeTrackSequence]; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index eaf1f0fe52..bb974de89b 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -40,7 +40,7 @@ static void paint_flying_saucers( int32_t edges = edges_4x4[relativeTrackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 2e5bb4d8b7..521ade0e6d 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -492,7 +492,7 @@ static void paint_ghost_train_track_spinning_tunnel( auto tunnelImage = get_tunnel_doors_image_straight_flat(trackElement, direction); paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 1c120deba4..cc05ce5b17 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -99,7 +99,7 @@ static void paint_haunted_house( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index 1b349958e8..51d75f9d5d 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -56,7 +56,7 @@ static void maze_paint_setup( int32_t image_id = SPR_TERRAIN_DIRT | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 32, 0 }); - wooden_a_supports_paint_setup(session, (rotation & 1) ? 0 : 1, 0, height, session->TrackColours[SCHEME_3], nullptr); + wooden_a_supports_paint_setup(session, (rotation & 1) ? 0 : 1, 0, height, session->TrackColours[SCHEME_3]); paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index a57086f37f..226faf31ab 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -110,7 +110,7 @@ static void paint_merry_go_round( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 0983862082..84dcf204db 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -731,7 +731,7 @@ static void paint_mini_golf_station( paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -832,7 +832,7 @@ static void paint_mini_golf_hole_ab( CoordsXY boundBox, boundBoxOffset; bool drewSupports = wooden_a_supports_paint_setup( - session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -904,7 +904,7 @@ static void paint_mini_golf_hole_c( CoordsXY boundBox, boundBoxOffset; bool drewSupports = wooden_a_supports_paint_setup( - session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -977,8 +977,7 @@ static void paint_mini_golf_hole_d( int32_t supportType = (direction & 1); if (trackSequence == 2) supportType = 1 - supportType; - bool drewSupports = wooden_a_supports_paint_setup( - session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + bool drewSupports = wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -1071,8 +1070,7 @@ static void paint_mini_golf_hole_e( int32_t supportType = (direction & 1); if (trackSequence == 2) supportType = 1 - supportType; - bool drewSupports = wooden_a_supports_paint_setup( - session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + bool drewSupports = wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index e530d90549..ac23f41455 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -92,7 +92,7 @@ static void paint_observation_tower_base( int32_t edges = edges_3x3[trackSequence]; CoordsXY position = session->MapPosition; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index e2dc0c6849..eaed11cbdc 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -100,7 +100,7 @@ static void paint_space_rings( uint32_t imageId; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = ride_get_station_object(ride); track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 46ac648aa4..8e895952f9 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -198,7 +198,7 @@ static void paint_spiral_slide( int32_t edges = edges_2x2[trackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); // Base uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index d8028570f4..60ab8b31f5 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -26,8 +26,7 @@ static void facility_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - bool hasSupports = wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); + bool hasSupports = wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_3]); if (ride == nullptr) return; diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index f4311ceb62..d37e6f84fa 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -26,8 +26,7 @@ static void shop_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - bool hasSupports = wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_3], nullptr); + bool hasSupports = wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_3]); if (ride == nullptr) return; diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 0546bd9603..4abb5b05e9 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -60,7 +60,7 @@ static void paint_3d_cinema( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index e88887aff6..c89cc39bd0 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -89,7 +89,7 @@ static void paint_enterprise( int32_t edges = edges_4x4[trackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = ride_get_station_object(ride); track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 427b1a55dd..965adb5826 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -150,7 +150,7 @@ static void paint_go_karts_track_flat( paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -189,19 +189,19 @@ static void paint_go_karts_track_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); break; } @@ -243,19 +243,19 @@ static void paint_go_karts_track_flat_to_25_deg_up( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); break; } @@ -297,19 +297,19 @@ static void paint_go_karts_track_25_deg_up_to_flat( switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); break; case 2: - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); break; case 3: - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); break; } @@ -448,7 +448,7 @@ static void paint_go_karts_station( } } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); @@ -518,7 +518,7 @@ static void paint_go_karts_track_left_quarter_turn_1_tile( break; } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 4881092781..9309b5262e 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -94,7 +94,7 @@ static void paint_launched_freefall_base( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 3a45815cae..0d80da8ad9 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -147,7 +147,7 @@ static void paint_motionsimulator( int32_t edges = edges_2x2[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 3840486e7a..0ff5bf1f9f 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -104,7 +104,7 @@ static void paint_roto_drop_base( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index f6c5c5774d..2ee85c3713 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -186,7 +186,7 @@ static void paint_swinging_ship( if (relativeTrackSequence == 1 || relativeTrackSequence == 4) { - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } else if (direction & 1) { diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index c0f86c3a18..7c8851fb4a 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -252,7 +252,7 @@ static void paint_top_spin( int32_t edges = edges_3x3[trackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = nullptr; if (ride != nullptr) diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 53223392d9..4422b484ce 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -92,7 +92,7 @@ static void paint_twist( uint32_t imageId; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); StationObject* stationObject = ride_get_station_object(ride); track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject); diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index eb853d1d7f..db0b0a2950 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -187,7 +187,7 @@ static void chairlift_paint_station_ne_sw( auto stationObj = ride_get_station_object(ride); - wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, 0, 0, height, session->TrackColours[SCHEME_MISC]); if (!isStart && !isEnd) { @@ -280,7 +280,7 @@ static void chairlift_paint_station_se_nw( auto stationObj = ride_get_station_object(ride); - wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_MISC], nullptr); + wooden_a_supports_paint_setup(session, 1, 0, height, session->TrackColours[SCHEME_MISC]); if (!isStart && !isEnd) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index cb599947e4..63c64774af 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -600,8 +600,7 @@ static void paint_miniature_railway_track_flat( paintGrooved = true; } - bool isSupported = wooden_a_supports_paint_setup( - session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + bool isSupported = wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); uint32_t imageId, imageIdAlt; // In the following 3 calls to PaintAddImageAsParentRotated/PaintAddImageAsChildRotated, we add 1 to the @@ -673,7 +672,7 @@ static void paint_miniature_railway_station( { uint32_t imageId; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); imageId = miniature_railway_station_floor[direction] | session->TrackColours[SCHEME_MISC]; PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); @@ -715,8 +714,7 @@ static void paint_miniature_railway_track_25_deg_up( break; } - wooden_a_supports_paint_setup( - session, direction & 1, 45 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 45 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 56, 0x20); @@ -747,8 +745,7 @@ static void paint_miniature_railway_track_flat_to_25_deg_up( break; } - wooden_a_supports_paint_setup( - session, direction & 1, 37 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 37 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 0x20); @@ -779,8 +776,7 @@ static void paint_miniature_railway_track_25_deg_up_to_flat( break; } - wooden_a_supports_paint_setup( - session, direction & 1, 41 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 41 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 40, 0x20); @@ -925,7 +921,7 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( { bool isSupported = wooden_a_supports_paint_setup( session, right_quarter_turn_5_supports_type[direction][trackSequence], 0, height, - session->TrackColours[SCHEME_SUPPORTS], nullptr); + session->TrackColours[SCHEME_SUPPORTS]); if (!isSupported || (trackSequence == 3 && direction == 2)) { @@ -1040,8 +1036,7 @@ static void paint_miniature_railway_track_s_bend_left( } bool isSupported = wooden_a_supports_paint_setup( - session, s_bend_left_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], - nullptr); + session, s_bend_left_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); static constexpr const CoordsXY offsetList[] = { { 0, 2 }, @@ -1142,8 +1137,7 @@ static void paint_miniature_railway_track_s_bend_right( } bool isSupported = wooden_a_supports_paint_setup( - session, s_bend_right_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], - nullptr); + session, s_bend_right_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); static constexpr const CoordsXY offsetList[] = { { 0, 2 }, @@ -1273,7 +1267,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( { static constexpr const uint8_t supportType[] = { 4, 5, 2, 3 }; isSupported = wooden_a_supports_paint_setup( - session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); } if (!isSupported) { @@ -1426,7 +1420,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( if (trackSequence != 4 || !isRightEighthToOrthog) { isSupported = wooden_a_supports_paint_setup( - session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); } uint32_t imageId; if (!isSupported) @@ -1562,7 +1556,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( if (trackSequence != 4 || !isLeftEighthToOrthog) { isSupported = wooden_a_supports_paint_setup( - session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportType[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS]); } uint32_t imageId; @@ -1690,8 +1684,7 @@ static void miniature_railway_track_diag_flat( floorImage = floors[supportType].image_id; floorBoundSize = floors[supportType].bound_size; floorBoundOffset = floors[supportType].bound_offset; - isSupported = wooden_a_supports_paint_setup( - session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + isSupported = wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1731,16 +1724,15 @@ enum }; static bool wooden_supports_paint_setup( - paint_session* session, int32_t woodType, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - bool* underground) + paint_session* session, int32_t woodType, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags) { switch (woodType) { case WOOD_A: - return wooden_a_supports_paint_setup(session, supportType, special, height, imageColourFlags, underground); + return wooden_a_supports_paint_setup(session, supportType, special, height, imageColourFlags); case WOOD_B: - return wooden_b_supports_paint_setup(session, supportType, special, height, imageColourFlags, underground); + return wooden_b_supports_paint_setup(session, supportType, special, height, imageColourFlags); } return false; @@ -1779,7 +1771,7 @@ static void miniature_railway_track_diag_25_deg_up( floorBoundSize = floors[supportType].bound_size; floorBoundOffset = floors[supportType].bound_offset; hasSupports = wooden_supports_paint_setup( - session, supportFunction, supportType, 0, height + heightDiff, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, supportFunction, supportType, 0, height + heightDiff, session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1838,8 +1830,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( floorImage = floors[supportType].image_id; floorBoundSize = floors[supportType].bound_size; floorBoundOffset = floors[supportType].bound_offset; - hasSupports = wooden_a_supports_paint_setup( - session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + hasSupports = wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1904,7 +1895,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( floorBoundOffset = floors[supportType].bound_offset; hasSupports = wooden_supports_paint_setup( session, supportFunction, supportType, 0, height + supportOffsets[direction][trackSequence], - session->TrackColours[SCHEME_SUPPORTS], nullptr); + session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1980,7 +1971,7 @@ static void miniature_railway_track_diag_25_deg_down( floorBoundOffset = floors[supportType].bound_offset; hasSupports = wooden_supports_paint_setup( session, supportFunction, supportType, 0, height + supportOffsets[direction][trackSequence], - session->TrackColours[SCHEME_SUPPORTS], nullptr); + session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -2054,7 +2045,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( floorBoundOffset = floors[supportType].bound_offset; hasSupports = wooden_supports_paint_setup( session, supportFunction, supportType, 0, height + supportOffsets[direction][trackSequence], - session->TrackColours[SCHEME_SUPPORTS], nullptr); + session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -2112,8 +2103,7 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( floorImage = floors[supportType].image_id; floorBoundSize = floors[supportType].bound_size; floorBoundOffset = floors[supportType].bound_offset; - hasSupports = wooden_a_supports_paint_setup( - session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + hasSupports = wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index 0b51f32807..5564e9ba5c 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -303,7 +303,7 @@ static void paint_river_rapids_track_flat( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 27, height + 17 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { @@ -344,7 +344,7 @@ static void paint_river_rapids_track_25_deg( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 9, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); break; @@ -356,7 +356,7 @@ static void paint_river_rapids_track_25_deg( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 10, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); break; @@ -368,7 +368,7 @@ static void paint_river_rapids_track_25_deg( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 11, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); break; @@ -379,7 +379,7 @@ static void paint_river_rapids_track_25_deg( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 12, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); break; } @@ -403,7 +403,7 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 18 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); break; @@ -415,7 +415,7 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 18 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); break; @@ -427,7 +427,7 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 18 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); break; @@ -438,7 +438,7 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 18 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); break; } @@ -462,7 +462,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 1, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); break; @@ -474,7 +474,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 2, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); break; @@ -486,7 +486,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 0, 3, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); break; @@ -497,7 +497,7 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = sprites[direction][1] | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height + 16 }); - wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); break; } @@ -607,7 +607,7 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( break; } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -664,7 +664,7 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( break; } - wooden_a_supports_paint_setup(session, 1 - (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, 1 - (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); } @@ -717,7 +717,7 @@ static void paint_river_rapids_track_waterfall( PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 1, 27 }, { 0, 27, height + 17 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { @@ -758,7 +758,7 @@ static void paint_river_rapids_track_rapids( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 11 }, { 0, 27, height + 17 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { @@ -819,7 +819,7 @@ static void paint_river_rapids_track_whirlpool( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 27, height + 17 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 9d4788ac8c..af9068a484 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -485,8 +485,7 @@ static void paint_splash_boats_track_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 50, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 9 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -511,8 +510,7 @@ static void paint_splash_boats_track_60_deg_up( session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 98, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 21 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -536,8 +534,7 @@ static void paint_splash_boats_track_flat_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 42, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 1 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -561,8 +558,7 @@ static void paint_splash_boats_track_25_deg_up_to_flat( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 34, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -587,8 +583,7 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up( session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 13 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -613,8 +608,7 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up( session, direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height); - wooden_a_supports_paint_setup( - session, (direction & 1), 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -640,7 +634,7 @@ static void paint_splash_boats_track_25_deg_down( static constexpr const uint8_t specialSupport[] = { 11, 12, 9, 10 }; wooden_a_supports_paint_setup( - session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -673,7 +667,7 @@ static void paint_splash_boats_track_flat_to_25_deg_down( static constexpr const uint8_t specialSupport[] = { 7, 8, 5, 6 }; wooden_a_supports_paint_setup( - session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -713,7 +707,7 @@ static void paint_splash_boats_track_25_deg_down_to_flat( static constexpr const uint8_t specialSupport[] = { 3, 4, 1, 2 }; wooden_a_supports_paint_setup( - session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + session, (direction & 1), specialSupport[direction], height, session->TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { @@ -766,7 +760,7 @@ static void paint_splash_boats_track_flat( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { @@ -805,7 +799,7 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS]); if (ride != nullptr) track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, trackElement); @@ -835,7 +829,7 @@ static void paint_splash_boats_track_left_quarter_turn_5_tiles( { 1, 0xFF, 4, 2, 0xFF, 4, 0 }, }; uint8_t supportType = supportTypes[direction][trackSequence]; - wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) @@ -916,7 +910,7 @@ static void paint_splash_boats_track_right_quarter_turn_5_tiles( { 1, 0xFF, 3, 5, 0xFF, 3, 0 }, }; uint8_t supportType = supportTypes[direction][trackSequence]; - wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportType, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) @@ -1013,7 +1007,7 @@ static void paint_splash_boats_track_s_bend_left( case 0: PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: @@ -1021,8 +1015,7 @@ static void paint_splash_boats_track_s_bend_left( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); - wooden_a_supports_paint_setup( - session, supportTypes1[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportTypes1[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height( session, @@ -1035,8 +1028,7 @@ static void paint_splash_boats_track_s_bend_left( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); - wooden_a_supports_paint_setup( - session, supportTypes2[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportTypes2[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height( session, @@ -1047,7 +1039,7 @@ static void paint_splash_boats_track_s_bend_left( case 3: PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; } @@ -1105,7 +1097,7 @@ static void paint_splash_boats_track_s_bend_right( case 0: PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: @@ -1113,8 +1105,7 @@ static void paint_splash_boats_track_s_bend_right( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); - wooden_a_supports_paint_setup( - session, supportTypes1[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportTypes1[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height( session, @@ -1127,8 +1118,7 @@ static void paint_splash_boats_track_s_bend_right( PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); - wooden_a_supports_paint_setup( - session, supportTypes2[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, supportTypes2[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height( session, @@ -1139,7 +1129,7 @@ static void paint_splash_boats_track_s_bend_right( case 3: PaintAddImageAsParentRotated(session, direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); PaintAddImageAsParentRotated(session, direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); + wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); break; } From f9c4bb2757575983d22f969a253d61484cb3396c Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 26 Aug 2021 23:00:12 +0200 Subject: [PATCH 237/681] Remove unused persistentChunks argument (#15290) --- src/openrct2/rct12/SawyerChunkReader.cpp | 25 +----------------------- src/openrct2/rct12/SawyerChunkReader.h | 4 +--- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index b8240009f6..3ce28fadff 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -27,9 +27,8 @@ constexpr const char* EXCEPTION_MSG_DESTINATION_TOO_SMALL = "Chunk data larger t constexpr const char* EXCEPTION_MSG_INVALID_CHUNK_ENCODING = "Invalid chunk encoding."; constexpr const char* EXCEPTION_MSG_ZERO_SIZED_CHUNK = "Encountered zero-sized chunk."; -SawyerChunkReader::SawyerChunkReader(OpenRCT2::IStream* stream, bool persistentChunks) +SawyerChunkReader::SawyerChunkReader(OpenRCT2::IStream* stream) : _stream(stream) - , _createsPersistentChunks(persistentChunks) { } @@ -79,10 +78,6 @@ std::shared_ptr SawyerChunkReader::ReadChunk() { throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK); } - if (_createsPersistentChunks) - { - buffer = static_cast(FinaliseLargeTempBuffer(buffer, uncompressedLength)); - } return std::make_shared( static_cast(header.encoding), buffer, uncompressedLength); } @@ -130,10 +125,6 @@ std::shared_ptr SawyerChunkReader::ReadChunkTrack() { throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK); } - if (_createsPersistentChunks) - { - buffer = static_cast(FinaliseLargeTempBuffer(buffer, uncompressedLength)); - } return std::make_shared(SAWYER_ENCODING::RLE, buffer, uncompressedLength); } catch (const std::exception&) @@ -324,20 +315,6 @@ void* SawyerChunkReader::AllocateLargeTempBuffer() return buffer; } -void* SawyerChunkReader::FinaliseLargeTempBuffer(void* buffer, size_t len) -{ -#ifdef __USE_HEAP_ALLOC__ - auto finalBuffer = HeapReAlloc(GetProcessHeap(), 0, buffer, len); -#else - auto finalBuffer = static_cast(std::realloc(buffer, len)); -#endif - if (finalBuffer == nullptr) - { - throw std::runtime_error("Unable to allocate final buffer."); - } - return finalBuffer; -} - void SawyerChunkReader::FreeLargeTempBuffer(void* buffer) { #ifdef __USE_HEAP_ALLOC__ diff --git a/src/openrct2/rct12/SawyerChunkReader.h b/src/openrct2/rct12/SawyerChunkReader.h index 954447325e..79b9fd8b17 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -43,10 +43,9 @@ class SawyerChunkReader final { private: OpenRCT2::IStream* const _stream = nullptr; - const bool _createsPersistentChunks = false; public: - explicit SawyerChunkReader(OpenRCT2::IStream* stream, bool persistentChunks = false); + explicit SawyerChunkReader(OpenRCT2::IStream* stream); /** * Skips the next chunk in the stream without decoding or reading its data @@ -99,6 +98,5 @@ private: static size_t DecodeChunkRotate(void* dst, size_t dstCapacity, const void* src, size_t srcLength); static void* AllocateLargeTempBuffer(); - static void* FinaliseLargeTempBuffer(void* buffer, size_t len); static void FreeLargeTempBuffer(void* buffer); }; From d2e18f5aa00b10caa986cf7e1b72e5db77c40668 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 27 Aug 2021 01:59:59 +0200 Subject: [PATCH 238/681] Add #3868 to changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c06bd9227f..0c91d3c290 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ +- Feature: [#3868] Initial support for using TTF in OpenGL mode (still contains bugs). - Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. From 371478db341549cff5d7d94574bc3caf9eb26848 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 27 Aug 2021 11:05:55 +0200 Subject: [PATCH 239/681] Add 'build' as issue area to form --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 2da13b1c73..3d1071dee6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -38,6 +38,7 @@ body: options: - The bug also exists in RCT2 (vanilla) - This bug is specific to multiplayer + - Building the game validations: required: false From 78747d266f1a763227212242732c74f71cfd5254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:40:17 +0300 Subject: [PATCH 240/681] Use constexpr where applicable in MiniatureRailway.cpp --- .../ride/transport/MiniatureRailway.cpp | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 63c64774af..b642fd9872 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -572,14 +572,18 @@ static uint32_t miniature_railway_track_to_grooved_indent( if (direction & 0x1) { - uint32_t imageIds[2][2] = { { SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW }, - { SPR_G2_MINIATURE_RAILWAY_INSET_END_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE } }; + static constexpr uint32_t imageIds[2][2] = { + { SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW }, + { SPR_G2_MINIATURE_RAILWAY_INSET_END_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE }, + }; imageIdAlt = imageIds[(correctedEdges & 0x2) ? 0 : 1][(correctedEdges & 0x8) ? 0 : 1]; } else { - uint32_t imageIds[2][2] = { { SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW }, - { SPR_G2_MINIATURE_RAILWAY_INSET_END_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE } }; + static constexpr uint32_t imageIds[2][2] = { + { SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW }, + { SPR_G2_MINIATURE_RAILWAY_INSET_END_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE }, + }; imageIdAlt = imageIds[(correctedEdges & 0x1) ? 0 : 1][(correctedEdges & 0x4) ? 0 : 1]; } @@ -1411,7 +1415,12 @@ static void paint_miniature_railway_track_left_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t supportType[4][5] = { { 0, 0, 3, 5, 1 }, { 1, 1, 4, 2, 0 }, { 0, 0, 5, 3, 1 }, { 1, 1, 2, 4, 0 } }; + static constexpr uint8_t supportType[4][5] = { + { 0, 0, 3, 5, 1 }, + { 1, 1, 4, 2, 0 }, + { 0, 0, 5, 3, 1 }, + { 1, 1, 2, 4, 0 }, + }; bool isSupported = false; bool isRightEighthToOrthog = trackElement.GetTrackType() == TrackElemType::RightEighthToOrthogonal; @@ -1547,7 +1556,12 @@ static void paint_miniature_railway_track_right_eighth_to_diag( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t supportType[4][5] = { { 0, 0, 2, 4, 1 }, { 1, 1, 3, 5, 0 }, { 0, 0, 4, 2, 1 }, { 1, 1, 5, 3, 0 } }; + static constexpr uint8_t supportType[4][5] = { + { 0, 0, 2, 4, 1 }, + { 1, 1, 3, 5, 0 }, + { 0, 0, 4, 2, 1 }, + { 1, 1, 5, 3, 0 }, + }; bool isSupported = false; bool isLeftEighthToOrthog = trackElement.GetTrackType() == TrackElemType::LeftEighthToOrthogonal; @@ -1752,7 +1766,7 @@ static void miniature_railway_track_diag_25_deg_up( supportFunction = WOOD_A; } - int8_t heightDiffs[] = { +8, -8, +8, -8 }; + static constexpr int8_t heightDiffs[] = { +8, -8, +8, -8 }; int8_t heightDiff = heightDiffs[direction]; if (trackSequence == 3) { @@ -1868,7 +1882,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t supportOffsets[][4] = { + static constexpr int8_t supportOffsets[][4] = { { 0, +8, +8, +8 }, { 0, -8, -8, 0 }, { 0, +8, +8, +8 }, @@ -1903,7 +1917,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( floorBoundOffset = CoordsXY(-16, -16); } - const int8_t offsetsB[4][4][2] = { + static constexpr int8_t offsetsB[4][4][2] = { { { 0, 0 }, { +8, +16 }, { +8, +8 }, { +8, +8 } }, { { 0, 0 }, { -8, -8 }, { -8, -8 }, { +8, +8 } }, { { 0, 0 }, { +8, +8 }, { +8, +16 }, { +8, +8 } }, @@ -1944,7 +1958,7 @@ static void miniature_railway_track_diag_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t supportOffsets[][4] = { + static constexpr int8_t supportOffsets[][4] = { { 0, +16, +16, 0 }, { 0, -8, -8, 0 }, { 0, +16, +16, 0 }, @@ -1983,7 +1997,7 @@ static void miniature_railway_track_diag_25_deg_down( bool drawRail = miniature_railway_diag_image_segment[direction][trackSequence]; const int8_t railOffsets[] = { 0, +8, +8, +8 }; - const int8_t offsetsB[4][4][2] = { + static constexpr int8_t offsetsB[4][4][2] = { { { 0, 0 }, { +8, +8 }, { +8, +8 }, { -8, -8 } }, { { 0, 0 }, { -8, -8 }, { -8, -8 }, { -8, 0 } }, { { 0, 0 }, { +8, +8 }, { +8, +16 }, { -8, -8 } }, @@ -2019,7 +2033,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t supportOffsets[][4] = { + static constexpr int8_t supportOffsets[][4] = { { 0, +16, +16, 0 }, { 0, -8, -8, -8 }, { 0, +8, +8, 0 }, @@ -2053,7 +2067,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( floorBoundOffset = CoordsXY(-16, -16); } - const int8_t offsetsB[4][4][2] = { + static constexpr int8_t offsetsB[4][4][2] = { { { 0, 0 }, { +8, +8 }, { +8, +8 }, { -8, -8 } }, { { 0, 0 }, { -8, -8 }, { -8, -8 }, { -8, 0 } }, { { 0, 0 }, { +8, +8 }, { +8, +16 }, { -8, -8 } }, From 04ba3f92d7a53d5aa466fae5fbe434ec6f87e5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:42:50 +0300 Subject: [PATCH 241/681] Use constexpr where applicable in Monorail.cpp --- src/openrct2/ride/transport/Monorail.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 65a534cc6a..ab6c1e9d4f 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -746,14 +746,14 @@ static void paint_monorail_track_s_bend_left( trackSequence = 3 - trackSequence; } - const CoordsXY offsetList[] = { + static constexpr CoordsXY offsetList[] = { { 0, 6 }, { 0, 0 }, { 0, 6 }, { 0, 6 }, }; - const CoordsXY boundsList[] = { + static constexpr CoordsXY boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -850,14 +850,14 @@ static void paint_monorail_track_s_bend_right( trackSequence = 3 - trackSequence; } - const CoordsXY offsetList[] = { + static constexpr CoordsXY offsetList[] = { { 0, 6 }, { 0, 6 }, { 0, 0 }, { 0, 6 }, }; - const CoordsXY boundsList[] = { + static constexpr CoordsXY boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -1133,7 +1133,7 @@ static void paint_monorail_track_left_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t map[] = { 4, 2, 3, 1, 0 }; + static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; paint_monorail_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } @@ -1143,7 +1143,7 @@ static void paint_monorail_track_right_eighth_to_orthogonal( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t map[] = { 4, 2, 3, 1, 0 }; + static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; paint_monorail_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } From 5bf882587a4f2d43b814c811abe94e93ed1e251a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:48:16 +0300 Subject: [PATCH 242/681] Use constexpr where applicable in Viewport.cpp --- src/openrct2/interface/Viewport.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 4f68f8ba27..dc0724ae3a 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -239,7 +239,12 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords) auto max = GetMapSizeMinus2(); if (pos.x > max && pos.y > max) { - const CoordsXY corr[] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }; + static constexpr CoordsXY corr[] = { + { -1, -1 }, + { 1, -1 }, + { 1, 1 }, + { -1, 1 }, + }; pos.x += corr[rotation].x * height; pos.y += corr[rotation].y * height; } From de747919c98506ef619bb981f1646aa4a8799ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:51:01 +0300 Subject: [PATCH 243/681] Use constexpr where applicable in Paint.TileElement.cpp From 5dd277fc0d00e37a428a0be2f0f1751ed769a338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:54:35 +0300 Subject: [PATCH 244/681] Use constexpr where applicable in HybridCoaster.cpp --- src/openrct2/ride/coaster/HybridCoaster.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 7ce3ae777e..2192b3aeff 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -447,13 +447,13 @@ namespace HybridRC { 24, 6, height + 8 }, { 4, 6, height + 8 }, }; - static const CoordsXYZ boundBoxLengths[4] = { + static constexpr CoordsXYZ boundBoxLengths[4] = { { 2, 20, 31 }, { 2, 20, 31 }, { 2, 20, 31 }, { 2, 20, 31 }, }; - static const uint32_t imageIds[4] = { + static constexpr uint32_t imageIds[4] = { SPR_G2_HYBRID_TRACK_VERTICAL + 8, SPR_G2_HYBRID_TRACK_VERTICAL + 9, SPR_G2_HYBRID_TRACK_VERTICAL + 10, @@ -492,13 +492,13 @@ namespace HybridRC { 24, 6, height }, { 0, 6, height }, }; - static const CoordsXYZ boundBoxLengths[4] = { + static constexpr CoordsXYZ boundBoxLengths[4] = { { 32, 20, 3 }, { 2, 20, 55 }, { 2, 20, 55 }, { 32, 20, 3 }, }; - static const uint32_t imageIds[4] = { + static constexpr uint32_t imageIds[4] = { SPR_G2_HYBRID_TRACK_VERTICAL + 0, SPR_G2_HYBRID_TRACK_VERTICAL + 1, SPR_G2_HYBRID_TRACK_VERTICAL + 2, @@ -543,13 +543,13 @@ namespace HybridRC { 24, 6, height + 8 }, { 0, 6, height + 8 }, }; - static const CoordsXYZ boundBoxLengths[4] = { + static constexpr CoordsXYZ boundBoxLengths[4] = { { 32, 20, 3 }, { 2, 20, 31 }, { 2, 20, 31 }, { 32, 20, 3 }, }; - static const uint32_t imageIds[4] = { + static constexpr uint32_t imageIds[4] = { SPR_G2_HYBRID_TRACK_VERTICAL + 4, SPR_G2_HYBRID_TRACK_VERTICAL + 5, SPR_G2_HYBRID_TRACK_VERTICAL + 6, From 3c106f7e0fcee2a9a2bd6efdba7c21e171abaf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 22:58:37 +0300 Subject: [PATCH 245/681] Use constexpr where applicable in JuniorRollerCoaster.cpp --- .../ride/coaster/JuniorRollerCoaster.cpp | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 46bd0265b5..3c5e3a250e 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -2509,7 +2509,7 @@ void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( junior_rc_track_pieces_left_quarter_turn_5_tiles_25_deg_up[EnumValue(chainType)], junior_rc_left_quarter_turn_5_tiles_25_deg_up_offsets, defaultRightQuarterTurn5TilesBoundLengths, nullptr); - uint8_t supportSpecial[4] = { 8, 8, 8, 3 }; + static constexpr uint8_t supportSpecial[4] = { 8, 8, 8, 3 }; switch (trackSequence) { case 0: @@ -2589,7 +2589,7 @@ void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( junior_rc_track_pieces_right_quarter_turn_5_tiles_25_deg_up[EnumValue(chainType)], defaultRightQuarterTurn5TilesOffsets, defaultRightQuarterTurn5TilesBoundLengths, nullptr); - uint8_t supportSpecial[4] = { 11, 8, 8, 7 }; + static constexpr uint8_t supportSpecial[4] = { 11, 8, 8, 7 }; switch (trackSequence) { case 0: @@ -2712,14 +2712,14 @@ static void junior_rc_s_bend_left_paint_setup( trackSequence = 3 - trackSequence; } - const CoordsXY offsetList[] = { + static constexpr CoordsXY offsetList[] = { { 0, 6 }, { 0, 0 }, { 0, 6 }, { 0, 6 }, }; - const CoordsXY boundsList[] = { + static constexpr CoordsXY boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -2816,14 +2816,14 @@ static void junior_rc_s_bend_right_paint_setup( trackSequence = 3 - trackSequence; } - const CoordsXY offsetList[] = { + static constexpr CoordsXY offsetList[] = { { 0, 6 }, { 0, 6 }, { 0, 0 }, { 0, 6 }, }; - const CoordsXY boundsList[] = { + static constexpr CoordsXY boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -2921,7 +2921,10 @@ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( defaultRightQuarterTurn3TilesBoundLengths, nullptr); track_paint_util_right_quarter_turn_3_tiles_tunnel(session, height, direction, trackSequence, TUNNEL_0); - uint8_t supportType[2][4] = { { 1, 0, 0, 2 }, { 2, 0, 0, 1 } }; + static constexpr uint8_t supportType[2][4] = { + { 1, 0, 0, 2 }, + { 2, 0, 0, 1 }, + }; switch (trackSequence) { case 0: @@ -3009,7 +3012,12 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - uint8_t thickness[4][4] = { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 26, 1, 1, 26 }, { 1, 1, 1, 1 } }; + static constexpr uint8_t thickness[4][4] = { + { 1, 1, 1, 1 }, + { 1, 1, 1, 1 }, + { 26, 1, 1, 26 }, + { 1, 1, 1, 1 }, + }; track_paint_util_right_quarter_turn_3_tiles_paint( session, thickness[direction][trackSequence], height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], @@ -3187,7 +3195,10 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); } - uint8_t supportType[2][4] = { { 1, 0, 0, 2 }, { 2, 0, 0, 1 } }; + static constexpr uint8_t supportType[2][4] = { + { 1, 0, 0, 2 }, + { 2, 0, 0, 1 }, + }; switch (trackSequence) { case 0: @@ -3274,7 +3285,7 @@ static void junior_rc_right_half_banked_helix_up_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t thickness[2] = { 1, 26 }; + static constexpr int8_t thickness[2] = { 1, 26 }; if (trackSequence > 3) { @@ -3342,7 +3353,7 @@ static void junior_rc_right_half_banked_helix_down_small_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t thickness[2] = { 1, 26 }; + static constexpr int8_t thickness[2] = { 1, 26 }; if (trackSequence > 3) { @@ -3442,7 +3453,7 @@ static void junior_rc_right_half_banked_helix_up_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t thickness[2] = { 1, 26 }; + static constexpr int8_t thickness[2] = { 1, 26 }; if (trackSequence > 6) { @@ -3528,7 +3539,7 @@ static void junior_rc_right_half_banked_helix_down_large_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const int8_t thickness[2] = { 1, 26 }; + static constexpr int8_t thickness[2] = { 1, 26 }; if (trackSequence > 6) { @@ -4162,7 +4173,7 @@ static void junior_rc_left_eighth_to_orthogonal_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t map[] = { 4, 2, 3, 1, 0 }; + static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; junior_rc_right_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } @@ -4172,7 +4183,7 @@ static void junior_rc_right_eighth_to_orthogonal_bank_paint_setup( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint8_t map[] = { 4, 2, 3, 1, 0 }; + static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; trackSequence = map[trackSequence]; junior_rc_left_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } @@ -4978,7 +4989,7 @@ void junior_rc_paint_track_60_deg_up( break; } - int8_t support[4] = { 35, 29, 25, 32 }; + static constexpr int8_t support[4] = { 35, 29, 25, 32 }; if (track_paint_util_should_paint_supports(session->MapPosition)) { metal_a_supports_paint_setup( @@ -5067,7 +5078,7 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( break; } - int8_t support[4] = { 12, 12, 12, 14 }; + static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(session->MapPosition)) { metal_a_supports_paint_setup( @@ -5449,7 +5460,7 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( break; } - int8_t support[4] = { 12, 12, 12, 14 }; + static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(session->MapPosition)) { metal_a_supports_paint_setup( From 2a087a7eef26de615ecd7b61587ffb9f80953846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 23:22:00 +0300 Subject: [PATCH 246/681] Remove static initialization in looping_rc_track_station --- .../ride/coaster/LoopingRollerCoaster.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index 0df9ecab8a..b2cdbf4ad4 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -82,15 +82,19 @@ static void looping_rc_track_station( paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - const uint32_t stationTrackNESW = is_csg_loaded() ? LOOPING_RC_BOOSTER_NE_SW : 15016; - const uint32_t stationTrackNWSE = is_csg_loaded() ? LOOPING_RC_BOOSTER_NW_SE : 15017; - - static const uint32_t imageIds[4][2] = { - { stationTrackNESW, SPR_STATION_BASE_B_SW_NE }, - { stationTrackNWSE, SPR_STATION_BASE_B_NW_SE }, - { stationTrackNESW, SPR_STATION_BASE_B_SW_NE }, - { stationTrackNWSE, SPR_STATION_BASE_B_NW_SE }, + static constexpr uint32_t imageIdsWithCsg[4][2] = { + { LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, + { LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, + { LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, + { LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; + static constexpr uint32_t imageIdWithoutCsg[4][2] = { + { 15016, SPR_STATION_BASE_B_SW_NE }, + { 15017, SPR_STATION_BASE_B_NW_SE }, + { 15016, SPR_STATION_BASE_B_SW_NE }, + { 15017, SPR_STATION_BASE_B_NW_SE }, + }; + const auto imageIds = is_csg_loaded() ? imageIdsWithCsg : imageIdWithoutCsg; PaintAddImageAsParentRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, From 70df58da1564b4fd8f804a35fafc43d3197c521e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 26 Aug 2021 23:26:28 +0300 Subject: [PATCH 247/681] Use constexpr where applicable in MiniatureRailway.cpp --- src/openrct2/ride/transport/MiniatureRailway.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index b642fd9872..3acb96aa18 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1927,7 +1927,7 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( uint32_t imageId = miniature_railway_track_pieces_diag_25_deg_up_to_flat[direction]; bool drawRail = miniature_railway_diag_image_segment[direction][trackSequence]; - const int8_t railOffsets[] = { +8, 0, +8, +8 }; + static constexpr int8_t railOffsets[] = { +8, 0, +8, +8 }; if (hasSupports) { @@ -1995,7 +1995,7 @@ static void miniature_railway_track_diag_25_deg_down( uint32_t imageId = miniature_railway_track_pieces_diag_25_deg_up[(direction + 2) % 4]; bool drawRail = miniature_railway_diag_image_segment[direction][trackSequence]; - const int8_t railOffsets[] = { 0, +8, +8, +8 }; + static constexpr int8_t railOffsets[] = { 0, +8, +8, +8 }; static constexpr int8_t offsetsB[4][4][2] = { { { 0, 0 }, { +8, +8 }, { +8, +8 }, { -8, -8 } }, @@ -2076,7 +2076,7 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( uint32_t imageId = miniature_railway_track_pieces_diag_25_deg_up_to_flat[(direction + 2) % 4]; bool drawRail = miniature_railway_diag_image_segment[direction][trackSequence]; - const int8_t railOffsets[] = { 0, +8, +8, +8 }; + static constexpr int8_t railOffsets[] = { 0, +8, +8, +8 }; if (hasSupports) { From d7b911ffeafa7b75e4ca8596be34bf9f9d3d0def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 27 Aug 2021 21:34:09 +0300 Subject: [PATCH 248/681] Add sprite constants for LOOPING_RC_FLAT_CHAINED --- .../ride/coaster/LoopingRollerCoaster.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index b2cdbf4ad4..b70fa6c187 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -21,6 +21,9 @@ #define LOOPING_RC_BOOSTER_NE_SW (SPR_CSG_BEGIN + 55679) #define LOOPING_RC_BOOSTER_NW_SE (SPR_CSG_BEGIN + 55680) +static constexpr auto SPR_LOOPING_RC_FLAT_CHAINED_SW_NE = 15016; +static constexpr auto SPR_LOOPING_RC_FLAT_CHAINED_NW_SE = 15017; + /** rct2: 0x008A6370 */ static void looping_rc_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -88,13 +91,13 @@ static void looping_rc_track_station( { LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, { LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; - static constexpr uint32_t imageIdWithoutCsg[4][2] = { - { 15016, SPR_STATION_BASE_B_SW_NE }, - { 15017, SPR_STATION_BASE_B_NW_SE }, - { 15016, SPR_STATION_BASE_B_SW_NE }, - { 15017, SPR_STATION_BASE_B_NW_SE }, + static constexpr uint32_t imageIdsWithoutCsg[4][2] = { + { SPR_LOOPING_RC_FLAT_CHAINED_SW_NE, SPR_STATION_BASE_B_SW_NE }, + { SPR_LOOPING_RC_FLAT_CHAINED_NW_SE, SPR_STATION_BASE_B_NW_SE }, + { SPR_LOOPING_RC_FLAT_CHAINED_SW_NE, SPR_STATION_BASE_B_SW_NE }, + { SPR_LOOPING_RC_FLAT_CHAINED_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; - const auto imageIds = is_csg_loaded() ? imageIdsWithCsg : imageIdWithoutCsg; + const auto imageIds = is_csg_loaded() ? imageIdsWithCsg : imageIdsWithoutCsg; PaintAddImageAsParentRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, From 0c05557b923b100d15292738b99a848b4c31315d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 27 Aug 2021 22:40:51 +0300 Subject: [PATCH 249/681] Change defines to constexpr and add SPR_ prefix --- .../ride/coaster/LoopingRollerCoaster.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index b70fa6c187..be93f9f8a3 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -18,8 +18,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" -#define LOOPING_RC_BOOSTER_NE_SW (SPR_CSG_BEGIN + 55679) -#define LOOPING_RC_BOOSTER_NW_SE (SPR_CSG_BEGIN + 55680) +static constexpr auto SPR_LOOPING_RC_BOOSTER_NE_SW = (SPR_CSG_BEGIN + 55679); +static constexpr auto SPR_LOOPING_RC_BOOSTER_NW_SE = (SPR_CSG_BEGIN + 55680); static constexpr auto SPR_LOOPING_RC_FLAT_CHAINED_SW_NE = 15016; static constexpr auto SPR_LOOPING_RC_FLAT_CHAINED_NW_SE = 15017; @@ -86,10 +86,10 @@ static void looping_rc_track_station( const TrackElement& trackElement) { static constexpr uint32_t imageIdsWithCsg[4][2] = { - { LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, - { LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, - { LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, - { LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, + { SPR_LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, + { SPR_LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, + { SPR_LOOPING_RC_BOOSTER_NE_SW, SPR_STATION_BASE_B_SW_NE }, + { SPR_LOOPING_RC_BOOSTER_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; static constexpr uint32_t imageIdsWithoutCsg[4][2] = { { SPR_LOOPING_RC_FLAT_CHAINED_SW_NE, SPR_STATION_BASE_B_SW_NE }, @@ -9172,14 +9172,14 @@ static void looping_rc_track_booster( case 0: case 2: PaintAddImageAsParentRotated( - session, direction, session->TrackColours[SCHEME_TRACK] | LOOPING_RC_BOOSTER_NE_SW, 0, 0, 32, 20, 3, height, 0, - 6, height); + session, direction, session->TrackColours[SCHEME_TRACK] | SPR_LOOPING_RC_BOOSTER_NE_SW, 0, 0, 32, 20, 3, height, + 0, 6, height); break; case 1: case 3: PaintAddImageAsParentRotated( - session, direction, session->TrackColours[SCHEME_TRACK] | LOOPING_RC_BOOSTER_NW_SE, 0, 0, 32, 20, 3, height, 0, - 6, height); + session, direction, session->TrackColours[SCHEME_TRACK] | SPR_LOOPING_RC_BOOSTER_NW_SE, 0, 0, 32, 20, 3, height, + 0, 6, height); break; } if (track_paint_util_should_paint_supports(session->MapPosition)) From 9c53fe252d8b645cdc6a095fc5314ea8faa38051 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Fri, 27 Aug 2021 17:44:33 -0400 Subject: [PATCH 250/681] Part of #13874: ZehMatt review changes --- src/openrct2-ui/windows/RideConstruction.cpp | 4 +-- src/openrct2/ride/Ride.cpp | 8 +++--- src/openrct2/ride/RideConstruction.cpp | 2 +- src/openrct2/ride/TrackData.cpp | 26 ++++++++++---------- src/openrct2/ride/TrackData.h | 2 +- src/openrct2/ride/TrackDesign.cpp | 12 ++++----- src/openrct2/world/TileInspector.cpp | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 36530f15be..660e44d6b9 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2349,7 +2349,7 @@ static void window_ride_construction_draw_track_piece( return; const auto& teDescriptor = GetTrackElementDescriptor(trackType); - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; while ((trackBlock + 1)->index != 0xFF) trackBlock++; @@ -2404,7 +2404,7 @@ static void sub_6CBCE2( gMapSize = MAXIMUM_MAP_SIZE_TECHNICAL; const auto& teDescriptor = GetTrackElementDescriptor(trackType); - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; while (trackBlock->index != 255) { auto quarterTile = trackBlock->var_08.Rotate(trackDirection); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index b55da43d9e..b3df84e1bc 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -531,7 +531,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return false; @@ -600,7 +600,7 @@ bool track_block_get_previous_from_zero( continue; const auto& teDesc = GetTrackElementDescriptor(trackElement->GetTrackType()); - auto nextTrackBlock = teDesc.Block; + const auto* nextTrackBlock = teDesc.Block; if (nextTrackBlock == nullptr) continue; auto nextTrackCoordinate = teDesc.Coordinates; @@ -636,7 +636,7 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); - auto nextTrackBlock2 = teDescriptor.Block; + const auto* nextTrackBlock2 = teDescriptor.Block; if (nextTrackBlock2 == nullptr) continue; @@ -677,7 +677,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra if (ride == nullptr) return false; - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return false; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 5b3bb6a432..980b0412c4 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -395,7 +395,7 @@ std::optional sub_6C683D( // Possibly z should be & 0xF8 const auto& teDescriptor = GetTrackElementDescriptor(type); - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; if (trackBlock == nullptr) return std::nullopt; diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 0ab32b5984..4777b5faf9 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -16,7 +16,7 @@ #include // clang-format off -const static rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { +static constexpr rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { { 0, 0, 0, 0, 0, 0 }, // ELEM_FLAT { 0, 0, 0, 0, 0, 0 }, // ELEM_END_STATION { 0, 0, 0, 0, 0, 0 }, // ELEM_BEGIN_STATION @@ -287,7 +287,7 @@ const static rct_track_coordinates TrackCoordinates[TrackElemType::Count] = { }; /** rct2: 0x0099BA64 */ -const static uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { +static constexpr uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { { 0 }, /* TrackElemType::EndStation */ { TRACK_SEQUENCE_FLAG_DIRECTION_1 | TRACK_SEQUENCE_FLAG_DIRECTION_3 | TRACK_SEQUENCE_FLAG_ORIGIN | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* TrackElemType::BeginStation */ { TRACK_SEQUENCE_FLAG_DIRECTION_1 | TRACK_SEQUENCE_FLAG_DIRECTION_3 | TRACK_SEQUENCE_FLAG_ORIGIN | TRACK_SEQUENCE_FLAG_DISALLOW_DOORS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -559,7 +559,7 @@ const static uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { #define TRACK_BLOCK_END { 255, 255, 255, 255, 255, {255, 255}, 255 } -static constexpr const rct_preview_track TrackBlocks000[] = { +static constexpr rct_preview_track TrackBlocks000[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, TRACK_BLOCK_END }; @@ -2545,7 +2545,7 @@ static constexpr const rct_preview_track TrackBlocksFlatTrack3x3[] = { }; // rct2: 0x00994638 -const static rct_preview_track *TrackBlocks[TrackElemType::Count] = { +static constexpr std::array TrackBlocks = { TrackBlocks000, TrackBlocks001, TrackBlocks002, @@ -2816,7 +2816,7 @@ const static rct_preview_track *TrackBlocks[TrackElemType::Count] = { TrackBlocksFlatTrack3x3, }; -const static uint8_t TrackPieceLengths[TrackElemType::Count] = { +static constexpr uint8_t TrackPieceLengths[TrackElemType::Count] = { 32, // TrackElemType::Flat 32, // TrackElemType::EndStation 32, // TrackElemType::BeginStation @@ -3087,7 +3087,7 @@ const static uint8_t TrackPieceLengths[TrackElemType::Count] = { }; // rct2: 0x00998C95 -const static track_curve_chain gTrackCurveChain[TrackElemType::Count] = { +static constexpr track_curve_chain gTrackCurveChain[TrackElemType::Count] = { { TRACK_CURVE_NONE, TRACK_CURVE_NONE }, { RideConstructionSpecialPieceSelected | TrackElemType::EndStation, RideConstructionSpecialPieceSelected | TrackElemType::EndStation }, { RideConstructionSpecialPieceSelected | TrackElemType::EndStation, RideConstructionSpecialPieceSelected | TrackElemType::EndStation }, @@ -3503,7 +3503,7 @@ const track_descriptor gTrackDescriptors[142] = { }; /** rct2: 0x00993D1C */ -const static track_type_t AlternativeTrackTypes[TrackElemType::Count] = { +static constexpr track_type_t AlternativeTrackTypes[TrackElemType::Count] = { TrackElemType::FlatCovered, // TrackElemType::Flat TrackElemType::None, TrackElemType::None, @@ -3774,7 +3774,7 @@ const static track_type_t AlternativeTrackTypes[TrackElemType::Count] = { }; /** rct2: 0x0099DA34 */ -const static money32 TrackPricing[TrackElemType::Count] = { +static constexpr money32 TrackPricing[TrackElemType::Count] = { 65536, // TrackElemType::Flat 98304, // TrackElemType::EndStation 98304, // TrackElemType::BeginStation @@ -4045,7 +4045,7 @@ const static money32 TrackPricing[TrackElemType::Count] = { }; /** rct2: 0x0099EA1C */ -const static track_type_t TrackElementMirrorMap[TrackElemType::Count] = { +static constexpr track_type_t TrackElementMirrorMap[TrackElemType::Count] = { TrackElemType::Flat, TrackElemType::EndStation, TrackElemType::BeginStation, @@ -4316,7 +4316,7 @@ const static track_type_t TrackElementMirrorMap[TrackElemType::Count] = { }; /** rct2: 0x00999694 */ -const static uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { +static constexpr uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { (1 << 0), // TrackElemType::Flat (1 << 0), // TrackElemType::EndStation (1 << 0), // TrackElemType::BeginStation @@ -4587,7 +4587,7 @@ const static uint32_t TrackHeightMarkerPositions[TrackElemType::Count] = { }; /** rct2: 0x00999A94 */ -const static uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequencesPerPiece] = { +static constexpr uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][MaxSequencesPerPiece] = { { 0b1010, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::Flat { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::EndStation { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // TrackElemType::BeginStation @@ -4858,7 +4858,7 @@ const static uint8_t TrackSequenceElementAllowedWallEdges[TrackElemType::Count][ }; /** rct2: 0x0099423C */ -const static uint16_t TrackFlags[TrackElemType::Count] = { +static constexpr uint16_t TrackFlags[TrackElemType::Count] = { /* TrackElemType::Flat */ TRACK_ELEM_FLAG_ALLOW_LIFT_HILL, /* TrackElemType::EndStation */ 0, /* TrackElemType::BeginStation */ 0, @@ -5160,7 +5160,7 @@ namespace OpenRCT2 _trackElementDescriptors.push_back(desc); } } - const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t& type) + const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t type) { return _trackElementDescriptors[type]; } diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 9e41660b5c..0b43a74426 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -77,6 +77,6 @@ namespace OpenRCT2 namespace TrackMetaData { void Init(); - const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t& type); + const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t type); } // namespace TrackMetaData } // namespace OpenRCT2 diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 5c22e095aa..a8d51989ed 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -185,7 +185,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) const auto& teDescriptor = GetTrackElementDescriptor(trackElement.element->AsTrack()->GetTrackType()); const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; // Used in the following loop to know when we have // completed all of the elements and are back at the // start. @@ -1650,13 +1650,13 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co } } - const rct_track_coordinates* track_coordinates = &teDescriptor.Coordinates; + const rct_track_coordinates& track_coordinates = teDescriptor.Coordinates; auto offsetAndRotatedTrack = CoordsXY{ newCoords } - + CoordsXY{ track_coordinates->x, track_coordinates->y }.Rotate(rotation); + + CoordsXY{ track_coordinates.x, track_coordinates.y }.Rotate(rotation); - newCoords = { offsetAndRotatedTrack, newCoords.z - track_coordinates->z_begin + track_coordinates->z_end }; - rotation = (rotation + track_coordinates->rotation_end - track_coordinates->rotation_begin) & 3; - if (track_coordinates->rotation_end & (1 << 2)) + newCoords = { offsetAndRotatedTrack, newCoords.z - track_coordinates.z_begin + track_coordinates.z_end }; + rotation = (rotation + track_coordinates.rotation_end - track_coordinates.rotation_begin) & 3; + if (track_coordinates.rotation_end & (1 << 2)) { rotation |= (1 << 2); } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index f5e2632bce..cf1a998b22 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -856,7 +856,7 @@ namespace OpenRCT2::TileInspector return std::make_unique(GameActions::Status::Unknown, STR_NONE); const auto& teDescriptor = GetTrackElementDescriptor(type); - auto trackBlock = teDescriptor.Block; + const auto* trackBlock = teDescriptor.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); From 5f438535adc468170d2c59c9cbb41eade47ec61b Mon Sep 17 00:00:00 2001 From: frutiemax Date: Fri, 27 Aug 2021 17:49:32 -0400 Subject: [PATCH 251/681] Part of #13874: Gymnasiast review --- src/openrct2-ui/windows/NewRide.cpp | 6 +- src/openrct2-ui/windows/Ride.cpp | 4 +- src/openrct2-ui/windows/RideConstruction.cpp | 24 +++---- src/openrct2-ui/windows/TrackDesignPlace.cpp | 11 ++- src/openrct2/actions/MazePlaceTrackAction.cpp | 8 +-- src/openrct2/actions/MazeSetTrackAction.cpp | 8 +-- src/openrct2/actions/TrackPlaceAction.cpp | 36 +++++----- src/openrct2/actions/TrackRemoveAction.cpp | 20 +++--- src/openrct2/actions/WallPlaceAction.cpp | 24 +++---- src/openrct2/ride/Ride.cpp | 70 +++++++++---------- src/openrct2/ride/RideConstruction.cpp | 40 +++++------ src/openrct2/ride/TrackDesign.cpp | 26 +++---- src/openrct2/ride/TrackPaint.cpp | 4 +- src/openrct2/ride/Vehicle.cpp | 28 ++++---- src/openrct2/windows/_legacy.cpp | 16 ++--- src/openrct2/world/Footpath.cpp | 18 ++--- src/openrct2/world/TileInspector.cpp | 12 ++-- 17 files changed, 177 insertions(+), 178 deletions(-) diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 0e4868a487..dff60eaa81 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -943,10 +943,10 @@ static void window_new_ride_paint_ride_information( if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { // Get price of ride - int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece; + int32_t startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece; money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; - const auto& teDescriptor = GetTrackElementDescriptor(unk2); - price *= teDescriptor.Pricing; + const auto& ted = GetTrackElementDescriptor(startPieceId); + price *= ted.Pricing; price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; // diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 5fc066517d..7469bce3dc 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1369,8 +1369,8 @@ rct_window* window_ride_open_track(TileElement* tileElement) // Open ride window in station view auto trackElement = tileElement->AsTrack(); auto trackType = trackElement->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { auto stationIndex = trackElement->GetStationIndex(); return window_ride_open_station(ride, stationIndex); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 660e44d6b9..00f1eaa72b 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1926,8 +1926,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) return; } - const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const rct_preview_track* trackBlock = ted.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; gGotoStartPlacementMode = true; } @@ -2348,8 +2348,8 @@ static void window_ride_construction_draw_track_piece( if (ride == nullptr) return; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const auto* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; while ((trackBlock + 1)->index != 0xFF) trackBlock++; @@ -2403,8 +2403,8 @@ static void sub_6CBCE2( gMapSize = MAXIMUM_MAP_SIZE_TECHNICAL; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const auto* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; while (trackBlock->index != 255) { auto quarterTile = trackBlock->var_08.Rotate(trackDirection); @@ -3297,8 +3297,8 @@ static void window_ride_construction_select_map_tiles( const rct_preview_track* trackBlock; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; trackDirection &= 3; gMapSelectionTiles.clear(); while (trackBlock->index != 255) @@ -3475,8 +3475,8 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) // z = map_get_highest_z(x >> 5, y >> 5); } // loc_6CC91B: - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; int32_t bx = 0; do { @@ -3706,8 +3706,8 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) if (_trackPlaceZ == 0) { - const auto& teDescriptor = GetTrackElementDescriptor(_currentTrackPieceType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(_currentTrackPieceType); + const rct_preview_track* trackBlock = ted.Block; int32_t bx = 0; do { diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 3ca11449c2..26d46164af 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -551,8 +551,8 @@ static void window_track_place_draw_mini_preview_track( } // Follow a single track piece shape - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; while (trackBlock->index != 255) { auto rotatedAndOffsetTrackBlock = curTrackStart + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(curTrackRotation); @@ -574,9 +574,8 @@ static void window_track_place_draw_mini_preview_track( auto bits = trackBlock->var_08.Rotate(curTrackRotation & 3).GetBaseQuarterOccupied(); // Station track is a lighter colour - uint8_t colour = (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) - ? _PaletteIndexColourStation - : _PaletteIndexColourTrack; + uint8_t colour = (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) ? _PaletteIndexColourStation + : _PaletteIndexColourTrack; for (int32_t i = 0; i < 4; i++) { @@ -597,7 +596,7 @@ static void window_track_place_draw_mini_preview_track( // Change rotation and next position based on track curvature curTrackRotation &= 3; - const rct_track_coordinates* track_coordinate = &teDescriptor.Coordinates; + const rct_track_coordinates* track_coordinate = &ted.Coordinates; curTrackStart += CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(curTrackRotation); curTrackRotation += track_coordinate->rotation_end - track_coordinate->rotation_begin; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 8e049bcd13..c39f19a21b 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -115,8 +115,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const return res; } - const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; return res; @@ -157,8 +157,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const return canBuild; } - const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index f7f78114c3..167f67e1fd 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -136,8 +136,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const return res; } - const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); res->Cost = price / 2 * 10; return res; @@ -172,8 +172,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex); if (tileElement == nullptr) { - const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16)); + const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); res->Cost = price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 21131a1c3c..96aab983f4 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -147,8 +147,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if ((_trackPlaceFlags & CONSTRUCTION_LIFT_HILL_SELECTED) && !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack) { - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); - if (teDescriptor.Flags & TRACK_ELEM_FLAG_IS_STEEP_UP) + const auto& ted = GetTrackElementDescriptor(_trackType); + if (ted.Flags & TRACK_ELEM_FLAG_IS_STEEP_UP) { return std::make_unique(GameActions::Status::Disallowed, STR_TOO_STEEP_FOR_LIFT_HILL); } @@ -156,8 +156,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 cost = 0; - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(_trackType); + const rct_preview_track* trackBlock = ted.Block; uint32_t numElements = 0; // First check if any of the track pieces are outside the park for (; trackBlock->index != 0xFF; trackBlock++) @@ -180,7 +180,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (!gCheatsAllowTrackPlaceInvalidHeights) { - if (teDescriptor.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) + if (ted.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) { if ((_origin.z & 0x0F) != 8) { @@ -199,7 +199,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } // If that is not the case, then perform the remaining checks - trackBlock = teDescriptor.Block; + trackBlock = ted.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { @@ -263,7 +263,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } res->GroundFlags = mapGroundFlags; - if (teDescriptor.Flags & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) + if (ted.Flags & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) { if (res->GroundFlags & ELEMENT_IS_UNDERGROUND) { @@ -272,7 +272,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - if (teDescriptor.Flags & TRACK_ELEM_FLAG_ONLY_UNDERWATER) + if (ted.Flags & TRACK_ELEM_FLAG_ONLY_UNDERWATER) { // No element has this flag if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) { @@ -318,7 +318,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.TrackSequenceProperties[0]; if ((entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN) && trackBlock->index == 0) { if (!track_add_station_element({ mapLoc, baseZ, _origin.direction }, _rideIndex, 0, _fromTrackDesign)) @@ -367,7 +367,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= teDescriptor.Pricing; + price *= ted.Pricing; price >>= 16; res->Cost = cost + ((price / 2) * 10); @@ -400,11 +400,11 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags; - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); - auto wallEdges = teDescriptor.SequenceElementAllowedWallEdges; + const auto& ted = GetTrackElementDescriptor(_trackType); + auto wallEdges = ted.SequenceElementAllowedWallEdges; money32 cost = 0; - const rct_preview_track* trackBlock = teDescriptor.Block; + const rct_preview_track* trackBlock = ted.Block; for (int32_t blockIndex = 0; trackBlock->index != 0xFF; trackBlock++, blockIndex++) { auto rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction), trackBlock->z }; @@ -538,7 +538,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const { if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND)) { - entranceDirections = teDescriptor.TrackSequenceProperties[0]; + entranceDirections = ted.TrackSequenceProperties[0]; } } @@ -597,7 +597,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } trackElement->SetColourScheme(_colour); - entranceDirections = teDescriptor.TrackSequenceProperties[0]; + entranceDirections = ted.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint8_t availableDirections = entranceDirections & 0x0F; @@ -653,7 +653,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= teDescriptor.Pricing; + price *= ted.Pricing; price >>= 16; res->Cost = cost + ((price / 2) * 10); @@ -662,8 +662,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const bool TrackPlaceAction::CheckMapCapacity(int16_t numTiles) const { - const auto& teDescriptor = GetTrackElementDescriptor(_trackType); - for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) + const auto& ted = GetTrackElementDescriptor(_trackType); + for (const rct_preview_track* trackBlock = ted.Block; trackBlock->index != 0xFF; trackBlock++) { auto rotatedTrack = CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 5e084b109d..49e9967d05 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -136,8 +136,8 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const log_warning("Ride type not found. ride type = %d.", ride->type); return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -153,7 +153,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const money32 cost = 0; - trackBlock = teDescriptor.Block; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -203,7 +203,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) @@ -229,7 +229,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= teDescriptor.Pricing; + price *= ted.Pricing; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) @@ -317,8 +317,8 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const log_warning("Ride not found. ride index = %d.", rideIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; trackBlock += tileElement->AsTrack()->GetSequenceIndex(); auto startLoc = _origin; @@ -333,7 +333,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const res->Position.z = startLoc.z; money32 cost = 0; - trackBlock = teDescriptor.Block; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { rotatedTrackLoc = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; @@ -378,7 +378,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = teDescriptor.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.TrackSequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) @@ -477,7 +477,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= teDescriptor.Pricing; + price *= ted.Pricing; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 7aa2244383..2f660ea596 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -408,7 +408,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( track_type_t trackType = trackElement->GetTrackType(); using namespace OpenRCT2::TrackMetaData; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const auto& ted = GetTrackElementDescriptor(trackType); int32_t sequence = trackElement->GetSequenceIndex(); int32_t direction = (_edge - trackElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; auto ride = get_ride(trackElement->GetRideIndex()); @@ -441,20 +441,20 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( int32_t z; if (sequence == 0) { - if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) + if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) { return false; } if (TrackDefinitions[trackType].bank_start == 0) { - if (!(teDescriptor.Coordinates.rotation_begin & 4)) + if (!(ted.Coordinates.rotation_begin & 4)) { direction = direction_reverse(trackElement->GetDirection()); if (direction == _edge) { - const rct_preview_track* trackBlock = &teDescriptor.Block[sequence]; - z = teDescriptor.Coordinates.z_begin; + const rct_preview_track* trackBlock = &ted.Block[sequence]; + z = ted.Coordinates.z_begin; z = trackElement->base_height + ((z - trackBlock->z) * 8); if (z == z0) { @@ -465,7 +465,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( } } - const rct_preview_track* trackBlock = &teDescriptor.Block[sequence + 1]; + const rct_preview_track* trackBlock = &ted.Block[sequence + 1]; if (trackBlock->index != 0xFF) { return false; @@ -476,20 +476,20 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - direction = teDescriptor.Coordinates.rotation_end; + direction = ted.Coordinates.rotation_end; if (direction & 4) { return false; } - direction = (trackElement->GetDirection() + teDescriptor.Coordinates.rotation_end) & TILE_ELEMENT_DIRECTION_MASK; + direction = (trackElement->GetDirection() + ted.Coordinates.rotation_end) & TILE_ELEMENT_DIRECTION_MASK; if (direction != _edge) { return false; } - trackBlock = &teDescriptor.Block[sequence]; - z = teDescriptor.Coordinates.z_end; + trackBlock = &ted.Block[sequence]; + z = ted.Coordinates.z_end; z = trackElement->base_height + ((z - trackBlock->z) * 8); return z == z0; } @@ -593,8 +593,8 @@ bool WallPlaceAction::TrackIsAllowedWallEdges( { if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_NO_WALLS)) { - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.SequenceElementAllowedWallEdges[trackSequence] & (1 << direction)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.SequenceElementAllowedWallEdges[trackSequence] & (1 << direction)) { return true; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index b3df84e1bc..877be528eb 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -410,11 +410,11 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) // Found a track piece for target ride // Check if it's not the station or ??? (but allow end piece of station) - const auto& teDescriptor = GetTrackElementDescriptor(it.element->AsTrack()->GetTrackType()); + const auto& ted = GetTrackElementDescriptor(it.element->AsTrack()->GetTrackType()); bool specialTrackPiece = (it.element->AsTrack()->GetTrackType() != TrackElemType::BeginStation && it.element->AsTrack()->GetTrackType() != TrackElemType::MiddleStation - && (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); + && (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); // Set result tile to this track piece if first found track or a ??? if (resultTileElement == nullptr || specialTrackPiece) @@ -480,12 +480,12 @@ bool track_block_get_next_from_zero( if (tileElement->IsGhost() != isGhost) continue; - const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); - auto nextTrackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + auto nextTrackBlock = ted.Block; if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = teDescriptor.Coordinates; + auto nextTrackCoordinate = ted.Coordinates; uint8_t nextRotation = tileElement->GetDirectionWithOffset(nextTrackCoordinate.rotation_begin) | (nextTrackCoordinate.rotation_begin & TRACK_BLOCK_2); @@ -522,7 +522,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 return false; auto inputElement = input->element->AsTrack(); - const auto& teDescriptor = GetTrackElementDescriptor(inputElement->GetTrackType()); + const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); if (inputElement == nullptr) return false; @@ -531,13 +531,13 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; - const auto* trackBlock = teDescriptor.Block; + const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; trackBlock += inputElement->GetSequenceIndex(); - auto trackCoordinate = teDescriptor.Coordinates; + auto trackCoordinate = ted.Coordinates; int32_t x = input->x; int32_t y = input->y; @@ -635,8 +635,8 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); - const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); - const auto* nextTrackBlock2 = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock2 = ted.Block; if (nextTrackBlock2 == nullptr) continue; @@ -668,7 +668,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra return false; auto trackElement = trackPos.element->AsTrack(); - const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); if (trackElement == nullptr) return false; @@ -677,13 +677,13 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra if (ride == nullptr) return false; - const auto* trackBlock = teDescriptor.Block; + const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; trackBlock += trackElement->GetSequenceIndex(); - auto trackCoordinate = teDescriptor.Coordinates; + auto trackCoordinate = ted.Coordinates; int32_t z = trackElement->GetBaseZ(); @@ -2229,8 +2229,8 @@ static void ride_shop_connected(Ride* ride) return; } - const auto& teDescriptor = GetTrackElementDescriptor(track_type); - uint8_t entrance_directions = teDescriptor.TrackSequenceProperties[0] & 0xF; + const auto& ted = GetTrackElementDescriptor(track_type); + uint8_t entrance_directions = ted.TrackSequenceProperties[0] & 0xF; uint8_t tile_direction = trackElement->GetDirection(); entrance_directions = rol4(entrance_directions, tile_direction); @@ -2665,8 +2665,8 @@ static bool ride_check_track_contains_inversions(CoordsXYE* input, CoordsXYE* ou while (track_circuit_iterator_next(&it)) { auto trackType = it.current.element->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.Flags & TRACK_ELEM_FLAG_INVERSION_TO_NORMAL) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.Flags & TRACK_ELEM_FLAG_INVERSION_TO_NORMAL) { *output = it.current; return true; @@ -2724,8 +2724,8 @@ static bool ride_check_track_contains_banked(CoordsXYE* input, CoordsXYE* output while (track_circuit_iterator_next(&it)) { auto trackType = output->element->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.Flags & TRACK_ELEM_FLAG_BANKED) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.Flags & TRACK_ELEM_FLAG_BANKED) { *output = it.current; return true; @@ -2774,8 +2774,8 @@ static int32_t ride_check_station_length(CoordsXYE* input, CoordsXYE* output) do { - const auto& teDescriptor = GetTrackElementDescriptor(output->element->AsTrack()->GetTrackType()); - if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& ted = GetTrackElementDescriptor(output->element->AsTrack()->GetTrackType()); + if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { num_station_elements++; last_good_station = *output; @@ -2822,8 +2822,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check back of the track track_get_back(input, &trackBack); auto trackType = trackBack.element->AsTrack()->GetTrackType(); - auto teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + auto ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -2832,8 +2832,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check front of the track track_get_front(input, &trackFront); trackType = trackFront.element->AsTrack()->GetTrackType(); - teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -2869,8 +2869,8 @@ static void ride_set_boat_hire_return_point(Ride* ride, CoordsXYE* startElement) }; trackType = returnPos.element->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - int32_t elementReturnDirection = teDescriptor.Coordinates.rotation_begin; + const auto& ted = GetTrackElementDescriptor(trackType); + int32_t elementReturnDirection = ted.Coordinates.rotation_begin; ride->boat_hire_return_direction = returnPos.element->GetDirectionWithOffset(elementReturnDirection); ride->boat_hire_return_position = TileCoordsXY{ returnPos }; } @@ -3544,8 +3544,8 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) if (tileElement->GetBaseZ() != location.z) continue; - const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { continue; } @@ -3777,8 +3777,8 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const continue; auto* trackElement = tileElement->AsTrack(); - const auto& teDescriptor = GetTrackElementDescriptor(trackElement->GetTrackType()); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (trackElement->GetRideIndex() == id) @@ -4884,8 +4884,8 @@ static int32_t ride_get_track_length(Ride* ride) continue; trackType = tileElement->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (tileElement->GetBaseZ() != trackStart.z) @@ -4916,8 +4916,8 @@ static int32_t ride_get_track_length(Ride* ride) while (track_circuit_iterator_next(&it)) { trackType = it.current.element->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - result += teDescriptor.PieceLength; + const auto& ted = GetTrackElementDescriptor(trackType); + result += ted.PieceLength; moveSlowIt = !moveSlowIt; if (moveSlowIt) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 980b0412c4..620761a8b4 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -394,8 +394,8 @@ std::optional sub_6C683D( } // Possibly z should be & 0xF8 - const auto& teDescriptor = GetTrackElementDescriptor(type); - const auto* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(type); + const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return std::nullopt; @@ -630,7 +630,7 @@ void ride_construction_set_default_next_piece() TileElement* tileElement; _currentTrackPrice = MONEY32_UNDEFINED; - TrackElementDescriptor teDescriptor; + TrackElementDescriptor ted; switch (_rideConstructionState) { case RideConstructionState::Front: @@ -659,8 +659,8 @@ void ride_construction_set_default_next_piece() } } - teDescriptor = GetTrackElementDescriptor(trackType); - curve = teDescriptor.CurveChain.next; + ted = GetTrackElementDescriptor(trackType); + curve = ted.CurveChain.next; bank = TrackDefinitions[trackType].bank_end; slope = TrackDefinitions[trackType].vangle_end; @@ -705,8 +705,8 @@ void ride_construction_set_default_next_piece() } } - teDescriptor = GetTrackElementDescriptor(trackType); - curve = teDescriptor.CurveChain.previous; + ted = GetTrackElementDescriptor(trackType); + curve = ted.CurveChain.previous; bank = TrackDefinitions[trackType].bank_start; slope = TrackDefinitions[trackType].vangle_start; @@ -1254,8 +1254,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC { if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) { - const auto& teDescriptor = GetTrackElementDescriptor(info.Element->AsTrack()->GetTrackType()); - if (teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + const auto& ted = GetTrackElementDescriptor(info.Element->AsTrack()->GetTrackType()); + if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) { @@ -1345,8 +1345,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; - const auto& teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (teDescriptor.TrackSequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) + const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (ted.TrackSequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) { entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; @@ -1439,7 +1439,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC */ void sub_6CB945(Ride* ride) { - TrackElementDescriptor teDescriptor; + TrackElementDescriptor ted; if (ride->type != RIDE_TYPE_MAZE) { for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) @@ -1475,8 +1475,8 @@ void sub_6CB945(Ride* ride) if (tileElement->AsTrack()->GetSequenceIndex() != 0) continue; - teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1503,8 +1503,8 @@ void sub_6CB945(Ride* ride) continue; } - teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - const rct_preview_track* trackBlock = teDescriptor.Block; + ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const rct_preview_track* trackBlock = ted.Block; while ((++trackBlock)->index != 0xFF) { CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; @@ -1520,8 +1520,8 @@ void sub_6CB945(Ride* ride) if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - teDescriptor = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1616,8 +1616,8 @@ void sub_6CB945(Ride* ride) Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << direction))) + ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[trackSequence] & (1 << direction))) { continue; } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index a8d51989ed..e2144e571e 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -183,9 +183,9 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) trackElement.y = newCoords->y; z = newCoords->z; - const auto& teDescriptor = GetTrackElementDescriptor(trackElement.element->AsTrack()->GetTrackType()); - const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; - const auto* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackElement.element->AsTrack()->GetTrackType()); + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; + const auto* trackBlock = ted.Block; // Used in the following loop to know when we have // completed all of the elements and are back at the // start. @@ -770,8 +770,8 @@ static void track_design_mirror_ride(TrackDesign* td6) { for (auto& track : td6->track_elements) { - const auto& teDescriptor = GetTrackElementDescriptor(track.type); - track.type = teDescriptor.MirrorMap; + const auto& ted = GetTrackElementDescriptor(track.type); + track.type = ted.MirrorMap; } for (auto& entrance : td6->entrance_elements) @@ -1522,14 +1522,14 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co for (const auto& track : td6->track_elements) { auto trackType = track.type; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); + const auto& ted = GetTrackElementDescriptor(trackType); track_design_update_max_min_coordinates(newCoords); switch (_trackDesignPlaceOperation) { case PTD_OPERATION_DRAW_OUTLINES: - for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) + for (const rct_preview_track* trackBlock = ted.Block; trackBlock->index != 0xFF; trackBlock++) { auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); track_design_update_max_min_coordinates({ tile, newCoords.z }); @@ -1538,8 +1538,8 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co break; case PTD_OPERATION_REMOVE_GHOST: { - const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; - const rct_preview_track* trackBlock = teDescriptor.Block; + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; + const rct_preview_track* trackBlock = ted.Block; int32_t tempZ = newCoords.z - trackCoordinates->z_begin + trackBlock->z; auto trackRemoveAction = TrackRemoveAction( trackType, 0, { newCoords, tempZ, static_cast(rotation & 3) }); @@ -1553,7 +1553,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co case PTD_OPERATION_PLACE_GHOST: case PTD_OPERATION_PLACE_TRACK_PREVIEW: { - const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; // di int16_t tempZ = newCoords.z - trackCoordinates->z_begin; @@ -1610,8 +1610,8 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co } case PTD_OPERATION_GET_PLACE_Z: { - int32_t tempZ = newCoords.z - teDescriptor.Coordinates.z_begin; - for (const rct_preview_track* trackBlock = teDescriptor.Block; trackBlock->index != 0xFF; trackBlock++) + int32_t tempZ = newCoords.z - ted.Coordinates.z_begin; + for (const rct_preview_track* trackBlock = ted.Block; trackBlock->index != 0xFF; trackBlock++) { auto tile = CoordsXY{ newCoords } + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(rotation); if (!map_is_location_valid(tile)) @@ -1650,7 +1650,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co } } - const rct_track_coordinates& track_coordinates = teDescriptor.Coordinates; + const rct_track_coordinates& track_coordinates = ted.Coordinates; auto offsetAndRotatedTrack = CoordsXY{ newCoords } + CoordsXY{ track_coordinates.x, track_coordinates.y }.Rotate(rotation); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 875506f6ed..cfe01185e1 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2204,8 +2204,8 @@ void PaintTrack(paint_session* session, Direction direction, int32_t height, con if (PaintShouldShowHeightMarkers(session, VIEWPORT_FLAG_TRACK_HEIGHTS)) { session->InteractionType = ViewportInteractionItem::None; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.HeightMarkerPositions & (1 << trackSequence)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.HeightMarkerPositions & (1 << trackSequence)) { uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset; // 0x1689 represents 0 height there are -127 to 128 heights above and below it diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e4258fe342..4c9057d2d3 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1707,8 +1707,8 @@ void Vehicle::UpdateMeasurements() } } - const auto& teDescriptor = GetTrackElementDescriptor(trackElemType); - uint16_t trackFlags = teDescriptor.Flags; + const auto& ted = GetTrackElementDescriptor(trackElemType); + uint16_t trackFlags = ted.Flags; uint32_t testingFlags = curRide->testing_flags; if (testingFlags & RIDE_TESTING_TURN_LEFT && trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) @@ -7495,13 +7495,13 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& void Vehicle::UpdateSceneryDoor() const { auto trackType = GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; while ((trackBlock + 1)->index != 255) { trackBlock++; } - const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; auto wallCoords = CoordsXYZ{ x, y, TrackLocation.z - trackBlock->z + trackCoordinates->z_end }.ToTileStart(); int32_t direction = (GetTrackDirection() + trackCoordinates->rotation_end) & 3; @@ -7593,9 +7593,9 @@ static void trigger_on_ride_photo(const CoordsXYZ& loc, TileElement* tileElement void Vehicle::UpdateSceneryDoorBackwards() const { auto trackType = GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = teDescriptor.Block; - const rct_track_coordinates* trackCoordinates = &teDescriptor.Coordinates; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_preview_track* trackBlock = ted.Block; + const rct_track_coordinates* trackCoordinates = &ted.Coordinates; auto wallCoords = CoordsXYZ{ TrackLocation, TrackLocation.z - trackBlock->z + trackCoordinates->z_begin }; int32_t direction = (GetTrackDirection() + trackCoordinates->rotation_begin) & 3; direction = direction_reverse(direction); @@ -7933,8 +7933,8 @@ void Vehicle::Sub6DBF3E() } auto trackType = GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } @@ -8547,8 +8547,8 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(uint16_t trackType, Ride* cu if (next_vehicle_on_train == SPRITE_INDEX_NULL) { trackType = tileElement->AsTrack()->GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.Flags & TRACK_ELEM_FLAG_DOWN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.Flags & TRACK_ELEM_FLAG_DOWN)) { _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_9; } @@ -9209,8 +9209,8 @@ loc_6DCE02: } { auto trackType = GetTrackType(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index dd0313d2fb..2fb047ac62 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -91,8 +91,8 @@ money32 place_provisional_track_piece( return result; int16_t z_begin, z_end; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_track_coordinates& coords = teDescriptor.Coordinates; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& coords = ted.Coordinates; if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) { z_begin = coords.z_begin; @@ -306,8 +306,8 @@ bool window_ride_construction_update_state( && _currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) { auto availablePieces = rtd.CoveredTrackPieces; - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - auto alternativeType = teDescriptor.AlternativeType; + const auto& ted = GetTrackElementDescriptor(trackType); + auto alternativeType = ted.AlternativeType; if (alternativeType != TrackElemType::None && (availablePieces & (1ULL << trackType))) { trackType = alternativeType; @@ -315,8 +315,8 @@ bool window_ride_construction_update_state( } } - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - const rct_track_coordinates& trackCoordinates = teDescriptor.Coordinates; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& trackCoordinates = ted.Coordinates; x = _currentTrackBegin.x; y = _currentTrackBegin.y; @@ -349,13 +349,13 @@ bool window_ride_construction_update_state( bool turnOffLiftHill = false; if (!(_enabledRidePieces & (1ULL << TRACK_LIFT_HILL_CURVE))) { - if (teDescriptor.Flags & TRACK_ELEM_FLAG_CURVE_ALLOWS_LIFT) + if (ted.Flags & TRACK_ELEM_FLAG_CURVE_ALLOWS_LIFT) { turnOffLiftHill = true; } } - if (!(teDescriptor.Flags & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) + if (!(ted.Flags & TRACK_ELEM_FLAG_ALLOW_LIFT_HILL)) { turnOffLiftHill = true; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 33c520a3e6..92bf23ead8 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -881,15 +881,15 @@ static void loc_6A6D7E( const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = direction_reverse( (direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx))) + if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -965,13 +965,13 @@ static void loc_6A6C85( const auto trackType = tileElementPos.element->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElementPos.element->AsTrack()->GetSequenceIndex(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + const auto& ted = GetTrackElementDescriptor(trackType); + if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = (direction - tileElementPos.element->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; - if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx))) + if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -2107,11 +2107,11 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); - const auto& teDescriptor = GetTrackElementDescriptor(trackType); - if (teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint16_t dx = ((coords.direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx)) + if (ted.TrackSequenceProperties[trackSequence] & (1 << dx)) { // Track element has the flags required for the given direction return true; diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index cf1a998b22..3520dcfcd4 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -855,8 +855,8 @@ namespace OpenRCT2::TileInspector if (ride == nullptr) return std::make_unique(GameActions::Status::Unknown, STR_NONE); - const auto& teDescriptor = GetTrackElementDescriptor(type); - const auto* trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(type); + const auto* trackBlock = ted.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -868,7 +868,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = teDescriptor.Block; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; @@ -939,8 +939,8 @@ namespace OpenRCT2::TileInspector if (ride == nullptr) return std::make_unique(GameActions::Status::Unknown, STR_NONE); - const auto& teDescriptor = GetTrackElementDescriptor(type); - auto trackBlock = teDescriptor.Block; + const auto& ted = GetTrackElementDescriptor(type); + auto trackBlock = ted.Block; trackBlock += trackElement->AsTrack()->GetSequenceIndex(); uint8_t originDirection = trackElement->GetDirection(); @@ -952,7 +952,7 @@ namespace OpenRCT2::TileInspector originY = static_cast(coords.y); originZ -= trackBlock->z; - trackBlock = teDescriptor.Block; + trackBlock = ted.Block; for (; trackBlock->index != 255; trackBlock++) { CoordsXYZD elem = { originX, originY, originZ + trackBlock->z, rotation }; From 97ded2d7c4edd00e24801220755d119ef46ea312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 27 Aug 2021 15:31:40 -0700 Subject: [PATCH 252/681] Use reference and not copy (#15303) --- src/openrct2/ride/coaster/LoopingRollerCoaster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index be93f9f8a3..a869a5f50f 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -97,7 +97,7 @@ static void looping_rc_track_station( { SPR_LOOPING_RC_FLAT_CHAINED_SW_NE, SPR_STATION_BASE_B_SW_NE }, { SPR_LOOPING_RC_FLAT_CHAINED_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; - const auto imageIds = is_csg_loaded() ? imageIdsWithCsg : imageIdsWithoutCsg; + const auto& imageIds = is_csg_loaded() ? imageIdsWithCsg : imageIdsWithoutCsg; PaintAddImageAsParentRotated( session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, From e0751d707f7e226d6aed32252dc88a8eeb98b248 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 28 Aug 2021 17:43:11 +0200 Subject: [PATCH 253/681] Fix #15298: Crash on map.getAllEntities from in-game console (#15301) --- src/openrct2/scripting/ScriptEngine.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index e5e132ceb1..caf284513b 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -1433,7 +1433,16 @@ int32_t OpenRCT2::Scripting::GetTargetAPIVersion() { auto& scriptEngine = GetContext()->GetScriptEngine(); auto& execInfo = scriptEngine.GetExecInfo(); - return execInfo.GetCurrentPlugin()->GetTargetAPIVersion(); + + // Commands from the in-game console do not have a plug-in set + auto plugin = execInfo.GetCurrentPlugin(); + if (plugin == nullptr) + { + // For in-game console, default to the current API version + return OPENRCT2_PLUGIN_API_VERSION; + } + + return plugin->GetTargetAPIVersion(); } #endif From b3744f129f56c5aaa80cd0bdc874af7492ac062e Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sat, 28 Aug 2021 18:57:46 -0400 Subject: [PATCH 254/681] Part of #13874: Avoid copies of ted --- src/openrct2/actions/TrackPlaceAction.cpp | 2 +- src/openrct2/ride/Ride.cpp | 24 +++++++++---------- src/openrct2/ride/RideConstruction.cpp | 28 +++++++++++------------ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 96aab983f4..1763aba396 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -401,7 +401,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags; const auto& ted = GetTrackElementDescriptor(_trackType); - auto wallEdges = ted.SequenceElementAllowedWallEdges; + const auto& wallEdges = ted.SequenceElementAllowedWallEdges; money32 cost = 0; const rct_preview_track* trackBlock = ted.Block; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 877be528eb..7774faf789 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -481,11 +481,11 @@ bool track_block_get_next_from_zero( continue; const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); - auto nextTrackBlock = ted.Block; + const auto* nextTrackBlock = ted.Block; if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = ted.Coordinates; + const auto& nextTrackCoordinate = ted.Coordinates; uint8_t nextRotation = tileElement->GetDirectionWithOffset(nextTrackCoordinate.rotation_begin) | (nextTrackCoordinate.rotation_begin & TRACK_BLOCK_2); @@ -537,7 +537,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 trackBlock += inputElement->GetSequenceIndex(); - auto trackCoordinate = ted.Coordinates; + const auto& trackCoordinate = ted.Coordinates; int32_t x = input->x; int32_t y = input->y; @@ -599,11 +599,11 @@ bool track_block_get_previous_from_zero( if (trackElement->GetRideIndex() != ride->id) continue; - const auto& teDesc = GetTrackElementDescriptor(trackElement->GetTrackType()); - const auto* nextTrackBlock = teDesc.Block; + const auto* ted = &GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock = ted->Block; if (nextTrackBlock == nullptr) continue; - auto nextTrackCoordinate = teDesc.Coordinates; + const auto& nextTrackCoordinate = ted->Coordinates; nextTrackBlock += trackElement->GetSequenceIndex(); if ((nextTrackBlock + 1)->index != 255) @@ -635,8 +635,8 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z = tileElement->GetBaseZ(); - const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); - const auto* nextTrackBlock2 = ted.Block; + ted = &GetTrackElementDescriptor(trackElement->GetTrackType()); + const auto* nextTrackBlock2 = ted->Block; if (nextTrackBlock2 == nullptr) continue; @@ -2822,8 +2822,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check back of the track track_get_back(input, &trackBack); auto trackType = trackBack.element->AsTrack()->GetTrackType(); - auto ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + const auto* ted = &GetTrackElementDescriptor(trackType); + if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -2832,8 +2832,8 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) // Check front of the track track_get_front(input, &trackFront); trackType = trackFront.element->AsTrack()->GetTrackType(); - ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = &GetTrackElementDescriptor(trackType); + if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 620761a8b4..0eae6e5656 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -630,7 +630,7 @@ void ride_construction_set_default_next_piece() TileElement* tileElement; _currentTrackPrice = MONEY32_UNDEFINED; - TrackElementDescriptor ted; + const TrackElementDescriptor* ted; switch (_rideConstructionState) { case RideConstructionState::Front: @@ -659,8 +659,8 @@ void ride_construction_set_default_next_piece() } } - ted = GetTrackElementDescriptor(trackType); - curve = ted.CurveChain.next; + ted = &GetTrackElementDescriptor(trackType); + curve = ted->CurveChain.next; bank = TrackDefinitions[trackType].bank_end; slope = TrackDefinitions[trackType].vangle_end; @@ -705,8 +705,8 @@ void ride_construction_set_default_next_piece() } } - ted = GetTrackElementDescriptor(trackType); - curve = ted.CurveChain.previous; + ted = &GetTrackElementDescriptor(trackType); + curve = ted->CurveChain.previous; bank = TrackDefinitions[trackType].bank_start; slope = TrackDefinitions[trackType].vangle_start; @@ -1439,7 +1439,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC */ void sub_6CB945(Ride* ride) { - TrackElementDescriptor ted; + const TrackElementDescriptor* ted; if (ride->type != RIDE_TYPE_MAZE) { for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) @@ -1475,8 +1475,8 @@ void sub_6CB945(Ride* ride) if (tileElement->AsTrack()->GetSequenceIndex() != 0) continue; - ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1503,8 +1503,8 @@ void sub_6CB945(Ride* ride) continue; } - ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - const rct_preview_track* trackBlock = ted.Block; + ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const rct_preview_track* trackBlock = ted->Block; while ((++trackBlock)->index != 0xFF) { CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; @@ -1520,8 +1520,8 @@ void sub_6CB945(Ride* ride) if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1616,8 +1616,8 @@ void sub_6CB945(Ride* ride) Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[trackSequence] & (1 << direction))) + ted = &GetTrackElementDescriptor(trackType); + if (!(ted->TrackSequenceProperties[trackSequence] & (1 << direction))) { continue; } From 4ada04c7ca3487ee60b270cdc761836b38a76dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:20:17 +0300 Subject: [PATCH 255/681] Fix #15289: Duplicated banner correction using the wrong index --- src/openrct2/world/Banner.cpp | 80 ++++++++++++++++------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index f51937f5bf..1d276df688 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -21,6 +21,7 @@ #include "../ride/RideData.h" #include "../ride/Track.h" #include "../windows/Intent.h" +#include "../world/TileElementsView.h" #include "Map.h" #include "MapAnimation.h" #include "Park.h" @@ -253,57 +254,50 @@ void fix_duplicated_banners() { // For each banner in the map, check if the banner index is in use already, and if so, create a new entry for it std::vector activeBanners; + activeBanners.resize(MAX_BANNERS); + for (int y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { for (int x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - if (tileElement != nullptr) + const auto bannerPos = TileCoordsXY{ x, y }.ToCoordsXY(); + for (auto* bannerElement : OpenRCT2::TileElementsView(bannerPos)) { - do + auto bannerIndex = bannerElement->GetIndex(); + if (bannerIndex == BANNER_INDEX_NULL) + continue; + + if (activeBanners[bannerIndex]) { - // TODO: Handle walls and large-scenery that use banner indices too. Large scenery can be tricky, as they - // occupy multiple tiles that should both refer to the same banner index. - if (tileElement->GetType() == TILE_ELEMENT_TYPE_BANNER) + log_info( + "Duplicated banner with index %d found at x = %d, y = %d and z = %d.", bannerIndex, x, y, + bannerElement->base_height); + + // Banner index is already in use by another banner, so duplicate it + auto newBanner = CreateBanner(); + if (newBanner == nullptr) { - auto bannerIndex = tileElement->AsBanner()->GetIndex(); - if (bannerIndex == BANNER_INDEX_NULL) - continue; - - if (activeBanners.size() <= bannerIndex) - { - activeBanners.resize(bannerIndex + 1); - } - if (activeBanners[bannerIndex]) - { - log_info( - "Duplicated banner with index %d found at x = %d, y = %d and z = %d.", bannerIndex, x, y, - tileElement->base_height); - - // Banner index is already in use by another banner, so duplicate it - auto newBanner = CreateBanner(); - if (newBanner == nullptr) - { - log_error("Failed to create new banner."); - continue; - } - Guard::Assert(!activeBanners[newBanner->id]); - - // Copy over the original banner, but update the location - auto oldBanner = GetBanner(bannerIndex); - if (oldBanner != nullptr) - { - *newBanner = *oldBanner; - newBanner->position = { x, y }; - } - - tileElement->AsBanner()->SetIndex(newBanner->id); - } - - // Mark banner index as in-use - activeBanners[bannerIndex] = true; + log_error("Failed to create new banner."); + continue; } - } while (!(tileElement++)->IsLastForTile()); + Guard::Assert(!activeBanners[newBanner->id]); + + // Copy over the original banner, but update the location + const auto* oldBanner = GetBanner(bannerIndex); + if (oldBanner != nullptr) + { + auto newBannerId = newBanner->id; + + *newBanner = *oldBanner; + newBanner->id = newBannerId; + newBanner->position = { x, y }; + } + + bannerElement->SetIndex(newBanner->id); + } + + // Mark banner index as in-use + activeBanners[bannerIndex] = true; } } } From 763d086c8557901cfc98a784dfd402ade7951fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:23:48 +0300 Subject: [PATCH 256/681] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0c91d3c290..f54c97bb06 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -16,6 +16,7 @@ - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. +- Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. From cba52b240e0f90907a85e17812fc09408ae092ba Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 29 Aug 2021 02:30:34 -0700 Subject: [PATCH 257/681] Bird animation (#15294) * initial implementation; progress 1 progress 2 refactor to chain start progress 3 begin walking finish bird remove walking remove unused functions refactor track element getting fix formatting refactor and add comments remove brackets from simple if-else statements invalidate vehicle refactor again fix format and refactor please satisfy clang format fix fallthrough invalidate default case remove redundant falltrhough network bump use std::max refactor animation again fix modulus * move array declaration * satisfy clang-format * add changelog entry --- contributors.md | 2 +- distribution/changelog.txt | 1 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 46 ++++++++++++++++++++++++++++ src/openrct2/ride/Vehicle.h | 4 ++- 5 files changed, 52 insertions(+), 3 deletions(-) diff --git a/contributors.md b/contributors.md index 21c84806fa..b12d3c4d21 100644 --- a/contributors.md +++ b/contributors.md @@ -62,7 +62,7 @@ The following people are not part of the development team, but have been contrib * Robert Jordan (trigger-death) - UI theming, title sequence editor, misc. * Aaron van Geffen (AaronVanGeffen) - scenario select screen, font detection, misc. * Michał Janiszewski (janisozaur) - Linux port, crash handling, security, misc. -* Kelson Blakewood (spacek531) - title sequences for release versions 0.0.4 through 0.1.2, title sequences using milliseconds +* Kelson Blakewood (spacek531) - title sequences, title sequence features, vehicle features * Hugo Wallenburg (Goddesen) - Misc. * Edward Calver (X7123M3-256) - New Hybrid Coaster track, extended sprite toolchain, more vehicle cheats, misc. * Matte Andersson (Nubbie) - Misc, UX diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0c91d3c290..5e5d7651a0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. - Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. +- Feature: [#15294] New vehicle animation type: flying animal - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 4452f1f04f..bd09ca6b0b 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "5" +#define NETWORK_STREAM_VERSION "6" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 8dcabb345e..bbbdef5358 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1536,6 +1536,13 @@ bool Vehicle::OpenRestraints() restraintsOpen = false; continue; } + if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_ANIMAL_FLYING + && (vehicle->animation_frame != 0 || vehicle->animationState > 0)) + { + vehicle->UpdateAnimationAnimalFlying(); + restraintsOpen = false; + continue; + } if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_BROKEN_CAR) && vehicle->restraints_position != 0xFF && (curRide->breakdown_reason_pending == BREAKDOWN_RESTRAINTS_STUCK_CLOSED @@ -7269,6 +7276,39 @@ void Vehicle::UpdateSpinningCar() Invalidate(); } +void Vehicle::UpdateAnimationAnimalFlying() +{ + if (animationState > 0) + { + animationState--; + return; + } + else + { + if (animation_frame == 0) + { + auto trackType = GetTrackType(); + TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + if (trackElement != nullptr && trackElement->AsTrack()->HasChain()) + { + // start flapping, bird + animation_frame = 1; + animationState = 5; + Invalidate(); + } + } + else + { + // continue flapping until reaching frame 0 + animation_frame = (animation_frame + 1) % 4; + Invalidate(); + } + // number of frames to skip before updating again + constexpr std::array frameWaitTimes = { 5, 3, 5, 3 }; + animationState = frameWaitTimes[animation_frame]; + } +} + /** * * rct2: 0x006D63D4 @@ -7421,6 +7461,12 @@ void Vehicle::UpdateAdditionalAnimation() } } break; + case VEHICLE_ENTRY_ANIMATION_ANIMAL_FLYING: + UpdateAnimationAnimalFlying(); + // makes animation play faster with vehicle speed + targetFrame = abs(_vehicleVelocityF64E08) >> 24; + animationState = std::max(animationState - targetFrame, 0); + break; } } diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index e8e84859f6..8963fb379d 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -324,6 +324,7 @@ private: void UpdateCrashSetup(); void UpdateCollisionSetup(); int32_t UpdateMotionDodgems(); + void UpdateAnimationAnimalFlying(); void UpdateAdditionalAnimation(); void CheckIfMissing(); bool CurrentTowerElementIsTop(); @@ -472,7 +473,8 @@ enum VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER, VEHICLE_ENTRY_ANIMATION_HELICARS, VEHICLE_ENTRY_ANIMATION_MONORAIL_CYCLES, - VEHICLE_ENTRY_ANIMATION_MULTI_DIM_COASTER + VEHICLE_ENTRY_ANIMATION_MULTI_DIM_COASTER, + VEHICLE_ENTRY_ANIMATION_ANIMAL_FLYING // OpenRCT2-specific feature }; enum : uint32_t From b6b792f874fd61b1eb4c1e8987578bca580f34fc Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 29 Aug 2021 16:22:51 +0200 Subject: [PATCH 258/681] Add GetImage() method to rct_footpath_entry --- src/openrct2/object/FootpathObject.cpp | 10 +++++----- src/openrct2/world/Footpath.h | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 6de138b344..827c3527c9 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -42,21 +42,21 @@ void FootpathObject::Load() _pathSurfaceEntry.string_idx = _legacyType.string_idx; _pathSurfaceEntry.image = _legacyType.image; - _pathSurfaceEntry.preview = _legacyType.image + 71; + _pathSurfaceEntry.preview = _legacyType.GetPreviewImage(); _pathSurfaceEntry.flags = _legacyType.flags; _queueEntry.string_idx = _legacyType.string_idx; - _queueEntry.image = _legacyType.image + 51; - _queueEntry.preview = _legacyType.image + 72; + _queueEntry.image = _legacyType.GetQueueImage(); + _queueEntry.preview = _legacyType.GetQueuePreviewImage(); _queueEntry.flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; _pathRailingsEntry.string_idx = _legacyType.string_idx; _pathRailingsEntry.bridge_image = _legacyType.bridge_image; - _pathRailingsEntry.preview = _legacyType.image + 71; + _pathRailingsEntry.preview = _legacyType.GetPreviewImage(); _pathRailingsEntry.flags = _legacyType.flags; _pathRailingsEntry.scrolling_mode = _legacyType.scrolling_mode; _pathRailingsEntry.support_type = _legacyType.support_type; - _pathRailingsEntry.railings_image = _legacyType.image + 73; + _pathRailingsEntry.railings_image = _legacyType.GetRailingsImage(); } void FootpathObject::Unload() diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 3f45837433..532b40f95f 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -49,6 +49,23 @@ struct rct_footpath_entry RailingEntrySupportType support_type; // 0x0A uint8_t flags; // 0x0B uint8_t scrolling_mode; // 0x0C + + constexpr uint32_t GetQueueImage() const + { + return image + 51; + } + constexpr uint32_t GetPreviewImage() const + { + return image + 71; + } + constexpr uint32_t GetQueuePreviewImage() const + { + return image + 72; + } + constexpr uint32_t GetRailingsImage() const + { + return image + 73; + } }; assert_struct_size(rct_footpath_entry, 13); #pragma pack(pop) From 450bf61ee4f19fb8a986c0194406773544274f7a Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 29 Aug 2021 10:08:54 -0400 Subject: [PATCH 259/681] Part of #13874: TrackSequenceProperties, Pricing and MirrorMap renamed --- src/openrct2-ui/windows/NewRide.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 4 ++-- src/openrct2/actions/MazePlaceTrackAction.cpp | 4 ++-- src/openrct2/actions/MazeSetTrackAction.cpp | 4 ++-- src/openrct2/actions/TrackPlaceAction.cpp | 10 +++++----- src/openrct2/actions/TrackRemoveAction.cpp | 8 ++++---- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/ride/Ride.cpp | 16 ++++++++-------- src/openrct2/ride/RideConstruction.cpp | 10 +++++----- src/openrct2/ride/TrackData.cpp | 6 +++--- src/openrct2/ride/TrackData.h | 6 +++--- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 4 ++-- src/openrct2/world/Footpath.cpp | 12 ++++++------ 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index dff60eaa81..c601b19dba 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -946,7 +946,7 @@ static void window_new_ride_paint_ride_information( int32_t startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece; money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; const auto& ted = GetTrackElementDescriptor(startPieceId); - price *= ted.Pricing; + price *= ted.Price; price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; // diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 7469bce3dc..1e42580432 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1370,7 +1370,7 @@ rct_window* window_ride_open_track(TileElement* tileElement) auto trackElement = tileElement->AsTrack(); auto trackType = trackElement->GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); - if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { auto stationIndex = trackElement->GetStationIndex(); return window_ride_open_station(ride, stationIndex); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 26d46164af..58da05f5bd 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -574,8 +574,8 @@ static void window_track_place_draw_mini_preview_track( auto bits = trackBlock->var_08.Rotate(curTrackRotation & 3).GetBaseQuarterOccupied(); // Station track is a lighter colour - uint8_t colour = (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) ? _PaletteIndexColourStation - : _PaletteIndexColourTrack; + uint8_t colour = (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) ? _PaletteIndexColourStation + : _PaletteIndexColourTrack; for (int32_t i = 0; i < 4; i++) { diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index c39f19a21b..c62e469524 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -116,7 +116,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const } const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; return res; @@ -158,7 +158,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const } const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = canBuild->Cost + price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 167f67e1fd..f0dd07396f 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -137,7 +137,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const } const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = price / 2 * 10; return res; @@ -173,7 +173,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const if (tileElement == nullptr) { const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); - money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Pricing) >> 16)); + money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.Price) >> 16)); res->Cost = price / 2 * 10; auto startLoc = _loc.ToTileStart(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 1763aba396..2f36dfc5c8 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -318,7 +318,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - int32_t entranceDirections = ted.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.SequenceProperties[0]; if ((entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN) && trackBlock->index == 0) { if (!track_add_station_element({ mapLoc, baseZ, _origin.direction }, _rideIndex, 0, _fromTrackDesign)) @@ -367,7 +367,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= ted.Pricing; + price *= ted.Price; price >>= 16; res->Cost = cost + ((price / 2) * 10); @@ -538,7 +538,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const { if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND)) { - entranceDirections = ted.TrackSequenceProperties[0]; + entranceDirections = ted.SequenceProperties[0]; } } @@ -597,7 +597,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } trackElement->SetColourScheme(_colour); - entranceDirections = ted.TrackSequenceProperties[0]; + entranceDirections = ted.SequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint8_t availableDirections = entranceDirections & 0x0F; @@ -653,7 +653,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= ted.Pricing; + price *= ted.Price; price >>= 16; res->Cost = cost + ((price / 2) * 10); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 49e9967d05..8e1bf2b942 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -203,7 +203,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = ted.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.SequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) @@ -229,7 +229,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= ted.Pricing; + price *= ted.Price; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) @@ -378,7 +378,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); } - int32_t entranceDirections = ted.TrackSequenceProperties[0]; + int32_t entranceDirections = ted.SequenceProperties[0]; if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN && (tileElement->AsTrack()->GetSequenceIndex() == 0)) { if (!track_remove_station_element({ mapLoc, _origin.direction }, rideIndex, 0)) @@ -477,7 +477,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const } money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; - price *= ted.Pricing; + price *= ted.Price; price >>= 16; price = (price + cost) / 2; if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 2f660ea596..d50b922c65 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -441,7 +441,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( int32_t z; if (sequence == 0) { - if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_DISALLOW_DOORS) { return false; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 7774faf789..ee659c2023 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -414,7 +414,7 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) bool specialTrackPiece = (it.element->AsTrack()->GetTrackType() != TrackElemType::BeginStation && it.element->AsTrack()->GetTrackType() != TrackElemType::MiddleStation - && (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); + && (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)); // Set result tile to this track piece if first found track or a ??? if (resultTileElement == nullptr || specialTrackPiece) @@ -2230,7 +2230,7 @@ static void ride_shop_connected(Ride* ride) } const auto& ted = GetTrackElementDescriptor(track_type); - uint8_t entrance_directions = ted.TrackSequenceProperties[0] & 0xF; + uint8_t entrance_directions = ted.SequenceProperties[0] & 0xF; uint8_t tile_direction = trackElement->GetDirection(); entrance_directions = rol4(entrance_directions, tile_direction); @@ -2775,7 +2775,7 @@ static int32_t ride_check_station_length(CoordsXYE* input, CoordsXYE* output) do { const auto& ted = GetTrackElementDescriptor(output->element->AsTrack()->GetTrackType()); - if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { num_station_elements++; last_good_station = *output; @@ -2823,7 +2823,7 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) track_get_back(input, &trackBack); auto trackType = trackBack.element->AsTrack()->GetTrackType(); const auto* ted = &GetTrackElementDescriptor(trackType); - if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -2833,7 +2833,7 @@ static bool ride_check_start_and_end_is_station(CoordsXYE* input) track_get_front(input, &trackFront); trackType = trackFront.element->AsTrack()->GetTrackType(); ted = &GetTrackElementDescriptor(trackType); - if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return false; } @@ -3545,7 +3545,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) continue; const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { continue; } @@ -3778,7 +3778,7 @@ TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const auto* trackElement = tileElement->AsTrack(); const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (trackElement->GetRideIndex() == id) @@ -4885,7 +4885,7 @@ static int32_t ride_get_track_length(Ride* ride) trackType = tileElement->AsTrack()->GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; if (tileElement->GetBaseZ() != trackStart.z) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 0eae6e5656..de5f99dfd3 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1255,7 +1255,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) { const auto& ted = GetTrackElementDescriptor(info.Element->AsTrack()->GetTrackType()); - if (ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) { @@ -1346,7 +1346,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (ted.TrackSequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) + if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) { entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; @@ -1476,7 +1476,7 @@ void sub_6CB945(Ride* ride) continue; ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1521,7 +1521,7 @@ void sub_6CB945(Ride* ride) continue; ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (!(ted->TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; trackFound = true; @@ -1617,7 +1617,7 @@ void sub_6CB945(Ride* ride) Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; ted = &GetTrackElementDescriptor(trackType); - if (!(ted->TrackSequenceProperties[trackSequence] & (1 << direction))) + if (!(ted->SequenceProperties[trackSequence] & (1 << direction))) { continue; } diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index 4777b5faf9..f30a130642 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -5148,14 +5148,14 @@ namespace OpenRCT2 desc.CurveChain = gTrackCurveChain[i]; desc.Flags = TrackFlags[i]; desc.HeightMarkerPositions = TrackHeightMarkerPositions[i]; - desc.MirrorMap = TrackElementMirrorMap[i]; + desc.MirrorElement = TrackElementMirrorMap[i]; desc.PieceLength = TrackPieceLengths[i]; - desc.Pricing = TrackPricing[i]; + desc.Price = TrackPricing[i]; for (uint8_t j = 0; j < MaxSequencesPerPiece; j++) { desc.SequenceElementAllowedWallEdges[j] = TrackSequenceElementAllowedWallEdges[i][j]; - desc.TrackSequenceProperties[j] = TrackSequenceProperties[i][j]; + desc.SequenceProperties[j] = TrackSequenceProperties[i][j]; } _trackElementDescriptors.push_back(desc); } diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 0b43a74426..4cd3705355 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -63,13 +63,13 @@ struct TrackElementDescriptor uint8_t PieceLength; track_curve_chain CurveChain; track_type_t AlternativeType; - money32 Pricing; - track_type_t MirrorMap; + money32 Price; + track_type_t MirrorElement; uint32_t HeightMarkerPositions; uint16_t Flags; std::array SequenceElementAllowedWallEdges; - std::array TrackSequenceProperties; + std::array SequenceProperties; }; namespace OpenRCT2 diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index e2144e571e..e6394da8fb 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -771,7 +771,7 @@ static void track_design_mirror_ride(TrackDesign* td6) for (auto& track : td6->track_elements) { const auto& ted = GetTrackElementDescriptor(track.type); - track.type = ted.MirrorMap; + track.type = ted.MirrorElement; } for (auto& entrance : td6->entrance_elements) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 4c9057d2d3..e1cbfce103 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7934,7 +7934,7 @@ void Vehicle::Sub6DBF3E() auto trackType = GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } @@ -9210,7 +9210,7 @@ loc_6DCE02: { auto trackType = GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) + if (!(ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) { return; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 92bf23ead8..1dceddad05 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -882,14 +882,14 @@ static void loc_6A6D7E( const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); const auto& ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + if (!(ted.SequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = direction_reverse( (direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx))) + if (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -966,12 +966,12 @@ static void loc_6A6C85( const auto trackType = tileElementPos.element->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElementPos.element->AsTrack()->GetSequenceIndex(); const auto& ted = GetTrackElementDescriptor(trackType); - if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) + if (!(ted.SequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)) { return; } uint16_t dx = (direction - tileElementPos.element->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; - if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx))) + if (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { return; } @@ -2108,10 +2108,10 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co const auto trackType = tileElement->AsTrack()->GetTrackType(); const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex(); const auto& ted = GetTrackElementDescriptor(trackType); - if (ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) + if (ted.SequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { uint16_t dx = ((coords.direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); - if (ted.TrackSequenceProperties[trackSequence] & (1 << dx)) + if (ted.SequenceProperties[trackSequence] & (1 << dx)) { // Track element has the flags required for the given direction return true; From bcba227430f0b669077c6ddac769a945177d2321 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 29 Aug 2021 17:07:38 +0200 Subject: [PATCH 260/681] Add footpath surface and railings objects from NSF --- OpenRCT2.xcodeproj/project.pbxproj | 12 +++ src/openrct2/interface/Colour.h | 4 +- src/openrct2/libopenrct2.vcxproj | 6 +- .../object/FootpathRailingsObject.cpp | 94 +++++++++++++++++++ src/openrct2/object/FootpathRailingsObject.h | 41 ++++++++ src/openrct2/object/FootpathSurfaceObject.cpp | 69 ++++++++++++++ src/openrct2/object/FootpathSurfaceObject.h | 36 +++++++ src/openrct2/object/Object.h | 2 + src/openrct2/object/ObjectFactory.cpp | 12 +++ src/openrct2/object/ObjectRepository.h | 4 + src/openrct2/world/Footpath.h | 1 + 11 files changed, 279 insertions(+), 2 deletions(-) create mode 100644 src/openrct2/object/FootpathRailingsObject.cpp create mode 100644 src/openrct2/object/FootpathRailingsObject.h create mode 100644 src/openrct2/object/FootpathSurfaceObject.cpp create mode 100644 src/openrct2/object/FootpathSurfaceObject.h diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 5733a6f091..f0fdda19f7 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -60,6 +60,8 @@ 4C8BB68525533DB9005C8830 /* ZoomLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB68425533DB9005C8830 /* ZoomLevel.cpp */; }; 4C91FD5F25AE476700CA5DA4 /* MusicObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C91FD5D25AE476700CA5DA4 /* MusicObject.cpp */; }; 4C91FD6225AE483700CA5DA4 /* RideAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C91FD6025AE483600CA5DA4 /* RideAudio.cpp */; }; + 4C976BC5263976F0002DEBD5 /* FootpathSurfaceObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */; }; + 4C976BC6263976F0002DEBD5 /* FootpathRailingsObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */; }; 4CA23D64263C91D800077AA1 /* ChecksumStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23D62263C91D700077AA1 /* ChecksumStream.cpp */; }; 4CA23DB2263C920900077AA1 /* Entity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23DB1263C920900077AA1 /* Entity.cpp */; }; 4CA39E512513F8A00094066B /* RTL.ICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA39E4E2513F8A00094066B /* RTL.ICU.cpp */; }; @@ -1189,6 +1191,10 @@ 4C93F1B71F8E185600A9330D /* NewsItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewsItem.h; sourceTree = ""; }; 4C93F1B81F8E185600A9330D /* Research.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Research.cpp; sourceTree = ""; }; 4C93F1B91F8E185600A9330D /* Research.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Research.h; sourceTree = ""; }; + 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathSurfaceObject.cpp; sourceTree = ""; }; + 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathRailingsObject.cpp; sourceTree = ""; }; + 4C976BC3263976F0002DEBD5 /* FootpathRailingsObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathRailingsObject.h; sourceTree = ""; }; + 4C976BC4263976F0002DEBD5 /* FootpathSurfaceObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathSurfaceObject.h; sourceTree = ""; }; 4CA23D62263C91D700077AA1 /* ChecksumStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChecksumStream.cpp; sourceTree = ""; }; 4CA23D63263C91D700077AA1 /* ChecksumStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChecksumStream.h; sourceTree = ""; }; 4CA23DAF263C920900077AA1 /* Entity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Entity.h; sourceTree = ""; }; @@ -2739,6 +2745,10 @@ F76C84171EC4E7CC00FA49E2 /* FootpathItemObject.h */, F76C84181EC4E7CC00FA49E2 /* FootpathObject.cpp */, F76C84191EC4E7CC00FA49E2 /* FootpathObject.h */, + 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */, + 4C976BC3263976F0002DEBD5 /* FootpathRailingsObject.h */, + 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */, + 4C976BC4263976F0002DEBD5 /* FootpathSurfaceObject.h */, F76C841A1EC4E7CC00FA49E2 /* ImageTable.cpp */, F76C841B1EC4E7CC00FA49E2 /* ImageTable.h */, F76C841C1EC4E7CC00FA49E2 /* LargeSceneryObject.cpp */, @@ -3980,6 +3990,7 @@ 4CA23DB2263C920900077AA1 /* Entity.cpp in Sources */, C64644F91F3FA4120026AC2D /* EditorInventionsList.cpp in Sources */, C68878C720289B710084B384 /* OpenGLShaderProgram.cpp in Sources */, + 4C976BC5263976F0002DEBD5 /* FootpathSurfaceObject.cpp in Sources */, 4CA39E512513F8A00094066B /* RTL.ICU.cpp in Sources */, 93CBA4C420A7502E00867D56 /* Imaging.cpp in Sources */, C6D2BEE61F9BAACE008B557C /* TrackList.cpp in Sources */, @@ -3993,6 +4004,7 @@ C68878C520289B710084B384 /* OpenGLDrawingEngine.cpp in Sources */, C6D2BEE71F9BAACE008B557C /* MapTooltip.cpp in Sources */, C666EE7B1F37ACB10061AA04 /* TitleExit.cpp in Sources */, + 4C976BC6263976F0002DEBD5 /* FootpathRailingsObject.cpp in Sources */, F7D7747F1EC61E5100BE6EBC /* UiContext.macOS.mm in Sources */, F76C887E1EC5324E00FA49E2 /* CursorRepository.cpp in Sources */, C654DF331F69C0430040F43D /* LoadSave.cpp in Sources */, diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index 3dab46bc72..e4f79b65dc 100644 --- a/src/openrct2/interface/Colour.h +++ b/src/openrct2/interface/Colour.h @@ -51,7 +51,9 @@ enum : colour_t COLOUR_BRIGHT_PINK, COLOUR_LIGHT_PINK, - COLOUR_COUNT + COLOUR_COUNT, + + COLOUR_NULL = 255, }; /** diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 8d336d6de6..344bada47a 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -256,6 +256,8 @@ + + @@ -696,6 +698,8 @@ + + @@ -918,4 +922,4 @@ - \ No newline at end of file + diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp new file mode 100644 index 0000000000..ee16825968 --- /dev/null +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -0,0 +1,94 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "FootpathRailingsObject.h" + +#include "../core/IStream.hpp" +#include "../core/Json.hpp" + +void FootpathRailingsObject::Load() +{ + GetStringTable().Sort(); + NameStringId = language_allocate_object_string(GetName()); + + auto numImages = GetImageTable().GetCount(); + if (numImages != 0) + { + PreviewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); + BridgeImageId = PreviewImageId + 37; + RailingsImageId = PreviewImageId + 1; + } +} + +void FootpathRailingsObject::Unload() +{ + language_free_object_string(NameStringId); + gfx_object_free_images(PreviewImageId, GetImageTable().GetCount()); + + NameStringId = 0; + PreviewImageId = 0; + BridgeImageId = 0; + RailingsImageId = 0; +} + +void FootpathRailingsObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const +{ + auto x = width / 2; + auto y = height / 2; + if (SupportType == RailingEntrySupportType::Pole) + { + auto img = ImageId(BridgeImageId + 20 + 15, Colour); + for (int i = 0; i < 2; i++) + { + auto h = i * 16; + gfx_draw_sprite(dpi, img, { x - 8, y + 8 + h }); + gfx_draw_sprite(dpi, img, { x + 8, y + 16 + h }); + } + + gfx_draw_sprite(dpi, BridgeImageId + 5, { x, y - 17 }, 0); + gfx_draw_sprite(dpi, RailingsImageId + 1, { x + 4, y - 14 }, 0); + gfx_draw_sprite(dpi, RailingsImageId + 1, { x + 27, y - 2 }, 0); + } + else + { + gfx_draw_sprite(dpi, BridgeImageId + 22, { x + 0, y + 16 }, 0); + gfx_draw_sprite(dpi, BridgeImageId + 49, { x, y - 17 }, 0); + gfx_draw_sprite(dpi, RailingsImageId + 1, { x + 4, y - 14 }, 0); + gfx_draw_sprite(dpi, RailingsImageId + 1, { x + 27, y - 3 }, 0); + } +} + +void FootpathRailingsObject::ReadJson(IReadObjectContext* context, json_t& root) +{ + Guard::Assert(root.is_object(), "FootpathObject::ReadJson expects parameter root to be object"); + + auto properties = root["properties"]; + if (properties.is_object()) + { + SupportType = ParseSupportType(Json::GetString(properties["supportType"])); + ScrollingMode = Json::GetNumber(properties["scrollingMode"]); + Colour = Colour::FromString(Json::GetString(properties["colour"]), COLOUR_NULL); + Flags = Json::GetFlags( + properties, + { + { "hasSupportImages", RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE }, + { "hasElevatedPathImages", RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS }, + }); + } + + PopulateTablesFromJson(context, root); +} + +RailingEntrySupportType FootpathRailingsObject::ParseSupportType(std::string_view s) +{ + if (s == "pole") + return RailingEntrySupportType::Pole; + else /* if (s == "box") */ + return RailingEntrySupportType::Box; +} diff --git a/src/openrct2/object/FootpathRailingsObject.h b/src/openrct2/object/FootpathRailingsObject.h new file mode 100644 index 0000000000..2b61ec9255 --- /dev/null +++ b/src/openrct2/object/FootpathRailingsObject.h @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../world/Footpath.h" +#include "Object.h" + +class FootpathRailingsObject final : public Object +{ +public: + rct_string_id NameStringId{}; + uint32_t PreviewImageId{}; + uint32_t BridgeImageId{}; + uint32_t RailingsImageId{}; + RailingEntrySupportType SupportType{}; + uint8_t Flags{}; + uint8_t ScrollingMode{}; + colour_t Colour{}; + +public: + explicit FootpathRailingsObject(const rct_object_entry& entry) + : Object(entry) + { + } + + void ReadJson(IReadObjectContext* context, json_t& root) override; + void Load() override; + void Unload() override; + + void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override; + +private: + RailingEntrySupportType ParseSupportType(std::string_view s); +}; diff --git a/src/openrct2/object/FootpathSurfaceObject.cpp b/src/openrct2/object/FootpathSurfaceObject.cpp new file mode 100644 index 0000000000..66b89b6727 --- /dev/null +++ b/src/openrct2/object/FootpathSurfaceObject.cpp @@ -0,0 +1,69 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "FootpathSurfaceObject.h" + +#include "../core/IStream.hpp" +#include "../core/Json.hpp" +#include "../object/ObjectRepository.h" + +void FootpathSurfaceObject::Load() +{ + GetStringTable().Sort(); + NameStringId = language_allocate_object_string(GetName()); + + auto numImages = GetImageTable().GetCount(); + if (numImages != 0) + { + PreviewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); + BaseImageId = PreviewImageId + 1; + } +} + +void FootpathSurfaceObject::Unload() +{ + language_free_object_string(NameStringId); + gfx_object_free_images(PreviewImageId, GetImageTable().GetCount()); + + NameStringId = 0; + PreviewImageId = 0; + BaseImageId = 0; +} + +void FootpathSurfaceObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const +{ + auto screenCoords = ScreenCoordsXY{ width / 2 - 16, height / 2 }; + gfx_draw_sprite(dpi, BaseImageId + 3, screenCoords, 0); + gfx_draw_sprite(dpi, BaseImageId + 16, { screenCoords.x + 32, screenCoords.y - 16 }, 0); + gfx_draw_sprite(dpi, BaseImageId + 8, { screenCoords.x + 32, screenCoords.y + 16 }, 0); +} + +void FootpathSurfaceObject::ReadJson(IReadObjectContext* context, json_t& root) +{ + Guard::Assert(root.is_object(), "FootpathSurfaceObject::ReadJson expects parameter root to be object"); + + auto properties = root["properties"]; + if (properties.is_object()) + { + Flags = Json::GetFlags( + properties, + { + { "editorOnly", FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR }, + { "isQueue", FOOTPATH_ENTRY_FLAG_IS_QUEUE }, + { "noSlopeRailings", FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS }, + }); + } + + PopulateTablesFromJson(context, root); +} + +void FootpathSurfaceObject::SetRepositoryItem(ObjectRepositoryItem* item) const +{ + item->FootpathSurfaceInfo.Flags = Flags; +} diff --git a/src/openrct2/object/FootpathSurfaceObject.h b/src/openrct2/object/FootpathSurfaceObject.h new file mode 100644 index 0000000000..7d5ca8c6d7 --- /dev/null +++ b/src/openrct2/object/FootpathSurfaceObject.h @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../world/Footpath.h" +#include "Object.h" + +class FootpathSurfaceObject final : public Object +{ +public: + rct_string_id NameStringId{}; + uint32_t PreviewImageId{}; + uint32_t BaseImageId{}; + uint8_t Flags{}; + +public: + explicit FootpathSurfaceObject(const rct_object_entry& entry) + : Object(entry) + { + } + + void ReadJson(IReadObjectContext* context, json_t& root) override; + void Load() override; + void Unload() override; + + void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override; + + void SetRepositoryItem(ObjectRepositoryItem* item) const override; +}; diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 4f7ca3f8cf..6d961edba4 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -42,6 +42,8 @@ enum class ObjectType : uint8_t TerrainEdge, Station, Music, + FootpathSurface, + FootpathRailings, Count, None = 255 diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index db5865e54a..854d3ed70b 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -24,6 +24,8 @@ #include "EntranceObject.h" #include "FootpathItemObject.h" #include "FootpathObject.h" +#include "FootpathRailingsObject.h" +#include "FootpathSurfaceObject.h" #include "LargeSceneryObject.h" #include "MusicObject.h" #include "Object.h" @@ -356,6 +358,12 @@ namespace ObjectFactory case ObjectType::Music: result = std::make_unique(entry); break; + case ObjectType::FootpathSurface: + result = std::make_unique(entry); + break; + case ObjectType::FootpathRailings: + result = std::make_unique(entry); + break; default: throw std::runtime_error("Invalid object type"); } @@ -392,6 +400,10 @@ namespace ObjectFactory return ObjectType::Station; if (s == "music") return ObjectType::Music; + if (s == "footpath_surface") + return ObjectType::FootpathSurface; + if (s == "footpath_railings") + return ObjectType::FootpathRailings; return ObjectType::None; } diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 6fa5555f8d..049fb54fe0 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -54,6 +54,10 @@ struct ObjectRepositoryItem { std::vector Entries; } SceneryGroupInfo; + struct + { + uint8_t Flags{}; + } FootpathSurfaceInfo; [[nodiscard]] ObjectSourceGame GetFirstSourceGame() const { diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 532b40f95f..f31d4fea8f 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -134,6 +134,7 @@ enum { FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2), FOOTPATH_ENTRY_FLAG_IS_QUEUE = (1 << 3), + FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS = (1 << 4), }; enum From b367f74496139db85b181c0118e01444c098fbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 29 Aug 2021 13:20:30 -0700 Subject: [PATCH 261/681] Fix #15199: Construction window is not closed when a ride gets demolished --- distribution/changelog.txt | 1 + src/openrct2/actions/RideDemolishAction.cpp | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b512a644dc..564b7fc02b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -16,6 +16,7 @@ - Fix: [#15170] Plugin: incorrect label text alignment. - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. +- Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Improved: [#3417] Crash dumps are now placed in their own folder. diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 3add2042dc..ecc24ea6ce 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -157,10 +157,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const gParkValue = GetContext()->GetGameState()->GetPark().CalculateParkValue(); // Close windows related to the demolished ride - if (!(GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) - { - window_close_by_number(WC_RIDE_CONSTRUCTION, _rideIndex); - } + window_close_by_number(WC_RIDE_CONSTRUCTION, _rideIndex); window_close_by_number(WC_RIDE, _rideIndex); window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, _rideIndex); window_close_by_class(WC_NEW_CAMPAIGN); From 51ad88c25d8f80925f8df6c489e1935c480a47e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 29 Aug 2021 23:43:59 +0300 Subject: [PATCH 262/681] Fix #15306: Fix track paint using the wrong bounding box offsets --- src/openrct2/ride/TrackPaint.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 99daa1465a..ce0df6247d 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1042,7 +1042,9 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( CoordsXY boundsLength = boundsLengths[direction][index][1]; CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, 0) : boundsOffsets[direction][index][1]); - PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, thickness[1] }, boundsOffset); + PaintAddImageAsParent( + session, imageId, { offset, height }, { boundsLength, thickness[1] }, + { boundsOffset.x, boundsOffset.y, height + boundsOffset.z }); } } @@ -1479,7 +1481,7 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( const sprite_bb* spriteBB = &sprites[direction][sprite]; const uint32_t imageId = spriteBB->sprite_id | colourFlags; const auto& offset = spriteBB->offset; - const auto& bbOffset = spriteBB->offset; + const auto& bbOffset = spriteBB->bb_offset; PaintAddImageAsParent( session, imageId, { offset.x, offset.y, height + offset.z }, spriteBB->bb_size, { bbOffset.x, bbOffset.y, height + bbOffset.z }); From 6d7fd57f5bb4672546f8461959d41de76285bf82 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sat, 21 Aug 2021 21:44:24 -0700 Subject: [PATCH 263/681] remove var_CA --- src/openrct2/GameStateSnapshots.cpp | 1 - src/openrct2/rct1/RCT1.h | 3 +-- src/openrct2/rct1/S4Importer.cpp | 1 - src/openrct2/rct2/RCT2.h | 3 +-- src/openrct2/rct2/S6Exporter.cpp | 1 - src/openrct2/rct2/S6Importer.cpp | 1 - src/openrct2/ride/CableLift.cpp | 1 - src/openrct2/ride/Vehicle.cpp | 3 +-- src/openrct2/ride/Vehicle.h | 3 +-- src/openrct2/world/Entity.cpp | 1 - 10 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index a3bc1e024f..f6e1f53d19 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -425,7 +425,6 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Vehicle, pad_C6[i]); } COMPARE_FIELD(Vehicle, animationState); - COMPARE_FIELD(Vehicle, var_CA); COMPARE_FIELD(Vehicle, scream_sound_id); COMPARE_FIELD(Vehicle, TrackSubposition); COMPARE_FIELD(Vehicle, num_laps); diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index e2b0293b91..95df48338d 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -300,8 +300,7 @@ namespace RCT1 uint8_t var_C4; uint8_t animation_frame; uint8_t pad_C6[0x2]; - uint16_t animationState; - uint16_t var_CA; + uint32_t animationState; uint8_t scream_sound_id; // 0xCC uint8_t TrackSubposition; union diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 794bb48311..d1cd3b312a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2722,7 +2722,6 @@ namespace RCT1 dst->var_C4 = src->var_C4; dst->animation_frame = src->animation_frame; dst->animationState = src->animationState; - dst->var_CA = src->var_CA; dst->var_CE = src->var_CE; dst->var_D3 = src->var_D3; dst->scream_sound_id = OpenRCT2::Audio::SoundId::Null; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 85b4999605..32d5cb5f6d 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -537,8 +537,7 @@ struct RCT2SpriteVehicle : RCT12SpriteBase }; uint8_t animation_frame; // 0xC5 uint8_t pad_C6[0x2]; - uint16_t animationState; - uint16_t var_CA; + uint32_t animationState; uint8_t scream_sound_id; // 0xCC uint8_t TrackSubposition; union diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 2d6ca37d9a..602af47bdd 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1180,7 +1180,6 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle* dst->dodgems_collision_direction = src->dodgems_collision_direction; dst->animation_frame = src->animation_frame; dst->animationState = src->animationState; - dst->var_CA = src->var_CA; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = static_cast(src->TrackSubposition); dst->var_CE = src->var_CE; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 114ccc6ef2..d331e309ad 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1664,7 +1664,6 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->dodgems_collision_direction = src->dodgems_collision_direction; dst->animation_frame = src->animation_frame; dst->animationState = src->animationState; - dst->var_CA = src->var_CA; dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; dst->var_CE = src->var_CE; diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 3432ed6b92..92d9bc43a2 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -55,7 +55,6 @@ Vehicle* cable_lift_segment_create( current->var_C4 = 0; current->animation_frame = 0; current->animationState = 0; - current->var_CA = 0; current->scream_sound_id = OpenRCT2::Audio::SoundId::Null; current->Pitch = 0; current->bank_rotation = 0; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index bbbdef5358..e33d53788a 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3647,9 +3647,8 @@ void Vehicle::UpdateCollisionSetup() train->IsCrashedVehicle = true; train->animationState = scenario_rand(); - train->var_CA = scenario_rand(); - train->animation_frame = train->var_CA & 0x7; + train->animation_frame = (train->animationState >> 16) & 0x7; train->sprite_width = 13; train->sprite_height_negative = 45; train->sprite_height_positive = 5; diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 8963fb379d..bc04b53ddf 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -182,8 +182,7 @@ struct Vehicle : EntityBase }; uint8_t animation_frame; uint8_t pad_C6[0x2]; - uint16_t animationState; - uint16_t var_CA; + uint32_t animationState; OpenRCT2::Audio::SoundId scream_sound_id; VehicleTrackSubposition TrackSubposition; union diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/world/Entity.cpp index bc1b1e0859..7d45216925 100644 --- a/src/openrct2/world/Entity.cpp +++ b/src/openrct2/world/Entity.cpp @@ -279,7 +279,6 @@ void Vehicle::Serialise(DataSerialiser& stream) stream << dodgems_collision_direction; stream << animation_frame; stream << animationState; - stream << var_CA; stream << scream_sound_id; stream << TrackSubposition; stream << var_CE; From 199de52afede08e35c9ce17b4699f90fad543ba3 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sat, 21 Aug 2021 21:53:29 -0700 Subject: [PATCH 264/681] quick removing this --- src/openrct2/ride/Vehicle.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e33d53788a..9302ff8c28 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5520,6 +5520,7 @@ void Vehicle::UpdateCrash() curVehicle->Invalidate(); } curVehicle->animationState += 7281; + curVehicle->animationState &= 0xFFFF; continue; } @@ -7318,7 +7319,6 @@ void Vehicle::UpdateAdditionalAnimation() uint8_t curFrame{}; uint32_t eax{}; - uint32_t* curAnimationState = reinterpret_cast(&animationState); auto vehicleEntry = Entry(); if (vehicleEntry == nullptr) { @@ -7327,8 +7327,8 @@ void Vehicle::UpdateAdditionalAnimation() switch (vehicleEntry->animation) { case VEHICLE_ENTRY_ANIMATION_MINITURE_RAILWAY_LOCOMOTIVE: // loc_6D652B - *curAnimationState += _vehicleVelocityF64E08; - targetFrame = (*curAnimationState >> 20) & 3; + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 20) & 3; if (animation_frame != targetFrame) { curFrame = animation_frame; @@ -7366,8 +7366,8 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_SWAN: // loc_6D6424 - *curAnimationState += _vehicleVelocityF64E08; - targetFrame = (*curAnimationState >> 18) & 2; + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 18) & 2; if (animation_frame != targetFrame) { animation_frame = targetFrame; @@ -7375,8 +7375,8 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_CANOES: // loc_6D6482 - *curAnimationState += _vehicleVelocityF64E08; - eax = ((*curAnimationState >> 13) & 0xFF) * 6; + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 13) & 0xFF) * 6; targetFrame = (eax >> 8) & 0xFF; if (animation_frame != targetFrame) { @@ -7385,8 +7385,8 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_ROW_BOATS: // loc_6D64F7 - *curAnimationState += _vehicleVelocityF64E08; - eax = ((*curAnimationState >> 13) & 0xFF) * 7; + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 13) & 0xFF) * 7; targetFrame = (eax >> 8) & 0xFF; if (animation_frame != targetFrame) { @@ -7395,8 +7395,8 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_WATER_TRICYCLES: // loc_6D6453 - *curAnimationState += _vehicleVelocityF64E08; - targetFrame = (*curAnimationState >> 19) & 1; + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 19) & 1; if (animation_frame != targetFrame) { animation_frame = targetFrame; @@ -7417,8 +7417,8 @@ void Vehicle::UpdateAdditionalAnimation() } break; case VEHICLE_ENTRY_ANIMATION_HELICARS: // loc_6D63F5 - *curAnimationState += _vehicleVelocityF64E08; - targetFrame = (*curAnimationState >> 18) & 3; + animationState += _vehicleVelocityF64E08; + targetFrame = (animationState >> 18) & 3; if (animation_frame != targetFrame) { animation_frame = targetFrame; @@ -7428,8 +7428,8 @@ void Vehicle::UpdateAdditionalAnimation() case VEHICLE_ENTRY_ANIMATION_MONORAIL_CYCLES: // loc_6D64B6 if (num_peeps != 0) { - *curAnimationState += _vehicleVelocityF64E08; - eax = ((*curAnimationState >> 13) & 0xFF) << 2; + animationState += _vehicleVelocityF64E08; + eax = ((animationState >> 13) & 0xFF) << 2; targetFrame = (eax >> 8) & 0xFF; if (animation_frame != targetFrame) { From 315070faaa0d157698eab0619c00995fa1b42c76 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 22 Aug 2021 21:44:04 -0700 Subject: [PATCH 265/681] set value to 0 --- src/openrct2/ride/Vehicle.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 9302ff8c28..1991d873e2 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1522,16 +1522,16 @@ bool Vehicle::OpenRestraints() } if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER && vehicle->animation_frame != 0) { - if (vehicle->animationState + 0x3333 < 0xFFFF) + if (vehicle->animationState <= 0xCCCC) { - vehicle->animationState = vehicle->animationState + 0x3333 - 0xFFFF; - vehicle->animation_frame++; - vehicle->animation_frame &= 7; - vehicle->Invalidate(); + vehicle->animationState += 0x3333; } else { - vehicle->animationState += 0x3333; + vehicle->animationState = 0; + vehicle->animation_frame++; + vehicle->animation_frame &= 7; + vehicle->Invalidate(); } restraintsOpen = false; continue; @@ -5512,15 +5512,18 @@ void Vehicle::UpdateCrash() ExplosionCloud::Create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); } } - if (curVehicle->animationState + 7281 > 0xFFFF) + if (curVehicle->animationState <= 58248) { + curVehicle->animationState += 7281; + } + else + { + curVehicle->animationState = 0; curVehicle->animation_frame++; if (curVehicle->animation_frame >= 8) curVehicle->animation_frame = 0; curVehicle->Invalidate(); } - curVehicle->animationState += 7281; - curVehicle->animationState &= 0xFFFF; continue; } @@ -7410,7 +7413,7 @@ void Vehicle::UpdateAdditionalAnimation() } else { - animationState += 0x3333; + animationState = 0; animation_frame += 1; animation_frame &= 7; Invalidate(); @@ -7447,7 +7450,7 @@ void Vehicle::UpdateAdditionalAnimation() } else { - animationState += 0x3333; + animationState = 0; if (seat_rotation >= target_seat_rotation) seat_rotation--; From 0f5075f0244bd444b2bc1feb68f1488331a488a3 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 24 Aug 2021 11:28:30 -0700 Subject: [PATCH 266/681] fix triggers --- src/openrct2/ride/Vehicle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 1991d873e2..d635bcae89 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3646,9 +3646,9 @@ void Vehicle::UpdateCollisionSetup() } train->IsCrashedVehicle = true; - train->animationState = scenario_rand(); + train->animationState = scenario_rand() & 0xFFFF; - train->animation_frame = (train->animationState >> 16) & 0x7; + train->animation_frame = scenario_rand() & 0x7; train->sprite_width = 13; train->sprite_height_negative = 45; train->sprite_height_positive = 5; @@ -5512,9 +5512,9 @@ void Vehicle::UpdateCrash() ExplosionCloud::Create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); } } - if (curVehicle->animationState <= 58248) + if (curVehicle->animationState <= 0xe388) { - curVehicle->animationState += 7281; + curVehicle->animationState += 0x1c71; } else { From 54bff59d901e4836bc7befb51b19cfa5df121f28 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 26 Aug 2021 07:42:02 +0100 Subject: [PATCH 267/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2a742f306..c4b1b1df2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.47") +set(REPLAYS_VERSION "0.0.48") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "61CAB8A0AD0B057B13B003DF32748977C2B5975F") +set(REPLAYS_SHA1 "6ED73C32BD62B9C6DA09FCE3426EC8E30CA59762") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 710f325bd9..51fd1c75ac 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.47/replays.zip - 61CAB8A0AD0B057B13B003DF32748977C2B5975F + https://github.com/OpenRCT2/replays/releases/download/v0.0.48/replays.zip + 6ED73C32BD62B9C6DA09FCE3426EC8E30CA59762 From 91099429c8c67baf6c4e2b28f820d7c392ac2f3f Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 29 Aug 2021 14:52:20 -0700 Subject: [PATCH 268/681] bump network --- 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 bd09ca6b0b..55891f3b28 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "6" +#define NETWORK_STREAM_VERSION "7" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 39b762aa785f90907b296f423536c786d36efd98 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 29 Aug 2021 15:00:47 -0700 Subject: [PATCH 269/681] fix sign error --- src/openrct2/ride/Vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index d635bcae89..fca333a112 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7467,7 +7467,7 @@ void Vehicle::UpdateAdditionalAnimation() UpdateAnimationAnimalFlying(); // makes animation play faster with vehicle speed targetFrame = abs(_vehicleVelocityF64E08) >> 24; - animationState = std::max(animationState - targetFrame, 0); + animationState = std::max(animationState - targetFrame, 0u); break; } } From 7e5e9bdf13ceedb3593bf781ec077af6d47d7a9a Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 29 Aug 2021 20:15:44 -0400 Subject: [PATCH 270/681] Part of #13874: Add definition field in TrackElementDescriptor --- src/openrct2-ui/windows/RideConstruction.cpp | 15 +- src/openrct2/actions/WallPlaceAction.cpp | 4 +- src/openrct2/ride/RideConstruction.cpp | 8 +- src/openrct2/ride/Track.cpp | 294 +------------------ src/openrct2/ride/Track.h | 2 - src/openrct2/ride/TrackData.cpp | 276 +++++++++++++++++ src/openrct2/ride/TrackData.h | 2 + src/openrct2/ride/Vehicle.cpp | 7 +- 8 files changed, 309 insertions(+), 299 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8879ec1607..76282bcf85 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2367,7 +2367,7 @@ static void window_ride_construction_draw_track_piece( mapCoords.y = 4112 + (rotatedMapCoords.y / 2); mapCoords.z = 1024 + mapCoords.z; - int16_t previewZOffset = TrackDefinitions[trackType].preview_z_offset; + int16_t previewZOffset = ted.Definition.preview_z_offset; mapCoords.z -= previewZOffset; const ScreenCoordsXY rotatedScreenCoords = translate_3d_to_2d_with_z(get_current_rotation(), mapCoords); @@ -2705,7 +2705,8 @@ static void window_ride_construction_update_possible_ride_configurations() _numCurrentPossibleSpecialTrackPieces = 0; for (trackType = 0; trackType < TrackElemType::Count; trackType++) { - int32_t trackTypeCategory = TrackDefinitions[trackType].type; + const auto& ted = GetTrackElementDescriptor(trackType); + int32_t trackTypeCategory = ted.Definition.type; if (trackTypeCategory == TRACK_NONE) continue; @@ -2718,13 +2719,13 @@ static void window_ride_construction_update_possible_ride_configurations() int32_t slope, bank; if (_rideConstructionState == RideConstructionState::Front || _rideConstructionState == RideConstructionState::Place) { - slope = TrackDefinitions[trackType].vangle_start; - bank = TrackDefinitions[trackType].bank_start; + slope = ted.Definition.vangle_start; + bank = ted.Definition.bank_start; } else if (_rideConstructionState == RideConstructionState::Back) { - slope = TrackDefinitions[trackType].vangle_end; - bank = TrackDefinitions[trackType].bank_end; + slope = ted.Definition.vangle_end; + bank = ted.Definition.bank_end; } else { @@ -2733,7 +2734,7 @@ static void window_ride_construction_update_possible_ride_configurations() if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) { - if (TrackDefinitions[trackType].type == TRACK_HELIX_SMALL || TrackDefinitions[trackType].type == TRACK_HELIX_LARGE) + if (ted.Definition.type == TRACK_HELIX_SMALL || ted.Definition.type == TRACK_HELIX_LARGE) { if (bank != _previousTrackBankEnd) { diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 1d2e44916b..17bd70d98f 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -443,7 +443,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - if (TrackDefinitions[trackType].bank_start == 0) + if (ted.Definition.bank_start == 0) { if (!(ted.Coordinates.rotation_begin & 4)) { @@ -468,7 +468,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - if (TrackDefinitions[trackType].bank_end != 0) + if (ted.Definition.bank_end != 0) { return false; } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index de5f99dfd3..e9ef4599ab 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -661,8 +661,8 @@ void ride_construction_set_default_next_piece() ted = &GetTrackElementDescriptor(trackType); curve = ted->CurveChain.next; - bank = TrackDefinitions[trackType].bank_end; - slope = TrackDefinitions[trackType].vangle_end; + bank = ted->Definition.bank_end; + slope = ted->Definition.vangle_end; // Set track curve _currentTrackCurve = curve; @@ -707,8 +707,8 @@ void ride_construction_set_default_next_piece() ted = &GetTrackElementDescriptor(trackType); curve = ted->CurveChain.previous; - bank = TrackDefinitions[trackType].bank_start; - slope = TrackDefinitions[trackType].vangle_start; + bank = ted->Definition.bank_start; + slope = ted->Definition.vangle_start; // Set track curve _currentTrackCurve = curve; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 73fa7f8946..0c5aaf3a05 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -34,289 +34,18 @@ #include "TrackData.h" #include "TrackDesign.h" -/** rct2: 0x00997C9D */ -// clang-format off -const rct_trackdefinition TrackDefinitions[TrackElemType::Count] = -{ - // TYPE VANGLE END VANGLE START BANK END BANK START PREVIEW Z OFFSET - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT - { TRACK_STATION_END, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_END_STATION - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BEGIN_STATION - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MIDDLE_STATION - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN - { TRACK_S_BEND, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_LEFT - { TRACK_S_BEND, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_RIGHT - { TRACK_VERTICAL_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, -48 }, // ELEM_LEFT_VERTICAL_LOOP - { TRACK_VERTICAL_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, -48 }, // ELEM_RIGHT_VERTICAL_LOOP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE - { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_TWIST_DOWN_TO_UP - { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_TWIST_DOWN_TO_UP - { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_LEFT_TWIST_UP_TO_DOWN - { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_RIGHT_TWIST_UP_TO_DOWN - { TRACK_HALF_LOOP, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_HALF_LOOP_UP - { TRACK_HALF_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_HALF_LOOP_DOWN - { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_CORKSCREW_UP - { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_CORKSCREW_UP - { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -32 }, // ELEM_LEFT_CORKSCREW_DOWN - { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -32 }, // ELEM_RIGHT_CORKSCREW_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_FLAT - { TRACK_TOWER_BASE, TRACK_VANGLE_TOWER, TRACK_VANGLE_TOWER, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_TOWER_BASE - { TRACK_TOWER_BASE, TRACK_VANGLE_TOWER, TRACK_VANGLE_TOWER, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_TOWER_SECTION - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_COVERED - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_COVERED - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_COVERED - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_UP_COVERED - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_60_DEG_UP_COVERED - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_25_DEG_UP_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_FLAT_COVERED - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_COVERED - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_COVERED - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_DOWN_COVERED - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_60_DEG_DOWN_COVERED - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_25_DEG_DOWN_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_FLAT_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_LEFT_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_RIGHT_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_COVERED - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_COVERED - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE - { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN - { TRACK_BRAKES, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BRAKES - { TRACK_BOOSTER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BOOSTER - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP - { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP - { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP - { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN - { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_DOWN - { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_HELIX_LARGE_UP - { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_HELIX_LARGE_UP - { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_HELIX_LARGE_DOWN - { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_HELIX_LARGE_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_25_DEG_UP_LEFT_BANKED - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_25_DEG_UP_RIGHT_BANKED - { TRACK_WATERFALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WATERFALL - { TRACK_RAPIDS, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RAPIDS - { TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_ON_RIDE_PHOTO - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_25_DEG_DOWN_LEFT_BANKED - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_25_DEG_DOWN_RIGHT_BANKED - { TRACK_WATER_SPLASH, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WATER_SPLASH - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_UP_LONG_BASE - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT_LONG_BASE - { TRACK_WHIRLPOOL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WHIRLPOOL - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_DOWN_LONG_BASE - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT_LONG_BASE_122 - { TRACK_LIFT_HILL_CABLE, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_CABLE_LIFT_HILL - { TRACK_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_REVERSE_FREEFALL_SLOPE - { TRACK_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_BANK_NONE,TRACK_BANK_NONE, 0 }, // ELEM_REVERSE_FREEFALL_VERTICAL - { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_90_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_DOWN_TO_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_UP_TO_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_90_DEG_DOWN - { TRACK_BRAKE_FOR_DROP, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BRAKE_FOR_DROP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_EIGHTH_TO_DIAG - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_EIGHTH_TO_DIAG - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_EIGHTH_TO_ORTHOGONAL - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_EIGHTH_BANK_TO_DIAG - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_EIGHTH_BANK_TO_DIAG - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_60_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_60_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK - { TRACK_LOG_FLUME_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LOG_FLUME_REVERSER - { TRACK_SPINNING_TUNNEL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_SPINNING_TUNNEL - { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_BARREL_ROLL_UP_TO_DOWN - { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_BARREL_ROLL_UP_TO_DOWN - { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_LEFT_BARREL_ROLL_DOWN_TO_UP - { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_RIGHT_BARREL_ROLL_DOWN_TO_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_LEFT_BANK - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_RIGHT_BANK - { TRACK_POWERED_LIFT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_POWERED_LIFT - {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_LEFT_LARGE_HALF_LOOP_UP - {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_RIGHT_LARGE_HALF_LOOP_UP - {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_RIGHT_LARGE_HALF_LOOP_DOWN - {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_LEFT_LARGE_HALF_LOOP_DOWN - {TRACK_INLINE_TWIST_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_TWIST_UP - {TRACK_INLINE_TWIST_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_TWIST_UP - {TRACK_INLINE_TWIST_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_TWIST_DOWN - {TRACK_INLINE_TWIST_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_TWIST_DOWN - {TRACK_HALF_LOOP_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_FLYER_HALF_LOOP_UP - {TRACK_HALF_LOOP_INVERTED, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -64 }, // ELEM_FLYER_HALF_LOOP_DOWN - {TRACK_CORKSCREW_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_CORKSCREW_UP - {TRACK_CORKSCREW_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_CORKSCREW_UP - {TRACK_CORKSCREW_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -32 }, // ELEM_LEFT_FLYER_CORKSCREW_DOWN - {TRACK_CORKSCREW_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -32 }, // ELEM_RIGHT_FLYER_CORKSCREW_DOWN - {TRACK_HEARTLINE_TRANSFER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_HEARTLINE_TRANSFER_UP - {TRACK_HEARTLINE_TRANSFER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_HEARTLINE_TRANSFER_DOWN - {TRACK_HEARTLINE_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_HEARTLINE_ROLL - {TRACK_HEARTLINE_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_HEARTLINE_ROLL - {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_A - {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_B - {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_C - {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_D - {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_E - {TRACK_QUARTER_LOOP_INVERTED, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN - {TRACK_QUARTER_LOOP, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_TO_INVERTED_FLAT_QUARTER_LOOP_UP - {TRACK_QUARTER_LOOP, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN - { TRACK_LIFT_HILL_CURVED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_CURVED_LIFT_HILL - { TRACK_LIFT_HILL_CURVED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_CURVED_LIFT_HILL - { TRACK_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_REVERSER - { TRACK_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_REVERSER - { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_TOP_CAP - { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_VERTICAL_DOWN - { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_VERTICAL_DOWN_TO_LEVEL - { TRACK_BLOCK_BRAKES, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BLOCK_BRAKES - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT - { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP - { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN - { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN - { TRACK_QUARTER_LOOP_UNINVERTED,TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_90_DEG_UP_TO_INVERTED_FLAT_QUARTER_LOOP - { TRACK_QUARTER_LOOP_UNINVERTED,TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_FLAT_TO_90_DEG_DOWN_QUARTER_LOOP - { TRACK_QUARTER_LOOP_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // 255 - { TRACK_ROTATION_CONTROL_TOGGLE,TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_ROTATION_CONTROL_TOGGLE - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x4A - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack2x2 - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack4x4 - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack2x4 - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x5 - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x1A - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x4B - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x1B - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, -40 }, // TrackElemType::FlatTrack1x4C - { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack3x3 -}; -// clang-format on +using namespace OpenRCT2::TrackMetaData; PitchAndRoll TrackPitchAndRollStart(track_type_t trackType) { - return { TrackDefinitions[trackType].vangle_start, TrackDefinitions[trackType].bank_start }; + const auto& ted = GetTrackElementDescriptor(trackType); + return { ted.Definition.vangle_start, ted.Definition.bank_start }; } PitchAndRoll TrackPitchAndRollEnd(track_type_t trackType) { - return { TrackDefinitions[trackType].vangle_end, TrackDefinitions[trackType].bank_end }; + const auto& ted = GetTrackElementDescriptor(trackType); + return { ted.Definition.vangle_end, ted.Definition.bank_end }; } /** @@ -327,13 +56,15 @@ int32_t track_is_connected_by_shape(TileElement* a, TileElement* b) int32_t trackType, aBank, aAngle, bBank, bAngle; trackType = a->AsTrack()->GetTrackType(); - aBank = TrackDefinitions[trackType].bank_end; - aAngle = TrackDefinitions[trackType].vangle_end; + const auto* ted = &GetTrackElementDescriptor(trackType); + aBank = ted->Definition.bank_end; + aAngle = ted->Definition.vangle_end; aBank = track_get_actual_bank(a, aBank); trackType = b->AsTrack()->GetTrackType(); - bBank = TrackDefinitions[trackType].bank_start; - bAngle = TrackDefinitions[trackType].vangle_start; + ted = &GetTrackElementDescriptor(trackType); + bBank = ted->Definition.bank_start; + bAngle = ted->Definition.vangle_start; bBank = track_get_actual_bank(b, bBank); return aBank == bBank && aAngle == bAngle; @@ -873,7 +604,8 @@ roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type roll_type_t track_get_actual_bank_3(bool useInvertedSprites, TileElement* tileElement) { auto trackType = tileElement->AsTrack()->GetTrackType(); - auto bankStart = TrackDefinitions[trackType].bank_start; + const auto& ted = GetTrackElementDescriptor(trackType); + auto bankStart = ted.Definition.bank_start; auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); if (ride == nullptr) return bankStart; diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index ac21d47da3..3c16e133f4 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -553,8 +553,6 @@ struct track_circuit_iterator bool looped; }; -extern const rct_trackdefinition TrackDefinitions[TrackElemType::Count]; - PitchAndRoll TrackPitchAndRollStart(track_type_t trackType); PitchAndRoll TrackPitchAndRollEnd(track_type_t trackType); diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index f30a130642..ac645d49fa 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -5129,6 +5129,281 @@ static constexpr uint16_t TrackFlags[TrackElemType::Count] = { }; // clang-format on +/** rct2: 0x00997C9D */ +// clang-format off +static constexpr rct_trackdefinition TrackDefinitions[TrackElemType::Count] = +{ + // TYPE VANGLE END VANGLE START BANK END BANK START PREVIEW Z OFFSET + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT + { TRACK_STATION_END, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_END_STATION + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BEGIN_STATION + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MIDDLE_STATION + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN + { TRACK_S_BEND, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_LEFT + { TRACK_S_BEND, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_RIGHT + { TRACK_VERTICAL_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, -48 }, // ELEM_LEFT_VERTICAL_LOOP + { TRACK_VERTICAL_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, -48 }, // ELEM_RIGHT_VERTICAL_LOOP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE + { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_TWIST_DOWN_TO_UP + { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_TWIST_DOWN_TO_UP + { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_LEFT_TWIST_UP_TO_DOWN + { TRACK_TWIST, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_RIGHT_TWIST_UP_TO_DOWN + { TRACK_HALF_LOOP, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_HALF_LOOP_UP + { TRACK_HALF_LOOP, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_HALF_LOOP_DOWN + { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_CORKSCREW_UP + { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_CORKSCREW_UP + { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -32 }, // ELEM_LEFT_CORKSCREW_DOWN + { TRACK_CORKSCREW, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -32 }, // ELEM_RIGHT_CORKSCREW_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_FLAT + { TRACK_TOWER_BASE, TRACK_VANGLE_TOWER, TRACK_VANGLE_TOWER, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_TOWER_BASE + { TRACK_TOWER_BASE, TRACK_VANGLE_TOWER, TRACK_VANGLE_TOWER, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_TOWER_SECTION + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_COVERED + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_COVERED + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_COVERED + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_UP_COVERED + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_60_DEG_UP_COVERED + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_25_DEG_UP_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_FLAT_COVERED + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_COVERED + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_COVERED + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_25_DEG_DOWN_COVERED + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_60_DEG_DOWN_COVERED + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_25_DEG_DOWN_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_FLAT_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_5_TILES_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_5_TILES_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_LEFT_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_S_BEND_RIGHT_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_COVERED + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_COVERED + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE + { TRACK_HELIX_SMALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN + { TRACK_BRAKES, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BRAKES + { TRACK_BOOSTER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BOOSTER + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP + { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP + { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP + { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN + { TRACK_HELIX_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_DOWN + { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_HELIX_LARGE_UP + { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_HELIX_LARGE_UP + { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_HELIX_LARGE_DOWN + { TRACK_HELIX_LARGE_UNBANKED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_HELIX_LARGE_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_25_DEG_UP_LEFT_BANKED + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_25_DEG_UP_RIGHT_BANKED + { TRACK_WATERFALL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WATERFALL + { TRACK_RAPIDS, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RAPIDS + { TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_ON_RIDE_PHOTO + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_25_DEG_DOWN_LEFT_BANKED + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_25_DEG_DOWN_RIGHT_BANKED + { TRACK_WATER_SPLASH, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WATER_SPLASH + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_UP_LONG_BASE + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT_LONG_BASE + { TRACK_WHIRLPOOL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_WHIRLPOOL + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_60_DEG_DOWN_LONG_BASE + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_FLAT_LONG_BASE_122 + { TRACK_LIFT_HILL_CABLE, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_CABLE_LIFT_HILL + { TRACK_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_REVERSE_FREEFALL_SLOPE + { TRACK_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_VANGLE_REVERSE_FREEFALL, TRACK_BANK_NONE,TRACK_BANK_NONE, 0 }, // ELEM_REVERSE_FREEFALL_VERTICAL + { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_UP_TO_90_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_DOWN_TO_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_UP_TO_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_60_DEG_DOWN_TO_90_DEG_DOWN + { TRACK_BRAKE_FOR_DROP, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BRAKE_FOR_DROP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_EIGHTH_TO_DIAG + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_EIGHTH_TO_DIAG + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_EIGHTH_TO_ORTHOGONAL + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_EIGHTH_BANK_TO_DIAG + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_EIGHTH_BANK_TO_DIAG + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_UP_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_60_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_60, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_60_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_60, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_60_DEG_DOWN_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_FLAT_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_DIAG_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_DIAG_RIGHT_BANK + { TRACK_LOG_FLUME_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LOG_FLUME_REVERSER + { TRACK_SPINNING_TUNNEL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_SPINNING_TUNNEL + { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_BARREL_ROLL_UP_TO_DOWN + { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_BARREL_ROLL_UP_TO_DOWN + { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_LEFT_BARREL_ROLL_DOWN_TO_UP + { TRACK_BARREL_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_RIGHT_BARREL_ROLL_DOWN_TO_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANK_TO_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANK_TO_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_LEFT_BANK + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_RIGHT_BANK + { TRACK_POWERED_LIFT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_POWERED_LIFT + {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_LEFT_LARGE_HALF_LOOP_UP + {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_RIGHT_LARGE_HALF_LOOP_UP + {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_RIGHT_LARGE_HALF_LOOP_DOWN + {TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, -64 }, // ELEM_LEFT_LARGE_HALF_LOOP_DOWN + {TRACK_INLINE_TWIST_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_TWIST_UP + {TRACK_INLINE_TWIST_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_TWIST_UP + {TRACK_INLINE_TWIST_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_TWIST_DOWN + {TRACK_INLINE_TWIST_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_TWIST_DOWN + {TRACK_HALF_LOOP_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 64 }, // ELEM_FLYER_HALF_LOOP_UP + {TRACK_HALF_LOOP_INVERTED, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -64 }, // ELEM_FLYER_HALF_LOOP_DOWN + {TRACK_CORKSCREW_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_FLYER_CORKSCREW_UP + {TRACK_CORKSCREW_UNINVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_FLYER_CORKSCREW_UP + {TRACK_CORKSCREW_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -32 }, // ELEM_LEFT_FLYER_CORKSCREW_DOWN + {TRACK_CORKSCREW_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, -32 }, // ELEM_RIGHT_FLYER_CORKSCREW_DOWN + {TRACK_HEARTLINE_TRANSFER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_HEARTLINE_TRANSFER_UP + {TRACK_HEARTLINE_TRANSFER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_HEARTLINE_TRANSFER_DOWN + {TRACK_HEARTLINE_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_HEARTLINE_ROLL + {TRACK_HEARTLINE_ROLL, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_HEARTLINE_ROLL + {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_A + {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_B + {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_C + {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_D + {TRACK_MINI_GOLF_HOLE, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_MINI_GOLF_HOLE_E + {TRACK_QUARTER_LOOP_INVERTED, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN + {TRACK_QUARTER_LOOP, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_90_DEG_TO_INVERTED_FLAT_QUARTER_LOOP_UP + {TRACK_QUARTER_LOOP, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_UPSIDE_DOWN, 0 }, // ELEM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN + { TRACK_LIFT_HILL_CURVED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_CURVED_LIFT_HILL + { TRACK_LIFT_HILL_CURVED, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_CURVED_LIFT_HILL + { TRACK_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_REVERSER + { TRACK_REVERSER, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_REVERSER + { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_TOP_CAP + { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_VERTICAL_DOWN + { TRACK_SLOPE_TO_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_AIR_THRUST_VERTICAL_DOWN_TO_LEVEL + { TRACK_BLOCK_BRAKES, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_BLOCK_BRAKES + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_LEFT, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_RIGHT, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_LEFT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_25, TRACK_SLOPE_NONE, TRACK_BANK_RIGHT, TRACK_BANK_NONE, 0 }, // ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_LEFT, 0 }, // ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_DOWN_25, TRACK_BANK_NONE, TRACK_BANK_RIGHT, 0 }, // ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT + { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_UP_90, TRACK_SLOPE_UP_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP + { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN + { TRACK_FLAT, TRACK_SLOPE_DOWN_90, TRACK_SLOPE_DOWN_90, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN + { TRACK_QUARTER_LOOP_UNINVERTED,TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_90_DEG_UP_TO_INVERTED_FLAT_QUARTER_LOOP + { TRACK_QUARTER_LOOP_UNINVERTED,TRACK_SLOPE_DOWN_90, TRACK_SLOPE_NONE, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // ELEM_MULTIDIM_FLAT_TO_90_DEG_DOWN_QUARTER_LOOP + { TRACK_QUARTER_LOOP_INVERTED, TRACK_SLOPE_NONE, TRACK_SLOPE_UP_90, TRACK_BANK_UPSIDE_DOWN, TRACK_BANK_NONE, 0 }, // 255 + { TRACK_ROTATION_CONTROL_TOGGLE,TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // ELEM_ROTATION_CONTROL_TOGGLE + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x4A + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack2x2 + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack4x4 + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack2x4 + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x5 + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x1A + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x4B + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack1x1B + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, -40 }, // TrackElemType::FlatTrack1x4C + { TRACK_FLAT, TRACK_SLOPE_NONE, TRACK_SLOPE_NONE, TRACK_BANK_NONE, TRACK_BANK_NONE, 0 }, // TrackElemType::FlatTrack3x3 +}; +// clang-format on + namespace OpenRCT2 { namespace TrackMetaData @@ -5151,6 +5426,7 @@ namespace OpenRCT2 desc.MirrorElement = TrackElementMirrorMap[i]; desc.PieceLength = TrackPieceLengths[i]; desc.Price = TrackPricing[i]; + desc.Definition = TrackDefinitions[i]; for (uint8_t j = 0; j < MaxSequencesPerPiece; j++) { diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 4cd3705355..5975063a73 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -70,6 +70,8 @@ struct TrackElementDescriptor std::array SequenceElementAllowedWallEdges; std::array SequenceProperties; + + rct_trackdefinition Definition; }; namespace OpenRCT2 diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 946bc66d7d..1dfd16bbae 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7599,7 +7599,8 @@ void Vehicle::UpdateLandscapeDoor() const static PitchAndRoll PitchAndRollStart(bool useInvertedSprites, TileElement* tileElement) { auto trackType = tileElement->AsTrack()->GetTrackType(); - return PitchAndRoll{ TrackDefinitions[trackType].vangle_start, track_get_actual_bank_3(useInvertedSprites, tileElement) }; + const auto& ted = GetTrackElementDescriptor(trackType); + return PitchAndRoll{ ted.Definition.vangle_start, track_get_actual_bank_3(useInvertedSprites, tileElement) }; } void Vehicle::UpdateGoKartAttemptSwitchLanes() @@ -8473,8 +8474,8 @@ loc_6DAEB9: static PitchAndRoll PitchAndRollEnd(Ride* curRide, bool useInvertedSprites, uint16_t trackType, TileElement* tileElement) { bool isInverted = useInvertedSprites ^ tileElement->AsTrack()->IsInverted(); - return { TrackDefinitions[trackType].vangle_end, - track_get_actual_bank_2(curRide->type, isInverted, TrackDefinitions[trackType].bank_end) }; + const auto& ted = GetTrackElementDescriptor(trackType); + return { ted.Definition.vangle_end, track_get_actual_bank_2(curRide->type, isInverted, ted.Definition.bank_end) }; } /** From 98a52ac934cfe13709eea49a8d329a199968f63d Mon Sep 17 00:00:00 2001 From: frutiemax Date: Sun, 29 Aug 2021 20:37:59 -0400 Subject: [PATCH 271/681] Part of #13874: Add SpinFunction field --- src/openrct2/ride/TrackData.cpp | 24 +++++++++++++++++ src/openrct2/ride/TrackData.h | 18 +++++++++++++ src/openrct2/ride/Vehicle.cpp | 48 +++------------------------------ 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index ac645d49fa..100dc1a637 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -5404,6 +5404,29 @@ static constexpr rct_trackdefinition TrackDefinitions[TrackElemType::Count] = }; // clang-format on +constexpr static uint8_t TrackTypeToSpinFunction[TrackElemType::Count] = { + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, LR_SPIN, + RL_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L5_SPIN, R5_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, LR_SPIN, RL_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, + L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, L5_SPIN, R5_SPIN, L5_SPIN, R5_SPIN, NO_SPIN, RC_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, + L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, SP_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, R5_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, L7_SPIN, R7_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, + L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, + NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN +}; + namespace OpenRCT2 { namespace TrackMetaData @@ -5427,6 +5450,7 @@ namespace OpenRCT2 desc.PieceLength = TrackPieceLengths[i]; desc.Price = TrackPricing[i]; desc.Definition = TrackDefinitions[i]; + desc.SpinFunction = TrackTypeToSpinFunction[i]; for (uint8_t j = 0; j < MaxSequencesPerPiece; j++) { diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 5975063a73..1d8b3c4199 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -34,6 +34,23 @@ struct track_descriptor uint8_t track_element; }; +enum +{ + NO_SPIN, + L8_SPIN, + R8_SPIN, + LR_SPIN, + RL_SPIN, + L7_SPIN, + R7_SPIN, + L5_SPIN, + R5_SPIN, + RC_SPIN, // Rotation Control Spin + SP_SPIN, // Special rapids Spin + L9_SPIN, + R9_SPIN +}; + extern const track_descriptor gTrackDescriptors[142]; struct dodgems_track_size @@ -72,6 +89,7 @@ struct TrackElementDescriptor std::array SequenceProperties; rct_trackdefinition Definition; + uint8_t SpinFunction; }; namespace OpenRCT2 diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 1dfd16bbae..7454e33ca5 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7121,50 +7121,6 @@ void Vehicle::UpdateSwingingCar() } } -#pragma region TrackTypeToSpinFunction - -enum -{ - NO_SPIN, - L8_SPIN, - R8_SPIN, - LR_SPIN, - RL_SPIN, - L7_SPIN, - R7_SPIN, - L5_SPIN, - R5_SPIN, - RC_SPIN, // Rotation Control Spin - SP_SPIN, // Special rapids Spin - L9_SPIN, - R9_SPIN -}; - -static const uint8_t TrackTypeToSpinFunction[TrackElemType::Count] = { - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, LR_SPIN, - RL_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L5_SPIN, R5_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, LR_SPIN, RL_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, - L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, L5_SPIN, R5_SPIN, L5_SPIN, R5_SPIN, NO_SPIN, RC_SPIN, NO_SPIN, L8_SPIN, R8_SPIN, - L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, SP_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, R5_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, L9_SPIN, R9_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, L7_SPIN, R7_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, L7_SPIN, R7_SPIN, L7_SPIN, R7_SPIN, - L8_SPIN, R8_SPIN, L8_SPIN, R8_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, - NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN, NO_SPIN -}; - -#pragma endregion - /** * * rct2: 0x006D661F @@ -7189,7 +7145,9 @@ void Vehicle::UpdateSpinningCar() // An L spin adds to the spin speed, R does the opposite // The number indicates how much right shift of the velocity will become spin // The bigger the number the less change in spin. - switch (TrackTypeToSpinFunction[trackType]) + + const auto& ted = GetTrackElementDescriptor(trackType); + switch (ted.SpinFunction) { case RC_SPIN: // On a rotation control track element From 8cc833f905184f6f53e9784a5f4e66abf9c1c0a5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 30 Aug 2021 11:28:50 +0100 Subject: [PATCH 272/681] Strip RCT1 out of RCT1 struct names in namespace (#15284) * Strip RCT1 out of struct names in namespace * Remove RCT1:: where not required --- src/openrct2/rct1/RCT1.h | 52 ++++++------ src/openrct2/rct1/S4Importer.cpp | 134 +++++++++++++++---------------- src/openrct2/rct1/T4Importer.cpp | 12 +-- src/openrct2/rct1/Tables.cpp | 4 +- src/openrct2/rct1/Tables.h | 4 +- 5 files changed, 102 insertions(+), 104 deletions(-) diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index e2b0293b91..ca25483938 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -35,20 +35,20 @@ namespace RCT1 constexpr const uint32_t RCT1_NUM_TERRAIN_EDGES = 15; #pragma pack(push, 1) - struct rct1_entrance + struct Entrance { uint16_t x; uint16_t y; uint16_t z; uint8_t direction; }; - assert_struct_size(rct1_entrance, 7); + assert_struct_size(Entrance, 7); /** * RCT1 ride structure * size: 0x260 */ - struct rct1_ride + struct Ride { uint8_t type; // 0x000 uint8_t vehicle_type; // 0x001 @@ -207,9 +207,9 @@ namespace RCT1 uint8_t entrance_style; // 0x179 uint8_t unk_17A[230]; // 0x17A }; - assert_struct_size(rct1_ride, 0x260); + assert_struct_size(Ride, 0x260); - struct rct1_unk_sprite : RCT12SpriteBase + struct UnkEntity : RCT12SpriteBase { uint8_t pad_1F[3]; // 0x1f rct_string_id name_string_idx; // 0x22 @@ -221,7 +221,7 @@ namespace RCT1 uint8_t var_71; }; - struct rct1_vehicle : RCT12SpriteBase + struct Vehicle : RCT12SpriteBase { uint8_t Pitch; // 0x1F uint8_t bank_rotation; // 0x20 @@ -333,7 +333,7 @@ namespace RCT1 } }; - struct rct1_peep : RCT12SpriteBase + struct Peep : RCT12SpriteBase { uint8_t pad_1F[3]; rct_string_id name_string_idx; // 0x22 @@ -477,7 +477,7 @@ namespace RCT1 return item_standard_flags; } }; - assert_struct_size(rct1_peep, 0x100); + assert_struct_size(Peep, 0x100); enum RCT1_PEEP_SPRITE_TYPE { @@ -511,12 +511,12 @@ namespace RCT1 RCT1_PEEP_SPRITE_TYPE_TOFFEE_APPLE = 30 }; - union rct1_sprite + union Entity { uint8_t pad_00[0x100]; - rct1_unk_sprite unknown; - rct1_vehicle vehicle; - rct1_peep peep; + UnkEntity unknown; + Vehicle vehicle; + Peep peep; RCT12SpriteLitter litter; RCT12SpriteBalloon balloon; RCT12SpriteDuck duck; @@ -526,9 +526,9 @@ namespace RCT1 RCT12SpriteCrashSplash crash_splash; RCT12SpriteSteamParticle steam_particle; }; - assert_struct_size(rct1_sprite, 0x100); + assert_struct_size(Entity, 0x100); - struct rct1_research_item + struct ResearchItem { uint8_t item; uint8_t related_ride; @@ -536,13 +536,13 @@ namespace RCT1 uint8_t flags; uint8_t category; }; - assert_struct_size(rct1_research_item, 5); + assert_struct_size(ResearchItem, 5); /** * RCT1,AA,LL scenario / saved game structure. * size: 0x1F850C */ - struct rct1_s4 + struct S4 { uint16_t month; uint16_t day; @@ -551,7 +551,7 @@ namespace RCT1 uint32_t random_b; RCT12TileElement tile_elements[RCT1_MAX_TILE_ELEMENTS]; uint32_t unk_counter; - rct1_sprite sprites[RCT1_MAX_SPRITES]; + Entity sprites[RCT1_MAX_SPRITES]; uint16_t next_sprite_index; uint16_t first_vehicle_sprite_index; uint16_t first_peep_sprite_index; @@ -570,7 +570,7 @@ namespace RCT1 money32 loan; uint32_t park_flags; money16 park_entrance_fee; - rct1_entrance park_entrance; + Entrance park_entrance; uint8_t unk_198849; rct12_peep_spawn peep_spawn[RCT12_MAX_PEEP_SPAWNS]; uint8_t unk_198856; @@ -600,7 +600,7 @@ namespace RCT1 uint8_t last_research_ride; uint8_t last_research_type; uint8_t last_research_flags; - rct1_research_item research_items[200]; + ResearchItem research_items[200]; uint8_t next_research_item; uint8_t next_research_ride; uint8_t next_research_type; @@ -668,12 +668,12 @@ namespace RCT1 uint8_t unk_199C96[3]; uint8_t water_colour; uint16_t unk_199C9A; - rct1_research_item research_items_LL[180]; + ResearchItem research_items_LL[180]; uint8_t unk_19A020[5468]; RCT12Banner banners[RCT1_MAX_BANNERS]; char string_table[RCT12_MAX_USER_STRINGS][RCT12_USER_STRING_MAX_LENGTH]; uint32_t game_time_counter; - rct1_ride rides[RCT12_MAX_RIDES_IN_PARK]; + Ride rides[RCT12_MAX_RIDES_IN_PARK]; uint16_t unk_game_time_counter; int16_t view_x; int16_t view_y; @@ -713,13 +713,13 @@ namespace RCT1 uint8_t unk_1F8358[432]; uint32_t expansion_pack_checksum; }; - assert_struct_size(rct1_s4, 0x1F850C); + assert_struct_size(S4, 0x1F850C); /** * Track design structure. Only for base RCT1 * size: 0x2006 */ - struct rct_track_td4 + struct TD4 { uint8_t type; // 0x00 uint8_t vehicle_type; @@ -761,13 +761,13 @@ namespace RCT1 money16 upkeep_cost; // 0x36 }; - assert_struct_size(rct_track_td4, 0x38); + assert_struct_size(TD4, 0x38); /** * Track design structure for Added Attractions / Loopy Landscapes * size: 0x2006 */ - struct rct_track_td4_aa : public rct_track_td4 + struct TD4AA : public TD4 { uint8_t track_spine_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x38 uint8_t track_rail_colour[RCT12_NUM_COLOUR_SCHEMES]; // 0x3C @@ -777,7 +777,7 @@ namespace RCT1 uint8_t pad_45[0x7F]; // 0x45 }; - assert_struct_size(rct_track_td4_aa, 0xC4); + assert_struct_size(TD4AA, 0xC4); #pragma pack(pop) enum diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 794bb48311..003ab50e48 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -117,7 +117,7 @@ namespace RCT1 { private: std::string _s4Path; - rct1_s4 _s4 = {}; + S4 _s4 = {}; uint8_t _gameVersion = 0; uint8_t _parkValueConversionFactor = 0; bool _isScenario = false; @@ -310,27 +310,27 @@ namespace RCT1 } private: - std::unique_ptr ReadAndDecodeS4(IStream* stream, bool isScenario) + std::unique_ptr ReadAndDecodeS4(IStream* stream, bool isScenario) { - auto s4 = std::make_unique(); + auto s4 = std::make_unique(); size_t dataSize = stream->GetLength() - stream->GetPosition(); auto data = stream->ReadArray(dataSize); - auto decodedData = std::make_unique(sizeof(rct1_s4)); + auto decodedData = std::make_unique(sizeof(S4)); size_t decodedSize; int32_t fileType = sawyercoding_detect_file_type(data.get(), dataSize); if (isScenario && (fileType & FILE_VERSION_MASK) != FILE_VERSION_RCT1) { - decodedSize = sawyercoding_decode_sc4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); + decodedSize = sawyercoding_decode_sc4(data.get(), decodedData.get(), dataSize, sizeof(S4)); } else { - decodedSize = sawyercoding_decode_sv4(data.get(), decodedData.get(), dataSize, sizeof(rct1_s4)); + decodedSize = sawyercoding_decode_sv4(data.get(), decodedData.get(), dataSize, sizeof(S4)); } - if (decodedSize == sizeof(rct1_s4)) + if (decodedSize == sizeof(S4)) { - std::memcpy(s4.get(), decodedData.get(), sizeof(rct1_s4)); + std::memcpy(s4.get(), decodedData.get(), sizeof(S4)); return s4; } else @@ -424,12 +424,12 @@ namespace RCT1 void AddAvailableEntriesFromResearchList() { size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); + const ResearchItem* researchList = GetResearchList(&researchListCount); std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( researchList, researchListCount); for (size_t i = 0; i < researchListCount; i++) { - const rct1_research_item* researchItem = &researchList[i]; + const ResearchItem* researchItem = &researchList[i]; if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { @@ -719,7 +719,7 @@ namespace RCT1 } } - void ImportRide(Ride* dst, rct1_ride* src, ride_id_t rideIndex) + void ImportRide(::Ride* dst, RCT1::Ride* src, ride_id_t rideIndex) { *dst = {}; dst->id = rideIndex; @@ -986,7 +986,7 @@ namespace RCT1 dst->music_tune_id = 255; } - void SetRideColourScheme(Ride* dst, rct1_ride* src) + void SetRideColourScheme(::Ride* dst, RCT1::Ride* src) { // Colours dst->colour_scheme_type = src->colour_scheme; @@ -1029,8 +1029,7 @@ namespace RCT1 for (int i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) { // RCT1 had no third colour - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1:: - GetColourSchemeCopyDescriptor(src->vehicle_type); + const auto colourSchemeCopyDescriptor = GetColourSchemeCopyDescriptor(src->vehicle_type); if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) { dst->vehicle_colours[i].Body = RCT1::GetColour(src->vehicle_colours[i].body); @@ -1128,11 +1127,11 @@ namespace RCT1 FixImportStaff(); } - void SetVehicleColours(Vehicle* dst, const rct1_vehicle* src) + void SetVehicleColours(::Vehicle* dst, const RCT1::Vehicle* src) { - rct1_ride* srcRide = &_s4.rides[src->ride]; - uint8_t vehicleTypeIndex = srcRide->vehicle_type; - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( + const auto& srcRide = _s4.rides[src->ride]; + uint8_t vehicleTypeIndex = srcRide.vehicle_type; + RCT1::VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( vehicleTypeIndex); // RCT1 had no third colour @@ -1195,7 +1194,7 @@ namespace RCT1 staff_update_greyed_patrol_areas(); } - void ImportPeep(Peep* dst, const rct1_peep* src) + void ImportPeep(::Peep* dst, const RCT1::Peep* src) { // Peep vs. staff (including which kind) dst->SpriteType = RCT1::GetPeepSpriteType(src->sprite_type); @@ -1851,7 +1850,7 @@ namespace RCT1 research_reset_items(); size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); + const RCT1::ResearchItem* researchList = GetResearchList(&researchListCount); // Initialise the "seen" tables _researchRideEntryUsed.reset(); @@ -1866,29 +1865,29 @@ namespace RCT1 bool researched = true; std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( researchList, researchListCount); - std::vector vehiclesWithMissingRideTypes; + std::vector vehiclesWithMissingRideTypes; for (size_t i = 0; i < researchListCount; i++) { - const rct1_research_item* researchItem = &researchList[i]; - if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + const auto& researchItem = researchList[i]; + if (researchItem.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE) + if (researchItem.item == RCT1_RESEARCH_END_AVAILABLE) { researched = false; continue; } // We don't import the random items yet. - else if (researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE || researchItem->item == RCT1_RESEARCH_END) + else if (researchItem.item == RCT1_RESEARCH_END_RESEARCHABLE || researchItem.item == RCT1_RESEARCH_END) { break; } } - switch (researchItem->type) + switch (researchItem.type) { case RCT1_RESEARCH_TYPE_THEME: { - uint8_t rct1SceneryTheme = researchItem->item; + uint8_t rct1SceneryTheme = researchItem.item; auto sceneryGroupEntryIndex = _sceneryThemeTypeToEntryMap[rct1SceneryTheme]; if (sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_IGNORE && sceneryGroupEntryIndex != OBJECT_ENTRY_INDEX_NULL) @@ -1899,7 +1898,7 @@ namespace RCT1 } case RCT1_RESEARCH_TYPE_RIDE: { - uint8_t rct1RideType = researchItem->item; + uint8_t rct1RideType = researchItem.item; _researchRideTypeUsed[rct1RideType] = true; auto ownRideEntryIndex = _rideTypeToRideEntryMap[rct1RideType]; @@ -1913,11 +1912,11 @@ namespace RCT1 // Add all vehicles for this ride type that are researched or before this research item for (size_t j = 0; j < researchListCount; j++) { - const rct1_research_item* researchItem2 = &researchList[j]; - if (researchItem2->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + const auto& researchItem2 = researchList[j]; + if (researchItem2.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - if (researchItem2->item == RCT1_RESEARCH_END_RESEARCHABLE - || researchItem2->item == RCT1_RESEARCH_END) + if (researchItem2.item == RCT1_RESEARCH_END_RESEARCHABLE + || researchItem2.item == RCT1_RESEARCH_END) { break; } @@ -1925,10 +1924,10 @@ namespace RCT1 continue; } - if (researchItem2->type == RCT1_RESEARCH_TYPE_VEHICLE - && researchItem2->related_ride == rct1RideType) + if (researchItem2.type == RCT1_RESEARCH_TYPE_VEHICLE + && researchItem2.related_ride == rct1RideType) { - auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2->item]; + auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2.item]; bool isOwnType = (ownRideEntryIndex == rideEntryIndex2); if (isOwnType) { @@ -1961,13 +1960,13 @@ namespace RCT1 // Only add vehicle if the related ride has been seen, this to make sure that vehicles // are researched only after the ride has been researched. Otherwise, remove them from the research // list, so that they are automatically co-invented when their master ride is invented. - if (_researchRideTypeUsed[researchItem->related_ride]) + if (_researchRideTypeUsed[researchItem.related_ride]) { InsertResearchVehicle(researchItem, researched); } - else if (!rideTypeInResearch[researchItem->related_ride] && _gameVersion == FILE_VERSION_RCT1_LL) + else if (!rideTypeInResearch[researchItem.related_ride] && _gameVersion == FILE_VERSION_RCT1_LL) { - vehiclesWithMissingRideTypes.push_back(*researchItem); + vehiclesWithMissingRideTypes.push_back(researchItem); } break; @@ -1977,9 +1976,9 @@ namespace RCT1 break; } } - for (const rct1_research_item& researchItem : vehiclesWithMissingRideTypes) + for (const auto& researchItem : vehiclesWithMissingRideTypes) { - InsertResearchVehicle(&researchItem, false); + InsertResearchVehicle(researchItem, false); } // Research funding / priority @@ -2025,7 +2024,7 @@ namespace RCT1 } else { - ResearchItem researchItem = {}; + ::ResearchItem researchItem = {}; ConvertResearchEntry(&researchItem, _s4.last_research_item, _s4.last_research_type); gResearchLastItem = researchItem; } @@ -2038,45 +2037,44 @@ namespace RCT1 } else { - ResearchItem researchItem = {}; + ::ResearchItem researchItem = {}; ConvertResearchEntry(&researchItem, _s4.next_research_item, _s4.next_research_type); gResearchNextItem = researchItem; } } static std::bitset GetRideTypesPresentInResearchList( - const rct1_research_item* researchList, size_t researchListCount) + const RCT1::ResearchItem* researchList, size_t researchListCount) { std::bitset ret = {}; for (size_t i = 0; i < researchListCount; i++) { - const rct1_research_item* researchItem = &researchList[i]; - if (researchItem->flags == RCT1_RESEARCH_FLAGS_SEPARATOR) + const auto& researchItem = researchList[i]; + if (researchItem.flags == RCT1_RESEARCH_FLAGS_SEPARATOR) { - if (researchItem->item == RCT1_RESEARCH_END_AVAILABLE - || researchItem->item == RCT1_RESEARCH_END_RESEARCHABLE) + if (researchItem.item == RCT1_RESEARCH_END_AVAILABLE || researchItem.item == RCT1_RESEARCH_END_RESEARCHABLE) { continue; } - else if (researchItem->item == RCT1_RESEARCH_END) + else if (researchItem.item == RCT1_RESEARCH_END) { break; } } - if (researchItem->type == RCT1_RESEARCH_TYPE_RIDE) + if (researchItem.type == RCT1_RESEARCH_TYPE_RIDE) { - ret[researchItem->item] = true; + ret[researchItem.item] = true; } } return ret; } - void InsertResearchVehicle(const rct1_research_item* researchItem, bool researched) + void InsertResearchVehicle(const ResearchItem& researchItem, bool researched) { - uint8_t vehicle = researchItem->item; + uint8_t vehicle = researchItem.item; auto rideEntryIndex = _vehicleTypeToRideEntryMap[vehicle]; if (!_researchRideEntryUsed[rideEntryIndex]) @@ -2150,7 +2148,7 @@ namespace RCT1 uint8_t researchItem = src->Assoc & 0x000000FF; uint8_t researchType = (src->Assoc & 0x00FF0000) >> 16; - ResearchItem tmpResearchItem = {}; + ::ResearchItem tmpResearchItem = {}; ConvertResearchEntry(&tmpResearchItem, researchItem, researchType); dst->Assoc = tmpResearchItem.rawValue; } @@ -2194,7 +2192,7 @@ namespace RCT1 gTotalRideValueForMoney = _s4.total_ride_value_for_money; } - void ConvertResearchEntry(ResearchItem* dst, uint8_t srcItem, uint8_t srcType) + void ConvertResearchEntry(::ResearchItem* dst, uint8_t srcItem, uint8_t srcType) { dst->SetNull(); if (srcType == RCT1_RESEARCH_TYPE_RIDE) @@ -2426,7 +2424,7 @@ namespace RCT1 return nullptr; } - const rct1_research_item* GetResearchList(size_t* count) + const RCT1::ResearchItem* GetResearchList(size_t* count) { // Loopy Landscapes stores research items in a different place if (_gameVersion == FILE_VERSION_RCT1_LL) @@ -2589,7 +2587,7 @@ namespace RCT1 ObjectEntryIndex GetBuildTheBestRideId() { size_t researchListCount; - const rct1_research_item* researchList = GetResearchList(&researchListCount); + const RCT1::ResearchItem* researchList = GetResearchList(&researchListCount); for (size_t i = 0; i < researchListCount; i++) { if (researchList[i].flags == 0xFF) @@ -2617,7 +2615,7 @@ namespace RCT1 output = EntityType::Vehicle; break; case RCT12SpriteIdentifier::Peep: - if (RCT12PeepType(static_cast(&src)->type) == RCT12PeepType::Guest) + if (RCT12PeepType(static_cast(&src)->type) == RCT12PeepType::Guest) { output = EntityType::Guest; } @@ -2671,10 +2669,10 @@ namespace RCT1 return output; } - template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) + template<> void S4Importer::ImportEntity<::Vehicle>(const RCT12SpriteBase& srcBase) { - auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); + auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index); + auto* src = static_cast(&srcBase); const auto* ride = get_ride(src->ride); if (ride == nullptr) return; @@ -2685,7 +2683,7 @@ namespace RCT1 dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); dst->vehicle_type = vehicleEntryIndex; - dst->SubType = Vehicle::Type(src->type); + dst->SubType = ::Vehicle::Type(src->type); dst->var_44 = src->var_44; dst->remaining_distance = src->remaining_distance; @@ -2749,16 +2747,16 @@ namespace RCT1 } } - Vehicle::Status statusSrc = Vehicle::Status::MovingToEndOfStation; - if (src->status <= static_cast(Vehicle::Status::StoppedByBlockBrakes)) + ::Vehicle::Status statusSrc = ::Vehicle::Status::MovingToEndOfStation; + if (src->status <= static_cast(::Vehicle::Status::StoppedByBlockBrakes)) { - statusSrc = static_cast(src->status); + statusSrc = static_cast<::Vehicle::Status>(src->status); } dst->status = statusSrc; dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; dst->TrackLocation = { src->track_x, src->track_y, src->track_z }; dst->current_station = src->current_station; - if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != Vehicle::Status::TravellingBoat) + if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != ::Vehicle::Status::TravellingBoat) { dst->BoatLocation.setNull(); dst->SetTrackDirection(src->GetTrackDirection()); @@ -2790,7 +2788,7 @@ namespace RCT1 template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); + auto* src = static_cast(&srcBase); ImportPeep(dst, src); dst->OutsideOfPark = static_cast(src->outside_of_park); @@ -2887,7 +2885,7 @@ namespace RCT1 template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) { auto* dst = CreateEntityAt(srcBase.sprite_index); - auto* src = static_cast(&srcBase); + auto* src = static_cast(&srcBase); ImportPeep(dst, src); dst->AssignedStaffType = StaffType(src->staff_type); dst->MechanicTimeSinceCall = src->mechanic_time_since_call; @@ -3005,7 +3003,7 @@ namespace RCT1 switch (GetEntityTypeFromRCT1Sprite(src)) { case EntityType::Vehicle: - ImportEntity(src); + ImportEntity<::Vehicle>(src); break; case EntityType::Guest: ImportEntity(src); diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index d704c09083..3974f41aea 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -95,8 +95,8 @@ namespace RCT1 std::unique_ptr ImportAA() { std::unique_ptr td = std::make_unique(); - rct_track_td4_aa td4aa{}; - _stream.Read(&td4aa, sizeof(rct_track_td4_aa)); + TD4AA td4aa{}; + _stream.Read(&td4aa, sizeof(TD4AA)); for (int32_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) { @@ -113,8 +113,8 @@ namespace RCT1 std::unique_ptr ImportTD4() { std::unique_ptr td = std::make_unique(); - rct_track_td4 td4{}; - _stream.Read(&td4, sizeof(rct_track_td4)); + TD4 td4{}; + _stream.Read(&td4, sizeof(TD4)); for (int32_t i = 0; i < NUM_COLOUR_SCHEMES; i++) { td->track_spine_colour[i] = RCT1::GetColour(td4.track_spine_colour_v0); @@ -137,7 +137,7 @@ namespace RCT1 return ImportTD4Base(std::move(td), td4); } - std::unique_ptr ImportTD4Base(std::unique_ptr td, rct_track_td4& td4Base) + std::unique_ptr ImportTD4Base(std::unique_ptr td, TD4& td4Base) { td->type = RCT1::GetRideType(td4Base.type, td4Base.vehicle_type); @@ -172,7 +172,7 @@ namespace RCT1 for (int32_t i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++) { // RCT1 had no third colour - RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( + RCT1::VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor( td4Base.vehicle_type); if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1) { diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 4fd6c5f436..af7c7fe6ef 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -275,9 +275,9 @@ namespace RCT1 return map[rideType]; } - RCT1VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType) + VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType) { - static RCT1VehicleColourSchemeCopyDescriptor map[89] = + static VehicleColourSchemeCopyDescriptor map[89] = { { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN = 0, { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN_BACKWARDS, diff --git a/src/openrct2/rct1/Tables.h b/src/openrct2/rct1/Tables.h index acb0db2006..ac263bd822 100644 --- a/src/openrct2/rct1/Tables.h +++ b/src/openrct2/rct1/Tables.h @@ -16,7 +16,7 @@ namespace RCT1 { - struct RCT1VehicleColourSchemeCopyDescriptor + struct VehicleColourSchemeCopyDescriptor { int8_t colour1, colour2, colour3; }; @@ -27,7 +27,7 @@ namespace RCT1 ObjectEntryIndex GetTerrainEdge(uint8_t terrainEdge); uint8_t GetRideType(uint8_t rideType, uint8_t vehicleType); - RCT1VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType); + VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType); bool RideTypeUsesVehicles(uint8_t rideType); bool PathIsQueue(uint8_t pathType); uint8_t NormalisePathAddition(uint8_t pathAdditionType); From 2f9e9e853e2292c4fb50a850e0f0129559745629 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 26 Aug 2021 12:54:38 +0100 Subject: [PATCH 273/681] Move further structs into correct headers --- src/openrct2/rct2/RCT2.h | 9 +++++++ src/openrct2/scenario/Scenario.h | 30 ---------------------- src/openrct2/scenario/ScenarioRepository.h | 12 +++++++++ src/openrct2/scenario/ScenarioSources.cpp | 1 + 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 14becf9d7d..dbb2cfadaa 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1037,6 +1037,15 @@ struct rct_s6_data uint8_t pad_13CE778[434]; }; assert_struct_size(rct_s6_data, 0x46b44a); + +struct rct_stex_entry +{ + rct_string_id scenario_name; // 0x00 + rct_string_id park_name; // 0x02 + rct_string_id details; // 0x04 + uint8_t var_06; +}; +assert_struct_size(rct_stex_entry, 7); #pragma pack(pop) std::vector DecryptSea(const fs::path& path); diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 1c6727146e..3d63931f9b 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -14,8 +14,6 @@ #include "../management/Finance.h" #include "../management/Research.h" #include "../object/Object.h" -#include "../rct12/RCT12.h" -#include "../rct2/RCT2.h" #include "../ride/Ride.h" #include "../ride/RideRatings.h" #include "../world/Banner.h" @@ -26,34 +24,6 @@ using random_engine_t = Random::Rct2::Engine; -enum class EditorStep : uint8_t; - -struct ParkLoadResult; - -#pragma pack(push, 1) - -enum class ScenarioSource : uint8_t -{ - RCT1, - RCT1_AA, - RCT1_LL, - RCT2, - RCT2_WW, - RCT2_TT, - Real, - Other -}; - -struct rct_stex_entry -{ - rct_string_id scenario_name; // 0x00 - rct_string_id park_name; // 0x02 - rct_string_id details; // 0x04 - uint8_t var_06; -}; -assert_struct_size(rct_stex_entry, 7); -#pragma pack(pop) - enum { SCENARIO_FLAGS_VISIBLE = (1 << 0), diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index 8d6898d464..c9ff1e12c7 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -24,6 +24,18 @@ struct scenario_highscore_entry datetime64 timestamp; }; +enum class ScenarioSource : uint8_t +{ + RCT1, + RCT1_AA, + RCT1_LL, + RCT2, + RCT2_WW, + RCT2_TT, + Real, + Other +}; + struct scenario_index_entry { utf8 path[MAX_PATH]; diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index 38f50f4c5a..584a1517b8 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -12,6 +12,7 @@ #include "../core/Guard.hpp" #include "../core/String.hpp" #include "Scenario.h" +#include "ScenarioRepository.h" #include From b97ebc745f929688ab0e3c900871584d2659aa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 27 Aug 2021 23:17:47 +0300 Subject: [PATCH 274/681] Rename rct_peep_thought to PeepThought --- src/openrct2/core/DataSerialiserTraits.h | 10 +++++----- src/openrct2/peep/Guest.cpp | 12 ++++++------ src/openrct2/peep/Peep.cpp | 3 +-- src/openrct2/peep/Peep.h | 6 +++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 3953709582..bb4b638724 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -814,27 +814,27 @@ template<> struct DataSerializerTraits_t } }; -template<> struct DataSerializerTraits_t +template<> struct DataSerializerTraits_t { - static void encode(OpenRCT2::IStream* stream, const rct_peep_thought& val) + static void encode(OpenRCT2::IStream* stream, const PeepThought& val) { stream->Write(&val.type); stream->Write(&val.item); stream->Write(&val.freshness); stream->Write(&val.fresh_timeout); } - static void decode(OpenRCT2::IStream* stream, rct_peep_thought& val) + static void decode(OpenRCT2::IStream* stream, PeepThought& val) { stream->Read(&val.type); stream->Read(&val.item); stream->Read(&val.freshness); stream->Read(&val.fresh_timeout); } - static void log(OpenRCT2::IStream* stream, const rct_peep_thought& val) + static void log(OpenRCT2::IStream* stream, const PeepThought& val) { char msg[128] = {}; snprintf( - msg, sizeof(msg), "rct_peep_thought(type = %d, item = %d, freshness = %d, freshtimeout = %d)", + msg, sizeof(msg), "PeepThought(type = %d, item = %d, freshness = %d, freshtimeout = %d)", static_cast(val.type), val.item, val.freshness, val.fresh_timeout); stream->Write(msg, strlen(msg)); } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index f85ef7f0b1..53e4792b08 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -3232,7 +3232,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type) // Remove the related thought for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; ++i) { - rct_peep_thought* thought = &Thoughts[i]; + PeepThought* thought = &Thoughts[i]; if (thought->type == PeepThoughtType::None) break; @@ -3242,7 +3242,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type) if (i < PEEP_MAX_THOUGHTS - 1) { - memmove(thought, thought + 1, sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); + memmove(thought, thought + 1, sizeof(PeepThought) * (PEEP_MAX_THOUGHTS - i - 1)); } Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None; @@ -6774,7 +6774,7 @@ bool Guest::HeadingForRideOrParkExit() const * argument_1 (esi & ebx) * argument_2 (esi+2) */ -void peep_thought_set_format_args(const rct_peep_thought* thought, Formatter& ft) +void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) { ft.Add(PeepThoughts[EnumValue(thought->type)]); @@ -6821,7 +6821,7 @@ void Guest::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgumen for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; ++i) { - rct_peep_thought* thought = &Thoughts[i]; + PeepThought* thought = &Thoughts[i]; // Remove the oldest thought by setting it to NONE. if (thought->type == PeepThoughtType::None) break; @@ -6833,13 +6833,13 @@ void Guest::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgumen // existing thought and placing it at the top. if (i < PEEP_MAX_THOUGHTS - 2) { - memmove(thought, thought + 1, sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); + memmove(thought, thought + 1, sizeof(PeepThought) * (PEEP_MAX_THOUGHTS - i - 1)); } break; } } - memmove(&Thoughts[1], &Thoughts[0], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - 1)); + memmove(&Thoughts[1], &Thoughts[0], sizeof(PeepThought) * (PEEP_MAX_THOUGHTS - 1)); Thoughts[0].type = thoughtType; Thoughts[0].item = thoughtArguments; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 48d9e7e7e8..5b1ff8ff82 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -887,8 +887,7 @@ static void peep_update_thoughts(Guest* peep) // Clear top thought, push others up if (i < PEEP_MAX_THOUGHTS - 2) { - memmove( - &peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); + memmove(&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(PeepThought) * (PEEP_MAX_THOUGHTS - i - 1)); } peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None; } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index ceab4cbde7..3a4a446898 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -485,7 +485,7 @@ enum PeepRideDecision PEEP_RIDE_DECISION_THINKING = 1 << 2, }; -struct rct_peep_thought +struct PeepThought { PeepThoughtType type; // 0 uint8_t item; // 1 @@ -703,7 +703,7 @@ public: int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance ride_id_t PreviousRide; uint16_t PreviousRideTimeOut; - std::array Thoughts; + std::array Thoughts; // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc uint8_t LitterCount; // 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc @@ -1002,7 +1002,7 @@ void peep_stop_crowd_noise(); void peep_update_crowd_noise(); void peep_update_days_in_queue(); void peep_applause(); -void peep_thought_set_format_args(const rct_peep_thought* thought, Formatter& ft); +void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft); int32_t get_peep_face_sprite_small(Guest* peep); int32_t get_peep_face_sprite_large(Guest* peep); void peep_sprite_remove(Peep* peep); From 1555a4da9f33dd9b1955aea06599c04e459f9f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:02:09 +0300 Subject: [PATCH 275/681] Modify storage of PeepThought items to 16 bit for rides and shop items --- src/openrct2/peep/Peep.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 3a4a446898..2d07b5847c 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -485,12 +485,19 @@ enum PeepRideDecision PEEP_RIDE_DECISION_THINKING = 1 << 2, }; +static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); + struct PeepThought { - PeepThoughtType type; // 0 - uint8_t item; // 1 - uint8_t freshness; // 2 larger is less fresh - uint8_t fresh_timeout; // 3 updates every tick + PeepThoughtType type; + union + { + ride_id_t rideId; + ShopItem shopItem; + uint16_t item; + }; + uint8_t freshness; // larger is less fresh + uint8_t fresh_timeout; // updates every tick }; struct Guest; From 483fb173f5bd0304fe4defb16df6b49cf36cda8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:06:29 +0300 Subject: [PATCH 276/681] Adjust S6 import/export for different thought item type --- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index be4005d824..99649fcd5b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1342,7 +1342,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src) auto srcThought = &src->Thoughts[i]; auto dstThought = &dst->thoughts[i]; dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; + dstThought->item = static_cast(srcThought->item); dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d331e309ad..0bf43eb635 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1721,7 +1721,10 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) auto srcThought = &src->thoughts[i]; auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; + if (srcThought->item == 0xFF) + dstThought->item = PeepThoughtItemNone; + else + dstThought->item = srcThought->item; dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } From a5931921bf9278adeea68192f456010ea82621d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:07:22 +0300 Subject: [PATCH 277/681] Small clean up --- src/openrct2/peep/Guest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 53e4792b08..aeb76dc25f 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6781,7 +6781,7 @@ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) PeepThoughtToActionFlag flags = PeepThoughtToActionMap[EnumValue(thought->type)].flags; if (flags & PEEP_THOUGHT_ACTION_FLAG_RIDE) { - auto ride = get_ride(thought->item); + auto ride = get_ride(thought->rideId); if (ride != nullptr) { ride->FormatNameTo(ft); @@ -6793,11 +6793,11 @@ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR) { - ft.Add(GetShopItemDescriptor(ShopItem(thought->item)).Naming.Singular); + ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Singular); } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_INDEFINITE) { - ft.Add(GetShopItemDescriptor(ShopItem(thought->item)).Naming.Indefinite); + ft.Add(GetShopItemDescriptor(thought->shopItem).Naming.Indefinite); } } From bab646de6e365b890fe8b17622462626ffaec24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 15:12:32 +0300 Subject: [PATCH 278/681] Add RCT12PeepThoughtItemNone constant --- src/openrct2/rct12/RCT12.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 4652c88625..53982f8e18 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -88,6 +88,8 @@ constexpr const uint16_t RCT12_PEEP_SPAWN_UNDEFINED = 0xFFFF; constexpr const uint16_t RCT12VehicleTrackDirectionMask = 0b0000000000000011; constexpr const uint16_t RCT12VehicleTrackTypeMask = 0b1111111111111100; +constexpr const uint8_t RCT12PeepThoughtItemNone = std::numeric_limits::max(); + enum class RCT12TrackDesignVersion : uint8_t { TD4, From 77dccb995c8c737474ad65feec05f04e83093118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 15:13:07 +0300 Subject: [PATCH 279/681] Use RCT12PeepThoughtItemNone for importers --- src/openrct2/rct1/S4Importer.cpp | 5 ++++- src/openrct2/rct2/S6Importer.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 7e24d90b54..dcdca4c08e 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2846,7 +2846,10 @@ namespace RCT1 auto srcThought = &src->thoughts[i]; auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; + if (srcThought->item == RCT12PeepThoughtItemNone) + dstThought->item = PeepThoughtItemNone; + else + dstThought->item = srcThought->item; dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 0bf43eb635..ae440fa402 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1721,7 +1721,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) auto srcThought = &src->thoughts[i]; auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); - if (srcThought->item == 0xFF) + if (srcThought->item == RCT12PeepThoughtItemNone) dstThought->item = PeepThoughtItemNone; else dstThought->item = srcThought->item; From e9c959b187dca896c9cfa20bc8112afca0e418e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 30 Aug 2021 18:33:48 +0300 Subject: [PATCH 280/681] Test correct fields in the gamestate snapshot --- src/openrct2/GameStateSnapshots.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index f6e1f53d19..0090e08e09 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -337,7 +337,10 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Guest, PreviousRideTimeOut); for (int i = 0; i < PEEP_MAX_THOUGHTS; i++) { - COMPARE_FIELD(Guest, Thoughts[i]); + COMPARE_FIELD(Guest, Thoughts[i].type); + COMPARE_FIELD(Guest, Thoughts[i].item); + COMPARE_FIELD(Guest, Thoughts[i].freshness); + COMPARE_FIELD(Guest, Thoughts[i].fresh_timeout); } COMPARE_FIELD(Guest, GuestHeadingToRideId); COMPARE_FIELD(Guest, GuestIsLostCountdown); From 336372c7beb659d8d76907e22c12b22947ab3620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:42:23 +0300 Subject: [PATCH 281/681] Adjust InsertThought overloads to use correct constants --- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2/peep/Guest.cpp | 46 +++++++++++++++++++------------ src/openrct2/peep/Peep.cpp | 12 ++++---- src/openrct2/peep/Peep.h | 4 ++- 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 52da711226..a52a0ee43c 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1100,7 +1100,7 @@ void window_guest_overview_update(rct_window* w) int32_t random = util_rand() & 0xFFFF; if (random <= 0x2AAA) { - peep->InsertNewThought(PeepThoughtType::Watched, PEEP_THOUGHT_ITEM_NONE); + peep->InsertNewThought(PeepThoughtType::Watched); } } } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index aeb76dc25f..bcb958d5bc 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -889,7 +889,7 @@ void Guest::Tick128UpdateGuest(int32_t index) PeepThoughtType thought_type = crowded_thoughts[scenario_rand() & 0xF]; if (thought_type != PeepThoughtType::None) { - InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(thought_type); } } @@ -950,7 +950,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (thought_type != PeepThoughtType::None) { - InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(thought_type); HappinessTarget = std::min(PEEP_MAX_HAPPINESS, HappinessTarget + 45); } } @@ -965,7 +965,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (PeepFlags & PEEP_FLAGS_WOW) { - InsertNewThought(PeepThoughtType::Wow2, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::Wow2); } if (GuestTimeOnRide > 15) @@ -1070,7 +1070,7 @@ void Guest::Tick128UpdateGuest(int32_t index) { PeepThoughtType chosen_thought = possible_thoughts[scenario_rand() % num_thoughts]; - InsertNewThought(chosen_thought, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(chosen_thought); switch (chosen_thought) { @@ -1106,7 +1106,7 @@ void Guest::Tick128UpdateGuest(int32_t index) thought_type = PeepThoughtType::VerySick; peep_head_for_nearest_ride_type(this, RIDE_TYPE_FIRST_AID); } - InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(thought_type); } } @@ -1379,7 +1379,7 @@ void Guest::CheckIfLost() return; TimeLost = 230; } - InsertNewThought(PeepThoughtType::Lost, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::Lost); HappinessTarget = std::max(HappinessTarget - 30, 0); } @@ -1429,7 +1429,7 @@ void Guest::CheckCantFindExit() // Peeps who can't find the park exit will continue to get less happy until they find it. if (GuestIsLostCountdown == 1) { - InsertNewThought(PeepThoughtType::CantFindExit, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::CantFindExit); HappinessTarget = std::max(HappinessTarget - 30, 0); } @@ -1495,13 +1495,13 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price) if (GetShopItemDescriptor(shopItem).IsFood() && (Hunger > 75)) { - InsertNewThought(PeepThoughtType::NotHungry, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::NotHungry); return false; } if (GetShopItemDescriptor(shopItem).IsDrink() && (Thirst > 75)) { - InsertNewThought(PeepThoughtType::NotThirsty, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::NotThirsty); return false; } @@ -1517,7 +1517,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price) { if (CashInPocket == 0) { - InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::SpentMoney); return false; } if (price > CashInPocket) @@ -1991,7 +1991,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t { if (CashInPocket <= 0) { - InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::SpentMoney); } else { @@ -2235,7 +2235,7 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop) { if (CashInPocket <= 0) { - InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::SpentMoney); } else { @@ -2584,7 +2584,7 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r if (peep->CashInPocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - peep->InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE); + peep->InsertNewThought(PeepThoughtType::SpentMoney); peep_update_ride_at_entrance_try_leave(peep); return false; } @@ -3070,7 +3070,7 @@ static void peep_leave_park(Guest* peep) peep->PeepFlags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN; } - peep->InsertNewThought(PeepThoughtType::GoHome, PEEP_THOUGHT_ITEM_NONE); + peep->InsertNewThought(PeepThoughtType::GoHome); rct_window* w = window_find_by_number(WC_PEEP, peep->sprite_index); if (w != nullptr) @@ -5425,11 +5425,11 @@ void Guest::UpdateWalking() if (CurrentSeat & 1) { - InsertNewThought(PeepThoughtType::NewRide, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::NewRide); } if (CurrentRide == RIDE_ID_NULL) { - InsertNewThought(PeepThoughtType::Scenery, PEEP_THOUGHT_ITEM_NONE); + InsertNewThought(PeepThoughtType::Scenery); } } @@ -6801,6 +6801,16 @@ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) } } +void Guest::InsertNewThought(PeepThoughtType thought_type) +{ + InsertNewThought(thought_type, PeepThoughtItemNone); +} + +void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) +{ + InsertNewThought(thought_type, static_cast(shopItem)); +} + /** * * rct2: 0x699F5A @@ -6808,7 +6818,7 @@ void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft) * ah:thoughtArguments * esi: peep */ -void Guest::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArguments) +void Guest::InsertNewThought(PeepThoughtType thoughtType, uint16_t thoughtArguments) { PeepActionType newAction = PeepThoughtToActionMap[EnumValue(thoughtType)].action; if (newAction != PeepActionType::Walking && IsActionInterruptable()) @@ -7459,6 +7469,6 @@ void Guest::RemoveRideFromMemory(ride_id_t rideId) // Last slot is now free. auto& lastEntry = Thoughts.back(); lastEntry.type = PeepThoughtType::None; - lastEntry.item = PEEP_THOUGHT_ITEM_NONE; + lastEntry.item = PeepThoughtItemNone; } } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 5b1ff8ff82..7b1d0e5b3e 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -752,7 +752,7 @@ void Peep::UpdateFalling() { // Drop balloon if held peep_release_balloon(guest, height); - guest->InsertNewThought(PeepThoughtType::Drowning, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::Drowning); } Action = PeepActionType::Drowning; @@ -844,7 +844,7 @@ void Peep::UpdatePicked() auto* guest = As(); if (SubState == 13 && guest != nullptr) { - guest->InsertNewThought(PeepThoughtType::Help, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::Help); } } @@ -1934,7 +1934,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool { if ((scenario_rand() & 0xFFFF) <= 10922) { - guest->InsertNewThought(PeepThoughtType::Vandalism, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::Vandalism); guest->HappinessTarget = std::max(0, guest->HappinessTarget - 17); } vandalThoughtTimeout = 3; @@ -1979,7 +1979,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool if (crowded >= 10 && guest->State == PeepState::Walking && (scenario_rand() & 0xFFFF) <= 21845) { - guest->InsertNewThought(PeepThoughtType::Crowded, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::Crowded); guest->HappinessTarget = std::max(0, guest->HappinessTarget - 14); } @@ -2005,7 +2005,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool if (total_sick >= 3 && (scenario_rand() & 0xFFFF) <= 10922) { - guest->InsertNewThought(PeepThoughtType::PathDisgusting, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::PathDisgusting); guest->HappinessTarget = std::max(0, guest->HappinessTarget - 17); // Reset disgusting time guest->DisgustingCount |= 0xC0; @@ -2031,7 +2031,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool if (total_litter >= 3 && (scenario_rand() & 0xFFFF) <= 10922) { - guest->InsertNewThought(PeepThoughtType::BadLitter, PEEP_THOUGHT_ITEM_NONE); + guest->InsertNewThought(PeepThoughtType::BadLitter); guest->HappinessTarget = std::max(0, guest->HappinessTarget - 17); // Reset litter time guest->LitterCount |= 0xC0; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 2d07b5847c..08968345c1 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -773,7 +773,9 @@ public: void HandleEasterEggName(); int32_t GetEasterEggNameId() const; void UpdateEasterEggInteractions(); - void InsertNewThought(PeepThoughtType thought_type, uint8_t thought_arguments); + void InsertNewThought(PeepThoughtType thought_type); + void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); + void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); static Guest* Generate(const CoordsXYZ& coords); bool UpdateQueuePosition(PeepActionType previous_action); void RemoveFromQueue(); From 9be3a39ddd3eb2a7d5887d55ec398ab1d9d7d2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:42:44 +0300 Subject: [PATCH 282/681] Remove old constant PEEP_THOUGHT_ITEM_NONE --- src/openrct2/peep/Peep.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 08968345c1..5165766865 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -24,7 +24,6 @@ #include #define PEEP_MAX_THOUGHTS 5 -#define PEEP_THOUGHT_ITEM_NONE 255 #define PEEP_HUNGER_WARNING_THRESHOLD 25 #define PEEP_THIRST_WARNING_THRESHOLD 25 From a2827dc50ed6956d2c92b4129e03b872f80156bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 30 Aug 2021 21:23:47 +0300 Subject: [PATCH 283/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4b1b1df2c..d7e6e4d0bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.48") +set(REPLAYS_VERSION "0.0.49") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "6ED73C32BD62B9C6DA09FCE3426EC8E30CA59762") +set(REPLAYS_SHA1 "004AE4D38D1326913AF5DE7A90E8AF31DD31BF94") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 51fd1c75ac..294fb087f3 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.48/replays.zip - 6ED73C32BD62B9C6DA09FCE3426EC8E30CA59762 + https://github.com/OpenRCT2/replays/releases/download/v0.0.49/replays.zip + 004AE4D38D1326913AF5DE7A90E8AF31DD31BF94 From c8bed6fa87f7518cf272b11cd21ff2712a7f1cdc Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:32:57 -0700 Subject: [PATCH 284/681] tower rides and slide --- src/openrct2/ride/TrackPaint.cpp | 22 +++++++++++++++++++ src/openrct2/ride/TrackPaint.h | 3 +++ src/openrct2/ride/gentle/ObservationTower.cpp | 10 ++++++--- src/openrct2/ride/gentle/SpiralSlide.cpp | 13 +++++++++-- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 15 +++++++------ src/openrct2/ride/thrill/RotoDrop.cpp | 10 ++++++--- 6 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 3129a1c031..b2529b4da2 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -119,6 +119,20 @@ const uint32_t floorSpritesCork[] = { SPR_FLOOR_CORK }; +const uint32_t floorSpritesMetal[] = { + SPR_FLOOR_METAL, + SPR_FLOOR_METAL, + SPR_FLOOR_METAL, + SPR_FLOOR_METAL +}; + +const uint32_t floorSpritesMetalB[] = { + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B, + SPR_FLOOR_METAL_B +}; + const uint32_t fenceSpritesRope[] = { SPR_FENCE_ROPE_NE, SPR_FENCE_ROPE_SE, @@ -126,6 +140,14 @@ const uint32_t fenceSpritesRope[] = { SPR_FENCE_ROPE_NW }; +const uint32_t fenceSpritesMetal[] = { + SPR_FENCE_METAL_NE, + SPR_FENCE_METAL_SE, + SPR_FENCE_METAL_SW, + SPR_FENCE_METAL_NW +}; + + const uint32_t fenceSpritesMetalB[] = { SPR_FENCE_METAL_B_NE, SPR_FENCE_METAL_B_SE, diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 5f7139116e..6c28ff0e73 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -240,8 +240,11 @@ enum }; extern const uint32_t floorSpritesCork[]; +extern const uint32_t floorSpritesMetal[]; +extern const uint32_t floorSpritesMetalB[]; extern const uint32_t fenceSpritesRope[]; +extern const uint32_t fenceSpritesMetal[]; extern const uint32_t fenceSpritesMetalB[]; extern const uint32_t trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3]; diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index ac23f41455..375d460b17 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -94,8 +94,12 @@ static void paint_observation_tower_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetalB, stationObject); if (ride != nullptr) { @@ -106,7 +110,7 @@ static void paint_observation_tower_base( if (trackSequence == 0) { - imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; + uint32_t imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 8e895952f9..caff183ff1 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -12,6 +12,7 @@ #include "../../paint/Supports.h" #include "../Track.h" #include "../TrackPaint.h" +#include "../../object/StationObject.h" enum { @@ -201,8 +202,16 @@ static void paint_spiral_slide( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); // Base - uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + if(stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) + | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + } if (ride != nullptr) { diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 9309b5262e..d9dd4c7ae3 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -24,9 +24,6 @@ enum SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP = 14566, }; -static constexpr const uint32_t launched_freefall_fence_sprites[] = { SPR_FENCE_METAL_NE, SPR_FENCE_METAL_SE, - SPR_FENCE_METAL_SW, SPR_FENCE_METAL_NW }; - /** * * rct2: 0x006D5FAB @@ -96,19 +93,23 @@ static void paint_launched_freefall_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetal, stationObject); if (ride != nullptr) { track_paint_util_paint_fences( session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_TRACK], height, - launched_freefall_fence_sprites, session->CurrentRotation); + fenceSpritesMetal, session->CurrentRotation); } if (trackSequence == 0) { - imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; + uint32_t imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); height += 32; diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 0ff5bf1f9f..e2a7f15dd3 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -106,8 +106,12 @@ static void paint_roto_drop_base( wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + track_paint_util_paint_floor( + session, edges, session->TrackColours[SCHEME_SUPPORTS], height, floorSpritesMetalB, stationObject); if (ride != nullptr) { @@ -118,7 +122,7 @@ static void paint_roto_drop_base( if (trackSequence == 0) { - imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) + uint32_t imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); From c248c8fada759c46a3de9874d18f0afaf8c81e42 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:38:37 -0700 Subject: [PATCH 285/681] format spiralslide --- src/openrct2/ride/gentle/SpiralSlide.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index caff183ff1..6e98da0ee9 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -8,11 +8,11 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../Track.h" #include "../TrackPaint.h" -#include "../../object/StationObject.h" enum { @@ -206,7 +206,7 @@ static void paint_spiral_slide( if (ride != nullptr) stationObject = ride_get_station_object(ride); - if(stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { uint32_t imageId = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | session->TrackColours[SCHEME_SUPPORTS]; From 77d546f39d7ec5621bf0831cc3f1da5538b38b38 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Mon, 30 Aug 2021 23:56:56 -0700 Subject: [PATCH 286/681] dodgems and flying saucers --- src/openrct2/ride/gentle/Dodgems.cpp | 78 ++++++++++++---------- src/openrct2/ride/gentle/FlyingSaucers.cpp | 12 +++- 2 files changed, 53 insertions(+), 37 deletions(-) diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index c960e9caf2..fc2a81f38b 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../util/Util.h" @@ -47,45 +48,52 @@ static void paint_dodgems( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); - + StationObject* stationObject = nullptr; if (ride != nullptr) - { - track_paint_util_paint_fences( - session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, - dodgems_fence_sprites, session->CurrentRotation); - } + stationObject = ride_get_station_object(ride); - switch (direction) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - case 2: - trackSequence = 15 - trackSequence; - [[fallthrough]]; - case 0: - if ((trackSequence / 4) & 1) - { - paint_dodgems_roof(session, height + 30, 0); - } - else - { - paint_dodgems_roof(session, height + 30, 2); - } - break; + uint32_t imageId = SPR_DODGEMS_FLOOR | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); - case 3: - trackSequence = 15 - trackSequence; - [[fallthrough]]; - case 1: - if ((trackSequence / 4) & 1) - { - paint_dodgems_roof(session, height + 30, 1); - } - else - { - paint_dodgems_roof(session, height + 30, 3); - } - break; + if (ride != nullptr) + { + track_paint_util_paint_fences( + session, edges, session->MapPosition, trackElement, ride, session->TrackColours[SCHEME_SUPPORTS], height, + dodgems_fence_sprites, session->CurrentRotation); + } + + switch (direction) + { + case 2: + trackSequence = 15 - trackSequence; + [[fallthrough]]; + case 0: + if ((trackSequence / 4) & 1) + { + paint_dodgems_roof(session, height + 30, 0); + } + else + { + paint_dodgems_roof(session, height + 30, 2); + } + break; + + case 3: + trackSequence = 15 - trackSequence; + [[fallthrough]]; + case 1: + if ((trackSequence / 4) & 1) + { + paint_dodgems_roof(session, height + 30, 1); + } + else + { + paint_dodgems_roof(session, height + 30, 3); + } + break; + } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, height + 36, 0x20); diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index bb974de89b..f19348b83b 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../Track.h" @@ -42,8 +43,15 @@ static void paint_flying_saucers( wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC]); - uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = SPR_FLYING_SAUCERS_FLOOR | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + } if (ride != nullptr) { From bb1d3ab6379cdbf9daad3a46963c1973170bc2c0 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 31 Aug 2021 00:08:03 -0700 Subject: [PATCH 287/681] swinging rides --- src/openrct2/ride/thrill/MagicCarpet.cpp | 11 +- .../ride/thrill/SwingingInverterShip.cpp | 48 +++-- src/openrct2/ride/thrill/SwingingShip.cpp | 175 ++++++++++-------- 3 files changed, 133 insertions(+), 101 deletions(-) diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 44d609520f..36b1e2fc6e 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -237,9 +238,15 @@ static void paint_magic_carpet( metal_a_supports_paint_setup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); - uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + uint32_t imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } break; } diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 4972e34039..faca18d95b 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -129,6 +130,10 @@ static void paint_swinging_inverter_ship( uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; uint32_t imageId; + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + if (relativeTrackSequence != 1 && relativeTrackSequence != 3) { if (direction & 1) @@ -142,27 +147,30 @@ static void paint_swinging_inverter_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } - imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); - - switch (direction) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - case 0: - imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); - break; - case 1: - imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); - break; - case 2: - imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height); - break; - case 3: - imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height); - break; + imageId = SPR_STATION_BASE_D | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + + switch (direction) + { + case 0: + imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); + break; + case 1: + imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); + break; + case 2: + imageId = SPR_STATION_PLATFORM_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height); + break; + case 3: + imageId = SPR_STATION_PLATFORM_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height); + break; + } } } diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 2ee85c3713..a923b133b7 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../../interface/Viewport.h" +#include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Entity.h" @@ -184,6 +185,10 @@ static void paint_swinging_ship( uint32_t imageId; bool hasFence; + StationObject* stationObject = nullptr; + if (ride != nullptr) + stationObject = ride_get_station_object(ride); + if (relativeTrackSequence == 1 || relativeTrackSequence == 4) { wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]); @@ -193,111 +198,123 @@ static void paint_swinging_ship( metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); - imageId = SPR_STATION_BASE_A_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + imageId = SPR_STATION_BASE_A_NW_SE | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } } else { metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); - imageId = SPR_STATION_BASE_A_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) + { + imageId = SPR_STATION_BASE_A_SW_NE | session->TrackColours[SCHEME_SUPPORTS]; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); + } } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - if (direction & 1) + if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - if (relativeTrackSequence != 1 && relativeTrackSequence != 4) + if (direction & 1) { - hasFence = track_paint_util_has_fence(EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 2) + if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - } - else - { - imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - } - PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height + 9); - - imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) - | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); - - hasFence = track_paint_util_has_fence(EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 3) - { - if (hasFence) + hasFence = track_paint_util_has_fence( + EDGE_NE, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 2) { - imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + } + else + { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + } + PaintAddImageAsChild(session, imageId, 0, 0, 8, 32, 1, height + 9, 0, -2, height + 9); + + imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE) + | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 24, 0, height + 9 }, { 8, 32, 1 }); + + hasFence = track_paint_util_has_fence( + EDGE_SW, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 3) + { + if (hasFence) + { + imageId = SPR_STATION_BEGIN_ANGLE_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); + } + else + { + imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 23, 31, height + 11 }, { 8, 1, 7 }); + } + + imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 8, 1, 7 }); + } + else if (hasFence) + { + imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } - else - { - imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 23, 31, height + 11 }, { 8, 1, 7 }); - } - - imageId = SPR_STATION_FENCE_SMALL_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 8, 1, 7 }); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 32, 7 }); } } - } - else - { - if (relativeTrackSequence != 1 && relativeTrackSequence != 4) + else { - hasFence = track_paint_util_has_fence(EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 2) + if (relativeTrackSequence != 1 && relativeTrackSequence != 4) { - imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - } - else - { - imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - } - PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height + 9); - - imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) - | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); - - hasFence = track_paint_util_has_fence(EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); - if (relativeTrackSequence == 3) - { - if (hasFence) + hasFence = track_paint_util_has_fence( + EDGE_NW, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 2) { - imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + } + else + { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + } + PaintAddImageAsChild(session, imageId, 0, 0, 32, 8, 1, height + 9, -2, 0, height + 9); + + imageId = (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE) + | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 24, height + 9 }, { 32, 8, 1 }); + + hasFence = track_paint_util_has_fence( + EDGE_SE, session->MapPosition, trackElement, ride, session->CurrentRotation); + if (relativeTrackSequence == 3) + { + if (hasFence) + { + imageId = SPR_STATION_BEGIN_ANGLE_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); + } + else + { + imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 23, height + 11 }, { 1, 8, 7 }); + } + + imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; + PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 8, 7 }); + } + else if (hasFence) + { + imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } - else - { - imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 23, height + 11 }, { 1, 8, 7 }); - } - - imageId = SPR_STATION_FENCE_SMALL_NW_SE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 31, 0, height + 11 }, { 1, 8, 7 }); - } - else if (hasFence) - { - imageId = SPR_STATION_FENCE_SW_NE | session->TrackColours[SCHEME_TRACK]; - PaintAddImageAsParent(session, imageId, { 0, 31, height + 11 }, { 32, 1, 7 }); } } } - switch (relativeTrackSequence) { case 1: From b2d0b54d135e1b82899e0e96affbf265c781179a Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 1 Sep 2021 06:15:45 +0100 Subject: [PATCH 288/681] Fix viewport interaction when zoomed (#15318) Mistake made when increasing the type size from 16 to 32bit --- src/openrct2/interface/Viewport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index dc0724ae3a..3b6fc35b4b 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -1720,8 +1720,8 @@ InteractionInfo get_map_coordinates_from_pos_window(rct_window* window, const Sc viewLoc += myviewport->viewPos; if (myviewport->zoom > 0) { - viewLoc.x &= (0xFFFF * myviewport->zoom) & 0xFFFF; - viewLoc.y &= (0xFFFF * myviewport->zoom) & 0xFFFF; + viewLoc.x &= (0xFFFFFFFF * myviewport->zoom) & 0xFFFFFFFF; + viewLoc.y &= (0xFFFFFFFF * myviewport->zoom) & 0xFFFFFFFF; } rct_drawpixelinfo dpi; dpi.x = viewLoc.x; From 3c451a4af4648cd8fd52eefe8a90b3e63bb181c3 Mon Sep 17 00:00:00 2001 From: Ted John Date: Wed, 1 Sep 2021 10:16:44 +0200 Subject: [PATCH 289/681] Use music objects instead of IDs --- src/openrct2/actions/RideCreateAction.cpp | 29 ++++++++---- src/openrct2/object/ObjectManager.cpp | 20 ++++++++ src/openrct2/object/ObjectManager.h | 2 + src/openrct2/rct1/S4Importer.cpp | 36 +++++++++------ src/openrct2/rct12/RCT12.cpp | 46 +++++++++++++++++++ src/openrct2/rct12/RCT12.h | 1 + src/openrct2/rct2/S6Importer.cpp | 7 ++- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideData.h | 18 +++++++- .../coaster/meta/AirPoweredVerticalCoaster.h | 2 +- .../ride/coaster/meta/BobsleighCoaster.h | 2 +- .../coaster/meta/ClassicMiniRollerCoaster.h | 2 +- .../coaster/meta/CompactInvertedCoaster.h | 2 +- .../coaster/meta/CorkscrewRollerCoaster.h | 2 +- .../ride/coaster/meta/FlyingRollerCoaster.h | 4 +- src/openrct2/ride/coaster/meta/GigaCoaster.h | 2 +- .../coaster/meta/HeartlineTwisterCoaster.h | 2 +- .../ride/coaster/meta/HybridCoaster.h | 2 +- src/openrct2/ride/coaster/meta/HyperTwister.h | 2 +- src/openrct2/ride/coaster/meta/Hypercoaster.h | 2 +- .../coaster/meta/InvertedHairpinCoaster.h | 2 +- .../coaster/meta/InvertedImpulseCoaster.h | 2 +- .../ride/coaster/meta/InvertedRollerCoaster.h | 2 +- .../ride/coaster/meta/JuniorRollerCoaster.h | 2 +- .../coaster/meta/LIMLaunchedRollerCoaster.h | 2 +- .../ride/coaster/meta/LayDownRollerCoaster.h | 4 +- .../ride/coaster/meta/LoopingRollerCoaster.h | 2 +- src/openrct2/ride/coaster/meta/MineRide.h | 2 +- .../ride/coaster/meta/MineTrainCoaster.h | 2 +- .../ride/coaster/meta/MiniRollerCoaster.h | 2 +- .../ride/coaster/meta/MiniSuspendedCoaster.h | 2 +- .../meta/MultiDimensionRollerCoaster.h | 4 +- .../coaster/meta/ReverseFreefallCoaster.h | 2 +- .../ride/coaster/meta/ReverserRollerCoaster.h | 2 +- .../coaster/meta/SideFrictionRollerCoaster.h | 2 +- .../coaster/meta/SingleRailRollerCoaster.h | 2 +- .../ride/coaster/meta/SpinningWildMouse.h | 2 +- .../ride/coaster/meta/SpiralRollerCoaster.h | 2 +- .../ride/coaster/meta/StandUpRollerCoaster.h | 2 +- .../ride/coaster/meta/SteelWildMouse.h | 2 +- src/openrct2/ride/coaster/meta/Steeplechase.h | 2 +- .../coaster/meta/SuspendedSwingingCoaster.h | 2 +- .../ride/coaster/meta/TwisterRollerCoaster.h | 2 +- .../ride/coaster/meta/VerticalDropCoaster.h | 2 +- src/openrct2/ride/coaster/meta/VirginiaReel.h | 2 +- src/openrct2/ride/coaster/meta/WaterCoaster.h | 2 +- .../ride/coaster/meta/WoodenRollerCoaster.h | 2 +- .../ride/coaster/meta/WoodenWildMouse.h | 2 +- src/openrct2/ride/gentle/meta/CarRide.h | 2 +- src/openrct2/ride/gentle/meta/Circus.h | 2 +- src/openrct2/ride/gentle/meta/CrookedHouse.h | 2 +- src/openrct2/ride/gentle/meta/Dodgems.h | 2 +- src/openrct2/ride/gentle/meta/FerrisWheel.h | 2 +- src/openrct2/ride/gentle/meta/FlyingSaucers.h | 2 +- src/openrct2/ride/gentle/meta/GhostTrain.h | 2 +- src/openrct2/ride/gentle/meta/HauntedHouse.h | 2 +- src/openrct2/ride/gentle/meta/Maze.h | 2 +- src/openrct2/ride/gentle/meta/MerryGoRound.h | 2 +- src/openrct2/ride/gentle/meta/MiniGolf.h | 2 +- .../ride/gentle/meta/MiniHelicopters.h | 2 +- .../ride/gentle/meta/MonorailCycles.h | 2 +- src/openrct2/ride/gentle/meta/MonsterTrucks.h | 2 +- .../ride/gentle/meta/ObservationTower.h | 2 +- src/openrct2/ride/gentle/meta/SpaceRings.h | 2 +- src/openrct2/ride/gentle/meta/SpiralSlide.h | 2 +- src/openrct2/ride/shops/meta/CashMachine.h | 2 +- src/openrct2/ride/shops/meta/DrinkStall.h | 2 +- src/openrct2/ride/shops/meta/FirstAid.h | 2 +- src/openrct2/ride/shops/meta/FoodStall.h | 2 +- .../ride/shops/meta/InformationKiosk.h | 2 +- src/openrct2/ride/shops/meta/Shop.h | 2 +- src/openrct2/ride/shops/meta/Toilets.h | 2 +- src/openrct2/ride/thrill/meta/3DCinema.h | 2 +- src/openrct2/ride/thrill/meta/Enterprise.h | 2 +- src/openrct2/ride/thrill/meta/GoKarts.h | 2 +- .../ride/thrill/meta/LaunchedFreefall.h | 2 +- src/openrct2/ride/thrill/meta/MagicCarpet.h | 2 +- .../ride/thrill/meta/MotionSimulator.h | 2 +- src/openrct2/ride/thrill/meta/RotoDrop.h | 2 +- .../ride/thrill/meta/SwingingInverterShip.h | 2 +- src/openrct2/ride/thrill/meta/SwingingShip.h | 2 +- src/openrct2/ride/thrill/meta/TopSpin.h | 2 +- src/openrct2/ride/thrill/meta/Twist.h | 2 +- src/openrct2/ride/transport/meta/Chairlift.h | 2 +- src/openrct2/ride/transport/meta/Lift.h | 2 +- .../ride/transport/meta/MiniatureRailway.h | 2 +- src/openrct2/ride/transport/meta/Monorail.h | 2 +- .../ride/transport/meta/SuspendedMonorail.h | 2 +- src/openrct2/ride/water/meta/BoatHire.h | 2 +- src/openrct2/ride/water/meta/DinghySlide.h | 2 +- src/openrct2/ride/water/meta/LogFlume.h | 2 +- src/openrct2/ride/water/meta/RiverRafts.h | 2 +- src/openrct2/ride/water/meta/RiverRapids.h | 2 +- src/openrct2/ride/water/meta/SplashBoats.h | 2 +- src/openrct2/ride/water/meta/SubmarineRide.h | 2 +- 95 files changed, 223 insertions(+), 116 deletions(-) diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 3b57344c95..f142b1729f 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -10,11 +10,13 @@ #include "RideCreateAction.h" #include "../Cheats.h" +#include "../Context.h" #include "../core/Memory.hpp" #include "../core/MemoryStream.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/StringIds.h" +#include "../object/ObjectManager.h" #include "../rct1/RCT1.h" #include "../ride/Ride.h" #include "../ride/RideData.h" @@ -167,16 +169,25 @@ GameActions::Result::Ptr RideCreateAction::Execute() const ride->min_waiting_time = 10; ride->max_waiting_time = 60; ride->depart_flags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3; - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)) - { - ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; - } - ride->music = ride->GetRideTypeDescriptor().DefaultMusic; - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + ride->music = objManager.GetLoadedObjectEntryIndex(rtd.DefaultMusic); + if (ride->music != OBJECT_ENTRY_INDEX_NULL) + { + if (rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)) + { + ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + } + } + } + + const auto& operatingSettings = rtd.OperatingSettings; ride->operation_option = (operatingSettings.MinValue * 3 + operatingSettings.MaxValue) / 4; - ride->lift_hill_speed = ride->GetRideTypeDescriptor().LiftData.minimum_speed; + ride->lift_hill_speed = rtd.LiftData.minimum_speed; ride->measurement = {}; ride->excitement = RIDE_RATING_UNDEFINED; @@ -193,7 +204,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const { for (auto i = 0; i < NUM_SHOP_ITEMS_PER_RIDE; i++) { - ride->price[i] = ride->GetRideTypeDescriptor().DefaultPrices[i]; + ride->price[i] = rtd.DefaultPrices[i]; } if (rideEntry->shop_item[0] == ShopItem::None) @@ -245,7 +256,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const } // Set the on-ride photo price, whether the ride has one or not (except shops). - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo)) + if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo)) { money32 price = shop_item_get_common_price(ride, ShopItem::Photo); if (price != MONEY32_UNDEFINED) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index b72f6c0bd8..e32acc427f 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -91,6 +91,26 @@ public: return loadedObject; } + ObjectEntryIndex GetLoadedObjectEntryIndex(std::string_view identifier) override + { + const auto* obj = GetLoadedObject(ObjectEntryDescriptor(identifier)); + if (obj != nullptr) + { + return GetLoadedObjectEntryIndex(obj); + } + return OBJECT_ENTRY_INDEX_NULL; + } + + ObjectEntryIndex GetLoadedObjectEntryIndex(const ObjectEntryDescriptor& descriptor) override + { + auto obj = GetLoadedObject(descriptor); + if (obj != nullptr) + { + return GetLoadedObjectEntryIndex(obj); + } + return OBJECT_ENTRY_INDEX_NULL; + } + ObjectEntryIndex GetLoadedObjectEntryIndex(const Object* object) override { ObjectEntryIndex result = OBJECT_ENTRY_INDEX_NULL; diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 1dbf7fc2a5..38329a6e9b 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -27,6 +27,8 @@ struct IObjectManager virtual Object* GetLoadedObject(size_t index) abstract; virtual Object* GetLoadedObject(ObjectType objectType, size_t index) abstract; virtual Object* GetLoadedObject(const ObjectEntryDescriptor& entry) abstract; + virtual ObjectEntryIndex GetLoadedObjectEntryIndex(std::string_view identifier) abstract; + virtual ObjectEntryIndex GetLoadedObjectEntryIndex(const ObjectEntryDescriptor& descriptor) abstract; virtual ObjectEntryIndex GetLoadedObjectEntryIndex(const Object* object) abstract; virtual std::vector GetInvalidObjects(const rct_object_entry* entries) abstract; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index dcdca4c08e..62a3d1367e 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -859,25 +859,33 @@ namespace RCT1 // RCT1 used 5mph / 8 km/h for every lift hill dst->lift_hill_speed = 5; - if (_gameVersion == FILE_VERSION_RCT1) + dst->music = OBJECT_ENTRY_INDEX_NULL; + if (GetRideTypeDescriptor(dst->type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) { - // Original RCT had no music settings, take default style - dst->music = GetRideTypeDescriptor(dst->type).DefaultMusic; - - // Only merry-go-round and dodgems had music and used - // the same flag as synchronise stations for the option to enable it - if (src->type == RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RCT1_RIDE_TYPE_DODGEMS) + if (_gameVersion == FILE_VERSION_RCT1) { - if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) + // Original RCT had no music settings, take default style + auto style = GetStyleFromMusicIdentifier(GetRideTypeDescriptor(dst->type).DefaultMusic); + if (style) { - dst->depart_flags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; - dst->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + dst->music = *style; + } + + // Only merry-go-round and dodgems had music and used + // the same flag as synchronise stations for the option to enable it + if (src->type == RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RCT1_RIDE_TYPE_DODGEMS) + { + if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) + { + dst->depart_flags &= ~RCT1_RIDE_DEPART_PLAY_MUSIC; + dst->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC; + } } } - } - else - { - dst->music = src->music; + else + { + dst->music = src->music; + } } if (src->operating_mode == RCT1_RIDE_MODE_POWERED_LAUNCH) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 438ad3f979..96a9df55ca 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -1366,3 +1366,49 @@ money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue) return ToMoney32(origValue); } + +static constexpr std::string_view _musicStyles[] = { + "rct2.music.dodgems", + "rct2.music.fairground", + "rct2.music.roman", + "rct2.music.oriental", + "rct2.music.martian", + "rct2.music.jungle", + "rct2.music.egyptian", + "rct2.music.toyland", + "", // CIRCUS + "rct2.music.space", + "rct2.music.horror", + "rct2.music.techno", + "rct2.music.gentle", + "rct2.music.summer", + "rct2.music.water", + "rct2.music.wildwest", + "rct2.music.jurassic", + "rct2.music.rock1", + "rct2.music.ragtime", + "rct2.music.fantasy", + "rct2.music.rock2", + "rct2.music.ice", + "rct2.music.snow", + "rct2.music.custom1", + "rct2.music.custom2", + "rct2.music.medieval", + "rct2.music.urban", + "rct2.music.organ", + "rct2.music.mechanical", + "rct2.music.modern", + "rct2.music.pirate", + "rct2.music.rock3", + "rct2.music.candy", +}; + +std::optional GetStyleFromMusicIdentifier(std::string_view identifier) +{ + auto it = std::find(std::begin(_musicStyles), std::end(_musicStyles), identifier); + if (it != std::end(_musicStyles)) + { + return std::distance(std::begin(_musicStyles), it); + } + return {}; +} diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 53982f8e18..b9e4dd52b1 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -937,6 +937,7 @@ std::string ConvertFormattedStringToRCT2(std::string_view buffer, size_t maxLeng std::string GetTruncatedRCT2String(std::string_view src, size_t maxLength); track_type_t RCT12FlatTrackTypeToOpenRCT2(RCT12TrackType origTrackType); RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType); +std::optional GetStyleFromMusicIdentifier(std::string_view identifier); static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ae440fa402..9083050b38 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -800,7 +800,12 @@ public: } } - dst->music = src->music; + auto musicStyle = OBJECT_ENTRY_INDEX_NULL; + if (GetRideTypeDescriptor(dst->type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + musicStyle = src->music; + } + dst->music = musicStyle; auto entranceStyle = src->entrance_style; // In SV7, "plain" entrances are invisible. diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index be14e2431a..b23ea3b5e1 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -361,7 +361,7 @@ public: money64 income_per_hour; money64 profit; TrackColour track_colour[NUM_COLOUR_SCHEMES]; - uint8_t music; + ObjectEntryIndex music; ObjectEntryIndex entrance_style; uint16_t vehicle_change_timeout; uint8_t num_block_brakes; diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 1905c17d96..76e92a533e 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -167,7 +167,7 @@ struct RideTypeDescriptor // rct2: 0x0097DD78 RideBuildCost BuildCosts; money16 DefaultPrices[NUM_SHOP_ITEMS_PER_RIDE]; - uint8_t DefaultMusic; + std::string_view DefaultMusic; /** rct2: 0x0097D7CB */ ShopItemIndex PhotoItem; /** rct2: 0x0097D21E */ @@ -295,6 +295,20 @@ constexpr const RideComponentName RideComponentNames[] = }; // clang-format on +constexpr std::string_view MUSIC_OBJECT_DODGEMS = "rct2.music.dodgems"; +constexpr std::string_view MUSIC_OBJECT_EGYPTIAN = "rct2.music.egyptian"; +constexpr std::string_view MUSIC_OBJECT_FAIRGROUND = "rct2.music.fairground"; +constexpr std::string_view MUSIC_OBJECT_GENTLE = "rct2.music.gentle"; +constexpr std::string_view MUSIC_OBJECT_HORROR = "rct2.music.horror"; +constexpr std::string_view MUSIC_OBJECT_PIRATE = "rct2.music.pirate"; +constexpr std::string_view MUSIC_OBJECT_ROCK_1 = "rct2.music.rock1"; +constexpr std::string_view MUSIC_OBJECT_ROCK_2 = "rct2.music.rock2"; +constexpr std::string_view MUSIC_OBJECT_ROCK_3 = "rct2.music.rock3"; +constexpr std::string_view MUSIC_OBJECT_SUMMER = "rct2.music.summer"; +constexpr std::string_view MUSIC_OBJECT_TECHNO = "rct2.music.techno"; +constexpr std::string_view MUSIC_OBJECT_WATER = "rct2.music.water"; +constexpr std::string_view MUSIC_OBJECT_WILD_WEST = "rct2.music.wildwest"; + constexpr const RideComponentName& GetRideComponentName(const RideComponentType type) { return RideComponentNames[EnumValue(type)]; @@ -343,7 +357,7 @@ constexpr const RideTypeDescriptor DummyRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 0, 0, 1 }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 0), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h index 7f9c161f9c..17e3a117c7 100644 --- a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h +++ b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor AirPoweredVerticalCoasterRTD = SET_FIELD(UpkeepCosts, { 90, 20, 0, 0, 0, 10 }), SET_FIELD(BuildCosts, { 200, 0, 45, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_2), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_2), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 70), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h index f71545918f..f917fd0cbc 100644 --- a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h +++ b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor BobsleighCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 80, 5, 45, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 75), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h index ef3f48959d..a89e64f0b8 100644 --- a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor ClassicMiniRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 8, 3, 5 }), SET_FIELD(BuildCosts, { 45, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h index 6909e40528..c364eda627 100644 --- a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h +++ b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor CompactInvertedCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 13, 3, 10 }), SET_FIELD(BuildCosts, { 100, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 80), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h index 26593b440d..a0700c7174 100644 --- a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h @@ -47,7 +47,7 @@ constexpr const RideTypeDescriptor CorkscrewRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 105, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h index 459f061589..2024be3ca6 100644 --- a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 125, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( @@ -84,7 +84,7 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterAltRTD = SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 125, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/GigaCoaster.h b/src/openrct2/ride/coaster/meta/GigaCoaster.h index a73b4ef050..baadb2ce97 100644 --- a/src/openrct2/ride/coaster/meta/GigaCoaster.h +++ b/src/openrct2/ride/coaster/meta/GigaCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor GigaCoasterRTD = SET_FIELD(UpkeepCosts, { 10, 20, 80, 12, 3, 40 }), SET_FIELD(BuildCosts, { 120, 5, 55, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_3), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_3), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 120), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h index bf13341e1f..d3ef1c3329 100644 --- a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h +++ b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor HeartlineTwisterCoasterRTD = SET_FIELD(UpkeepCosts, { 47, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 135, 7, 30, }), SET_FIELD(DefaultPrices, { 15, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/HybridCoaster.h b/src/openrct2/ride/coaster/meta/HybridCoaster.h index 9ba4481b90..a703e5a354 100644 --- a/src/openrct2/ride/coaster/meta/HybridCoaster.h +++ b/src/openrct2/ride/coaster/meta/HybridCoaster.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor HybridCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 110, 7, 55}), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_2), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_2), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 120), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/HyperTwister.h b/src/openrct2/ride/coaster/meta/HyperTwister.h index a8b4ec0225..87f2634d0a 100644 --- a/src/openrct2/ride/coaster/meta/HyperTwister.h +++ b/src/openrct2/ride/coaster/meta/HyperTwister.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor HyperTwisterRTD = SET_FIELD(UpkeepCosts, { 43, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 120, 5, 55, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 120), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/Hypercoaster.h b/src/openrct2/ride/coaster/meta/Hypercoaster.h index 867a269c5e..880e6efc7a 100644 --- a/src/openrct2/ride/coaster/meta/Hypercoaster.h +++ b/src/openrct2/ride/coaster/meta/Hypercoaster.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor HypercoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 105, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h index fa80cbe46d..0324379fb8 100644 --- a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor InvertedHairpinCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), SET_FIELD(BuildCosts, { 67, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_2), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_2), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h index d3e787ffd8..021a1b9c2a 100644 --- a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor InvertedImpulseCoasterRTD = SET_FIELD(UpkeepCosts, { 180, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 125, 5, 25, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 75), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h index 6d50a74f5f..180901769d 100644 --- a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor InvertedRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 13, 3, 10 }), SET_FIELD(BuildCosts, { 110, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets,TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h index 101532831b..0d2c167da6 100644 --- a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor JuniorRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 8, 3, 5 }), SET_FIELD(BuildCosts, { 45, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h index 35f8900276..9638a8030e 100644 --- a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor LIMLaunchedRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 42, 20, 80, 9, 3, 10 }), SET_FIELD(BuildCosts, { 95, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h index 5900df08f2..a7ad21562e 100644 --- a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor LayDownRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 107, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( @@ -80,7 +80,7 @@ constexpr const RideTypeDescriptor LayDownRollerCoasterAltRTD = SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 107, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h index 2374d1dbc0..a0e33a11a3 100644 --- a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor LoopingRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 90, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 95), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/MineRide.h b/src/openrct2/ride/coaster/meta/MineRide.h index 82f3d4c3ce..0b89d897fd 100644 --- a/src/openrct2/ride/coaster/meta/MineRide.h +++ b/src/openrct2/ride/coaster/meta/MineRide.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor MineRideRTD = SET_FIELD(UpkeepCosts, { 50, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 85, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WILD_WEST), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WILD_WEST), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 70), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h index b2133f19af..a712b8cc0a 100644 --- a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h +++ b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor MineTrainCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 82, 6, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WILD_WEST), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WILD_WEST), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 85), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h index 1d6b4991b3..e62b371285 100644 --- a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor MiniRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 35, 20, 80, 8, 3, 10 }), SET_FIELD(BuildCosts, { 65, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h index 32c11d91dc..c82713aa5f 100644 --- a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor MiniSuspendedCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 60, 5, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WILD_WEST), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WILD_WEST), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h index 7e049d21fd..7e68ced6b4 100644 --- a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor MultiDimensionRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 75, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 180, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_3), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_3), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( @@ -81,7 +81,7 @@ constexpr const RideTypeDescriptor MultiDimensionRollerCoasterAltRTD = SET_FIELD(UpkeepCosts, { 75, 20, 90, 11, 3, 15 }), SET_FIELD(BuildCosts, { 180, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_3), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_3), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 100), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h index edabe9571a..c36f4c54e3 100644 --- a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor ReverseFreefallCoasterRTD = SET_FIELD(UpkeepCosts, { 80, 20, 0, 0, 0, 10 }), SET_FIELD(BuildCosts, { 200, 0, 45, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 70), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h index 76301d644f..f9c4b750cb 100644 --- a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor ReverserRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 55, 6, 37, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo3), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h index 13b1482f9e..02efb37468 100644 --- a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor SideFrictionRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 55, 6, 37, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo3), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h index cd21cd9032..f2125e6927 100644 --- a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor SingleRailRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 75, 5, 50}), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 80), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h index fee738531b..7aa8ce1dc3 100644 --- a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor SpinningWildMouseRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), SET_FIELD(BuildCosts, { 55, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h index 12e6a20755..20fbc5c740 100644 --- a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor SpiralRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 41, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 70, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_3), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_3), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 85), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h index 17c354bdd8..437eb1b634 100644 --- a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor StandUpRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 100, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 90), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SteelWildMouse.h b/src/openrct2/ride/coaster/meta/SteelWildMouse.h index dff98628af..f73ea3258a 100644 --- a/src/openrct2/ride/coaster/meta/SteelWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SteelWildMouse.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor SteelWildMouseRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), SET_FIELD(BuildCosts, { 55, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/Steeplechase.h b/src/openrct2/ride/coaster/meta/Steeplechase.h index ea84b71a93..19d8161c58 100644 --- a/src/openrct2/ride/coaster/meta/Steeplechase.h +++ b/src/openrct2/ride/coaster/meta/Steeplechase.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor SteeplechaseRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 57, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h index 4fa2861672..263d95e49f 100644 --- a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h +++ b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor SuspendedSwingingCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 20, 3, 10 }), SET_FIELD(BuildCosts, { 95, 5, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo2), SET_FIELD(BonusValue, 90), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h index f6c7597726..55b9fae6de 100644 --- a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h @@ -50,7 +50,7 @@ constexpr const RideTypeDescriptor TwisterRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 43, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 120, 5, 55, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 120), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h index e2b180f293..74578315d2 100644 --- a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h +++ b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor VerticalDropCoasterRTD = SET_FIELD(UpkeepCosts, { 44, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 120, 5, 42, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 95), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/VirginiaReel.h b/src/openrct2/ride/coaster/meta/VirginiaReel.h index 0e867f273b..eb76ae6a6a 100644 --- a/src/openrct2/ride/coaster/meta/VirginiaReel.h +++ b/src/openrct2/ride/coaster/meta/VirginiaReel.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor VirginiaReelRTD = SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 53, 6, 25, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo3), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/WaterCoaster.h b/src/openrct2/ride/coaster/meta/WaterCoaster.h index 9d222b43de..aa98ee9b43 100644 --- a/src/openrct2/ride/coaster/meta/WaterCoaster.h +++ b/src/openrct2/ride/coaster/meta/WaterCoaster.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor WaterCoasterRTD = SET_FIELD(UpkeepCosts, { 60, 20, 80, 8, 3, 10 }), SET_FIELD(BuildCosts, { 55, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h index 63285a2648..01f9dbf921 100644 --- a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor WoodenRollerCoasterRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), SET_FIELD(BuildCosts, { 75, 7, 50, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WILD_WEST), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WILD_WEST), SET_FIELD(PhotoItem, ShopItem::Photo3), SET_FIELD(BonusValue, 105), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h index 69dd57d352..167a23ad51 100644 --- a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h +++ b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor WoodenWildMouseRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), SET_FIELD(BuildCosts, { 50, 6, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WILD_WEST), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WILD_WEST), SET_FIELD(PhotoItem, ShopItem::Photo3), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/CarRide.h b/src/openrct2/ride/gentle/meta/CarRide.h index 79714b4c4d..50d18a0b4c 100644 --- a/src/openrct2/ride/gentle/meta/CarRide.h +++ b/src/openrct2/ride/gentle/meta/CarRide.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor CarRideRTD = SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), SET_FIELD(BuildCosts, { 25, 5, 30, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/Circus.h b/src/openrct2/ride/gentle/meta/Circus.h index 61e8aec3eb..034adfbce0 100644 --- a/src/openrct2/ride/gentle/meta/Circus.h +++ b/src/openrct2/ride/gentle/meta/Circus.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor CircusRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 125, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_CIRCUS_SHOW), + SET_FIELD(DefaultMusic, {}), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 39), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/gentle/meta/CrookedHouse.h b/src/openrct2/ride/gentle/meta/CrookedHouse.h index 1b7de29e60..9884f4fcab 100644 --- a/src/openrct2/ride/gentle/meta/CrookedHouse.h +++ b/src/openrct2/ride/gentle/meta/CrookedHouse.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor CrookedHouseRTD = SET_FIELD(UpkeepCosts, { 30, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 65, 2, 1, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 22), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/Dodgems.h b/src/openrct2/ride/gentle/meta/Dodgems.h index 0daa624b6e..8e032b7809 100644 --- a/src/openrct2/ride/gentle/meta/Dodgems.h +++ b/src/openrct2/ride/gentle/meta/Dodgems.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor DodgemsRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 5, 0, 0 }), SET_FIELD(BuildCosts, { 55, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_DODGEMS_BEAT), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_DODGEMS), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/FerrisWheel.h b/src/openrct2/ride/gentle/meta/FerrisWheel.h index 335ad0de9f..2345449c46 100644 --- a/src/openrct2/ride/gentle/meta/FerrisWheel.h +++ b/src/openrct2/ride/gentle/meta/FerrisWheel.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor FerrisWheelRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 225, 2, 1, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/FlyingSaucers.h b/src/openrct2/ride/gentle/meta/FlyingSaucers.h index 495e362a94..633e3d07a1 100644 --- a/src/openrct2/ride/gentle/meta/FlyingSaucers.h +++ b/src/openrct2/ride/gentle/meta/FlyingSaucers.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor FlyingSaucersRTD = SET_FIELD(UpkeepCosts, { 90, 1, 0, 5, 0, 0 }), SET_FIELD(BuildCosts, { 70, 4, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/GhostTrain.h b/src/openrct2/ride/gentle/meta/GhostTrain.h index a2bbe1bc3f..8201874a7d 100644 --- a/src/openrct2/ride/gentle/meta/GhostTrain.h +++ b/src/openrct2/ride/gentle/meta/GhostTrain.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor GhostTrainRTD = SET_FIELD(UpkeepCosts, { 80, 20, 0, 8, 3, 5 }), SET_FIELD(BuildCosts, { 26, 5, 30, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_HORROR), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_HORROR), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/HauntedHouse.h b/src/openrct2/ride/gentle/meta/HauntedHouse.h index a0e9652a5d..1409b473c3 100644 --- a/src/openrct2/ride/gentle/meta/HauntedHouse.h +++ b/src/openrct2/ride/gentle/meta/HauntedHouse.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor HauntedHouseRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 85, 2, 1, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_HORROR), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_HORROR), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 22), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/gentle/meta/Maze.h b/src/openrct2/ride/gentle/meta/Maze.h index 57e8243971..22346da43c 100644 --- a/src/openrct2/ride/gentle/meta/Maze.h +++ b/src/openrct2/ride/gentle/meta/Maze.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor MazeRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 55, 2, 8, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 40), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/MerryGoRound.h b/src/openrct2/ride/gentle/meta/MerryGoRound.h index 2c32bf84c7..ae7b5e50a3 100644 --- a/src/openrct2/ride/gentle/meta/MerryGoRound.h +++ b/src/openrct2/ride/gentle/meta/MerryGoRound.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor MerryGoRoundRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 115, 2, 1, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_FAIRGROUND_ORGAN), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_FAIRGROUND), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/gentle/meta/MiniGolf.h b/src/openrct2/ride/gentle/meta/MiniGolf.h index b68f2b68bf..c8e3b0e2f6 100644 --- a/src/openrct2/ride/gentle/meta/MiniGolf.h +++ b/src/openrct2/ride/gentle/meta/MiniGolf.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor MiniGolfRTD = SET_FIELD(UpkeepCosts, { 30, 20, 80, 11, 3, 10 }), SET_FIELD(BuildCosts, { 50, 7, 20, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 23), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/MiniHelicopters.h b/src/openrct2/ride/gentle/meta/MiniHelicopters.h index 624f94f23b..9f4d215aba 100644 --- a/src/openrct2/ride/gentle/meta/MiniHelicopters.h +++ b/src/openrct2/ride/gentle/meta/MiniHelicopters.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor MiniHelicoptersRTD = SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), SET_FIELD(BuildCosts, { 25, 5, 30, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/MonorailCycles.h b/src/openrct2/ride/gentle/meta/MonorailCycles.h index 1d1f3f4983..c093ebe1fc 100644 --- a/src/openrct2/ride/gentle/meta/MonorailCycles.h +++ b/src/openrct2/ride/gentle/meta/MonorailCycles.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor MonorailCyclesRTD = SET_FIELD(UpkeepCosts, { 47, 20, 0, 8, 3, 5 }), SET_FIELD(BuildCosts, { 20, 5, 30, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/MonsterTrucks.h b/src/openrct2/ride/gentle/meta/MonsterTrucks.h index 3f4f6c28e0..5d9c4b329b 100644 --- a/src/openrct2/ride/gentle/meta/MonsterTrucks.h +++ b/src/openrct2/ride/gentle/meta/MonsterTrucks.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor MonsterTrucksRTD = SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), SET_FIELD(BuildCosts, { 25, 5, 30, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/ObservationTower.h b/src/openrct2/ride/gentle/meta/ObservationTower.h index 3001175af8..871845fa01 100644 --- a/src/openrct2/ride/gentle/meta/ObservationTower.h +++ b/src/openrct2/ride/gentle/meta/ObservationTower.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor ObservationTowerRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), SET_FIELD(BuildCosts, { 37, 0, 4, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/gentle/meta/SpaceRings.h b/src/openrct2/ride/gentle/meta/SpaceRings.h index 82a75a4372..f6b873f3a2 100644 --- a/src/openrct2/ride/gentle/meta/SpaceRings.h +++ b/src/openrct2/ride/gentle/meta/SpaceRings.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor SpaceRingsRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 72, 2, 1, }), SET_FIELD(DefaultPrices, { 5, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 30), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/gentle/meta/SpiralSlide.h b/src/openrct2/ride/gentle/meta/SpiralSlide.h index fcff0d58a5..e5181f34d8 100644 --- a/src/openrct2/ride/gentle/meta/SpiralSlide.h +++ b/src/openrct2/ride/gentle/meta/SpiralSlide.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor SpiralSlideRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 165, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 40), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/shops/meta/CashMachine.h b/src/openrct2/ride/shops/meta/CashMachine.h index 987a28abec..54b5d197a7 100644 --- a/src/openrct2/ride/shops/meta/CashMachine.h +++ b/src/openrct2/ride/shops/meta/CashMachine.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor CashMachineRTD = SET_FIELD(UpkeepCosts, { 40, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 400, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 5), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/DrinkStall.h b/src/openrct2/ride/shops/meta/DrinkStall.h index f2f61afa22..0a2276b901 100644 --- a/src/openrct2/ride/shops/meta/DrinkStall.h +++ b/src/openrct2/ride/shops/meta/DrinkStall.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor DrinkStallRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 500, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 15), SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/FirstAid.h b/src/openrct2/ride/shops/meta/FirstAid.h index 573c7c0afa..92cf762c75 100644 --- a/src/openrct2/ride/shops/meta/FirstAid.h +++ b/src/openrct2/ride/shops/meta/FirstAid.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor FirstAidRTD = SET_FIELD(UpkeepCosts, { 45, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 500, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 5), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/FoodStall.h b/src/openrct2/ride/shops/meta/FoodStall.h index a558bbcd89..4dfbb3d1c3 100644 --- a/src/openrct2/ride/shops/meta/FoodStall.h +++ b/src/openrct2/ride/shops/meta/FoodStall.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor FoodStallRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 600, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 15), SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/InformationKiosk.h b/src/openrct2/ride/shops/meta/InformationKiosk.h index 3a14abde31..576a8dc772 100644 --- a/src/openrct2/ride/shops/meta/InformationKiosk.h +++ b/src/openrct2/ride/shops/meta/InformationKiosk.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor InformationKioskRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 500, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 15), SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/Shop.h b/src/openrct2/ride/shops/meta/Shop.h index de1149c499..792a734c92 100644 --- a/src/openrct2/ride/shops/meta/Shop.h +++ b/src/openrct2/ride/shops/meta/Shop.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor ShopRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 400, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 15), SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), diff --git a/src/openrct2/ride/shops/meta/Toilets.h b/src/openrct2/ride/shops/meta/Toilets.h index 39b43a0c86..408ba0def4 100644 --- a/src/openrct2/ride/shops/meta/Toilets.h +++ b/src/openrct2/ride/shops/meta/Toilets.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor ToiletsRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 450, 0, 1, }), SET_FIELD(DefaultPrices, { 0, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 5), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/thrill/meta/3DCinema.h b/src/openrct2/ride/thrill/meta/3DCinema.h index 8be884f1a9..bf75114b6e 100644 --- a/src/openrct2/ride/thrill/meta/3DCinema.h +++ b/src/openrct2/ride/thrill/meta/3DCinema.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor CinemaRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 140, 2, 1, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/thrill/meta/Enterprise.h b/src/openrct2/ride/thrill/meta/Enterprise.h index 782cdf98d3..f88d090b16 100644 --- a/src/openrct2/ride/thrill/meta/Enterprise.h +++ b/src/openrct2/ride/thrill/meta/Enterprise.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor EnterpriseRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 100, 2, 1, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK_STYLE_2), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_2), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/thrill/meta/GoKarts.h b/src/openrct2/ride/thrill/meta/GoKarts.h index 0bae76b34e..c419d96a61 100644 --- a/src/openrct2/ride/thrill/meta/GoKarts.h +++ b/src/openrct2/ride/thrill/meta/GoKarts.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor GoKartsRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 8, 0, 0 }), SET_FIELD(BuildCosts, { 62, 4, 20, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h index e81bf617d3..37be700e2f 100644 --- a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h +++ b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor LaunchedFreefallRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), SET_FIELD(BuildCosts, { 50, 0, 4, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/MagicCarpet.h b/src/openrct2/ride/thrill/meta/MagicCarpet.h index a7dbb534fc..3abaff3776 100644 --- a/src/openrct2/ride/thrill/meta/MagicCarpet.h +++ b/src/openrct2/ride/thrill/meta/MagicCarpet.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor MagicCarpetRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 198, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_EGYPTIAN), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_EGYPTIAN), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/MotionSimulator.h b/src/openrct2/ride/thrill/meta/MotionSimulator.h index bee3798611..b4a97a3bb8 100644 --- a/src/openrct2/ride/thrill/meta/MotionSimulator.h +++ b/src/openrct2/ride/thrill/meta/MotionSimulator.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor MotionSimulatorRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 220, 2, 1, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/thrill/meta/RotoDrop.h b/src/openrct2/ride/thrill/meta/RotoDrop.h index 84b8b89964..1d769241aa 100644 --- a/src/openrct2/ride/thrill/meta/RotoDrop.h +++ b/src/openrct2/ride/thrill/meta/RotoDrop.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor RotoDropRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), SET_FIELD(BuildCosts, { 55, 0, 4, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_ROCK), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_ROCK_1), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h index f034b39b72..57b57a1a21 100644 --- a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor SwingingInverterShipRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 212, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/SwingingShip.h b/src/openrct2/ride/thrill/meta/SwingingShip.h index 83ab4511d2..9d085310aa 100644 --- a/src/openrct2/ride/thrill/meta/SwingingShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingShip.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor SwingingShipRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 155, 2, 1, }), SET_FIELD(DefaultPrices, { 15, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_PIRATES), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_PIRATE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 35), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/TopSpin.h b/src/openrct2/ride/thrill/meta/TopSpin.h index 2321b0f69a..331dfb0755 100644 --- a/src/openrct2/ride/thrill/meta/TopSpin.h +++ b/src/openrct2/ride/thrill/meta/TopSpin.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor TopSpinRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 145, 2, 1, }), SET_FIELD(DefaultPrices, { 20, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_TECHNO), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_TECHNO), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/thrill/meta/Twist.h b/src/openrct2/ride/thrill/meta/Twist.h index 6f77545457..3fd14a8560 100644 --- a/src/openrct2/ride/thrill/meta/Twist.h +++ b/src/openrct2/ride/thrill/meta/Twist.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor TwistRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), SET_FIELD(BuildCosts, { 90, 2, 1, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 40), SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), diff --git a/src/openrct2/ride/transport/meta/Chairlift.h b/src/openrct2/ride/transport/meta/Chairlift.h index 3f7a110347..60f7a7c58a 100644 --- a/src/openrct2/ride/transport/meta/Chairlift.h +++ b/src/openrct2/ride/transport/meta/Chairlift.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor ChairliftRTD = SET_FIELD(UpkeepCosts, { 60, 20, 0, 4, 3, 10 }), SET_FIELD(BuildCosts, { 65, 1, 30, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/transport/meta/Lift.h b/src/openrct2/ride/transport/meta/Lift.h index 33d557d756..7046b0e1c4 100644 --- a/src/openrct2/ride/transport/meta/Lift.h +++ b/src/openrct2/ride/transport/meta/Lift.h @@ -43,7 +43,7 @@ constexpr const RideTypeDescriptor LiftRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), SET_FIELD(BuildCosts, { 39, 0, 4, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 45), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/transport/meta/MiniatureRailway.h b/src/openrct2/ride/transport/meta/MiniatureRailway.h index 12bcce0f79..a470bd0e7e 100644 --- a/src/openrct2/ride/transport/meta/MiniatureRailway.h +++ b/src/openrct2/ride/transport/meta/MiniatureRailway.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor MiniatureRailwayRTD = SET_FIELD(UpkeepCosts, { 60, 20, 0, 10, 3, 5 }), SET_FIELD(BuildCosts, { 35, 6, 50, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 50), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/transport/meta/Monorail.h b/src/openrct2/ride/transport/meta/Monorail.h index 9c68694177..bddd24d97b 100644 --- a/src/openrct2/ride/transport/meta/Monorail.h +++ b/src/openrct2/ride/transport/meta/Monorail.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor MonorailRTD = SET_FIELD(UpkeepCosts, { 65, 20, 0, 10, 3, 10 }), SET_FIELD(BuildCosts, { 42, 5, 50, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/transport/meta/SuspendedMonorail.h b/src/openrct2/ride/transport/meta/SuspendedMonorail.h index 88c46671a3..147baff8d3 100644 --- a/src/openrct2/ride/transport/meta/SuspendedMonorail.h +++ b/src/openrct2/ride/transport/meta/SuspendedMonorail.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor SuspendedMonorailRTD = SET_FIELD(UpkeepCosts, { 70, 20, 0, 10, 3, 10 }), SET_FIELD(BuildCosts, { 65, 5, 50, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_SUMMER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_SUMMER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 60), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/BoatHire.h b/src/openrct2/ride/water/meta/BoatHire.h index 4f0c8cd8a0..30efcf34b4 100644 --- a/src/openrct2/ride/water/meta/BoatHire.h +++ b/src/openrct2/ride/water/meta/BoatHire.h @@ -42,7 +42,7 @@ constexpr const RideTypeDescriptor BoatHireRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 4, 0, 0 }), SET_FIELD(BuildCosts, { 55, 5, 5, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 40), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/DinghySlide.h b/src/openrct2/ride/water/meta/DinghySlide.h index c40b35f541..e428fcbec5 100644 --- a/src/openrct2/ride/water/meta/DinghySlide.h +++ b/src/openrct2/ride/water/meta/DinghySlide.h @@ -54,7 +54,7 @@ constexpr const RideTypeDescriptor DinghySlideRTD = SET_FIELD(UpkeepCosts, { 40, 20, 80, 4, 3, 10 }), SET_FIELD(BuildCosts, { 40, 4, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 55), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/LogFlume.h b/src/openrct2/ride/water/meta/LogFlume.h index 017fd299da..5d2f7fccb7 100644 --- a/src/openrct2/ride/water/meta/LogFlume.h +++ b/src/openrct2/ride/water/meta/LogFlume.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor LogFlumeRTD = SET_FIELD(UpkeepCosts, { 80, 20, 0, 9, 0, 10 }), SET_FIELD(BuildCosts, { 45, 5, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/RiverRafts.h b/src/openrct2/ride/water/meta/RiverRafts.h index b947579d71..6554deb094 100644 --- a/src/openrct2/ride/water/meta/RiverRafts.h +++ b/src/openrct2/ride/water/meta/RiverRafts.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor RiverRaftsRTD = SET_FIELD(UpkeepCosts, { 50, 20, 0, 9, 0, 10 }), SET_FIELD(BuildCosts, { 40, 5, 30, }), SET_FIELD(DefaultPrices, { 10, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_GENTLE), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_GENTLE), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/RiverRapids.h b/src/openrct2/ride/water/meta/RiverRapids.h index 89357f0e67..859f012d53 100644 --- a/src/openrct2/ride/water/meta/RiverRapids.h +++ b/src/openrct2/ride/water/meta/RiverRapids.h @@ -46,7 +46,7 @@ constexpr const RideTypeDescriptor RiverRapidsRTD = SET_FIELD(UpkeepCosts, { 82, 20, 0, 10, 0, 10 }), SET_FIELD(BuildCosts, { 62, 6, 40, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 70), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/SplashBoats.h b/src/openrct2/ride/water/meta/SplashBoats.h index 9390ebcc12..90659891f4 100644 --- a/src/openrct2/ride/water/meta/SplashBoats.h +++ b/src/openrct2/ride/water/meta/SplashBoats.h @@ -45,7 +45,7 @@ constexpr const RideTypeDescriptor SplashBoatsRTD = SET_FIELD(UpkeepCosts, { 70, 20, 0, 9, 0, 10 }), SET_FIELD(BuildCosts, { 57, 5, 30, }), SET_FIELD(DefaultPrices, { 20, 20 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo4), SET_FIELD(BonusValue, 65), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( diff --git a/src/openrct2/ride/water/meta/SubmarineRide.h b/src/openrct2/ride/water/meta/SubmarineRide.h index 4d88ba60db..742827aa22 100644 --- a/src/openrct2/ride/water/meta/SubmarineRide.h +++ b/src/openrct2/ride/water/meta/SubmarineRide.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor SubmarineRideRTD = SET_FIELD(UpkeepCosts, { 50, 1, 0, 4, 0, 0 }), SET_FIELD(BuildCosts, { 70, 0, 5, }), SET_FIELD(DefaultPrices, { 10, 0 }), - SET_FIELD(DefaultMusic, MUSIC_STYLE_WATER), + SET_FIELD(DefaultMusic, MUSIC_OBJECT_WATER), SET_FIELD(PhotoItem, ShopItem::Photo), SET_FIELD(BonusValue, 40), SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( From ebc201aaf2aa68697363ac40b7e8d2e060105c9f Mon Sep 17 00:00:00 2001 From: spacek531 Date: Wed, 1 Sep 2021 19:00:18 -0700 Subject: [PATCH 290/681] comment and rename refactor to class method fix formatting rename function rename another rename sub_6C683D rename loc_6CD18E annotate ride_get_entrance_or_exit_position_from_screen_position fix format rename loop value fix formatting again rename functions to TitleCase --- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 53 +++-- src/openrct2/actions/MazeSetTrackAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 2 +- .../actions/RideSetColourSchemeAction.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 2 +- src/openrct2/actions/TrackRemoveAction.cpp | 2 +- src/openrct2/ride/Ride.cpp | 5 +- src/openrct2/ride/Ride.h | 7 +- src/openrct2/ride/RideConstruction.cpp | 205 ++++++++++-------- src/openrct2/ride/Track.h | 8 +- src/openrct2/ride/TrackDesign.cpp | 8 +- 12 files changed, 169 insertions(+), 129 deletions(-) diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 93006dd0c6..99b2dd5521 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -331,7 +331,7 @@ static void window_maze_construction_update(rct_window* w) default: break; } - sub_6C94D8(); + updateGhostTrackAndArrow(); } /** diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8879ec1607..431d4db888 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -466,7 +466,7 @@ static void window_ride_construction_select_map_tiles( Ride* ride, int32_t trackType, int32_t trackDirection, const CoordsXY& tileCoords); static void window_ride_construction_show_special_track_dropdown(rct_window* w, rct_widget* widget); static void ride_selected_track_set_seat_rotation(int32_t seatRotation); -static void loc_6C7502(int32_t al); +static void UpdateLiftHillSelected(int32_t slope); static void ride_construction_set_brakes_speed(int32_t brakesSpeed); static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& screenCoords); @@ -1376,11 +1376,11 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi } if (w->widgets[WIDX_SLOPE_DOWN_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP) { - loc_6C7502(8); + UpdateLiftHillSelected(TRACK_SLOPE_DOWN_60); } else { - loc_6C7502(10); + UpdateLiftHillSelected(TRACK_SLOPE_UP_90); } break; case WIDX_SLOPE_DOWN: @@ -1389,7 +1389,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi { _currentTrackBankEnd = TRACK_BANK_NONE; } - loc_6C7502(6); + UpdateLiftHillSelected(TRACK_SLOPE_DOWN_25); break; case WIDX_LEVEL: ride_construction_invalidate_current_track(); @@ -1415,7 +1415,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi _currentTrackBankEnd = TRACK_BANK_RIGHT; } } - loc_6C7502(0); + UpdateLiftHillSelected(TRACK_SLOPE_NONE); break; case WIDX_SLOPE_UP: ride_construction_invalidate_current_track(); @@ -1433,7 +1433,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi } else { - loc_6C7502(2); + UpdateLiftHillSelected(TRACK_SLOPE_UP_25); } break; case WIDX_SLOPE_UP_STEEP: @@ -1508,11 +1508,11 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi } if (w->widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) { - loc_6C7502(4); + UpdateLiftHillSelected(TRACK_SLOPE_UP_60); } else { - loc_6C7502(18); + UpdateLiftHillSelected(TRACK_SLOPE_DOWN_90); } break; case WIDX_CHAIN_LIFT: @@ -1888,7 +1888,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) // Invalidate the selected track element or make sure it's at origin??? direction = _currentTrackPieceDirection; track_type_t type = _currentTrackPieceType; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { window_ride_construction_update_active_elements(); @@ -1918,7 +1919,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) { direction = _currentTrackPieceDirection; type = _currentTrackPieceType; - newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { @@ -2089,7 +2091,7 @@ static void window_ride_construction_update(rct_window* w) break; } - sub_6C94D8(); + updateGhostTrackAndArrow(); } /** @@ -2489,7 +2491,7 @@ void window_ride_construction_update_active_elements_impl() _selectedTrackType = TrackElemType::None; if (_rideConstructionState == RideConstructionState::Selected) { - if (sub_6C683D( + if (GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, &tileElement, 0) != std::nullopt) @@ -2527,7 +2529,7 @@ void window_ride_construction_update_enabled_track_pieces() * * rct2: 0x006C94D8 */ -void sub_6C94D8() +void updateGhostTrackAndArrow() { ride_id_t rideIndex; int32_t direction, type, liftHillAndAlternativeState; @@ -2551,6 +2553,7 @@ void sub_6C94D8() case RideConstructionState::Front: case RideConstructionState::Back: { + // place ghost piece if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) { if (window_ride_construction_update_state( @@ -2565,7 +2568,7 @@ void sub_6C94D8() window_ride_construction_update_active_elements(); } } - + // update flashing arrow auto curTime = platform_get_ticks(); if (_rideConstructionNextArrowPulse >= curTime) break; @@ -2575,6 +2578,7 @@ void sub_6C94D8() trackPos = _currentTrackBegin; direction = _currentTrackPieceDirection; type = _currentTrackPieceType; + // diagonal pieces trigger this if (direction >= 4) direction += 4; if (_rideConstructionState == RideConstructionState::Back) @@ -2599,7 +2603,8 @@ void sub_6C94D8() type = _currentTrackPieceType; uint16_t flags = _currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW ? TRACK_ELEMENT_SET_HIGHLIGHT_TRUE : TRACK_ELEMENT_SET_HIGHLIGHT_FALSE; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); if (newCoords == std::nullopt) { ride_construction_remove_ghosts(); @@ -3356,7 +3361,7 @@ static void window_ride_construction_show_special_track_dropdown(rct_window* w, */ static void ride_selected_track_set_seat_rotation(int32_t seatRotation) { - sub_6C683D( + GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, seatRotation, nullptr, TRACK_ELEMENT_SET_SEAT_ROTATION); window_ride_construction_update_active_elements(); @@ -3366,15 +3371,21 @@ static void ride_selected_track_set_seat_rotation(int32_t seatRotation) * * rct2: 0x006C7502 */ -static void loc_6C7502(int32_t al) +static void UpdateLiftHillSelected(int32_t slope) { - _currentTrackSlopeEnd = al; + _currentTrackSlopeEnd = slope; _currentTrackPrice = MONEY32_UNDEFINED; if (_rideConstructionState == RideConstructionState::Front) { - if (al != 2 && al != 4 && al != 0) + switch (slope) { - _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + case TRACK_SLOPE_NONE: + case TRACK_SLOPE_UP_25: + case TRACK_SLOPE_UP_60: + break; + default: + _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + break; } } window_ride_construction_update_active_elements(); @@ -3388,7 +3399,7 @@ static void ride_construction_set_brakes_speed(int32_t brakesSpeed) { TileElement* tileElement; - if (sub_6C683D( + if (GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, &tileElement, 0) != std::nullopt) diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index f0dd07396f..19e38f95d0 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -293,7 +293,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888) { tile_element_remove(tileElement); - sub_6CB945(ride); + ride->ValidateStations(); ride->maze_tiles--; } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index ecc24ea6ce..3591fe98c0 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -129,7 +129,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const ride_remove_peeps(ride); ride->StopGuestsQueuing(); - sub_6CB945(ride); + ride->ValidateStations(); ride_clear_leftover_entrances(ride); News::DisableNewsItems(News::ItemType::Ride, _rideIndex); diff --git a/src/openrct2/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index 8e245cc3df..064d30bb9c 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.cpp +++ b/src/openrct2/actions/RideSetColourSchemeAction.cpp @@ -61,7 +61,7 @@ GameActions::Result::Ptr RideSetColourSchemeAction::Execute() const res->Expenditure = ExpenditureType::RideConstruction; res->ErrorTitle = STR_CANT_SET_COLOUR_SCHEME; - sub_6C683D(_loc, _trackType, _newColourScheme, nullptr, TRACK_ELEMENT_SET_COLOUR_SCHEME); + GetTrackElementOriginAndApplyChanges(_loc, _trackType, _newColourScheme, nullptr, TRACK_ELEMENT_SET_COLOUR_SCHEME); return res; } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 2f36dfc5c8..ab58057ab4 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -629,7 +629,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const { track_add_station_element({ mapLoc, _origin.direction }, _rideIndex, GAME_COMMAND_FLAG_APPLY, _fromTrackDesign); } - sub_6CB945(ride); + ride->ValidateStations(); ride->UpdateMaxVehicles(); } diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 8e1bf2b942..65c1a1b1b1 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -426,7 +426,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const footpath_remove_edges_at(mapLoc, tileElement); } tile_element_remove(tileElement); - sub_6CB945(ride); + ride->ValidateStations(); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { ride->UpdateMaxVehicles(); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index dd232f6f07..62dee8b349 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2863,7 +2863,8 @@ static void ride_set_boat_hire_return_point(Ride* ride, CoordsXYE* startElement) auto trackCoords = CoordsXYZ{ trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }; int32_t direction = trackBeginEnd.begin_direction; trackType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); - auto newCoords = sub_6C683D({ trackCoords, static_cast(direction) }, trackType, 0, &returnPos.element, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { trackCoords, static_cast(direction) }, trackType, 0, &returnPos.element, 0); returnPos = newCoords == std::nullopt ? CoordsXYE{ trackCoords, returnPos.element } : CoordsXYE{ *newCoords, returnPos.element }; }; @@ -3610,7 +3611,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) auto tmpLoc = CoordsXYZ{ it.current, tileElement->GetBaseZ() }; auto direction = tileElement->GetDirection(); trackType = tileElement->AsTrack()->GetTrackType(); - sub_6C683D({ tmpLoc, direction }, trackType, 0, &tileElement, flags); + GetTrackElementOriginAndApplyChanges({ tmpLoc, direction }, trackType, 0, &tileElement, flags); } } return true; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index be14e2431a..fcaa9a7ad1 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -424,6 +424,7 @@ public: bool SupportsStatus(RideStatus s) const; void StopGuestsQueuing(); + void ValidateStations(); bool Open(bool isApplying); bool Test(RideStatus newStatus, bool isApplying); @@ -1147,7 +1148,7 @@ void ride_breakdown_add_news_item(Ride* ride); Staff* ride_find_closest_mechanic(Ride* ride, int32_t forInspection); int32_t ride_initialise_construction_window(Ride* ride); void ride_construction_invalidate_current_track(); -std::optional sub_6C683D( +std::optional GetTrackElementOriginAndApplyChanges( const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags); void ride_set_map_tooltip(TileElement* tileElement); void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason); @@ -1218,9 +1219,7 @@ enum class RideSetSetting : uint8_t; money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value); money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags); -void sub_6CB945(Ride* ride); - -void sub_6C94D8(); +void updateGhostTrackAndArrow(); void ride_reset_all_names(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index de5f99dfd3..2cfa63038c 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -379,7 +379,7 @@ void ride_clear_blocked_tiles(Ride* ride) * di : output_element * bp : flags */ -std::optional sub_6C683D( +std::optional GetTrackElementOriginAndApplyChanges( const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags) { // Find the relevant track piece, prefer sequence 0 (this ensures correct behaviour for diagonal track pieces) @@ -549,7 +549,7 @@ void ride_construction_invalidate_current_track() switch (_rideConstructionState) { case RideConstructionState::Selected: - sub_6C683D( + GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, nullptr, TRACK_ELEMENT_SET_HIGHLIGHT_FALSE); break; @@ -750,7 +750,8 @@ void ride_select_next_section() int32_t direction = _currentTrackPieceDirection; int32_t type = _currentTrackPieceType; TileElement* tileElement; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { _rideConstructionState = RideConstructionState::State0; @@ -816,7 +817,8 @@ void ride_select_previous_section() int32_t direction = _currentTrackPieceDirection; int32_t type = _currentTrackPieceType; TileElement* tileElement; - auto newCoords = sub_6C683D({ _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); if (newCoords == std::nullopt) { _rideConstructionState = RideConstructionState::State0; @@ -1034,7 +1036,7 @@ bool ride_modify(CoordsXYE* input) auto tileCoords = CoordsXYZ{ tileElement, tileElement.element->GetBaseZ() }; auto direction = tileElement.element->GetDirection(); auto type = tileElement.element->AsTrack()->GetTrackType(); - auto newCoords = sub_6C683D({ tileCoords, direction }, type, 0, nullptr, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges({ tileCoords, direction }, type, 0, nullptr, 0); if (newCoords == std::nullopt) return false; @@ -1200,42 +1202,39 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; } -static int32_t loc_6CD18E( +// for a 3xN or nx3 grid, find the direction that faces the inside. +static Direction GetEntranceExitDirection( int16_t mapX, int16_t mapY, int16_t entranceMinX, int16_t entranceMinY, int16_t entranceMaxX, int16_t entranceMaxY) { - int32_t direction = 0; if (mapX == entranceMinX) { if (mapY > entranceMinY && mapY < entranceMaxY) { - return direction; + return 0; } } - direction = 1; if (mapY == entranceMaxY) { if (mapX > entranceMinX && mapX < entranceMaxX) { - return direction; + return 1; } } - direction = 2; if (mapX == entranceMaxX) { if (mapY > entranceMinY && mapY < entranceMaxY) { - return direction; + return 2; } } - direction = 3; if (mapY == entranceMinY) { if (mapX > entranceMinX && mapX < entranceMaxX) { - return direction; + return 3; } } - return -1; + return INVALID_DIRECTION; } /** @@ -1245,8 +1244,8 @@ static int32_t loc_6CD18E( CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords) { CoordsXYZD entranceExitCoords{}; - gRideEntranceExitPlaceDirection = INVALID_DIRECTION; + // determine if the mouse is hovering over a station - that's the station to add the entrance to auto info = get_map_coordinates_from_pos(screenCoords, EnumsToFlags(ViewportInteractionItem::Ride)); if (info.SpriteType != ViewportInteractionItem::None) { @@ -1279,17 +1278,14 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto stationBaseZ = ride->stations[gRideEntranceExitPlaceStationIndex].GetBaseZ(); - auto coords = screen_get_map_xy_with_z(screenCoords, stationBaseZ); - if (!coords) + auto coordsAtHeight = screen_get_map_xy_with_z(screenCoords, stationBaseZ); + if (!coordsAtHeight) { entranceExitCoords.setNull(); return entranceExitCoords; } - auto word_F4418C = coords->x; - auto word_F4418E = coords->y; - - entranceExitCoords = { coords->ToTileStart(), stationBaseZ, INVALID_DIRECTION }; + entranceExitCoords = { coordsAtHeight->ToTileStart(), stationBaseZ, INVALID_DIRECTION }; if (ride->type == RIDE_TYPE_NULL) { @@ -1304,26 +1300,33 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC return entranceExitCoords; } + // flat rides if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) { - auto mapX = (word_F4418C & 0x1F) - 16; - auto mapY = (word_F4418E & 0x1F) - 16; + // find the quadrant the mouse is hovering over - that's the direction to start searching for a station TileElement + Direction startDirection = 0; + auto mapX = (coordsAtHeight->x & 0x1F) - 16; + auto mapY = (coordsAtHeight->y & 0x1F) - 16; if (std::abs(mapX) < std::abs(mapY)) { - entranceExitCoords.direction = mapY < 0 ? 3 : 1; + startDirection = mapY < 0 ? 3 : 1; } else { - entranceExitCoords.direction = mapX < 0 ? 0 : 2; + startDirection = mapX < 0 ? 0 : 2; } - - for (int32_t i = 0; i < MAX_STATIONS; i++) + // check all 4 directions, starting with the mouse's quadrant + for (uint8_t directionIncrement = 0; directionIncrement < 4; directionIncrement++) { - mapX = entranceExitCoords.x + CoordsDirectionDelta[entranceExitCoords.direction].x; - mapY = entranceExitCoords.y + CoordsDirectionDelta[entranceExitCoords.direction].y; - if (map_is_location_valid({ mapX, mapY })) + entranceExitCoords.direction = (startDirection + directionIncrement) & 3; + // search for TrackElement one tile over, shifted in the search direction + auto nextLocation = entranceExitCoords; + nextLocation.x += CoordsDirectionDelta[entranceExitCoords.direction].x; + nextLocation.y += CoordsDirectionDelta[entranceExitCoords.direction].y; + if (map_is_location_valid(nextLocation)) { - auto tileElement = map_get_first_element_at({ mapX, mapY }); + // iterate over every element in the tile until we find what we want + auto tileElement = map_get_first_element_at(nextLocation); if (tileElement == nullptr) continue; do @@ -1336,37 +1339,42 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC continue; if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Maze) { + // if it's a maze, it can place the entrance and exit immediately entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; return entranceExitCoords; } if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) continue; + // if it's not a maze, the sequence properties for the TrackElement must be found to determine if an + // entrance can be placed on that side - int32_t eax = (entranceExitCoords.direction + 2 - tileElement->GetDirection()) - & TILE_ELEMENT_DIRECTION_MASK; + // get the exit hut side relative to the TrackElement + Direction direction = (direction_reverse(entranceExitCoords.direction) - tileElement->GetDirection()) & 3; const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << eax)) + if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << direction)) { + // if that side of the TrackElement supports stations, the entrance hut is valid and faces away from the + // station entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; return entranceExitCoords; } } while (!(tileElement++)->IsLastForTile()); } - entranceExitCoords.direction = (entranceExitCoords.direction + 1) & 3; } gRideEntranceExitPlaceDirection = INVALID_DIRECTION; } else { - auto mapX = stationStart.x; - auto mapY = stationStart.y; - auto entranceMinX = mapX; - auto entranceMinY = mapY; - auto entranceMaxX = mapX; - auto entranceMaxY = mapY; + // create a 2-point rectangle. The rectangle will have a width or height of 0 depending on station direction or length + // (if the station is 0) The 2-point rectangle is ballooned on all four sides by 1 tile for a 3xN or Nx3 rectangle. + // Whatever edge the entrance hut is on, rotate it outward to get entrance direction. + CoordsXY nextLocation = { stationStart.x, stationStart.y }; + CoordsXY entranceMin = { nextLocation }; + CoordsXY entranceMax = { nextLocation }; + // get the beginning of the station TrackElement auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); if (tileElement == nullptr) { @@ -1376,13 +1384,13 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC entranceExitCoords.direction = tileElement->GetDirection(); auto stationDirection = entranceExitCoords.direction; + // find additional station TrackElements and extend the line of valid entrance locations while (true) { - entranceMaxX = mapX; - entranceMaxY = mapY; - mapX -= CoordsDirectionDelta[entranceExitCoords.direction].x; - mapY -= CoordsDirectionDelta[entranceExitCoords.direction].y; - tileElement = map_get_first_element_at({ mapX, mapY }); + entranceMax = { nextLocation }; + nextLocation.x -= CoordsDirectionDelta[entranceExitCoords.direction].x; + nextLocation.y -= CoordsDirectionDelta[entranceExitCoords.direction].y; + tileElement = map_get_first_element_at(nextLocation); if (tileElement == nullptr) break; bool goToNextTile = false; @@ -1405,25 +1413,25 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (!goToNextTile) break; } - - mapX = entranceMinX; - if (mapX > entranceMaxX) + // swap variables for valid ranges + nextLocation.x = entranceMin.x; + if (nextLocation.x > entranceMax.x) { - entranceMinX = entranceMaxX; - entranceMaxX = mapX; + entranceMin.x = entranceMax.x; + entranceMax.x = nextLocation.x; } - mapY = entranceMinY; - if (mapY > entranceMaxY) + nextLocation.y = entranceMin.y; + if (nextLocation.y > entranceMax.y) { - entranceMinY = entranceMaxY; - entranceMaxY = mapY; + entranceMin.y = entranceMax.y; + entranceMax.y = nextLocation.y; } - - auto direction = loc_6CD18E( - entranceExitCoords.x, entranceExitCoords.y, entranceMinX - 32, entranceMinY - 32, entranceMaxX + 32, - entranceMaxY + 32); - if (direction != -1 && direction != stationDirection && direction != direction_reverse(stationDirection)) + // for a 3xN or Nx3 grid, determine the direction toward the center + auto direction = GetEntranceExitDirection( + entranceExitCoords.x, entranceExitCoords.y, entranceMin.x - 32, entranceMin.y - 32, entranceMax.x + 32, + entranceMax.y + 32); + if (direction != INVALID_DIRECTION && direction != stationDirection && direction != direction_reverse(stationDirection)) { entranceExitCoords.direction = direction; gRideEntranceExitPlaceDirection = entranceExitCoords.direction; @@ -1437,23 +1445,25 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC * * rct2: 0x006CB945 */ -void sub_6CB945(Ride* ride) +void Ride::ValidateStations() { const TrackElementDescriptor* ted; - if (ride->type != RIDE_TYPE_MAZE) + if (type != RIDE_TYPE_MAZE) { + // find the stations of the ride to begin stepping over track elements from for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) { - if (ride->stations[stationId].Start.isNull()) + if (stations[stationId].Start.isNull()) continue; - CoordsXYZ location = ride->stations[stationId].GetStart(); + CoordsXYZ location = stations[stationId].GetStart(); uint8_t direction = INVALID_DIRECTION; bool specialTrack = false; TileElement* tileElement = nullptr; while (true) { + // search backwards for the previous station TrackElement (only if the first station TrackElement is found) if (direction != INVALID_DIRECTION) { location.x -= CoordsDirectionDelta[direction].x; @@ -1463,6 +1473,7 @@ void sub_6CB945(Ride* ride) if (tileElement == nullptr) break; + // find the target TrackElement on the tile it's supposed to appear on bool trackFound = false; do { @@ -1470,12 +1481,13 @@ void sub_6CB945(Ride* ride) continue; if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (tileElement->AsTrack()->GetRideIndex() != ride->id) + if (tileElement->AsTrack()->GetRideIndex() != id) continue; if (tileElement->AsTrack()->GetSequenceIndex() != 0) continue; ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + // keep searching for a station piece (coaster station, tower ride base, shops, and flat ride base) if (!(ted->SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)) continue; @@ -1487,22 +1499,26 @@ void sub_6CB945(Ride* ride) { break; } - + // update the StationIndex, get the TrackElement's rotation tileElement->AsTrack()->SetStationIndex(stationId); direction = tileElement->GetDirection(); - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) + // TODO: update this to look at the ted sequence length + // tower ride, flat ride, shop + if (GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) { + // if the track has multiple sequences, stop looking for the next one. specialTrack = true; break; } } + // if the track piece is not a tower ride, flat ride, or shop, continue to the next StationIndex if (!specialTrack) { continue; } - + // update all the blocks with StationIndex ted = &GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); const rct_preview_track* trackBlock = ted->Block; while ((++trackBlock)->index != 0xFF) @@ -1513,6 +1529,7 @@ void sub_6CB945(Ride* ride) tileElement = map_get_first_element_at(blockLocation); if (tileElement == nullptr) break; + // find the target TrackElement on the tile it's supposed to appear on do { if (blockLocation.z != tileElement->GetBaseZ()) @@ -1530,6 +1547,7 @@ void sub_6CB945(Ride* ride) if (!trackFound) { + // Critical error! Stop trying to find the next sequence to set StationIndex. break; } @@ -1537,22 +1555,22 @@ void sub_6CB945(Ride* ride) } } } - + // determine what entrances and exits exist FixedVector locations; for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) { - auto entrance = ride_get_entrance_location(ride, stationId); + auto entrance = ride_get_entrance_location(this, stationId); if (!entrance.isNull()) { locations.push_back(entrance); - ride_clear_entrance_location(ride, stationId); + ride_clear_entrance_location(this, stationId); } - auto exit = ride_get_exit_location(ride, stationId); + auto exit = ride_get_exit_location(this, stationId); if (!exit.isNull()) { locations.push_back(exit); - ride_clear_exit_location(ride, stationId); + ride_clear_exit_location(this, stationId); } } @@ -1560,7 +1578,8 @@ void sub_6CB945(Ride* ride) for (const TileCoordsXYZD& locationCoords : locations) { auto locationList = ++locationListIter; - + // determine if there's another hut at this location later in the array + // if there is, skip it. The last hut in the array at the location is not skipped bool duplicateLocation = false; while (locationList != locations.cend()) { @@ -1575,9 +1594,10 @@ void sub_6CB945(Ride* ride) if (duplicateLocation) { + // if it's a duplicate continue to the next hut continue; } - + // if it's not a duplicate location CoordsXY location = locationCoords.ToCoordsXY(); TileElement* tileElement = map_get_first_element_at(location); @@ -1589,15 +1609,18 @@ void sub_6CB945(Ride* ride) continue; if (tileElement->base_height != locationCoords.z) continue; - if (tileElement->AsEntrance()->GetRideIndex() != ride->id) + if (tileElement->AsEntrance()->GetRideIndex() != id) continue; + // if it's a park entrance continue to the next tile element if (tileElement->AsEntrance()->GetEntranceType() > ENTRANCE_TYPE_RIDE_EXIT) continue; + // find the station that's connected to this hut CoordsXY nextLocation = location; nextLocation.x += CoordsDirectionDelta[tileElement->GetDirection()].x; nextLocation.y += CoordsDirectionDelta[tileElement->GetDirection()].y; + // if there's no connected station, remove the hut (see below) bool shouldRemove = true; TileElement* trackElement = map_get_first_element_at(nextLocation); if (trackElement == nullptr) @@ -1606,7 +1629,7 @@ void sub_6CB945(Ride* ride) { if (trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (trackElement->AsTrack()->GetRideIndex() != ride->id) + if (trackElement->AsTrack()->GetRideIndex() != id) continue; if (trackElement->base_height != tileElement->base_height) continue; @@ -1614,41 +1637,45 @@ void sub_6CB945(Ride* ride) auto trackType = trackElement->AsTrack()->GetTrackType(); uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); + // determine where the hut is relative to the station track Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; + // if the hut is not on a valid side, remove the hut ted = &GetTrackElementDescriptor(trackType); if (!(ted->SequenceProperties[trackSequence] & (1 << direction))) { continue; } - + // get the StationIndex for the station StationIndex stationId = 0; if (trackType != TrackElemType::Maze) { stationId = trackElement->AsTrack()->GetStationIndex(); } - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) { - if (!ride_get_exit_location(ride, stationId).isNull()) + // if the location is already set for this station, big problem! + if (!ride_get_exit_location(this, stationId).isNull()) break; - - CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; - ride_set_exit_location(ride, stationId, TileCoordsXYZD{ loc }); + // set the station's exit hut location to this hut + CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_exit_location(this, stationId, TileCoordsXYZD{ loc }); } else { - if (!ride_get_entrance_location(ride, stationId).isNull()) + // if the location is already set for this station, big problem! + if (!ride_get_entrance_location(this, stationId).isNull()) break; - - CoordsXYZD loc = { location, ride->stations[stationId].GetBaseZ(), tileElement->GetDirection() }; - ride_set_entrance_location(ride, stationId, TileCoordsXYZD{ loc }); + // set the station's entrance hut location to this hut + CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; + ride_set_entrance_location(this, stationId, TileCoordsXYZD{ loc }); } - + // set the hut's StationIndex as this station tileElement->AsEntrance()->SetStationIndex(stationId); shouldRemove = false; } while (!(trackElement++)->IsLastForTile()); + // remove the hut and clean up if necessary if (shouldRemove) { footpath_queue_chain_reset(); diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index ac21d47da3..fe1c86484b 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -526,10 +526,10 @@ namespace TrackElemType enum { - TRACK_SEQUENCE_FLAG_DIRECTION_0 = (1 << 0), - TRACK_SEQUENCE_FLAG_DIRECTION_1 = (1 << 1), - TRACK_SEQUENCE_FLAG_DIRECTION_2 = (1 << 2), - TRACK_SEQUENCE_FLAG_DIRECTION_3 = (1 << 3), + TRACK_SEQUENCE_FLAG_DIRECTION_0 = (1 << 0), // Huts/path connect to front + TRACK_SEQUENCE_FLAG_DIRECTION_1 = (1 << 1), // Huts/path connect to right + TRACK_SEQUENCE_FLAG_DIRECTION_2 = (1 << 2), // Huts/path connect to back + TRACK_SEQUENCE_FLAG_DIRECTION_3 = (1 << 3), // Huts/path connect to left TRACK_SEQUENCE_FLAG_ORIGIN = (1 << 4), // 0x10 TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH = (1 << 5), // 0x20 TRACK_SEQUENCE_FLAG_DISALLOW_DOORS = (1 << 6), // 0x40 diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index e6394da8fb..c3c042ed5f 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -173,7 +173,8 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) auto trackType = trackElement.element->AsTrack()->GetTrackType(); uint8_t direction = trackElement.element->GetDirection(); _saveDirection = direction; - auto newCoords = sub_6C683D({ trackElement, z, direction }, trackType, 0, &trackElement.element, 0); + auto newCoords = GetTrackElementOriginAndApplyChanges( + { trackElement, z, direction }, trackType, 0, &trackElement.element, 0); if (newCoords == std::nullopt) { @@ -229,7 +230,8 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) z = trackElement.element->GetBaseZ(); direction = trackElement.element->GetDirection(); trackType = trackElement.element->AsTrack()->GetTrackType(); - newCoords = sub_6C683D({ trackElement, z, direction }, trackType, 0, &trackElement.element, 0); + newCoords = GetTrackElementOriginAndApplyChanges( + { trackElement, z, direction }, trackType, 0, &trackElement.element, 0); if (newCoords == std::nullopt) { @@ -1769,7 +1771,7 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co if (_trackDesignPlaceOperation == PTD_OPERATION_REMOVE_GHOST) { - sub_6CB945(ride); + ride->ValidateStations(); ride->Delete(); } return totalCost; From 110ef368b00bb5d6e91fcb19957d09c75263d0b0 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Thu, 2 Sep 2021 19:51:35 -0700 Subject: [PATCH 291/681] update function to TitleCase --- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 4 ++-- src/openrct2/ride/Ride.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 99b2dd5521..1d85230e86 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -331,7 +331,7 @@ static void window_maze_construction_update(rct_window* w) default: break; } - updateGhostTrackAndArrow(); + UpdateGhostTrackAndArrow(); } /** diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 431d4db888..87745e2de8 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2091,7 +2091,7 @@ static void window_ride_construction_update(rct_window* w) break; } - updateGhostTrackAndArrow(); + UpdateGhostTrackAndArrow(); } /** @@ -2529,7 +2529,7 @@ void window_ride_construction_update_enabled_track_pieces() * * rct2: 0x006C94D8 */ -void updateGhostTrackAndArrow() +void UpdateGhostTrackAndArrow() { ride_id_t rideIndex; int32_t direction, type, liftHillAndAlternativeState; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index fcaa9a7ad1..6c4f3a69da 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1219,7 +1219,7 @@ enum class RideSetSetting : uint8_t; money32 set_operating_setting(ride_id_t rideId, RideSetSetting setting, uint8_t value); money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, uint8_t value, uint8_t flags); -void updateGhostTrackAndArrow(); +void UpdateGhostTrackAndArrow(); void ride_reset_all_names(); From 91ca2e58bc9aa5e0698d38b055093eab8215088a Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 3 Sep 2021 04:08:05 +0000 Subject: [PATCH 292/681] Merge Localisation/master into OpenRCT2/develop --- data/language/de-DE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index c6a3e8299f..fbfe49efbf 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -3650,6 +3650,7 @@ STR_6452 :{WINDOW_COLOUR_2}Verkauft: {BLACK}{STRING} STR_6453 :Versionsinfo kopieren STR_6454 :Kann Banner nicht umbenennen … STR_6455 :Kann Schild nicht umbenennen … +STR_6456 :Riesiger Screenshot ############# # Scenarios # From 1f4f0c015c3a5e65e5ef67ffe01d980fc49e508f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 13:43:06 +0300 Subject: [PATCH 293/681] Fix ownership of loaded object data --- src/openrct2/object/ObjectManager.cpp | 287 ++++++++++----------- src/openrct2/object/ObjectRepository.cpp | 6 +- src/openrct2/object/ObjectRepository.h | 4 +- src/openrct2/object/SceneryGroupObject.cpp | 2 +- 4 files changed, 142 insertions(+), 157 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index b72f6c0bd8..c0bcc39faa 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -36,7 +36,8 @@ class ObjectManager final : public IObjectManager { private: IObjectRepository& _objectRepository; - std::vector> _loadedObjects; + + std::vector _loadedObjects; std::array, RIDE_TYPE_COUNT> _rideTypeToObjectMap; // Used to return a safe empty vector back from GetAllRideEntries, can be removed when std::span is available @@ -63,7 +64,7 @@ public: { return nullptr; } - return _loadedObjects[index].get(); + return _loadedObjects[index]; } Object* GetLoadedObject(ObjectType objectType, size_t index) override @@ -82,13 +83,11 @@ public: Object* GetLoadedObject(const ObjectEntryDescriptor& entry) override { - Object* loadedObject = nullptr; const ObjectRepositoryItem* ori = _objectRepository.FindObject(entry); - if (ori != nullptr) - { - loadedObject = ori->LoadedObject; - } - return loadedObject; + if (ori == nullptr) + return nullptr; + + return ori->LoadedObject.get(); } ObjectEntryIndex GetLoadedObjectEntryIndex(const Object* object) override @@ -142,7 +141,7 @@ public: const ObjectRepositoryItem* ori = _objectRepository.FindObject(&entry); if (ori != nullptr) { - Object* loadedObject = ori->LoadedObject; + Object* loadedObject = ori->LoadedObject.get(); if (loadedObject != nullptr) { UnloadObject(loadedObject); @@ -162,7 +161,7 @@ public: { for (auto& object : _loadedObjects) { - UnloadObject(object.get()); + UnloadObject(object); } UpdateSceneryGroupIndexes(); ResetTypeToRideEntryIndexMap(); @@ -333,42 +332,42 @@ private: Object* RepositoryItemToObject(const ObjectRepositoryItem* ori, std::optional slot = {}) { - Object* loadedObject = nullptr; - if (ori != nullptr) + if (ori == nullptr) + return nullptr; + + Object* loadedObject = ori->LoadedObject.get(); + if (loadedObject != nullptr) + return loadedObject; + + ObjectType objectType = ori->ObjectEntry.GetType(); + if (slot) { - loadedObject = ori->LoadedObject; - if (loadedObject == nullptr) + if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) { - ObjectType objectType = ori->ObjectEntry.GetType(); - if (slot) - { - if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) - { - // Slot already taken - return nullptr; - } - } - else - { - slot = FindSpareSlot(objectType); - } - if (slot) - { - auto object = GetOrLoadObject(ori); - if (object != nullptr) - { - if (_loadedObjects.size() <= static_cast(*slot)) - { - _loadedObjects.resize(*slot + 1); - } - loadedObject = object.get(); - _loadedObjects[*slot] = std::move(object); - UpdateSceneryGroupIndexes(); - ResetTypeToRideEntryIndexMap(); - } - } + // Slot already taken + return nullptr; } } + else + { + slot = FindSpareSlot(objectType); + } + if (slot) + { + auto object = GetOrLoadObject(ori); + if (object != nullptr) + { + if (_loadedObjects.size() <= static_cast(*slot)) + { + _loadedObjects.resize(*slot + 1); + } + loadedObject = object; + _loadedObjects[*slot] = object; + UpdateSceneryGroupIndexes(); + ResetTypeToRideEntryIndexMap(); + } + } + return loadedObject; } @@ -396,8 +395,7 @@ private: Guard::ArgumentNotNull(object, GUARD_LINE); auto result = std::numeric_limits().max(); - auto it = std::find_if( - _loadedObjects.begin(), _loadedObjects.end(), [object](auto& obj) { return obj.get() == object; }); + auto it = std::find_if(_loadedObjects.begin(), _loadedObjects.end(), [object](auto& obj) { return obj == object; }); if (it != _loadedObjects.end()) { result = std::distance(_loadedObjects.begin(), it); @@ -405,7 +403,7 @@ private: return result; } - void SetNewLoadedObjectList(std::vector>&& newLoadedObjects) + void SetNewLoadedObjectList(std::vector&& newLoadedObjects) { if (newLoadedObjects.empty()) { @@ -420,30 +418,24 @@ private: void UnloadObject(Object* object) { - if (object != nullptr) + if (object == nullptr) + return; + + object->Unload(); + + // TODO try to prevent doing a repository search + const ObjectRepositoryItem* ori = _objectRepository.FindObject(object->GetObjectEntry()); + if (ori != nullptr) { - object->Unload(); - - // TODO try to prevent doing a repository search - const ObjectRepositoryItem* ori = _objectRepository.FindObject(object->GetObjectEntry()); - if (ori != nullptr) - { - _objectRepository.UnregisterLoadedObject(ori, object); - } - - // Because it's possible to have the same loaded object for multiple - // slots, we have to make sure find and set all of them to nullptr - for (auto& obj : _loadedObjects) - { - if (obj.get() == object) - { - obj = nullptr; - } - } + _objectRepository.UnregisterLoadedObject(ori, object); } + + // Because it's possible to have the same loaded object for multiple + // slots, we have to make sure find and set all of them to nullptr + std::replace(_loadedObjects.begin(), _loadedObjects.end(), object, static_cast(nullptr)); } - void UnloadObjectsExcept(const std::vector>& newLoadedObjects) + void UnloadObjectsExcept(const std::vector& newLoadedObjects) { // Build a hash set for quick checking auto exceptSet = std::unordered_set(); @@ -451,7 +443,7 @@ private: { if (object != nullptr) { - exceptSet.insert(object.get()); + exceptSet.insert(object); } } @@ -463,9 +455,9 @@ private: if (object != nullptr) { totalObjectsLoaded++; - if (exceptSet.find(object.get()) == exceptSet.end()) + if (exceptSet.find(object) == exceptSet.end()) { - UnloadObject(object.get()); + UnloadObject(object); numObjectsUnloaded++; } } @@ -478,50 +470,51 @@ private: { for (auto& loadedObject : _loadedObjects) { - if (loadedObject != nullptr) + // The list can contain unused slots, skip them. + if (loadedObject == nullptr) + continue; + + switch (loadedObject->GetObjectType()) { - switch (loadedObject->GetObjectType()) + case ObjectType::SmallScenery: { - case ObjectType::SmallScenery: - { - auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); - sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject.get()); - break; - } - case ObjectType::LargeScenery: - { - auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); - sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject.get()); - break; - } - case ObjectType::Walls: - { - auto* wallEntry = static_cast(loadedObject->GetLegacyData()); - wallEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject.get()); - break; - } - case ObjectType::Banners: - { - auto* bannerEntry = static_cast(loadedObject->GetLegacyData()); - bannerEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject.get()); - break; - } - case ObjectType::PathBits: - { - auto* pathBitEntry = static_cast(loadedObject->GetLegacyData()); - pathBitEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject.get()); - break; - } - case ObjectType::SceneryGroup: - { - auto sgObject = dynamic_cast(loadedObject.get()); - sgObject->UpdateEntryIndexes(); - break; - } - default: - // This switch only handles scenery ObjectTypes. - break; + auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); + sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + break; } + case ObjectType::LargeScenery: + { + auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); + sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + break; + } + case ObjectType::Walls: + { + auto* wallEntry = static_cast(loadedObject->GetLegacyData()); + wallEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + break; + } + case ObjectType::Banners: + { + auto* bannerEntry = static_cast(loadedObject->GetLegacyData()); + bannerEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + break; + } + case ObjectType::PathBits: + { + auto* pathBitEntry = static_cast(loadedObject->GetLegacyData()); + pathBitEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + break; + } + case ObjectType::SceneryGroup: + { + auto sgObject = dynamic_cast(loadedObject); + sgObject->UpdateEntryIndexes(); + break; + } + default: + // This switch only handles scenery ObjectTypes. + break; } } @@ -583,7 +576,7 @@ private: } else { - auto loadedObject = ori->LoadedObject; + auto* loadedObject = ori->LoadedObject.get(); if (loadedObject == nullptr) { auto object = _objectRepository.LoadObject(ori); @@ -651,61 +644,51 @@ private: } } - std::vector> LoadObjects( - std::vector& requiredObjects, size_t* outNewObjectsLoaded) + std::vector LoadObjects(std::vector& requiredObjects, size_t* outNewObjectsLoaded) { - std::vector> objects; - std::vector loadedObjects; + std::vector objects; + std::vector newLoadedObjects; std::vector badObjects; objects.resize(OBJECT_ENTRY_COUNT); - loadedObjects.reserve(OBJECT_ENTRY_COUNT); + newLoadedObjects.reserve(OBJECT_ENTRY_COUNT); // Read objects std::mutex commonMutex; - ParallelFor(requiredObjects, [this, &commonMutex, requiredObjects, &objects, &badObjects, &loadedObjects](size_t i) { + ParallelFor(requiredObjects, [this, &commonMutex, requiredObjects, &objects, &badObjects, &newLoadedObjects](size_t i) { auto requiredObject = requiredObjects[i]; - std::unique_ptr object; + Object* object = nullptr; if (requiredObject != nullptr) { - auto loadedObject = requiredObject->LoadedObject; + auto loadedObject = requiredObject->LoadedObject.get(); if (loadedObject == nullptr) { // Object requires to be loaded, if the object successfully loads it will register it // as a loaded object otherwise placed into the badObjects list. - object = _objectRepository.LoadObject(requiredObject); + auto newObject = _objectRepository.LoadObject(requiredObject); std::lock_guard guard(commonMutex); - if (object == nullptr) + if (newObject == nullptr) { badObjects.push_back(requiredObject->ObjectEntry); ReportObjectLoadProblem(&requiredObject->ObjectEntry); } else { - loadedObjects.push_back(object.get()); + object = newObject.get(); + newLoadedObjects.push_back(object); // Connect the ori to the registered object - _objectRepository.RegisterLoadedObject(requiredObject, object.get()); + _objectRepository.RegisterLoadedObject(requiredObject, std::move(newObject)); } } else { - // The object is already loaded, given that the new list will be used as the next loaded object list, - // we can move the element out safely. This is required as the resulting list must contain all loaded - // objects and not just the newly loaded ones. - std::lock_guard guard(commonMutex); - auto it = std::find_if(_loadedObjects.begin(), _loadedObjects.end(), [loadedObject](const auto& obj) { - return obj.get() == loadedObject; - }); - if (it != _loadedObjects.end()) - { - object = std::move(*it); - } + object = loadedObject; } } - objects[i] = std::move(object); + objects[i] = object; }); // Load objects - for (auto obj : loadedObjects) + for (auto obj : newLoadedObjects) { obj->Load(); } @@ -713,7 +696,7 @@ private: if (!badObjects.empty()) { // Unload all the new objects we loaded - for (auto object : loadedObjects) + for (auto object : newLoadedObjects) { UnloadObject(object); } @@ -722,28 +705,30 @@ private: if (outNewObjectsLoaded != nullptr) { - *outNewObjectsLoaded = loadedObjects.size(); + *outNewObjectsLoaded = newLoadedObjects.size(); } return objects; } - std::unique_ptr GetOrLoadObject(const ObjectRepositoryItem* ori) + Object* GetOrLoadObject(const ObjectRepositoryItem* ori) { - std::unique_ptr object; - auto loadedObject = ori->LoadedObject; - if (loadedObject == nullptr) - { - // Try to load object - object = _objectRepository.LoadObject(ori); - if (object != nullptr) - { - object->Load(); + auto* loadedObject = ori->LoadedObject.get(); + if (loadedObject != nullptr) + return loadedObject; - // Connect the ori to the registered object - _objectRepository.RegisterLoadedObject(ori, object.get()); - } + // Try to load object + auto object = _objectRepository.LoadObject(ori); + if (object != nullptr) + { + loadedObject = object.get(); + + object->Load(); + + // Connect the ori to the registered object + _objectRepository.RegisterLoadedObject(ori, std::move(object)); } - return object; + + return loadedObject; } void ResetTypeToRideEntryIndexMap() diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index e436e36563..ea19c419bf 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -266,18 +266,18 @@ public: } } - void RegisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) override + void RegisterLoadedObject(const ObjectRepositoryItem* ori, std::unique_ptr&& object) override { ObjectRepositoryItem* item = &_items[ori->Id]; Guard::Assert(item->LoadedObject == nullptr, GUARD_LINE); - item->LoadedObject = object; + item->LoadedObject = std::move(object); } void UnregisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) override { ObjectRepositoryItem* item = &_items[ori->Id]; - if (item->LoadedObject == object) + if (item->LoadedObject.get() == object) { item->LoadedObject = nullptr; } diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 049fb54fe0..e6de1cce14 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -43,7 +43,7 @@ struct ObjectRepositoryItem std::string Name; std::vector Authors; std::vector Sources; - Object* LoadedObject{}; + std::shared_ptr LoadedObject{}; struct { uint8_t RideFlags; @@ -82,7 +82,7 @@ struct IObjectRepository [[nodiscard]] virtual const ObjectRepositoryItem* FindObject(const ObjectEntryDescriptor& oed) const abstract; [[nodiscard]] virtual std::unique_ptr LoadObject(const ObjectRepositoryItem* ori) abstract; - virtual void RegisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; + virtual void RegisterLoadedObject(const ObjectRepositoryItem* ori, std::unique_ptr&& object) abstract; virtual void UnregisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; virtual void AddObject(const rct_object_entry* objectEntry, const void* data, size_t dataSize) abstract; diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index aa6a8bfd20..166245d8b1 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -81,7 +81,7 @@ void SceneryGroupObject::UpdateEntryIndexes() if (ori->LoadedObject == nullptr) continue; - auto entryIndex = objectManager.GetLoadedObjectEntryIndex(ori->LoadedObject); + auto entryIndex = objectManager.GetLoadedObjectEntryIndex(ori->LoadedObject.get()); Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE); auto sceneryType = ori->ObjectEntry.GetSceneryType(); From a44f3017dc276843bb5f1bb2de9004054688d967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:01:34 +0300 Subject: [PATCH 294/681] Move the log print and remove optional parameter --- src/openrct2/object/ObjectManager.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index c0bcc39faa..14902b118c 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -119,14 +119,17 @@ public: auto requiredObjects = GetRequiredObjects(entries, count); // Load the required objects - size_t numNewLoadedObjects = 0; - auto loadedObjects = LoadObjects(requiredObjects, &numNewLoadedObjects); + { + auto loadedObjects = LoadObjects(requiredObjects); + SetNewLoadedObjectList(std::move(loadedObjects)); + } - SetNewLoadedObjectList(std::move(loadedObjects)); + // Load defaults. LoadDefaultObjects(); + + // Update indices. UpdateSceneryGroupIndexes(); ResetTypeToRideEntryIndexMap(); - log_verbose("%u / %u new objects loaded", numNewLoadedObjects, requiredObjects.size()); } void UnloadObjects(const std::vector& entries) override @@ -644,7 +647,7 @@ private: } } - std::vector LoadObjects(std::vector& requiredObjects, size_t* outNewObjectsLoaded) + std::vector LoadObjects(std::vector& requiredObjects) { std::vector objects; std::vector newLoadedObjects; @@ -703,10 +706,7 @@ private: throw ObjectLoadException(std::move(badObjects)); } - if (outNewObjectsLoaded != nullptr) - { - *outNewObjectsLoaded = newLoadedObjects.size(); - } + log_verbose("%u / %u new objects loaded", newLoadedObjects.size(), requiredObjects.size()); return objects; } From 976c6148812f0ccf1ea9b43236e28631f37980df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:08:17 +0300 Subject: [PATCH 295/681] Reduce duplicate code --- src/openrct2/object/ObjectManager.cpp | 42 ++++++++++++--------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 14902b118c..ef84127b3d 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -469,6 +469,18 @@ private: log_verbose("%u / %u objects unloaded", numObjectsUnloaded, totalObjectsLoaded); } + template static void UpdateSceneryGroupIndexes(Object* object) + { + auto* sceneryEntry = static_cast(object->GetLegacyData()); + sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + } + + template<> static void UpdateSceneryGroupIndexes(Object* object) + { + auto sgObject = dynamic_cast(object); + sgObject->UpdateEntryIndexes(); + } + void UpdateSceneryGroupIndexes() { for (auto& loadedObject : _loadedObjects) @@ -480,41 +492,23 @@ private: switch (loadedObject->GetObjectType()) { case ObjectType::SmallScenery: - { - auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); - sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + UpdateSceneryGroupIndexes(loadedObject); break; - } case ObjectType::LargeScenery: - { - auto* sceneryEntry = static_cast(loadedObject->GetLegacyData()); - sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + UpdateSceneryGroupIndexes(loadedObject); break; - } case ObjectType::Walls: - { - auto* wallEntry = static_cast(loadedObject->GetLegacyData()); - wallEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + UpdateSceneryGroupIndexes(loadedObject); break; - } case ObjectType::Banners: - { - auto* bannerEntry = static_cast(loadedObject->GetLegacyData()); - bannerEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + UpdateSceneryGroupIndexes(loadedObject); break; - } case ObjectType::PathBits: - { - auto* pathBitEntry = static_cast(loadedObject->GetLegacyData()); - pathBitEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); + UpdateSceneryGroupIndexes(loadedObject); break; - } case ObjectType::SceneryGroup: - { - auto sgObject = dynamic_cast(loadedObject); - sgObject->UpdateEntryIndexes(); + UpdateSceneryGroupIndexes(loadedObject); break; - } default: // This switch only handles scenery ObjectTypes. break; From a118b1691254844852539e63fc48036e8315f78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:10:42 +0300 Subject: [PATCH 296/681] Remove unused functions --- src/openrct2/object/ObjectManager.cpp | 61 --------------------------- src/openrct2/object/ObjectManager.h | 1 - 2 files changed, 62 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index ef84127b3d..4a125b8ad1 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -534,60 +534,6 @@ private: return entryIndex; } - rct_object_entry* DuplicateObjectEntry(const rct_object_entry* original) - { - rct_object_entry* duplicate = Memory::Allocate(sizeof(rct_object_entry)); - duplicate->checksum = original->checksum; - strncpy(duplicate->name, original->name, 8); - duplicate->flags = original->flags; - return duplicate; - } - - std::vector GetInvalidObjects(const rct_object_entry* entries) override - { - std::vector invalidEntries; - invalidEntries.reserve(OBJECT_ENTRY_COUNT); - for (int32_t i = 0; i < OBJECT_ENTRY_COUNT; i++) - { - auto entry = entries[i]; - const ObjectRepositoryItem* ori = nullptr; - if (object_entry_is_empty(&entry)) - { - entry = {}; - continue; - } - - ori = _objectRepository.FindObject(&entry); - if (ori == nullptr) - { - if (entry.GetType() != ObjectType::ScenarioText) - { - invalidEntries.push_back(entry); - ReportMissingObject(&entry); - } - else - { - entry = {}; - continue; - } - } - else - { - auto* loadedObject = ori->LoadedObject.get(); - if (loadedObject == nullptr) - { - auto object = _objectRepository.LoadObject(ori); - if (object == nullptr) - { - invalidEntries.push_back(entry); - ReportObjectLoadProblem(&entry); - } - } - } - } - return invalidEntries; - } - std::vector GetRequiredObjects(const rct_object_entry* entries, size_t count) { std::vector requiredObjects; @@ -787,13 +733,6 @@ std::unique_ptr CreateObjectManager(IObjectRepository& objectRep return std::make_unique(objectRepository); } -Object* object_manager_get_loaded_object_by_index(size_t index) -{ - auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); - Object* loadedObject = objectManager.GetLoadedObject(index); - return loadedObject; -} - Object* object_manager_get_loaded_object(const ObjectEntryDescriptor& entry) { auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 1dbf7fc2a5..ed22926211 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -45,7 +45,6 @@ struct IObjectManager [[nodiscard]] std::unique_ptr CreateObjectManager(IObjectRepository& objectRepository); -[[nodiscard]] Object* object_manager_get_loaded_object_by_index(size_t index); [[nodiscard]] Object* object_manager_get_loaded_object(const ObjectEntryDescriptor& entry); [[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const Object* loadedObject); [[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const ObjectEntryDescriptor& entry); From cf0425d9538d05f194a45dc37cbb3bd738cdbf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:17:53 +0300 Subject: [PATCH 297/681] Fix building --- src/openrct2/object/ObjectManager.cpp | 15 ++++++--------- src/openrct2/object/ObjectManager.h | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 4a125b8ad1..acb487a00e 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -469,16 +469,10 @@ private: log_verbose("%u / %u objects unloaded", numObjectsUnloaded, totalObjectsLoaded); } - template static void UpdateSceneryGroupIndexes(Object* object) + template void UpdateSceneryGroupIndexes(Object* object) { auto* sceneryEntry = static_cast(object->GetLegacyData()); - sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(loadedObject); - } - - template<> static void UpdateSceneryGroupIndexes(Object* object) - { - auto sgObject = dynamic_cast(object); - sgObject->UpdateEntryIndexes(); + sceneryEntry->scenery_tab_id = GetPrimarySceneryGroupEntryIndex(object); } void UpdateSceneryGroupIndexes() @@ -507,8 +501,11 @@ private: UpdateSceneryGroupIndexes(loadedObject); break; case ObjectType::SceneryGroup: - UpdateSceneryGroupIndexes(loadedObject); + { + auto sgObject = dynamic_cast(loadedObject); + sgObject->UpdateEntryIndexes(); break; + } default: // This switch only handles scenery ObjectTypes. break; diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index ed22926211..a93b9f5c10 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -28,7 +28,6 @@ struct IObjectManager virtual Object* GetLoadedObject(ObjectType objectType, size_t index) abstract; virtual Object* GetLoadedObject(const ObjectEntryDescriptor& entry) abstract; virtual ObjectEntryIndex GetLoadedObjectEntryIndex(const Object* object) abstract; - virtual std::vector GetInvalidObjects(const rct_object_entry* entries) abstract; virtual Object* LoadObject(std::string_view identifier) abstract; virtual Object* LoadObject(const rct_object_entry* entry) abstract; From 6186b29675567fc085f71251a42ae867e50c9026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 16:26:13 +0300 Subject: [PATCH 298/681] Apply review suggestion --- src/openrct2/object/ObjectManager.cpp | 93 +++++++++++++-------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index acb487a00e..85e9871e6d 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -119,10 +119,7 @@ public: auto requiredObjects = GetRequiredObjects(entries, count); // Load the required objects - { - auto loadedObjects = LoadObjects(requiredObjects); - SetNewLoadedObjectList(std::move(loadedObjects)); - } + LoadObjects(requiredObjects); // Load defaults. LoadDefaultObjects(); @@ -162,7 +159,7 @@ public: void UnloadAll() override { - for (auto& object : _loadedObjects) + for (auto* object : _loadedObjects) { UnloadObject(object); } @@ -357,7 +354,7 @@ private: } if (slot) { - auto object = GetOrLoadObject(ori); + auto* object = GetOrLoadObject(ori); if (object != nullptr) { if (_loadedObjects.size() <= static_cast(*slot)) @@ -398,7 +395,7 @@ private: Guard::ArgumentNotNull(object, GUARD_LINE); auto result = std::numeric_limits().max(); - auto it = std::find_if(_loadedObjects.begin(), _loadedObjects.end(), [object](auto& obj) { return obj == object; }); + auto it = std::find(_loadedObjects.begin(), _loadedObjects.end(), object); if (it != _loadedObjects.end()) { result = std::distance(_loadedObjects.begin(), it); @@ -406,19 +403,6 @@ private: return result; } - void SetNewLoadedObjectList(std::vector&& newLoadedObjects) - { - if (newLoadedObjects.empty()) - { - UnloadAll(); - } - else - { - UnloadObjectsExcept(newLoadedObjects); - } - _loadedObjects = std::move(newLoadedObjects); - } - void UnloadObject(Object* object) { if (object == nullptr) @@ -453,16 +437,16 @@ private: // Unload objects that are not in the hash set size_t totalObjectsLoaded = 0; size_t numObjectsUnloaded = 0; - for (auto& object : _loadedObjects) + for (auto* object : _loadedObjects) { - if (object != nullptr) + if (object == nullptr) + continue; + + totalObjectsLoaded++; + if (exceptSet.find(object) == exceptSet.end()) { - totalObjectsLoaded++; - if (exceptSet.find(object) == exceptSet.end()) - { - UnloadObject(object); - numObjectsUnloaded++; - } + UnloadObject(object); + numObjectsUnloaded++; } } @@ -477,7 +461,7 @@ private: void UpdateSceneryGroupIndexes() { - for (auto& loadedObject : _loadedObjects) + for (auto* loadedObject : _loadedObjects) { // The list can contain unused slots, skip them. if (loadedObject == nullptr) @@ -519,7 +503,7 @@ private: ObjectEntryIndex GetPrimarySceneryGroupEntryIndex(Object* loadedObject) { - auto sceneryObject = dynamic_cast(loadedObject); + auto* sceneryObject = dynamic_cast(loadedObject); const auto& primarySGEntry = sceneryObject->GetPrimarySceneryGroup(); Object* sgObject = GetLoadedObject(primarySGEntry); @@ -584,7 +568,7 @@ private: } } - std::vector LoadObjects(std::vector& requiredObjects) + void LoadObjects(std::vector& requiredObjects) { std::vector objects; std::vector newLoadedObjects; @@ -595,11 +579,11 @@ private: // Read objects std::mutex commonMutex; ParallelFor(requiredObjects, [this, &commonMutex, requiredObjects, &objects, &badObjects, &newLoadedObjects](size_t i) { - auto requiredObject = requiredObjects[i]; + auto* requiredObject = requiredObjects[i]; Object* object = nullptr; if (requiredObject != nullptr) { - auto loadedObject = requiredObject->LoadedObject.get(); + auto* loadedObject = requiredObject->LoadedObject.get(); if (loadedObject == nullptr) { // Object requires to be loaded, if the object successfully loads it will register it @@ -628,7 +612,7 @@ private: }); // Load objects - for (auto obj : newLoadedObjects) + for (auto* obj : newLoadedObjects) { obj->Load(); } @@ -636,15 +620,26 @@ private: if (!badObjects.empty()) { // Unload all the new objects we loaded - for (auto object : newLoadedObjects) + for (auto* object : newLoadedObjects) { UnloadObject(object); } throw ObjectLoadException(std::move(badObjects)); } + // Unload objects which are not in the required list. + if (objects.empty()) + { + UnloadAll(); + } + else + { + UnloadObjectsExcept(objects); + } + + _loadedObjects = std::move(objects); + log_verbose("%u / %u new objects loaded", newLoadedObjects.size(), requiredObjects.size()); - return objects; } Object* GetOrLoadObject(const ObjectRepositoryItem* ori) @@ -677,23 +672,23 @@ private: } // Build object lists - auto maxRideObjects = static_cast(object_entry_group_counts[EnumValue(ObjectType::Ride)]); + const auto maxRideObjects = static_cast(object_entry_group_counts[EnumValue(ObjectType::Ride)]); for (size_t i = 0; i < maxRideObjects; i++) { - auto rideObject = static_cast(GetLoadedObject(ObjectType::Ride, i)); - if (rideObject != nullptr) + auto* rideObject = static_cast(GetLoadedObject(ObjectType::Ride, i)); + if (rideObject == nullptr) + continue; + + const auto* entry = static_cast(rideObject->GetLegacyData()); + if (entry == nullptr) + continue; + + for (auto rideType : entry->ride_type) { - const auto entry = static_cast(rideObject->GetLegacyData()); - if (entry != nullptr) + if (rideType < _rideTypeToObjectMap.size()) { - for (auto rideType : entry->ride_type) - { - if (rideType < _rideTypeToObjectMap.size()) - { - auto& v = _rideTypeToObjectMap[rideType]; - v.push_back(static_cast(i)); - } - } + auto& v = _rideTypeToObjectMap[rideType]; + v.push_back(static_cast(i)); } } } From 0794dbf1126630b5d5bc2f3e33a11e522e626da5 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Fri, 3 Sep 2021 10:08:01 -0700 Subject: [PATCH 299/681] rename huts --- src/openrct2/ride/RideConstruction.cpp | 2 +- src/openrct2/ride/Track.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 2cfa63038c..da9c19b514 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1503,7 +1503,7 @@ void Ride::ValidateStations() tileElement->AsTrack()->SetStationIndex(stationId); direction = tileElement->GetDirection(); - // TODO: update this to look at the ted sequence length + // In the future this could look at the TED and see if the station has a sequence longer than 1 // tower ride, flat ride, shop if (GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) { diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index fe1c86484b..5ad39ed0c2 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -526,10 +526,10 @@ namespace TrackElemType enum { - TRACK_SEQUENCE_FLAG_DIRECTION_0 = (1 << 0), // Huts/path connect to front - TRACK_SEQUENCE_FLAG_DIRECTION_1 = (1 << 1), // Huts/path connect to right - TRACK_SEQUENCE_FLAG_DIRECTION_2 = (1 << 2), // Huts/path connect to back - TRACK_SEQUENCE_FLAG_DIRECTION_3 = (1 << 3), // Huts/path connect to left + TRACK_SEQUENCE_FLAG_DIRECTION_0 = (1 << 0), // Ride Entrances and path connect to front + TRACK_SEQUENCE_FLAG_DIRECTION_1 = (1 << 1), // connect to right + TRACK_SEQUENCE_FLAG_DIRECTION_2 = (1 << 2), // connect to back + TRACK_SEQUENCE_FLAG_DIRECTION_3 = (1 << 3), // connect to left TRACK_SEQUENCE_FLAG_ORIGIN = (1 << 4), // 0x10 TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH = (1 << 5), // 0x20 TRACK_SEQUENCE_FLAG_DISALLOW_DOORS = (1 << 6), // 0x40 From af99bc28c7da327eb84d4bbc83149dce8c6c00f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 23:29:22 +0300 Subject: [PATCH 300/681] Make S4 RideType a strong enum --- src/openrct2/rct1/RCT1.h | 188 +++++++++++++++---------------- src/openrct2/rct1/S4Importer.cpp | 57 +++++----- src/openrct2/rct1/T4Importer.cpp | 6 +- src/openrct2/rct1/Tables.cpp | 70 ++++++------ src/openrct2/rct1/Tables.h | 8 +- 5 files changed, 168 insertions(+), 161 deletions(-) diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 12682df6a0..0eddfbcf0b 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -34,6 +34,98 @@ namespace RCT1 constexpr const uint32_t RCT1_NUM_TERRAIN_SURFACES = 16; constexpr const uint32_t RCT1_NUM_TERRAIN_EDGES = 15; + enum class RideType : uint8_t + { + RCT1_RIDE_TYPE_NULL = 255, + RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER = 0, + RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER, + RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER, + RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER, + RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER, + RCT1_RIDE_TYPE_MINIATURE_RAILWAY, + RCT1_RIDE_TYPE_MONORAIL, + RCT1_RIDE_TYPE_SUSPENDED_SINGLE_RAIL_ROLLER_COASTER, + RCT1_RIDE_TYPE_BOAT_HIRE, + RCT1_RIDE_TYPE_WOODEN_CRAZY_RODENT_ROLLER_COASTER, + RCT1_RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, + RCT1_RIDE_TYPE_CAR_RIDE, + RCT1_RIDE_TYPE_LAUNCHED_FREEFALL, + RCT1_RIDE_TYPE_BOBSLED_ROLLER_COASTER, + RCT1_RIDE_TYPE_OBSERVATION_TOWER, + RCT1_RIDE_TYPE_STEEL_ROLLER_COASTER, + RCT1_RIDE_TYPE_WATER_SLIDE, + RCT1_RIDE_TYPE_MINE_TRAIN_ROLLER_COASTER, + RCT1_RIDE_TYPE_CHAIRLIFT, + RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER, + RCT1_RIDE_TYPE_HEDGE_MAZE, + RCT1_RIDE_TYPE_SPIRAL_SLIDE, + RCT1_RIDE_TYPE_GO_KARTS, + RCT1_RIDE_TYPE_LOG_FLUME, + RCT1_RIDE_TYPE_RIVER_RAPIDS, + RCT1_RIDE_TYPE_DODGEMS, + RCT1_RIDE_TYPE_SWINGING_SHIP, + RCT1_RIDE_TYPE_SWINGING_INVERTER_SHIP, + RCT1_RIDE_TYPE_ICE_CREAM_STALL, + RCT1_RIDE_TYPE_CHIPS_STALL, + RCT1_RIDE_TYPE_DRINK_STALL, + RCT1_RIDE_TYPE_CANDYFLOSS_STALL, + RCT1_RIDE_TYPE_BURGER_BAR, + RCT1_RIDE_TYPE_MERRY_GO_ROUND, + RCT1_RIDE_TYPE_BALLOON_STALL, + RCT1_RIDE_TYPE_INFORMATION_KIOSK, + RCT1_RIDE_TYPE_TOILETS, + RCT1_RIDE_TYPE_FERRIS_WHEEL, + RCT1_RIDE_TYPE_MOTION_SIMULATOR, + RCT1_RIDE_TYPE_3D_CINEMA, + RCT1_RIDE_TYPE_TOP_SPIN, + RCT1_RIDE_TYPE_SPACE_RINGS, + RCT1_RIDE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER, + RCT1_RIDE_TYPE_SOUVENIR_STALL, + RCT1_RIDE_TYPE_VERTICAL_ROLLER_COASTER, + RCT1_RIDE_TYPE_PIZZA_STALL, + RCT1_RIDE_TYPE_TWIST, + RCT1_RIDE_TYPE_HAUNTED_HOUSE, + RCT1_RIDE_TYPE_POPCORN_STALL, + RCT1_RIDE_TYPE_CIRCUS, + RCT1_RIDE_TYPE_GHOST_TRAIN, + RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_WOODEN_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_WOODEN_SIDE_FRICTION_ROLLER_COASTER, + RCT1_RIDE_TYPE_STEEL_WILD_MOUSE_ROLLER_COASTER, + RCT1_RIDE_TYPE_HOT_DOG_STALL, + RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL, + RCT1_RIDE_TYPE_HAT_STALL, + RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL, + RCT1_RIDE_TYPE_VIRGINIA_REEL, + RCT1_RIDE_TYPE_RIVER_RIDE, + RCT1_RIDE_TYPE_CYCLE_MONORAIL, + RCT1_RIDE_TYPE_FLYING_ROLLER_COASTER, + RCT1_RIDE_TYPE_SUSPENDED_MONORAIL, + RCT1_RIDE_TYPE_40, + RCT1_RIDE_TYPE_WOODEN_REVERSER_ROLLER_COASTER, + RCT1_RIDE_TYPE_HEARTLINE_TWISTER_ROLLER_COASTER, + RCT1_RIDE_TYPE_MINIATURE_GOLF, + RCT1_RIDE_TYPE_44, + RCT1_RIDE_TYPE_ROTO_DROP, + RCT1_RIDE_TYPE_FLYING_SAUCERS, + RCT1_RIDE_TYPE_CROOKED_HOUSE, + RCT1_RIDE_TYPE_CYCLE_RAILWAY, + RCT1_RIDE_TYPE_SUSPENDED_LOOPING_ROLLER_COASTER, + RCT1_RIDE_TYPE_WATER_COASTER, + RCT1_RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, + RCT1_RIDE_TYPE_INVERTED_WILD_MOUSE_COASTER, + RCT1_RIDE_TYPE_JET_SKIS, + RCT1_RIDE_TYPE_T_SHIRT_STALL, + RCT1_RIDE_TYPE_RAFT_RIDE, + RCT1_RIDE_TYPE_DOUGHNUT_SHOP, + RCT1_RIDE_TYPE_ENTERPRISE, + RCT1_RIDE_TYPE_COFFEE_SHOP, + RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL, + RCT1_RIDE_TYPE_LEMONADE_STALL, + + RCT1_RIDE_TYPE_COUNT + }; + #pragma pack(push, 1) struct Entrance { @@ -50,7 +142,7 @@ namespace RCT1 */ struct Ride { - uint8_t type; // 0x000 + RideType type; // 0x000 uint8_t vehicle_type; // 0x001 uint16_t lifecycle_flags; // 0x002 uint8_t operating_mode; // 0x004 @@ -720,7 +812,7 @@ namespace RCT1 */ struct TD4 { - uint8_t type; // 0x00 + RideType type; // 0x00 uint8_t vehicle_type; uint32_t flags; // 0x02 uint8_t mode; // 0x06 @@ -779,98 +871,6 @@ namespace RCT1 assert_struct_size(TD4AA, 0xC4); #pragma pack(pop) - enum - { - RCT1_RIDE_TYPE_NULL = 255, - RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER = 0, - RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER, - RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_RAILWAY, - RCT1_RIDE_TYPE_MONORAIL, - RCT1_RIDE_TYPE_SUSPENDED_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_BOAT_HIRE, - RCT1_RIDE_TYPE_WOODEN_CRAZY_RODENT_ROLLER_COASTER, - RCT1_RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_CAR_RIDE, - RCT1_RIDE_TYPE_LAUNCHED_FREEFALL, - RCT1_RIDE_TYPE_BOBSLED_ROLLER_COASTER, - RCT1_RIDE_TYPE_OBSERVATION_TOWER, - RCT1_RIDE_TYPE_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_SLIDE, - RCT1_RIDE_TYPE_MINE_TRAIN_ROLLER_COASTER, - RCT1_RIDE_TYPE_CHAIRLIFT, - RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEDGE_MAZE, - RCT1_RIDE_TYPE_SPIRAL_SLIDE, - RCT1_RIDE_TYPE_GO_KARTS, - RCT1_RIDE_TYPE_LOG_FLUME, - RCT1_RIDE_TYPE_RIVER_RAPIDS, - RCT1_RIDE_TYPE_DODGEMS, - RCT1_RIDE_TYPE_SWINGING_SHIP, - RCT1_RIDE_TYPE_SWINGING_INVERTER_SHIP, - RCT1_RIDE_TYPE_ICE_CREAM_STALL, - RCT1_RIDE_TYPE_CHIPS_STALL, - RCT1_RIDE_TYPE_DRINK_STALL, - RCT1_RIDE_TYPE_CANDYFLOSS_STALL, - RCT1_RIDE_TYPE_BURGER_BAR, - RCT1_RIDE_TYPE_MERRY_GO_ROUND, - RCT1_RIDE_TYPE_BALLOON_STALL, - RCT1_RIDE_TYPE_INFORMATION_KIOSK, - RCT1_RIDE_TYPE_TOILETS, - RCT1_RIDE_TYPE_FERRIS_WHEEL, - RCT1_RIDE_TYPE_MOTION_SIMULATOR, - RCT1_RIDE_TYPE_3D_CINEMA, - RCT1_RIDE_TYPE_TOP_SPIN, - RCT1_RIDE_TYPE_SPACE_RINGS, - RCT1_RIDE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SOUVENIR_STALL, - RCT1_RIDE_TYPE_VERTICAL_ROLLER_COASTER, - RCT1_RIDE_TYPE_PIZZA_STALL, - RCT1_RIDE_TYPE_TWIST, - RCT1_RIDE_TYPE_HAUNTED_HOUSE, - RCT1_RIDE_TYPE_POPCORN_STALL, - RCT1_RIDE_TYPE_CIRCUS, - RCT1_RIDE_TYPE_GHOST_TRAIN, - RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_SIDE_FRICTION_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_WILD_MOUSE_ROLLER_COASTER, - RCT1_RIDE_TYPE_HOT_DOG_STALL, - RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL, - RCT1_RIDE_TYPE_HAT_STALL, - RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL, - RCT1_RIDE_TYPE_VIRGINIA_REEL, - RCT1_RIDE_TYPE_RIVER_RIDE, - RCT1_RIDE_TYPE_CYCLE_MONORAIL, - RCT1_RIDE_TYPE_FLYING_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_MONORAIL, - RCT1_RIDE_TYPE_40, - RCT1_RIDE_TYPE_WOODEN_REVERSER_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEARTLINE_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_GOLF, - RCT1_RIDE_TYPE_44, - RCT1_RIDE_TYPE_ROTO_DROP, - RCT1_RIDE_TYPE_FLYING_SAUCERS, - RCT1_RIDE_TYPE_CROOKED_HOUSE, - RCT1_RIDE_TYPE_CYCLE_RAILWAY, - RCT1_RIDE_TYPE_SUSPENDED_LOOPING_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_COASTER, - RCT1_RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, - RCT1_RIDE_TYPE_INVERTED_WILD_MOUSE_COASTER, - RCT1_RIDE_TYPE_JET_SKIS, - RCT1_RIDE_TYPE_T_SHIRT_STALL, - RCT1_RIDE_TYPE_RAFT_RIDE, - RCT1_RIDE_TYPE_DOUGHNUT_SHOP, - RCT1_RIDE_TYPE_ENTERPRISE, - RCT1_RIDE_TYPE_COFFEE_SHOP, - RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL, - RCT1_RIDE_TYPE_LEMONADE_STALL, - - RCT1_RIDE_TYPE_COUNT - }; - enum { RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN = 0, diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 62a3d1367e..5c8776ea86 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -133,7 +133,7 @@ namespace RCT1 EntryList _waterEntry; // Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries - ObjectEntryIndex _rideTypeToRideEntryMap[RCT1_RIDE_TYPE_COUNT]{}; + ObjectEntryIndex _rideTypeToRideEntryMap[EnumValue(RideType::RCT1_RIDE_TYPE_COUNT)]{}; ObjectEntryIndex _vehicleTypeToRideEntryMap[RCT1_VEHICLE_TYPE_COUNT]{}; ObjectEntryIndex _smallSceneryTypeToEntryMap[256]{}; ObjectEntryIndex _largeSceneryTypeToEntryMap[256]{}; @@ -144,7 +144,7 @@ namespace RCT1 // Research std::bitset _researchRideEntryUsed{}; - std::bitset _researchRideTypeUsed{}; + std::bitset _researchRideTypeUsed{}; // Scenario repository - used for determining scenario name IScenarioRepository* _scenarioRepository = GetScenarioRepository(); @@ -425,7 +425,7 @@ namespace RCT1 { size_t researchListCount; const ResearchItem* researchList = GetResearchList(&researchListCount); - std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( + std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( researchList, researchListCount); for (size_t i = 0; i < researchListCount; i++) { @@ -450,14 +450,14 @@ namespace RCT1 AddEntriesForSceneryTheme(researchItem->item); break; case RCT1_RESEARCH_TYPE_RIDE: - AddEntryForRideType(researchItem->item); + AddEntryForRideType(static_cast(researchItem->item)); break; case RCT1_RESEARCH_TYPE_VEHICLE: // For some bizarre reason, RCT1 research lists contain vehicles that aren't actually researched. // Extra bizarrely, this does not seem to apply to Loopy Landscapes saves/scenarios. if (rideTypeInResearch[researchItem->related_ride] || _gameVersion == FILE_VERSION_RCT1_LL) { - AddEntryForVehicleType(researchItem->related_ride, researchItem->item); + AddEntryForVehicleType(static_cast(researchItem->related_ride), researchItem->item); } break; } @@ -516,7 +516,7 @@ namespace RCT1 for (size_t i = 0; i < std::size(_s4.rides); i++) { auto ride = &_s4.rides[i]; - if (ride->type != RCT1_RIDE_TYPE_NULL) + if (ride->type != RideType::RCT1_RIDE_TYPE_NULL) { if (RCT1::RideTypeUsesVehicles(ride->type)) AddEntryForVehicleType(ride->type, ride->vehicle_type); @@ -584,23 +584,25 @@ namespace RCT1 _waterEntry.GetOrAddEntry(entryName); } - void AddEntryForRideType(uint8_t rideType) + void AddEntryForRideType(RideType rideType) { - assert(rideType < std::size(_rideTypeToRideEntryMap)); - if (_rideTypeToRideEntryMap[rideType] == OBJECT_ENTRY_INDEX_NULL) + Guard::Assert(EnumValue(rideType) < std::size(_rideTypeToRideEntryMap)); + + if (_rideTypeToRideEntryMap[EnumValue(rideType)] == OBJECT_ENTRY_INDEX_NULL) { const char* entryName = RCT1::GetRideTypeObject(rideType); if (!String::Equals(entryName, " ")) { auto entryIndex = _rideEntries.GetOrAddEntry(entryName); - _rideTypeToRideEntryMap[rideType] = entryIndex; + _rideTypeToRideEntryMap[EnumValue(rideType)] = entryIndex; } } } - void AddEntryForVehicleType(uint8_t rideType, uint8_t vehicleType) + void AddEntryForVehicleType(RideType rideType, uint8_t vehicleType) { - assert(vehicleType < std::size(_vehicleTypeToRideEntryMap)); + Guard::Assert(EnumValue(rideType) < std::size(_rideTypeToRideEntryMap)); + if (_vehicleTypeToRideEntryMap[vehicleType] == OBJECT_ENTRY_INDEX_NULL) { const char* entryName = RCT1::GetVehicleObject(vehicleType); @@ -609,7 +611,7 @@ namespace RCT1 auto entryIndex = _rideEntries.GetOrAddEntry(entryName); _vehicleTypeToRideEntryMap[vehicleType] = entryIndex; - if (rideType != RIDE_TYPE_NULL) + if (rideType != RideType::RCT1_RIDE_TYPE_NULL) AddEntryForRideType(rideType); } } @@ -712,7 +714,7 @@ namespace RCT1 { for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) { - if (_s4.rides[i].type != RIDE_TYPE_NULL) + if (_s4.rides[i].type != RideType::RCT1_RIDE_TYPE_NULL) { ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); } @@ -725,7 +727,7 @@ namespace RCT1 dst->id = rideIndex; // This is a peculiarity of this exact version number, which only Heide-Park seems to use. - if (_s4.game_version == 110018 && src->type == RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER) + if (_s4.game_version == 110018 && src->type == RideType::RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER) { dst->type = RIDE_TYPE_COMPACT_INVERTED_COASTER; } @@ -740,7 +742,7 @@ namespace RCT1 } else { - dst->subtype = _rideTypeToRideEntryMap[src->type]; + dst->subtype = _rideTypeToRideEntryMap[EnumValue(src->type)]; } rct_ride_entry* rideEntry = get_ride_entry(dst->subtype); @@ -873,7 +875,7 @@ namespace RCT1 // Only merry-go-round and dodgems had music and used // the same flag as synchronise stations for the option to enable it - if (src->type == RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RCT1_RIDE_TYPE_DODGEMS) + if (src->type == RideType::RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RideType::RCT1_RIDE_TYPE_DODGEMS) { if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) { @@ -1005,11 +1007,11 @@ namespace RCT1 dst->track_colour[0].supports = RCT1::GetColour(src->track_support_colour); // Balloons were always blue in the original RCT. - if (src->type == RCT1_RIDE_TYPE_BALLOON_STALL) + if (src->type == RideType::RCT1_RIDE_TYPE_BALLOON_STALL) { dst->track_colour[0].main = COLOUR_LIGHT_BLUE; } - else if (src->type == RCT1_RIDE_TYPE_RIVER_RAPIDS) + else if (src->type == RideType::RCT1_RIDE_TYPE_RIVER_RAPIDS) { dst->track_colour[0].main = COLOUR_WHITE; } @@ -1871,8 +1873,7 @@ namespace RCT1 } bool researched = true; - std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( - researchList, researchListCount); + auto rideTypeInResearch = GetRideTypesPresentInResearchList(researchList, researchListCount); std::vector vehiclesWithMissingRideTypes; for (size_t i = 0; i < researchListCount; i++) { @@ -1906,10 +1907,10 @@ namespace RCT1 } case RCT1_RESEARCH_TYPE_RIDE: { - uint8_t rct1RideType = researchItem.item; - _researchRideTypeUsed[rct1RideType] = true; + const auto rct1RideType = static_cast(researchItem.item); + _researchRideTypeUsed[EnumValue(rct1RideType)] = true; - auto ownRideEntryIndex = _rideTypeToRideEntryMap[rct1RideType]; + auto ownRideEntryIndex = _rideTypeToRideEntryMap[EnumValue(rct1RideType)]; Guard::Assert( ownRideEntryIndex != OBJECT_ENTRY_INDEX_NULL, "ownRideEntryIndex was OBJECT_ENTRY_INDEX_NULL"); @@ -1933,7 +1934,7 @@ namespace RCT1 } if (researchItem2.type == RCT1_RESEARCH_TYPE_VEHICLE - && researchItem2.related_ride == rct1RideType) + && static_cast(researchItem2.related_ride) == rct1RideType) { auto rideEntryIndex2 = _vehicleTypeToRideEntryMap[researchItem2.item]; bool isOwnType = (ownRideEntryIndex == rideEntryIndex2); @@ -2051,10 +2052,10 @@ namespace RCT1 } } - static std::bitset GetRideTypesPresentInResearchList( + static std::bitset GetRideTypesPresentInResearchList( const RCT1::ResearchItem* researchList, size_t researchListCount) { - std::bitset ret = {}; + std::bitset ret = {}; for (size_t i = 0; i < researchListCount; i++) { @@ -2605,7 +2606,7 @@ namespace RCT1 if (researchList[i].type == RCT1_RESEARCH_TYPE_RIDE) { - return RCT1::GetRideType(researchList[i].item, 0); + return RCT1::GetRideType(static_cast(researchList[i].item), 0); } } diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 3974f41aea..12f839662c 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -124,10 +124,10 @@ namespace RCT1 // Mazes were only hedges switch (td4.type) { - case RCT1_RIDE_TYPE_HEDGE_MAZE: + case RideType::RCT1_RIDE_TYPE_HEDGE_MAZE: td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; break; - case RCT1_RIDE_TYPE_RIVER_RAPIDS: + case RideType::RCT1_RIDE_TYPE_RIVER_RAPIDS: td->track_spine_colour[i] = COLOUR_WHITE; td->track_rail_colour[i] = COLOUR_WHITE; break; @@ -150,7 +150,7 @@ namespace RCT1 // Convert RCT1 vehicle type to RCT2 vehicle type. Initialise with a string consisting of 8 spaces. rct_object_entry vehicleObject = { 0x80, " " }; - if (td4Base.type == RIDE_TYPE_MAZE) + if (td4Base.type == RideType::RCT1_RIDE_TYPE_HEDGE_MAZE) { const char* vehObjName = RCT1::GetRideTypeObject(td4Base.type); assert(vehObjName != nullptr); diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index af7c7fe6ef..d3dfe396d3 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -175,11 +175,11 @@ namespace RCT1 return object_manager_get_loaded_object_entry_index(ObjectEntryDescriptor(selectedEdge)); } - uint8_t GetRideType(uint8_t rideType, uint8_t vehicleType) + uint8_t GetRideType(RideType rideType, uint8_t vehicleType) { - if (rideType == RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN) + if (rideType == RideType::RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN) return RIDE_TYPE_HYPER_TWISTER; - if (rideType == RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN) + if (rideType == RideType::RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN) return RIDE_TYPE_HYPERCOASTER; static uint8_t map[] = @@ -271,8 +271,10 @@ namespace RCT1 RIDE_TYPE_DRINK_STALL, // RCT1_RIDE_TYPE_LEMONADE_STALL }; - Guard::ArgumentInRange(rideType, 0, std::size(map), "Unsupported RCT1 ride type."); - return map[rideType]; + const auto index = EnumValue(rideType); + Guard::ArgumentInRange(index, 0, std::size(map), "Unsupported RCT1 ride type."); + + return map[index]; } VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType) @@ -374,33 +376,33 @@ namespace RCT1 return map[vehicleType]; } - bool RideTypeUsesVehicles(uint8_t rideType) + bool RideTypeUsesVehicles(RideType rideType) { switch (rideType) { - case RCT1_RIDE_TYPE_HEDGE_MAZE: - case RCT1_RIDE_TYPE_SPIRAL_SLIDE: - case RCT1_RIDE_TYPE_ICE_CREAM_STALL: - case RCT1_RIDE_TYPE_CHIPS_STALL: - case RCT1_RIDE_TYPE_DRINK_STALL: - case RCT1_RIDE_TYPE_CANDYFLOSS_STALL: - case RCT1_RIDE_TYPE_BURGER_BAR: - case RCT1_RIDE_TYPE_BALLOON_STALL: - case RCT1_RIDE_TYPE_INFORMATION_KIOSK: - case RCT1_RIDE_TYPE_TOILETS: - case RCT1_RIDE_TYPE_SOUVENIR_STALL: - case RCT1_RIDE_TYPE_PIZZA_STALL: - case RCT1_RIDE_TYPE_POPCORN_STALL: - case RCT1_RIDE_TYPE_HOT_DOG_STALL: - case RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL: - case RCT1_RIDE_TYPE_HAT_STALL: - case RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL: - case RCT1_RIDE_TYPE_40: - case RCT1_RIDE_TYPE_44: - case RCT1_RIDE_TYPE_T_SHIRT_STALL: - case RCT1_RIDE_TYPE_DOUGHNUT_SHOP: - case RCT1_RIDE_TYPE_COFFEE_SHOP: - case RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL: - case RCT1_RIDE_TYPE_LEMONADE_STALL: + case RideType::RCT1_RIDE_TYPE_HEDGE_MAZE: + case RideType::RCT1_RIDE_TYPE_SPIRAL_SLIDE: + case RideType::RCT1_RIDE_TYPE_ICE_CREAM_STALL: + case RideType::RCT1_RIDE_TYPE_CHIPS_STALL: + case RideType::RCT1_RIDE_TYPE_DRINK_STALL: + case RideType::RCT1_RIDE_TYPE_CANDYFLOSS_STALL: + case RideType::RCT1_RIDE_TYPE_BURGER_BAR: + case RideType::RCT1_RIDE_TYPE_BALLOON_STALL: + case RideType::RCT1_RIDE_TYPE_INFORMATION_KIOSK: + case RideType::RCT1_RIDE_TYPE_TOILETS: + case RideType::RCT1_RIDE_TYPE_SOUVENIR_STALL: + case RideType::RCT1_RIDE_TYPE_PIZZA_STALL: + case RideType::RCT1_RIDE_TYPE_POPCORN_STALL: + case RideType::RCT1_RIDE_TYPE_HOT_DOG_STALL: + case RideType::RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL: + case RideType::RCT1_RIDE_TYPE_HAT_STALL: + case RideType::RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL: + case RideType::RCT1_RIDE_TYPE_40: + case RideType::RCT1_RIDE_TYPE_44: + case RideType::RCT1_RIDE_TYPE_T_SHIRT_STALL: + case RideType::RCT1_RIDE_TYPE_DOUGHNUT_SHOP: + case RideType::RCT1_RIDE_TYPE_COFFEE_SHOP: + case RideType::RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL: + case RideType::RCT1_RIDE_TYPE_LEMONADE_STALL: return false; default: return true; @@ -696,7 +698,7 @@ namespace RCT1 return map[vehicleSubEntry]; } - const char * GetRideTypeObject(uint8_t rideType) + const char * GetRideTypeObject(RideType rideType) { static constexpr const char * map[] = { @@ -787,8 +789,10 @@ namespace RCT1 "LEMST ", // RCT1_RIDE_TYPE_LEMONADE_STALL }; - Guard::ArgumentInRange(rideType, 0, std::size(map), "Unsupported RCT1 ride type."); - return map[rideType]; + const auto index = EnumValue(rideType); + Guard::ArgumentInRange(index, 0, std::size(map), "Unsupported RCT1 ride type."); + + return map[index]; } const char * GetVehicleObject(uint8_t vehicleType) diff --git a/src/openrct2/rct1/Tables.h b/src/openrct2/rct1/Tables.h index ac263bd822..6667e61eac 100644 --- a/src/openrct2/rct1/Tables.h +++ b/src/openrct2/rct1/Tables.h @@ -21,19 +21,21 @@ namespace RCT1 int8_t colour1, colour2, colour3; }; + enum class RideType : uint8_t; + colour_t GetColour(colour_t colour); PeepSpriteType GetPeepSpriteType(uint8_t rct1SpriteType); ObjectEntryIndex GetTerrain(uint8_t terrain); ObjectEntryIndex GetTerrainEdge(uint8_t terrainEdge); - uint8_t GetRideType(uint8_t rideType, uint8_t vehicleType); + uint8_t GetRideType(RideType rideType, uint8_t vehicleType); VehicleColourSchemeCopyDescriptor GetColourSchemeCopyDescriptor(uint8_t vehicleType); - bool RideTypeUsesVehicles(uint8_t rideType); + bool RideTypeUsesVehicles(RideType rideType); bool PathIsQueue(uint8_t pathType); uint8_t NormalisePathAddition(uint8_t pathAdditionType); uint8_t GetVehicleSubEntryIndex(uint8_t vehicleSubEntry); - const char* GetRideTypeObject(uint8_t rideType); + const char* GetRideTypeObject(RideType rideType); const char* GetVehicleObject(uint8_t vehicleType); const char* GetSmallSceneryObject(uint8_t smallSceneryType); const char* GetLargeSceneryObject(uint8_t largeSceneryType); From 481f7565dcf64ba1c48ce94e54f2a959b40d69e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 23:48:35 +0300 Subject: [PATCH 301/681] Rename enum members --- src/openrct2/rct1/RCT1.h | 174 +++++++++++++++---------------- src/openrct2/rct1/S4Importer.cpp | 24 ++--- src/openrct2/rct1/T4Importer.cpp | 6 +- src/openrct2/rct1/Tables.cpp | 52 ++++----- 4 files changed, 128 insertions(+), 128 deletions(-) diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 0eddfbcf0b..e081a55d58 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -36,94 +36,94 @@ namespace RCT1 enum class RideType : uint8_t { - RCT1_RIDE_TYPE_NULL = 255, - RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER = 0, - RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER, - RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_RAILWAY, - RCT1_RIDE_TYPE_MONORAIL, - RCT1_RIDE_TYPE_SUSPENDED_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_BOAT_HIRE, - RCT1_RIDE_TYPE_WOODEN_CRAZY_RODENT_ROLLER_COASTER, - RCT1_RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, - RCT1_RIDE_TYPE_CAR_RIDE, - RCT1_RIDE_TYPE_LAUNCHED_FREEFALL, - RCT1_RIDE_TYPE_BOBSLED_ROLLER_COASTER, - RCT1_RIDE_TYPE_OBSERVATION_TOWER, - RCT1_RIDE_TYPE_STEEL_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_SLIDE, - RCT1_RIDE_TYPE_MINE_TRAIN_ROLLER_COASTER, - RCT1_RIDE_TYPE_CHAIRLIFT, - RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEDGE_MAZE, - RCT1_RIDE_TYPE_SPIRAL_SLIDE, - RCT1_RIDE_TYPE_GO_KARTS, - RCT1_RIDE_TYPE_LOG_FLUME, - RCT1_RIDE_TYPE_RIVER_RAPIDS, - RCT1_RIDE_TYPE_DODGEMS, - RCT1_RIDE_TYPE_SWINGING_SHIP, - RCT1_RIDE_TYPE_SWINGING_INVERTER_SHIP, - RCT1_RIDE_TYPE_ICE_CREAM_STALL, - RCT1_RIDE_TYPE_CHIPS_STALL, - RCT1_RIDE_TYPE_DRINK_STALL, - RCT1_RIDE_TYPE_CANDYFLOSS_STALL, - RCT1_RIDE_TYPE_BURGER_BAR, - RCT1_RIDE_TYPE_MERRY_GO_ROUND, - RCT1_RIDE_TYPE_BALLOON_STALL, - RCT1_RIDE_TYPE_INFORMATION_KIOSK, - RCT1_RIDE_TYPE_TOILETS, - RCT1_RIDE_TYPE_FERRIS_WHEEL, - RCT1_RIDE_TYPE_MOTION_SIMULATOR, - RCT1_RIDE_TYPE_3D_CINEMA, - RCT1_RIDE_TYPE_TOP_SPIN, - RCT1_RIDE_TYPE_SPACE_RINGS, - RCT1_RIDE_TYPE_REVERSE_FREEFALL_ROLLER_COASTER, - RCT1_RIDE_TYPE_SOUVENIR_STALL, - RCT1_RIDE_TYPE_VERTICAL_ROLLER_COASTER, - RCT1_RIDE_TYPE_PIZZA_STALL, - RCT1_RIDE_TYPE_TWIST, - RCT1_RIDE_TYPE_HAUNTED_HOUSE, - RCT1_RIDE_TYPE_POPCORN_STALL, - RCT1_RIDE_TYPE_CIRCUS, - RCT1_RIDE_TYPE_GHOST_TRAIN, - RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_WOODEN_SIDE_FRICTION_ROLLER_COASTER, - RCT1_RIDE_TYPE_STEEL_WILD_MOUSE_ROLLER_COASTER, - RCT1_RIDE_TYPE_HOT_DOG_STALL, - RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL, - RCT1_RIDE_TYPE_HAT_STALL, - RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL, - RCT1_RIDE_TYPE_VIRGINIA_REEL, - RCT1_RIDE_TYPE_RIVER_RIDE, - RCT1_RIDE_TYPE_CYCLE_MONORAIL, - RCT1_RIDE_TYPE_FLYING_ROLLER_COASTER, - RCT1_RIDE_TYPE_SUSPENDED_MONORAIL, - RCT1_RIDE_TYPE_40, - RCT1_RIDE_TYPE_WOODEN_REVERSER_ROLLER_COASTER, - RCT1_RIDE_TYPE_HEARTLINE_TWISTER_ROLLER_COASTER, - RCT1_RIDE_TYPE_MINIATURE_GOLF, - RCT1_RIDE_TYPE_44, - RCT1_RIDE_TYPE_ROTO_DROP, - RCT1_RIDE_TYPE_FLYING_SAUCERS, - RCT1_RIDE_TYPE_CROOKED_HOUSE, - RCT1_RIDE_TYPE_CYCLE_RAILWAY, - RCT1_RIDE_TYPE_SUSPENDED_LOOPING_ROLLER_COASTER, - RCT1_RIDE_TYPE_WATER_COASTER, - RCT1_RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, - RCT1_RIDE_TYPE_INVERTED_WILD_MOUSE_COASTER, - RCT1_RIDE_TYPE_JET_SKIS, - RCT1_RIDE_TYPE_T_SHIRT_STALL, - RCT1_RIDE_TYPE_RAFT_RIDE, - RCT1_RIDE_TYPE_DOUGHNUT_SHOP, - RCT1_RIDE_TYPE_ENTERPRISE, - RCT1_RIDE_TYPE_COFFEE_SHOP, - RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL, - RCT1_RIDE_TYPE_LEMONADE_STALL, + WoodenRollerCoaster = 0, + StandUpSteelRollerCoaster, + SuspendedRollerCoaster, + InvertedRollerCoaster, + SteelMiniRollerCoaster, + MiniatureRailway, + Monorail, + SuspendedSingleRailRollerCoaster, + BoatHire, + WoodenCrazyRodentRollerCoaster, + SingleRailRollerCoaster, + CarRide, + LaunchedFreefall, + BobsledRollerCoaster, + ObservationTower, + SteelRollerCoaster, + WaterSlide, + MineTrainRollerCoaster, + Chairlift, + SteelCorkscrewRollerCoaster, + HedgeMaze, + SpiralSlide, + GoKarts, + LogFlume, + RiverRapids, + Dodgems, + SwingingShip, + SwingingInverterShip, + IceCreamStall, + ChipsStall, + DrinkStall, + CandyflossStall, + BurgerBar, + MerryGoRound, + BalloonStall, + InformationKiosk, + Toilets, + FerrisWheel, + MotionSimulator, + _3DCinema, + TopSpin, + SpaceRings, + ReverseFreefallRollerCoaster, + SouvenirStall, + VerticalRollerCoaster, + PizzaStall, + Twist, + HauntedHouse, + PopcornStall, + Circus, + GhostTrain, + SteelTwisterRollerCoaster, + WoodenTwisterRollerCoaster, + WoodenSideFrictionRollerCoaster, + SteelWildMouseRollerCoaster, + HotDogStall, + ExoticSeaFoodStall, + HatStall, + ToffeeAppleStall, + VirginiaReel, + RiverRide, + CycleMonorail, + FlyingRollerCoaster, + SuspendedMonorail, + _40, + WoodenReverseRollerCoaster, + HeartlineTwisterRollerCoaster, + MiniatureGolf, + _44, + RotoDrop, + FlyingSaucers, + CrookedHouse, + CycleRailway, + SuspendedLoopingRollerCoaster, + WaterCoaster, + AirPoweredVerticalCoaster, + InvertedWildMouseCoaster, + JetSkis, + TShirtStall, + RaftRide, + DoughnutShop, + Enterprise, + CoffeeShop, + FriedChickenStall, + LemonadeStall, - RCT1_RIDE_TYPE_COUNT + Count, + Null = 255, }; #pragma pack(push, 1) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 5c8776ea86..8bccea764d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -133,7 +133,7 @@ namespace RCT1 EntryList _waterEntry; // Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries - ObjectEntryIndex _rideTypeToRideEntryMap[EnumValue(RideType::RCT1_RIDE_TYPE_COUNT)]{}; + ObjectEntryIndex _rideTypeToRideEntryMap[EnumValue(RideType::Count)]{}; ObjectEntryIndex _vehicleTypeToRideEntryMap[RCT1_VEHICLE_TYPE_COUNT]{}; ObjectEntryIndex _smallSceneryTypeToEntryMap[256]{}; ObjectEntryIndex _largeSceneryTypeToEntryMap[256]{}; @@ -144,7 +144,7 @@ namespace RCT1 // Research std::bitset _researchRideEntryUsed{}; - std::bitset _researchRideTypeUsed{}; + std::bitset _researchRideTypeUsed{}; // Scenario repository - used for determining scenario name IScenarioRepository* _scenarioRepository = GetScenarioRepository(); @@ -425,7 +425,7 @@ namespace RCT1 { size_t researchListCount; const ResearchItem* researchList = GetResearchList(&researchListCount); - std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( + std::bitset rideTypeInResearch = GetRideTypesPresentInResearchList( researchList, researchListCount); for (size_t i = 0; i < researchListCount; i++) { @@ -516,7 +516,7 @@ namespace RCT1 for (size_t i = 0; i < std::size(_s4.rides); i++) { auto ride = &_s4.rides[i]; - if (ride->type != RideType::RCT1_RIDE_TYPE_NULL) + if (ride->type != RideType::Null) { if (RCT1::RideTypeUsesVehicles(ride->type)) AddEntryForVehicleType(ride->type, ride->vehicle_type); @@ -611,7 +611,7 @@ namespace RCT1 auto entryIndex = _rideEntries.GetOrAddEntry(entryName); _vehicleTypeToRideEntryMap[vehicleType] = entryIndex; - if (rideType != RideType::RCT1_RIDE_TYPE_NULL) + if (rideType != RideType::Null) AddEntryForRideType(rideType); } } @@ -714,7 +714,7 @@ namespace RCT1 { for (int32_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) { - if (_s4.rides[i].type != RideType::RCT1_RIDE_TYPE_NULL) + if (_s4.rides[i].type != RideType::Null) { ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); } @@ -727,7 +727,7 @@ namespace RCT1 dst->id = rideIndex; // This is a peculiarity of this exact version number, which only Heide-Park seems to use. - if (_s4.game_version == 110018 && src->type == RideType::RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER) + if (_s4.game_version == 110018 && src->type == RideType::InvertedRollerCoaster) { dst->type = RIDE_TYPE_COMPACT_INVERTED_COASTER; } @@ -875,7 +875,7 @@ namespace RCT1 // Only merry-go-round and dodgems had music and used // the same flag as synchronise stations for the option to enable it - if (src->type == RideType::RCT1_RIDE_TYPE_MERRY_GO_ROUND || src->type == RideType::RCT1_RIDE_TYPE_DODGEMS) + if (src->type == RideType::MerryGoRound || src->type == RideType::Dodgems) { if (src->depart_flags & RCT1_RIDE_DEPART_PLAY_MUSIC) { @@ -1007,11 +1007,11 @@ namespace RCT1 dst->track_colour[0].supports = RCT1::GetColour(src->track_support_colour); // Balloons were always blue in the original RCT. - if (src->type == RideType::RCT1_RIDE_TYPE_BALLOON_STALL) + if (src->type == RideType::BalloonStall) { dst->track_colour[0].main = COLOUR_LIGHT_BLUE; } - else if (src->type == RideType::RCT1_RIDE_TYPE_RIVER_RAPIDS) + else if (src->type == RideType::RiverRapids) { dst->track_colour[0].main = COLOUR_WHITE; } @@ -2052,10 +2052,10 @@ namespace RCT1 } } - static std::bitset GetRideTypesPresentInResearchList( + static std::bitset GetRideTypesPresentInResearchList( const RCT1::ResearchItem* researchList, size_t researchListCount) { - std::bitset ret = {}; + std::bitset ret = {}; for (size_t i = 0; i < researchListCount; i++) { diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 12f839662c..ec28b2eb8e 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -124,10 +124,10 @@ namespace RCT1 // Mazes were only hedges switch (td4.type) { - case RideType::RCT1_RIDE_TYPE_HEDGE_MAZE: + case RideType::HedgeMaze: td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; break; - case RideType::RCT1_RIDE_TYPE_RIVER_RAPIDS: + case RideType::RiverRapids: td->track_spine_colour[i] = COLOUR_WHITE; td->track_rail_colour[i] = COLOUR_WHITE; break; @@ -150,7 +150,7 @@ namespace RCT1 // Convert RCT1 vehicle type to RCT2 vehicle type. Initialise with a string consisting of 8 spaces. rct_object_entry vehicleObject = { 0x80, " " }; - if (td4Base.type == RideType::RCT1_RIDE_TYPE_HEDGE_MAZE) + if (td4Base.type == RideType::HedgeMaze) { const char* vehObjName = RCT1::GetRideTypeObject(td4Base.type); assert(vehObjName != nullptr); diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index d3dfe396d3..597c4ca81b 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -177,9 +177,9 @@ namespace RCT1 uint8_t GetRideType(RideType rideType, uint8_t vehicleType) { - if (rideType == RideType::RCT1_RIDE_TYPE_STEEL_TWISTER_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN) + if (rideType == RideType::SteelTwisterRollerCoaster && vehicleType == RCT1_VEHICLE_TYPE_NON_LOOPING_STEEL_TWISTER_ROLLER_COASTER_TRAIN) return RIDE_TYPE_HYPER_TWISTER; - if (rideType == RideType::RCT1_RIDE_TYPE_STEEL_CORKSCREW_ROLLER_COASTER && vehicleType == RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN) + if (rideType == RideType::SteelCorkscrewRollerCoaster && vehicleType == RCT1_VEHICLE_TYPE_HYPERCOASTER_TRAIN) return RIDE_TYPE_HYPERCOASTER; static uint8_t map[] = @@ -379,30 +379,30 @@ namespace RCT1 bool RideTypeUsesVehicles(RideType rideType) { switch (rideType) { - case RideType::RCT1_RIDE_TYPE_HEDGE_MAZE: - case RideType::RCT1_RIDE_TYPE_SPIRAL_SLIDE: - case RideType::RCT1_RIDE_TYPE_ICE_CREAM_STALL: - case RideType::RCT1_RIDE_TYPE_CHIPS_STALL: - case RideType::RCT1_RIDE_TYPE_DRINK_STALL: - case RideType::RCT1_RIDE_TYPE_CANDYFLOSS_STALL: - case RideType::RCT1_RIDE_TYPE_BURGER_BAR: - case RideType::RCT1_RIDE_TYPE_BALLOON_STALL: - case RideType::RCT1_RIDE_TYPE_INFORMATION_KIOSK: - case RideType::RCT1_RIDE_TYPE_TOILETS: - case RideType::RCT1_RIDE_TYPE_SOUVENIR_STALL: - case RideType::RCT1_RIDE_TYPE_PIZZA_STALL: - case RideType::RCT1_RIDE_TYPE_POPCORN_STALL: - case RideType::RCT1_RIDE_TYPE_HOT_DOG_STALL: - case RideType::RCT1_RIDE_TYPE_EXOTIC_SEA_FOOD_STALL: - case RideType::RCT1_RIDE_TYPE_HAT_STALL: - case RideType::RCT1_RIDE_TYPE_TOFFEE_APPLE_STALL: - case RideType::RCT1_RIDE_TYPE_40: - case RideType::RCT1_RIDE_TYPE_44: - case RideType::RCT1_RIDE_TYPE_T_SHIRT_STALL: - case RideType::RCT1_RIDE_TYPE_DOUGHNUT_SHOP: - case RideType::RCT1_RIDE_TYPE_COFFEE_SHOP: - case RideType::RCT1_RIDE_TYPE_FRIED_CHICKEN_STALL: - case RideType::RCT1_RIDE_TYPE_LEMONADE_STALL: + case RideType::HedgeMaze: + case RideType::SpiralSlide: + case RideType::IceCreamStall: + case RideType::ChipsStall: + case RideType::DrinkStall: + case RideType::CandyflossStall: + case RideType::BurgerBar: + case RideType::BalloonStall: + case RideType::InformationKiosk: + case RideType::Toilets: + case RideType::SouvenirStall: + case RideType::PizzaStall: + case RideType::PopcornStall: + case RideType::HotDogStall: + case RideType::ExoticSeaFoodStall: + case RideType::HatStall: + case RideType::ToffeeAppleStall: + case RideType::_40: + case RideType::_44: + case RideType::TShirtStall: + case RideType::DoughnutShop: + case RideType::CoffeeShop: + case RideType::FriedChickenStall: + case RideType::LemonadeStall: return false; default: return true; From 8f5fb9d179422380060c9da1e6f673dd143cb595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 3 Sep 2021 23:53:04 +0300 Subject: [PATCH 302/681] Convert switch to two conditional scopes --- src/openrct2/rct1/T4Importer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index ec28b2eb8e..536eeabc4d 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -122,15 +122,14 @@ namespace RCT1 td->track_support_colour[i] = RCT1::GetColour(td4.track_support_colour_v0); // Mazes were only hedges - switch (td4.type) + if (td4.type == RideType::HedgeMaze) { - case RideType::HedgeMaze: - td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; - break; - case RideType::RiverRapids: - td->track_spine_colour[i] = COLOUR_WHITE; - td->track_rail_colour[i] = COLOUR_WHITE; - break; + td->track_support_colour[i] = MAZE_WALL_TYPE_HEDGE; + } + else if (td4.type == RideType::RiverRapids) + { + td->track_spine_colour[i] = COLOUR_WHITE; + td->track_rail_colour[i] = COLOUR_WHITE; } } td->flags2 = 0; From 600ce959d7fa415d0f070903189081d96334cc58 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 3 Sep 2021 23:43:43 +0200 Subject: [PATCH 303/681] Use real values for gGuestsInParkHistory --- src/openrct2-ui/windows/Park.cpp | 15 ++++++++++++++- src/openrct2/rct1/S4Importer.cpp | 11 +++++++++-- src/openrct2/rct12/RCT12.h | 3 +++ src/openrct2/rct2/S6Exporter.cpp | 9 +++++++++ src/openrct2/rct2/S6Importer.cpp | 11 +++++++++-- src/openrct2/world/Park.cpp | 21 +++++++++------------ src/openrct2/world/Park.h | 15 +++++++++------ 7 files changed, 62 insertions(+), 23 deletions(-) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index d4993fac98..4ac9087e87 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1065,7 +1065,20 @@ static void window_park_guests_paint(rct_window* w, rct_drawpixelinfo* dpi) // Graph screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; - Graph::Draw(dpi, gGuestsInParkHistory, 32, screenPos); + uint8_t cappedHistory[32]; + for (size_t i = 0; i < std::size(cappedHistory); i++) + { + auto value = gGuestsInParkHistory[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); } #pragma endregion diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 62a3d1367e..6bf6d87777 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2118,9 +2118,16 @@ namespace RCT1 // Park rating gParkRating = _s4.park_rating; - for (size_t i = 0; i < 32; i++) + + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + park.ResetHistories(); + std::memcpy(gParkRatingHistory, _s4.park_rating_history, sizeof(_s4.park_rating_history)); + for (size_t i = 0; i < std::size(_s4.guests_in_park_history); i++) { - gParkRatingHistory[i] = _s4.park_rating_history[i]; + if (_s4.guests_in_park_history[i] != RCT12ParkHistoryUndefined) + { + gGuestsInParkHistory[i] = _s4.guests_in_park_history[i] * RCT12GuestsInParkHistoryFactor; + } } // Awards diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index b9e4dd52b1..94d4368330 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -90,6 +90,9 @@ constexpr const uint16_t RCT12VehicleTrackTypeMask = 0b1111111111111100; constexpr const uint8_t RCT12PeepThoughtItemNone = std::numeric_limits::max(); +constexpr const uint8_t RCT12GuestsInParkHistoryFactor = 20; +constexpr const uint8_t RCT12ParkHistoryUndefined = std::numeric_limits::max(); + enum class RCT12TrackDesignVersion : uint8_t { TD4, diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 99649fcd5b..95d7fdcc09 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -352,6 +352,15 @@ void S6Exporter::Export() _s6.park_rating = gParkRating; std::memcpy(_s6.park_rating_history, gParkRatingHistory, sizeof(_s6.park_rating_history)); + std::fill(std::begin(_s6.guests_in_park_history), std::end(_s6.guests_in_park_history), RCT12ParkHistoryUndefined); + for (size_t i = 0; i < std::size(gGuestsInParkHistory); i++) + { + if (gGuestsInParkHistory[i] != GuestsInParkHistoryUndefined) + { + _s6.guests_in_park_history[i] = std::min(gGuestsInParkHistory[i], 5000) / RCT12GuestsInParkHistoryFactor; + } + } + std::memcpy(_s6.guests_in_park_history, gGuestsInParkHistory, sizeof(_s6.guests_in_park_history)); _s6.active_research_types = gResearchPriorities; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 9083050b38..4b7652d2b6 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -270,8 +270,16 @@ public: gParkRating = _s6.park_rating; + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + park.ResetHistories(); std::memcpy(gParkRatingHistory, _s6.park_rating_history, sizeof(_s6.park_rating_history)); - std::memcpy(gGuestsInParkHistory, _s6.guests_in_park_history, sizeof(_s6.guests_in_park_history)); + for (size_t i = 0; i < std::size(_s6.guests_in_park_history); i++) + { + if (_s6.guests_in_park_history[i] != RCT12ParkHistoryUndefined) + { + gGuestsInParkHistory[i] = _s6.guests_in_park_history[i] * RCT12GuestsInParkHistoryFactor; + } + } gResearchPriorities = _s6.active_research_types; gResearchProgressStage = _s6.research_progress_stage; @@ -464,7 +472,6 @@ public: map_count_remaining_land_rights(); determine_ride_entrance_and_exit_locations(); - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); park.Name = GetUserString(_s6.park_name); FixLandOwnership(); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 98745ca80a..85c337b416 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -46,22 +46,22 @@ using namespace OpenRCT2; -uint32_t gParkFlags; +uint64_t gParkFlags; uint16_t gParkRating; money16 gParkEntranceFee; uint16_t gParkSize; money16 gLandPrice; money16 gConstructionRightsPrice; -uint32_t gTotalAdmissions; -money32 gTotalIncomeFromAdmissions; +uint64_t gTotalAdmissions; +money64 gTotalIncomeFromAdmissions; -money32 gParkValue; -money32 gCompanyValue; +money64 gParkValue; +money64 gCompanyValue; int16_t gParkRatingCasualtyPenalty; uint8_t gParkRatingHistory[32]; -uint8_t gGuestsInParkHistory[32]; +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; @@ -743,11 +743,8 @@ template static void HistoryPushRecord(T history[TSize void Park::ResetHistories() { - for (size_t i = 0; i < 32; i++) - { - gParkRatingHistory[i] = 255; - gGuestsInParkHistory[i] = 255; - } + std::fill(std::begin(gParkRatingHistory), std::end(gParkRatingHistory), ParkRatingHistoryUndefined); + std::fill(std::begin(gGuestsInParkHistory), std::end(gGuestsInParkHistory), GuestsInParkHistoryUndefined); } void Park::UpdateHistories() @@ -767,7 +764,7 @@ void Park::UpdateHistories() // Update park rating, guests in park and current cash history HistoryPushRecord(gParkRatingHistory, CalculateParkRating() / 4); - HistoryPushRecord(gGuestsInParkHistory, std::min(gNumGuestsInPark, 5000) / 20); + HistoryPushRecord(gGuestsInParkHistory, gNumGuestsInPark); HistoryPushRecord(gCashHistory, finance_get_current_cash() - gBankLoan); // Update weekly profit history diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index e998d48104..786d122e10 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -18,6 +18,9 @@ #define MAX_ENTRANCE_FEE MONEY(200, 00) +constexpr const uint8_t ParkRatingHistoryUndefined = std::numeric_limits::max(); +constexpr const uint32_t GuestsInParkHistoryUndefined = std::numeric_limits::max(); + enum : uint32_t { PARK_FLAGS_PARK_OPEN = (1 << 0), @@ -87,22 +90,22 @@ namespace OpenRCT2 }; } // namespace OpenRCT2 -extern uint32_t gParkFlags; +extern uint64_t gParkFlags; extern uint16_t gParkRating; extern money16 gParkEntranceFee; extern uint16_t gParkSize; extern money16 gLandPrice; extern money16 gConstructionRightsPrice; -extern uint32_t gTotalAdmissions; -extern money32 gTotalIncomeFromAdmissions; +extern uint64_t gTotalAdmissions; +extern money64 gTotalIncomeFromAdmissions; -extern money32 gParkValue; -extern money32 gCompanyValue; +extern money64 gParkValue; +extern money64 gCompanyValue; extern int16_t gParkRatingCasualtyPenalty; extern uint8_t gParkRatingHistory[32]; -extern uint8_t gGuestsInParkHistory[32]; +extern uint32_t gGuestsInParkHistory[32]; extern int32_t _guestGenerationProbability; extern uint32_t _suggestedGuestMaximum; From a526caa1cb35fb423f2b1bf607620bf6da098ab5 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 4 Sep 2021 00:03:24 +0200 Subject: [PATCH 304/681] Use std::copy for gParkRatingHistory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com> --- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6bf6d87777..23010d8d50 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2121,7 +2121,7 @@ namespace RCT1 auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); park.ResetHistories(); - std::memcpy(gParkRatingHistory, _s4.park_rating_history, sizeof(_s4.park_rating_history)); + std::copy(std::begin(_s4.park_rating_history), std::end(_s4.park_rating_history), gParkRatingHistory); for (size_t i = 0; i < std::size(_s4.guests_in_park_history); i++) { if (_s4.guests_in_park_history[i] != RCT12ParkHistoryUndefined) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 95d7fdcc09..6f3e4b0168 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -351,7 +351,7 @@ void S6Exporter::Export() _s6.park_rating = gParkRating; - std::memcpy(_s6.park_rating_history, gParkRatingHistory, sizeof(_s6.park_rating_history)); + std::copy(std::begin(gParkRatingHistory), std::end(gParkRatingHistory), _s6.park_rating_history); std::fill(std::begin(_s6.guests_in_park_history), std::end(_s6.guests_in_park_history), RCT12ParkHistoryUndefined); for (size_t i = 0; i < std::size(gGuestsInParkHistory); i++) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 4b7652d2b6..708d6e404e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -272,7 +272,7 @@ public: auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); park.ResetHistories(); - std::memcpy(gParkRatingHistory, _s6.park_rating_history, sizeof(_s6.park_rating_history)); + std::copy(std::begin(_s6.park_rating_history), std::end(_s6.park_rating_history), gParkRatingHistory); for (size_t i = 0; i < std::size(_s6.guests_in_park_history); i++) { if (_s6.guests_in_park_history[i] != RCT12ParkHistoryUndefined) From fd2a572f9a1da621d8a09b86ae84d2d2096bad5f Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 4 Sep 2021 01:01:41 +0200 Subject: [PATCH 305/681] Fix #15319: Clicking on Object Selection Cheat Freezes the Game MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes it by adding limits for the missing path types. Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com> --- src/openrct2/object/ObjectLimits.h | 10 +++++++++- src/openrct2/object/ObjectList.cpp | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/openrct2/object/ObjectLimits.h b/src/openrct2/object/ObjectLimits.h index febbda2544..f9ebf6ffd7 100644 --- a/src/openrct2/object/ObjectLimits.h +++ b/src/openrct2/object/ObjectLimits.h @@ -26,6 +26,8 @@ constexpr const uint16_t MAX_TERRAIN_SURFACE_OBJECTS = 18; constexpr const uint16_t MAX_TERRAIN_EDGE_OBJECTS = 255; constexpr const uint16_t MAX_STATION_OBJECTS = 255; constexpr const uint16_t MAX_MUSIC_OBJECTS = 255; +constexpr const uint16_t MAX_FOOTPATH_SURFACE_OBJECTS = 255; +constexpr const uint16_t MAX_FOOTPATH_RAILINGS_OBJECTS = 255; // clang-format off constexpr const uint16_t OBJECT_ENTRY_COUNT = @@ -39,7 +41,13 @@ constexpr const uint16_t OBJECT_ENTRY_COUNT = MAX_SCENERY_GROUP_OBJECTS + MAX_PARK_ENTRANCE_OBJECTS + MAX_WATER_OBJECTS + - MAX_SCENARIO_TEXT_OBJECTS; + MAX_SCENARIO_TEXT_OBJECTS + + MAX_TERRAIN_SURFACE_OBJECTS + + MAX_TERRAIN_EDGE_OBJECTS + + MAX_STATION_OBJECTS + + MAX_MUSIC_OBJECTS + + MAX_FOOTPATH_SURFACE_OBJECTS + + MAX_FOOTPATH_RAILINGS_OBJECTS; // clang-format on constexpr const uint8_t DAT_NAME_LENGTH = 8; diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 26035d97f6..967ccef4a8 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -38,6 +38,8 @@ int32_t object_entry_group_counts[] = { MAX_TERRAIN_EDGE_OBJECTS, MAX_STATION_OBJECTS, MAX_MUSIC_OBJECTS, + MAX_FOOTPATH_SURFACE_OBJECTS, + MAX_FOOTPATH_RAILINGS_OBJECTS, }; // 98DA2C From f1fbe07ded6f4b175e88de815c2d2007478ae220 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 4 Sep 2021 21:17:08 +0200 Subject: [PATCH 306/681] Avoid redefining WIN32_LEAN_AND_MEAN (#15342) --- src/openrct2/core/Http.cURL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index d18a9c1750..41891a50a4 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -18,7 +18,7 @@ # include # include -# ifdef _WIN32 +# if defined(_WIN32) && !defined(WIN32_LEAN_AND_MEAN) // cURL includes windows.h, but we don't need all of it. # define WIN32_LEAN_AND_MEAN # endif From c527bd87fe127af6a302910b0a4fe20d1324ee22 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sat, 4 Sep 2021 13:47:30 -0700 Subject: [PATCH 307/681] remove more hutts --- src/openrct2/ride/RideConstruction.cpp | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index da9c19b514..3103e55614 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1349,12 +1349,12 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC // if it's not a maze, the sequence properties for the TrackElement must be found to determine if an // entrance can be placed on that side - // get the exit hut side relative to the TrackElement + // get the ride entrance's side relative to the TrackElement Direction direction = (direction_reverse(entranceExitCoords.direction) - tileElement->GetDirection()) & 3; const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << direction)) { - // if that side of the TrackElement supports stations, the entrance hut is valid and faces away from the + // if that side of the TrackElement supports stations, the ride entrance is valid and faces away from the // station entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; @@ -1369,8 +1369,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC { // create a 2-point rectangle. The rectangle will have a width or height of 0 depending on station direction or length // (if the station is 0) The 2-point rectangle is ballooned on all four sides by 1 tile for a 3xN or Nx3 rectangle. - // Whatever edge the entrance hut is on, rotate it outward to get entrance direction. - CoordsXY nextLocation = { stationStart.x, stationStart.y }; + // Whatever edge the ride entrance is on, rotate it outward to get entrance direction. + CoordsXY nextLocation = { stationStart }; CoordsXY entranceMin = { nextLocation }; CoordsXY entranceMax = { nextLocation }; @@ -1578,8 +1578,8 @@ void Ride::ValidateStations() for (const TileCoordsXYZD& locationCoords : locations) { auto locationList = ++locationListIter; - // determine if there's another hut at this location later in the array - // if there is, skip it. The last hut in the array at the location is not skipped + // determine if there's another ride entrance at this location later in the array + // if there is, skip it. The last ride entrance in the array at the location is not skipped bool duplicateLocation = false; while (locationList != locations.cend()) { @@ -1594,7 +1594,7 @@ void Ride::ValidateStations() if (duplicateLocation) { - // if it's a duplicate continue to the next hut + // if it's a duplicate continue to the next ride entrance continue; } // if it's not a duplicate location @@ -1615,12 +1615,12 @@ void Ride::ValidateStations() if (tileElement->AsEntrance()->GetEntranceType() > ENTRANCE_TYPE_RIDE_EXIT) continue; - // find the station that's connected to this hut + // find the station that's connected to this ride entrance CoordsXY nextLocation = location; nextLocation.x += CoordsDirectionDelta[tileElement->GetDirection()].x; nextLocation.y += CoordsDirectionDelta[tileElement->GetDirection()].y; - // if there's no connected station, remove the hut (see below) + // if there's no connected station, remove the ride entrance (see below) bool shouldRemove = true; TileElement* trackElement = map_get_first_element_at(nextLocation); if (trackElement == nullptr) @@ -1637,10 +1637,10 @@ void Ride::ValidateStations() auto trackType = trackElement->AsTrack()->GetTrackType(); uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); - // determine where the hut is relative to the station track + // determine where the ride entrance is relative to the station track Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - // if the hut is not on a valid side, remove the hut + // if the ride entrance is not on a valid side, remove it ted = &GetTrackElementDescriptor(trackType); if (!(ted->SequenceProperties[trackSequence] & (1 << direction))) { @@ -1657,7 +1657,7 @@ void Ride::ValidateStations() // if the location is already set for this station, big problem! if (!ride_get_exit_location(this, stationId).isNull()) break; - // set the station's exit hut location to this hut + // set the station's exit location to this one CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; ride_set_exit_location(this, stationId, TileCoordsXYZD{ loc }); } @@ -1666,16 +1666,16 @@ void Ride::ValidateStations() // if the location is already set for this station, big problem! if (!ride_get_entrance_location(this, stationId).isNull()) break; - // set the station's entrance hut location to this hut + // set the station's entrance location to this one CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; ride_set_entrance_location(this, stationId, TileCoordsXYZD{ loc }); } - // set the hut's StationIndex as this station + // set the entrance's StationIndex as this station tileElement->AsEntrance()->SetStationIndex(stationId); shouldRemove = false; } while (!(trackElement++)->IsLastForTile()); - // remove the hut and clean up if necessary + // remove the ride entrance and clean up if necessary if (shouldRemove) { footpath_queue_chain_reset(); From e3af9982a9e830d327fd801f5b4b6c9c6b734550 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sat, 4 Sep 2021 14:06:02 -0700 Subject: [PATCH 308/681] rework grid entrance rotation finder --- src/openrct2/ride/RideConstruction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 3103e55614..8ed51b59de 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1202,7 +1202,8 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; } -// for a 3xN or nx3 grid, find the direction that faces the inside. +// Finds the direction a station should face for an NxN station when called with an N+2xN+2 grid size. +// Direction is valid only if the tile in question is on the outer tiles of the grid static Direction GetEntranceExitDirection( int16_t mapX, int16_t mapY, int16_t entranceMinX, int16_t entranceMinY, int16_t entranceMaxX, int16_t entranceMaxY) { @@ -1354,8 +1355,8 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << direction)) { - // if that side of the TrackElement supports stations, the ride entrance is valid and faces away from the - // station + // if that side of the TrackElement supports stations, the ride entrance is valid and faces away from + // the station entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; return entranceExitCoords; From c23775bf8c33f3f76c42fca3c1bf6a3e1fd0daaf Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 4 Sep 2021 17:38:17 +0200 Subject: [PATCH 309/681] Remove hardcoded dropdown indices --- src/openrct2-ui/windows/TopToolbar.cpp | 71 ++++++++++++-------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index a14e62993e..d702b8994b 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -423,60 +423,55 @@ static void window_top_toolbar_mouseup(rct_window* w, rct_widgetindex widgetInde */ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - int32_t numItems; + int32_t numItems = 0; switch (widgetIndex) { case WIDX_FILE_MENU: if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) { - gDropdownItemsFormat[0] = STR_ABOUT; - gDropdownItemsFormat[1] = STR_OPTIONS; - gDropdownItemsFormat[2] = STR_SCREENSHOT; - gDropdownItemsFormat[3] = STR_GIANT_SCREENSHOT; - gDropdownItemsFormat[4] = STR_EMPTY; - gDropdownItemsFormat[5] = STR_QUIT_TRACK_DESIGNS_MANAGER; - gDropdownItemsFormat[6] = STR_EXIT_OPENRCT2; + gDropdownItemsFormat[numItems++] = STR_ABOUT; + gDropdownItemsFormat[numItems++] = STR_OPTIONS; + gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - gDropdownItemsFormat[5] = STR_QUIT_ROLLERCOASTER_DESIGNER; - - numItems = 7; + gDropdownItemsFormat[numItems++] = STR_QUIT_ROLLERCOASTER_DESIGNER; } else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { - gDropdownItemsFormat[0] = STR_LOAD_LANDSCAPE; - gDropdownItemsFormat[1] = STR_SAVE_LANDSCAPE; - gDropdownItemsFormat[2] = STR_EMPTY; - gDropdownItemsFormat[3] = STR_ABOUT; - gDropdownItemsFormat[4] = STR_OPTIONS; - gDropdownItemsFormat[5] = STR_SCREENSHOT; - gDropdownItemsFormat[6] = STR_GIANT_SCREENSHOT; - gDropdownItemsFormat[7] = STR_EMPTY; - gDropdownItemsFormat[8] = STR_QUIT_SCENARIO_EDITOR; - gDropdownItemsFormat[9] = STR_EXIT_OPENRCT2; - numItems = 10; + gDropdownItemsFormat[numItems++] = STR_LOAD_LANDSCAPE; + gDropdownItemsFormat[numItems++] = STR_SAVE_LANDSCAPE; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_ABOUT; + gDropdownItemsFormat[numItems++] = STR_OPTIONS; + gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_QUIT_SCENARIO_EDITOR; + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } else { - gDropdownItemsFormat[0] = STR_NEW_GAME; - gDropdownItemsFormat[1] = STR_LOAD_GAME; - gDropdownItemsFormat[2] = STR_SAVE_GAME; - gDropdownItemsFormat[3] = STR_SAVE_GAME_AS; - gDropdownItemsFormat[4] = STR_EMPTY; - gDropdownItemsFormat[5] = STR_ABOUT; - gDropdownItemsFormat[6] = STR_OPTIONS; - gDropdownItemsFormat[7] = STR_SCREENSHOT; - gDropdownItemsFormat[8] = STR_GIANT_SCREENSHOT; - gDropdownItemsFormat[9] = STR_EMPTY; - gDropdownItemsFormat[10] = STR_QUIT_TO_MENU; - gDropdownItemsFormat[11] = STR_EXIT_OPENRCT2; - numItems = 12; + gDropdownItemsFormat[numItems++] = STR_NEW_GAME; + gDropdownItemsFormat[numItems++] = STR_LOAD_GAME; + gDropdownItemsFormat[numItems++] = STR_SAVE_GAME; + gDropdownItemsFormat[numItems++] = STR_SAVE_GAME_AS; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_ABOUT; + gDropdownItemsFormat[numItems++] = STR_OPTIONS; + gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_QUIT_TO_MENU; + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; if (OpenRCT2::GetContext()->HasNewVersionInfo()) { - gDropdownItemsFormat[12] = STR_EMPTY; - gDropdownItemsFormat[13] = STR_UPDATE_AVAILABLE; - numItems += 2; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; } } WindowDropdownShowText( From b2dfeaf1b92781a89e2620360f079ec8f27c1f7d Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 5 Sep 2021 12:44:58 +0200 Subject: [PATCH 310/681] Introduce String::URLEncode --- src/openrct2/core/String.cpp | 28 ++++++++++++++++++++++++++++ src/openrct2/core/String.hpp | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index bb773e5df9..a1e9ff1370 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -14,7 +14,10 @@ #endif // __MINGW32__ #include +#include #include +#include +#include #include #include #ifndef _WIN32 @@ -823,6 +826,31 @@ namespace String return trunc; } + + std::string URLEncode(std::string_view value) + { + std::ostringstream escaped; + escaped.fill('0'); + escaped << std::hex; + + for (auto c : value) + { + // Keep alphanumeric and other accepted characters intact + if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') + { + escaped << c; + } + else + { + // Any other characters are percent-escaped + escaped << std::uppercase; + escaped << '%' << std::setw(2) << int32_t(static_cast(c)); + escaped << std::nouppercase; + } + } + + return escaped.str(); + } } // namespace String char32_t CodepointView::iterator::GetNextCodepoint(const char* ch, const char** next) diff --git a/src/openrct2/core/String.hpp b/src/openrct2/core/String.hpp index d4ce69210e..8c590ee207 100644 --- a/src/openrct2/core/String.hpp +++ b/src/openrct2/core/String.hpp @@ -178,6 +178,8 @@ namespace String */ std::string_view UTF8Truncate(std::string_view v, size_t size); + // Escapes special characters in a string to the percentage equivalent that can be used in URLs. + std::string URLEncode(std::string_view value); } // namespace String class CodepointView From 8ae918118a07722489b444d19ee0f1ece9449e9a Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 5 Sep 2021 13:56:52 +0200 Subject: [PATCH 311/681] Add a bug-report item in file dropdown menu --- data/language/en-GB.txt | 1 + distribution/changelog.txt | 3 ++- src/openrct2-ui/windows/TopToolbar.cpp | 25 ++++++++++++++++++++++--- src/openrct2/localisation/StringIds.h | 2 ++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index a64c2f6992..d78cd83530 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3654,6 +3654,7 @@ STR_6453 :Copy version info STR_6454 :Can’t rename banner… STR_6455 :Can’t rename sign… STR_6456 :Giant Screenshot +STR_6457 :Report a bug on GitHub ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 564b7fc02b..a800039df6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,7 +6,8 @@ - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. - Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. -- Feature: [#15294] New vehicle animation type: flying animal +- Feature: [#15195] Added a bug-report item in file dropdown menu. +- Feature: [#15294] New vehicle animation type: flying animal. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index d702b8994b..870ec0f40a 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -119,10 +121,12 @@ enum FILE_MENU_DDIDX { DDIDX_SCREENSHOT = 7, DDIDX_GIANT_SCREENSHOT = 8, // separator - DDIDX_QUIT_TO_MENU = 10, - DDIDX_EXIT_OPENRCT2 = 11, + DDIDX_FILE_BUG_ON_GITHUB = 10, // separator - DDIDX_UPDATE_AVAILABLE = 13, + DDIDX_QUIT_TO_MENU = 12, + DDIDX_EXIT_OPENRCT2 = 13, + // separator + DDIDX_UPDATE_AVAILABLE = 15, }; enum TOP_TOOLBAR_VIEW_MENU_DDIDX { @@ -435,6 +439,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; @@ -451,6 +457,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_SCENARIO_EDITOR; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } @@ -466,6 +474,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_TO_MENU; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; if (OpenRCT2::GetContext()->HasNewVersionInfo()) @@ -577,6 +587,15 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd case DDIDX_GIANT_SCREENSHOT: screenshot_giant(); break; + case DDIDX_FILE_BUG_ON_GITHUB: + { + std::string url = "https://github.com/OpenRCT2/OpenRCT2/issues/" + "new?assignees=&labels=bug&template=bug_report.yaml"; + auto versionStr = String::URLEncode(gVersionInfoFull); + url.append("&openrct2_build=" + versionStr); + OpenRCT2::GetContext()->GetUiContext()->OpenURL(url); + } + break; case DDIDX_QUIT_TO_MENU: { window_close_by_class(WC_MANAGE_TRACK_DESIGN); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 64b53a5e8f..66bf283cc2 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3909,6 +3909,8 @@ enum STR_SHORTCUT_GIANT_SCREENSHOT = 6456, + STR_FILE_BUG_ON_GITHUB = 6457, + // 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 7b2554cdae914e4b4d3e6ea3790d71df39917537 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 5 Sep 2021 16:06:34 +0200 Subject: [PATCH 312/681] Addendum to #15340: guard size of object_entry_group_counts --- src/openrct2/object/ObjectList.cpp | 2 ++ test/testpaint/Compat.cpp | 30 +++++++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 967ccef4a8..76f1a92a74 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -18,6 +18,7 @@ #include "ObjectRepository.h" #include +#include #include // 98DA00 @@ -41,6 +42,7 @@ int32_t object_entry_group_counts[] = { MAX_FOOTPATH_SURFACE_OBJECTS, MAX_FOOTPATH_RAILINGS_OBJECTS, }; +static_assert(std::size(object_entry_group_counts) == EnumValue(ObjectType::Count)); // 98DA2C int32_t object_entry_group_encoding[] = { diff --git a/test/testpaint/Compat.cpp b/test/testpaint/Compat.cpp index 5c23207e35..d0a62db3bf 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -9,6 +9,7 @@ #include "Addresses.h" +#include #include #include #include @@ -72,18 +73,25 @@ uint8_t get_current_rotation() } int object_entry_group_counts[] = { - 128, // rides - 252, // small scenery - 128, // large scenery - 128, // walls - 32, // banners - 16, // paths - 15, // path bits - 19, // scenery sets - 1, // park entrance - 1, // water - 1 // scenario text + 128, // ObjectType::Ride + 252, // ObjectType::SmallScenery + 128, // ObjectType::LargeScenery + 128, // ObjectType::Walls + 32, // ObjectType::Banners + 16, // ObjectType::Paths + 15, // ObjectType::PathBits + 19, // ObjectType::SceneryGroup + 1, // ObjectType::ParkEntrance + 1, // ObjectType::Water + 1, // ObjectType::ScenarioText + 0, // ObjectType::TerrainSurface + 0, // ObjectType::TerrainEdge + 0, // ObjectType::Station + 0, // ObjectType::Music + 0, // ObjectType::FootpathSurface + 0, // ObjectType::FootpathRailings }; +static_assert(std::size(object_entry_group_counts) == EnumValue(ObjectType::Count)); GeneralConfiguration gConfigGeneral; uint16_t gMapSelectFlags; From 23f4f720471451d8a9e63c01a7b4b76b1b0a0394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 5 Sep 2021 16:59:42 +0300 Subject: [PATCH 313/681] Fix enum serialization not using byte swap --- src/openrct2/core/DataSerialiserTraits.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index bb4b638724..7cea7fe8f5 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -38,19 +38,23 @@ template struct DataSerializerTraits_t template struct DataSerializerTraits_enum { + using TUnderlying = std::underlying_type_t; + static void encode(OpenRCT2::IStream* stream, const T& val) { - stream->Write(&val); + TUnderlying temp = ByteSwapBE(static_cast(val)); + stream->Write(&temp); } static void decode(OpenRCT2::IStream* stream, T& val) { - stream->Read(&val); + TUnderlying temp; + stream->Read(&temp); + val = static_cast(ByteSwapBE(temp)); } static void log(OpenRCT2::IStream* stream, const T& val) { - using underlying = std::underlying_type_t; std::stringstream ss; - ss << std::hex << std::setw(sizeof(underlying) * 2) << std::setfill('0') << static_cast(val); + ss << std::hex << std::setw(sizeof(TUnderlying) * 2) << std::setfill('0') << static_cast(val); std::string str = ss.str(); stream->Write(str.c_str(), str.size()); From b8d1f86f3f91316a9ad78137d571ae4229240f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:21:51 +0300 Subject: [PATCH 314/681] Use correct underlying type for Vehicle::Status enum --- src/openrct2/ride/Vehicle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index bc04b53ddf..2146af930d 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -63,7 +63,7 @@ struct Vehicle : EntityBase Tail, }; - enum class Status + enum class Status : uint8_t { MovingToEndOfStation, WaitingForPassengers, From c844bf91423d718e49a348dc78081d3277f66987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:22:52 +0300 Subject: [PATCH 315/681] Bump up network version --- 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 f60ab85a15..691c0467e9 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "7" +#define NETWORK_STREAM_VERSION "8" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 745885e78eca33b08407f25631246646b3919ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:49:42 +0300 Subject: [PATCH 316/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e6e4d0bd..ab47c2c638 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.49") +set(REPLAYS_VERSION "0.0.50") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "004AE4D38D1326913AF5DE7A90E8AF31DD31BF94") +set(REPLAYS_SHA1 "C569C73147F1C1554807B6FBE74C39A4F0E20EAF") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 294fb087f3..504b00508c 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.49/replays.zip - 004AE4D38D1326913AF5DE7A90E8AF31DD31BF94 + https://github.com/OpenRCT2/replays/releases/download/v0.0.50/replays.zip + C569C73147F1C1554807B6FBE74C39A4F0E20EAF From 2282f24404bc21e8d2148f8379767dcae6d9e7da Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 5 Sep 2021 16:58:54 +0200 Subject: [PATCH 317/681] Rename path surface and railings descriptors --- src/openrct2-ui/windows/Footpath.cpp | 28 ++++++------- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2/object/FootpathObject.cpp | 34 +++++++-------- src/openrct2/object/FootpathObject.h | 12 +++--- src/openrct2/paint/Supports.cpp | 28 ++++++------- src/openrct2/paint/Supports.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 4 +- .../paint/tile_element/Paint.Path.cpp | 42 +++++++++---------- src/openrct2/ride/TrackDesign.cpp | 4 +- src/openrct2/world/Footpath.cpp | 14 +++---- src/openrct2/world/Footpath.h | 30 ++++++------- src/openrct2/world/TileElement.h | 4 +- 12 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index c548259d2c..dfb6508ac3 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -187,8 +187,8 @@ static bool footpath_select_default(); rct_window* window_footpath_open() { // If a restricted path was selected when the game is no longer in Sandbox mode, reset it - PathSurfaceEntry* pathEntry = get_path_surface_entry(gFootpathSelectedId); - if (pathEntry != nullptr && (pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !gCheatsSandboxMode) + PathSurfaceDescriptor* pathEntry = get_path_surface_entry(gFootpathSelectedId); + if (pathEntry != nullptr && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !gCheatsSandboxMode) { pathEntry = nullptr; } @@ -369,12 +369,12 @@ static void window_footpath_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t i = 0, j = 0; for (; i < MAX_PATH_OBJECTS; i++) { - PathSurfaceEntry* pathType = get_path_surface_entry(i); + PathSurfaceDescriptor* pathType = get_path_surface_entry(i); if (pathType == nullptr) { continue; } - if ((pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) { continue; } @@ -577,9 +577,9 @@ static void window_footpath_invalidate(rct_window* w) auto pathEntry = get_path_surface_entry(gFootpathSelectedId); if (pathEntry != nullptr) { - pathImage = pathEntry->preview; + pathImage = pathEntry->PreviewImage; // Editor-only paths might lack a queue image - queueImage = (pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1; + queueImage = (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1; } window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage; @@ -610,8 +610,8 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) int32_t image = ConstructionPreviewImages[slope][direction]; int32_t selectedPath = gFootpathSelectedId + (MAX_PATH_OBJECTS * _footpathSelectedType); - PathSurfaceEntry* pathType = get_path_surface_entry(selectedPath); - image += pathType->image; + PathSurfaceDescriptor* pathType = get_path_surface_entry(selectedPath); + image += pathType->Image; // Draw construction image screenCoords = w->windowPos @@ -647,7 +647,7 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget* widget, bool showQueues) { int32_t i, image; - PathSurfaceEntry* pathType; + PathSurfaceDescriptor* pathType; uint32_t numPathTypes = 0; // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor @@ -660,14 +660,14 @@ static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget { continue; } - if ((pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) { continue; } - image = pathType->preview; + image = pathType->PreviewImage; // Editor-only paths usually lack queue images. In this case, use the main path image - if (showQueues && !(pathType->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + if (showQueues && !(pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) { image++; } @@ -1227,13 +1227,13 @@ static bool footpath_select_default() int32_t footpathId = -1; for (int32_t i = 0; i < object_entry_group_counts[EnumValue(ObjectType::Paths)]; i++) { - PathSurfaceEntry* pathEntry = get_path_surface_entry(i); + PathSurfaceDescriptor* pathEntry = get_path_surface_entry(i); if (pathEntry != nullptr) { footpathId = i; // Prioritise non-restricted path - if (!(pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + if (!(pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) { break; } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 9fe20395ba..b1f8042bc6 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1886,7 +1886,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Path name auto ft = Formatter(); - ft.Add(tileElement->AsPath()->GetSurfaceEntry()->string_idx); + ft.Add(tileElement->AsPath()->GetSurfaceEntry()->Name); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); // Path addition diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 827c3527c9..26c5961cf9 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -40,23 +40,23 @@ void FootpathObject::Load() _legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); _legacyType.bridge_image = _legacyType.image + 109; - _pathSurfaceEntry.string_idx = _legacyType.string_idx; - _pathSurfaceEntry.image = _legacyType.image; - _pathSurfaceEntry.preview = _legacyType.GetPreviewImage(); - _pathSurfaceEntry.flags = _legacyType.flags; + _pathSurfaceEntry.Name = _legacyType.string_idx; + _pathSurfaceEntry.Image = _legacyType.image; + _pathSurfaceEntry.PreviewImage = _legacyType.GetPreviewImage(); + _pathSurfaceEntry.Flags = _legacyType.flags; - _queueEntry.string_idx = _legacyType.string_idx; - _queueEntry.image = _legacyType.GetQueueImage(); - _queueEntry.preview = _legacyType.GetQueuePreviewImage(); - _queueEntry.flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; + _queueEntry.Name = _legacyType.string_idx; + _queueEntry.Image = _legacyType.GetQueueImage(); + _queueEntry.PreviewImage = _legacyType.GetQueuePreviewImage(); + _queueEntry.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; - _pathRailingsEntry.string_idx = _legacyType.string_idx; - _pathRailingsEntry.bridge_image = _legacyType.bridge_image; - _pathRailingsEntry.preview = _legacyType.GetPreviewImage(); - _pathRailingsEntry.flags = _legacyType.flags; - _pathRailingsEntry.scrolling_mode = _legacyType.scrolling_mode; - _pathRailingsEntry.support_type = _legacyType.support_type; - _pathRailingsEntry.railings_image = _legacyType.GetRailingsImage(); + _pathRailingsEntry.Name = _legacyType.string_idx; + _pathRailingsEntry.BridgeImage = _legacyType.bridge_image; + _pathRailingsEntry.PreviewImage = _legacyType.GetPreviewImage(); + _pathRailingsEntry.Flags = _legacyType.flags; + _pathRailingsEntry.ScrollingMode = _legacyType.scrolling_mode; + _pathRailingsEntry.SupportType = _legacyType.support_type; + _pathRailingsEntry.RailingsImage = _legacyType.GetRailingsImage(); } void FootpathObject::Unload() @@ -71,8 +71,8 @@ void FootpathObject::Unload() void FootpathObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const { auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 }; - gfx_draw_sprite(dpi, _pathSurfaceEntry.preview, screenCoords - ScreenCoordsXY{ 49, 17 }, 0); - gfx_draw_sprite(dpi, _queueEntry.preview, screenCoords + ScreenCoordsXY{ 4, -17 }, 0); + gfx_draw_sprite(dpi, _pathSurfaceEntry.PreviewImage, screenCoords - ScreenCoordsXY{ 49, 17 }, 0); + gfx_draw_sprite(dpi, _queueEntry.PreviewImage, screenCoords + ScreenCoordsXY{ 4, -17 }, 0); } static RailingEntrySupportType ParseSupportType(const std::string& s) diff --git a/src/openrct2/object/FootpathObject.h b/src/openrct2/object/FootpathObject.h index 7fe5274cdb..52af3a2ae9 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -16,9 +16,9 @@ class FootpathObject final : public Object { private: rct_footpath_entry _legacyType = {}; - PathSurfaceEntry _pathSurfaceEntry = {}; - PathSurfaceEntry _queueEntry = {}; - PathRailingsEntry _pathRailingsEntry = {}; + PathSurfaceDescriptor _pathSurfaceEntry = {}; + PathSurfaceDescriptor _queueEntry = {}; + PathRailingsDescriptor _pathRailingsEntry = {}; public: explicit FootpathObject(const rct_object_entry& entry) @@ -31,17 +31,17 @@ public: return &_legacyType; } - PathSurfaceEntry* GetPathSurfaceEntry() + PathSurfaceDescriptor* GetPathSurfaceEntry() { return &_pathSurfaceEntry; } - PathSurfaceEntry* GetQueueEntry() + PathSurfaceDescriptor* GetQueueEntry() { return &_queueEntry; } - PathRailingsEntry* GetPathRailingsEntry() + PathRailingsDescriptor* GetPathRailingsEntry() { return &_pathRailingsEntry; } diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 754f687298..7c73be108b 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -1168,7 +1168,7 @@ bool metal_b_supports_paint_setup( */ bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsEntry* railingEntry, bool* underground) + PathRailingsDescriptor* railingEntry, bool* underground) { if (underground != nullptr) { @@ -1202,7 +1202,7 @@ bool path_a_supports_paint_setup( { // save dx2 PaintAddImageAsParent( - session, (railingEntry->bridge_image + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); + session, (railingEntry->BridgeImage + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1216,7 +1216,7 @@ bool path_a_supports_paint_setup( } uint32_t imageId = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingEntry->bridge_image; + + railingEntry->BridgeImage; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1239,7 +1239,7 @@ bool path_a_supports_paint_setup( } uint32_t ebx = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingEntry->bridge_image; + + railingEntry->BridgeImage; PaintAddImageAsParent(session, ebx | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1251,7 +1251,7 @@ bool path_a_supports_paint_setup( { if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight) { - uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 23; + uint32_t imageId = (supportType * 24) + railingEntry->BridgeImage + 23; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) }); @@ -1261,7 +1261,7 @@ bool path_a_supports_paint_setup( } else { - uint32_t imageId = (supportType * 24) + railingEntry->bridge_image + 22; + uint32_t imageId = (supportType * 24) + railingEntry->BridgeImage + 22; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) }); @@ -1275,7 +1275,7 @@ bool path_a_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - uint32_t imageId = railingEntry->bridge_image + 55 + specialIndex; + uint32_t imageId = railingEntry->BridgeImage + 55 + specialIndex; const unk_supports_desc& supportsDesc = byte_98D8D4[specialIndex]; const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; @@ -1320,7 +1320,7 @@ bool path_a_supports_paint_setup( */ bool path_b_supports_paint_setup( paint_session* session, int32_t segment, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsEntry* railingEntry) + PathRailingsDescriptor* railingEntry) { support_height* supportSegments = session->SupportSegments; @@ -1342,7 +1342,7 @@ bool path_b_supports_paint_setup( uint16_t baseHeight; if ((supportSegments[segment].slope & 0x20) || (height - supportSegments[segment].height < 6) - || !(railingEntry->flags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) + || !(railingEntry->Flags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) { baseHeight = supportSegments[segment].height; } @@ -1352,7 +1352,7 @@ bool path_b_supports_paint_setup( baseHeight = supportSegments[segment].height; PaintAddImageAsParent( - session, (railingEntry->bridge_image + 37 + imageOffset) | imageColourFlags, + session, (railingEntry->BridgeImage + 37 + imageOffset) | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1371,7 +1371,7 @@ bool path_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (heightDiff - 1)) | imageColourFlags, + session, (railingEntry->BridgeImage + 20 + (heightDiff - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } @@ -1404,7 +1404,7 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, (railingEntry->bridge_image + 20 + (z - 1)) | imageColourFlags, + session, (railingEntry->BridgeImage + 20 + (z - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; @@ -1415,7 +1415,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); + uint32_t imageId = railingEntry->BridgeImage + 20 + (z - 1); if (z == 16) { imageId += 1; @@ -1449,7 +1449,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->bridge_image + 20 + (z - 1); + uint32_t imageId = railingEntry->BridgeImage + 20 + (z - 1); PaintAddImageAsParent( session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, 0 }, { SupportBoundBoxes[segment], baseHeight }); diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 15f2d160ae..3131df3e03 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -24,10 +24,10 @@ bool metal_b_supports_paint_setup( paint_session* session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, uint32_t imageColourFlags); bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsEntry* railingEntry, bool* underground); + PathRailingsDescriptor* railingEntry, bool* underground); bool path_b_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsEntry* railingEntry); + PathRailingsDescriptor* railingEntry); // There are 13 types of metal supports. A graphic showing all of them is available here: // https://cloud.githubusercontent.com/assets/737603/19420485/7eaba28e-93ec-11e6-83cb-03190accc094.png diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index def51a9793..fb4dbdd63f 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -245,7 +245,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 // Index to which part of the entrance // Middle, left, right uint8_t part_index = tile_element.GetSequenceIndex(); - PathSurfaceEntry* path_entry = nullptr; + PathSurfaceDescriptor* path_entry = nullptr; // The left and right of the park entrance often have this set to 127. // So only attempt to get the footpath type if we're dealing with the middle bit of the entrance. @@ -260,7 +260,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 case 0: if (path_entry != nullptr) { - image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; + image_id = (path_entry->Image + 5 * (1 + (direction & 1))) | ghost_id; PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 0x1C, 0 }, { 0, 2, height }); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index b1b3bacf92..939f66a857 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -86,11 +86,11 @@ static constexpr const uint8_t byte_98D8A4[] = { // clang-format on void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceDescriptor* footpathEntry, + PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceDescriptor* footpathEntry, + PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); /* rct2: 0x006A5AE5 */ static void path_bit_lights_paint( @@ -326,9 +326,9 @@ static void path_bit_jumping_fountains_paint( */ static void sub_6A4101( paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool word_F3F038, - PathRailingsEntry* railingEntry, uint32_t imageFlags) + PathRailingsDescriptor* railingEntry, uint32_t imageFlags) { - uint32_t base_image_id = railingEntry->railings_image | imageFlags; + uint32_t base_image_id = railingEntry->RailingsImage | imageFlags; if (pathElement.IsQueue()) { @@ -447,7 +447,7 @@ static void sub_6A4101( auto ride = get_ride(pathElement.GetRideIndex()); if (direction < 2 && ride != nullptr && imageFlags == 0) { - uint16_t scrollingMode = railingEntry->scrolling_mode; + uint16_t scrollingMode = railingEntry->ScrollingMode; scrollingMode += direction; auto ft = Formatter(); @@ -669,7 +669,7 @@ static void sub_6A4101( */ static void sub_6A3F61( paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, - PathRailingsEntry* railingEntry, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) + PathRailingsDescriptor* railingEntry, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) { // eax -- // ebx -- @@ -943,12 +943,12 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE PaintAddImageAsParent(session, imageId, { 16, 16, heightMarkerBaseZ }, { 1, 1, 0 }); } - PathSurfaceEntry* footpathEntry = tileElement.GetSurfaceEntry(); - PathRailingsEntry* railingEntry = tileElement.GetRailingEntry(); + PathSurfaceDescriptor* footpathEntry = tileElement.GetSurfaceEntry(); + PathRailingsDescriptor* railingEntry = tileElement.GetRailingEntry(); if (footpathEntry != nullptr && railingEntry != nullptr) { - if (railingEntry->support_type == RailingEntrySupportType::Pole) + if (railingEntry->SupportType == RailingEntrySupportType::Pole) { path_paint_pole_support( session, tileElement, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); @@ -993,8 +993,8 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceDescriptor* footpathEntry, + PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1019,7 +1019,7 @@ void path_paint_box_support( imageId = byte_98D6E0[edi]; } - imageId += footpathEntry->image; + imageId += footpathEntry->Image; if (!session->DidPassSurface) { @@ -1054,11 +1054,11 @@ void path_paint_box_support( if (pathElement.IsSloped()) { image_id = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingEntry->bridge_image + 51; + + railingEntry->BridgeImage + 51; } else { - image_id = byte_98D8A4[edges] + railingEntry->bridge_image + 49; + image_id = byte_98D8A4[edges] + railingEntry->BridgeImage + 49; } PaintAddImageAsParent( @@ -1139,8 +1139,8 @@ void path_paint_box_support( } void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceEntry* footpathEntry, - PathRailingsEntry* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceDescriptor* footpathEntry, + PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1165,7 +1165,7 @@ void path_paint_pole_support( imageId = byte_98D6E0[edi]; } - imageId += footpathEntry->image; + imageId += footpathEntry->Image; // Below Surface if (!session->DidPassSurface) @@ -1202,11 +1202,11 @@ void path_paint_pole_support( { bridgeImage = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingEntry->bridge_image + 16; + + railingEntry->BridgeImage + 16; } else { - bridgeImage = edges + railingEntry->bridge_image; + bridgeImage = edges + railingEntry->BridgeImage; bridgeImage |= imageFlags; } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index c3c042ed5f..2deca96b0a 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -874,7 +874,7 @@ static bool TrackDesignPlaceSceneryElementGetEntry( } entry_index = 0; - for (PathSurfaceEntry* path = get_path_surface_entry(0); + for (PathSurfaceDescriptor* path = get_path_surface_entry(0); entry_index < object_entry_group_counts[EnumValue(ObjectType::Paths)]; path = get_path_surface_entry(entry_index), entry_index++) { @@ -882,7 +882,7 @@ static bool TrackDesignPlaceSceneryElementGetEntry( { return true; } - if (path->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) + if (path->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) { return true; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 1dceddad05..398dc4f8a0 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1652,7 +1652,7 @@ PathRailingsIndex PathElement::GetRailingEntryIndex() const return GetSurfaceEntryIndex(); } -PathSurfaceEntry* PathElement::GetSurfaceEntry() const +PathSurfaceDescriptor* PathElement::GetSurfaceEntry() const { if (!IsQueue()) return get_path_surface_entry(GetSurfaceEntryIndex()); @@ -1660,7 +1660,7 @@ PathSurfaceEntry* PathElement::GetSurfaceEntry() const return get_path_surface_entry(GetSurfaceEntryIndex() + MAX_PATH_OBJECTS); } -PathRailingsEntry* PathElement::GetRailingEntry() const +PathRailingsDescriptor* PathElement::GetRailingEntry() const { return get_path_railings_entry(GetRailingEntryIndex()); } @@ -1688,7 +1688,7 @@ void PathElement::SetQueueBannerDirection(uint8_t direction) bool PathElement::ShouldDrawPathOverSupports() const { - return (GetRailingEntry()->flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); + return (GetRailingEntry()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); } void PathElement::SetShouldDrawPathOverSupports(bool on) @@ -2247,9 +2247,9 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem tileElement->AsPath()->SetEdgesAndCorners(0); } -PathSurfaceEntry* get_path_surface_entry(PathSurfaceIndex entryIndex) +PathSurfaceDescriptor* get_path_surface_entry(PathSurfaceIndex entryIndex) { - PathSurfaceEntry* result = nullptr; + PathSurfaceDescriptor* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); // TODO: Change when moving to the new save format. auto obj = objMgr.GetLoadedObject(ObjectType::Paths, entryIndex % MAX_PATH_OBJECTS); @@ -2263,9 +2263,9 @@ PathSurfaceEntry* get_path_surface_entry(PathSurfaceIndex entryIndex) return result; } -PathRailingsEntry* get_path_railings_entry(PathRailingsIndex entryIndex) +PathRailingsDescriptor* get_path_railings_entry(PathRailingsIndex entryIndex) { - PathRailingsEntry* result = nullptr; + PathRailingsDescriptor* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); auto obj = objMgr.GetLoadedObject(ObjectType::Paths, entryIndex); if (obj != nullptr) diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index f31d4fea8f..3c6ec98ace 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -70,23 +70,23 @@ struct rct_footpath_entry assert_struct_size(rct_footpath_entry, 13); #pragma pack(pop) -struct PathSurfaceEntry +struct PathSurfaceDescriptor { - rct_string_id string_idx; - uint32_t image; - uint32_t preview; - uint8_t flags; + rct_string_id Name; + uint32_t Image; + uint32_t PreviewImage; + uint8_t Flags; }; -struct PathRailingsEntry +struct PathRailingsDescriptor { - rct_string_id string_idx; - uint32_t preview; - uint32_t bridge_image; - uint32_t railings_image; - RailingEntrySupportType support_type; - uint8_t flags; - uint8_t scrolling_mode; + rct_string_id Name; + uint32_t PreviewImage; + uint32_t BridgeImage; + uint32_t RailingsImage; + RailingEntrySupportType SupportType; + uint8_t Flags; + uint8_t ScrollingMode; }; struct ProvisionalFootpath @@ -215,8 +215,8 @@ bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); int32_t footpath_is_connected_to_map_edge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags); void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement); -PathSurfaceEntry* get_path_surface_entry(PathSurfaceIndex entryIndex); -PathRailingsEntry* get_path_railings_entry(PathRailingsIndex entryIndex); +PathSurfaceDescriptor* get_path_surface_entry(PathSurfaceIndex entryIndex); +PathRailingsDescriptor* get_path_railings_entry(PathRailingsIndex entryIndex); void footpath_queue_chain_reset(); void footpath_queue_chain_push(ride_id_t rideIndex); diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 8b12e7a319..008b21be4a 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -282,11 +282,11 @@ private: public: PathSurfaceIndex GetSurfaceEntryIndex() const; - PathSurfaceEntry* GetSurfaceEntry() const; + PathSurfaceDescriptor* GetSurfaceEntry() const; void SetSurfaceEntryIndex(PathSurfaceIndex newIndex); PathRailingsIndex GetRailingEntryIndex() const; - PathRailingsEntry* GetRailingEntry() const; + PathRailingsDescriptor* GetRailingEntry() const; void SetRailingEntryIndex(PathRailingsIndex newIndex); uint8_t GetQueueBannerDirection() const; From 4cc717ccdbece7d193a9c9e1e2ed1bd6e74e22bd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 5 Sep 2021 18:44:43 +0200 Subject: [PATCH 318/681] Rework path surface and railings descriptor handling --- src/openrct2-ui/windows/Footpath.cpp | 82 ++++++++++--------- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2/EditorObjectSelectionSession.cpp | 4 +- src/openrct2/actions/FootpathPlaceAction.cpp | 14 ++-- .../actions/FootpathPlaceFromTrackAction.cpp | 8 +- .../actions/PlaceParkEntranceAction.cpp | 2 +- src/openrct2/object/FootpathObject.cpp | 34 ++++---- src/openrct2/object/FootpathObject.h | 18 ++-- .../object/FootpathRailingsObject.cpp | 8 ++ src/openrct2/object/FootpathRailingsObject.h | 6 ++ src/openrct2/object/FootpathSurfaceObject.cpp | 5 ++ src/openrct2/object/FootpathSurfaceObject.h | 6 ++ src/openrct2/paint/Supports.cpp | 32 ++++---- src/openrct2/paint/Supports.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 10 ++- .../paint/tile_element/Paint.Path.cpp | 53 ++++++------ src/openrct2/rct1/S4Importer.cpp | 29 +------ src/openrct2/rct2/S6Exporter.cpp | 4 +- src/openrct2/rct2/S6Importer.cpp | 4 +- src/openrct2/ride/RideRatings.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 11 +-- src/openrct2/ride/TrackDesignSave.cpp | 4 +- .../bindings/world/ScTileElement.cpp | 8 +- src/openrct2/world/Entrance.cpp | 14 +++- src/openrct2/world/Footpath.cpp | 66 ++++++--------- src/openrct2/world/Footpath.h | 34 ++++---- src/openrct2/world/TileElement.h | 23 +++--- 27 files changed, 250 insertions(+), 237 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index dfb6508ac3..1cdd7ba637 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -187,14 +188,14 @@ static bool footpath_select_default(); rct_window* window_footpath_open() { // If a restricted path was selected when the game is no longer in Sandbox mode, reset it - PathSurfaceDescriptor* pathEntry = get_path_surface_entry(gFootpathSelectedId); - if (pathEntry != nullptr && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !gCheatsSandboxMode) + const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); + if (legacyPathEntry != nullptr && legacyPathEntry->GetPathSurfaceDescriptor().IsEditorOnly() && !gCheatsSandboxMode) { - pathEntry = nullptr; + legacyPathEntry = nullptr; } // Select the default path if we don't have one - if (pathEntry == nullptr) + if (legacyPathEntry == nullptr) { if (!footpath_select_default()) { @@ -369,12 +370,12 @@ static void window_footpath_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t i = 0, j = 0; for (; i < MAX_PATH_OBJECTS; i++) { - PathSurfaceDescriptor* pathType = get_path_surface_entry(i); - if (pathType == nullptr) - { + const auto* legacyPathEntry = GetLegacyFootpathEntry(i); + if (legacyPathEntry == nullptr) continue; - } - if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + + const PathSurfaceDescriptor& surfaceDescriptor = legacyPathEntry->GetPathSurfaceDescriptor(); + if (surfaceDescriptor.IsEditorOnly() && !showEditorPaths) { continue; } @@ -574,12 +575,11 @@ static void window_footpath_invalidate(rct_window* w) // Set footpath and queue type button images auto pathImage = static_cast(SPR_NONE); auto queueImage = static_cast(SPR_NONE); - auto pathEntry = get_path_surface_entry(gFootpathSelectedId); - if (pathEntry != nullptr) + const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); + if (legacyPathEntry != nullptr) { - pathImage = pathEntry->PreviewImage; - // Editor-only paths might lack a queue image - queueImage = (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) ? pathImage : pathImage + 1; + pathImage = legacyPathEntry->GetPathSurfaceDescriptor().PreviewImage; + queueImage = legacyPathEntry->GetQueueSurfaceDescriptor().PreviewImage; } window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage; @@ -609,9 +609,14 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) } int32_t image = ConstructionPreviewImages[slope][direction]; - int32_t selectedPath = gFootpathSelectedId + (MAX_PATH_OBJECTS * _footpathSelectedType); - PathSurfaceDescriptor* pathType = get_path_surface_entry(selectedPath); - image += pathType->Image; + const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); + if (legacyPathEntry != nullptr) + { + if (_footpathSelectedType == SELECTED_PATH_TYPE_NORMAL) + image += legacyPathEntry->GetPathSurfaceDescriptor().Image; + else + image += legacyPathEntry->GetQueueSurfaceDescriptor().Image; + } // Draw construction image screenCoords = w->windowPos @@ -646,32 +651,28 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget* widget, bool showQueues) { - int32_t i, image; - PathSurfaceDescriptor* pathType; - 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); - for (i = 0; i < MAX_PATH_OBJECTS; i++) + for (int32_t i = 0; i < MAX_PATH_OBJECTS; i++) { - pathType = get_path_surface_entry(i); - if (pathType == nullptr) - { - continue; - } - if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + const auto* legacyPathEntry = GetLegacyFootpathEntry(i); + if (legacyPathEntry == nullptr) { continue; } - image = pathType->PreviewImage; - // Editor-only paths usually lack queue images. In this case, use the main path image - if (showQueues && !(pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + const auto& surfaceDescriptor = (showQueues) ? legacyPathEntry->GetQueueSurfaceDescriptor() + : legacyPathEntry->GetPathSurfaceDescriptor(); + + if (surfaceDescriptor.IsEditorOnly() && !showEditorPaths) { - image++; + continue; } + const auto image = surfaceDescriptor.PreviewImage; + gDropdownItemsFormat[numPathTypes] = STR_NONE; gDropdownItemsArgs[numPathTypes] = image; numPathTypes++; @@ -1227,16 +1228,17 @@ static bool footpath_select_default() int32_t footpathId = -1; for (int32_t i = 0; i < object_entry_group_counts[EnumValue(ObjectType::Paths)]; i++) { - PathSurfaceDescriptor* pathEntry = get_path_surface_entry(i); - if (pathEntry != nullptr) - { - footpathId = i; + const auto* footpathObject = GetLegacyFootpathEntry(i); + if (footpathObject == nullptr) + continue; - // Prioritise non-restricted path - if (!(pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) - { - break; - } + footpathId = i; + + const PathSurfaceDescriptor& surfaceDescriptor = footpathObject->GetPathSurfaceDescriptor(); + // Prioritise non-restricted path + if (!surfaceDescriptor.IsEditorOnly()) + { + break; } } if (footpathId == -1) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index b1f8042bc6..bfadeab869 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1886,7 +1886,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Path name auto ft = Formatter(); - ft.Add(tileElement->AsPath()->GetSurfaceEntry()->Name); + ft.Add(tileElement->AsPath()->GetSurfaceDescriptor()->Name); DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); // Path addition diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 687233c39f..622262fe06 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -140,7 +140,7 @@ void setup_in_use_selection_flags() case TILE_ELEMENT_TYPE_TRACK: break; case TILE_ELEMENT_TYPE_PATH: - type = iter.element->AsPath()->GetSurfaceEntryIndex(); + type = iter.element->AsPath()->GetLegacyPathEntryIndex(); assert(type < object_entry_group_counts[EnumValue(ObjectType::Paths)]); Editor::SetSelectedObject(ObjectType::Paths, type, OBJECT_SELECTION_FLAG_SELECTED); @@ -164,7 +164,7 @@ void setup_in_use_selection_flags() Editor::SetSelectedObject(ObjectType::ParkEntrance, 0, OBJECT_SELECTION_FLAG_SELECTED); - type = iter.element->AsEntrance()->GetPathType(); + type = iter.element->AsEntrance()->GetLegacyPathEntryIndex(); assert(type < object_entry_group_counts[EnumValue(ObjectType::Paths)]); Editor::SetSelectedObject(ObjectType::Paths, type, OBJECT_SELECTION_FLAG_SELECTED); break; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 6124336ffd..b294f1ee2a 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -153,7 +153,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateQuery(PathElement* pa { const int32_t newFootpathType = (_type & (FOOTPATH_PROPERTIES_TYPE_MASK >> 4)); const bool newPathIsQueue = ((_type >> 7) == 1); - if (pathElement->GetSurfaceEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (pathElement->GetLegacyPathEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) { res->Cost += MONEY(6, 00); } @@ -169,7 +169,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateExecute(PathElement* { const int32_t newFootpathType = (_type & (FOOTPATH_PROPERTIES_TYPE_MASK >> 4)); const bool newPathIsQueue = ((_type >> 7) == 1); - if (pathElement->GetSurfaceEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (pathElement->GetLegacyPathEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) { res->Cost += MONEY(6, 00); } @@ -181,7 +181,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateExecute(PathElement* footpath_remove_edges_at(_loc, reinterpret_cast(pathElement)); } - pathElement->SetSurfaceEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); + pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); bool isQueue = _type & FOOTPATH_ELEMENT_INSERT_QUEUE; pathElement->SetIsQueue(isQueue); @@ -238,7 +238,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_type & 0xF)) + if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); @@ -304,7 +304,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_type & 0xF)) + if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); @@ -339,7 +339,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !entranceIsSamePath) { // Set the path type but make sure it's not a queue as that will not show up - entranceElement->SetPathType(_type & 0x7F); + entranceElement->SetLegacyPathEntryIndex(_type & 0x7F); map_invalidate_tile_full(_loc); } } @@ -349,7 +349,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetSurfaceEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); + pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); pathElement->SetIsQueue(_type & FOOTPATH_ELEMENT_INSERT_QUEUE); diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index 80249c155f..0c73ba201d 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -122,7 +122,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_type & 0xF)) + if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); @@ -189,7 +189,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetPathType() == (_type & 0xF)) + if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); @@ -223,7 +223,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !entranceIsSamePath) { // Set the path type but make sure it's not a queue as that will not show up - entranceElement->SetPathType(_type & 0x7F); + entranceElement->SetLegacyPathEntryIndex(_type & 0x7F); map_invalidate_tile_full(_loc); } } @@ -233,7 +233,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetSurfaceEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); + pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); pathElement->SetIsQueue(_type & FOOTPATH_ELEMENT_INSERT_QUEUE); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 8b4e3db1d2..72c9d102b8 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -146,7 +146,7 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Execute() const entranceElement->SetDirection(_loc.direction); entranceElement->SetSequenceIndex(index); entranceElement->SetEntranceType(ENTRANCE_TYPE_PARK_ENTRANCE); - entranceElement->SetPathType(_pathType); + entranceElement->SetLegacyPathEntryIndex(_pathType); if (!entranceElement->IsGhost()) { diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 26c5961cf9..17df28d69c 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -40,23 +40,23 @@ void FootpathObject::Load() _legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); _legacyType.bridge_image = _legacyType.image + 109; - _pathSurfaceEntry.Name = _legacyType.string_idx; - _pathSurfaceEntry.Image = _legacyType.image; - _pathSurfaceEntry.PreviewImage = _legacyType.GetPreviewImage(); - _pathSurfaceEntry.Flags = _legacyType.flags; + _pathSurfaceDescriptor.Name = _legacyType.string_idx; + _pathSurfaceDescriptor.Image = _legacyType.image; + _pathSurfaceDescriptor.PreviewImage = _legacyType.GetPreviewImage(); + _pathSurfaceDescriptor.Flags = _legacyType.flags; - _queueEntry.Name = _legacyType.string_idx; - _queueEntry.Image = _legacyType.GetQueueImage(); - _queueEntry.PreviewImage = _legacyType.GetQueuePreviewImage(); - _queueEntry.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; + _queueSurfaceDescriptor.Name = _legacyType.string_idx; + _queueSurfaceDescriptor.Image = _legacyType.GetQueueImage(); + _queueSurfaceDescriptor.PreviewImage = _legacyType.GetQueuePreviewImage(); + _queueSurfaceDescriptor.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE; - _pathRailingsEntry.Name = _legacyType.string_idx; - _pathRailingsEntry.BridgeImage = _legacyType.bridge_image; - _pathRailingsEntry.PreviewImage = _legacyType.GetPreviewImage(); - _pathRailingsEntry.Flags = _legacyType.flags; - _pathRailingsEntry.ScrollingMode = _legacyType.scrolling_mode; - _pathRailingsEntry.SupportType = _legacyType.support_type; - _pathRailingsEntry.RailingsImage = _legacyType.GetRailingsImage(); + _pathRailingsDescriptor.Name = _legacyType.string_idx; + _pathRailingsDescriptor.BridgeImage = _legacyType.bridge_image; + _pathRailingsDescriptor.PreviewImage = _legacyType.GetPreviewImage(); + _pathRailingsDescriptor.Flags = _legacyType.flags; + _pathRailingsDescriptor.ScrollingMode = _legacyType.scrolling_mode; + _pathRailingsDescriptor.SupportType = _legacyType.support_type; + _pathRailingsDescriptor.RailingsImage = _legacyType.GetRailingsImage(); } void FootpathObject::Unload() @@ -71,8 +71,8 @@ void FootpathObject::Unload() void FootpathObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const { auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 }; - gfx_draw_sprite(dpi, _pathSurfaceEntry.PreviewImage, screenCoords - ScreenCoordsXY{ 49, 17 }, 0); - gfx_draw_sprite(dpi, _queueEntry.PreviewImage, screenCoords + ScreenCoordsXY{ 4, -17 }, 0); + gfx_draw_sprite(dpi, _pathSurfaceDescriptor.PreviewImage, screenCoords - ScreenCoordsXY{ 49, 17 }, 0); + gfx_draw_sprite(dpi, _queueSurfaceDescriptor.PreviewImage, screenCoords + ScreenCoordsXY{ 4, -17 }, 0); } static RailingEntrySupportType ParseSupportType(const std::string& s) diff --git a/src/openrct2/object/FootpathObject.h b/src/openrct2/object/FootpathObject.h index 52af3a2ae9..5d481cec80 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -16,9 +16,9 @@ class FootpathObject final : public Object { private: rct_footpath_entry _legacyType = {}; - PathSurfaceDescriptor _pathSurfaceEntry = {}; - PathSurfaceDescriptor _queueEntry = {}; - PathRailingsDescriptor _pathRailingsEntry = {}; + PathSurfaceDescriptor _pathSurfaceDescriptor = {}; + PathSurfaceDescriptor _queueSurfaceDescriptor = {}; + PathRailingsDescriptor _pathRailingsDescriptor = {}; public: explicit FootpathObject(const rct_object_entry& entry) @@ -31,19 +31,19 @@ public: return &_legacyType; } - PathSurfaceDescriptor* GetPathSurfaceEntry() + const PathSurfaceDescriptor& GetPathSurfaceDescriptor() const { - return &_pathSurfaceEntry; + return _pathSurfaceDescriptor; } - PathSurfaceDescriptor* GetQueueEntry() + const PathSurfaceDescriptor& GetQueueSurfaceDescriptor() const { - return &_queueEntry; + return _queueSurfaceDescriptor; } - PathRailingsDescriptor* GetPathRailingsEntry() + const PathRailingsDescriptor& GetPathRailingsDescriptor() const { - return &_pathRailingsEntry; + return _pathRailingsDescriptor; } void ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) override; diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index ee16825968..70b742339f 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -24,6 +24,14 @@ void FootpathRailingsObject::Load() BridgeImageId = PreviewImageId + 37; RailingsImageId = PreviewImageId + 1; } + + _descriptor.Name = NameStringId; + _descriptor.BridgeImage = BridgeImageId; + _descriptor.PreviewImage = PreviewImageId; + _descriptor.Flags = Flags; + _descriptor.ScrollingMode = ScrollingMode; + _descriptor.SupportType = SupportType; + _descriptor.RailingsImage = RailingsImageId; } void FootpathRailingsObject::Unload() diff --git a/src/openrct2/object/FootpathRailingsObject.h b/src/openrct2/object/FootpathRailingsObject.h index 2b61ec9255..205ebebd8f 100644 --- a/src/openrct2/object/FootpathRailingsObject.h +++ b/src/openrct2/object/FootpathRailingsObject.h @@ -23,6 +23,7 @@ public: uint8_t Flags{}; uint8_t ScrollingMode{}; colour_t Colour{}; + PathRailingsDescriptor _descriptor = {}; public: explicit FootpathRailingsObject(const rct_object_entry& entry) @@ -36,6 +37,11 @@ public: void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override; + const PathRailingsDescriptor& GetDescriptor() const + { + return _descriptor; + } + private: RailingEntrySupportType ParseSupportType(std::string_view s); }; diff --git a/src/openrct2/object/FootpathSurfaceObject.cpp b/src/openrct2/object/FootpathSurfaceObject.cpp index 66b89b6727..bb20157c11 100644 --- a/src/openrct2/object/FootpathSurfaceObject.cpp +++ b/src/openrct2/object/FootpathSurfaceObject.cpp @@ -24,6 +24,11 @@ void FootpathSurfaceObject::Load() PreviewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); BaseImageId = PreviewImageId + 1; } + + _descriptor.Name = NameStringId; + _descriptor.Image = BaseImageId; + _descriptor.PreviewImage = PreviewImageId; + _descriptor.Flags = Flags; } void FootpathSurfaceObject::Unload() diff --git a/src/openrct2/object/FootpathSurfaceObject.h b/src/openrct2/object/FootpathSurfaceObject.h index 7d5ca8c6d7..fd23e06a81 100644 --- a/src/openrct2/object/FootpathSurfaceObject.h +++ b/src/openrct2/object/FootpathSurfaceObject.h @@ -19,6 +19,7 @@ public: uint32_t PreviewImageId{}; uint32_t BaseImageId{}; uint8_t Flags{}; + PathSurfaceDescriptor _descriptor = {}; public: explicit FootpathSurfaceObject(const rct_object_entry& entry) @@ -33,4 +34,9 @@ public: void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override; void SetRepositoryItem(ObjectRepositoryItem* item) const override; + + const PathSurfaceDescriptor& GetDescriptor() const + { + return _descriptor; + } }; diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 7c73be108b..ed60fe98ef 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -1161,14 +1161,14 @@ bool metal_b_supports_paint_setup( * @param special (ax) * @param height (dx) * @param imageColourFlags (ebp) - * @param railingEntry (0x00F3EF6C) + * @param railingsDescriptor (0x00F3EF6C) * @param[out] underground (Carry Flag) * * @return Whether supports were drawn */ bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsDescriptor* railingEntry, bool* underground) + const PathRailingsDescriptor* railingsDescriptor, bool* underground) { if (underground != nullptr) { @@ -1202,7 +1202,7 @@ bool path_a_supports_paint_setup( { // save dx2 PaintAddImageAsParent( - session, (railingEntry->BridgeImage + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); + session, (railingsDescriptor->BridgeImage + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1216,7 +1216,7 @@ bool path_a_supports_paint_setup( } uint32_t imageId = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingEntry->BridgeImage; + + railingsDescriptor->BridgeImage; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1239,7 +1239,7 @@ bool path_a_supports_paint_setup( } uint32_t ebx = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingEntry->BridgeImage; + + railingsDescriptor->BridgeImage; PaintAddImageAsParent(session, ebx | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1251,7 +1251,7 @@ bool path_a_supports_paint_setup( { if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight) { - uint32_t imageId = (supportType * 24) + railingEntry->BridgeImage + 23; + uint32_t imageId = (supportType * 24) + railingsDescriptor->BridgeImage + 23; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) }); @@ -1261,7 +1261,7 @@ bool path_a_supports_paint_setup( } else { - uint32_t imageId = (supportType * 24) + railingEntry->BridgeImage + 22; + uint32_t imageId = (supportType * 24) + railingsDescriptor->BridgeImage + 22; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) }); @@ -1275,7 +1275,7 @@ bool path_a_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - uint32_t imageId = railingEntry->BridgeImage + 55 + specialIndex; + uint32_t imageId = railingsDescriptor->BridgeImage + 55 + specialIndex; const unk_supports_desc& supportsDesc = byte_98D8D4[specialIndex]; const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; @@ -1314,13 +1314,13 @@ bool path_a_supports_paint_setup( * @param special (ax) * @param height (dx) * @param imageColourFlags (ebp) - * @param railingEntry (0x00F3EF6C) + * @param railingsDescriptor (0x00F3EF6C) * * @return Whether supports were drawn */ bool path_b_supports_paint_setup( paint_session* session, int32_t segment, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsDescriptor* railingEntry) + const PathRailingsDescriptor* railingsDescriptor) { support_height* supportSegments = session->SupportSegments; @@ -1342,7 +1342,7 @@ bool path_b_supports_paint_setup( uint16_t baseHeight; if ((supportSegments[segment].slope & 0x20) || (height - supportSegments[segment].height < 6) - || !(railingEntry->Flags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) + || !(railingsDescriptor->Flags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) { baseHeight = supportSegments[segment].height; } @@ -1352,7 +1352,7 @@ bool path_b_supports_paint_setup( baseHeight = supportSegments[segment].height; PaintAddImageAsParent( - session, (railingEntry->BridgeImage + 37 + imageOffset) | imageColourFlags, + session, (railingsDescriptor->BridgeImage + 37 + imageOffset) | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1371,7 +1371,7 @@ bool path_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (railingEntry->BridgeImage + 20 + (heightDiff - 1)) | imageColourFlags, + session, (railingsDescriptor->BridgeImage + 20 + (heightDiff - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } @@ -1404,7 +1404,7 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, (railingEntry->BridgeImage + 20 + (z - 1)) | imageColourFlags, + session, (railingsDescriptor->BridgeImage + 20 + (z - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; @@ -1415,7 +1415,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->BridgeImage + 20 + (z - 1); + uint32_t imageId = railingsDescriptor->BridgeImage + 20 + (z - 1); if (z == 16) { imageId += 1; @@ -1449,7 +1449,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingEntry->BridgeImage + 20 + (z - 1); + uint32_t imageId = railingsDescriptor->BridgeImage + 20 + (z - 1); PaintAddImageAsParent( session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, 0 }, { SupportBoundBoxes[segment], baseHeight }); diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 3131df3e03..3e8ff8fb57 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -24,10 +24,10 @@ bool metal_b_supports_paint_setup( paint_session* session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, uint32_t imageColourFlags); bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsDescriptor* railingEntry, bool* underground); + const PathRailingsDescriptor* railingsDescriptor, bool* underground); bool path_b_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - PathRailingsDescriptor* railingEntry); + const PathRailingsDescriptor* railingsDescriptor); // There are 13 types of metal supports. A graphic showing all of them is available here: // https://cloud.githubusercontent.com/assets/737603/19420485/7eaba28e-93ec-11e6-83cb-03190accc094.png diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index fb4dbdd63f..7b0ab9c16d 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -245,12 +245,14 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 // Index to which part of the entrance // Middle, left, right uint8_t part_index = tile_element.GetSequenceIndex(); - PathSurfaceDescriptor* path_entry = nullptr; + const PathSurfaceDescriptor* surfaceDescriptor = nullptr; // The left and right of the park entrance often have this set to 127. // So only attempt to get the footpath type if we're dealing with the middle bit of the entrance. if (part_index == 0) - path_entry = get_path_surface_entry(tile_element.GetPathType()); + { + surfaceDescriptor = tile_element.GetPathSurfaceDescriptor(); + } rct_entrance_type* entrance; uint8_t di = ((direction / 2 + part_index / 2) & 1) ? 0x1A : 0x20; @@ -258,9 +260,9 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 switch (part_index) { case 0: - if (path_entry != nullptr) + if (surfaceDescriptor != nullptr) { - image_id = (path_entry->Image + 5 * (1 + (direction & 1))) | ghost_id; + image_id = (surfaceDescriptor->Image + 5 * (1 + (direction & 1))) | ghost_id; PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 0x1C, 0 }, { 0, 2, height }); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 939f66a857..711dc7b32a 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -86,11 +86,11 @@ static constexpr const uint8_t byte_98D8A4[] = { // clang-format on void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceDescriptor* footpathEntry, - PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int32_t height, const PathSurfaceDescriptor* footpathEntry, + const PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceDescriptor* footpathEntry, - PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int16_t height, const PathSurfaceDescriptor* surfaceDescriptor, + const PathRailingsDescriptor* railingsDescriptor, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); /* rct2: 0x006A5AE5 */ static void path_bit_lights_paint( @@ -326,9 +326,9 @@ static void path_bit_jumping_fountains_paint( */ static void sub_6A4101( paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool word_F3F038, - PathRailingsDescriptor* railingEntry, uint32_t imageFlags) + const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags) { - uint32_t base_image_id = railingEntry->RailingsImage | imageFlags; + uint32_t base_image_id = railingsDescriptor->RailingsImage | imageFlags; if (pathElement.IsQueue()) { @@ -447,7 +447,7 @@ static void sub_6A4101( auto ride = get_ride(pathElement.GetRideIndex()); if (direction < 2 && ride != nullptr && imageFlags == 0) { - uint16_t scrollingMode = railingEntry->ScrollingMode; + uint16_t scrollingMode = railingsDescriptor->ScrollingMode; scrollingMode += direction; auto ft = Formatter(); @@ -663,13 +663,13 @@ static void sub_6A4101( * @param pathElement (esp[0]) * @param connectedEdges (bp) (relative to the camera's rotation) * @param height (dx) - * @param railingEntry (0x00F3EF6C) + * @param railingsDescriptor (0x00F3EF6C) * @param imageFlags (0x00F3EF70) * @param sceneryImageFlags (0x00F3EF74) */ static void sub_6A3F61( paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, - PathRailingsDescriptor* railingEntry, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) + const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) { // eax -- // ebx -- @@ -749,7 +749,7 @@ static void sub_6A3F61( // Redundant zoom-level check removed if (paintScenery) - sub_6A4101(session, pathElement, height, connectedEdges, word_F3F038, railingEntry, imageFlags); + sub_6A4101(session, pathElement, height, connectedEdges, word_F3F038, railingsDescriptor, imageFlags); } // This is about tunnel drawing @@ -943,20 +943,22 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE PaintAddImageAsParent(session, imageId, { 16, 16, heightMarkerBaseZ }, { 1, 1, 0 }); } - PathSurfaceDescriptor* footpathEntry = tileElement.GetSurfaceEntry(); - PathRailingsDescriptor* railingEntry = tileElement.GetRailingEntry(); + const PathSurfaceDescriptor* surfaceDescriptor = tileElement.GetSurfaceDescriptor(); + const PathRailingsDescriptor* railingsDescriptor = tileElement.GetRailingsDescriptor(); - if (footpathEntry != nullptr && railingEntry != nullptr) + if (surfaceDescriptor != nullptr && railingsDescriptor != nullptr) { - if (railingEntry->SupportType == RailingEntrySupportType::Pole) + if (railingsDescriptor->SupportType == RailingEntrySupportType::Pole) { path_paint_pole_support( - session, tileElement, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); + session, tileElement, height, surfaceDescriptor, railingsDescriptor, hasSupports, imageFlags, + sceneryImageFlags); } else { path_paint_box_support( - session, tileElement, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); + session, tileElement, height, surfaceDescriptor, railingsDescriptor, hasSupports, imageFlags, + sceneryImageFlags); } } @@ -993,8 +995,8 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, PathSurfaceDescriptor* footpathEntry, - PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int32_t height, const PathSurfaceDescriptor* footpathEntry, + const PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1139,8 +1141,8 @@ void path_paint_box_support( } void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, PathSurfaceDescriptor* footpathEntry, - PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int16_t height, const PathSurfaceDescriptor* surfaceDescriptor, + const PathRailingsDescriptor* railingsDescriptor, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1165,7 +1167,7 @@ void path_paint_pole_support( imageId = byte_98D6E0[edi]; } - imageId += footpathEntry->Image; + imageId += surfaceDescriptor->Image; // Below Surface if (!session->DidPassSurface) @@ -1202,11 +1204,11 @@ void path_paint_pole_support( { bridgeImage = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingEntry->BridgeImage + 16; + + railingsDescriptor->BridgeImage + 16; } else { - bridgeImage = edges + railingEntry->BridgeImage; + bridgeImage = edges + railingsDescriptor->BridgeImage; bridgeImage |= imageFlags; } @@ -1223,7 +1225,8 @@ void path_paint_pole_support( } } - sub_6A3F61(session, pathElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments + sub_6A3F61( + session, pathElement, edi, height, railingsDescriptor, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments uint16_t ax = 0; if (pathElement.IsSloped()) @@ -1242,7 +1245,7 @@ void path_paint_pole_support( { if (!(edges & (1 << i))) { - path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags, railingEntry); + path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags, railingsDescriptor); } } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ac1555b2d6..efcdeb95d3 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1599,36 +1599,13 @@ namespace RCT1 dst2->SetIsBroken(false); dst2->SetIsBlockedByVehicle(false); - dst2->SetSurfaceEntryIndex(entryIndex); + dst2->SetLegacyPathEntryIndex(entryIndex); dst2->SetShouldDrawPathOverSupports(true); if (RCT1::PathIsQueue(pathType)) { dst2->SetIsQueue(true); } - if (_gameVersion != FILE_VERSION_RCT1_LL) - { - dst2->SetRailingEntryIndex(0); - } - else - { - ObjectEntryIndex railingsEntryIndex; - switch (src2->GetRCT1SupportType()) - { - case RCT1_PATH_SUPPORT_TYPE_COATED_WOOD: - railingsEntryIndex = 3; - break; - case RCT1_PATH_SUPPORT_TYPE_SPACE: - railingsEntryIndex = 4; - break; - case RCT1_PATH_SUPPORT_TYPE_BAMBOO: - railingsEntryIndex = 5; - break; - case RCT1_PATH_SUPPORT_TYPE_TRUSS: - default: - railingsEntryIndex = 0; - } - dst2->SetRailingEntryIndex(railingsEntryIndex); - } + // TODO: Set railings type // Additions ObjectEntryIndex additionType = dst2->GetAddition(); @@ -1743,7 +1720,7 @@ namespace RCT1 pathType = RCT1_FOOTPATH_TYPE_TARMAC_GRAY; } auto entryIndex = _pathTypeToEntryMap[pathType]; - dst2->SetPathType(entryIndex & 0x7F); + dst2->SetLegacyPathEntryIndex(entryIndex & 0x7F); } return 1; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 6f3e4b0168..c8394c5fd0 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1798,7 +1798,7 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, const TileElement* src auto dst2 = dst->AsPath(); auto src2 = src->AsPath(); - dst2->SetPathEntryIndex(src2->GetSurfaceEntryIndex()); + dst2->SetPathEntryIndex(src2->GetLegacyPathEntryIndex()); dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection()); dst2->SetSloped(src2->IsSloped()); dst2->SetSlopeDirection(src2->GetSlopeDirection()); @@ -1889,7 +1889,7 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, const TileElement* src dst2->SetRideIndex(OpenRCT2RideIdToRCT12RideId(src2->GetRideIndex())); dst2->SetStationIndex(src2->GetStationIndex()); dst2->SetSequenceIndex(src2->GetSequenceIndex()); - dst2->SetPathType(src2->GetPathType()); + dst2->SetPathType(src2->GetLegacyPathEntryIndex()); break; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 708d6e404e..3a7d792448 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1167,7 +1167,7 @@ public: auto dst2 = dst->AsPath(); auto src2 = src->AsPath(); - dst2->SetSurfaceEntryIndex(src2->GetEntryIndex()); + dst2->SetLegacyPathEntryIndex(src2->GetEntryIndex()); dst2->SetQueueBannerDirection(src2->GetQueueBannerDirection()); dst2->SetSloped(src2->IsSloped()); dst2->SetSlopeDirection(src2->GetSlopeDirection()); @@ -1257,7 +1257,7 @@ public: dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); dst2->SetStationIndex(src2->GetStationIndex()); dst2->SetSequenceIndex(src2->GetSequenceIndex()); - dst2->SetPathType(src2->GetPathType()); + dst2->SetLegacyPathEntryIndex(src2->GetPathType()); break; } diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 58265bbbb9..308a2f6528 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -591,7 +591,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til break; case TILE_ELEMENT_TYPE_PATH: // Bonus for normal path - if (tileElement->AsPath()->GetSurfaceEntryIndex() != 0) + if (tileElement->AsPath()->GetLegacyPathEntryIndex() != 0) { if (tileElement->GetClearanceZ() == inputTileElement->GetBaseZ()) { diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 2deca96b0a..33bf8c9732 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -39,6 +39,7 @@ #include "../localisation/StringIds.h" #include "../management/Finance.h" #include "../network/network.h" +#include "../object/FootpathObject.h" #include "../object/ObjectList.h" #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" @@ -874,15 +875,15 @@ static bool TrackDesignPlaceSceneryElementGetEntry( } entry_index = 0; - for (PathSurfaceDescriptor* path = get_path_surface_entry(0); - entry_index < object_entry_group_counts[EnumValue(ObjectType::Paths)]; - path = get_path_surface_entry(entry_index), entry_index++) + for (; entry_index < object_entry_group_counts[EnumValue(ObjectType::Paths)]; entry_index++) { - if (path == nullptr) + const auto* legacyPathEntry = GetLegacyFootpathEntry(entry_index); + if (legacyPathEntry == nullptr) { return true; } - if (path->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) + const auto& surfaceDescriptor = legacyPathEntry->GetPathSurfaceDescriptor(); + if (surfaceDescriptor.IsEditorOnly()) { return true; } diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index cf3dde9395..a345852212 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -296,7 +296,7 @@ static void track_design_save_add_wall(const CoordsXY& loc, WallElement* wallEle static void track_design_save_add_footpath(const CoordsXY& loc, PathElement* pathElement) { - int32_t entryType = pathElement->GetSurfaceEntryIndex(); + int32_t entryType = pathElement->GetLegacyPathEntryIndex(); auto entry = object_entry_get_object(ObjectType::Paths, entryType); uint8_t flags = 0; @@ -473,7 +473,7 @@ static void track_design_save_remove_wall(const CoordsXY& loc, WallElement* wall static void track_design_save_remove_footpath(const CoordsXY& loc, PathElement* pathElement) { - int32_t entryType = pathElement->GetSurfaceEntryIndex(); + int32_t entryType = pathElement->GetLegacyPathEntryIndex(); auto entry = object_entry_get_object(ObjectType::Paths, entryType); uint8_t flags = 0; diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 40251c55a4..1cc7aadbfb 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -713,7 +713,7 @@ namespace OpenRCT2::Scripting case TILE_ELEMENT_TYPE_PATH: { auto el = _element->AsPath(); - duk_push_int(ctx, el->GetSurfaceEntryIndex()); + duk_push_int(ctx, el->GetLegacyPathEntryIndex()); break; } case TILE_ELEMENT_TYPE_SMALL_SCENERY: @@ -756,7 +756,7 @@ namespace OpenRCT2::Scripting case TILE_ELEMENT_TYPE_PATH: { auto el = _element->AsPath(); - el->SetSurfaceEntryIndex(value & 0xFF); + el->SetLegacyPathEntryIndex(value & 0xFF); Invalidate(); break; } @@ -1397,7 +1397,7 @@ namespace OpenRCT2::Scripting auto ctx = GetContext()->GetScriptEngine().GetContext(); auto el = _element->AsEntrance(); if (el != nullptr) - duk_push_int(ctx, el->GetPathType()); + duk_push_int(ctx, el->GetLegacyPathEntryIndex()); else duk_push_null(ctx); return DukValue::take_from_stack(ctx); @@ -1408,7 +1408,7 @@ namespace OpenRCT2::Scripting auto el = _element->AsEntrance(); if (el != nullptr) { - el->SetPathType(value); + el->SetLegacyPathEntryIndex(value); Invalidate(); } } diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 73b3e17c08..00131be3ec 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -18,6 +18,7 @@ #include "../localisation/StringIds.h" #include "../management/Finance.h" #include "../network/network.h" +#include "../object/FootpathObject.h" #include "../ride/Station.h" #include "../ride/Track.h" #include "Footpath.h" @@ -254,12 +255,21 @@ void EntranceElement::SetSequenceIndex(uint8_t newSequenceIndex) SequenceIndex |= (newSequenceIndex & 0xF); } -PathSurfaceIndex EntranceElement::GetPathType() const +ObjectEntryIndex EntranceElement::GetLegacyPathEntryIndex() const { return PathType; } -void EntranceElement::SetPathType(PathSurfaceIndex newPathType) +void EntranceElement::SetLegacyPathEntryIndex(ObjectEntryIndex newPathType) { PathType = newPathType; } + +const PathSurfaceDescriptor* EntranceElement::GetPathSurfaceDescriptor() const +{ + const auto* legacyPathEntry = GetLegacyFootpathEntry(PathType); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathSurfaceDescriptor(); +} diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 398dc4f8a0..fe59e4e6d1 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1642,39 +1642,42 @@ void PathElement::SetAdditionIsGhost(bool isGhost) Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; } -PathSurfaceIndex PathElement::GetSurfaceEntryIndex() const +ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const { return SurfaceIndex; } -PathRailingsIndex PathElement::GetRailingEntryIndex() const +const FootpathObject* PathElement::GetLegacyPathEntry() const { - return GetSurfaceEntryIndex(); + return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); } -PathSurfaceDescriptor* PathElement::GetSurfaceEntry() const +const PathSurfaceDescriptor* PathElement::GetSurfaceDescriptor() const { - if (!IsQueue()) - return get_path_surface_entry(GetSurfaceEntryIndex()); - else - return get_path_surface_entry(GetSurfaceEntryIndex() + MAX_PATH_OBJECTS); + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + if (IsQueue()) + return &legacyPathEntry->GetQueueSurfaceDescriptor(); + + return &legacyPathEntry->GetPathSurfaceDescriptor(); } -PathRailingsDescriptor* PathElement::GetRailingEntry() const +const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const { - return get_path_railings_entry(GetRailingEntryIndex()); + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathRailingsDescriptor(); } -void PathElement::SetSurfaceEntryIndex(PathSurfaceIndex newIndex) +void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) { SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; } -void PathElement::SetRailingEntryIndex(PathRailingsIndex newEntryIndex) -{ - log_verbose("Setting railing entry index to %d", newEntryIndex); -} - uint8_t PathElement::GetQueueBannerDirection() const { return ((type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6); @@ -1688,7 +1691,7 @@ void PathElement::SetQueueBannerDirection(uint8_t direction) bool PathElement::ShouldDrawPathOverSupports() const { - return (GetRailingEntry()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); + return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); } void PathElement::SetShouldDrawPathOverSupports(bool on) @@ -2247,32 +2250,15 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem tileElement->AsPath()->SetEdgesAndCorners(0); } -PathSurfaceDescriptor* get_path_surface_entry(PathSurfaceIndex entryIndex) +const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex) { - PathSurfaceDescriptor* result = nullptr; - auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); - // TODO: Change when moving to the new save format. - auto obj = objMgr.GetLoadedObject(ObjectType::Paths, entryIndex % MAX_PATH_OBJECTS); - if (obj != nullptr) - { - if (entryIndex < MAX_PATH_OBJECTS) - result = (static_cast(obj))->GetPathSurfaceEntry(); - else - result = (static_cast(obj))->GetQueueEntry(); - } - return result; -} - -PathRailingsDescriptor* get_path_railings_entry(PathRailingsIndex entryIndex) -{ - PathRailingsDescriptor* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); auto obj = objMgr.GetLoadedObject(ObjectType::Paths, entryIndex); - if (obj != nullptr) - { - result = (static_cast(obj))->GetPathRailingsEntry(); - } - return result; + if (obj == nullptr) + return nullptr; + + const FootpathObject* footpathObject = (static_cast(obj)); + return footpathObject; } ride_id_t PathElement::GetRideIndex() const diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 3c6ec98ace..1dc6e10f2a 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -27,11 +27,7 @@ constexpr auto PATH_CLEARANCE = 4 * COORDS_Z_STEP; #define FOOTPATH_ELEMENT_INSERT_QUEUE 0x80 -using PathSurfaceIndex = uint16_t; -constexpr PathSurfaceIndex PATH_SURFACE_INDEX_NULL = static_cast(-1); - -using PathRailingsIndex = uint8_t; -constexpr PathRailingsIndex PATH_RAILINGS_INDEX_NULL = static_cast(-1); +class FootpathObject; enum class RailingEntrySupportType : uint8_t { @@ -40,6 +36,13 @@ enum class RailingEntrySupportType : uint8_t Count }; +enum +{ + FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2), + FOOTPATH_ENTRY_FLAG_IS_QUEUE = (1 << 3), + FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS = (1 << 4), +}; + #pragma pack(push, 1) struct rct_footpath_entry { @@ -60,6 +63,12 @@ struct rct_footpath_entry } constexpr uint32_t GetQueuePreviewImage() const { + // Editor-only paths usually lack queue images. In this case, use the main path image. + if (flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) + { + return GetPreviewImage(); + } + return image + 72; } constexpr uint32_t GetRailingsImage() const @@ -76,6 +85,11 @@ struct PathSurfaceDescriptor uint32_t Image; uint32_t PreviewImage; uint8_t Flags; + + inline constexpr bool IsEditorOnly() const + { + return Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR; + } }; struct PathRailingsDescriptor @@ -130,13 +144,6 @@ enum FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN = (1 << 4), }; -enum -{ - FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2), - FOOTPATH_ENTRY_FLAG_IS_QUEUE = (1 << 3), - FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS = (1 << 4), -}; - enum { RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE = (1 << 0), @@ -215,8 +222,7 @@ bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); int32_t footpath_is_connected_to_map_edge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags); void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement); -PathSurfaceDescriptor* get_path_surface_entry(PathSurfaceIndex entryIndex); -PathRailingsDescriptor* get_path_railings_entry(PathRailingsIndex entryIndex); +const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex); void footpath_queue_chain_reset(); void footpath_queue_chain_push(ride_id_t rideIndex); diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 008b21be4a..b683684571 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -260,10 +260,10 @@ struct PathElement : TileElementBase static constexpr TileElementType ElementType = TileElementType::Path; private: - PathSurfaceIndex SurfaceIndex; // 5 + ObjectEntryIndex SurfaceIndex; // 5 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" - PathRailingsIndex RailingsIndex; // 7 + uint8_t RailingsIndex; // 7 #pragma clang diagnostic pop uint8_t Additions; // 8 (0 means no addition) uint8_t EdgesAndCorners; // 9 (edges in lower 4 bits, corners in upper 4) @@ -281,13 +281,12 @@ private: #pragma clang diagnostic pop public: - PathSurfaceIndex GetSurfaceEntryIndex() const; - PathSurfaceDescriptor* GetSurfaceEntry() const; - void SetSurfaceEntryIndex(PathSurfaceIndex newIndex); + ObjectEntryIndex GetLegacyPathEntryIndex() const; + const FootpathObject* GetLegacyPathEntry() const; + void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex); - PathRailingsIndex GetRailingEntryIndex() const; - PathRailingsDescriptor* GetRailingEntry() const; - void SetRailingEntryIndex(PathRailingsIndex newIndex); + const PathSurfaceDescriptor* GetSurfaceDescriptor() const; + const PathRailingsDescriptor* GetRailingsDescriptor() const; uint8_t GetQueueBannerDirection() const; void SetQueueBannerDirection(uint8_t direction); @@ -569,7 +568,7 @@ private: uint8_t entranceType; // 5 uint8_t SequenceIndex; // 6. Only uses the lower nibble. uint8_t StationIndex; // 7 - PathSurfaceIndex PathType; // 8 + ObjectEntryIndex PathType; // 8 ride_id_t rideIndex; // 9 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" @@ -589,8 +588,10 @@ public: uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); - PathSurfaceIndex GetPathType() const; - void SetPathType(PathSurfaceIndex newPathType); + ObjectEntryIndex GetLegacyPathEntryIndex() const; + void SetLegacyPathEntryIndex(ObjectEntryIndex newPathType); + + const PathSurfaceDescriptor* GetPathSurfaceDescriptor() const; int32_t GetDirections() const; }; From 2d34fe3972586d3295bf673a44d28e598c3b099b Mon Sep 17 00:00:00 2001 From: zrowny Date: Thu, 13 May 2021 18:08:21 -0400 Subject: [PATCH 319/681] Update description of palette colors in ImageImporter --- src/openrct2/drawing/ImageImporter.h | 52 ++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index e121414259..0e5507e33e 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -65,10 +65,10 @@ namespace OpenRCT2::Drawing } // namespace OpenRCT2::Drawing constexpr const GamePalette StandardPalette = { { - // 0 (unused) + // 0 (Unused/Transparent) { 0, 0, 0, 255 }, - // 1 - 9 (misc. e.g. font and water) + // 1 - 9 (Misc. e.g. font, water, chain lift) { 1, 1, 1, 255 }, { 2, 2, 2, 255 }, { 3, 3, 3, 255 }, @@ -79,7 +79,7 @@ constexpr const GamePalette StandardPalette = { { { 8, 8, 8, 255 }, { 9, 9, 9, 255 }, - // + // 10 - 21 (Grey) { 35, 35, 23, 255 }, { 51, 51, 35, 255 }, { 67, 67, 47, 255 }, @@ -92,6 +92,8 @@ constexpr const GamePalette StandardPalette = { { { 195, 195, 183, 255 }, { 219, 219, 211, 255 }, { 243, 243, 239, 255 }, + + // 22 - 33 (Olive) { 0, 47, 51, 255 }, { 0, 59, 63, 255 }, { 11, 75, 79, 255 }, @@ -104,6 +106,8 @@ constexpr const GamePalette StandardPalette = { { { 115, 191, 187, 255 }, { 139, 207, 203, 255 }, { 163, 227, 223, 255 }, + + // 34 - 45 (Light Brown) { 7, 43, 67, 255 }, { 11, 59, 87, 255 }, { 23, 75, 111, 255 }, @@ -116,6 +120,8 @@ constexpr const GamePalette StandardPalette = { { { 135, 199, 219, 255 }, { 163, 219, 231, 255 }, { 195, 239, 247, 255 }, + + // 46 - 57 (Yellow, also used for tertiary remap) { 0, 27, 71, 255 }, { 0, 43, 95, 255 }, { 0, 63, 119, 255 }, @@ -128,6 +134,8 @@ constexpr const GamePalette StandardPalette = { { { 95, 243, 255, 255 }, { 143, 251, 255, 255 }, { 195, 255, 255, 255 }, + + // 58 - 69 (Indian Red) { 0, 0, 35, 255 }, { 0, 0, 79, 255 }, { 7, 7, 95, 255 }, @@ -140,6 +148,8 @@ constexpr const GamePalette StandardPalette = { { { 127, 127, 215, 255 }, { 159, 159, 235, 255 }, { 191, 191, 255, 255 }, + + // 70 - 81 (Grass Green) { 19, 51, 27, 255 }, { 23, 63, 35, 255 }, { 31, 79, 47, 255 }, @@ -152,6 +162,8 @@ constexpr const GamePalette StandardPalette = { { { 83, 187, 147, 255 }, { 95, 203, 163, 255 }, { 103, 219, 183, 255 }, + + // 82 - 93 (Olive Green) { 27, 55, 31, 255 }, { 35, 71, 47, 255 }, { 43, 83, 59, 255 }, @@ -164,6 +176,8 @@ constexpr const GamePalette StandardPalette = { { { 147, 219, 195, 255 }, { 167, 231, 207, 255 }, { 191, 247, 223, 255 }, + + // 94 - 105 (Green) { 0, 63, 15, 255 }, { 0, 83, 19, 255 }, { 0, 103, 23, 255 }, @@ -176,6 +190,8 @@ constexpr const GamePalette StandardPalette = { { { 115, 223, 139, 255 }, { 143, 239, 163, 255 }, { 179, 255, 195, 255 }, + + // 106 - 117 (Tan) { 19, 43, 79, 255 }, { 27, 55, 99, 255 }, { 43, 71, 119, 255 }, @@ -188,6 +204,8 @@ constexpr const GamePalette StandardPalette = { { { 151, 191, 239, 255 }, { 171, 207, 247, 255 }, { 195, 227, 255, 255 }, + + // 118 - 129 (Indigo) { 55, 19, 15, 255 }, { 87, 43, 39, 255 }, { 103, 55, 51, 255 }, @@ -200,6 +218,8 @@ constexpr const GamePalette StandardPalette = { { { 223, 183, 183, 255 }, { 239, 211, 211, 255 }, { 255, 239, 239, 255 }, + + // 130 - 141 (Blue) { 111, 27, 0, 255 }, { 151, 39, 0, 255 }, { 167, 51, 7, 255 }, @@ -212,6 +232,8 @@ constexpr const GamePalette StandardPalette = { { { 243, 211, 143, 255 }, { 251, 231, 175, 255 }, { 255, 247, 215, 255 }, + + // 142 - 153 (Sea Green) { 15, 43, 11, 255 }, { 23, 55, 15, 255 }, { 31, 71, 23, 255 }, @@ -224,6 +246,8 @@ constexpr const GamePalette StandardPalette = { { { 167, 199, 147, 255 }, { 195, 219, 175, 255 }, { 223, 243, 207, 255 }, + + // 154 - 165 (Purple) { 95, 0, 63, 255 }, { 115, 7, 75, 255 }, { 127, 15, 83, 255 }, @@ -236,6 +260,8 @@ constexpr const GamePalette StandardPalette = { { { 231, 155, 191, 255 }, { 243, 195, 215, 255 }, { 255, 235, 243, 255 }, + + // 166 - 177 (Red) { 0, 0, 63, 255 }, { 0, 0, 87, 255 }, { 0, 0, 115, 255 }, @@ -248,6 +274,8 @@ constexpr const GamePalette StandardPalette = { { { 115, 123, 255, 255 }, { 163, 171, 255, 255 }, { 215, 219, 255, 255 }, + + // 178 - 189 (Orange) { 0, 39, 79, 255 }, { 0, 51, 111, 255 }, { 0, 63, 147, 255 }, @@ -260,6 +288,8 @@ constexpr const GamePalette StandardPalette = { { { 107, 183, 255, 255 }, { 135, 203, 255, 255 }, { 163, 219, 255, 255 }, + + // 190 - 201 (Water Blue) { 47, 51, 0, 255 }, { 55, 63, 0, 255 }, { 67, 75, 0, 255 }, @@ -273,7 +303,7 @@ constexpr const GamePalette StandardPalette = { { { 231, 231, 171, 255 }, { 255, 255, 207, 255 }, - // 202 - 213 (Secondary remap) + // 202 - 213 (Pink, also used for secondary remap) { 27, 0, 63, 255 }, { 51, 0, 103, 255 }, { 63, 11, 123, 255 }, @@ -301,27 +331,29 @@ constexpr const GamePalette StandardPalette = { { { 195, 219, 231, 255 }, { 223, 243, 255, 255 }, - // 226 (unknown) + // 226 (Extra grey) { 75, 75, 55, 255 }, - // 227 - 229 (tertiary remap) + // 227 - 229 (Extra yellows) { 0, 183, 255, 255 }, { 0, 219, 255, 255 }, { 0, 255, 255, 255 }, - // 230 - 239 (water) + // 230 - 234 (Water waves) { 99, 107, 7, 255 }, { 99, 107, 7, 255 }, { 135, 143, 39, 255 }, { 123, 131, 27, 255 }, { 99, 107, 7, 255 }, + + // 235 - 249 (Water sparkles) { 151, 155, 55, 255 }, { 151, 155, 55, 255 }, { 227, 227, 155, 255 }, { 203, 203, 115, 255 }, { 151, 155, 55, 255 }, - // 240 - 242 (chain lift) + // 240 - 242 (Exra grey) { 91, 91, 67, 255 }, { 107, 107, 83, 255 }, { 123, 123, 99, 255 }, @@ -331,7 +363,7 @@ constexpr const GamePalette StandardPalette = { { // { 47, 47, 47, 255 }, // { 47, 71, 87, 255 }, - // 243 to 254 (primary remap) + // 243 to 254 (Primary remap) { 47, 51, 111, 255 }, { 47, 55, 131, 255 }, { 51, 63, 151, 255 }, @@ -345,6 +377,6 @@ constexpr const GamePalette StandardPalette = { { { 63, 183, 255, 255 }, { 75, 207, 255, 255 }, - // 255 (unused?) + // 255 (Used in a small number of cases for pure white) { 0, 0, 0, 255 }, } }; From c4aaae1a07bb2106f4fc23748aef9b520b309577 Mon Sep 17 00:00:00 2001 From: zrowny Date: Thu, 13 May 2021 18:21:44 -0400 Subject: [PATCH 320/681] Correct ImageImporter palette index 255 to white Reflects the change that was made in 5035492f8cf93a03eac799a92f8cb30df2bb3ed9 to the renderer to fix #1749 and #6535 --- src/openrct2/drawing/ImageImporter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index 0e5507e33e..def6288f39 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -378,5 +378,5 @@ constexpr const GamePalette StandardPalette = { { { 75, 207, 255, 255 }, // 255 (Used in a small number of cases for pure white) - { 0, 0, 0, 255 }, + { 255, 255, 255, 255 }, } }; From c381a97d66e251accc6f335e41feeccda9f71a65 Mon Sep 17 00:00:00 2001 From: zrowny Date: Thu, 13 May 2021 20:54:06 -0400 Subject: [PATCH 321/681] Fix ImageImporter for colors outside of palette (#14649:) When converting to the internal palette, if a color is not in the palette, the ImageImporter now re-maps it only to those non "special" color indices ("special," meaning those for water effects, font, chain lift and so on, as well as the primary remappable color). Additionally, if the Importer is told to dither the image, it now does not dither colors that are already in the OpenRCT2 palette, or dither between remappable colors and non-remappable colors. --- src/openrct2/drawing/ImageImporter.cpp | 73 ++++++++++++++++---------- src/openrct2/drawing/ImageImporter.h | 15 +++++- 2 files changed, 58 insertions(+), 30 deletions(-) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index fe7b313872..c447a0c3fc 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -217,24 +217,22 @@ int32_t ImageImporter::CalculatePaletteIndex( { auto& palette = StandardPalette; auto paletteIndex = GetPaletteIndex(palette, rgbaSrc); - if (mode == IMPORT_MODE::CLOSEST || mode == IMPORT_MODE::DITHERING) + if ((mode == IMPORT_MODE::CLOSEST || mode == IMPORT_MODE::DITHERING) && !IsInPalette(palette, rgbaSrc)) { - if (paletteIndex == PALETTE_TRANSPARENT && !IsTransparentPixel(rgbaSrc)) - { - paletteIndex = GetClosestPaletteIndex(palette, rgbaSrc); - } - } - if (mode == IMPORT_MODE::DITHERING) - { - if (!IsTransparentPixel(rgbaSrc) && IsChangablePixel(GetPaletteIndex(palette, rgbaSrc))) + paletteIndex = GetClosestPaletteIndex(palette, rgbaSrc); + if (mode == IMPORT_MODE::DITHERING) { 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 colors with nonremappable colors, etc + PaletteIndexType thisIndexType = GetPaletteIndexType(paletteIndex); + if (x + 1 < width) { - if (!IsTransparentPixel(rgbaSrc + 4) && IsChangablePixel(GetPaletteIndex(palette, rgbaSrc + 4))) + if (!IsInPalette(palette, rgbaSrc + 4) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4))) { // Right rgbaSrc[4] += dr * 7 / 16; @@ -247,8 +245,8 @@ int32_t ImageImporter::CalculatePaletteIndex( { if (x > 0) { - if (!IsTransparentPixel(rgbaSrc + 4 * (width - 1)) - && IsChangablePixel(GetPaletteIndex(palette, rgbaSrc + 4 * (width - 1)))) + if (!IsInPalette(palette, rgbaSrc + 4 * (width - 1)) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width - 1)))) { // Bottom left rgbaSrc[4 * (width - 1)] += dr * 3 / 16; @@ -258,7 +256,8 @@ int32_t ImageImporter::CalculatePaletteIndex( } // Bottom - if (!IsTransparentPixel(rgbaSrc + 4 * width) && IsChangablePixel(GetPaletteIndex(palette, rgbaSrc + 4 * width))) + 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; @@ -267,8 +266,8 @@ int32_t ImageImporter::CalculatePaletteIndex( if (x + 1 < width) { - if (!IsTransparentPixel(rgbaSrc + 4 * (width + 1)) - && IsChangablePixel(GetPaletteIndex(palette, rgbaSrc + 4 * (width + 1)))) + if (!IsInPalette(palette, rgbaSrc + 4 * (width + 1)) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width + 1)))) { // Bottom right rgbaSrc[4 * (width + 1)] += dr * 1 / 16; @@ -279,6 +278,7 @@ int32_t ImageImporter::CalculatePaletteIndex( } } } + return paletteIndex; } @@ -304,23 +304,40 @@ bool ImageImporter::IsTransparentPixel(const int16_t* colour) } /** - * @returns true if pixel index is an index not used for remapping. + * @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) { - if (paletteIndex == PALETTE_TRANSPARENT) - return true; - if (paletteIndex == 0) - return false; + 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 false; - if (paletteIndex == 226) - return false; - if (paletteIndex >= 227 && paletteIndex <= 229) - return false; - if (paletteIndex >= 243) - return false; - return true; + 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) diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index def6288f39..70e61b046f 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -50,6 +50,15 @@ namespace OpenRCT2::Drawing IMPORT_MODE mode = IMPORT_MODE::DEFAULT) const; private: + enum class PaletteIndexType : uint8_t + { + Normal, + PrimaryRemap, + SecondaryRemap, + TertiaryRemap, + Special, + }; + static std::vector GetPixels( const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode); static std::vector EncodeRaw(const int32_t* pixels, uint32_t width, uint32_t height); @@ -59,7 +68,9 @@ namespace OpenRCT2::Drawing IMPORT_MODE mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height); static int32_t GetPaletteIndex(const GamePalette& palette, int16_t* colour); static bool IsTransparentPixel(const int16_t* colour); + static bool IsInPalette(const GamePalette& palette, int16_t* colour); static bool IsChangablePixel(int32_t paletteIndex); + static PaletteIndexType GetPaletteIndexType(int32_t paletteIndex); static int32_t GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour); }; } // namespace OpenRCT2::Drawing @@ -176,7 +187,7 @@ constexpr const GamePalette StandardPalette = { { { 147, 219, 195, 255 }, { 167, 231, 207, 255 }, { 191, 247, 223, 255 }, - + // 94 - 105 (Green) { 0, 63, 15, 255 }, { 0, 83, 19, 255 }, @@ -353,7 +364,7 @@ constexpr const GamePalette StandardPalette = { { { 203, 203, 115, 255 }, { 151, 155, 55, 255 }, - // 240 - 242 (Exra grey) + // 240 - 242 (Extra grey) { 91, 91, 67, 255 }, { 107, 107, 83, 255 }, { 123, 123, 99, 255 }, From fa0efd67c14f228055401f4c319f1257d2979b91 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 5 Sep 2021 20:38:33 +0200 Subject: [PATCH 322/681] Update changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index a800039df6..13c0ca1a18 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Feature: [#15294] New vehicle animation type: flying animal. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. +- Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. From e26c4bdd4e0b0d2447f69d2000935dd623014f62 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 5 Sep 2021 20:40:01 +0200 Subject: [PATCH 323/681] Fix US spelling --- src/openrct2/drawing/ImageImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index c447a0c3fc..3f578faf49 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -226,7 +226,7 @@ int32_t ImageImporter::CalculatePaletteIndex( 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 colors with nonremappable colors, etc + // We don't want to dither remappable colours with nonremappable colours, etc PaletteIndexType thisIndexType = GetPaletteIndexType(paletteIndex); if (x + 1 < width) From 6f2e20f8dbc301dffead9c64c446ed3ca479a2ff Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 5 Sep 2021 21:03:55 +0200 Subject: [PATCH 324/681] Add #13912 to changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 13c0ca1a18..d93174905a 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -9,6 +9,7 @@ - Feature: [#15195] Added a bug-report item in file dropdown menu. - Feature: [#15294] New vehicle animation type: flying animal. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. +- Fix: [#13912] “Dome park” no longer renders dome correctly. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). From 613c309f931b84125b1ce7a6ba29856cecdd2c71 Mon Sep 17 00:00:00 2001 From: Daniel Karandikar Date: Sun, 5 Sep 2021 20:57:08 +0100 Subject: [PATCH 325/681] Close #13407 Allow building covered lift hill when cheat enabled --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 7 +++---- src/openrct2/windows/_legacy.cpp | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d93174905a..4389b0eb51 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ - Feature: [#3868] Initial support for using TTF in OpenGL mode (still contains bugs). +- Feature: [#13407] Allow building chain lifts on enclosed dinghy slide pieces when cheats are on. - Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 31b780672b..b1ed717898 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1518,10 +1518,8 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi case WIDX_CHAIN_LIFT: ride_construction_invalidate_current_track(); _currentTrackLiftHill ^= CONSTRUCTION_LIFT_HILL_SELECTED; - if (_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) - { + if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !gCheatsEnableChainLiftOnAllTrack) _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - } _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; @@ -1599,7 +1597,8 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi case WIDX_O_TRACK: ride_construction_invalidate_current_track(); _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + if (!gCheatsEnableChainLiftOnAllTrack) + _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 2fb047ac62..12a005b4c5 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -311,7 +311,8 @@ bool window_ride_construction_update_state( if (alternativeType != TrackElemType::None && (availablePieces & (1ULL << trackType))) { trackType = alternativeType; - liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + if (!gCheatsEnableChainLiftOnAllTrack) + liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; } } From fc189f8c7d064f601b32a7434dd74cdeb6ac101a Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Mon, 6 Sep 2021 04:08:02 +0000 Subject: [PATCH 326/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ko-KR.txt | 4 ++-- data/language/nl-NL.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 2e57f042b9..06f8c104de 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -3963,8 +3963,8 @@ STR_DTLS :파라다이스 부두는 바다 위의 산책로를 확장했습 STR_SCNR :Dragon’s Cove -STR_PARK :용의 동굴 -STR_DTLS :이번 롤러코스터 건설 도전에서는 해안 동굴이 무대가 됩니다. +STR_PARK :용의 만 +STR_DTLS :이번 롤러코스터 건설 도전에서는 바닷가 근처의 만이 무대가 됩니다. STR_SCNR :Good Knight Park diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 9faa62b71a..1b022c114a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -809,7 +809,7 @@ STR_1423 :Wachtrijpad STR_1424 :Voetpad STR_1425 :Voetpad STR_1426 :Wachtrij -STR_1427 :{WINDOW_COLOUR_2}Passagiers: {BLACK}{COMMA32} per uur +STR_1427 :{WINDOW_COLOUR_2}Bezoekers: {BLACK}{COMMA32} per uur STR_1428 :{WINDOW_COLOUR_2}Toegangsprijs: STR_1429 :{POP16}{POP16}{POP16}{CURRENCY2DP} STR_1430 :Gratis @@ -2969,9 +2969,9 @@ STR_5731 :Lineair STR_5734 :Rendering STR_5735 :Netwerkstatus STR_5736 :Speler -STR_5737 :Gesloten, nog {COMMA16} passagier -STR_5738 :Gesloten, nog {COMMA16} passagiers -STR_5739 :{WINDOW_COLOUR_2}Huidig aantal passagiers: {BLACK}{COMMA16} +STR_5737 :Gesloten, nog {COMMA16} bezoeker +STR_5738 :Gesloten, nog {COMMA16} bezoekers +STR_5739 :{WINDOW_COLOUR_2}Huidig aantal bezoekers: {BLACK}{COMMA16} STR_5740 :Oneindige marketingcampagnes STR_5741 :Marketingcampagnes verlopen nooit STR_5742 :Authenticeren… From 4e46fa4f6d2143807fbd3d64a9d03d76135753f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 04:35:20 -0700 Subject: [PATCH 327/681] Enable parallel builds for debug configuration (#15324) --- openrct2.common.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openrct2.common.props b/openrct2.common.props index 49e0395b7c..fb2f6a188f 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -74,6 +74,7 @@ MultiThreadedDebug MultiThreadedDebugDLL false + true DebugFull @@ -90,6 +91,7 @@ false NDEBUG;%(PreprocessorDefinitions) Speed + true DebugFull From a9e0eeccc4967d8d17700c4edd12306da34f02d9 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 6 Sep 2021 21:59:17 +0200 Subject: [PATCH 328/681] Add support for surface and railings objects to PathElement Co-authored-by: IntelOrca --- src/openrct2/world/Entrance.cpp | 55 +++++++++++++++++-- src/openrct2/world/Entrance.h | 5 ++ src/openrct2/world/Footpath.cpp | 93 +++++++++++++++++++++++++++----- src/openrct2/world/Footpath.h | 1 + src/openrct2/world/TileElement.h | 49 ++++++++++------- 5 files changed, 169 insertions(+), 34 deletions(-) diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 00131be3ec..6710bead7b 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -10,6 +10,7 @@ #include "Entrance.h" #include "../Cheats.h" +#include "../Context.h" #include "../Game.h" #include "../OpenRCT2.h" #include "../actions/ParkEntranceRemoveAction.h" @@ -19,6 +20,8 @@ #include "../management/Finance.h" #include "../network/network.h" #include "../object/FootpathObject.h" +#include "../object/FootpathSurfaceObject.h" +#include "../object/ObjectManager.h" #include "../ride/Station.h" #include "../ride/Track.h" #include "Footpath.h" @@ -255,21 +258,65 @@ void EntranceElement::SetSequenceIndex(uint8_t newSequenceIndex) SequenceIndex |= (newSequenceIndex & 0xF); } +bool EntranceElement::HasLegacyPathEntry() const +{ + return (flags2 & ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0; +} + ObjectEntryIndex EntranceElement::GetLegacyPathEntryIndex() const { - return PathType; + if (HasLegacyPathEntry()) + return PathType; + else + return OBJECT_ENTRY_INDEX_NULL; +} + +const FootpathObject* EntranceElement::GetLegacyPathEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::Paths, GetLegacyPathEntryIndex())); } void EntranceElement::SetLegacyPathEntryIndex(ObjectEntryIndex newPathType) { PathType = newPathType; + flags2 |= ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +ObjectEntryIndex EntranceElement::GetSurfaceEntryIndex() const +{ + if (HasLegacyPathEntry()) + return OBJECT_ENTRY_INDEX_NULL; + else + return PathType; +} + +const FootpathSurfaceObject* EntranceElement::GetSurfaceEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathSurface, GetSurfaceEntryIndex())); +} + +void EntranceElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex) +{ + PathType = newIndex; + flags2 &= ~ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } const PathSurfaceDescriptor* EntranceElement::GetPathSurfaceDescriptor() const { - const auto* legacyPathEntry = GetLegacyFootpathEntry(PathType); - if (legacyPathEntry == nullptr) + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathSurfaceDescriptor(); + } + + const auto* surfaceEntry = GetSurfaceEntry(); + if (surfaceEntry == nullptr) return nullptr; - return &legacyPathEntry->GetPathSurfaceDescriptor(); + return &surfaceEntry->GetDescriptor(); } diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index 8d3b20eade..cd89adbe4b 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -28,6 +28,11 @@ assert_struct_size(rct_entrance_type, 8); struct TileElement; +enum +{ + ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 0), +}; + constexpr const uint8_t ParkEntranceHeight = 12 * COORDS_Z_STEP; constexpr const uint8_t RideEntranceHeight = 7 * COORDS_Z_STEP; constexpr const uint8_t RideExitHeight = 5 * COORDS_Z_STEP; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index fe59e4e6d1..1860e0e30f 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -20,6 +20,8 @@ #include "../management/Finance.h" #include "../network/network.h" #include "../object/FootpathObject.h" +#include "../object/FootpathRailingsObject.h" +#include "../object/FootpathSurfaceObject.h" #include "../object/ObjectList.h" #include "../object/ObjectManager.h" #include "../paint/VirtualFloor.h" @@ -1644,7 +1646,10 @@ void PathElement::SetAdditionIsGhost(bool isGhost) ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const { - return SurfaceIndex; + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return SurfaceIndex; + else + return OBJECT_ENTRY_INDEX_NULL; } const FootpathObject* PathElement::GetLegacyPathEntry() const @@ -1652,30 +1657,94 @@ const FootpathObject* PathElement::GetLegacyPathEntry() const return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); } +void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) +{ + SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +bool PathElement::HasLegacyPathEntry() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0; +} + const PathSurfaceDescriptor* PathElement::GetSurfaceDescriptor() const { - const auto* legacyPathEntry = GetLegacyPathEntry(); - if (legacyPathEntry == nullptr) + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + if (IsQueue()) + return &legacyPathEntry->GetQueueSurfaceDescriptor(); + + return &legacyPathEntry->GetPathSurfaceDescriptor(); + } + + const auto* surfaceEntry = GetSurfaceEntry(); + if (surfaceEntry == nullptr) return nullptr; - if (IsQueue()) - return &legacyPathEntry->GetQueueSurfaceDescriptor(); - - return &legacyPathEntry->GetPathSurfaceDescriptor(); + return &surfaceEntry->GetDescriptor(); } const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const { - const auto* legacyPathEntry = GetLegacyPathEntry(); - if (legacyPathEntry == nullptr) + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathRailingsDescriptor(); + } + + const auto* railingsEntry = GetRailingsEntry(); + if (railingsEntry == nullptr) return nullptr; - return &legacyPathEntry->GetPathRailingsDescriptor(); + return &railingsEntry->GetDescriptor(); } -void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) +ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const { - SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + else + return SurfaceIndex; +} + +const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathSurface, GetSurfaceEntryIndex())); +} + +void PathElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex) +{ + SurfaceIndex = newIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +ObjectEntryIndex PathElement::GetRailingsEntryIndex() const +{ + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + else + return RailingsIndex; +} + +const FootpathRailingsObject* PathElement::GetRailingsEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathRailings, GetRailingsEntryIndex())); +} + +void PathElement::SetRailingsEntryIndex(ObjectEntryIndex newEntryIndex) +{ + RailingsIndex = newEntryIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } uint8_t PathElement::GetQueueBannerDirection() const diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 1dc6e10f2a..8072c7ab10 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -142,6 +142,7 @@ enum FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST = (1 << 2), FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE = (1 << 3), FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN = (1 << 4), + FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 5), }; enum diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index b683684571..68f289c8ce 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -26,6 +26,9 @@ struct rct_footpath_entry; class LargeSceneryObject; class TerrainSurfaceObject; class TerrainEdgeObject; +class FootpathObject; +class FootpathSurfaceObject; +class FootpathRailingsObject; using track_type_t = uint16_t; constexpr const uint8_t MAX_ELEMENT_HEIGHT = 255; @@ -260,30 +263,32 @@ struct PathElement : TileElementBase static constexpr TileElementType ElementType = TileElementType::Path; private: - ObjectEntryIndex SurfaceIndex; // 5 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t RailingsIndex; // 7 -#pragma clang diagnostic pop - uint8_t Additions; // 8 (0 means no addition) - uint8_t EdgesAndCorners; // 9 (edges in lower 4 bits, corners in upper 4) - uint8_t Flags2; // 10 - uint8_t SlopeDirection; // 11 + ObjectEntryIndex SurfaceIndex; // 5 + ObjectEntryIndex RailingsIndex; // 7 + uint8_t Additions; // 9 (0 means no addition) + uint8_t EdgesAndCorners; // 10 (edges in lower 4 bits, corners in upper 4) + uint8_t Flags2; // 11 + uint8_t SlopeDirection; // 12 union { - uint8_t AdditionStatus; // 12, only used for litter bins - ride_id_t rideIndex; // 12 + uint8_t AdditionStatus; // 13, only used for litter bins + ride_id_t rideIndex; // 13 }; - ::StationIndex StationIndex; // 14 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t pad_0F[1]; -#pragma clang diagnostic pop + ::StationIndex StationIndex; // 15 public: ObjectEntryIndex GetLegacyPathEntryIndex() const; const FootpathObject* GetLegacyPathEntry() const; void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex); + bool HasLegacyPathEntry() const; + + ObjectEntryIndex GetSurfaceEntryIndex() const; + const FootpathSurfaceObject* GetSurfaceEntry() const; + void SetSurfaceEntryIndex(ObjectEntryIndex newIndex); + + ObjectEntryIndex GetRailingsEntryIndex() const; + const FootpathRailingsObject* GetRailingsEntry() const; + void SetRailingsEntryIndex(ObjectEntryIndex newIndex); const PathSurfaceDescriptor* GetSurfaceDescriptor() const; const PathRailingsDescriptor* GetRailingsDescriptor() const; @@ -569,10 +574,11 @@ private: uint8_t SequenceIndex; // 6. Only uses the lower nibble. uint8_t StationIndex; // 7 ObjectEntryIndex PathType; // 8 - ride_id_t rideIndex; // 9 + ride_id_t rideIndex; // A + uint8_t flags2; // C #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t pad_0C[4]; + uint8_t pad_0D[3]; #pragma clang diagnostic pop public: @@ -588,9 +594,16 @@ public: uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); + bool HasLegacyPathEntry() const; + ObjectEntryIndex GetLegacyPathEntryIndex() const; + const FootpathObject* GetLegacyPathEntry() const; void SetLegacyPathEntryIndex(ObjectEntryIndex newPathType); + ObjectEntryIndex GetSurfaceEntryIndex() const; + const FootpathSurfaceObject* GetSurfaceEntry() const; + void SetSurfaceEntryIndex(ObjectEntryIndex newIndex); + const PathSurfaceDescriptor* GetPathSurfaceDescriptor() const; int32_t GetDirections() const; From c6e4dc5ef1b85f96c42ee4a79ec4a22a54dd325d Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 7 Sep 2021 04:08:07 +0000 Subject: [PATCH 329/681] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-OO.txt | 1 + data/language/fi-FI.txt | 2 ++ data/language/fr-FR.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index c516132598..f5d4b63906 100644 --- a/data/language/eo-OO.txt +++ b/data/language/eo-OO.txt @@ -3654,6 +3654,7 @@ STR_6453 :Kopii informojn de versio STR_6454 :Ne povas renomi rubandon… STR_6455 :Ne povas renomi surskribaĵon… STR_6456 :Giganta Ekrankopio +STR_6457 :Raporti cimon sur GitHub ############# # Scenarios # diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 0df643a943..4607f77fb4 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -3660,6 +3660,8 @@ STR_6452 :{WINDOW_COLOUR_2}Myy: {BLACK}{STRING} STR_6453 :Kopioi versiotiedot STR_6454 :Banneria ei voi uudelleennimetä… STR_6455 :Kylttiä ei voi uudelleennimetä… +STR_6456 :Jättiruudunkaappaus +STR_6457 :Ilmoita viasta GitHubissa ############# # Scenarios # diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 37fd6ffb0f..b3ddbd05ea 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -3661,6 +3661,7 @@ STR_6453 :Copier les informations de version STR_6454 :Impossible de renommer la bannière… STR_6455 :Impossible de renommer le panneau… STR_6456 :Capture d’écran géante +STR_6457 :Signaler un bug sur GitHub ############# # Scenarios # From 876329da8723082813ce229eec75cda179bef518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 7 Sep 2021 17:43:38 +0300 Subject: [PATCH 330/681] Fix hash bucketing of paint entries --- src/openrct2/paint/Paint.cpp | 6 +++--- src/openrct2/paint/Paint.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index a27565383e..1b06b4b002 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -56,7 +56,7 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y); static uint32_t PaintPSColourifyImage(uint32_t imageId, ViewportInteractionItem spriteType, uint32_t viewFlags); -static constexpr int32_t CalculatePositionHash(const paint_struct& ps, uint8_t rotation) +static constexpr uint32_t CalculatePositionHash(const paint_struct& ps, uint8_t rotation) { auto pos = CoordsXY{ ps.bounds.x, ps.bounds.y }.Rotate(rotation); switch (rotation) @@ -72,13 +72,13 @@ static constexpr int32_t CalculatePositionHash(const paint_struct& ps, uint8_t r break; } - return pos.x + pos.y; + return static_cast(pos.x + pos.y); } static void PaintSessionAddPSToQuadrant(paint_session* session, paint_struct* ps) { auto positionHash = CalculatePositionHash(*ps, session->CurrentRotation); - uint32_t paintQuadrantIndex = std::clamp(positionHash / 32, 0, MAX_PAINT_QUADRANTS - 1); + uint32_t paintQuadrantIndex = (positionHash / 32) % MAX_PAINT_QUADRANTS; ps->quadrant_index = paintQuadrantIndex; ps->next_quadrant_ps = session->Quadrants[paintQuadrantIndex]; session->Quadrants[paintQuadrantIndex] = ps; diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 7a6787d18e..596208bfea 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -113,7 +113,10 @@ struct tunnel_entry uint8_t type; }; -#define MAX_PAINT_QUADRANTS 512 +// NOTE: This should be preferably a prime number. This is the amount of +// buckets used with the position hash, so the bucket is hash % max. +#define MAX_PAINT_QUADRANTS 521 + #define TUNNEL_MAX_COUNT 65 /** From a3b0c9ac81fbe5da147cabead5c41084c93d382c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:19:14 +0300 Subject: [PATCH 331/681] Add overload for map_get_first_element_at to accept TileCoordsXY --- src/openrct2/world/Map.cpp | 19 +++++++++++++++---- src/openrct2/world/Map.h | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 04e5f8e4aa..427f27480a 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -283,15 +283,26 @@ void tile_element_iterator_restart_for_tile(tile_element_iterator* it) it->element = nullptr; } -TileElement* map_get_first_element_at(const CoordsXY& elementPos) +static bool IsTileLocationValid(const TileCoordsXY& coords) { - if (!map_is_location_valid(elementPos)) + 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; + return is_x_valid && is_y_valid; +} + +TileElement* map_get_first_element_at(const TileCoordsXY& tilePos) +{ + if (!IsTileLocationValid(tilePos)) { log_verbose("Trying to access element outside of range"); return nullptr; } - auto tileElementPos = TileCoordsXY{ elementPos }; - return _tileIndex.GetFirstElementAt(tileElementPos); + return _tileIndex.GetFirstElementAt(tilePos); +} + +TileElement* map_get_first_element_at(const CoordsXY& elementPos) +{ + return map_get_first_element_at(TileCoordsXY{ elementPos }); } TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 9427e13bf9..d9f524c646 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -191,7 +191,8 @@ void map_init(int32_t size); void map_count_remaining_land_rights(); void map_strip_ghost_flag_from_elements(); -TileElement* map_get_first_element_at(const CoordsXY& elementPos); +TileElement* map_get_first_element_at(const CoordsXY& tilePos); +TileElement* map_get_first_element_at(const TileCoordsXY& tilePos); TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n); void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements); int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped); From 79ab832000fcaba1bb1f9c2b1ff3e4217f47f15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:20:13 +0300 Subject: [PATCH 332/681] Fix overload resolution for map_get_first_element_at --- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 4 ++-- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/transport/Chairlift.cpp | 2 +- src/openrct2/world/Map.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 7b1d0e5b3e..7eff568503 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -713,7 +713,7 @@ void Peep::UpdateFalling() } // If not drowning then falling. Note: peeps 'fall' after leaving a ride/enter the park. - TileElement* tile_element = map_get_first_element_at({ x, y }); + TileElement* tile_element = map_get_first_element_at(CoordsXY{ x, y }); TileElement* saved_map = nullptr; int32_t saved_height = 0; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 33bf8c9732..9adc725a45 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -351,7 +351,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) { for (; x < MAXIMUM_MAP_SIZE_BIG; x += COORDS_XY_STEP) { - auto tileElement = map_get_first_element_at({ x, y }); + auto tileElement = map_get_first_element_at(CoordsXY{ x, y }); do { if (tileElement == nullptr) @@ -457,7 +457,7 @@ CoordsXYE TrackDesign::MazeGetFirstElement(const Ride& ride) { for (tile.x = 0; tile.x < MAXIMUM_MAP_SIZE_BIG; tile.x += COORDS_XY_STEP) { - tile.element = map_get_first_element_at({ tile.x, tile.y }); + tile.element = map_get_first_element_at(CoordsXY{ tile.x, tile.y }); do { if (tile.element == nullptr) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 369f6121a0..2a1f0f47cf 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1897,7 +1897,7 @@ void Vehicle::UpdateMeasurements() { // Set tile_element to first element. Since elements aren't always ordered by base height, // we must start at the first element and iterate through each tile element. - auto tileElement = map_get_first_element_at({ x, y }); + auto tileElement = map_get_first_element_at(CoordsXY{ x, y }); if (tileElement == nullptr) return; diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index db0b0a2950..101f424449 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -110,7 +110,7 @@ static void chairlift_paint_util_draw_supports(paint_session* session, int32_t s static const TrackElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( int32_t x, int32_t y, int32_t z, const Ride* ride) { - const TileElement* tileElement = map_get_first_element_at({ x, y }); + const TileElement* tileElement = map_get_first_element_at(CoordsXY{ x, y }); if (tileElement == nullptr) { return nullptr; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 427f27480a..d58c895a61 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -243,7 +243,7 @@ void tile_element_iterator_begin(tile_element_iterator* it) { it->x = 0; it->y = 0; - it->element = map_get_first_element_at({ 0, 0 }); + it->element = map_get_first_element_at(TileCoordsXY{ 0, 0 }); } int32_t tile_element_iterator_next(tile_element_iterator* it) From 07a7946caf06d4ff19b819cfa6783761cc7acf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:24:23 +0300 Subject: [PATCH 333/681] Remove redundant conversions --- src/openrct2-ui/windows/Banner.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 10 +++++----- src/openrct2/actions/ClearAction.cpp | 2 +- src/openrct2/peep/GuestPathfinding.cpp | 12 ++++++------ src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/ride/Ride.cpp | 8 ++++---- src/openrct2/ride/RideConstruction.cpp | 2 +- src/openrct2/ride/RideRatings.cpp | 2 +- src/openrct2/ride/TrackDesignSave.cpp | 2 +- src/openrct2/world/Banner.cpp | 4 ++-- src/openrct2/world/Footpath.cpp | 4 ++-- src/openrct2/world/Map.cpp | 10 +++++----- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 2ec3a3e9a6..90380222cb 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -96,7 +96,7 @@ private: return nullptr; } - TileElement* tileElement = map_get_first_element_at(banner->position.ToCoordsXY().ToTileCentre()); + TileElement* tileElement = map_get_first_element_at(banner->position); if (tileElement == nullptr) { return nullptr; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b1ed717898..0ae570d8e8 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2424,11 +2424,11 @@ static void sub_6CBCE2( auto southTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_SOUTH]; // Replace map elements with temporary ones containing track - _backupTileElementArrays[0] = map_get_first_element_at(centreTileCoords.ToCoordsXY()); - _backupTileElementArrays[1] = map_get_first_element_at(eastTileCoords.ToCoordsXY()); - _backupTileElementArrays[2] = map_get_first_element_at(westTileCoords.ToCoordsXY()); - _backupTileElementArrays[3] = map_get_first_element_at(northTileCoords.ToCoordsXY()); - _backupTileElementArrays[4] = map_get_first_element_at(southTileCoords.ToCoordsXY()); + _backupTileElementArrays[0] = map_get_first_element_at(centreTileCoords); + _backupTileElementArrays[1] = map_get_first_element_at(eastTileCoords); + _backupTileElementArrays[2] = map_get_first_element_at(westTileCoords); + _backupTileElementArrays[3] = map_get_first_element_at(northTileCoords); + _backupTileElementArrays[4] = map_get_first_element_at(southTileCoords); map_set_tile_element(centreTileCoords, &_tempTrackTileElement); map_set_tile_element(eastTileCoords, &_tempSideTrackTileElement); map_set_tile_element(westTileCoords, &_tempSideTrackTileElement); diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index cfeea2f993..bccba7e5a7 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -214,7 +214,7 @@ void ClearAction::ResetClearLargeSceneryFlag() { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); do { if (tileElement == nullptr) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 8a2f474810..9e37e3b08b 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -276,7 +276,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement } loc += TileDirectionDelta[chosenDirection]; - nextTileElement = map_get_first_element_at(loc.ToCoordsXY()); + nextTileElement = map_get_first_element_at(loc); do { if (nextTileElement == nullptr) @@ -327,7 +327,7 @@ static uint8_t footpath_element_dest_in_dir( return PATH_SEARCH_LIMIT_REACHED; loc += TileDirectionDelta[chosenDirection]; - tileElement = map_get_first_element_at(loc.ToCoordsXY()); + tileElement = map_get_first_element_at(loc); if (tileElement == nullptr) { return PATH_SEARCH_FAILED; @@ -733,7 +733,7 @@ static void peep_pathfind_heuristic_search( /* Get the next map element of interest in the direction of test_edge. */ bool found = false; - TileElement* tileElement = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(loc); if (tileElement == nullptr) { return; @@ -1275,7 +1275,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 // Get the path element at this location - TileElement* dest_tile_element = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* dest_tile_element = map_get_first_element_at(loc); /* Where there are multiple matching map elements placed with zero * clearance, save the first one for later use to determine the path * slope - this maintains the original behaviour (which only processes @@ -1797,7 +1797,7 @@ static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges) static void get_ride_queue_end(TileCoordsXYZ& loc) { TileCoordsXY queueEnd = { 0, 0 }; - TileElement* tileElement = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(loc); if (tileElement == nullptr) { @@ -1845,7 +1845,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) } nextTile += TileDirectionDelta[direction]; - tileElement = map_get_first_element_at(nextTile.ToCoordsXY()); + tileElement = map_get_first_element_at(nextTile); found = false; if (tileElement == nullptr) break; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index efcdeb95d3..75e1a7726f 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2527,7 +2527,7 @@ namespace RCT1 { for (int32_t y = 0; y < RCT1_MAX_MAP_SIZE; y++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 62dee8b349..1ea600de47 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2207,7 +2207,7 @@ static void ride_shop_connected(Ride* ride) return; TrackElement* trackElement = nullptr; - TileElement* tileElement = map_get_first_element_at(shopLoc.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(shopLoc); do { if (tileElement == nullptr) @@ -2563,7 +2563,7 @@ void Ride::ChainQueues() const // This will fire for every entrance on this x, y and z, regardless whether that actually belongs to // the ride or not. - TileElement* tileElement = map_get_first_element_at(location.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(location); if (tileElement != nullptr) { do @@ -2908,7 +2908,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) { auto entranceExitMapPos = position->ToCoordsXYZ(); - TileElement* tileElement = map_get_first_element_at(position->ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(*position); do { if (tileElement == nullptr) @@ -5552,7 +5552,7 @@ void determine_ride_entrance_and_exit_locations() { for (uint8_t y = 1; y < MAXIMUM_MAP_SIZE_TECHNICAL - 1; y++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); if (tileElement != nullptr) { diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index f6a270ab00..19c50b3ce8 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -347,7 +347,7 @@ void ride_clear_blocked_tiles(Ride* ride) { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto element = map_get_first_element_at(TileCoordsXY{ x, y }); if (element != nullptr) { do diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 308a2f6528..005af0a20f 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -1463,7 +1463,7 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride) xx++) { // Count scenery items on this tile - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ xx, yy }.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ xx, yy }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index a345852212..ee7702a6bf 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -547,7 +547,7 @@ static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex { for (int32_t x = cx - TRACK_NEARBY_SCENERY_DISTANCE; x <= cx + TRACK_NEARBY_SCENERY_DISTANCE; x++) { - tileElement = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 1d276df688..86bdcb4f49 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -145,7 +145,7 @@ TileElement* banner_get_tile_element(BannerIndex bannerIndex) auto banner = GetBanner(bannerIndex); if (banner != nullptr) { - auto tileElement = map_get_first_element_at(banner->position.ToCoordsXY()); + auto tileElement = map_get_first_element_at(banner->position); if (tileElement != nullptr) { do @@ -166,7 +166,7 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex) if (banner == nullptr) return nullptr; - auto tileElement = map_get_first_element_at(banner->position.ToCoordsXY()); + auto tileElement = map_get_first_element_at(banner->position); if (tileElement == nullptr) return nullptr; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index fe59e4e6d1..a0a11c9a3a 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1222,7 +1222,7 @@ void footpath_update_queue_chains() if (location.isNull()) continue; - TileElement* tileElement = map_get_first_element_at(location.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(location); if (tileElement != nullptr) { do @@ -2070,7 +2070,7 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in // entrances and exits, shops, paths). bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved) { - TileElement* tileElement = map_get_first_element_at(coords.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(coords); if (tileElement == nullptr) return false; do diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index d58c895a61..2c1df1f044 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -159,7 +159,7 @@ static void ReorganiseTileElements(size_t capacity) { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - const auto* element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + const auto* element = map_get_first_element_at(TileCoordsXY{ x, y }); if (element == nullptr) { auto& newElement = newElements.emplace_back(); @@ -250,7 +250,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) { if (it->element == nullptr) { - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }.ToCoordsXY()); + it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); return 1; } @@ -263,7 +263,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) if (it->x < (MAXIMUM_MAP_SIZE_TECHNICAL - 1)) { it->x++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }.ToCoordsXY()); + it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); return 1; } @@ -271,7 +271,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) { it->x = 0; it->y++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }.ToCoordsXY()); + it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); return 1; } @@ -649,7 +649,7 @@ int16_t tile_element_water_height(const CoordsXY& loc) */ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) { - TileElement* tileElement = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* tileElement = map_get_first_element_at(loc); if (tileElement == nullptr) return false; From dba4518d118a74244fbd5170fbf39e9dcfa3e345 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 7 Sep 2021 23:33:48 -0700 Subject: [PATCH 334/681] refactor entrance hut finding function (#15360) --- src/openrct2/ride/RideConstruction.cpp | 72 +++++++++++--------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index f6a270ab00..d3f8630e7b 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1202,35 +1202,36 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; } -// Finds the direction a station should face for an NxN station when called with an N+2xN+2 grid size. -// Direction is valid only if the tile in question is on the outer tiles of the grid -static Direction GetEntranceExitDirection( - int16_t mapX, int16_t mapY, int16_t entranceMinX, int16_t entranceMinY, int16_t entranceMaxX, int16_t entranceMaxY) +// Finds the direction a ride entrance should face for an NxN station. +// Direction is valid if queryLocation is directly adjacent to this station. +static Direction GetRideEntranceDirection(CoordsXY& queryLocation, CoordsXY& entranceMin, CoordsXY& entranceMax) { - if (mapX == entranceMinX) + entranceMin -= CoordsXY(32, 32); + entranceMax += CoordsXY(32, 32); + if (queryLocation.x == entranceMax.x) { - if (mapY > entranceMinY && mapY < entranceMaxY) + if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) { return 0; } } - if (mapY == entranceMaxY) + if (queryLocation.y == entranceMax.y) { - if (mapX > entranceMinX && mapX < entranceMaxX) + if (queryLocation.x > entranceMin.x && queryLocation.x < entranceMax.x) { return 1; } } - if (mapX == entranceMaxX) + if (queryLocation.x == entranceMin.x) { - if (mapY > entranceMinY && mapY < entranceMaxY) + if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) { return 2; } } - if (mapY == entranceMinY) + if (queryLocation.y == entranceMin.y) { - if (mapX > entranceMinX && mapX < entranceMaxX) + if (queryLocation.x > entranceMin.x && queryLocation.x < entranceMax.x) { return 3; } @@ -1322,8 +1323,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC entranceExitCoords.direction = (startDirection + directionIncrement) & 3; // search for TrackElement one tile over, shifted in the search direction auto nextLocation = entranceExitCoords; - nextLocation.x += CoordsDirectionDelta[entranceExitCoords.direction].x; - nextLocation.y += CoordsDirectionDelta[entranceExitCoords.direction].y; + nextLocation += CoordsDirectionDelta[entranceExitCoords.direction]; if (map_is_location_valid(nextLocation)) { // iterate over every element in the tile until we find what we want @@ -1366,14 +1366,12 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC } gRideEntranceExitPlaceDirection = INVALID_DIRECTION; } + // tracked rides excluding tower rides else { - // create a 2-point rectangle. The rectangle will have a width or height of 0 depending on station direction or length - // (if the station is 0) The 2-point rectangle is ballooned on all four sides by 1 tile for a 3xN or Nx3 rectangle. - // Whatever edge the ride entrance is on, rotate it outward to get entrance direction. - CoordsXY nextLocation = { stationStart }; - CoordsXY entranceMin = { nextLocation }; - CoordsXY entranceMax = { nextLocation }; + // create a 2-point rectangle. The rectangle will have a width or height of 0 depending on station direction + CoordsXY entranceMin = { stationStart }; + CoordsXY entranceMax = { stationStart }; // get the beginning of the station TrackElement auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); @@ -1382,16 +1380,13 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC entranceExitCoords.setNull(); return entranceExitCoords; } - entranceExitCoords.direction = tileElement->GetDirection(); - auto stationDirection = entranceExitCoords.direction; + auto stationDirection = tileElement->GetDirection(); // find additional station TrackElements and extend the line of valid entrance locations while (true) { - entranceMax = { nextLocation }; - nextLocation.x -= CoordsDirectionDelta[entranceExitCoords.direction].x; - nextLocation.y -= CoordsDirectionDelta[entranceExitCoords.direction].y; - tileElement = map_get_first_element_at(nextLocation); + entranceMax -= CoordsDirectionDelta[stationDirection]; + tileElement = map_get_first_element_at(entranceMax); if (tileElement == nullptr) break; bool goToNextTile = false; @@ -1414,24 +1409,17 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (!goToNextTile) break; } + // entranceMax increments before the check + entranceMax += CoordsDirectionDelta[stationDirection]; // swap variables for valid ranges - nextLocation.x = entranceMin.x; - if (nextLocation.x > entranceMax.x) - { - entranceMin.x = entranceMax.x; - entranceMax.x = nextLocation.x; - } + if (entranceMin.x > entranceMax.x) + std::swap(entranceMin.x, entranceMax.x); + if (entranceMin.y > entranceMax.y) + std::swap(entranceMin.y, entranceMax.y); + + // get the station direction from its position + auto direction = GetRideEntranceDirection(entranceExitCoords, entranceMin, entranceMax); - nextLocation.y = entranceMin.y; - if (nextLocation.y > entranceMax.y) - { - entranceMin.y = entranceMax.y; - entranceMax.y = nextLocation.y; - } - // for a 3xN or Nx3 grid, determine the direction toward the center - auto direction = GetEntranceExitDirection( - entranceExitCoords.x, entranceExitCoords.y, entranceMin.x - 32, entranceMin.y - 32, entranceMax.x + 32, - entranceMax.y + 32); if (direction != INVALID_DIRECTION && direction != stationDirection && direction != direction_reverse(stationDirection)) { entranceExitCoords.direction = direction; From 33fbad9726eafd62e14fe078d3975aaf02ebdbe0 Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:39:34 +0900 Subject: [PATCH 335/681] Fix #15257: Chat widgets removed from Scenario Editor (#15365) * Update TopToolbar.cpp Removed else statement which caused the game to skip toolbar element deactivations. * Update contributors.md Adding name to contrib.md * Update changelog.txt Updated changelog * Update changelog.txt Fixing changelog item position --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/TopToolbar.cpp | 64 ++++++++++++-------------- 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/contributors.md b/contributors.md index b12d3c4d21..302be0ee29 100644 --- a/contributors.md +++ b/contributors.md @@ -176,6 +176,7 @@ The following people are not part of the development team, but have been contrib * Kane Shaw (seifer7) * Saad Rehman (SaadRehmanCS) * (ocalhoun6) +* Sean Payne (seanmajorpayne) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4389b0eb51..f1e4eab986 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. +- Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 870ec0f40a..3970a94872 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -675,13 +675,24 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; if (!gConfigInterface.toolbar_show_mute) - { window_top_toolbar_widgets[WIDX_MUTE].type = WindowWidgetType::Empty; - } if (!gConfigInterface.toolbar_show_chat) - { window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_research) + window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_cheats) + window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_news) + window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.toolbar_show_zoom) + { + window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; + window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; } if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR || gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) @@ -689,6 +700,9 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; } + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) + window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; + if (gScreenFlags & SCREEN_FLAGS_EDITOR) { window_top_toolbar_widgets[WIDX_PARK].type = WindowWidgetType::Empty; @@ -725,39 +739,19 @@ static void window_top_toolbar_invalidate(rct_window* w) window_top_toolbar_widgets[WIDX_VIEW_MENU].type = WindowWidgetType::Empty; } } - else + + switch (network_get_mode()) { - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) - window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_research) - window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_cheats) - window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_news) - window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.toolbar_show_zoom) - { - window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; - window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; - } - - switch (network_get_mode()) - { - case NETWORK_MODE_NONE: - window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; - window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - break; - case NETWORK_MODE_CLIENT: - window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; - [[fallthrough]]; - case NETWORK_MODE_SERVER: - window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; - break; - } + case NETWORK_MODE_NONE: + window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; + window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + break; + case NETWORK_MODE_CLIENT: + window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; + [[fallthrough]]; + case NETWORK_MODE_SERVER: + window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; + break; } enabledWidgets = 0; From 3988261e8f368352acaaa1abf6ec9853726e65ba Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 8 Sep 2021 13:39:11 +0200 Subject: [PATCH 336/681] Set RailingsEntryIndex to null for good measure --- src/openrct2/world/Footpath.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 1860e0e30f..a1452df224 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1660,6 +1660,7 @@ const FootpathObject* PathElement::GetLegacyPathEntry() const void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) { SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; + RailingsIndex = OBJECT_ENTRY_INDEX_NULL; Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } From f9f027e219d220412aed3abe7bb3cf07bba40dc1 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 8 Sep 2021 15:40:35 +0200 Subject: [PATCH 337/681] Name word_F3F038 (#15373) Co-authored-by: IntelOrca --- src/openrct2/paint/tile_element/Paint.Path.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 711dc7b32a..5f93c63949 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -325,7 +325,7 @@ static void path_bit_jumping_fountains_paint( * @param tile_element (esi) */ static void sub_6A4101( - paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool word_F3F038, + paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool hasSupports, const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags) { uint32_t base_image_id = railingsDescriptor->RailingsImage | imageFlags; @@ -519,7 +519,7 @@ static void sub_6A4101( } else { - if (!word_F3F038) + if (!hasSupports) { return; } @@ -669,7 +669,7 @@ static void sub_6A4101( */ static void sub_6A3F61( paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, - const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags, uint32_t sceneryImageFlags, bool word_F3F038) + const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags, uint32_t sceneryImageFlags, bool hasSupports) { // eax -- // ebx -- @@ -749,7 +749,7 @@ static void sub_6A3F61( // Redundant zoom-level check removed if (paintScenery) - sub_6A4101(session, pathElement, height, connectedEdges, word_F3F038, railingsDescriptor, imageFlags); + sub_6A4101(session, pathElement, height, connectedEdges, hasSupports, railingsDescriptor, imageFlags); } // This is about tunnel drawing From 0fcef925b6f1fc62f5c04785c72d58328a85cd82 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 8 Sep 2021 20:58:11 +0100 Subject: [PATCH 338/681] Fix #15375. Issue with entrance exit placement after refactor (#15380) --- src/openrct2/ride/RideConstruction.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index d3f8630e7b..bc3f30dc8e 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1204,11 +1204,11 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u // Finds the direction a ride entrance should face for an NxN station. // Direction is valid if queryLocation is directly adjacent to this station. -static Direction GetRideEntranceDirection(CoordsXY& queryLocation, CoordsXY& entranceMin, CoordsXY& entranceMax) +static Direction GetRideEntranceDirection(const CoordsXY& queryLocation, CoordsXY entranceMin, CoordsXY entranceMax) { entranceMin -= CoordsXY(32, 32); entranceMax += CoordsXY(32, 32); - if (queryLocation.x == entranceMax.x) + if (queryLocation.x == entranceMin.x) { if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) { @@ -1222,7 +1222,7 @@ static Direction GetRideEntranceDirection(CoordsXY& queryLocation, CoordsXY& ent return 1; } } - if (queryLocation.x == entranceMin.x) + if (queryLocation.x == entranceMax.x) { if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) { @@ -1381,12 +1381,15 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC return entranceExitCoords; } auto stationDirection = tileElement->GetDirection(); + entranceExitCoords.direction = stationDirection; + auto next = entranceMax; // find additional station TrackElements and extend the line of valid entrance locations while (true) { - entranceMax -= CoordsDirectionDelta[stationDirection]; - tileElement = map_get_first_element_at(entranceMax); + entranceMax = next; + next -= CoordsDirectionDelta[stationDirection]; + tileElement = map_get_first_element_at(next); if (tileElement == nullptr) break; bool goToNextTile = false; @@ -1409,8 +1412,6 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (!goToNextTile) break; } - // entranceMax increments before the check - entranceMax += CoordsDirectionDelta[stationDirection]; // swap variables for valid ranges if (entranceMin.x > entranceMax.x) std::swap(entranceMin.x, entranceMax.x); From 6a7fe6a5e29d24680a3732dd85a15dfb561ede1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 8 Sep 2021 23:13:19 +0300 Subject: [PATCH 339/681] Fix #15376: Extend the X axis on rotation 0 to cover corners Also make the code branchless --- src/openrct2/paint/Paint.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 1b06b4b002..6d64b750c2 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -56,21 +56,19 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y); static uint32_t PaintPSColourifyImage(uint32_t imageId, ViewportInteractionItem spriteType, uint32_t viewFlags); +static constexpr int32_t _PositionHashExtendsX[] = { + -0x2000, + 0x2000, + 0x4000, + 0x2000, +}; + static constexpr uint32_t CalculatePositionHash(const paint_struct& ps, uint8_t rotation) { auto pos = CoordsXY{ ps.bounds.x, ps.bounds.y }.Rotate(rotation); - switch (rotation) - { - case 0: - break; - case 1: - case 3: - pos.x += 0x2000; - break; - case 2: - pos.x += 0x4000; - break; - } + + // For corners to fall into the right buckets this extends the X axis. + pos.x += _PositionHashExtendsX[rotation]; return static_cast(pos.x + pos.y); } From d3263ef6b728aa983b07db96873ad50e367663b2 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 8 Sep 2021 22:55:08 +0200 Subject: [PATCH 340/681] Make smart follow functions easier to follow Opted for a switch case instead of if-else if-else if-else Reuse entity - is already checked for null and doesn't change Remove unnecessary else blocks after if-block that returns --- src/openrct2/interface/Viewport.cpp | 120 +++++++++++++--------------- 1 file changed, 54 insertions(+), 66 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 3b6fc35b4b..a083fa62db 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -669,40 +669,34 @@ void viewport_update_sprite_follow(rct_window* window) void viewport_update_smart_sprite_follow(rct_window* window) { auto entity = TryGetEntity(window->viewport_smart_follow_sprite); - if (entity == nullptr) + if (entity == nullptr || entity->Type == EntityType::Null) { window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; + return; } - else if (entity->Type == EntityType::Guest || entity->Type == EntityType::Staff) + + switch (entity->Type) { - Peep* peep = TryGetEntity(window->viewport_smart_follow_sprite); - if (peep == nullptr) + case EntityType::Vehicle: + viewport_update_smart_vehicle_follow(window); + break; + + case EntityType::Guest: + case EntityType::Staff: { - // will never happen - window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; - window->viewport_target_sprite = SPRITE_INDEX_NULL; - return; + Peep* peep = static_cast(entity); + if (peep->Is()) + viewport_update_smart_guest_follow(window, peep); + else if (peep->Is()) + viewport_update_smart_staff_follow(window, peep); + break; } - if (peep->Is()) - viewport_update_smart_guest_follow(window, peep); - else if (peep->Is()) - viewport_update_smart_staff_follow(window, peep); - } - else if (entity->Type == EntityType::Vehicle) - { - viewport_update_smart_vehicle_follow(window); - } - else if (entity->Type != EntityType::Null) - { - window->viewport_focus_sprite.sprite_id = window->viewport_smart_follow_sprite; - window->viewport_target_sprite = window->viewport_smart_follow_sprite; - } - else - { - window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; - window->viewport_target_sprite = SPRITE_INDEX_NULL; + default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. + window->viewport_focus_sprite.sprite_id = window->viewport_smart_follow_sprite; + window->viewport_target_sprite = window->viewport_smart_follow_sprite; + break; } } @@ -719,48 +713,47 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep window->viewport_target_sprite = SPRITE_INDEX_NULL; return focus; } - else + + bool overallFocus = true; + if (peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide + || (peep->State == PeepState::LeavingRide && peep->x == LOCATION_NULL)) { - bool overallFocus = true; - if (peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide - || (peep->State == PeepState::LeavingRide && peep->x == LOCATION_NULL)) + auto ride = get_ride(peep->CurrentRide); + if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { - auto ride = get_ride(peep->CurrentRide); - if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + auto train = GetEntity(ride->vehicles[peep->CurrentTrain]); + if (train != nullptr) { - auto train = GetEntity(ride->vehicles[peep->CurrentTrain]); - if (train != nullptr) + const auto car = train->GetCar(peep->CurrentCar); + if (car != nullptr) { - const auto car = train->GetCar(peep->CurrentCar); - if (car != nullptr) - { - focus.sprite.sprite_id = car->sprite_index; - overallFocus = false; - } + focus.sprite.sprite_id = car->sprite_index; + overallFocus = false; } } } - if (peep->x == LOCATION_NULL && overallFocus) - { - auto ride = get_ride(peep->CurrentRide); - if (ride != nullptr) - { - auto xy = ride->overall_view.ToTileCentre(); - focus.type = VIEWPORT_FOCUS_TYPE_COORDINATE; - focus.coordinate.x = xy.x; - focus.coordinate.y = xy.y; - focus.coordinate.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; - } - } - else - { - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; - focus.sprite.pad_486 &= 0xFFFF; - } - focus.coordinate.rotation = get_current_rotation(); } + if (peep->x == LOCATION_NULL && overallFocus) + { + auto ride = get_ride(peep->CurrentRide); + if (ride != nullptr) + { + auto xy = ride->overall_view.ToTileCentre(); + focus.type = VIEWPORT_FOCUS_TYPE_COORDINATE; + focus.coordinate.x = xy.x; + focus.coordinate.y = xy.y; + focus.coordinate.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); + focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + } + } + else + { + focus.sprite.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; + focus.sprite.pad_486 &= 0xFFFF; + } + focus.coordinate.rotation = get_current_rotation(); + window->viewport_focus_sprite = focus.sprite; window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; return focus; @@ -774,15 +767,12 @@ void viewport_update_smart_staff_follow(rct_window* window, Peep* peep) if (peep->State == PeepState::Picked) { - // focus.sprite.sprite_id = SPRITE_INDEX_NULL; window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; return; } - else - { - focus.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; - } + + focus.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; window->viewport_focus_sprite = focus; window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; @@ -790,9 +780,7 @@ void viewport_update_smart_staff_follow(rct_window* window, Peep* peep) void viewport_update_smart_vehicle_follow(rct_window* window) { - // Can be expanded in the future if needed sprite_focus focus = {}; - focus.sprite_id = window->viewport_smart_follow_sprite; window->viewport_focus_sprite = focus; From 2b51b91524ff054175108adca1033308f4128f97 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 8 Sep 2021 22:59:58 +0200 Subject: [PATCH 341/681] Make peep argument const --- src/openrct2/interface/Viewport.cpp | 4 ++-- src/openrct2/interface/Viewport.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index a083fa62db..d1ca5556ac 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -700,7 +700,7 @@ void viewport_update_smart_sprite_follow(rct_window* window) } } -viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep) +viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Peep* peep) { viewport_focus focus{}; focus.type = VIEWPORT_FOCUS_TYPE_SPRITE; @@ -759,7 +759,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep return focus; } -void viewport_update_smart_staff_follow(rct_window* window, Peep* peep) +void viewport_update_smart_staff_follow(rct_window* window, const Peep* peep) { sprite_focus focus = {}; diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 3bd4f8880a..4c72fed796 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -111,8 +111,8 @@ void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bott void viewport_update_position(rct_window* window); void viewport_update_sprite_follow(rct_window* window); void viewport_update_smart_sprite_follow(rct_window* window); -viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep); -void viewport_update_smart_staff_follow(rct_window* window, Peep* peep); +viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Peep* peep); +void viewport_update_smart_staff_follow(rct_window* window, const Peep* peep); void viewport_update_smart_vehicle_follow(rct_window* window); void viewport_render( rct_drawpixelinfo* dpi, const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom, From 624a32e93b3c9d22f50c23daad327963555eca42 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 9 Sep 2021 01:48:53 +0200 Subject: [PATCH 342/681] Make Coords isNull/setNull functions TitleCase (#15382) --- .../interface/ViewportInteraction.cpp | 6 +- src/openrct2-ui/windows/Footpath.cpp | 4 +- src/openrct2-ui/windows/Guest.cpp | 6 +- src/openrct2-ui/windows/Map.cpp | 12 ++-- src/openrct2-ui/windows/MazeConstruction.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 12 ++-- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 10 +-- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 66 +++++++++--------- src/openrct2-ui/windows/TrackDesignPlace.cpp | 10 +-- src/openrct2/ReplayManager.cpp | 2 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/PeepPickupAction.cpp | 2 +- src/openrct2/actions/RideCreateAction.cpp | 4 +- src/openrct2/actions/RideDemolishAction.cpp | 4 +- .../actions/RideEntranceExitPlaceAction.cpp | 4 +- .../actions/RideSetAppearanceAction.cpp | 2 +- src/openrct2/actions/RideSetPriceAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 4 +- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/management/NewsItem.cpp | 4 +- src/openrct2/peep/Guest.cpp | 10 +-- src/openrct2/peep/GuestPathfinding.cpp | 8 +-- src/openrct2/peep/Staff.cpp | 24 +++---- src/openrct2/rct1/S4Importer.cpp | 22 +++--- src/openrct2/rct12/RCT12.h | 4 +- src/openrct2/rct2/S6Exporter.cpp | 28 ++++---- src/openrct2/rct2/S6Importer.cpp | 26 +++---- src/openrct2/ride/CableLift.cpp | 2 +- src/openrct2/ride/Ride.cpp | 68 +++++++++---------- src/openrct2/ride/RideConstruction.cpp | 30 ++++---- src/openrct2/ride/RideRatings.cpp | 6 +- src/openrct2/ride/Station.cpp | 12 ++-- src/openrct2/ride/Track.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 6 +- src/openrct2/ride/Vehicle.cpp | 18 ++--- src/openrct2/scripting/Duktape.hpp | 8 +-- src/openrct2/scripting/ScriptEngine.cpp | 2 +- src/openrct2/world/Banner.cpp | 2 +- src/openrct2/world/Footpath.cpp | 8 +-- src/openrct2/world/Location.hpp | 32 ++++----- src/openrct2/world/MoneyEffect.cpp | 2 +- 46 files changed, 246 insertions(+), 246 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 24f5914c2e..9b77d36303 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -375,7 +375,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor stationIndex = tileElement->AsTrack()->GetStationIndex(); for (i = stationIndex; i >= 0; i--) - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) stationIndex--; stationIndex++; ft.Add(stationIndex); @@ -761,7 +761,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo if (window == nullptr || window->viewport == nullptr) { CoordsXY ret{}; - ret.setNull(); + ret.SetNull(); return ret; } auto viewport = window->viewport; @@ -771,7 +771,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo if (info.SpriteType == ViewportInteractionItem::None) { - initialPos.setNull(); + initialPos.SetNull(); return initialPos; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 1cdd7ba637..ed4915bccc 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -798,7 +798,7 @@ static void window_footpath_set_selection_start_bridge_at_point(const ScreenCoor gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) { return; } @@ -904,7 +904,7 @@ static void window_footpath_start_bridge_at_point(const ScreenCoordsXY& screenCo TileElement* tileElement; auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) { return; } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index a52a0ee43c..4e62cf9142 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -585,7 +585,7 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex) } w->picked_peep_old_x = peep->x; CoordsXYZ nullLoc{}; - nullLoc.setNull(); + nullLoc.SetNull(); PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() }; pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) @@ -1132,7 +1132,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); - if (!mapCoords.isNull()) + if (!mapCoords.IsNull()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; @@ -1180,7 +1180,7 @@ void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, TileElement* tileElement; auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); - if (destCoords.isNull()) + if (destCoords.IsNull()) return; PeepPickupAction pickupAction{ diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 2891a7eada..dd8d141f48 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1216,13 +1216,13 @@ static CoordsXYZD place_park_entrance_get_map_position(const ScreenCoordsXY& scr CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION }; const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION }; - if (parkEntranceMapPosition.isNull()) + if (parkEntranceMapPosition.IsNull()) return parkEntranceMapPosition; auto surfaceElement = map_get_surface_element_at(mapCoords); if (surfaceElement == nullptr) { - parkEntranceMapPosition.setNull(); + parkEntranceMapPosition.SetNull(); return parkEntranceMapPosition; } @@ -1257,7 +1257,7 @@ static void window_map_place_park_entrance_tool_update(const ScreenCoordsXY& scr gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; CoordsXYZD parkEntrancePosition = place_park_entrance_get_map_position(screenCoords); - if (parkEntrancePosition.isNull()) + if (parkEntrancePosition.IsNull()) { park_entrance_remove_ghost(); return; @@ -1298,7 +1298,7 @@ static void window_map_set_peep_spawn_tool_update(const ScreenCoordsXY& screenCo gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) return; mapZ = tileElement->GetBaseZ(); @@ -1329,7 +1329,7 @@ static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& scree park_entrance_remove_ghost(); CoordsXYZD parkEntrancePosition = place_park_entrance_get_map_position(screenCoords); - if (!parkEntrancePosition.isNull()) + if (!parkEntrancePosition.IsNull()) { auto gameAction = PlaceParkEntranceAction(parkEntrancePosition, gFootpathSelectedId); auto result = GameActions::Execute(&gameAction); @@ -1351,7 +1351,7 @@ static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoor // Verify footpath exists at location, and retrieve coordinates auto mapCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) return; mapZ = tileElement->GetBaseZ(); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 1d85230e86..8ba2e75354 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -159,7 +159,7 @@ static void window_maze_construction_close(rct_window* w) auto ride = get_ride(_currentRideIndex); if (ride != nullptr) { - if (ride->overall_view.isNull()) + if (ride->overall_view.IsNull()) { int32_t savedPausedState = gGamePaused; gGamePaused = 0; @@ -366,7 +366,7 @@ static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& scr gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; CoordsXYZD entranceOrExitCoords = ride_get_entrance_or_exit_position_from_screen_position(screenCoords); - if (entranceOrExitCoords.isNull()) + if (entranceOrExitCoords.IsNull()) return; if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index a2df6fa936..b79a7cec0e 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1334,7 +1334,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde // View for (int32_t i = stationIndex; i >= 0; i--) { - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) { stationIndex--; } @@ -1564,7 +1564,7 @@ static std::optional GetStationIndexFromViewSelection(const rct_wi for (StationIndex index = 0; index < sizeof(ride->stations); ++index) { const auto& station = ride->stations[index]; - if (!station.Start.isNull()) + if (!station.Start.IsNull()) { if (viewSelectionIndex-- == 0) { @@ -1688,7 +1688,7 @@ static void window_ride_init_viewport(rct_window* w) w->viewport_focus_coordinates.height = w->height; // rct2: 0x006aec9c only used here so brought it into the function - if (!w->viewport && !ride->overall_view.isNull()) + if (!w->viewport && !ride->overall_view.IsNull()) { rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT]; @@ -2558,14 +2558,14 @@ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft // Entrance / exit if (ride->status == RideStatus::Closed) { - if (ride_get_entrance_location(ride, static_cast(*stationIndex)).isNull()) + if (ride_get_entrance_location(ride, static_cast(*stationIndex)).IsNull()) stringId = STR_NO_ENTRANCE; - else if (ride_get_exit_location(ride, static_cast(*stationIndex)).isNull()) + else if (ride_get_exit_location(ride, static_cast(*stationIndex)).IsNull()) stringId = STR_NO_EXIT; } else { - if (ride_get_entrance_location(ride, static_cast(*stationIndex)).isNull()) + if (ride_get_entrance_location(ride, static_cast(*stationIndex)).IsNull()) stringId = STR_EXIT_ONLY; } // Queue length diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b1ed717898..8d6c70f41e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2159,7 +2159,7 @@ static std::optional ride_get_place_position_from_screen_position(Scre if (!_trackPlaceCtrlState) { mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) return std::nullopt; _trackPlaceZ = 0; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index d67cfb5dea..c6eb21d957 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -415,7 +415,7 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex) { w->picked_peep_old_x = peep->x; CoordsXYZ nullLoc{}; - nullLoc.setNull(); + nullLoc.SetNull(); PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() }; pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) @@ -1138,7 +1138,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); - if (!mapCoords.isNull()) + if (!mapCoords.IsNull()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; @@ -1185,7 +1185,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, TileElement* tileElement; auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); - if (destCoords.isNull()) + if (destCoords.IsNull()) return; PeepPickupAction pickupAction{ @@ -1203,7 +1203,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, { auto destCoords = footpath_get_coordinates_from_pos(screenCoords, nullptr, nullptr); - if (destCoords.isNull()) + if (destCoords.IsNull()) return; auto staff = TryGetEntity(w->number); @@ -1239,7 +1239,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, auto destCoords = footpath_get_coordinates_from_pos(screenCoords, nullptr, nullptr); - if (destCoords.isNull()) + if (destCoords.IsNull()) return; auto staff = TryGetEntity(w->number); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index e3458544f1..ef633b3bb2 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -552,7 +552,7 @@ private: int32_t direction{}; TileElement* tileElement{}; auto footpathCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement); - if (footpathCoords.isNull()) + if (footpathCoords.IsNull()) return nullptr; auto isPatrolAreaSet = staff_is_patrol_area_set_for_type(GetSelectedStaffType(), footpathCoords); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 3970a94872..e2b01cd018 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1241,7 +1241,7 @@ static void sub_6E1F34_small_scenery( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1269,7 +1269,7 @@ static void sub_6E1F34_small_scenery( auto gridCoords = screen_get_map_xy_quadrant(screenPos, &quadrant); if (!gridCoords) { - gridPos.setNull(); + gridPos.SetNull(); return; } gridPos = *gridCoords; @@ -1283,7 +1283,7 @@ static void sub_6E1F34_small_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1302,7 +1302,7 @@ static void sub_6E1F34_small_scenery( auto mapCoords = screen_get_map_xy_quadrant_with_z(screenPos, z, &quadrant); if (!mapCoords) { - gridPos.setNull(); + gridPos.SetNull(); return; } gridPos = *mapCoords; @@ -1318,7 +1318,7 @@ static void sub_6E1F34_small_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; uint8_t rotation = gWindowSceneryRotation; @@ -1352,7 +1352,7 @@ static void sub_6E1F34_small_scenery( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1366,7 +1366,7 @@ static void sub_6E1F34_small_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1388,7 +1388,7 @@ static void sub_6E1F34_small_scenery( } else { - gridPos.setNull(); + gridPos.SetNull(); } // If SHIFT pressed if (gSceneryShiftPressed) @@ -1401,7 +1401,7 @@ static void sub_6E1F34_small_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; gridPos = gridPos.ToTileStart(); @@ -1431,7 +1431,7 @@ static void sub_6E1F34_path_item( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1445,7 +1445,7 @@ static void sub_6E1F34_path_item( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1464,7 +1464,7 @@ static void sub_6E1F34_wall( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1487,7 +1487,7 @@ static void sub_6E1F34_wall( auto gridCoords = screen_get_map_xy_side(screenPos, &edge); if (!gridCoords) { - gridPos.setNull(); + gridPos.SetNull(); return; } gridPos = *gridCoords; @@ -1501,7 +1501,7 @@ static void sub_6E1F34_wall( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1519,7 +1519,7 @@ static void sub_6E1F34_wall( auto mapCoords = screen_get_map_xy_side_with_z(screenPos, z, &edge); if (!mapCoords) { - gridPos.setNull(); + gridPos.SetNull(); return; } gridPos = *mapCoords; @@ -1535,7 +1535,7 @@ static void sub_6E1F34_wall( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) @@ -1553,7 +1553,7 @@ static void sub_6E1F34_large_scenery( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1580,7 +1580,7 @@ static void sub_6E1F34_large_scenery( const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos); gridPos = mapCoords; - if (gridPos.isNull()) + if (gridPos.IsNull()) return; gSceneryPlaceZ = 0; @@ -1592,7 +1592,7 @@ static void sub_6E1F34_large_scenery( if (surfaceElement == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1614,7 +1614,7 @@ static void sub_6E1F34_large_scenery( } else { - gridPos.setNull(); + gridPos.SetNull(); } // If SHIFT pressed @@ -1628,7 +1628,7 @@ static void sub_6E1F34_large_scenery( gSceneryPlaceZ = z; } - if (gridPos.isNull()) + if (gridPos.IsNull()) return; gridPos = gridPos.ToTileStart(); @@ -1653,7 +1653,7 @@ static void sub_6E1F34_banner( if (w == nullptr) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1667,7 +1667,7 @@ static void sub_6E1F34_banner( if (info.SpriteType == ViewportInteractionItem::None) { - gridPos.setNull(); + gridPos.SetNull(); return; } @@ -1728,7 +1728,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos uint8_t quadrant; Direction rotation; sub_6E1F34_small_scenery(windowPos, selectedScenery, gridPos, &quadrant, &rotation); - if (gridPos.isNull()) + if (gridPos.IsNull()) return; int32_t quantity = 1; @@ -1848,7 +1848,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos { int32_t z; sub_6E1F34_path_item(windowPos, selectedScenery, gridPos, &z); - if (gridPos.isNull()) + if (gridPos.IsNull()) return; auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery + 1); @@ -1867,7 +1867,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos { uint8_t edges; sub_6E1F34_wall(windowPos, selectedScenery, gridPos, &edges); - if (gridPos.isNull()) + if (gridPos.IsNull()) return; uint8_t zAttemptRange = 1; @@ -1919,7 +1919,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos { Direction direction; sub_6E1F34_large_scenery(windowPos, selectedScenery, gridPos, &direction); - if (gridPos.isNull()) + if (gridPos.IsNull()) return; uint8_t zAttemptRange = 1; @@ -1977,7 +1977,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos int32_t z; Direction direction; sub_6E1F34_banner(windowPos, selectedScenery, gridPos, &z, &direction); - if (gridPos.isNull()) + if (gridPos.IsNull()) return; CoordsXYZD loc{ gridPos, z, direction }; @@ -2628,7 +2628,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) sub_6E1F34_small_scenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation); - if (mapTile.isNull()) + if (mapTile.IsNull()) { scenery_remove_ghost_tool_placement(); return; @@ -2706,7 +2706,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) sub_6E1F34_path_item(screenPos, selection.EntryIndex, mapTile, &z); - if (mapTile.isNull()) + if (mapTile.IsNull()) { scenery_remove_ghost_tool_placement(); return; @@ -2741,7 +2741,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) sub_6E1F34_wall(screenPos, selection.EntryIndex, mapTile, &edge); - if (mapTile.isNull()) + if (mapTile.IsNull()) { scenery_remove_ghost_tool_placement(); return; @@ -2796,7 +2796,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) sub_6E1F34_large_scenery(screenPos, selection.EntryIndex, mapTile, &direction); - if (mapTile.isNull()) + if (mapTile.IsNull()) { scenery_remove_ghost_tool_placement(); return; @@ -2863,7 +2863,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) sub_6E1F34_banner(screenPos, selection.EntryIndex, mapTile, &z, &direction); - if (mapTile.isNull()) + if (mapTile.IsNull()) { scenery_remove_ghost_tool_placement(); return; diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 58da05f5bd..ce83d160f7 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -152,7 +152,7 @@ rct_window* window_track_place_open(const track_design_file_ref* tdFileRef) window_push_others_right(w); show_gridlines(); _window_track_place_last_cost = MONEY32_UNDEFINED; - _windowTrackPlaceLast.setNull(); + _windowTrackPlaceLast.SetNull(); _currentTrackPieceDirection = (2 - get_current_rotation()) & 3; window_track_place_clear_mini_preview(); @@ -193,14 +193,14 @@ static void window_track_place_mouseup(rct_window* w, rct_widgetindex widgetInde window_track_place_clear_provisional(); _currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3; w->Invalidate(); - _windowTrackPlaceLast.setNull(); + _windowTrackPlaceLast.SetNull(); window_track_place_draw_mini_preview(_trackDesign.get()); break; case WIDX_MIRROR: track_design_mirror(_trackDesign.get()); _currentTrackPieceDirection = (0 - _currentTrackPieceDirection) & 3; w->Invalidate(); - _windowTrackPlaceLast.setNull(); + _windowTrackPlaceLast.SetNull(); window_track_place_draw_mini_preview(_trackDesign.get()); break; case WIDX_SELECT_DIFFERENT_DESIGN: @@ -259,7 +259,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI // Get the tool map position CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) { window_track_place_clear_provisional(); return; @@ -324,7 +324,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.isNull()) + if (mapCoords.IsNull()) return; // Try increasing Z until a feasible placement is found diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index e3022c3190..94fae3d0ba 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -857,7 +857,7 @@ namespace OpenRCT2 } // Focus camera on event. - if (isPositionValid && !result->Position.isNull()) + if (isPositionValid && !result->Position.IsNull()) { auto* mainWindow = window_get_main(); if (mainWindow != nullptr) diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index adc8606a62..0186df8e7e 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -492,7 +492,7 @@ namespace GameActions network_add_player_money_spent(playerIndex, result->Cost); } - if (!result->Position.isNull()) + if (!result->Position.IsNull()) { network_set_player_last_action_coord(playerIndex, result->Position); } diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index bee844a0e0..db89689ddd 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -43,7 +43,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); } - if (!_loc.isNull() && !LocationValid(_loc)) + if (!_loc.IsNull() && !LocationValid(_loc)) { return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index f142b1729f..bf09c66fe9 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -140,12 +140,12 @@ GameActions::Result::Ptr RideCreateAction::Execute() const ride->type = _rideType; ride->subtype = rideEntryIndex; ride->SetColourPreset(_colour1); - ride->overall_view.setNull(); + ride->overall_view.SetNull(); ride->SetNameToDefault(); for (int32_t i = 0; i < MAX_STATIONS; i++) { - ride->stations[i].Start.setNull(); + ride->stations[i].Start.SetNull(); ride_clear_entrance_location(ride, i); ride_clear_exit_location(ride, i); ride->stations[i].TrainAtStation = RideStation::NO_TRAIN; diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 3591fe98c0..e53af79c82 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -147,7 +147,7 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const res->Expenditure = ExpenditureType::RideConstruction; res->Cost = refundPrice; - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto xy = ride->overall_view.ToTileCentre(); res->Position = { xy, tile_element_height(xy) }; @@ -266,7 +266,7 @@ GameActions::Result::Ptr RideDemolishAction::RefurbishRide(Ride* ride) const ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE | RIDE_INVALIDATE_RIDE_CUSTOMER; - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index df2b87bf2c..fc20629013 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -76,7 +76,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const const auto location = _isExit ? ride_get_exit_location(ride, _stationNum) : ride_get_entrance_location(ride, _stationNum); - if (!location.isNull()) + if (!location.IsNull()) { auto rideEntranceExitRemove = RideEntranceExitRemoveAction(location.ToCoordsXY(), _rideIndex, _stationNum, _isExit); rideEntranceExitRemove.SetFlags(GetFlags()); @@ -143,7 +143,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const } const auto location = _isExit ? ride_get_exit_location(ride, _stationNum) : ride_get_entrance_location(ride, _stationNum); - if (!location.isNull()) + if (!location.IsNull()) { auto rideEntranceExitRemove = RideEntranceExitRemoveAction(location.ToCoordsXY(), _rideIndex, _stationNum, _isExit); rideEntranceExitRemove.SetFlags(GetFlags()); diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 551d1edd5e..53b76ff27a 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -142,7 +142,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const window_invalidate_by_number(WC_RIDE, _rideIndex); auto res = std::make_unique(); - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 374bd4d9a0..caf508d1e0 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -87,7 +87,7 @@ GameActions::Result::Ptr RideSetPriceAction::Execute() const return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index fb7b8d506b..220c0ced3d 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -228,7 +228,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const } auto res = std::make_unique(); - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 2750d639f3..f6cffc84aa 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -131,7 +131,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const Formatter ft(res->ErrorMessageArgs.data()); ft.Increment(6); ride->FormatNameTo(ft); - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 167d2cb0b2..320aeafe12 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -192,7 +192,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const ride->UpdateMaxVehicles(); auto res = std::make_unique(); - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(res->Position) }; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index ab58057ab4..aeb736728c 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -534,7 +534,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } int32_t entranceDirections = 0; - if (!ride->overall_view.isNull()) + if (!ride->overall_view.IsNull()) { if (!(GetFlags() & GAME_COMMAND_FLAG_NO_SPEND)) { @@ -542,7 +542,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } } - if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.isNull()) + if (entranceDirections & TRACK_SEQUENCE_FLAG_ORIGIN || ride->overall_view.IsNull()) { ride->overall_view = mapLoc; } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 3b6fc35b4b..6358d3c650 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -106,7 +106,7 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi // If the start location was invalid // propagate the invalid location to the output. // This fixes a bug that caused the game to enter an infinite loop. - if (loc.isNull()) + if (loc.IsNull()) { return std::nullopt; } diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index c93eabe5af..e9cd6b3147 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -212,7 +212,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s case News::ItemType::Ride: { Ride* ride = get_ride(subject); - if (ride == nullptr || ride->overall_view.isNull()) + if (ride == nullptr || ride->overall_view.IsNull()) { break; } @@ -271,7 +271,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s auto subjectUnsigned = static_cast(subject); auto subjectXY = CoordsXY{ static_cast(subjectUnsigned & 0xFFFF), static_cast(subjectUnsigned >> 16) }; - if (!subjectXY.isNull()) + if (!subjectXY.IsNull()) { subjectLoc = CoordsXYZ{ subjectXY, tile_element_height(subjectXY) }; } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index bcb958d5bc..b1bc71cba3 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -2460,7 +2460,7 @@ static void peep_choose_seat_from_car(Peep* peep, Ride* ride, Vehicle* vehicle) void Guest::GoToRideEntrance(Ride* ride) { TileCoordsXYZD tileLocation = ride_get_entrance_location(ride, CurrentRideStation); - if (tileLocation.isNull()) + if (tileLocation.IsNull()) { RemoveFromQueue(); return; @@ -3550,7 +3550,7 @@ static uint8_t peep_get_waypointed_seat_location( static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) { TileCoordsXYZD entranceLocation = ride_get_entrance_location(ride, peep->CurrentRideStation); - Guard::Assert(!entranceLocation.isNull()); + Guard::Assert(!entranceLocation.IsNull()); uint8_t direction_entrance = entranceLocation.direction; CoordsXY waypoint = ride->stations[peep->CurrentRideStation].Start.ToTileCentre(); @@ -3632,7 +3632,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) { auto entranceLocation = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZD(); - Guard::Assert(!entranceLocation.isNull()); + Guard::Assert(!entranceLocation.IsNull()); if (ride->type == RIDE_TYPE_MAZE) { @@ -3744,7 +3744,7 @@ static void peep_go_to_ride_exit(Peep* peep, Ride* ride, int16_t x, int16_t y, i Guard::Assert(peep->CurrentRideStation < MAX_STATIONS); auto exit = ride_get_exit_location(ride, peep->CurrentRideStation); - Guard::Assert(!exit.isNull()); + Guard::Assert(!exit.IsNull()); x = exit.x; y = exit.y; x *= 32; @@ -4210,7 +4210,7 @@ void Guest::UpdateRideLeaveVehicle() } auto exitLocation = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXYZD(); - Guard::Assert(!exitLocation.isNull()); + Guard::Assert(!exitLocation.IsNull()); auto waypointLoc = CoordsXYZ{ ride->stations[CurrentRideStation].Start.ToTileCentre(), exitLocation.z + ride->GetRideTypeDescriptor().Heights.PlatformHeight }; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 8a2f474810..708aa59be2 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -1400,7 +1400,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) // Clear pathfinding history TileCoordsXYZD nullPos; - nullPos.setNull(); + nullPos.SetNull(); std::fill(std::begin(peep->PathfindHistory), std::end(peep->PathfindHistory), nullPos); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 @@ -1461,7 +1461,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) for (auto& entry : _peepPathFindHistory) { - entry.location.setNull(); + entry.location.SetNull(); entry.direction = INVALID_DIRECTION; } @@ -2185,7 +2185,7 @@ int32_t guest_path_finding(Guest* peep) for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; ++stationNum) { // Skip if stationNum has no entrance (so presumably an exit only station) - if (ride_get_entrance_location(ride, stationNum).isNull()) + if (ride_get_entrance_location(ride, stationNum).IsNull()) continue; numEntranceStations++; @@ -2303,7 +2303,7 @@ void Peep::ResetPathfindGoal() } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 - PathfindGoal.setNull(); + PathfindGoal.SetNull(); PathfindGoal.direction = INVALID_DIRECTION; } diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 423290e8fa..3cf1d8dafe 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -712,7 +712,7 @@ Direction Staff::MechanicDirectionSurface() const if (ride != nullptr && (State == PeepState::Answering || State == PeepState::HeadingToInspection) && (scenario_rand() & 1)) { auto location = ride_get_exit_location(ride, CurrentRideStation); - if (location.isNull()) + if (location.IsNull()) { location = ride_get_entrance_location(ride, CurrentRideStation); } @@ -793,12 +793,12 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat /* Find location of the exit for the target ride station * or if the ride has no exit, the entrance. */ TileCoordsXYZD location = ride_get_exit_location(ride, CurrentRideStation); - if (location.isNull()) + if (location.IsNull()) { location = ride_get_entrance_location(ride, CurrentRideStation); // If no entrance is present either. This is an incorrect state. - if (location.isNull()) + if (location.IsNull()) { return MechanicDirectionPathRand(pathDirections); } @@ -1380,7 +1380,7 @@ void Staff::UpdateHeadingToInspect() return; } - if (ride_get_exit_location(ride, CurrentRideStation).isNull()) + if (ride_get_exit_location(ride, CurrentRideStation).IsNull()) { ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; SetState(PeepState::Falling); @@ -1435,7 +1435,7 @@ void Staff::UpdateHeadingToInspect() if (pathingResult & PATHING_RIDE_ENTRANCE) { - if (!ride_get_exit_location(ride, exit_index).isNull()) + if (!ride_get_exit_location(ride, exit_index).IsNull()) { return; } @@ -1542,7 +1542,7 @@ void Staff::UpdateAnswering() if (pathingResult & PATHING_RIDE_ENTRANCE) { - if (!ride_get_exit_location(ride, exit_index).isNull()) + if (!ride_get_exit_location(ride, exit_index).IsNull()) { return; } @@ -2275,7 +2275,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride) } auto stationPos = ride->stations[CurrentRideStation].GetStart(); - if (stationPos.isNull()) + if (stationPos.IsNull()) { return true; } @@ -2361,7 +2361,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride) } auto stationPosition = ride->stations[CurrentRideStation].GetStart(); - if (stationPosition.isNull()) + if (stationPosition.IsNull()) { return true; } @@ -2505,11 +2505,11 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride) if (!firstRun) { auto stationPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY(); - if (stationPosition.isNull()) + if (stationPosition.IsNull()) { stationPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY(); - if (stationPosition.isNull()) + if (stationPosition.IsNull()) { return true; } @@ -2587,11 +2587,11 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride) if (!firstRun) { auto exitPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY(); - if (exitPosition.isNull()) + if (exitPosition.IsNull()) { exitPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY(); - if (exitPosition.isNull()) + if (exitPosition.IsNull()) { SetState(PeepState::Falling); return false; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index efcdeb95d3..436fc72c41 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -773,9 +773,9 @@ namespace RCT1 } // Station - if (src->overall_view.isNull()) + if (src->overall_view.IsNull()) { - dst->overall_view.setNull(); + dst->overall_view.SetNull(); } else { @@ -784,9 +784,9 @@ namespace RCT1 for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) { - if (src->station_starts[i].isNull()) + if (src->station_starts[i].IsNull()) { - dst->stations[i].Start.setNull(); + dst->stations[i].Start.SetNull(); } else { @@ -800,13 +800,13 @@ namespace RCT1 dst->stations[i].TrainAtStation = src->station_depart[i]; // Direction is fixed later. - if (src->entrance[i].isNull()) + if (src->entrance[i].IsNull()) ride_clear_entrance_location(dst, i); else ride_set_entrance_location( dst, i, { src->entrance[i].x, src->entrance[i].y, src->station_height[i] / 2, 0 }); - if (src->exit[i].isNull()) + if (src->exit[i].IsNull()) ride_clear_exit_location(dst, i); else ride_set_exit_location(dst, i, { src->exit[i].x, src->exit[i].y, src->station_height[i] / 2, 0 }); @@ -821,7 +821,7 @@ namespace RCT1 // All other values take 0 as their default. Since they're already memset to that, no need to do it again. for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++) { - dst->stations[i].Start.setNull(); + dst->stations[i].Start.SetNull(); dst->stations[i].TrainAtStation = RideStation::NO_TRAIN; ride_clear_entrance_location(dst, i); ride_clear_exit_location(dst, i); @@ -951,9 +951,9 @@ namespace RCT1 src->chairlift_bullwheel_z[i] / 2 }; } - if (src->cur_test_track_location.isNull()) + if (src->cur_test_track_location.IsNull()) { - dst->CurTestTrackLocation.setNull(); + dst->CurTestTrackLocation.SetNull(); } else { @@ -2748,9 +2748,9 @@ namespace RCT1 dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; dst->TrackLocation = { src->track_x, src->track_y, src->track_z }; dst->current_station = src->current_station; - if (src->boat_location.isNull() || ride->mode != RideMode::BoatHire || statusSrc != ::Vehicle::Status::TravellingBoat) + if (src->boat_location.IsNull() || ride->mode != RideMode::BoatHire || statusSrc != ::Vehicle::Status::TravellingBoat) { - dst->BoatLocation.setNull(); + dst->BoatLocation.SetNull(); dst->SetTrackDirection(src->GetTrackDirection()); dst->SetTrackType(RCT1TrackTypeToOpenRCT2(src->GetTrackType(), ride->type)); } diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 94d4368330..418b3f08a6 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -199,12 +199,12 @@ struct RCT12xy8 uint16_t xy; }; - bool isNull() const + bool IsNull() const { return xy == RCT12_XY8_UNDEFINED; } - void setNull() + void SetNull() { xy = RCT12_XY8_UNDEFINED; } diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index c8394c5fd0..2cffe9bc09 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -670,9 +670,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) dst->name_arguments_number = src->default_name_number; } - if (src->overall_view.isNull()) + if (src->overall_view.IsNull()) { - dst->overall_view.setNull(); + dst->overall_view.SetNull(); } else { @@ -682,9 +682,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) { - if (src->stations[i].Start.isNull()) + if (src->stations[i].Start.IsNull()) { - dst->station_starts[i].setNull(); + dst->station_starts[i].SetNull(); } else { @@ -697,14 +697,14 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) dst->train_at_station[i] = src->stations[i].TrainAtStation; TileCoordsXYZD entrance = ride_get_entrance_location(src, i); - if (entrance.isNull()) - dst->entrances[i].setNull(); + if (entrance.IsNull()) + dst->entrances[i].SetNull(); else dst->entrances[i] = { static_cast(entrance.x), static_cast(entrance.y) }; TileCoordsXYZD exit = ride_get_exit_location(src, i); - if (exit.isNull()) - dst->exits[i].setNull(); + if (exit.IsNull()) + dst->exits[i].SetNull(); else dst->exits[i] = { static_cast(exit.x), static_cast(exit.y) }; @@ -760,9 +760,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) // pad_106[0x2]; dst->testing_flags = src->testing_flags; - if (src->CurTestTrackLocation.isNull()) + if (src->CurTestTrackLocation.IsNull()) { - dst->cur_test_track_location.setNull(); + dst->cur_test_track_location.SetNull(); } else { @@ -1230,9 +1230,9 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle* dst->track_progress = src->track_progress; if (ride != nullptr && ride->mode == RideMode::BoatHire && src->status == Vehicle::Status::TravellingBoat) { - if (src->BoatLocation.isNull()) + if (src->BoatLocation.IsNull()) { - dst->boat_location.setNull(); + dst->boat_location.SetNull(); } else { @@ -1473,7 +1473,7 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src) dst->id = src->Id; dst->path_check_optimisation = src->PathCheckOptimisation; dst->peep_flags = src->PeepFlags; - if (src->PathfindGoal.isNull()) + if (src->PathfindGoal.IsNull()) { dst->pathfind_goal = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION }; } @@ -1484,7 +1484,7 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src) } for (size_t i = 0; i < std::size(src->PathfindHistory); i++) { - if (src->PathfindHistory[i].isNull()) + if (src->PathfindHistory[i].IsNull()) { dst->pathfind_history[i] = { 0xFF, 0xFF, 0xFF, INVALID_DIRECTION }; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 3a7d792448..5510056d77 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -582,9 +582,9 @@ public: dst->default_name_number = src->name_arguments_number; } - if (src->overall_view.isNull()) + if (src->overall_view.IsNull()) { - dst->overall_view.setNull(); + dst->overall_view.SetNull(); } else { @@ -594,9 +594,9 @@ public: for (int32_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) { - if (src->station_starts[i].isNull()) + if (src->station_starts[i].IsNull()) { - dst->stations[i].Start.setNull(); + dst->stations[i].Start.SetNull(); } else { @@ -609,12 +609,12 @@ public: dst->stations[i].TrainAtStation = src->train_at_station[i]; // Direction is fixed later. - if (src->entrances[i].isNull()) + if (src->entrances[i].IsNull()) ride_clear_entrance_location(dst, i); else ride_set_entrance_location(dst, i, { src->entrances[i].x, src->entrances[i].y, src->station_heights[i], 0 }); - if (src->exits[i].isNull()) + if (src->exits[i].IsNull()) ride_clear_exit_location(dst, i); else ride_set_exit_location(dst, i, { src->exits[i].x, src->exits[i].y, src->station_heights[i], 0 }); @@ -631,7 +631,7 @@ public: // All other values take 0 as their default. Since they're already memset to that, no need to do it again. for (int32_t i = RCT12_MAX_STATIONS_PER_RIDE; i < MAX_STATIONS; i++) { - dst->stations[i].Start.setNull(); + dst->stations[i].Start.SetNull(); dst->stations[i].TrainAtStation = RideStation::NO_TRAIN; ride_clear_entrance_location(dst, i); ride_clear_exit_location(dst, i); @@ -683,9 +683,9 @@ public: // pad_106[0x2]; dst->testing_flags = src->testing_flags; - if (src->cur_test_track_location.isNull()) + if (src->cur_test_track_location.IsNull()) { - dst->CurTestTrackLocation.setNull(); + dst->CurTestTrackLocation.SetNull(); } else { @@ -1445,7 +1445,7 @@ public: dst->PeepFlags = src->peep_flags; if (isNullLocation(src->pathfind_goal)) { - dst->PathfindGoal.setNull(); + dst->PathfindGoal.SetNull(); dst->PathfindGoal.direction = INVALID_DIRECTION; } else @@ -1457,7 +1457,7 @@ public: { if (isNullLocation(src->pathfind_history[i])) { - dst->PathfindHistory[i].setNull(); + dst->PathfindHistory[i].SetNull(); dst->PathfindHistory[i].direction = INVALID_DIRECTION; } else @@ -1602,10 +1602,10 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->colours = src->colours; dst->track_progress = src->track_progress; dst->TrackLocation = { src->track_x, src->track_y, src->track_z }; - if (src->boat_location.isNull() || static_cast(ride.mode) != RideMode::BoatHire + if (src->boat_location.IsNull() || static_cast(ride.mode) != RideMode::BoatHire || src->status != static_cast(Vehicle::Status::TravellingBoat)) { - dst->BoatLocation.setNull(); + dst->BoatLocation.SetNull(); dst->SetTrackDirection(src->GetTrackDirection()); dst->SetTrackType(src->GetTrackType()); // RotationControlToggle and Booster are saved as the same track piece ID diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 92d9bc43a2..a42310440b 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -77,7 +77,7 @@ Vehicle* cable_lift_segment_create( current->SetState(Vehicle::Status::MovingToEndOfStation, 0); current->num_peeps = 0; current->next_free_seat = 0; - current->BoatLocation.setNull(); + current->BoatLocation.SetNull(); current->IsCrashedVehicle = false; return current; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 62dee8b349..833a6c3250 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -251,7 +251,7 @@ int32_t Ride::GetTotalQueueLength() const { int32_t i, queueLength = 0; for (i = 0; i < MAX_STATIONS; i++) - if (!ride_get_entrance_location(this, i).isNull()) + if (!ride_get_entrance_location(this, i).IsNull()) queueLength += stations[i].QueueLength; return queueLength; } @@ -260,7 +260,7 @@ int32_t Ride::GetMaxQueueTime() const { uint8_t i, queueTime = 0; for (i = 0; i < MAX_STATIONS; i++) - if (!ride_get_entrance_location(this, i).isNull()) + if (!ride_get_entrance_location(this, i).IsNull()) queueTime = std::max(queueTime, stations[i].QueueTime); return static_cast(queueTime); } @@ -1166,7 +1166,7 @@ void Ride::UpdateSpiralSlide() // Invalidate something related to station start for (int32_t i = 0; i < MAX_STATIONS; i++) { - if (stations[i].Start.isNull()) + if (stations[i].Start.IsNull()) continue; auto startLoc = stations[i].Start; @@ -1647,10 +1647,10 @@ Staff* ride_find_closest_mechanic(Ride* ride, int32_t forInspection) // Get either exit position or entrance position if there is no exit auto stationIndex = ride->inspection_station; TileCoordsXYZD location = ride_get_exit_location(ride, stationIndex); - if (location.isNull()) + if (location.IsNull()) { location = ride_get_entrance_location(ride, stationIndex); - if (location.isNull()) + if (location.IsNull()) return nullptr; } @@ -2155,7 +2155,7 @@ void ride_check_all_reachable() */ static bool ride_entrance_exit_is_reachable(const TileCoordsXYZD& coordinates) { - if (coordinates.isNull()) + if (coordinates.IsNull()) return true; TileCoordsXYZ loc{ coordinates.x, coordinates.y, coordinates.z }; @@ -2172,9 +2172,9 @@ static void ride_entrance_exit_connected(Ride* ride) auto entrance = ride_get_entrance_location(ride, i); auto exit = ride_get_exit_location(ride, i); - if (station_start.isNull()) + if (station_start.IsNull()) continue; - if (!entrance.isNull() && !ride_entrance_exit_is_reachable(entrance)) + if (!entrance.IsNull() && !ride_entrance_exit_is_reachable(entrance)) { // name of ride is parameter of the format string Formatter ft; @@ -2186,7 +2186,7 @@ static void ride_entrance_exit_connected(Ride* ride) ride->connected_message_throttle = 3; } - if (!exit.isNull() && !ride_entrance_exit_is_reachable(exit)) + if (!exit.IsNull() && !ride_entrance_exit_is_reachable(exit)) { // name of ride is parameter of the format string Formatter ft; @@ -2203,7 +2203,7 @@ static void ride_entrance_exit_connected(Ride* ride) static void ride_shop_connected(Ride* ride) { auto shopLoc = TileCoordsXY(ride->stations[0].Start); - if (shopLoc.isNull()) + if (shopLoc.IsNull()) return; TrackElement* trackElement = nullptr; @@ -2312,7 +2312,7 @@ static void ride_station_set_map_tooltip(TileElement* tileElement) { auto stationIndex = tileElement->AsTrack()->GetStationIndex(); for (int32_t i = stationIndex; i >= 0; i--) - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) stationIndex--; auto ft = Formatter(); @@ -2337,14 +2337,14 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) // Get the station auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); for (int32_t i = stationIndex; i >= 0; i--) - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) stationIndex--; if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) { // Get the queue length int32_t queueLength = 0; - if (!ride_get_entrance_location(ride, stationIndex).isNull()) + if (!ride_get_entrance_location(ride, stationIndex).IsNull()) queueLength = ride->stations[stationIndex].QueueLength; auto ft = Formatter(); @@ -2378,7 +2378,7 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) // Get the station stationIndex = tileElement->AsEntrance()->GetStationIndex(); for (int32_t i = stationIndex; i >= 0; i--) - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) stationIndex--; auto ft = Formatter(); @@ -2430,7 +2430,7 @@ static StationIndex ride_mode_check_valid_station_numbers(Ride* ride) uint16_t numStations = 0; for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; ++stationIndex) { - if (!ride->stations[stationIndex].Start.isNull()) + if (!ride->stations[stationIndex].Start.IsNull()) { numStations++; } @@ -2510,22 +2510,22 @@ static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex) uint8_t exit = 0; for (int32_t i = 0; i < MAX_STATIONS; i++) { - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) continue; - if (!ride_get_entrance_location(ride, i).isNull()) + if (!ride_get_entrance_location(ride, i).IsNull()) { entrance = 1; } - if (!ride_get_exit_location(ride, i).isNull()) + if (!ride_get_exit_location(ride, i).IsNull()) { exit = 1; } // If station start and no entrance/exit // Sets same error message as no entrance - if (ride_get_exit_location(ride, i).isNull() && ride_get_entrance_location(ride, i).isNull()) + if (ride_get_exit_location(ride, i).IsNull() && ride_get_entrance_location(ride, i).IsNull()) { entrance = 0; break; @@ -2556,7 +2556,7 @@ void Ride::ChainQueues() const for (int32_t i = 0; i < MAX_STATIONS; i++) { auto location = ride_get_entrance_location(this, i); - if (location.isNull()) + if (location.IsNull()) continue; auto mapLocation = location.ToCoordsXYZ(); @@ -2892,19 +2892,19 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) const auto entrance = ride_get_entrance_location(ride, i); const auto exit = ride_get_exit_location(ride, i); - if (!entrance.isNull()) + if (!entrance.IsNull()) { *position++ = entrance; } - if (!exit.isNull()) + if (!exit.IsNull()) { *position++ = exit; } } - (*position++).setNull(); + (*position++).SetNull(); // Enumerate entrance and exit positions - for (position = positions; !(*position).isNull(); position++) + for (position = positions; !(*position).IsNull(); position++) { auto entranceExitMapPos = position->ToCoordsXYZ(); @@ -3211,7 +3211,7 @@ static Vehicle* vehicle_create_car( // loc_6DDD5E: vehicle->num_peeps = 0; vehicle->next_free_seat = 0; - vehicle->BoatLocation.setNull(); + vehicle->BoatLocation.SetNull(); vehicle->IsCrashedVehicle = false; return vehicle; } @@ -3525,7 +3525,7 @@ static bool ride_initialise_cable_lift_track(Ride* ride, bool isApplying) for (StationIndex stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++) { location = ride->stations[stationIndex].GetStart(); - if (!location.isNull()) + if (!location.IsNull()) break; if (stationIndex == (MAX_STATIONS - 1)) { @@ -3709,16 +3709,16 @@ void Ride::ConstructMissingEntranceOrExit() const int32_t i; for (i = 0; i < MAX_STATIONS; i++) { - if (stations[i].Start.isNull()) + if (stations[i].Start.IsNull()) continue; - if (ride_get_entrance_location(this, i).isNull()) + if (ride_get_entrance_location(this, i).IsNull()) { entranceOrExit = WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE; break; } - if (ride_get_exit_location(this, i).isNull()) + if (ride_get_exit_location(this, i).IsNull()) { entranceOrExit = WC_RIDE_CONSTRUCTION__WIDX_EXIT; break; @@ -4848,7 +4848,7 @@ static std::optional ride_get_smallest_station_length(Ride* ride) std::optional result; for (const auto& station : ride->stations) { - if (!station.Start.isNull()) + if (!station.Start.IsNull()) { if (!result.has_value() || station.Length < *result) { @@ -4873,7 +4873,7 @@ static int32_t ride_get_track_length(Ride* ride) for (int32_t i = 0; i < MAX_STATIONS && !foundTrack; i++) { trackStart = ride->stations[i].GetStart(); - if (trackStart.isNull()) + if (trackStart.IsNull()) continue; tileElement = map_get_first_element_at(trackStart); @@ -5334,7 +5334,7 @@ bool ride_has_adjacent_station(Ride* ride) for (StationIndex stationNum = 0; stationNum < MAX_STATIONS; stationNum++) { auto stationStart = ride->stations[stationNum].GetStart(); - if (!stationStart.isNull()) + if (!stationStart.IsNull()) { /* Get the map element for the station start. */ TileElement* stationElement = get_station_platform({ stationStart, stationStart.z + 0 }); @@ -5509,7 +5509,7 @@ void determine_ride_entrance_and_exit_locations() bool fixExit = false; // Skip if the station has no entrance - if (!entranceLoc.isNull()) + if (!entranceLoc.IsNull()) { const EntranceElement* entranceElement = map_get_ride_entrance_element_at(entranceLoc.ToCoordsXYZD(), false); @@ -5524,7 +5524,7 @@ void determine_ride_entrance_and_exit_locations() } } - if (!exitLoc.isNull()) + if (!exitLoc.IsNull()) { const EntranceElement* entranceElement = map_get_ride_exit_element_at(exitLoc.ToCoordsXYZD(), false); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index bc3f30dc8e..d0e06c9a88 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -258,7 +258,7 @@ void ride_remove_peeps(Ride* ride) if (stationIndex != STATION_INDEX_NULL) { auto location = ride_get_exit_location(ride, stationIndex).ToCoordsXYZD(); - if (!location.isNull()) + if (!location.IsNull()) { auto direction = direction_reverse(location.direction); exitPosition = location; @@ -1274,7 +1274,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto ride = get_ride(gRideEntranceExitPlaceRideIndex); if (ride == nullptr) { - entranceExitCoords.setNull(); + entranceExitCoords.SetNull(); return entranceExitCoords; } @@ -1283,7 +1283,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto coordsAtHeight = screen_get_map_xy_with_z(screenCoords, stationBaseZ); if (!coordsAtHeight) { - entranceExitCoords.setNull(); + entranceExitCoords.SetNull(); return entranceExitCoords; } @@ -1291,14 +1291,14 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (ride->type == RIDE_TYPE_NULL) { - entranceExitCoords.setNull(); + entranceExitCoords.SetNull(); return entranceExitCoords; } auto stationStart = ride->stations[gRideEntranceExitPlaceStationIndex].Start; - if (stationStart.isNull()) + if (stationStart.IsNull()) { - entranceExitCoords.setNull(); + entranceExitCoords.SetNull(); return entranceExitCoords; } @@ -1377,7 +1377,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); if (tileElement == nullptr) { - entranceExitCoords.setNull(); + entranceExitCoords.SetNull(); return entranceExitCoords; } auto stationDirection = tileElement->GetDirection(); @@ -1443,7 +1443,7 @@ void Ride::ValidateStations() // find the stations of the ride to begin stepping over track elements from for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) { - if (stations[stationId].Start.isNull()) + if (stations[stationId].Start.IsNull()) continue; CoordsXYZ location = stations[stationId].GetStart(); @@ -1550,14 +1550,14 @@ void Ride::ValidateStations() for (StationIndex stationId = 0; stationId < MAX_STATIONS; ++stationId) { auto entrance = ride_get_entrance_location(this, stationId); - if (!entrance.isNull()) + if (!entrance.IsNull()) { locations.push_back(entrance); ride_clear_entrance_location(this, stationId); } auto exit = ride_get_exit_location(this, stationId); - if (!exit.isNull()) + if (!exit.IsNull()) { locations.push_back(exit); ride_clear_exit_location(this, stationId); @@ -1645,7 +1645,7 @@ void Ride::ValidateStations() if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) { // if the location is already set for this station, big problem! - if (!ride_get_exit_location(this, stationId).isNull()) + if (!ride_get_exit_location(this, stationId).IsNull()) break; // set the station's exit location to this one CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; @@ -1654,7 +1654,7 @@ void Ride::ValidateStations() else { // if the location is already set for this station, big problem! - if (!ride_get_entrance_location(this, stationId).isNull()) + if (!ride_get_entrance_location(this, stationId).IsNull()) break; // set the station's entrance location to this one CoordsXYZD loc = { location, stations[stationId].GetBaseZ(), tileElement->GetDirection() }; @@ -1738,16 +1738,16 @@ bool ride_are_all_possible_entrances_and_exits_built(Ride* ride) for (int32_t i = 0; i < MAX_STATIONS; i++) { - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) { continue; } - if (ride_get_entrance_location(ride, i).isNull()) + if (ride_get_entrance_location(ride, i).IsNull()) { gGameCommandErrorText = STR_ENTRANCE_NOT_YET_BUILT; return false; } - if (ride_get_exit_location(ride, i).isNull()) + if (ride_get_exit_location(ride, i).IsNull()) { gGameCommandErrorText = STR_EXIT_NOT_YET_BUILT; return false; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 308a2f6528..515e710c43 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -237,7 +237,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) { int32_t entranceIndex = tileElement->AsTrack()->GetStationIndex(); state.StationFlags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE; - if (ride_get_entrance_location(ride, entranceIndex).isNull()) + if (ride_get_entrance_location(ride, entranceIndex).IsNull()) { state.StationFlags |= RIDE_RATING_STATION_FLAG_NO_ENTRANCE; } @@ -386,10 +386,10 @@ static void ride_ratings_begin_proximity_loop(RideRatingUpdateState& state) for (int32_t i = 0; i < MAX_STATIONS; i++) { - if (!ride->stations[i].Start.isNull()) + if (!ride->stations[i].Start.IsNull()) { state.StationFlags &= ~RIDE_RATING_STATION_FLAG_NO_ENTRANCE; - if (ride_get_entrance_location(ride, i).isNull()) + if (ride_get_entrance_location(ride, i).IsNull()) { state.StationFlags |= RIDE_RATING_STATION_FLAG_NO_ENTRANCE; } diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index f62414cb19..ec38c94a0e 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -29,7 +29,7 @@ static void ride_invalidate_station_start(Ride* ride, StationIndex stationIndex, */ void ride_update_station(Ride* ride, StationIndex stationIndex) { - if (ride->stations[stationIndex].Start.isNull()) + if (ride->stations[stationIndex].Start.IsNull()) return; switch (ride->mode) @@ -367,7 +367,7 @@ StationIndex ride_get_first_valid_station_exit(Ride* ride) { for (StationIndex i = 0; i < MAX_STATIONS; i++) { - if (!ride->stations[i].Exit.isNull()) + if (!ride->stations[i].Exit.IsNull()) { return i; } @@ -379,7 +379,7 @@ StationIndex ride_get_first_valid_station_start(const Ride* ride) { for (StationIndex i = 0; i < MAX_STATIONS; i++) { - if (!ride->stations[i].Start.isNull()) + if (!ride->stations[i].Start.IsNull()) { return i; } @@ -391,7 +391,7 @@ StationIndex ride_get_first_empty_station_start(const Ride* ride) { for (StationIndex i = 0; i < MAX_STATIONS; i++) { - if (ride->stations[i].Start.isNull()) + if (ride->stations[i].Start.IsNull()) { return i; } @@ -411,12 +411,12 @@ TileCoordsXYZD ride_get_exit_location(const Ride* ride, const StationIndex stati void ride_clear_entrance_location(Ride* ride, const StationIndex stationIndex) { - ride->stations[stationIndex].Entrance.setNull(); + ride->stations[stationIndex].Entrance.SetNull(); } void ride_clear_exit_location(Ride* ride, const StationIndex stationIndex) { - ride->stations[stationIndex].Exit.setNull(); + ride->stations[stationIndex].Exit.SetNull(); } void ride_set_entrance_location(Ride* ride, const StationIndex stationIndex, const TileCoordsXYZD& location) diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 0c5aaf3a05..e27ee73ed0 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -100,7 +100,7 @@ static void ride_remove_station(Ride* ride, const CoordsXYZ& location) auto stationStart = ride->stations[i].GetStart(); if (stationStart == location) { - ride->stations[i].Start.setNull(); + ride->stations[i].Start.SetNull(); ride->num_stations--; break; } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 33bf8c9732..a8d3f0aa67 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -265,7 +265,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) location = ride_get_exit_location(&ride, station_index); } - if (location.isNull()) + if (location.IsNull()) { continue; } @@ -379,7 +379,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) } auto location = ride_get_entrance_location(&ride, 0); - if (location.isNull()) + if (location.IsNull()) { return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; } @@ -408,7 +408,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) maze_elements.push_back(mazeEntrance); location = ride_get_exit_location(&ride, 0); - if (location.isNull()) + if (location.IsNull()) { return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 369f6121a0..659d40b00c 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1607,7 +1607,7 @@ void Vehicle::UpdateMeasurements() if (curRide->current_test_station == STATION_INDEX_NULL) return; - if (!ride_get_entrance_location(curRide, curRide->current_test_station).isNull()) + if (!ride_get_entrance_location(curRide, curRide->current_test_station).IsNull()) { uint8_t test_segment = curRide->current_test_segment; @@ -1666,7 +1666,7 @@ void Vehicle::UpdateMeasurements() { curRide->CurTestTrackLocation = curTrackLoc; - if (ride_get_entrance_location(curRide, curRide->current_test_station).isNull()) + if (ride_get_entrance_location(curRide, curRide->current_test_station).IsNull()) return; auto trackElemType = GetTrackType(); @@ -1882,7 +1882,7 @@ void Vehicle::UpdateMeasurements() } } - if (ride_get_entrance_location(curRide, curRide->current_test_station).isNull()) + if (ride_get_entrance_location(curRide, curRide->current_test_station).IsNull()) return; if (x == LOCATION_NULL) @@ -2332,7 +2332,7 @@ void Vehicle::UpdateWaitingForPassengers() if (!OpenRestraints()) return; - if (ride_get_entrance_location(curRide, current_station).isNull()) + if (ride_get_entrance_location(curRide, current_station).IsNull()) { curRide->stations[current_station].TrainAtStation = RideStation::NO_TRAIN; sub_state = 2; @@ -2568,7 +2568,7 @@ void Vehicle::UpdateWaitingToDepart() } else { - if (!ride_get_exit_location(curRide, current_station).isNull()) + if (!ride_get_exit_location(curRide, current_station).IsNull()) { SetState(Vehicle::Status::UnloadingPassengers); return; @@ -2582,7 +2582,7 @@ void Vehicle::UpdateWaitingToDepart() { if (trainCar->num_peeps != 0) { - if (!ride_get_exit_location(curRide, current_station).isNull()) + if (!ride_get_exit_location(curRide, current_station).IsNull()) { SetState(Vehicle::Status::UnloadingPassengers); return; @@ -3144,7 +3144,7 @@ static void test_reset(Ride& ride, StationIndex curStation) ride.previous_vertical_g = 0; ride.previous_lateral_g = 0; ride.testing_flags = 0; - ride.CurTestTrackLocation.setNull(); + ride.CurTestTrackLocation.SetNull(); ride.turn_count_default = 0; ride.turn_count_banked = 0; ride.turn_count_sloped = 0; @@ -4200,7 +4200,7 @@ void Vehicle::UpdateUnloadingPassengers() } else { - if (ride_get_exit_location(curRide, current_station).isNull()) + if (ride_get_exit_location(curRide, current_station).IsNull()) { if (sub_state != 1) return; @@ -4388,7 +4388,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const { SetTrackType(trackElement->GetTrackType()); SetTrackDirection(curRide->boat_hire_return_direction); - BoatLocation.setNull(); + BoatLocation.SetNull(); } track_progress = 0; diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index de51173220..a168c2bb5c 100644 --- a/src/openrct2/scripting/Duktape.hpp +++ b/src/openrct2/scripting/Duktape.hpp @@ -341,7 +341,7 @@ namespace OpenRCT2::Scripting template<> inline DukValue ToDuk(duk_context* ctx, const CoordsXYZ& value) { - if (value.isNull()) + if (value.IsNull()) { return ToDuk(ctx, nullptr); } @@ -366,14 +366,14 @@ namespace OpenRCT2::Scripting } else { - result.setNull(); + result.SetNull(); } return result; } template<> inline DukValue ToDuk(duk_context* ctx, const CoordsXYZD& value) { - if (value.isNull()) + if (value.IsNull()) { return ToDuk(ctx, nullptr); } @@ -408,7 +408,7 @@ namespace OpenRCT2::Scripting } else { - result.setNull(); + result.SetNull(); } return result; } diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index caf284513b..4b127d5a69 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -878,7 +878,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std { obj.Set("cost", result->Cost); } - if (!result->Position.isNull()) + if (!result->Position.IsNull()) { obj.Set("position", ToDuk(_context, result->Position)); } diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 1d276df688..10d704a732 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -221,7 +221,7 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) continue; auto rideCoords = ride.overall_view; - if (rideCoords.isNull()) + if (rideCoords.IsNull()) continue; int32_t distance = abs(mapPos.x - rideCoords.x) + abs(mapPos.y - rideCoords.y); diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index a1452df224..c691b7d521 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -246,7 +246,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i if (window == nullptr || window->viewport == nullptr) { CoordsXY position{}; - position.setNull(); + position.SetNull(); return position; } auto viewport = window->viewport; @@ -259,7 +259,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i if (info.SpriteType == ViewportInteractionItem::None) { auto position = info.Loc; - position.setNull(); + position.SetNull(); return position; } } @@ -344,7 +344,7 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i if (window == nullptr || window->viewport == nullptr) { CoordsXY ret{}; - ret.setNull(); + ret.SetNull(); return ret; } auto viewport = window->viewport; @@ -1221,7 +1221,7 @@ void footpath_update_queue_chains() for (int32_t i = 0; i < MAX_STATIONS; i++) { TileCoordsXYZD location = ride_get_entrance_location(ride, i); - if (location.isNull()) + if (location.IsNull()) continue; TileElement* tileElement = map_get_first_element_at(location.ToCoordsXY()); diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index c9f90a921b..55855570fc 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -215,12 +215,12 @@ struct CoordsXY return { floor2(x, COORDS_XY_STEP), floor2(y, COORDS_XY_STEP) }; } - constexpr bool isNull() const + constexpr bool IsNull() const { return x == COORDS_NULL; }; - constexpr void setNull() + constexpr void SetNull() { x = COORDS_NULL; y = 0; @@ -269,9 +269,9 @@ struct CoordsXYZ : public CoordsXY return ToTileStart() + CoordsXYZ{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0 }; } - constexpr void setNull() + constexpr void SetNull() { - CoordsXY::setNull(); + CoordsXY::SetNull(); z = 0; } }; @@ -343,10 +343,10 @@ struct TileCoordsXY constexpr CoordsXY ToCoordsXY() const { - if (isNull()) + if (IsNull()) { CoordsXY ret{}; - ret.setNull(); + ret.SetNull(); return ret; } @@ -390,12 +390,12 @@ struct TileCoordsXY return !(*this == other); } - constexpr bool isNull() const + constexpr bool IsNull() const { return x == COORDS_NULL; }; - constexpr void setNull() + constexpr void SetNull() { x = COORDS_NULL; y = 0; @@ -457,18 +457,18 @@ struct TileCoordsXYZ : public TileCoordsXY constexpr CoordsXYZ ToCoordsXYZ() const { - if (isNull()) + if (IsNull()) { CoordsXYZ ret{}; - ret.setNull(); + ret.SetNull(); return ret; } return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP }; } - constexpr void setNull() + constexpr void SetNull() { - TileCoordsXY::setNull(); + TileCoordsXY::SetNull(); z = 0; } }; @@ -667,18 +667,18 @@ struct TileCoordsXYZD : public TileCoordsXYZ constexpr CoordsXYZD ToCoordsXYZD() const { - if (isNull()) + if (IsNull()) { CoordsXYZD ret{}; - ret.setNull(); + ret.SetNull(); return ret; } return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction }; } - constexpr void setNull() + constexpr void SetNull() { - TileCoordsXYZ::setNull(); + TileCoordsXYZ::SetNull(); direction = INVALID_DIRECTION; } }; diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index e001459036..90aed63694 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -66,7 +66,7 @@ void MoneyEffect::CreateAt(money64 value, const CoordsXYZ& effectPos, bool verti void MoneyEffect::Create(money64 value, const CoordsXYZ& loc) { auto offsetLoc = loc; - if (loc.isNull()) + if (loc.IsNull()) { // If game actions return no valid location of the action we can not use the screen // coordinates as every client will have different ones. From f966c229c04f4f2daa8a56fb35b4f886293eb984 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 9 Sep 2021 18:44:52 +0200 Subject: [PATCH 343/681] Refactor out unnecessary Is checks --- src/openrct2/interface/Viewport.cpp | 15 ++++++--------- src/openrct2/interface/Viewport.h | 9 +++++---- src/openrct2/rct2/S6Exporter.h | 3 ++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index d1ca5556ac..58ac6676dd 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -683,15 +683,12 @@ void viewport_update_smart_sprite_follow(rct_window* window) break; case EntityType::Guest: + viewport_update_smart_guest_follow(window, entity->As()); + break; + case EntityType::Staff: - { - Peep* peep = static_cast(entity); - if (peep->Is()) - viewport_update_smart_guest_follow(window, peep); - else if (peep->Is()) - viewport_update_smart_staff_follow(window, peep); + viewport_update_smart_staff_follow(window, entity->As()); break; - } default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. window->viewport_focus_sprite.sprite_id = window->viewport_smart_follow_sprite; @@ -700,7 +697,7 @@ void viewport_update_smart_sprite_follow(rct_window* window) } } -viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Peep* peep) +viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) { viewport_focus focus{}; focus.type = VIEWPORT_FOCUS_TYPE_SPRITE; @@ -759,7 +756,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Peep return focus; } -void viewport_update_smart_staff_follow(rct_window* window, const Peep* peep) +void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep) { sprite_focus focus = {}; diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 4c72fed796..09091e511b 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -20,11 +20,12 @@ struct paint_session; struct RecordedPaintSession; struct paint_struct; struct rct_drawpixelinfo; -struct Peep; struct TileElement; struct rct_window; -union paint_entry; struct EntityBase; +struct Guest; +struct Staff; +union paint_entry; enum { @@ -111,8 +112,8 @@ void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bott void viewport_update_position(rct_window* window); void viewport_update_sprite_follow(rct_window* window); void viewport_update_smart_sprite_follow(rct_window* window); -viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Peep* peep); -void viewport_update_smart_staff_follow(rct_window* window, const Peep* peep); +viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Guest* peep); +void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep); void viewport_update_smart_vehicle_follow(rct_window* window); void viewport_render( rct_drawpixelinfo* dpi, const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom, diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index 9970a7ef3e..b5a69db52d 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -26,8 +26,9 @@ namespace OpenRCT2 struct Litter; struct ObjectRepositoryItem; struct RCT12SpriteBase; -union rct_sprite; struct EntityBase; +struct Peep; +union rct_sprite; /** * Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). From e2841477bda7c504b559bf60cac8a2a7350838f3 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 10 Sep 2021 04:08:27 +0000 Subject: [PATCH 344/681] Merge Localisation/master into OpenRCT2/develop --- data/language/pt-BR.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 34266b9163..78ac8aaa3e 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -3654,6 +3654,7 @@ STR_6453 :Copiar informações da versão STR_6454 :Não é possível renomear o banner… STR_6455 :Não é possível renomear a placa… STR_6456 :Captura Gigante de Tela +STR_6457 :Relatar um problema pelo GitHub ############# # Scenarios # From 0b12076f2f8760aa4f136b996296ee943577c634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 10 Sep 2021 17:19:30 +0300 Subject: [PATCH 345/681] Fix #15390: Revert quadrant distribution change and cleanup --- src/openrct2/paint/Paint.cpp | 42 +++++++++++++++++++++++------------- src/openrct2/paint/Paint.h | 9 ++++---- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 6d64b750c2..96d662fcd8 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -56,27 +56,39 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* static void PaintPSImage(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int32_t x, int32_t y); static uint32_t PaintPSColourifyImage(uint32_t imageId, ViewportInteractionItem spriteType, uint32_t viewFlags); -static constexpr int32_t _PositionHashExtendsX[] = { - -0x2000, - 0x2000, - 0x4000, - 0x2000, -}; - -static constexpr uint32_t CalculatePositionHash(const paint_struct& ps, uint8_t rotation) +static int32_t RemapPositionToQuadrant(const paint_struct& ps, uint8_t rotation) { - auto pos = CoordsXY{ ps.bounds.x, ps.bounds.y }.Rotate(rotation); + constexpr auto MapRangeMax = MaxPaintQuadrants * COORDS_XY_STEP; + constexpr auto MapRangeCenter = MapRangeMax / 2; - // For corners to fall into the right buckets this extends the X axis. - pos.x += _PositionHashExtendsX[rotation]; - - return static_cast(pos.x + pos.y); + const auto x = ps.bounds.x; + const auto y = ps.bounds.y; + // NOTE: We are not calling CoordsXY::Rotate on purpose to mix in the additional + // value without a secondary switch. + switch (rotation & 3) + { + case 0: + return x + y; + case 1: + // Because one component may be the maximum we add the center to be a positive value. + return (y - x) + MapRangeCenter; + case 2: + // If both components would be the maximum it would be the negative xy, to be positive add max. + return (-(y + x)) + MapRangeMax; + case 3: + // Same as 1 but inverted. + return (x - y) + MapRangeCenter; + } + return 0; } static void PaintSessionAddPSToQuadrant(paint_session* session, paint_struct* ps) { - auto positionHash = CalculatePositionHash(*ps, session->CurrentRotation); - uint32_t paintQuadrantIndex = (positionHash / 32) % MAX_PAINT_QUADRANTS; + const auto positionHash = RemapPositionToQuadrant(*ps, session->CurrentRotation); + + // Values below zero or above MaxPaintQuadrants are void, corners also share the same quadrant as void. + const uint32_t paintQuadrantIndex = std::clamp(positionHash / COORDS_XY_STEP, 0, MaxPaintQuadrants); + ps->quadrant_index = paintQuadrantIndex; ps->next_quadrant_ps = session->Quadrants[paintQuadrantIndex]; session->Quadrants[paintQuadrantIndex] = ps; diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 596208bfea..974b73f786 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -14,6 +14,7 @@ #include "../drawing/Drawing.h" #include "../interface/Colour.h" #include "../world/Location.hpp" +#include "../world/Map.h" #include #include @@ -113,9 +114,9 @@ struct tunnel_entry uint8_t type; }; -// NOTE: This should be preferably a prime number. This is the amount of -// buckets used with the position hash, so the bucket is hash % max. -#define MAX_PAINT_QUADRANTS 521 +// The maximum size must be MAXIMUM_MAP_SIZE_TECHNICAL 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; #define TUNNEL_MAX_COUNT 65 @@ -171,7 +172,7 @@ public: struct PaintSessionCore { - paint_struct* Quadrants[MAX_PAINT_QUADRANTS]; + paint_struct* Quadrants[MaxPaintQuadrants]; paint_struct* LastPS; paint_string_struct* PSStringHead; paint_string_struct* LastPSString; From 49bbc0f8544dce4b09adb5a54a816372e40e367c Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 07:24:39 +0300 Subject: [PATCH 346/681] Turn ride_id_t into a strong type --- src/openrct2/ride/RideTypes.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/RideTypes.h b/src/openrct2/ride/RideTypes.h index 2a1567ad4b..7d8b11b344 100644 --- a/src/openrct2/ride/RideTypes.h +++ b/src/openrct2/ride/RideTypes.h @@ -13,11 +13,12 @@ #include #include +#include -using ride_id_t = uint16_t; +enum class ride_id_t : uint16_t; struct Ride; -constexpr const ride_id_t RIDE_ID_NULL = std::numeric_limits::max(); +constexpr const ride_id_t RIDE_ID_NULL = static_cast(std::numeric_limits>::max()); /** * Couples a ride type and subtype together. From 3ad72baaae388114f684a995c941a1d5c2fcb417 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 07:24:52 +0300 Subject: [PATCH 347/681] Cast fixes --- src/openrct2-ui/WindowManager.cpp | 13 +- .../windows/DemolishRidePrompt.cpp | 12 +- .../windows/EditorObjectiveOptions.cpp | 8 +- src/openrct2-ui/windows/Guest.cpp | 5 +- src/openrct2-ui/windows/GuestList.cpp | 6 +- src/openrct2-ui/windows/MazeConstruction.cpp | 6 +- src/openrct2-ui/windows/NewCampaign.cpp | 9 +- src/openrct2-ui/windows/Ride.cpp | 255 +++++++++--------- src/openrct2-ui/windows/RideConstruction.cpp | 10 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 13 +- src/openrct2/actions/ParkMarketingAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 18 +- .../actions/RideSetAppearanceAction.cpp | 2 +- src/openrct2/actions/RideSetPriceAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 8 +- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 14 +- src/openrct2/management/NewsItem.cpp | 2 +- src/openrct2/peep/GuestPathfinding.cpp | 4 +- src/openrct2/rct12/RCT12.cpp | 4 +- src/openrct2/ride/Ride.cpp | 40 +-- src/openrct2/ride/RideConstruction.cpp | 4 +- src/openrct2/ride/RideRatings.cpp | 10 +- src/openrct2/ride/TrackDesign.cpp | 9 +- src/openrct2/ride/Vehicle.cpp | 11 +- src/openrct2/scripting/ScriptEngine.cpp | 2 +- 29 files changed, 256 insertions(+), 221 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 850a2122ef..bdcb8a0c9a 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -184,9 +184,9 @@ public: case WD_BANNER: return window_banner_open(id); case WD_DEMOLISH_RIDE: - return window_ride_demolish_prompt_open(get_ride(id)); + return window_ride_demolish_prompt_open(get_ride(static_cast(id))); case WD_REFURBISH_RIDE: - return window_ride_refurbish_prompt_open(get_ride(id)); + return window_ride_refurbish_prompt_open(get_ride(static_cast(id))); case WD_NEW_CAMPAIGN: return window_new_campaign_open(id); case WD_SIGN: @@ -264,7 +264,8 @@ public: } case WC_RIDE: { - auto ride = get_ride(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); + const auto rideId = static_cast(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); + auto ride = get_ride(rideId); return ride == nullptr ? nullptr : window_ride_main_open(ride); } case WC_TRACK_DESIGN_PLACE: @@ -343,13 +344,13 @@ public: if (w == nullptr || w->number != rideIndex) { window_close_construction_windows(); - _currentRideIndex = rideIndex; + _currentRideIndex = static_cast(rideIndex); w = OpenWindow(WC_RIDE_CONSTRUCTION); } else { ride_construction_invalidate_current_track(); - _currentRideIndex = rideIndex; + _currentRideIndex = static_cast(rideIndex); } break; } @@ -395,7 +396,7 @@ public: case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW: { auto vehicle = static_cast(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE)); - auto w = window_find_by_number(WC_RIDE, vehicle->ride); + auto w = window_find_by_number(WC_RIDE, static_cast(vehicle->ride)); if (w == nullptr) return; diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 395bd145cf..88f61a5d8b 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -84,7 +84,7 @@ rct_window* window_ride_demolish_prompt_open(Ride* ride) w->widgets = window_ride_demolish_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CANCEL) | (1ULL << WIDX_DEMOLISH); WindowInitScrollWidgets(w); - w->number = ride->id; + w->number = static_cast(ride->id); _demolishRideCost = -ride_get_refund_price(ride); return w; @@ -109,7 +109,7 @@ rct_window* window_ride_refurbish_prompt_open(Ride* ride) w->widgets = window_ride_refurbish_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CANCEL) | (1ULL << WIDX_REFURBISH); WindowInitScrollWidgets(w); - w->number = ride->id; + w->number = static_cast(ride->id); _demolishRideCost = -ride_get_refund_price(ride); return w; @@ -125,7 +125,7 @@ static void window_ride_demolish_mouseup(rct_window* w, rct_widgetindex widgetIn { case WIDX_DEMOLISH: { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); ride_action_modify(ride, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY); break; } @@ -142,7 +142,7 @@ static void window_ride_refurbish_mouseup(rct_window* w, rct_widgetindex widgetI { case WIDX_REFURBISH: { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); ride_action_modify(ride, RIDE_MODIFY_RENEW, GAME_COMMAND_FLAG_APPLY); break; } @@ -161,7 +161,7 @@ static void window_ride_demolish_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID : STR_DEMOLISH_RIDE_ID_MONEY; @@ -178,7 +178,7 @@ static void window_ride_refurbish_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY : STR_REFURBISH_RIDE_ID_MONEY; diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index bd3c0357ae..50bb176749 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -972,7 +972,7 @@ static void window_editor_objective_options_rides_update(rct_window* w) { if (ride.IsRide()) { - w->list_item_positions[numItems] = ride.id; + w->list_item_positions[numItems] = static_cast(ride.id); numItems++; } } @@ -1005,7 +1005,8 @@ static void window_editor_objective_options_rides_scrollmousedown( if (i < 0 || i >= w->no_list_items) return; - auto ride = get_ride(w->list_item_positions[i]); + const auto rideId = static_cast(w->list_item_positions[i]); + auto ride = get_ride(rideId); if (ride != nullptr) { ride->lifecycle_flags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE; @@ -1098,7 +1099,8 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window* w, rct } // Checkbox mark - auto ride = get_ride(w->list_item_positions[i]); + const auto rideId = static_cast(w->list_item_positions[i]); + auto ride = get_ride(rideId); if (ride != nullptr) { if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 4e62cf9142..4c35e18d02 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1456,7 +1456,7 @@ void window_guest_rides_update(rct_window* w) { if (ride.IsRide() && guest->HasRidden(&ride)) { - w->list_item_positions[curr_list_position] = ride.id; + w->list_item_positions[curr_list_position] = static_cast(ride.id); curr_list_position++; } } @@ -1607,7 +1607,8 @@ void window_guest_rides_scroll_paint(rct_window* w, rct_drawpixelinfo* dpi, int3 stringId = STR_WINDOW_COLOUR_2_STRINGID; } - auto ride = get_ride(w->list_item_positions[list_index]); + const auto rideId = static_cast(w->list_item_positions[list_index]); + auto ride = get_ride(rideId); if (ride != nullptr) { auto ft = Formatter(); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index d1b2d29c4b..cc3b1254c9 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -182,7 +182,7 @@ public: { case GuestListFilterType::GuestsOnRide: { - auto guestRide = get_ride(index); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add( @@ -198,7 +198,7 @@ public: } case GuestListFilterType::GuestsInQueue: { - auto guestRide = get_ride(index); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add(STR_QUEUING_FOR); @@ -213,7 +213,7 @@ public: } case GuestListFilterType::GuestsThinkingAboutRide: { - auto guestRide = get_ride(index); + auto guestRide = get_ride(static_cast(index)); if (guestRide != nullptr) { ft.Add(STR_NONE); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 8ba2e75354..9d7a3654cc 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -130,7 +130,7 @@ rct_window* window_maze_construction_open() WindowInitScrollWidgets(w); - w->number = _currentRideIndex; + w->number = static_cast(_currentRideIndex); window_push_others_right(w); show_gridlines(); @@ -169,7 +169,7 @@ static void window_maze_construction_close(rct_window* w) else { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, ride->id); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(ride->id)); context_open_intent(&intent); } } @@ -181,7 +181,7 @@ static void window_maze_construction_entrance_mouseup(rct_window* w, rct_widgeti return; gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = static_cast(w->number); + gRideEntranceExitPlaceRideIndex = static_cast(w->number); gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index d1ad6aa8d9..78139854cb 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -22,7 +22,9 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; static constexpr const int32_t WH = 109; static constexpr const int32_t WW = 350; -constexpr uint16_t SELECTED_RIDE_UNDEFINED = 0xFFFF; + +constexpr auto SELECTED_RIDE_UNDEFINED = RIDE_ID_NULL; +constexpr uint16_t SELECTED_ITEM_UNDEFINED = 0xFFFF; // clang-format off enum WINDOW_NEW_CAMPAIGN_WIDGET_IDX { @@ -252,7 +254,8 @@ public: break; case WIDX_START_BUTTON: { - auto gameAction = ParkMarketingAction(campaign.campaign_type, campaign.RideId, campaign.no_weeks); + auto gameAction = ParkMarketingAction( + campaign.campaign_type, static_cast(campaign.RideId), campaign.no_weeks); gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { @@ -322,7 +325,7 @@ public: 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_RIDE_UNDEFINED) + if (campaign.ShopItemId != SELECTED_ITEM_UNDEFINED) { widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(campaign.ShopItemId)).Naming.Plural; } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b79a7cec0e..e014523787 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -958,7 +958,7 @@ static void window_ride_draw_tab_main(rct_drawpixelinfo* dpi, rct_window* w) rct_widgetindex widgetIndex = WIDX_TAB_1 + WINDOW_RIDE_PAGE_MAIN; if (!(w->disabled_widgets & (1LL << widgetIndex))) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { int32_t spriteIndex = 0; @@ -1014,7 +1014,7 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w) screenCoords = ScreenCoordsXY{ widget->width() / 2, widget->height() - 12 }; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -1108,7 +1108,7 @@ static void window_ride_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w) static void window_ride_disable_tabs(rct_window* w) { uint32_t disabled_tabs = 0; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -1192,12 +1192,12 @@ static void window_ride_update_overall_view(Ride* ride) maxz = std::max(maxz, clearZ); } - if (ride->id >= ride_overall_views.size()) + if (static_cast(ride->id) >= ride_overall_views.size()) { - ride_overall_views.resize(ride->id + 1); + ride_overall_views.resize(static_cast(ride->id) + 1); } - auto& view = ride_overall_views[ride->id]; + auto& view = ride_overall_views[static_cast(ride->id)]; view.x = (minx + maxx) / 2 + 16; view.y = (miny + maxy) / 2 + 16; view.z = (minz + maxz) / 2 - 8; @@ -1234,7 +1234,7 @@ static rct_window* window_ride_open(Ride* ride) w->widgets = window_ride_page_widgets[WINDOW_RIDE_PAGE_MAIN]; w->enabled_widgets = window_ride_page_enabled_widgets[WINDOW_RIDE_PAGE_MAIN]; w->hold_down_widgets = window_ride_page_hold_down_widgets[WINDOW_RIDE_PAGE_MAIN]; - w->number = ride->id; + w->number = static_cast(ride->id); w->page = WINDOW_RIDE_PAGE_MAIN; w->vehicleIndex = 0; @@ -1264,7 +1264,7 @@ rct_window* window_ride_main_open(Ride* ride) return nullptr; } - rct_window* w = window_bring_to_front_by_number(WC_RIDE, ride->id); + rct_window* w = window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1305,7 +1305,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) return window_ride_main_open(ride); - auto w = window_bring_to_front_by_number(WC_RIDE, ride->id); + auto w = window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1407,7 +1407,7 @@ rct_window* window_ride_open_vehicle(Vehicle* vehicle) view++; } - rct_window* w = window_find_by_number(WC_RIDE, ride->id); + rct_window* w = window_find_by_number(WC_RIDE, static_cast(ride->id)); if (w != nullptr) { w->Invalidate(); @@ -1442,7 +1442,8 @@ rct_window* window_ride_open_vehicle(Vehicle* vehicle) } } - w = openedPeepWindow ? window_find_by_number(WC_RIDE, ride->id) : window_bring_to_front_by_number(WC_RIDE, ride->id); + w = openedPeepWindow ? window_find_by_number(WC_RIDE, static_cast(ride->id)) + : window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); } if (w == nullptr) @@ -1584,7 +1585,7 @@ static void window_ride_init_viewport(rct_window* w) if (w->page != WINDOW_RIDE_PAGE_MAIN) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -1716,7 +1717,7 @@ static void window_ride_init_viewport(rct_window* w) */ static void window_ride_rename(rct_window* w) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto rideName = ride->GetName(); @@ -1750,11 +1751,11 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) break; case WIDX_CONSTRUCTION: { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { ride_construct(ride); - if (window_find_by_number(WC_RIDE_CONSTRUCTION, ride->id) != nullptr) + if (window_find_by_number(WC_RIDE_CONSTRUCTION, static_cast(ride->id)) != nullptr) { window_close(w); } @@ -1775,7 +1776,7 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_TEST_LIGHT: case WIDX_OPEN_LIGHT: { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { RideStatus status; @@ -1813,7 +1814,7 @@ static void window_ride_main_resize(rct_window* w) { minHeight += 20 + RCT1_LIGHT_OFFSET; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { #ifdef __SIMULATE_IN_RIDE_WINDOW__ @@ -1845,7 +1846,7 @@ static void window_ride_main_resize(rct_window* w) static void window_ride_show_view_dropdown(rct_window* w, rct_widget* widget) { rct_widget* dropdownWidget = widget - 1; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -1961,7 +1962,7 @@ static void window_ride_set_dropdown(RideStatusDropdownInfo& info, RideStatus st static void window_ride_show_open_dropdown(rct_window* w, rct_widget* widget) { RideStatusDropdownInfo info; - info.Ride = get_ride(w->number); + info.Ride = get_ride(static_cast(w->number)); if (info.Ride == nullptr) return; @@ -2029,7 +2030,7 @@ static void populate_ride_type_dropdown() static void window_ride_show_ride_type_dropdown(rct_window* w, rct_widget* widget) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2125,7 +2126,7 @@ static void populate_vehicle_type_dropdown(Ride* ride) static void window_ride_show_vehicle_type_dropdown(rct_window* w, rct_widget* widget) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2192,7 +2193,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex if (dropdownIndex == -1) { dropdownIndex = w->ride.view + 1; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { if (dropdownIndex != 0 && dropdownIndex <= ride->num_vehicles @@ -2213,7 +2214,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex break; case WIDX_OPEN: { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto status = RideStatus::Closed; @@ -2250,7 +2251,8 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex uint8_t rideType = RideDropdownData[rideLabelId].ride_type_id; if (rideType < RIDE_TYPE_COUNT) { - auto rideSetSetting = RideSetSettingAction(w->number, RideSetSetting::RideType, rideType); + const auto rideId = static_cast(w->number); + 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. @@ -2276,7 +2278,7 @@ static void window_ride_main_update(rct_window* w) widget_invalidate(w, WIDX_TAB_1); // Update status - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) @@ -2311,7 +2313,7 @@ static void window_ride_main_textinput(rct_window* w, rct_widgetindex widgetInde if (widgetIndex != WIDX_RENAME || text == nullptr) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { ride_set_name(ride, text, 0); @@ -2345,7 +2347,7 @@ static void window_ride_main_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2477,7 +2479,7 @@ static void window_ride_main_invalidate(rct_window* w) static rct_string_id window_ride_get_status_overall_view(rct_window* w, Formatter& ft) { auto stringId = STR_NONE; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { ride->FormatStatusTo(ft); @@ -2496,7 +2498,7 @@ static rct_string_id window_ride_get_status_overall_view(rct_window* w, Formatte */ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return STR_EMPTY; @@ -2544,7 +2546,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft */ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return STR_NONE; @@ -2595,7 +2597,7 @@ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft */ static rct_string_id window_ride_get_status(rct_window* w, Formatter& ft) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (w->ride.view == 0) return window_ride_get_status_overall_view(w, ft); if (ride != nullptr && w->ride.view <= ride->num_vehicles) @@ -2625,7 +2627,7 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi) } // View dropdown - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2707,7 +2709,7 @@ static void window_ride_vehicle_resize(rct_window* w) */ static void window_ride_vehicle_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2750,7 +2752,7 @@ static void window_ride_vehicle_dropdown(rct_window* w, rct_widgetindex widgetIn case WIDX_VEHICLE_TYPE_DROPDOWN: if (dropdownIndex >= 0 && static_cast(dropdownIndex) < VehicleDropdownData.size()) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto newRideType = VehicleDropdownData[dropdownIndex].subtype_id; @@ -2775,7 +2777,7 @@ static void window_ride_vehicle_update(rct_window* w) static OpenRCT2String window_ride_vehicle_tooltip( rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return { STR_NONE, {} }; @@ -2842,7 +2844,7 @@ static void window_ride_vehicle_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2922,7 +2924,7 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -2997,7 +2999,7 @@ static rct_vehicle_paintinfo _sprites_to_draw[144]; */ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3090,7 +3092,8 @@ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dp */ static void window_ride_mode_tweak_increase(rct_window* w) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3106,7 +3109,7 @@ static void window_ride_mode_tweak_increase(rct_window* w) uint8_t increment = ride->mode == RideMode::Dodgems ? 10 : 1; set_operating_setting( - w->number, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); + rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); } /** @@ -3115,7 +3118,8 @@ static void window_ride_mode_tweak_increase(rct_window* w) */ static void window_ride_mode_tweak_decrease(rct_window* w) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3130,7 +3134,7 @@ static void window_ride_mode_tweak_decrease(rct_window* w) uint8_t decrement = ride->mode == RideMode::Dodgems ? 10 : 1; set_operating_setting( - w->number, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); + rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); } /** @@ -3142,7 +3146,8 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) rct_widget* dropdownWidget; dropdownWidget = widget - 1; - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3181,7 +3186,8 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) */ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3204,7 +3210,8 @@ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget) */ static void window_ride_operating_mouseup(rct_window* w, rct_widgetindex widgetIndex) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3226,23 +3233,21 @@ static void window_ride_operating_mouseup(rct_window* w, rct_widgetindex widgetI window_ride_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_LOAD_CHECKBOX: - set_operating_setting(w->number, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_LOAD); + set_operating_setting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_LOAD); break; case WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX: set_operating_setting( - w->number, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); break; case WIDX_MINIMUM_LENGTH_CHECKBOX: - set_operating_setting( - w->number, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); + set_operating_setting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); break; case WIDX_MAXIMUM_LENGTH_CHECKBOX: - set_operating_setting( - w->number, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); + set_operating_setting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); break; case WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX: set_operating_setting( - w->number, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); break; } } @@ -3262,7 +3267,8 @@ static void window_ride_operating_resize(rct_window* w) */ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3279,42 +3285,42 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge upper_bound = gCheatsUnlockOperatingLimits ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed; lower_bound = gCheatsUnlockOperatingLimits ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed; set_operating_setting( - w->number, RideSetSetting::LiftHillSpeed, + rideId, RideSetSetting::LiftHillSpeed, std::clamp(ride->lift_hill_speed + 1, lower_bound, upper_bound)); break; case WIDX_LIFT_HILL_SPEED_DECREASE: upper_bound = gCheatsUnlockOperatingLimits ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed; lower_bound = gCheatsUnlockOperatingLimits ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed; set_operating_setting( - w->number, RideSetSetting::LiftHillSpeed, + rideId, RideSetSetting::LiftHillSpeed, std::clamp(ride->lift_hill_speed - 1, lower_bound, upper_bound)); break; case WIDX_MINIMUM_LENGTH_INCREASE: upper_bound = 250; lower_bound = 0; set_operating_setting( - w->number, RideSetSetting::MinWaitingTime, + rideId, RideSetSetting::MinWaitingTime, std::clamp(ride->min_waiting_time + 1, lower_bound, upper_bound)); break; case WIDX_MINIMUM_LENGTH_DECREASE: upper_bound = 250; lower_bound = 0; set_operating_setting( - w->number, RideSetSetting::MinWaitingTime, + rideId, RideSetSetting::MinWaitingTime, std::clamp(ride->min_waiting_time - 1, lower_bound, upper_bound)); break; case WIDX_MAXIMUM_LENGTH_INCREASE: upper_bound = 250; lower_bound = 0; set_operating_setting( - w->number, RideSetSetting::MaxWaitingTime, + rideId, RideSetSetting::MaxWaitingTime, std::clamp(ride->max_waiting_time + 1, lower_bound, upper_bound)); break; case WIDX_MAXIMUM_LENGTH_DECREASE: upper_bound = 250; lower_bound = 0; set_operating_setting( - w->number, RideSetSetting::MaxWaitingTime, + rideId, RideSetSetting::MaxWaitingTime, std::clamp(ride->max_waiting_time - 1, lower_bound, upper_bound)); break; case WIDX_MODE_DROPDOWN: @@ -3327,13 +3333,13 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge upper_bound = gCheatsUnlockOperatingLimits ? 255 : MAX_CIRCUITS_PER_RIDE; lower_bound = 1; set_operating_setting( - w->number, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits + 1, lower_bound, upper_bound)); + rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits + 1, lower_bound, upper_bound)); break; case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE: upper_bound = gCheatsUnlockOperatingLimits ? 255 : MAX_CIRCUITS_PER_RIDE; lower_bound = 1; set_operating_setting( - w->number, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits - 1, lower_bound, upper_bound)); + rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits - 1, lower_bound, upper_bound)); break; } } @@ -3347,7 +3353,8 @@ static void window_ride_operating_dropdown(rct_window* w, rct_widgetindex widget if (dropdownIndex == -1) return; - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3371,12 +3378,12 @@ static void window_ride_operating_dropdown(rct_window* w, rct_widgetindex widget } } if (rideMode != RideMode::NullMode) - set_operating_setting(w->number, RideSetSetting::Mode, static_cast(rideMode)); + set_operating_setting(rideId, RideSetSetting::Mode, static_cast(rideMode)); break; } case WIDX_LOAD_DROPDOWN: set_operating_setting( - w->number, RideSetSetting::Departure, (ride->depart_flags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); + rideId, RideSetSetting::Departure, (ride->depart_flags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); break; } } @@ -3391,7 +3398,7 @@ static void window_ride_operating_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_3); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; @@ -3417,7 +3424,7 @@ static void window_ride_operating_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3658,7 +3665,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3690,7 +3697,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_ride_locate_mechanic(rct_window* w) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3780,7 +3787,7 @@ static void window_ride_maintenance_resize(rct_window* w) */ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -3884,7 +3891,8 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg if (dropdownIndex == -1) return; - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3895,7 +3903,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg switch (widgetIndex) { case WIDX_INSPECTION_INTERVAL_DROPDOWN: - set_operating_setting(w->number, RideSetSetting::InspectionInterval, dropdownIndex); + set_operating_setting(rideId, RideSetSetting::InspectionInterval, dropdownIndex); break; case WIDX_FORCE_BREAKDOWN: @@ -3990,7 +3998,7 @@ static void window_ride_maintenance_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_4); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -4013,7 +4021,7 @@ static void window_ride_maintenance_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4055,7 +4063,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4210,7 +4218,7 @@ static void window_ride_set_track_colour_scheme(rct_window* w, const ScreenCoord return; if (info.Element->GetType() != TILE_ELEMENT_TYPE_TRACK) return; - if (info.Element->AsTrack()->GetRideIndex() != w->number) + if (info.Element->AsTrack()->GetRideIndex() != static_cast(w->number)) return; if (info.Element->AsTrack()->GetColourScheme() == newColourScheme) return; @@ -4288,7 +4296,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn int32_t i, numItems; rct_string_id stringId; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4421,6 +4429,7 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd if (dropdownIndex == -1) return; + const auto rideId = static_cast(w->number); switch (widgetIndex) { case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: @@ -4430,28 +4439,28 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd case WIDX_TRACK_MAIN_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::TrackColourMain, dropdownIndex, w->ride_colour); + rideId, RideSetAppearanceType::TrackColourMain, dropdownIndex, w->ride_colour); GameActions::Execute(&rideSetAppearanceAction); } break; case WIDX_TRACK_ADDITIONAL_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::TrackColourAdditional, dropdownIndex, w->ride_colour); + rideId, RideSetAppearanceType::TrackColourAdditional, dropdownIndex, w->ride_colour); GameActions::Execute(&rideSetAppearanceAction); } break; case WIDX_TRACK_SUPPORT_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::TrackColourSupports, dropdownIndex, w->ride_colour); + rideId, RideSetAppearanceType::TrackColourSupports, dropdownIndex, w->ride_colour); GameActions::Execute(&rideSetAppearanceAction); } break; case WIDX_MAZE_STYLE_DROPDOWN: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::MazeStyle, dropdownIndex, w->ride_colour); + rideId, RideSetAppearanceType::MazeStyle, dropdownIndex, w->ride_colour); GameActions::Execute(&rideSetAppearanceAction); } break; @@ -4467,7 +4476,7 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd if (ddIndex == dropdownIndex) { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::EntranceStyle, ddIndex, 0); + rideId, RideSetAppearanceType::EntranceStyle, ddIndex, 0); GameActions::Execute(&rideSetAppearanceAction); break; } @@ -4479,7 +4488,7 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0); + rideId, RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0); GameActions::Execute(&rideSetAppearanceAction); w->vehicleIndex = 0; } @@ -4491,21 +4500,21 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd case WIDX_VEHICLE_MAIN_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::VehicleColourBody, dropdownIndex, w->vehicleIndex); + rideId, RideSetAppearanceType::VehicleColourBody, dropdownIndex, w->vehicleIndex); GameActions::Execute(&rideSetAppearanceAction); } break; case WIDX_VEHICLE_ADDITIONAL_COLOUR_1: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::VehicleColourTrim, dropdownIndex, w->vehicleIndex); + rideId, RideSetAppearanceType::VehicleColourTrim, dropdownIndex, w->vehicleIndex); GameActions::Execute(&rideSetAppearanceAction); } break; case WIDX_VEHICLE_ADDITIONAL_COLOUR_2: { auto rideSetAppearanceAction = RideSetAppearanceAction( - w->number, RideSetAppearanceType::VehicleColourTernary, dropdownIndex, w->vehicleIndex); + rideId, RideSetAppearanceType::VehicleColourTernary, dropdownIndex, w->vehicleIndex); GameActions::Execute(&rideSetAppearanceAction); } break; @@ -4562,7 +4571,7 @@ static void window_ride_colour_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4788,7 +4797,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_drawpixelinfo clippedDpi; rct_widget* widget; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4888,7 +4897,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_ride_colour_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -4951,11 +4960,12 @@ static std::vector window_ride_current_music_style_order; */ static void window_ride_toggle_music(rct_window* w) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride != nullptr) { int32_t activateMusic = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; - set_operating_setting(w->number, RideSetSetting::Music, activateMusic); + set_operating_setting(rideId, RideSetSetting::Music, activateMusic); } } @@ -5027,7 +5037,7 @@ static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetInd return; auto dropdownWidget = widget - 1; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -5106,7 +5116,7 @@ static void window_ride_music_dropdown(rct_window* w, rct_widgetindex widgetInde && static_cast(dropdownIndex) < window_ride_current_music_style_order.size()) { auto musicStyle = window_ride_current_music_style_order[dropdownIndex]; - set_operating_setting(w->number, RideSetSetting::MusicType, musicStyle); + set_operating_setting(static_cast(w->number), RideSetSetting::MusicType, musicStyle); } } @@ -5136,7 +5146,7 @@ static void window_ride_music_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -5227,7 +5237,7 @@ static void setup_scenery_selection(rct_window* w) while (tool_set(w, WIDX_BACKGROUND, Tool::Crosshair)) ; - gTrackDesignSaveRideIndex = w->number; + gTrackDesignSaveRideIndex = static_cast(w->number); track_design_save_init(); gGamePaused |= GAME_PAUSED_SAVING_TRACK; @@ -5290,7 +5300,7 @@ static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* pat */ static void window_ride_measurements_design_save(rct_window* w) { - Ride* ride = get_ride(w->number); + Ride* ride = get_ride(static_cast(w->number)); _trackDesign = ride->SaveToTrackDesign(); if (!_trackDesign) { @@ -5382,7 +5392,7 @@ static void window_ride_measurements_mousedown(rct_window* w, rct_widgetindex wi if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -5508,7 +5518,8 @@ static void window_ride_measurements_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -5517,7 +5528,7 @@ static void window_ride_measurements_invalidate(rct_window* w) window_ride_measurements_widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN_NOT_POSSIBLE; window_ride_measurements_widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::Empty; - if (gTrackDesignSaveMode && gTrackDesignSaveRideIndex == w->number) + if (gTrackDesignSaveMode && gTrackDesignSaveRideIndex == rideId) { window_ride_measurements_widgets[WIDX_SELECT_NEARBY_SCENERY].type = WindowWidgetType::Button; window_ride_measurements_widgets[WIDX_RESET_SELECTION].type = WindowWidgetType::Button; @@ -5570,7 +5581,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi } else { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -5894,7 +5905,7 @@ static void window_ride_graphs_update(rct_window* w) x = w->scrolls[0].h_left; if (!(w->list_information_type & 0x8000)) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5919,7 +5930,7 @@ static void window_ride_graphs_scrollgetheight(rct_window* w, int32_t scrollInde *width = window_ride_graphs_widgets[WIDX_GRAPH].width() - 2; // Get measurement size - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5948,7 +5959,7 @@ static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widget { if (widgetIndex == WIDX_GRAPH) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto [measurement, message] = ride->GetMeasurement(); @@ -5988,7 +5999,7 @@ static void window_ride_graphs_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -6054,7 +6065,7 @@ static void window_ride_graphs_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi gfx_clear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); auto widget = &window_ride_graphs_widgets[WIDX_GRAPH]; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) { return; @@ -6247,7 +6258,8 @@ static void update_same_price_throughout_flags(ShopItem shop_item) */ static void window_ride_income_toggle_primary_price(rct_window* w) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6273,7 +6285,7 @@ static void window_ride_income_toggle_primary_price(rct_window* w) update_same_price_throughout_flags(shop_item); - auto rideSetPriceAction = RideSetPriceAction(w->number, ride->price[0], true); + auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[0], true); GameActions::Execute(&rideSetPriceAction); } @@ -6283,7 +6295,8 @@ static void window_ride_income_toggle_primary_price(rct_window* w) */ static void window_ride_income_toggle_secondary_price(rct_window* w) { - auto ride = get_ride(w->number); + const auto rideId = static_cast(w->number); + auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6297,13 +6310,13 @@ static void window_ride_income_toggle_secondary_price(rct_window* w) update_same_price_throughout_flags(shop_item); - auto rideSetPriceAction = RideSetPriceAction(w->number, ride->price[1], false); + auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[1], false); GameActions::Execute(&rideSetPriceAction); } static void window_ride_income_set_primary_price(rct_window* w, money16 price) { - auto rideSetPriceAction = RideSetPriceAction(w->number, price, true); + auto rideSetPriceAction = RideSetPriceAction(static_cast(w->number), price, true); GameActions::Execute(&rideSetPriceAction); } @@ -6316,7 +6329,7 @@ static void window_ride_income_increase_primary_price(rct_window* w) if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -6336,7 +6349,7 @@ static void window_ride_income_decrease_primary_price(rct_window* w) if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -6349,7 +6362,7 @@ static void window_ride_income_decrease_primary_price(rct_window* w) static money16 window_ride_income_get_secondary_price(rct_window* w) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return 0; @@ -6359,13 +6372,13 @@ static money16 window_ride_income_get_secondary_price(rct_window* w) static void window_ride_income_set_secondary_price(rct_window* w, money16 price) { - auto rideSetPriceAction = RideSetPriceAction((w->number & 0x00FF), price, false); + auto rideSetPriceAction = RideSetPriceAction(static_cast(w->number), price, false); GameActions::Execute(&rideSetPriceAction); } static bool window_ride_income_can_modify_primary_price(rct_window* w) { - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return false; @@ -6430,7 +6443,7 @@ static void window_ride_income_mouseup(rct_window* w, rct_widgetindex widgetInde if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { money_to_string(static_cast(ride->price[0]), _moneyInputText, MONEY_STRING_MAXLENGTH, true); @@ -6500,7 +6513,7 @@ static void window_ride_income_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_9); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; @@ -6547,7 +6560,7 @@ static void window_ride_income_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -6658,7 +6671,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; @@ -6826,7 +6839,7 @@ static void window_ride_customer_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_10); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; @@ -6849,7 +6862,7 @@ static void window_ride_customer_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride != nullptr) { auto ft = Formatter::Common(); @@ -6885,7 +6898,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(w->number); + auto ride = get_ride(static_cast(w->number)); if (ride == nullptr) return; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8d6c70f41e..d8424785d3 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -509,7 +509,7 @@ static void close_ride_window_for_construction(rct_windownumber number) rct_window* window_ride_construction_open() { ride_id_t rideIndex = _currentRideIndex; - close_ride_window_for_construction(rideIndex); + close_ride_window_for_construction(static_cast(rideIndex)); auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -543,7 +543,7 @@ rct_window* window_ride_construction_open() w->colours[1] = COLOUR_DARK_BROWN; w->colours[2] = COLOUR_DARK_BROWN; - w->number = rideIndex; + w->number = static_cast(rideIndex); window_push_others_right(w); show_gridlines(); @@ -620,7 +620,7 @@ static void window_ride_construction_close(rct_window* w) ride->SetToDefaultInspectionInterval(); auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, ride->id); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(ride->id)); context_open_intent(&intent); } else @@ -1937,7 +1937,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) _currentTrackPieceType, 0, { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, _currentTrackPieceDirection }); - const auto rideId = w->number; + const auto rideId = static_cast(w->number); trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -2017,7 +2017,7 @@ static void window_ride_construction_exit_click(rct_window* w) else { gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = w->number & 0xFF; + gRideEntranceExitPlaceRideIndex = static_cast(w->number); gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); ride_construction_invalidate_current_track(); diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index aa932db73e..94a51eb2c9 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -443,7 +443,7 @@ static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, else { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(rideIndex)); context_open_intent(&intent); } } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index bfadeab869..575710c2ea 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1931,7 +1931,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Details // Ride auto trackElement = tileElement->AsTrack(); - int16_t rideId = trackElement->GetRideIndex(); + ride_id_t rideId = trackElement->GetRideIndex(); auto ride = get_ride(rideId); if (ride != nullptr) { diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index ce83d160f7..35ad8b135b 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -268,7 +268,9 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI // Check if tool map position has changed since last update if (mapCoords == _windowTrackPlaceLast) { - place_virtual_track(_trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(0), { mapCoords, 0 }); + place_virtual_track( + _trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), + { mapCoords, 0 }); return; } @@ -308,7 +310,8 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI widget_invalidate(w, WIDX_PRICE); } - place_virtual_track(_trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(0), trackLoc); + place_virtual_track( + _trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), trackLoc); } /** @@ -348,7 +351,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd if (track_design_are_entrance_and_exit_placed()) { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, result->rideIndex); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(result->rideIndex)); context_open_intent(&intent); auto wnd = window_find_by_class(WC_TRACK_DESIGN_PLACE); window_close(wnd); @@ -469,7 +472,9 @@ static int32_t window_track_place_get_base_z(const CoordsXY& loc) if (surfaceElement->GetWaterHeight() > 0) z = std::max(z, surfaceElement->GetWaterHeight()); - return z + place_virtual_track(_trackDesign.get(), PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(0), { loc, z }); + return z + + place_virtual_track( + _trackDesign.get(), PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(static_cast(0)), { loc, z }); } /** diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index aa9c2abda4..665f00fbc5 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -70,7 +70,7 @@ GameActions::Result::Ptr ParkMarketingAction::Execute() const campaign.Flags = MarketingCampaignFlags::FIRST_WEEK; if (campaign.Type == ADVERTISING_CAMPAIGN_RIDE_FREE || campaign.Type == ADVERTISING_CAMPAIGN_RIDE) { - campaign.RideId = _item; + campaign.RideId = static_cast(_item); } else if (campaign.Type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) { diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index e53af79c82..c59bc5c1c3 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -131,14 +131,16 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const ride->ValidateStations(); ride_clear_leftover_entrances(ride); - News::DisableNewsItems(News::ItemType::Ride, _rideIndex); - UnlinkAllBannersForRide(_rideIndex); + const auto rideId = ride->id; + News::DisableNewsItems(News::ItemType::Ride, EnumValue(rideId)); - RideUse::GetHistory().RemoveValue(_rideIndex); + UnlinkAllBannersForRide(ride->id); + + RideUse::GetHistory().RemoveValue(ride->id); for (auto peep : EntityList()) { - peep->RemoveRideFromMemory(_rideIndex); + peep->RemoveRideFromMemory(ride->id); } MarketingCancelCampaignsForRide(_rideIndex); @@ -157,9 +159,9 @@ GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const gParkValue = GetContext()->GetGameState()->GetPark().CalculateParkValue(); // Close windows related to the demolished ride - window_close_by_number(WC_RIDE_CONSTRUCTION, _rideIndex); - window_close_by_number(WC_RIDE, _rideIndex); - window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, _rideIndex); + window_close_by_number(WC_RIDE_CONSTRUCTION, EnumValue(rideId)); + window_close_by_number(WC_RIDE, EnumValue(rideId)); + window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, EnumValue(rideId)); window_close_by_class(WC_NEW_CAMPAIGN); // Refresh windows that display the ride name @@ -272,7 +274,7 @@ GameActions::Result::Ptr RideDemolishAction::RefurbishRide(Ride* ride) const res->Position = { location, tile_element_height(location) }; } - window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, _rideIndex); + window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, static_cast(_rideIndex)); return res; } diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 53b76ff27a..bf8e9fc366 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -139,7 +139,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const gfx_invalidate_screen(); break; } - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); auto res = std::make_unique(); if (!ride->overall_view.IsNull()) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index caf508d1e0..268fd7d9a7 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -180,7 +180,7 @@ void RideSetPriceAction::RideSetCommonPrice(ShopItem shopItem) const } if (invalidate) { - window_invalidate_by_number(WC_RIDE, ride.id); + window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); } } } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 220c0ced3d..233b19154e 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -233,7 +233,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; } - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); return res; } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index f6cffc84aa..5a79dae8bd 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -154,7 +154,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; ride->race_winner = SPRITE_INDEX_NULL; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); break; case RideStatus::Simulating: { @@ -176,7 +176,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); break; } case RideStatus::Testing: @@ -195,7 +195,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const // Fix #3183: Make sure we close the construction window so the ride finishes any editing code before opening // otherwise vehicles get added to the ride incorrectly (such as to a ghost station) - rct_window* constructionWindow = window_find_by_number(WC_RIDE_CONSTRUCTION, _rideIndex); + rct_window* constructionWindow = window_find_by_number(WC_RIDE_CONSTRUCTION, static_cast(_rideIndex)); if (constructionWindow != nullptr) { window_close(constructionWindow); @@ -223,7 +223,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, _rideIndex); + window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); break; } default: diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 320aeafe12..bda774375f 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -199,7 +199,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const } auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, _rideIndex); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(_rideIndex)); context_broadcast_intent(&intent); gfx_invalidate_screen(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 3ad3c5fb25..a4f4e2b559 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -194,7 +194,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - int32_t res = set_operating_setting(ride_index, RideSetSetting::RideType, type); + int32_t res = set_operating_setting(static_cast(ride_index), RideSetSetting::RideType, type); if (res == MONEY32_UNDEFINED) { if (!gCheatsAllowArbitraryRideTypeChanges) @@ -224,7 +224,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(ride_index); + auto ride = get_ride(static_cast(ride_index)); if (mode >= static_cast(RideMode::Count)) { console.WriteFormatLine("Invalid ride mode."); @@ -256,7 +256,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(ride_index); + auto ride = get_ride(static_cast(ride_index)); if (mass <= 0) { console.WriteFormatLine("Friction value must be strictly positive"); @@ -294,7 +294,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(ride_index); + auto ride = get_ride(static_cast(ride_index)); if (excitement <= 0) { console.WriteFormatLine("Excitement value must be strictly positive"); @@ -325,7 +325,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(ride_index); + auto ride = get_ride(static_cast(ride_index)); if (intensity <= 0) { console.WriteFormatLine("Intensity value must be strictly positive"); @@ -356,7 +356,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto ride = get_ride(ride_index); + auto ride = get_ride(static_cast(ride_index)); if (nausea <= 0) { console.WriteFormatLine("Nausea value must be strictly positive"); @@ -426,7 +426,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv) } else { - auto rideSetPrice = RideSetPriceAction(rideId, price, true); + auto rideSetPrice = RideSetPriceAction(static_cast(rideId), price, true); GameActions::Execute(&rideSetPrice); } } diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index e9cd6b3147..bbd1d07af6 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -211,7 +211,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s { case News::ItemType::Ride: { - Ride* ride = get_ride(subject); + Ride* ride = get_ride(static_cast(subject)); if (ride == nullptr || ride->overall_view.IsNull()) { break; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 708aa59be2..91a3e633f7 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -2095,8 +2095,8 @@ int32_t guest_path_finding(Guest* peep) if (!(adjustedEdges & (1 << chosenDirection))) continue; - ride_id_t rideIndex, pathSearchResult; - pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex); + ride_id_t rideIndex = RIDE_ID_NULL; + auto pathSearchResult = footpath_element_destination_in_direction(loc, pathElement, chosenDirection, &rideIndex); switch (pathSearchResult) { case PATH_SEARCH_DEAD_END: diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 96a9df55ca..560cd73cfd 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -1046,7 +1046,7 @@ ride_id_t RCT12RideIdToOpenRCT2RideId(const RCT12RideId rideId) if (rideId == RCT12_RIDE_ID_NULL) return RIDE_ID_NULL; - return rideId; + return static_cast(rideId); } RCT12RideId OpenRCT2RideIdToRCT12RideId(const ride_id_t rideId) @@ -1054,7 +1054,7 @@ RCT12RideId OpenRCT2RideIdToRCT12RideId(const ride_id_t rideId) if (rideId == RIDE_ID_NULL) return RCT12_RIDE_ID_NULL; - return rideId; + return static_cast(rideId); } static bool RCT12IsFormatChar(codepoint_t c) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 833a6c3250..392992b9ae 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -147,21 +147,23 @@ ride_id_t GetNextFreeRideId() Ride* GetOrAllocateRide(ride_id_t index) { - if (_rides.size() <= index) + const auto idx = static_cast(index); + if (_rides.size() <= idx) { - _rides.resize(index + 1); + _rides.resize(idx + 1); } - auto result = &_rides[index]; + auto result = &_rides[idx]; result->id = index; return result; } Ride* get_ride(ride_id_t index) { - if (index < _rides.size()) + const auto idx = static_cast(index); + if (idx < _rides.size()) { - auto& ride = _rides[index]; + auto& ride = _rides[idx]; if (ride.type != RIDE_TYPE_NULL) { assert(ride.id == index); @@ -1503,7 +1505,7 @@ void ride_breakdown_add_news_item(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_BROKEN_DOWN, ride->id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_BROKEN_DOWN, static_cast(ride->id), ft); } } @@ -1530,7 +1532,7 @@ static void ride_breakdown_status_update(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_STILL_NOT_FIXED, ride->id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_STILL_NOT_FIXED, static_cast(ride->id), ft); } } } @@ -2181,7 +2183,7 @@ static void ride_entrance_exit_connected(Ride* ride) ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, ride->id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, static_cast(ride->id), ft); } ride->connected_message_throttle = 3; } @@ -2193,7 +2195,7 @@ static void ride_entrance_exit_connected(Ride* ride) ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, ride->id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, static_cast(ride->id), ft); } ride->connected_message_throttle = 3; } @@ -2262,7 +2264,7 @@ static void ride_shop_connected(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, ride->id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, static_cast(ride->id), ft); } ride->connected_message_throttle = 3; @@ -3795,13 +3797,13 @@ bool Ride::Test(RideStatus newStatus, bool isApplying) if (type == RIDE_TYPE_NULL) { - log_warning("Invalid ride type for ride %u", id); + log_warning("Invalid ride type for ride %u", static_cast(id)); return false; } if (newStatus != RideStatus::Simulating) { - window_close_by_number(WC_RIDE_CONSTRUCTION, id); + window_close_by_number(WC_RIDE_CONSTRUCTION, static_cast(id)); } StationIndex stationIndex = ride_mode_check_station_present(this); @@ -3928,9 +3930,11 @@ bool Ride::Open(bool isApplying) // to set the track to its final state and clean up ghosts. // We can't just call close as it would cause a stack overflow during shop creation // with auto open on. - if (WC_RIDE_CONSTRUCTION == gCurrentToolWidget.window_classification && id == gCurrentToolWidget.window_number - && (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) - window_close_by_number(WC_RIDE_CONSTRUCTION, id); + if (WC_RIDE_CONSTRUCTION == gCurrentToolWidget.window_classification + && static_cast(id) == gCurrentToolWidget.window_number && (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) + { + window_close_by_number(WC_RIDE_CONSTRUCTION, static_cast(id)); + } StationIndex stationIndex = ride_mode_check_station_present(this); if (stationIndex == STATION_INDEX_NULL) @@ -4637,7 +4641,7 @@ void invalidate_test_results(Ride* ride) } } } - window_invalidate_by_number(WC_RIDE, ride->id); + window_invalidate_by_number(WC_RIDE, static_cast(ride->id)); } /** @@ -5085,7 +5089,7 @@ void Ride::UpdateMaxVehicles() { num_cars_per_train = numCarsPerTrain; num_vehicles = numVehicles; - window_invalidate_by_number(WC_RIDE, id); + window_invalidate_by_number(WC_RIDE, static_cast(id)); } } @@ -5154,7 +5158,7 @@ void Ride::Crash(uint8_t vehicleIndex) { Formatter ft; FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_HAS_CRASHED, id, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_HAS_CRASHED, static_cast(id), ft); } } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index d0e06c9a88..df0b9c152c 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -122,7 +122,7 @@ static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); - intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(rideIndex)); windowManager->BroadcastIntent(intent); return window_find_by_class(WC_RIDE_CONSTRUCTION); } @@ -239,7 +239,7 @@ void ride_clear_for_construction(Ride* ride) ride->RemoveVehicles(); ride_clear_blocked_tiles(ride); - auto w = window_find_by_number(WC_RIDE, ride->id); + auto w = window_find_by_number(WC_RIDE, static_cast(ride->id)); if (w != nullptr) window_event_resize_call(w); } diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 515e710c43..19b7b1b03d 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -159,10 +159,10 @@ static void ride_ratings_update_state_0(RideRatingUpdateState& state) { ride_id_t currentRide = state.CurrentRide; - currentRide++; - if (currentRide >= MAX_RIDES) + currentRide = static_cast(static_cast(currentRide) + 1); + if (currentRide >= static_cast(MAX_RIDES)) { - currentRide = 0; + currentRide = {}; } auto ride = get_ride(currentRide); @@ -285,7 +285,7 @@ static void ride_ratings_update_state_3(RideRatingUpdateState& state) ride_ratings_calculate(state, ride); ride_ratings_calculate_value(ride); - window_invalidate_by_number(WC_RIDE, state.CurrentRide); + window_invalidate_by_number(WC_RIDE, static_cast(state.CurrentRide)); state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; } @@ -753,7 +753,7 @@ static void ride_ratings_calculate(RideRatingUpdateState& state, Ride* ride) // Create event args object auto obj = DukObject(ctx); - obj.Set("rideId", ride->id); + obj.Set("rideId", static_cast(ride->id)); obj.Set("excitement", originalExcitement); obj.Set("intensity", originalIntensity); obj.Set("nausea", originalNausea); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index a8d3f0aa67..f419047418 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -319,7 +319,8 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) } } - place_virtual_track(this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(0), { 4096, 4096, 0 }); + place_virtual_track( + this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), { 4096, 4096, 0 }); // Resave global vars for scenery reasons. _trackPreviewOrigin = startPos; @@ -438,7 +439,8 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) // Save global vars as they are still used by scenery???? int32_t startZ = _trackPreviewOrigin.z; - place_virtual_track(this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(0), { 4096, 4096, 0 }); + place_virtual_track( + this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), { 4096, 4096, 0 }); _trackPreviewOrigin = { startLoc.x, startLoc.y, startZ }; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; @@ -1931,7 +1933,8 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o int32_t mapSize = gMapSize << 4; _currentTrackPieceDirection = 0; - int32_t z = place_virtual_track(td6, PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(0), { mapSize, mapSize, 16 }); + int32_t z = place_virtual_track( + td6, PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(static_cast(0)), { mapSize, mapSize, 16 }); if (_trackDesignPlaceStateHasScenery) { diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 659d40b00c..7b29615007 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1600,7 +1600,7 @@ void Vehicle::UpdateMeasurements() curRide->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS; curRide->lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; ClearUpdateFlag(VEHICLE_UPDATE_FLAG_TESTING); - window_invalidate_by_number(WC_RIDE, ride); + window_invalidate_by_number(WC_RIDE, static_cast(ride)); return; } @@ -3114,7 +3114,7 @@ static void test_finish(Ride& ride) totalTime = std::max(totalTime, 1u); ride.average_speed = ride.average_speed / totalTime; - window_invalidate_by_number(WC_RIDE, ride.id); + window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); } void Vehicle::UpdateTestFinish() @@ -3164,7 +3164,7 @@ static void test_reset(Ride& ride, StationIndex curStation) } ride.total_air_time = 0; ride.current_test_station = curStation; - window_invalidate_by_number(WC_RIDE, ride.id); + window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); } void Vehicle::TestReset() @@ -3570,7 +3570,7 @@ void Vehicle::CheckIfMissing() curRide->FormatNameTo(ft); ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular); - News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, ride, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, static_cast(ride), ft); } } @@ -5305,7 +5305,8 @@ static void ride_train_crash(Ride* ride, uint16_t numFatalities) { ride->FormatNameTo(ft); News::AddItemToQueue( - News::ItemType::Ride, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, ride->id, ft); + News::ItemType::Ride, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, + static_cast(ride->id), ft); } if (gParkRatingCasualtyPenalty < 500) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 4b127d5a69..2f363306b6 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -893,7 +893,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std auto& rideCreateResult = static_cast(*result.get()); if (rideCreateResult.rideIndex != RIDE_ID_NULL) { - obj.Set("ride", rideCreateResult.rideIndex); + obj.Set("ride", static_cast(rideCreateResult.rideIndex)); } } else if (action.GetType() == GameCommand::HireNewStaffMember) From 2768910fbf4d80f93b6ea8b2a31f963fee24691d Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:00:38 +0300 Subject: [PATCH 348/681] Allow Formatter to accept ride_id_t --- src/openrct2/localisation/Formatter.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index 7151fdbf94..fb392c9d97 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -16,6 +16,8 @@ extern thread_local uint8_t gCommonFormatArgs[80]; +enum class ride_id_t : uint16_t; + class Formatter { std::array Buffer{}; @@ -83,6 +85,7 @@ public: std::is_same_v::type, int32_t> || std::is_same_v::type, money32> || std::is_same_v::type, money64> || + std::is_same_v::type, ride_id_t> || std::is_same_v::type, rct_string_id> || std::is_same_v::type, uint16_t> || std::is_same_v::type, uint32_t> || @@ -92,7 +95,7 @@ public: // clang-format on uint64_t convertedValue; - if constexpr (std::is_integral_v) + if constexpr (std::is_integral_v || std::is_enum_v) { convertedValue = static_cast(value); } From e65a1f6fc52961e897620091cb1d941fbb1be854 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:02:23 +0300 Subject: [PATCH 349/681] Forward NetworkRideId_t to ride_id_t and adjust serialiser --- src/openrct2/core/DataSerialiserTraits.h | 8 ++++---- src/openrct2/network/NetworkTypes.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 7cea7fe8f5..ec862bab38 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -218,7 +218,7 @@ template<> struct DataSerializerTraits_t { static void encode(OpenRCT2::IStream* stream, const NetworkRideId_t& val) { - uint32_t temp = static_cast(val.id); + uint32_t temp = static_cast(val); temp = ByteSwapBE(temp); stream->Write(&temp); } @@ -226,16 +226,16 @@ template<> struct DataSerializerTraits_t { uint32_t temp; stream->Read(&temp); - val.id = static_cast(ByteSwapBE(temp)); + val = static_cast(ByteSwapBE(temp)); } static void log(OpenRCT2::IStream* stream, const NetworkRideId_t& val) { char rideId[28] = {}; - snprintf(rideId, sizeof(rideId), "%u", val.id); + snprintf(rideId, sizeof(rideId), "%u", val); stream->Write(rideId, strlen(rideId)); - auto ride = get_ride(val.id); + auto ride = get_ride(val); if (ride != nullptr) { auto rideName = ride->GetName(); diff --git a/src/openrct2/network/NetworkTypes.h b/src/openrct2/network/NetworkTypes.h index 6e4df2285b..c173fbfb16 100644 --- a/src/openrct2/network/NetworkTypes.h +++ b/src/openrct2/network/NetworkTypes.h @@ -126,10 +126,11 @@ template struct NetworkObjectId_t }; #pragma pack(pop) +using NetworkRideId_t = ride_id_t; + // NOTE: When adding new types make sure to have no duplicate _TypeID's otherwise // there is no way to specialize templates if they have the exact symbol. using NetworkPlayerId_t = NetworkObjectId_t; -using NetworkRideId_t = NetworkObjectId_t; using NetworkCheatType_t = NetworkObjectId_t; enum class NetworkStatisticsGroup : uint32_t From b9c679d23e9cd10347cf2f03344c2e8cf7769169 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:03:00 +0300 Subject: [PATCH 350/681] Fix window list only able to hold 255 indices --- src/openrct2/interface/Window_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 9fd1784815..396f46839d 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -48,7 +48,7 @@ struct rct_window rct_windownumber number{}; uint16_t flags{}; rct_scroll scrolls[3]; - uint8_t list_item_positions[1024]{}; + uint32_t list_item_positions[1024]{}; uint16_t no_list_items{}; // 0 for no items int16_t selected_list_item{}; // -1 for none selected union From 47b782ec2d451eb2fe9d8c5a934fd24e178f6439 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:04:15 +0300 Subject: [PATCH 351/681] Use correct type in path finding code --- test/tests/Pathfinding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index df55e74b3e..c34ea49c8f 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -64,7 +64,7 @@ protected: return nullptr; } - static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, int targetRideID) + static bool FindPath(TileCoordsXYZ* pos, const TileCoordsXYZ& goal, int expectedSteps, ride_id_t targetRideID) { // Our start position is in tile coordinates, but we need to give the peep spawn // position in actual world coords (32 units per tile X/Y, 8 per Z level). From ca605d6f82bc758a15a16906d6b73009084de40c Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:07:53 +0300 Subject: [PATCH 352/681] Refactor object selection to use RideManager --- src/openrct2/EditorObjectSelectionSession.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 622262fe06..bafce4fc47 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -192,14 +192,10 @@ void setup_in_use_selection_flags() } } while (tile_element_iterator_next(&iter)); - for (ride_id_t ride_index = 0; ride_index < MAX_RIDES; ride_index++) + for (auto& ride : GetRideManager()) { - auto ride = get_ride(ride_index); - if (ride != nullptr) - { - ObjectEntryIndex type = ride->subtype; - Editor::SetSelectedObject(ObjectType::Ride, type, OBJECT_SELECTION_FLAG_SELECTED); - } + ObjectEntryIndex type = ride.subtype; + Editor::SetSelectedObject(ObjectType::Ride, type, OBJECT_SELECTION_FLAG_SELECTED); } // Apply selected object status for hacked vehicles that may not have an associated ride From 18fa68813d03364ba4540445b2fc55b4a210d88f Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:09:51 +0300 Subject: [PATCH 353/681] Adjust importer/exporter --- src/openrct2/rct2/S6Exporter.cpp | 14 +++++++------- src/openrct2/rct2/S6Importer.cpp | 12 +++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 2cffe9bc09..a1ef85dc30 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -609,7 +609,7 @@ void S6Exporter::ExportRides() const Ride nullRide{}; for (int32_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++) { - const auto* src = get_ride(index); + const auto* src = get_ride(static_cast(index)); if (src == nullptr) { src = &nullRide; @@ -931,9 +931,9 @@ void S6Exporter::ExportRideMeasurements() { // Get all the ride measurements std::vector ridesWithMeasurements; - for (ride_id_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) + for (size_t i = 0; i < RCT12_MAX_RIDES_IN_PARK; i++) { - auto ride = get_ride(i); + auto ride = get_ride(static_cast(i)); if (ride != nullptr && ride->measurement != nullptr) { ridesWithMeasurements.push_back(ride); @@ -958,8 +958,8 @@ void S6Exporter::ExportRideMeasurements() ExportRideMeasurement(_s6.ride_measurements[i], *src->measurement.get()); auto rideId = src->id; - dst.ride_index = rideId; - _s6.rides[rideId].measurement_index = i; + dst.ride_index = static_cast(rideId); + _s6.rides[static_cast(rideId)].measurement_index = i; i++; } } @@ -1224,7 +1224,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpriteVehicle* dst, const Vehicle* dst->remaining_distance = src->remaining_distance; dst->velocity = src->velocity; dst->acceleration = src->acceleration; - dst->ride = src->ride; + dst->ride = static_cast(src->ride); dst->vehicle_type = src->vehicle_type; dst->colours = src->colours; dst->track_progress = src->track_progress; @@ -1840,7 +1840,7 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, const TileElement* src // Skipping IsHighlighted() // This has to be done last, since the maze entry shares fields with the colour and sequence fields. - auto ride = get_ride(dst2->GetRideIndex()); + auto ride = get_ride(static_cast(dst2->GetRideIndex())); if (ride) { if (ride->type == RIDE_TYPE_MAZE) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5510056d77..1ae9885831 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -530,8 +530,9 @@ public: auto src = &_s6.rides[index]; if (src->type != RIDE_TYPE_NULL) { - auto dst = GetOrAllocateRide(index); - ImportRide(dst, src, index); + const auto rideId = static_cast(index); + auto dst = GetOrAllocateRide(rideId); + ImportRide(dst, src, rideId); } } } @@ -872,7 +873,8 @@ public: { if (src.ride_index != RCT12_RIDE_ID_NULL) { - auto ride = get_ride(src.ride_index); + const auto rideId = static_cast(src.ride_index); + auto ride = get_ride(rideId); if (ride != nullptr) { ride->measurement = std::make_unique(); @@ -1061,7 +1063,7 @@ public: { if (sprite.unknown.sprite_identifier == RCT12SpriteIdentifier::Peep) { - if (sprite.peep.current_ride == rideIndex + if (sprite.peep.current_ride == static_cast(rideIndex) && (static_cast(sprite.peep.state) == PeepState::OnRide || static_cast(sprite.peep.state) == PeepState::EnteringRide)) { @@ -1597,7 +1599,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->remaining_distance = src->remaining_distance; dst->velocity = src->velocity; dst->acceleration = src->acceleration; - dst->ride = src->ride; + dst->ride = static_cast(src->ride); dst->vehicle_type = src->vehicle_type; dst->colours = src->colours; dst->track_progress = src->track_progress; From ec65a04883736978073d9293e95c62f8bb60c9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 18:36:35 +0300 Subject: [PATCH 354/681] Cast fixes --- src/openrct2-ui/windows/Ride.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e014523787..9b9aa774bd 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1552,7 +1552,7 @@ static void window_ride_anchor_border_widgets(rct_window* w) static std::optional GetStationIndexFromViewSelection(const rct_window& w) { - const auto* ride = get_ride(w.number); + const auto* ride = get_ride(static_cast(w.number)); if (ride == nullptr) return {}; From 078d12a2070f1aabe4125a1fbde31c4936f28bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 18:36:47 +0300 Subject: [PATCH 355/681] Fix S4 importer --- src/openrct2/rct1/S4Importer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 436fc72c41..fbfd9fa4a8 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -716,7 +716,8 @@ namespace RCT1 { if (_s4.rides[i].type != RideType::Null) { - ImportRide(GetOrAllocateRide(i), &_s4.rides[i], i); + const auto rideId = static_cast(i); + ImportRide(GetOrAllocateRide(rideId), &_s4.rides[i], rideId); } } } @@ -2482,10 +2483,12 @@ namespace RCT1 { if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) { + const auto firstRideId = static_cast(0); + // First, make the queuing peep exit for (auto peep : EntityList()) { - if (peep->State == PeepState::QueuingFront && peep->CurrentRide == 0) + if (peep->State == PeepState::QueuingFront && peep->CurrentRide == firstRideId) { peep->RemoveFromQueue(); peep->SetState(PeepState::Falling); @@ -2494,7 +2497,7 @@ namespace RCT1 } // Now, swap the entrance and exit. - auto ride = get_ride(0); + auto ride = get_ride(firstRideId); if (ride != nullptr) { auto entranceCoords = ride->stations[0].Exit; @@ -2666,13 +2669,13 @@ namespace RCT1 { auto* dst = CreateEntityAt<::Vehicle>(srcBase.sprite_index); auto* src = static_cast(&srcBase); - const auto* ride = get_ride(src->ride); + const auto* ride = get_ride(static_cast(src->ride)); if (ride == nullptr) return; uint8_t vehicleEntryIndex = RCT1::GetVehicleSubEntryIndex(src->vehicle_type); - dst->ride = src->ride; + dst->ride = static_cast(src->ride); dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype); dst->vehicle_type = vehicleEntryIndex; From e1e29379bafb20a8cdf174bd9206592000463f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 18:37:49 +0300 Subject: [PATCH 356/681] Add thought insertion overload with strong ride id type --- src/openrct2/peep/Guest.cpp | 4 ++++ src/openrct2/peep/Peep.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index b1bc71cba3..deb4807785 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6811,6 +6811,10 @@ void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) InsertNewThought(thought_type, static_cast(shopItem)); } +void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t ride) +{ + InsertNewThought(thought_type, static_cast(ride)); +} /** * * rct2: 0x699F5A diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 5165766865..08b7f6a340 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -774,6 +774,7 @@ public: void UpdateEasterEggInteractions(); void InsertNewThought(PeepThoughtType thought_type); void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); + void InsertNewThought(PeepThoughtType thought_type, ride_id_t ride); void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); static Guest* Generate(const CoordsXYZ& coords); bool UpdateQueuePosition(PeepActionType previous_action); From eda3188ecf667546ed045627968a3aeb68d5305f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 18:50:21 +0300 Subject: [PATCH 357/681] Fix rebase --- src/openrct2/peep/Guest.cpp | 23 ++++++++++--------- src/openrct2/rct12/RCT12.h | 2 +- src/openrct2/rct2/S6Exporter.cpp | 5 ++-- .../scripting/bindings/entity/ScVehicle.cpp | 8 +++---- .../scripting/bindings/entity/ScVehicle.hpp | 4 ++-- .../scripting/bindings/ride/ScRide.cpp | 2 +- .../bindings/world/ScTileElement.cpp | 14 +++++------ .../bindings/world/ScTileElement.hpp | 2 +- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index deb4807785..7842dff1e1 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1822,7 +1822,8 @@ Ride* Guest::FindBestRideToGoOn() Ride* mostExcitingRide = nullptr; for (auto& ride : GetRideManager()) { - if (rideConsideration.size() > ride.id && rideConsideration[ride.id]) + const auto rideIndex = EnumValue(ride.id); + if (rideConsideration.size() > rideIndex && rideConsideration[rideIndex]) { if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL)) { @@ -1853,7 +1854,7 @@ std::bitset Guest::FindRidesToGoOn() { if (!HasRidden(&ride)) { - rideConsideration[ride.id] = true; + rideConsideration[EnumValue(ride.id)] = true; } } } @@ -1874,7 +1875,7 @@ std::bitset Guest::FindRidesToGoOn() for (auto* trackElement : TileElementsView(location)) { auto rideIndex = trackElement->GetRideIndex(); - rideConsideration[rideIndex] = true; + rideConsideration[EnumValue(rideIndex)] = true; } } } @@ -1884,7 +1885,7 @@ std::bitset Guest::FindRidesToGoOn() { if (ride.highest_drop_height > 66 || ride.excitement >= RIDE_RATING(8, 00)) { - rideConsideration[ride.id] = true; + rideConsideration[EnumValue(ride.id)] = true; } } } @@ -3105,7 +3106,7 @@ template static void peep_head_for_nearest_ride(Guest* peep, bool co { if (predicate(ride)) { - rideConsideration[ride.id] = true; + rideConsideration[EnumValue(ride.id)] = true; } } } @@ -3133,18 +3134,18 @@ template static void peep_head_for_nearest_ride(Guest* peep, bool co if (!predicate(*ride)) continue; - rideConsideration[rideIndex] = true; + rideConsideration[EnumValue(ride->id)] = true; } } } } // Filter the considered rides - uint8_t potentialRides[MAX_RIDES]; + ride_id_t potentialRides[MAX_RIDES]; size_t numPotentialRides = 0; for (auto& ride : GetRideManager()) { - if (rideConsideration[ride.id]) + if (rideConsideration[EnumValue(ride.id)]) { if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL)) { @@ -3657,7 +3658,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, CurrentRide, ft); + News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, EnumValue(CurrentRide), ft); } } @@ -3811,7 +3812,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) if (queueTime != ride->stations[CurrentRideStation].QueueTime) { ride->stations[CurrentRideStation].QueueTime = queueTime; - window_invalidate_by_number(WC_RIDE, CurrentRide); + window_invalidate_by_number(WC_RIDE, EnumValue(CurrentRide)); } if (PeepFlags & PEEP_FLAGS_TRACKING) @@ -7458,7 +7459,7 @@ void Guest::RemoveRideFromMemory(ride_id_t rideId) break; // Ride ids and shop item ids might have the same value, look only for ride thoughts. - if (IsThoughtShopItemRelated(entry.type) || entry.item != rideId) + if (IsThoughtShopItemRelated(entry.type) || entry.rideId != rideId) { it++; continue; diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 418b3f08a6..9507cb1c90 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -966,7 +966,7 @@ template std::vector RCT12GetRidesBeenOn(T* srcPeep) { if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8))) { - ridesBeenOn.push_back(i); + ridesBeenOn.push_back(static_cast(i)); } } return ridesBeenOn; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index a1ef85dc30..e7ffb9ee58 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -170,7 +170,7 @@ static void ride_all_has_any_track_elements(std::arrayIsGhost()) continue; - rideIndexArray[it.element->AsTrack()->GetRideIndex()] = true; + rideIndexArray[EnumValue(it.element->AsTrack()->GetRideIndex())] = true; } } @@ -1330,7 +1330,8 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src) { for (auto rideId : *rideHistory) { - dst->rides_been_on[rideId / 8] |= (1 << (rideId % 8)); + const auto rideIndex = EnumValue(rideId); + dst->rides_been_on[rideIndex / 8] |= (1 << (rideIndex % 8)); } } dst->item_extra_flags = static_cast(src->GetItemFlags() >> 32); diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index 90389d7157..2f4be2efcb 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -135,18 +135,18 @@ namespace OpenRCT2::Scripting } } - ride_id_t ScVehicle::ride_get() const + int32_t ScVehicle::ride_get() const { auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->ride : 0; + return EnumValue(vehicle != nullptr ? vehicle->ride : RIDE_ID_NULL); } - void ScVehicle::ride_set(ride_id_t value) + void ScVehicle::ride_set(int32_t value) { ThrowIfGameStateNotMutable(); auto vehicle = GetVehicle(); if (vehicle != nullptr) { - vehicle->ride = value; + vehicle->ride = static_cast(value); } } diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.hpp b/src/openrct2/scripting/bindings/entity/ScVehicle.hpp index 57d29c6194..c98cd5b3dc 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.hpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.hpp @@ -35,8 +35,8 @@ namespace OpenRCT2::Scripting uint8_t spriteType_get() const; void spriteType_set(uint8_t value); - ride_id_t ride_get() const; - void ride_set(ride_id_t value); + int32_t ride_get() const; + void ride_set(int32_t value); uint8_t numSeats_get() const; void numSeats_set(uint8_t value); diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp index 9e81db6ce2..d03c54d141 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -27,7 +27,7 @@ namespace OpenRCT2::Scripting int32_t ScRide::id_get() const { - return _rideId; + return EnumValue(_rideId); } std::shared_ptr ScRide::object_get() diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 1cc7aadbfb..18f644c1f9 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -431,7 +431,7 @@ namespace OpenRCT2::Scripting { auto el = _element->AsPath(); if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL) - duk_push_int(ctx, el->GetRideIndex()); + duk_push_int(ctx, EnumValue(el->GetRideIndex())); else duk_push_null(ctx); break; @@ -439,13 +439,13 @@ namespace OpenRCT2::Scripting case TILE_ELEMENT_TYPE_TRACK: { auto el = _element->AsTrack(); - duk_push_int(ctx, el->GetRideIndex()); + duk_push_int(ctx, EnumValue(el->GetRideIndex())); break; } case TILE_ELEMENT_TYPE_ENTRANCE: { auto el = _element->AsEntrance(); - duk_push_int(ctx, el->GetRideIndex()); + duk_push_int(ctx, EnumValue(el->GetRideIndex())); break; } default: @@ -456,7 +456,7 @@ namespace OpenRCT2::Scripting } return DukValue::take_from_stack(ctx); } - void ScTileElement::ride_set(ride_id_t value) + void ScTileElement::ride_set(int32_t value) { ThrowIfGameStateNotMutable(); switch (_element->GetType()) @@ -466,7 +466,7 @@ namespace OpenRCT2::Scripting auto el = _element->AsPath(); if (!el->HasAddition()) { - el->SetRideIndex(value); + el->SetRideIndex(static_cast(value)); Invalidate(); } break; @@ -474,14 +474,14 @@ namespace OpenRCT2::Scripting case TILE_ELEMENT_TYPE_TRACK: { auto el = _element->AsTrack(); - el->SetRideIndex(value); + el->SetRideIndex(static_cast(value)); Invalidate(); break; } case TILE_ELEMENT_TYPE_ENTRANCE: { auto el = _element->AsEntrance(); - el->SetRideIndex(value); + el->SetRideIndex(static_cast(value)); Invalidate(); break; } diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp index 9b0fcd7060..7fa36099ea 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.hpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -85,7 +85,7 @@ namespace OpenRCT2::Scripting void sequence_set(uint8_t value); DukValue ride_get() const; - void ride_set(ride_id_t value); + void ride_set(int32_t value); DukValue station_get() const; void station_set(uint8_t value); From 18af5d49501097c9322f5ad83e745a7c99609127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 19:04:53 +0300 Subject: [PATCH 358/681] Use union for window association to prevent casts --- .../windows/DemolishRidePrompt.cpp | 8 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/NewCampaign.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 163 +++++++++--------- src/openrct2-ui/windows/RideConstruction.cpp | 6 +- src/openrct2/interface/Window_internal.h | 6 +- 6 files changed, 96 insertions(+), 93 deletions(-) diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 88f61a5d8b..b95252ea82 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -125,7 +125,7 @@ static void window_ride_demolish_mouseup(rct_window* w, rct_widgetindex widgetIn { case WIDX_DEMOLISH: { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); ride_action_modify(ride, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY); break; } @@ -142,7 +142,7 @@ static void window_ride_refurbish_mouseup(rct_window* w, rct_widgetindex widgetI { case WIDX_REFURBISH: { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); ride_action_modify(ride, RIDE_MODIFY_RENEW, GAME_COMMAND_FLAG_APPLY); break; } @@ -161,7 +161,7 @@ static void window_ride_demolish_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID : STR_DEMOLISH_RIDE_ID_MONEY; @@ -178,7 +178,7 @@ static void window_ride_refurbish_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto stringId = (gParkFlags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY : STR_REFURBISH_RIDE_ID_MONEY; diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 9d7a3654cc..aa8e791130 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -181,7 +181,7 @@ static void window_maze_construction_entrance_mouseup(rct_window* w, rct_widgeti return; gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = static_cast(w->number); + gRideEntranceExitPlaceRideIndex = w->rideId; gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 78139854cb..b091ac7a4a 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -207,9 +207,9 @@ public: else { int32_t numItems = 0; - for (auto rideId : RideList) + for (auto rideIndex : RideList) { - auto curRide = get_ride(rideId); + auto curRide = get_ride(rideIndex); if (curRide != nullptr) { // HACK until dropdown items have longer argument buffers diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 9b9aa774bd..7fb73ba416 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -958,7 +958,7 @@ static void window_ride_draw_tab_main(rct_drawpixelinfo* dpi, rct_window* w) rct_widgetindex widgetIndex = WIDX_TAB_1 + WINDOW_RIDE_PAGE_MAIN; if (!(w->disabled_widgets & (1LL << widgetIndex))) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { int32_t spriteIndex = 0; @@ -1014,7 +1014,7 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w) screenCoords = ScreenCoordsXY{ widget->width() / 2, widget->height() - 12 }; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -1108,7 +1108,7 @@ static void window_ride_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w) static void window_ride_disable_tabs(rct_window* w) { uint32_t disabled_tabs = 0; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -1585,7 +1585,7 @@ static void window_ride_init_viewport(rct_window* w) if (w->page != WINDOW_RIDE_PAGE_MAIN) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -1717,7 +1717,7 @@ static void window_ride_init_viewport(rct_window* w) */ static void window_ride_rename(rct_window* w) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto rideName = ride->GetName(); @@ -1751,7 +1751,7 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) break; case WIDX_CONSTRUCTION: { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { ride_construct(ride); @@ -1776,7 +1776,7 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_TEST_LIGHT: case WIDX_OPEN_LIGHT: { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { RideStatus status; @@ -1814,7 +1814,7 @@ static void window_ride_main_resize(rct_window* w) { minHeight += 20 + RCT1_LIGHT_OFFSET; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { #ifdef __SIMULATE_IN_RIDE_WINDOW__ @@ -1846,7 +1846,7 @@ static void window_ride_main_resize(rct_window* w) static void window_ride_show_view_dropdown(rct_window* w, rct_widget* widget) { rct_widget* dropdownWidget = widget - 1; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -1962,7 +1962,7 @@ static void window_ride_set_dropdown(RideStatusDropdownInfo& info, RideStatus st static void window_ride_show_open_dropdown(rct_window* w, rct_widget* widget) { RideStatusDropdownInfo info; - info.Ride = get_ride(static_cast(w->number)); + info.Ride = get_ride(w->rideId); if (info.Ride == nullptr) return; @@ -2030,7 +2030,7 @@ static void populate_ride_type_dropdown() static void window_ride_show_ride_type_dropdown(rct_window* w, rct_widget* widget) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2126,7 +2126,7 @@ static void populate_vehicle_type_dropdown(Ride* ride) static void window_ride_show_vehicle_type_dropdown(rct_window* w, rct_widget* widget) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2193,7 +2193,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex if (dropdownIndex == -1) { dropdownIndex = w->ride.view + 1; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { if (dropdownIndex != 0 && dropdownIndex <= ride->num_vehicles @@ -2214,7 +2214,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex break; case WIDX_OPEN: { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto status = RideStatus::Closed; @@ -2251,7 +2251,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex uint8_t rideType = RideDropdownData[rideLabelId].ride_type_id; if (rideType < RIDE_TYPE_COUNT) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; 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 @@ -2278,7 +2278,7 @@ static void window_ride_main_update(rct_window* w) widget_invalidate(w, WIDX_TAB_1); // Update status - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) @@ -2313,7 +2313,7 @@ static void window_ride_main_textinput(rct_window* w, rct_widgetindex widgetInde if (widgetIndex != WIDX_RENAME || text == nullptr) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { ride_set_name(ride, text, 0); @@ -2347,7 +2347,7 @@ static void window_ride_main_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2479,7 +2479,7 @@ static void window_ride_main_invalidate(rct_window* w) static rct_string_id window_ride_get_status_overall_view(rct_window* w, Formatter& ft) { auto stringId = STR_NONE; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { ride->FormatStatusTo(ft); @@ -2498,7 +2498,7 @@ static rct_string_id window_ride_get_status_overall_view(rct_window* w, Formatte */ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return STR_EMPTY; @@ -2546,7 +2546,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft */ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return STR_NONE; @@ -2597,7 +2597,7 @@ static rct_string_id window_ride_get_status_station(rct_window* w, Formatter& ft */ static rct_string_id window_ride_get_status(rct_window* w, Formatter& ft) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (w->ride.view == 0) return window_ride_get_status_overall_view(w, ft); if (ride != nullptr && w->ride.view <= ride->num_vehicles) @@ -2627,7 +2627,7 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi) } // View dropdown - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2709,7 +2709,7 @@ static void window_ride_vehicle_resize(rct_window* w) */ static void window_ride_vehicle_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2752,7 +2752,7 @@ static void window_ride_vehicle_dropdown(rct_window* w, rct_widgetindex widgetIn case WIDX_VEHICLE_TYPE_DROPDOWN: if (dropdownIndex >= 0 && static_cast(dropdownIndex) < VehicleDropdownData.size()) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto newRideType = VehicleDropdownData[dropdownIndex].subtype_id; @@ -2777,7 +2777,7 @@ static void window_ride_vehicle_update(rct_window* w) static OpenRCT2String window_ride_vehicle_tooltip( rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return { STR_NONE, {} }; @@ -2844,7 +2844,7 @@ static void window_ride_vehicle_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2924,7 +2924,7 @@ static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -2999,7 +2999,7 @@ static rct_vehicle_paintinfo _sprites_to_draw[144]; */ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3092,7 +3092,7 @@ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dp */ static void window_ride_mode_tweak_increase(rct_window* w) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3118,8 +3118,7 @@ static void window_ride_mode_tweak_increase(rct_window* w) */ static void window_ride_mode_tweak_decrease(rct_window* w) { - const auto rideId = static_cast(w->number); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3134,7 +3133,7 @@ static void window_ride_mode_tweak_decrease(rct_window* w) uint8_t decrement = ride->mode == RideMode::Dodgems ? 10 : 1; set_operating_setting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); + w->rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); } /** @@ -3146,7 +3145,7 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) rct_widget* dropdownWidget; dropdownWidget = widget - 1; - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3186,7 +3185,7 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) */ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3210,7 +3209,7 @@ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget) */ static void window_ride_operating_mouseup(rct_window* w, rct_widgetindex widgetIndex) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3267,7 +3266,7 @@ static void window_ride_operating_resize(rct_window* w) */ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3353,7 +3352,7 @@ static void window_ride_operating_dropdown(rct_window* w, rct_widgetindex widget if (dropdownIndex == -1) return; - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3398,7 +3397,7 @@ static void window_ride_operating_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_3); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; @@ -3424,7 +3423,7 @@ static void window_ride_operating_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3665,7 +3664,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3697,7 +3696,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_ride_locate_mechanic(rct_window* w) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3787,7 +3786,7 @@ static void window_ride_maintenance_resize(rct_window* w) */ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3891,7 +3890,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg if (dropdownIndex == -1) return; - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -3998,7 +3997,7 @@ static void window_ride_maintenance_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_4); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -4021,7 +4020,7 @@ static void window_ride_maintenance_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4063,7 +4062,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4218,7 +4217,7 @@ static void window_ride_set_track_colour_scheme(rct_window* w, const ScreenCoord return; if (info.Element->GetType() != TILE_ELEMENT_TYPE_TRACK) return; - if (info.Element->AsTrack()->GetRideIndex() != static_cast(w->number)) + if (info.Element->AsTrack()->GetRideIndex() != w->rideId) return; if (info.Element->AsTrack()->GetColourScheme() == newColourScheme) return; @@ -4296,7 +4295,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn int32_t i, numItems; rct_string_id stringId; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4429,7 +4428,7 @@ static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetInd if (dropdownIndex == -1) return; - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; switch (widgetIndex) { case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: @@ -4571,7 +4570,7 @@ static void window_ride_colour_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4797,7 +4796,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) rct_drawpixelinfo clippedDpi; rct_widget* widget; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4897,7 +4896,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_ride_colour_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -4960,7 +4959,7 @@ static std::vector window_ride_current_music_style_order; */ static void window_ride_toggle_music(rct_window* w) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride != nullptr) { @@ -5037,7 +5036,7 @@ static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetInd return; auto dropdownWidget = widget - 1; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -5116,7 +5115,7 @@ static void window_ride_music_dropdown(rct_window* w, rct_widgetindex widgetInde && static_cast(dropdownIndex) < window_ride_current_music_style_order.size()) { auto musicStyle = window_ride_current_music_style_order[dropdownIndex]; - set_operating_setting(static_cast(w->number), RideSetSetting::MusicType, musicStyle); + set_operating_setting(w->rideId, RideSetSetting::MusicType, musicStyle); } } @@ -5146,7 +5145,7 @@ static void window_ride_music_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -5237,7 +5236,7 @@ static void setup_scenery_selection(rct_window* w) while (tool_set(w, WIDX_BACKGROUND, Tool::Crosshair)) ; - gTrackDesignSaveRideIndex = static_cast(w->number); + gTrackDesignSaveRideIndex = w->rideId; track_design_save_init(); gGamePaused |= GAME_PAUSED_SAVING_TRACK; @@ -5300,7 +5299,7 @@ static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* pat */ static void window_ride_measurements_design_save(rct_window* w) { - Ride* ride = get_ride(static_cast(w->number)); + Ride* ride = get_ride(w->rideId); _trackDesign = ride->SaveToTrackDesign(); if (!_trackDesign) { @@ -5392,7 +5391,7 @@ static void window_ride_measurements_mousedown(rct_window* w, rct_widgetindex wi if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -5518,7 +5517,7 @@ static void window_ride_measurements_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -5581,7 +5580,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi } else { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -5905,7 +5904,7 @@ static void window_ride_graphs_update(rct_window* w) x = w->scrolls[0].h_left; if (!(w->list_information_type & 0x8000)) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5930,7 +5929,7 @@ static void window_ride_graphs_scrollgetheight(rct_window* w, int32_t scrollInde *width = window_ride_graphs_widgets[WIDX_GRAPH].width() - 2; // Get measurement size - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { RideMeasurement* measurement{}; @@ -5959,7 +5958,7 @@ static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widget { if (widgetIndex == WIDX_GRAPH) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto [measurement, message] = ride->GetMeasurement(); @@ -5999,7 +5998,7 @@ static void window_ride_graphs_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6065,7 +6064,7 @@ static void window_ride_graphs_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi gfx_clear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); auto widget = &window_ride_graphs_widgets[WIDX_GRAPH]; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) { return; @@ -6258,7 +6257,7 @@ static void update_same_price_throughout_flags(ShopItem shop_item) */ static void window_ride_income_toggle_primary_price(rct_window* w) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6295,7 +6294,7 @@ static void window_ride_income_toggle_primary_price(rct_window* w) */ static void window_ride_income_toggle_secondary_price(rct_window* w) { - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; auto ride = get_ride(rideId); if (ride == nullptr) return; @@ -6316,7 +6315,7 @@ static void window_ride_income_toggle_secondary_price(rct_window* w) static void window_ride_income_set_primary_price(rct_window* w, money16 price) { - auto rideSetPriceAction = RideSetPriceAction(static_cast(w->number), price, true); + auto rideSetPriceAction = RideSetPriceAction(w->rideId, price, true); GameActions::Execute(&rideSetPriceAction); } @@ -6329,7 +6328,7 @@ static void window_ride_income_increase_primary_price(rct_window* w) if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6349,7 +6348,7 @@ static void window_ride_income_decrease_primary_price(rct_window* w) if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6362,7 +6361,7 @@ static void window_ride_income_decrease_primary_price(rct_window* w) static money16 window_ride_income_get_secondary_price(rct_window* w) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return 0; @@ -6372,13 +6371,13 @@ static money16 window_ride_income_get_secondary_price(rct_window* w) static void window_ride_income_set_secondary_price(rct_window* w, money16 price) { - auto rideSetPriceAction = RideSetPriceAction(static_cast(w->number), price, false); + auto rideSetPriceAction = RideSetPriceAction(w->rideId, price, false); GameActions::Execute(&rideSetPriceAction); } static bool window_ride_income_can_modify_primary_price(rct_window* w) { - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return false; @@ -6443,7 +6442,7 @@ static void window_ride_income_mouseup(rct_window* w, rct_widgetindex widgetInde if (!window_ride_income_can_modify_primary_price(w)) return; - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { money_to_string(static_cast(ride->price[0]), _moneyInputText, MONEY_STRING_MAXLENGTH, true); @@ -6513,7 +6512,7 @@ static void window_ride_income_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_9); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; @@ -6560,7 +6559,7 @@ static void window_ride_income_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6671,7 +6670,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -6839,7 +6838,7 @@ static void window_ride_customer_update(rct_window* w) window_event_invalidate_call(w); widget_invalidate(w, WIDX_TAB_10); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) { ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; @@ -6862,7 +6861,7 @@ static void window_ride_customer_invalidate(rct_window* w) window_ride_set_pressed_tab(w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride != nullptr) { auto ft = Formatter::Common(); @@ -6898,7 +6897,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(w, dpi); window_ride_draw_tab_images(dpi, w); - auto ride = get_ride(static_cast(w->number)); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index d8424785d3..5cdb6c6934 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1937,7 +1937,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) _currentTrackPieceType, 0, { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, _currentTrackPieceDirection }); - const auto rideId = static_cast(w->number); + const auto rideId = w->rideId; trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -1987,7 +1987,7 @@ static void window_ride_construction_entrance_click(rct_window* w) else { gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_ENTRANCE; - gRideEntranceExitPlaceRideIndex = static_cast(w->number); + gRideEntranceExitPlaceRideIndex = w->rideId; gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); ride_construction_invalidate_current_track(); @@ -2017,7 +2017,7 @@ static void window_ride_construction_exit_click(rct_window* w) else { gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = static_cast(w->number); + gRideEntranceExitPlaceRideIndex = w->rideId; gRideEntranceExitPlaceStationIndex = 0; input_set_flag(INPUT_FLAG_6, true); ride_construction_invalidate_current_track(); diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 396f46839d..ed63206e35 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -45,7 +45,11 @@ struct rct_window int16_t max_width{}; int16_t min_height{}; int16_t max_height{}; - rct_windownumber number{}; + union + { + rct_windownumber number{}; + ride_id_t rideId; + }; uint16_t flags{}; rct_scroll scrolls[3]; uint32_t list_item_positions[1024]{}; From 120bb10fd5e48f9bf4c139db515d944cbc3c7650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 19:06:28 +0300 Subject: [PATCH 359/681] Fix serialiser traits --- src/openrct2/core/DataSerialiserTraits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index ec862bab38..b3cfc9dc04 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -231,7 +231,7 @@ template<> struct DataSerializerTraits_t static void log(OpenRCT2::IStream* stream, const NetworkRideId_t& val) { char rideId[28] = {}; - snprintf(rideId, sizeof(rideId), "%u", val); + snprintf(rideId, sizeof(rideId), "%u", EnumValue(val)); stream->Write(rideId, strlen(rideId)); From f8e26a3752a359c76829c1a36156ae3ac9309458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 4 Sep 2021 19:17:37 +0300 Subject: [PATCH 360/681] Fix signed/unsigned mismatch --- src/openrct2-ui/windows/Ride.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 7fb73ba416..b9bb9f2673 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1192,12 +1192,13 @@ static void window_ride_update_overall_view(Ride* ride) maxz = std::max(maxz, clearZ); } - if (static_cast(ride->id) >= ride_overall_views.size()) + const auto rideIndex = EnumValue(ride->id); + if (rideIndex >= ride_overall_views.size()) { - ride_overall_views.resize(static_cast(ride->id) + 1); + ride_overall_views.resize(rideIndex + 1); } - auto& view = ride_overall_views[static_cast(ride->id)]; + auto& view = ride_overall_views[rideIndex]; view.x = (minx + maxx) / 2 + 16; view.y = (miny + maxy) / 2 + 16; view.z = (minz + maxz) / 2 - 8; From 50467d4fd8c9079726a2b0a7e63a430d844c4813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 16:20:34 +0300 Subject: [PATCH 361/681] Remove unused serialiser traits --- src/openrct2/core/DataSerialiserTraits.h | 33 ------------------------ 1 file changed, 33 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index b3cfc9dc04..ca391d360c 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -214,39 +214,6 @@ template<> struct DataSerializerTraits_t } }; -template<> struct DataSerializerTraits_t -{ - static void encode(OpenRCT2::IStream* stream, const NetworkRideId_t& val) - { - uint32_t temp = static_cast(val); - temp = ByteSwapBE(temp); - stream->Write(&temp); - } - static void decode(OpenRCT2::IStream* stream, NetworkRideId_t& val) - { - uint32_t temp; - stream->Read(&temp); - val = static_cast(ByteSwapBE(temp)); - } - static void log(OpenRCT2::IStream* stream, const NetworkRideId_t& val) - { - char rideId[28] = {}; - snprintf(rideId, sizeof(rideId), "%u", EnumValue(val)); - - stream->Write(rideId, strlen(rideId)); - - auto ride = get_ride(val); - if (ride != nullptr) - { - auto rideName = ride->GetName(); - - stream->Write(" \"", 2); - stream->Write(rideName.c_str(), rideName.size()); - stream->Write("\"", 1); - } - } -}; - template struct DataSerializerTraits_t> { static void encode(OpenRCT2::IStream* stream, const DataSerialiserTag& tag) From 0cdd348428c8277c347750e6407debece6079868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 16:22:35 +0300 Subject: [PATCH 362/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab47c2c638..622ac35946 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.50") +set(REPLAYS_VERSION "0.0.51") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "C569C73147F1C1554807B6FBE74C39A4F0E20EAF") +set(REPLAYS_SHA1 "01086A05A3291B296906AE215855BC7CDB045A6A") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 504b00508c..f2f33c624f 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.50/replays.zip - C569C73147F1C1554807B6FBE74C39A4F0E20EAF + https://github.com/OpenRCT2/replays/releases/download/v0.0.51/replays.zip + 01086A05A3291B296906AE215855BC7CDB045A6A From 8a21bd01c664ce2143d9e7f8b5631271a616e1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 16:46:16 +0300 Subject: [PATCH 363/681] Bump up scripting version --- src/openrct2/scripting/ScriptEngine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 404e7daffd..1e0c0db23b 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 36; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 37; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; From d7e0e473c13e827faa8e2e7d24e961643ee7b847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 16:40:12 +0300 Subject: [PATCH 364/681] Apply review suggestion, cleanup --- .../windows/DemolishRidePrompt.cpp | 4 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 38 ++++++++----------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index b95252ea82..94fc63ea8a 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -84,7 +84,7 @@ rct_window* window_ride_demolish_prompt_open(Ride* ride) w->widgets = window_ride_demolish_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CANCEL) | (1ULL << WIDX_DEMOLISH); WindowInitScrollWidgets(w); - w->number = static_cast(ride->id); + w->rideId = ride->id; _demolishRideCost = -ride_get_refund_price(ride); return w; @@ -109,7 +109,7 @@ rct_window* window_ride_refurbish_prompt_open(Ride* ride) w->widgets = window_ride_refurbish_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CANCEL) | (1ULL << WIDX_REFURBISH); WindowInitScrollWidgets(w); - w->number = static_cast(ride->id); + w->rideId = ride->id; _demolishRideCost = -ride_get_refund_price(ride); return w; diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index aa8e791130..e08708daa6 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -130,7 +130,7 @@ rct_window* window_maze_construction_open() WindowInitScrollWidgets(w); - w->number = static_cast(_currentRideIndex); + w->rideId = _currentRideIndex; window_push_others_right(w); show_gridlines(); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b9bb9f2673..acab395266 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1235,7 +1235,7 @@ static rct_window* window_ride_open(Ride* ride) w->widgets = window_ride_page_widgets[WINDOW_RIDE_PAGE_MAIN]; w->enabled_widgets = window_ride_page_enabled_widgets[WINDOW_RIDE_PAGE_MAIN]; w->hold_down_widgets = window_ride_page_hold_down_widgets[WINDOW_RIDE_PAGE_MAIN]; - w->number = static_cast(ride->id); + w->rideId = ride->id; w->page = WINDOW_RIDE_PAGE_MAIN; w->vehicleIndex = 0; @@ -1265,7 +1265,7 @@ rct_window* window_ride_main_open(Ride* ride) return nullptr; } - rct_window* w = window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); + rct_window* w = window_bring_to_front_by_number(WC_RIDE, EnumValue(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1306,7 +1306,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) return window_ride_main_open(ride); - auto w = window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); + auto w = window_bring_to_front_by_number(WC_RIDE, EnumValue(ride->id)); if (w == nullptr) { w = window_ride_open(ride); @@ -1408,7 +1408,7 @@ rct_window* window_ride_open_vehicle(Vehicle* vehicle) view++; } - rct_window* w = window_find_by_number(WC_RIDE, static_cast(ride->id)); + rct_window* w = window_find_by_number(WC_RIDE, EnumValue(ride->id)); if (w != nullptr) { w->Invalidate(); @@ -1443,8 +1443,8 @@ rct_window* window_ride_open_vehicle(Vehicle* vehicle) } } - w = openedPeepWindow ? window_find_by_number(WC_RIDE, static_cast(ride->id)) - : window_bring_to_front_by_number(WC_RIDE, static_cast(ride->id)); + w = openedPeepWindow ? window_find_by_number(WC_RIDE, EnumValue(ride->id)) + : window_bring_to_front_by_number(WC_RIDE, EnumValue(ride->id)); } if (w == nullptr) @@ -1756,7 +1756,7 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) if (ride != nullptr) { ride_construct(ride); - if (window_find_by_number(WC_RIDE_CONSTRUCTION, static_cast(ride->id)) != nullptr) + if (window_find_by_number(WC_RIDE_CONSTRUCTION, EnumValue(ride->id)) != nullptr) { window_close(w); } @@ -2252,8 +2252,7 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex uint8_t rideType = RideDropdownData[rideLabelId].ride_type_id; if (rideType < RIDE_TYPE_COUNT) { - const auto rideId = w->rideId; - auto rideSetSetting = RideSetSettingAction(rideId, RideSetSetting::RideType, rideType); + auto rideSetSetting = RideSetSettingAction(w->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. @@ -3093,8 +3092,7 @@ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dp */ static void window_ride_mode_tweak_increase(rct_window* w) { - const auto rideId = w->rideId; - auto ride = get_ride(rideId); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3110,7 +3108,7 @@ static void window_ride_mode_tweak_increase(rct_window* w) uint8_t increment = ride->mode == RideMode::Dodgems ? 10 : 1; set_operating_setting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); + w->rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); } /** @@ -3146,8 +3144,7 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) rct_widget* dropdownWidget; dropdownWidget = widget - 1; - const auto rideId = w->rideId; - auto ride = get_ride(rideId); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3186,8 +3183,7 @@ static void window_ride_mode_dropdown(rct_window* w, rct_widget* widget) */ static void window_ride_load_dropdown(rct_window* w, rct_widget* widget) { - const auto rideId = w->rideId; - auto ride = get_ride(rideId); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3891,8 +3887,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg if (dropdownIndex == -1) return; - const auto rideId = w->rideId; - auto ride = get_ride(rideId); + auto ride = get_ride(w->rideId); if (ride == nullptr) return; @@ -3903,7 +3898,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg switch (widgetIndex) { case WIDX_INSPECTION_INTERVAL_DROPDOWN: - set_operating_setting(rideId, RideSetSetting::InspectionInterval, dropdownIndex); + set_operating_setting(w->rideId, RideSetSetting::InspectionInterval, dropdownIndex); break; case WIDX_FORCE_BREAKDOWN: @@ -4960,12 +4955,11 @@ static std::vector window_ride_current_music_style_order; */ static void window_ride_toggle_music(rct_window* w) { - const auto rideId = w->rideId; - auto ride = get_ride(rideId); + auto ride = get_ride(w->rideId); if (ride != nullptr) { int32_t activateMusic = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; - set_operating_setting(rideId, RideSetSetting::Music, activateMusic); + set_operating_setting(w->rideId, RideSetSetting::Music, activateMusic); } } From d21ccc103b99102afc5f0bc4ede135fd0b6318d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 6 Sep 2021 17:23:46 +0300 Subject: [PATCH 365/681] Bump up network version --- 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 691c0467e9..d2c3334245 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "8" +#define NETWORK_STREAM_VERSION "9" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 516232e0a79d525ba8243d2afe8e8daf325e7fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 8 Sep 2021 17:07:41 +0300 Subject: [PATCH 366/681] Change static casts to EnumValue --- src/openrct2-ui/WindowManager.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/RideConstruction.cpp | 6 ++--- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 2 +- .../actions/RideEntranceExitPlaceAction.cpp | 4 ++-- .../actions/RideEntranceExitRemoveAction.cpp | 12 +++++----- .../actions/RideSetAppearanceAction.cpp | 2 +- src/openrct2/actions/RideSetPriceAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 6 ++--- src/openrct2/actions/RideSetStatusAction.cpp | 12 +++++----- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 10 ++++---- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/ride/Ride.cpp | 24 +++++++++---------- src/openrct2/ride/RideConstruction.cpp | 4 ++-- src/openrct2/ride/RideRatings.cpp | 6 ++--- src/openrct2/ride/Vehicle.cpp | 12 +++++----- src/openrct2/scripting/ScriptEngine.cpp | 2 +- 21 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index bdcb8a0c9a..4b9366ecb1 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -396,7 +396,7 @@ public: case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW: { auto vehicle = static_cast(intent.GetPointerExtra(INTENT_EXTRA_VEHICLE)); - auto w = window_find_by_number(WC_RIDE, static_cast(vehicle->ride)); + auto w = window_find_by_number(WC_RIDE, EnumValue(vehicle->ride)); if (w == nullptr) return; diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 50bb176749..5bd5919deb 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -972,7 +972,7 @@ static void window_editor_objective_options_rides_update(rct_window* w) { if (ride.IsRide()) { - w->list_item_positions[numItems] = static_cast(ride.id); + w->list_item_positions[numItems] = EnumValue(ride.id); numItems++; } } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 4c35e18d02..cbdb074338 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1456,7 +1456,7 @@ void window_guest_rides_update(rct_window* w) { if (ride.IsRide() && guest->HasRidden(&ride)) { - w->list_item_positions[curr_list_position] = static_cast(ride.id); + w->list_item_positions[curr_list_position] = EnumValue(ride.id); curr_list_position++; } } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index e08708daa6..e82f43edbc 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -169,7 +169,7 @@ static void window_maze_construction_close(rct_window* w) else { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(ride->id)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(ride->id)); context_open_intent(&intent); } } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 5cdb6c6934..8eb5a7dc55 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -509,7 +509,7 @@ static void close_ride_window_for_construction(rct_windownumber number) rct_window* window_ride_construction_open() { ride_id_t rideIndex = _currentRideIndex; - close_ride_window_for_construction(static_cast(rideIndex)); + close_ride_window_for_construction(EnumValue(rideIndex)); auto ride = get_ride(rideIndex); if (ride == nullptr) @@ -543,7 +543,7 @@ rct_window* window_ride_construction_open() w->colours[1] = COLOUR_DARK_BROWN; w->colours[2] = COLOUR_DARK_BROWN; - w->number = static_cast(rideIndex); + w->rideId = rideIndex; window_push_others_right(w); show_gridlines(); @@ -620,7 +620,7 @@ static void window_ride_construction_close(rct_window* w) ride->SetToDefaultInspectionInterval(); auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(ride->id)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(ride->id)); context_open_intent(&intent); } else diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 94a51eb2c9..de3ecf4b09 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -443,7 +443,7 @@ static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, else { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(rideIndex)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(rideIndex)); context_open_intent(&intent); } } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index c59bc5c1c3..2d063ce8f6 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -274,7 +274,7 @@ GameActions::Result::Ptr RideDemolishAction::RefurbishRide(Ride* ride) const res->Position = { location, tile_element_height(location) }; } - window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, static_cast(_rideIndex)); + window_close_by_number(WC_DEMOLISH_RIDE_PROMPT, EnumValue(_rideIndex)); return res; } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index fc20629013..df49331e73 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -54,7 +54,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid game command for ride %d", static_cast(_rideIndex)); + log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); return MakeResult(GameActions::Status::InvalidParameters, errorTitle); } @@ -132,7 +132,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid game command for ride %d", static_cast(_rideIndex)); + log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); return MakeResult(GameActions::Status::InvalidParameters, errorTitle); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index f4fac8cae3..6144d29eda 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -74,7 +74,7 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride id %d for entrance/exit removal", static_cast(_rideIndex)); + log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); } @@ -99,8 +99,8 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Query() const if (entranceElement == nullptr) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, - static_cast(_rideIndex), _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, EnumValue(_rideIndex), + _stationNum); return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } @@ -112,7 +112,7 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Execute() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride id %d for entrance/exit removal", static_cast(_rideIndex)); + log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); } @@ -130,8 +130,8 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Execute() const if (entranceElement == nullptr) { log_warning( - "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, - static_cast(_rideIndex), _stationNum); + "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, EnumValue(_rideIndex), + _stationNum); return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index bf8e9fc366..d5355db520 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -139,7 +139,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const gfx_invalidate_screen(); break; } - window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); auto res = std::make_unique(); if (!ride->overall_view.IsNull()) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 268fd7d9a7..81b29ce432 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -180,7 +180,7 @@ void RideSetPriceAction::RideSetCommonPrice(ShopItem shopItem) const } if (invalidate) { - window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); + window_invalidate_by_number(WC_RIDE, EnumValue(ride.id)); } } } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 233b19154e..1c5a5ac262 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -45,7 +45,7 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride: #%d.", static_cast(_rideIndex)); + log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); } @@ -153,7 +153,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride: #%d.", static_cast(_rideIndex)); + log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); } @@ -233,7 +233,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const auto location = ride->overall_view.ToTileCentre(); res->Position = { location, tile_element_height(location) }; } - window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); return res; } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 5a79dae8bd..9743b311a0 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -59,7 +59,7 @@ GameActions::Result::Ptr RideSetStatusAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); + log_warning("Invalid game command for ride %u", EnumValue(_rideIndex)); res->Error = GameActions::Status::InvalidParameters; res->ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res->ErrorMessage = STR_NONE; @@ -68,7 +68,7 @@ GameActions::Result::Ptr RideSetStatusAction::Query() const if (_status >= RideStatus::Count) { - log_warning("Invalid ride status %u for ride %u", uint32_t(_status), uint32_t(_rideIndex)); + log_warning("Invalid ride status %u for ride %u", EnumValue(_status), EnumValue(_rideIndex)); res->Error = GameActions::Status::InvalidParameters; res->ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res->ErrorMessage = STR_NONE; @@ -154,7 +154,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; ride->race_winner = SPRITE_INDEX_NULL; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); break; case RideStatus::Simulating: { @@ -176,7 +176,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); break; } case RideStatus::Testing: @@ -195,7 +195,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const // Fix #3183: Make sure we close the construction window so the ride finishes any editing code before opening // otherwise vehicles get added to the ride incorrectly (such as to a ghost station) - rct_window* constructionWindow = window_find_by_number(WC_RIDE_CONSTRUCTION, static_cast(_rideIndex)); + rct_window* constructionWindow = window_find_by_number(WC_RIDE_CONSTRUCTION, EnumValue(_rideIndex)); if (constructionWindow != nullptr) { window_close(constructionWindow); @@ -223,7 +223,7 @@ GameActions::Result::Ptr RideSetStatusAction::Execute() const ride->last_issue_time = 0; ride->GetMeasurement(); ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; - window_invalidate_by_number(WC_RIDE, static_cast(_rideIndex)); + window_invalidate_by_number(WC_RIDE, EnumValue(_rideIndex)); break; } default: diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index bda774375f..b03b792348 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -199,7 +199,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const } auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(_rideIndex)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(_rideIndex)); context_broadcast_intent(&intent); gfx_invalidate_screen(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index aeb736728c..a3269cbe9a 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -85,13 +85,13 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", static_cast(_rideIndex)); + log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", static_cast(_rideIndex)); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); } @@ -379,14 +379,14 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const auto ride = get_ride(_rideIndex); if (ride == nullptr) { - log_warning("Invalid ride for track placement, rideIndex = %d", static_cast(_rideIndex)); + log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - log_warning("Invalid ride subtype for track placement, rideIndex = %d", static_cast(_rideIndex)); + log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::InvalidParameters); } @@ -550,7 +550,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const auto* trackElement = TileElementInsert(mapLoc, quarterTile.GetBaseQuarterOccupied()); if (trackElement == nullptr) { - log_warning("Cannot create track element for ride = %d", static_cast(_rideIndex)); + log_warning("Cannot create track element for ride = %d", EnumValue(_rideIndex)); return std::make_unique(GameActions::Status::NoFreeElements); } diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index e7ffb9ee58..d646534def 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -959,7 +959,7 @@ void S6Exporter::ExportRideMeasurements() auto rideId = src->id; dst.ride_index = static_cast(rideId); - _s6.rides[static_cast(rideId)].measurement_index = i; + _s6.rides[dst.ride_index].measurement_index = i; i++; } } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 392992b9ae..d39f418e69 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1505,7 +1505,7 @@ void ride_breakdown_add_news_item(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_BROKEN_DOWN, static_cast(ride->id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_BROKEN_DOWN, EnumValue(ride->id), ft); } } @@ -1532,7 +1532,7 @@ static void ride_breakdown_status_update(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_STILL_NOT_FIXED, static_cast(ride->id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_IS_STILL_NOT_FIXED, EnumValue(ride->id), ft); } } } @@ -2183,7 +2183,7 @@ static void ride_entrance_exit_connected(Ride* ride) ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, static_cast(ride->id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, EnumValue(ride->id), ft); } ride->connected_message_throttle = 3; } @@ -2195,7 +2195,7 @@ static void ride_entrance_exit_connected(Ride* ride) ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, static_cast(ride->id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, EnumValue(ride->id), ft); } ride->connected_message_throttle = 3; } @@ -2264,7 +2264,7 @@ static void ride_shop_connected(Ride* ride) { Formatter ft; ride->FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, static_cast(ride->id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, EnumValue(ride->id), ft); } ride->connected_message_throttle = 3; @@ -3797,13 +3797,13 @@ bool Ride::Test(RideStatus newStatus, bool isApplying) if (type == RIDE_TYPE_NULL) { - log_warning("Invalid ride type for ride %u", static_cast(id)); + log_warning("Invalid ride type for ride %u", EnumValue(id)); return false; } if (newStatus != RideStatus::Simulating) { - window_close_by_number(WC_RIDE_CONSTRUCTION, static_cast(id)); + window_close_by_number(WC_RIDE_CONSTRUCTION, EnumValue(id)); } StationIndex stationIndex = ride_mode_check_station_present(this); @@ -3930,10 +3930,10 @@ bool Ride::Open(bool isApplying) // to set the track to its final state and clean up ghosts. // We can't just call close as it would cause a stack overflow during shop creation // with auto open on. - if (WC_RIDE_CONSTRUCTION == gCurrentToolWidget.window_classification - && static_cast(id) == gCurrentToolWidget.window_number && (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) + if (WC_RIDE_CONSTRUCTION == gCurrentToolWidget.window_classification && EnumValue(id) == gCurrentToolWidget.window_number + && (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) { - window_close_by_number(WC_RIDE_CONSTRUCTION, static_cast(id)); + window_close_by_number(WC_RIDE_CONSTRUCTION, EnumValue(id)); } StationIndex stationIndex = ride_mode_check_station_present(this); @@ -5089,7 +5089,7 @@ void Ride::UpdateMaxVehicles() { num_cars_per_train = numCarsPerTrain; num_vehicles = numVehicles; - window_invalidate_by_number(WC_RIDE, static_cast(id)); + window_invalidate_by_number(WC_RIDE, EnumValue(id)); } } @@ -5158,7 +5158,7 @@ void Ride::Crash(uint8_t vehicleIndex) { Formatter ft; FormatNameTo(ft); - News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_HAS_CRASHED, static_cast(id), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_RIDE_HAS_CRASHED, EnumValue(id), ft); } } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index df0b9c152c..722bea5ecc 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -122,7 +122,7 @@ static rct_window* ride_create_or_find_construction_window(ride_id_t rideIndex) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(rideIndex)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, EnumValue(rideIndex)); windowManager->BroadcastIntent(intent); return window_find_by_class(WC_RIDE_CONSTRUCTION); } @@ -239,7 +239,7 @@ void ride_clear_for_construction(Ride* ride) ride->RemoveVehicles(); ride_clear_blocked_tiles(ride); - auto w = window_find_by_number(WC_RIDE, static_cast(ride->id)); + auto w = window_find_by_number(WC_RIDE, EnumValue(ride->id)); if (w != nullptr) window_event_resize_call(w); } diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 19b7b1b03d..2f338b1be8 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -159,7 +159,7 @@ static void ride_ratings_update_state_0(RideRatingUpdateState& state) { ride_id_t currentRide = state.CurrentRide; - currentRide = static_cast(static_cast(currentRide) + 1); + currentRide = static_cast(EnumValue(currentRide) + 1); if (currentRide >= static_cast(MAX_RIDES)) { currentRide = {}; @@ -285,7 +285,7 @@ static void ride_ratings_update_state_3(RideRatingUpdateState& state) ride_ratings_calculate(state, ride); ride_ratings_calculate_value(ride); - window_invalidate_by_number(WC_RIDE, static_cast(state.CurrentRide)); + window_invalidate_by_number(WC_RIDE, EnumValue(state.CurrentRide)); state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; } @@ -753,7 +753,7 @@ static void ride_ratings_calculate(RideRatingUpdateState& state, Ride* ride) // Create event args object auto obj = DukObject(ctx); - obj.Set("rideId", static_cast(ride->id)); + obj.Set("rideId", EnumValue(ride->id)); obj.Set("excitement", originalExcitement); obj.Set("intensity", originalIntensity); obj.Set("nausea", originalNausea); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 7b29615007..a13689a586 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1600,7 +1600,7 @@ void Vehicle::UpdateMeasurements() curRide->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS; curRide->lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; ClearUpdateFlag(VEHICLE_UPDATE_FLAG_TESTING); - window_invalidate_by_number(WC_RIDE, static_cast(ride)); + window_invalidate_by_number(WC_RIDE, EnumValue(ride)); return; } @@ -3114,7 +3114,7 @@ static void test_finish(Ride& ride) totalTime = std::max(totalTime, 1u); ride.average_speed = ride.average_speed / totalTime; - window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); + window_invalidate_by_number(WC_RIDE, EnumValue(ride.id)); } void Vehicle::UpdateTestFinish() @@ -3164,7 +3164,7 @@ static void test_reset(Ride& ride, StationIndex curStation) } ride.total_air_time = 0; ride.current_test_station = curStation; - window_invalidate_by_number(WC_RIDE, static_cast(ride.id)); + window_invalidate_by_number(WC_RIDE, EnumValue(ride.id)); } void Vehicle::TestReset() @@ -3570,7 +3570,7 @@ void Vehicle::CheckIfMissing() curRide->FormatNameTo(ft); ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular); - News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, static_cast(ride), ft); + News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, EnumValue(ride), ft); } } @@ -5305,8 +5305,8 @@ static void ride_train_crash(Ride* ride, uint16_t numFatalities) { ride->FormatNameTo(ft); News::AddItemToQueue( - News::ItemType::Ride, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, - static_cast(ride->id), ft); + News::ItemType::Ride, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, EnumValue(ride->id), + ft); } if (gParkRatingCasualtyPenalty < 500) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 2f363306b6..3f5cf95324 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -893,7 +893,7 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std auto& rideCreateResult = static_cast(*result.get()); if (rideCreateResult.rideIndex != RIDE_ID_NULL) { - obj.Set("ride", static_cast(rideCreateResult.rideIndex)); + obj.Set("ride", EnumValue(rideCreateResult.rideIndex)); } } else if (action.GetType() == GameCommand::HireNewStaffMember) From e5eb8f84cf69ba273838c631d09a43842ab6a037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 9 Sep 2021 00:06:34 +0300 Subject: [PATCH 367/681] Apply review suggestions --- src/openrct2-ui/windows/RideConstruction.cpp | 6 +++--- src/openrct2-ui/windows/TrackDesignPlace.cpp | 8 +++----- src/openrct2/peep/Guest.cpp | 4 ++-- src/openrct2/peep/Peep.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 6 +++--- src/openrct2/ride/TrackDesign.cpp | 9 ++++----- src/openrct2/ride/TrackDesign.h | 2 ++ 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8eb5a7dc55..24fdf0f985 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -495,9 +495,9 @@ static int32_t ride_get_alternative_type(Ride* ride) } /* move to ride.c */ -static void close_ride_window_for_construction(rct_windownumber number) +static void close_ride_window_for_construction(ride_id_t rideId) { - rct_window* w = window_find_by_number(WC_RIDE, number); + rct_window* w = window_find_by_number(WC_RIDE, EnumValue(rideId)); if (w != nullptr && w->page == 1) window_close(w); } @@ -509,7 +509,7 @@ static void close_ride_window_for_construction(rct_windownumber number) rct_window* window_ride_construction_open() { ride_id_t rideIndex = _currentRideIndex; - close_ride_window_for_construction(EnumValue(rideIndex)); + close_ride_window_for_construction(rideIndex); auto ride = get_ride(rideIndex); if (ride == nullptr) diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 35ad8b135b..9cc6a33cc7 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -269,8 +269,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI if (mapCoords == _windowTrackPlaceLast) { place_virtual_track( - _trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), - { mapCoords, 0 }); + _trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(PreviewRideId), { mapCoords, 0 }); return; } @@ -310,8 +309,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI widget_invalidate(w, WIDX_PRICE); } - place_virtual_track( - _trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), trackLoc); + place_virtual_track(_trackDesign.get(), PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(PreviewRideId), trackLoc); } /** @@ -474,7 +472,7 @@ static int32_t window_track_place_get_base_z(const CoordsXY& loc) return z + place_virtual_track( - _trackDesign.get(), PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(static_cast(0)), { loc, z }); + _trackDesign.get(), PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(PreviewRideId), { loc, z }); } /** diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 7842dff1e1..747b8670f4 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6812,9 +6812,9 @@ void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) InsertNewThought(thought_type, static_cast(shopItem)); } -void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t ride) +void Guest::InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId) { - InsertNewThought(thought_type, static_cast(ride)); + InsertNewThought(thought_type, static_cast(rideId)); } /** * diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 08b7f6a340..08ca29df35 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -774,7 +774,7 @@ public: void UpdateEasterEggInteractions(); void InsertNewThought(PeepThoughtType thought_type); void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); - void InsertNewThought(PeepThoughtType thought_type, ride_id_t ride); + void InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId); void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); static Guest* Generate(const CoordsXYZ& coords); bool UpdateQueuePosition(PeepActionType previous_action); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fbfd9fa4a8..bd9def7a5c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2483,12 +2483,12 @@ namespace RCT1 { if (_s4.scenario_slot_index == SC_URBAN_PARK && _isScenario) { - const auto firstRideId = static_cast(0); + const auto merryGoRoundId = static_cast(0); // First, make the queuing peep exit for (auto peep : EntityList()) { - if (peep->State == PeepState::QueuingFront && peep->CurrentRide == firstRideId) + if (peep->State == PeepState::QueuingFront && peep->CurrentRide == merryGoRoundId) { peep->RemoveFromQueue(); peep->SetState(PeepState::Falling); @@ -2497,7 +2497,7 @@ namespace RCT1 } // Now, swap the entrance and exit. - auto ride = get_ride(firstRideId); + auto ride = get_ride(merryGoRoundId); if (ride != nullptr) { auto entranceCoords = ride->stations[0].Exit; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index f419047418..747430bc7c 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -57,6 +57,7 @@ #include "RideData.h" #include "Track.h" #include "TrackData.h" +#include "TrackDesign.h" #include "TrackDesignRepository.h" #include "Vehicle.h" @@ -319,8 +320,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) } } - place_virtual_track( - this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), { 4096, 4096, 0 }); + place_virtual_track(this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(PreviewRideId), { 4096, 4096, 0 }); // Resave global vars for scenery reasons. _trackPreviewOrigin = startPos; @@ -439,8 +439,7 @@ rct_string_id TrackDesign::CreateTrackDesignMaze(const Ride& ride) // Save global vars as they are still used by scenery???? int32_t startZ = _trackPreviewOrigin.z; - place_virtual_track( - this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(static_cast(0)), { 4096, 4096, 0 }); + place_virtual_track(this, PTD_OPERATION_DRAW_OUTLINES, true, GetOrAllocateRide(PreviewRideId), { 4096, 4096, 0 }); _trackPreviewOrigin = { startLoc.x, startLoc.y, startZ }; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; @@ -1934,7 +1933,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o _currentTrackPieceDirection = 0; int32_t z = place_virtual_track( - td6, PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(static_cast(0)), { mapSize, mapSize, 16 }); + td6, PTD_OPERATION_GET_PLACE_Z, true, GetOrAllocateRide(PreviewRideId), { mapSize, mapSize, 16 }); if (_trackDesignPlaceStateHasScenery) { diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index d459527365..e78fa32c68 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -191,6 +191,8 @@ enum MAZE_ELEMENT_TYPE_EXIT = (1 << 7) }; +static constexpr ride_id_t PreviewRideId = static_cast(0); + extern bool gTrackDesignSceneryToggle; extern bool _trackDesignDrawingPreview; From 2e8d40b5e382f0f2a8e9c0ba0a19d9d218636934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 10 Sep 2021 22:08:49 +0300 Subject: [PATCH 368/681] Fix out of bounds regression from #15391 --- src/openrct2/paint/Paint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 96d662fcd8..862a5a8b10 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -87,7 +87,7 @@ static void PaintSessionAddPSToQuadrant(paint_session* session, paint_struct* ps const auto positionHash = RemapPositionToQuadrant(*ps, session->CurrentRotation); // Values below zero or above MaxPaintQuadrants are void, corners also share the same quadrant as void. - const uint32_t paintQuadrantIndex = std::clamp(positionHash / COORDS_XY_STEP, 0, MaxPaintQuadrants); + const uint32_t paintQuadrantIndex = std::clamp(positionHash / COORDS_XY_STEP, 0, MaxPaintQuadrants - 1); ps->quadrant_index = paintQuadrantIndex; ps->next_quadrant_ps = session->Quadrants[paintQuadrantIndex]; From ef6768dd33af3fcc696e28395bb463ecdcae1dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:18:24 +0300 Subject: [PATCH 369/681] Segment the object arrays in rct_s6_data --- src/openrct2/rct2/RCT2.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 84218c1cf5..73cffc8e7f 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -836,7 +836,24 @@ struct rct_s6_data // packed objects // SC6[3] - rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT]; + union + { + rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT]; + struct + { + rct_object_entry rideObjects[RCT12_MAX_RIDE_OBJECTS]; + rct_object_entry sceneryObjects[RCT2_MAX_SMALL_SCENERY_OBJECTS]; + rct_object_entry largeSceneryObjects[RCT2_MAX_LARGE_SCENERY_OBJECTS]; + rct_object_entry wallSceneryObjects[RCT2_MAX_WALL_SCENERY_OBJECTS]; + rct_object_entry bannerObjects[RCT2_MAX_BANNER_OBJECTS]; + rct_object_entry pathObjects[RCT2_MAX_PATH_OBJECTS]; + rct_object_entry pathAdditionObjects[RCT2_MAX_PATH_ADDITION_OBJECTS]; + rct_object_entry sceneryGroupObjects[RCT2_MAX_SCENERY_GROUP_OBJECTS]; + rct_object_entry parkEntranceObjects[RCT2_MAX_PARK_ENTRANCE_OBJECTS]; + rct_object_entry waterObjects[RCT2_MAX_WATER_OBJECTS]; + rct_object_entry scenarioTextObjects[RCT2_MAX_SCENARIO_TEXT_OBJECTS]; + }; + }; // SC6[4] uint16_t elapsed_months; From b1ba29716d6904c16ce0cb0eaf147f34a649bbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:42:30 +0300 Subject: [PATCH 370/681] Refactor import of s6 objects --- src/openrct2/rct2/S6Importer.cpp | 44 ++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 1ae9885831..a718b7f882 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -169,9 +169,10 @@ public: _isSV7 = _stricmp(extension, ".sv7") == 0; } + chunkReader.ReadChunk(&_s6.objects, sizeof(_s6.objects)); + if (isScenario) { - chunkReader.ReadChunk(&_s6.objects, sizeof(_s6.objects)); chunkReader.ReadChunk(&_s6.elapsed_months, 16); chunkReader.ReadChunk(&_s6.tile_elements, sizeof(_s6.tile_elements)); chunkReader.ReadChunk(&_s6.next_free_tile_element_pointer_index, 2560076); @@ -185,7 +186,6 @@ public: } else { - chunkReader.ReadChunk(&_s6.objects, sizeof(_s6.objects)); chunkReader.ReadChunk(&_s6.elapsed_months, 16); chunkReader.ReadChunk(&_s6.tile_elements, sizeof(_s6.tile_elements)); chunkReader.ReadChunk(&_s6.next_free_tile_element_pointer_index, 3048816); @@ -1563,25 +1563,41 @@ public: return justText.data(); } - std::vector GetRequiredObjects() + template + static void AddRequiredObjects(std::vector& required, const T& list, size_t internalLimit) { - std::vector result; rct_object_entry nullEntry = {}; std::memset(&nullEntry, 0xFF, sizeof(nullEntry)); - int objectIt = 0; - for (int16_t objectType = EnumValue(ObjectType::Ride); objectType <= EnumValue(ObjectType::Water); objectType++) + for (const auto& entry : list) { - for (int16_t i = 0; i < rct2_object_entry_group_counts[objectType]; i++, objectIt++) - { - result.push_back(_s6.objects[objectIt]); - } - for (int16_t i = rct2_object_entry_group_counts[objectType]; i < object_entry_group_counts[objectType]; i++) - { - result.push_back(nullEntry); - } + required.push_back(entry); } + // NOTE: The segment of this object type needs to be filled to the internal limit + // the object manager currently expects this. + for (size_t i = std::size(list); i < internalLimit; i++) + { + required.push_back(nullEntry); + } + } + + std::vector GetRequiredObjects() + { + std::vector result; + + AddRequiredObjects(result, _s6.rideObjects, MAX_RIDE_OBJECTS); + AddRequiredObjects(result, _s6.sceneryObjects, MAX_SMALL_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.largeSceneryObjects, MAX_LARGE_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.wallSceneryObjects, MAX_WALL_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.bannerObjects, MAX_BANNER_OBJECTS); + AddRequiredObjects(result, _s6.pathObjects, MAX_PATH_OBJECTS); + AddRequiredObjects(result, _s6.pathAdditionObjects, MAX_PATH_ADDITION_OBJECTS); + AddRequiredObjects(result, _s6.sceneryGroupObjects, MAX_SCENERY_GROUP_OBJECTS); + AddRequiredObjects(result, _s6.parkEntranceObjects, MAX_PARK_ENTRANCE_OBJECTS); + AddRequiredObjects(result, _s6.waterObjects, MAX_WATER_OBJECTS); + AddRequiredObjects(result, _s6.scenarioTextObjects, MAX_SCENARIO_TEXT_OBJECTS); + return result; } }; From 47d163322400a3b7ff0080a80042c84fe68e50d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 8 Sep 2021 21:14:16 +0300 Subject: [PATCH 371/681] Refactor Export --- src/openrct2/rct2/S6Exporter.cpp | 44 ++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index d646534def..e0d28d1986 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -255,6 +255,24 @@ static void scenario_fix_ghosts(rct_s6_data* s6) } } +template static void ExportObjectList(IObjectManager& objMgr, T& objects, ObjectType type, size_t maxEntries) +{ + for (size_t i = 0; i < maxEntries; i++) + { + auto& dst = objects[i]; + + auto* object = objMgr.GetLoadedObject(type, i); + if (object == nullptr || object->GetObjectEntry() == nullptr) + { + std::memset(&dst, 0xFF, sizeof(dst)); + } + else + { + dst = *object->GetObjectEntry(); + } + } +} + void S6Exporter::Export() { _s6.info = {}; @@ -278,20 +296,18 @@ void S6Exporter::Export() uint32_t researchedTrackPiecesA[128] = {}; uint32_t researchedTrackPiecesB[128] = {}; - for (int32_t i = 0; i < RCT2_OBJECT_ENTRY_COUNT; i++) - { - const rct_object_entry* entry = get_loaded_object_entry(i); - void* entryData = get_loaded_object_chunk(i); - // RCT2 uses (void *)-1 to mark NULL. Make sure it's written in a vanilla-compatible way. - if (entry == nullptr || entryData == nullptr || entryData == reinterpret_cast(-1)) - { - std::memset(&_s6.objects[i], 0xFF, sizeof(rct_object_entry)); - } - else - { - _s6.objects[i] = *entry; - } - } + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); + ExportObjectList(objectMgr, _s6.rideObjects, ObjectType::Ride, RCT12_MAX_RIDE_OBJECTS); + ExportObjectList(objectMgr, _s6.sceneryObjects, ObjectType::SmallScenery, RCT2_MAX_SMALL_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.largeSceneryObjects, ObjectType::LargeScenery, RCT2_MAX_LARGE_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.wallSceneryObjects, ObjectType::Walls, RCT2_MAX_WALL_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.bannerObjects, ObjectType::Banners, RCT2_MAX_BANNER_OBJECTS); + ExportObjectList(objectMgr, _s6.pathObjects, ObjectType::Paths, RCT2_MAX_PATH_OBJECTS); + ExportObjectList(objectMgr, _s6.pathAdditionObjects, ObjectType::PathBits, RCT2_MAX_PATH_ADDITION_OBJECTS); + ExportObjectList(objectMgr, _s6.sceneryGroupObjects, ObjectType::SceneryGroup, RCT2_MAX_SCENERY_GROUP_OBJECTS); + ExportObjectList(objectMgr, _s6.parkEntranceObjects, ObjectType::ParkEntrance, RCT2_MAX_PARK_ENTRANCE_OBJECTS); + ExportObjectList(objectMgr, _s6.waterObjects, ObjectType::Water, RCT2_MAX_WATER_OBJECTS); + ExportObjectList(objectMgr, _s6.scenarioTextObjects, ObjectType::ScenarioText, RCT2_MAX_SCENARIO_TEXT_OBJECTS); _s6.elapsed_months = static_cast(gDateMonthsElapsed); _s6.current_day = gDateMonthTicks; From e3f39bf5540d33ef3695c9d49e807b7f183d8a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 9 Sep 2021 02:20:02 +0300 Subject: [PATCH 372/681] Use PascalCase for object members --- src/openrct2/rct2/RCT2.h | 24 ++++++++++++------------ src/openrct2/rct2/S6Exporter.cpp | 24 ++++++++++++------------ src/openrct2/rct2/S6Importer.cpp | 24 ++++++++++++------------ 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 73cffc8e7f..22575fe640 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -838,20 +838,20 @@ struct rct_s6_data // SC6[3] union { - rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT]; + rct_object_entry Objects[RCT2_OBJECT_ENTRY_COUNT]; struct { - rct_object_entry rideObjects[RCT12_MAX_RIDE_OBJECTS]; - rct_object_entry sceneryObjects[RCT2_MAX_SMALL_SCENERY_OBJECTS]; - rct_object_entry largeSceneryObjects[RCT2_MAX_LARGE_SCENERY_OBJECTS]; - rct_object_entry wallSceneryObjects[RCT2_MAX_WALL_SCENERY_OBJECTS]; - rct_object_entry bannerObjects[RCT2_MAX_BANNER_OBJECTS]; - rct_object_entry pathObjects[RCT2_MAX_PATH_OBJECTS]; - rct_object_entry pathAdditionObjects[RCT2_MAX_PATH_ADDITION_OBJECTS]; - rct_object_entry sceneryGroupObjects[RCT2_MAX_SCENERY_GROUP_OBJECTS]; - rct_object_entry parkEntranceObjects[RCT2_MAX_PARK_ENTRANCE_OBJECTS]; - rct_object_entry waterObjects[RCT2_MAX_WATER_OBJECTS]; - rct_object_entry scenarioTextObjects[RCT2_MAX_SCENARIO_TEXT_OBJECTS]; + rct_object_entry RideObjects[RCT12_MAX_RIDE_OBJECTS]; + rct_object_entry SceneryObjects[RCT2_MAX_SMALL_SCENERY_OBJECTS]; + rct_object_entry LargeSceneryObjects[RCT2_MAX_LARGE_SCENERY_OBJECTS]; + rct_object_entry WallSceneryObjects[RCT2_MAX_WALL_SCENERY_OBJECTS]; + rct_object_entry BannerObjects[RCT2_MAX_BANNER_OBJECTS]; + rct_object_entry PathObjects[RCT2_MAX_PATH_OBJECTS]; + rct_object_entry PathAdditionObjects[RCT2_MAX_PATH_ADDITION_OBJECTS]; + rct_object_entry SceneryGroupObjects[RCT2_MAX_SCENERY_GROUP_OBJECTS]; + rct_object_entry ParkEntranceObjects[RCT2_MAX_PARK_ENTRANCE_OBJECTS]; + rct_object_entry WaterObjects[RCT2_MAX_WATER_OBJECTS]; + rct_object_entry ScenarioTextObjects[RCT2_MAX_SCENARIO_TEXT_OBJECTS]; }; }; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index e0d28d1986..a101fe8d18 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -120,7 +120,7 @@ void S6Exporter::Save(OpenRCT2::IStream* stream, bool isScenario) } // 3: Write available objects chunk - chunkWriter.WriteChunk(_s6.objects, sizeof(_s6.objects), SAWYER_ENCODING::ROTATE); + chunkWriter.WriteChunk(_s6.Objects, sizeof(_s6.Objects), SAWYER_ENCODING::ROTATE); // 4: Misc fields (data, rand...) chunk chunkWriter.WriteChunk(&_s6.elapsed_months, 16, SAWYER_ENCODING::RLECOMPRESSED); @@ -297,17 +297,17 @@ void S6Exporter::Export() uint32_t researchedTrackPiecesB[128] = {}; auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); - ExportObjectList(objectMgr, _s6.rideObjects, ObjectType::Ride, RCT12_MAX_RIDE_OBJECTS); - ExportObjectList(objectMgr, _s6.sceneryObjects, ObjectType::SmallScenery, RCT2_MAX_SMALL_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.largeSceneryObjects, ObjectType::LargeScenery, RCT2_MAX_LARGE_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.wallSceneryObjects, ObjectType::Walls, RCT2_MAX_WALL_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.bannerObjects, ObjectType::Banners, RCT2_MAX_BANNER_OBJECTS); - ExportObjectList(objectMgr, _s6.pathObjects, ObjectType::Paths, RCT2_MAX_PATH_OBJECTS); - ExportObjectList(objectMgr, _s6.pathAdditionObjects, ObjectType::PathBits, RCT2_MAX_PATH_ADDITION_OBJECTS); - ExportObjectList(objectMgr, _s6.sceneryGroupObjects, ObjectType::SceneryGroup, RCT2_MAX_SCENERY_GROUP_OBJECTS); - ExportObjectList(objectMgr, _s6.parkEntranceObjects, ObjectType::ParkEntrance, RCT2_MAX_PARK_ENTRANCE_OBJECTS); - ExportObjectList(objectMgr, _s6.waterObjects, ObjectType::Water, RCT2_MAX_WATER_OBJECTS); - ExportObjectList(objectMgr, _s6.scenarioTextObjects, ObjectType::ScenarioText, RCT2_MAX_SCENARIO_TEXT_OBJECTS); + ExportObjectList(objectMgr, _s6.RideObjects, ObjectType::Ride, RCT12_MAX_RIDE_OBJECTS); + ExportObjectList(objectMgr, _s6.SceneryObjects, ObjectType::SmallScenery, RCT2_MAX_SMALL_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.LargeSceneryObjects, ObjectType::LargeScenery, RCT2_MAX_LARGE_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.WallSceneryObjects, ObjectType::Walls, RCT2_MAX_WALL_SCENERY_OBJECTS); + ExportObjectList(objectMgr, _s6.BannerObjects, ObjectType::Banners, RCT2_MAX_BANNER_OBJECTS); + ExportObjectList(objectMgr, _s6.PathObjects, ObjectType::Paths, RCT2_MAX_PATH_OBJECTS); + ExportObjectList(objectMgr, _s6.PathAdditionObjects, ObjectType::PathBits, RCT2_MAX_PATH_ADDITION_OBJECTS); + ExportObjectList(objectMgr, _s6.SceneryGroupObjects, ObjectType::SceneryGroup, RCT2_MAX_SCENERY_GROUP_OBJECTS); + ExportObjectList(objectMgr, _s6.ParkEntranceObjects, ObjectType::ParkEntrance, RCT2_MAX_PARK_ENTRANCE_OBJECTS); + ExportObjectList(objectMgr, _s6.WaterObjects, ObjectType::Water, RCT2_MAX_WATER_OBJECTS); + ExportObjectList(objectMgr, _s6.ScenarioTextObjects, ObjectType::ScenarioText, RCT2_MAX_SCENARIO_TEXT_OBJECTS); _s6.elapsed_months = static_cast(gDateMonthsElapsed); _s6.current_day = gDateMonthTicks; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index a718b7f882..32fe1918b3 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -169,7 +169,7 @@ public: _isSV7 = _stricmp(extension, ".sv7") == 0; } - chunkReader.ReadChunk(&_s6.objects, sizeof(_s6.objects)); + chunkReader.ReadChunk(&_s6.Objects, sizeof(_s6.Objects)); if (isScenario) { @@ -1586,17 +1586,17 @@ public: { std::vector result; - AddRequiredObjects(result, _s6.rideObjects, MAX_RIDE_OBJECTS); - AddRequiredObjects(result, _s6.sceneryObjects, MAX_SMALL_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.largeSceneryObjects, MAX_LARGE_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.wallSceneryObjects, MAX_WALL_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.bannerObjects, MAX_BANNER_OBJECTS); - AddRequiredObjects(result, _s6.pathObjects, MAX_PATH_OBJECTS); - AddRequiredObjects(result, _s6.pathAdditionObjects, MAX_PATH_ADDITION_OBJECTS); - AddRequiredObjects(result, _s6.sceneryGroupObjects, MAX_SCENERY_GROUP_OBJECTS); - AddRequiredObjects(result, _s6.parkEntranceObjects, MAX_PARK_ENTRANCE_OBJECTS); - AddRequiredObjects(result, _s6.waterObjects, MAX_WATER_OBJECTS); - AddRequiredObjects(result, _s6.scenarioTextObjects, MAX_SCENARIO_TEXT_OBJECTS); + AddRequiredObjects(result, _s6.RideObjects, MAX_RIDE_OBJECTS); + AddRequiredObjects(result, _s6.SceneryObjects, MAX_SMALL_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.LargeSceneryObjects, MAX_LARGE_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.WallSceneryObjects, MAX_WALL_SCENERY_OBJECTS); + AddRequiredObjects(result, _s6.BannerObjects, MAX_BANNER_OBJECTS); + AddRequiredObjects(result, _s6.PathObjects, MAX_PATH_OBJECTS); + AddRequiredObjects(result, _s6.PathAdditionObjects, MAX_PATH_ADDITION_OBJECTS); + AddRequiredObjects(result, _s6.SceneryGroupObjects, MAX_SCENERY_GROUP_OBJECTS); + AddRequiredObjects(result, _s6.ParkEntranceObjects, MAX_PARK_ENTRANCE_OBJECTS); + AddRequiredObjects(result, _s6.WaterObjects, MAX_WATER_OBJECTS); + AddRequiredObjects(result, _s6.ScenarioTextObjects, MAX_SCENARIO_TEXT_OBJECTS); return result; } From c416c7ca278fad8554bec384b250d900a02dcf73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 9 Sep 2021 03:21:43 +0300 Subject: [PATCH 373/681] Remove unused function get_loaded_object_chunk --- src/openrct2/object/ObjectList.cpp | 8 -------- src/openrct2/object/ObjectList.h | 1 - 2 files changed, 9 deletions(-) diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 76f1a92a74..186401ae65 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -151,14 +151,6 @@ const rct_object_entry* get_loaded_object_entry(size_t index) return obj->GetObjectEntry(); } -void* get_loaded_object_chunk(size_t index) -{ - ObjectType objectType; - ObjectEntryIndex entryIndex; - get_type_entry_index(index, &objectType, &entryIndex); - return object_entry_get_chunk(objectType, entryIndex); -} - void object_entry_get_name_fixed(utf8* buffer, size_t bufferSize, const rct_object_entry* entry) { bufferSize = std::min(static_cast(DAT_NAME_LENGTH) + 1, bufferSize); diff --git a/src/openrct2/object/ObjectList.h b/src/openrct2/object/ObjectList.h index 62cbe2cdca..ad5b8378ed 100644 --- a/src/openrct2/object/ObjectList.h +++ b/src/openrct2/object/ObjectList.h @@ -19,4 +19,3 @@ void get_type_entry_index(size_t index, ObjectType* outObjectType, ObjectEntryIndex* outEntryIndex); const rct_object_entry* get_loaded_object_entry(size_t index); -void* get_loaded_object_chunk(size_t index); From 38ec042a52caefd1e51109b36c271c1020b72bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 9 Sep 2021 03:26:52 +0300 Subject: [PATCH 374/681] Refactor object_entry_get_chunk wrapper --- src/openrct2/object/ObjectList.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 186401ae65..d27e33386a 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -160,20 +160,13 @@ void object_entry_get_name_fixed(utf8* buffer, size_t bufferSize, const rct_obje void* object_entry_get_chunk(ObjectType objectType, ObjectEntryIndex index) { - ObjectEntryIndex objectIndex = index; - for (int32_t i = 0; i < EnumValue(objectType); i++) - { - objectIndex += object_entry_group_counts[i]; - } - - void* result = nullptr; auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); - auto obj = objectMgr.GetLoadedObject(objectIndex); - if (obj != nullptr) + auto* object = objectMgr.GetLoadedObject(objectType, index); + if (object != nullptr) { - result = obj->GetLegacyData(); + return object->GetLegacyData(); } - return result; + return nullptr; } const Object* object_entry_get_object(ObjectType objectType, ObjectEntryIndex index) From 50d7b8bb1c518e5bb5a6ceb04498f97e210dff50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 9 Sep 2021 03:27:24 +0300 Subject: [PATCH 375/681] Remove unused function get_loaded_object_entry --- src/openrct2/object/ObjectList.cpp | 14 -------------- src/openrct2/object/ObjectList.h | 1 - 2 files changed, 15 deletions(-) diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index d27e33386a..ab94ef62f4 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -137,20 +137,6 @@ void get_type_entry_index(size_t index, ObjectType* outObjectType, ObjectEntryIn *outEntryIndex = static_cast(index); } -const rct_object_entry* get_loaded_object_entry(size_t index) -{ - ObjectType objectType; - ObjectEntryIndex entryIndex; - get_type_entry_index(index, &objectType, &entryIndex); - auto obj = object_entry_get_object(objectType, entryIndex); - if (obj == nullptr) - { - return nullptr; - } - - return obj->GetObjectEntry(); -} - void object_entry_get_name_fixed(utf8* buffer, size_t bufferSize, const rct_object_entry* entry) { bufferSize = std::min(static_cast(DAT_NAME_LENGTH) + 1, bufferSize); diff --git a/src/openrct2/object/ObjectList.h b/src/openrct2/object/ObjectList.h index ad5b8378ed..b1048fd82c 100644 --- a/src/openrct2/object/ObjectList.h +++ b/src/openrct2/object/ObjectList.h @@ -18,4 +18,3 @@ #include "ObjectLimits.h" void get_type_entry_index(size_t index, ObjectType* outObjectType, ObjectEntryIndex* outEntryIndex); -const rct_object_entry* get_loaded_object_entry(size_t index); From c9e2c9f4d2dfce25c9acc63a4cb864c4994a1058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 11 Sep 2021 17:10:11 +0300 Subject: [PATCH 376/681] Apply review suggestions --- src/openrct2/rct2/S6Exporter.cpp | 30 ++++++++++++++++-------------- src/openrct2/rct2/S6Importer.cpp | 28 ++++++++++++++-------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index a101fe8d18..2b155cc33f 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -255,15 +255,17 @@ static void scenario_fix_ghosts(rct_s6_data* s6) } } -template static void ExportObjectList(IObjectManager& objMgr, T& objects, ObjectType type, size_t maxEntries) +template +static void ExportObjectList(IObjectManager& objMgr, T& objects) { - for (size_t i = 0; i < maxEntries; i++) + for (size_t i = 0; i < TMaxEntries; i++) { auto& dst = objects[i]; - auto* object = objMgr.GetLoadedObject(type, i); + const auto* object = objMgr.GetLoadedObject(TObjectType, i); if (object == nullptr || object->GetObjectEntry() == nullptr) { + // The sv6 format expects null/invalid entries to be filled with 0xFF. std::memset(&dst, 0xFF, sizeof(dst)); } else @@ -297,17 +299,17 @@ void S6Exporter::Export() uint32_t researchedTrackPiecesB[128] = {}; auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); - ExportObjectList(objectMgr, _s6.RideObjects, ObjectType::Ride, RCT12_MAX_RIDE_OBJECTS); - ExportObjectList(objectMgr, _s6.SceneryObjects, ObjectType::SmallScenery, RCT2_MAX_SMALL_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.LargeSceneryObjects, ObjectType::LargeScenery, RCT2_MAX_LARGE_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.WallSceneryObjects, ObjectType::Walls, RCT2_MAX_WALL_SCENERY_OBJECTS); - ExportObjectList(objectMgr, _s6.BannerObjects, ObjectType::Banners, RCT2_MAX_BANNER_OBJECTS); - ExportObjectList(objectMgr, _s6.PathObjects, ObjectType::Paths, RCT2_MAX_PATH_OBJECTS); - ExportObjectList(objectMgr, _s6.PathAdditionObjects, ObjectType::PathBits, RCT2_MAX_PATH_ADDITION_OBJECTS); - ExportObjectList(objectMgr, _s6.SceneryGroupObjects, ObjectType::SceneryGroup, RCT2_MAX_SCENERY_GROUP_OBJECTS); - ExportObjectList(objectMgr, _s6.ParkEntranceObjects, ObjectType::ParkEntrance, RCT2_MAX_PARK_ENTRANCE_OBJECTS); - ExportObjectList(objectMgr, _s6.WaterObjects, ObjectType::Water, RCT2_MAX_WATER_OBJECTS); - ExportObjectList(objectMgr, _s6.ScenarioTextObjects, ObjectType::ScenarioText, RCT2_MAX_SCENARIO_TEXT_OBJECTS); + ExportObjectList(objectMgr, _s6.RideObjects); + ExportObjectList(objectMgr, _s6.SceneryObjects); + ExportObjectList(objectMgr, _s6.LargeSceneryObjects); + ExportObjectList(objectMgr, _s6.WallSceneryObjects); + ExportObjectList(objectMgr, _s6.BannerObjects); + ExportObjectList(objectMgr, _s6.PathObjects); + ExportObjectList(objectMgr, _s6.PathAdditionObjects); + ExportObjectList(objectMgr, _s6.SceneryGroupObjects); + ExportObjectList(objectMgr, _s6.ParkEntranceObjects); + ExportObjectList(objectMgr, _s6.WaterObjects); + ExportObjectList(objectMgr, _s6.ScenarioTextObjects); _s6.elapsed_months = static_cast(gDateMonthsElapsed); _s6.current_day = gDateMonthTicks; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 32fe1918b3..bee403a492 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1563,8 +1563,8 @@ public: return justText.data(); } - template - static void AddRequiredObjects(std::vector& required, const T& list, size_t internalLimit) + template + static void AddRequiredObjects(std::vector& required, const T& list) { rct_object_entry nullEntry = {}; std::memset(&nullEntry, 0xFF, sizeof(nullEntry)); @@ -1576,7 +1576,7 @@ public: // NOTE: The segment of this object type needs to be filled to the internal limit // the object manager currently expects this. - for (size_t i = std::size(list); i < internalLimit; i++) + for (size_t i = std::size(list); i < TInternalLimit; i++) { required.push_back(nullEntry); } @@ -1586,17 +1586,17 @@ public: { std::vector result; - AddRequiredObjects(result, _s6.RideObjects, MAX_RIDE_OBJECTS); - AddRequiredObjects(result, _s6.SceneryObjects, MAX_SMALL_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.LargeSceneryObjects, MAX_LARGE_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.WallSceneryObjects, MAX_WALL_SCENERY_OBJECTS); - AddRequiredObjects(result, _s6.BannerObjects, MAX_BANNER_OBJECTS); - AddRequiredObjects(result, _s6.PathObjects, MAX_PATH_OBJECTS); - AddRequiredObjects(result, _s6.PathAdditionObjects, MAX_PATH_ADDITION_OBJECTS); - AddRequiredObjects(result, _s6.SceneryGroupObjects, MAX_SCENERY_GROUP_OBJECTS); - AddRequiredObjects(result, _s6.ParkEntranceObjects, MAX_PARK_ENTRANCE_OBJECTS); - AddRequiredObjects(result, _s6.WaterObjects, MAX_WATER_OBJECTS); - AddRequiredObjects(result, _s6.ScenarioTextObjects, MAX_SCENARIO_TEXT_OBJECTS); + AddRequiredObjects(result, _s6.RideObjects); + AddRequiredObjects(result, _s6.SceneryObjects); + AddRequiredObjects(result, _s6.LargeSceneryObjects); + AddRequiredObjects(result, _s6.WallSceneryObjects); + AddRequiredObjects(result, _s6.BannerObjects); + AddRequiredObjects(result, _s6.PathObjects); + AddRequiredObjects(result, _s6.PathAdditionObjects); + AddRequiredObjects(result, _s6.SceneryGroupObjects); + AddRequiredObjects(result, _s6.ParkEntranceObjects); + AddRequiredObjects(result, _s6.WaterObjects); + AddRequiredObjects(result, _s6.ScenarioTextObjects); return result; } From 2daa356fbfa5e67b09c708b4d9d8cb084bbeabee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 11 Sep 2021 19:06:17 +0300 Subject: [PATCH 377/681] Move ZipStream into new header --- OpenRCT2.xcodeproj/project.pbxproj | 4 ++ src/openrct2/core/ZipStream.hpp | 86 ++++++++++++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 3 +- src/openrct2/object/Object.cpp | 70 +----------------------- 4 files changed, 93 insertions(+), 70 deletions(-) create mode 100644 src/openrct2/core/ZipStream.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index f0fdda19f7..1addaf0b3a 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -801,6 +801,7 @@ 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */; }; E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA720D496604387806AC168 /* RideUseSystem.h */; }; C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4D523B8782E4C458AF1490D /* GroupVector.hpp */; }; + B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F28A181D311D4E078FDB090C /* ZipStream.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1906,6 +1907,7 @@ 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideUseSystem.cpp; path = src/openrct2/peep/RideUseSystem.cpp; sourceTree = SOURCE_ROOT; }; 2DA720D496604387806AC168 /* RideUseSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RideUseSystem.h; path = src/openrct2/peep/RideUseSystem.h; sourceTree = SOURCE_ROOT; }; F4D523B8782E4C458AF1490D /* GroupVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GroupVector.hpp; path = src/openrct2/core/GroupVector.hpp; sourceTree = SOURCE_ROOT; }; + F28A181D311D4E078FDB090C /* ZipStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ZipStream.hpp; path = src/openrct2/core/ZipStream.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2576,6 +2578,7 @@ F76C839A1EC4E7CC00FA49E2 /* Zip.h */, BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */, F4D523B8782E4C458AF1490D /* GroupVector.hpp */, + F28A181D311D4E078FDB090C /* ZipStream.hpp */, ); path = core; sourceTree = ""; @@ -3659,6 +3662,7 @@ DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */, E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */, C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */, + B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/core/ZipStream.hpp b/src/openrct2/core/ZipStream.hpp new file mode 100644 index 0000000000..0a2ede8bad --- /dev/null +++ b/src/openrct2/core/ZipStream.hpp @@ -0,0 +1,86 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "IStream.hpp" +#include "Zip.h" + +#include + +namespace OpenRCT2 +{ + /** + * Couples a zip archive and a zip item stream to ensure the lifetime of the zip archive is maintained + * for the lifetime of the stream. + */ + class ZipStreamWrapper final : public IStream + { + private: + std::unique_ptr _zipArchive; + std::unique_ptr _base; + + public: + ZipStreamWrapper(std::unique_ptr zipArchive, std::unique_ptr base) + : _zipArchive(std::move(zipArchive)) + , _base(std::move(base)) + { + } + + bool CanRead() const override + { + return _base->CanRead(); + } + + bool CanWrite() const override + { + return _base->CanWrite(); + } + + uint64_t GetLength() const override + { + return _base->GetLength(); + } + + uint64_t GetPosition() const override + { + return _base->GetPosition(); + } + + void SetPosition(uint64_t position) override + { + _base->SetPosition(position); + } + + void Seek(int64_t offset, int32_t origin) override + { + _base->Seek(offset, origin); + } + + void Read(void* buffer, uint64_t length) override + { + _base->Read(buffer, length); + } + + void Write(const void* buffer, uint64_t length) override + { + _base->Write(buffer, length); + } + + uint64_t TryRead(void* buffer, uint64_t length) override + { + return _base->TryRead(buffer, length); + } + + const void* GetData() const override + { + return _base->GetData(); + } + }; + +} // namespace OpenRCT2 diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index f2f780a5fa..70da83f6af 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -185,6 +185,7 @@ + @@ -923,4 +924,4 @@ - + \ No newline at end of file diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 6de569acdf..7c7fd8a417 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -14,7 +14,7 @@ #include "../core/FileStream.h" #include "../core/Memory.hpp" #include "../core/String.hpp" -#include "../core/Zip.h" +#include "../core/ZipStream.hpp" #include "../localisation/Language.h" #include "../localisation/LocalisationService.h" #include "../localisation/StringIds.h" @@ -171,74 +171,6 @@ std::optional rct_object_entry::GetSceneryType() const } } -/** - * Couples a zip archive and a zip item stream to ensure the lifetime of the zip archive is maintained - * for the lifetime of the stream. - */ -class ZipStreamWrapper final : public IStream -{ -private: - std::unique_ptr _zipArchive; - std::unique_ptr _base; - -public: - ZipStreamWrapper(std::unique_ptr zipArchive, std::unique_ptr base) - : _zipArchive(std::move(zipArchive)) - , _base(std::move(base)) - { - } - - bool CanRead() const override - { - return _base->CanRead(); - } - - bool CanWrite() const override - { - return _base->CanWrite(); - } - - uint64_t GetLength() const override - { - return _base->GetLength(); - } - - uint64_t GetPosition() const override - { - return _base->GetPosition(); - } - - void SetPosition(uint64_t position) override - { - _base->SetPosition(position); - } - - void Seek(int64_t offset, int32_t origin) override - { - _base->Seek(offset, origin); - } - - void Read(void* buffer, uint64_t length) override - { - _base->Read(buffer, length); - } - - void Write(const void* buffer, uint64_t length) override - { - _base->Write(buffer, length); - } - - uint64_t TryRead(void* buffer, uint64_t length) override - { - return _base->TryRead(buffer, length); - } - - const void* GetData() const override - { - return _base->GetData(); - } -}; - bool ObjectAsset::IsAvailable() const { if (_zipPath.empty()) From b733e97bfae25b2497420cb47910f1c00b62da01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 11 Sep 2021 19:53:14 +0300 Subject: [PATCH 378/681] Remove numerics from common.h and use it as needed --- src/openrct2/actions/TrackPlaceAction.cpp | 3 ++- src/openrct2/common.h | 12 ------------ src/openrct2/core/FileIndex.hpp | 3 ++- src/openrct2/core/FileScanner.cpp | 3 ++- src/openrct2/core/Numerics.hpp | 9 +++++++++ src/openrct2/drawing/TTF.cpp | 3 ++- src/openrct2/drawing/X8DrawingEngine.cpp | 3 ++- src/openrct2/object/ObjectRepository.cpp | 9 +++++---- .../paint/tile_element/Paint.LargeScenery.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.Path.cpp | 9 +++++---- src/openrct2/paint/tile_element/Paint.Surface.cpp | 5 +++-- .../paint/tile_element/Paint.TileElement.cpp | 3 ++- src/openrct2/peep/Guest.cpp | 5 +++-- src/openrct2/rct12/SawyerChunkReader.cpp | 3 ++- src/openrct2/rct12/SawyerChunkWriter.cpp | 3 ++- src/openrct2/rct12/SawyerEncoding.cpp | 3 ++- src/openrct2/rct2/S6Exporter.cpp | 9 ++++++--- src/openrct2/rct2/S6Importer.cpp | 3 +++ src/openrct2/rct2/SeaDecrypt.cpp | 5 +++-- src/openrct2/ride/Ride.cpp | 9 +++++---- src/openrct2/ride/TrackDesign.cpp | 3 ++- src/openrct2/ride/gentle/Maze.cpp | 3 ++- src/openrct2/scenario/ScenarioRepository.cpp | 3 ++- src/openrct2/util/SawyerCoding.cpp | 13 +++++++------ src/openrct2/world/Park.h | 3 --- 25 files changed, 75 insertions(+), 55 deletions(-) diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index a3269cbe9a..f0fc1898cb 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -9,6 +9,7 @@ #include "TrackPlaceAction.h" +#include "../core/Numerics.hpp" #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/Track.h" @@ -453,7 +454,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const // Remove walls in the directions this track intersects uint8_t intersectingDirections = wallEdges[blockIndex]; intersectingDirections ^= 0x0F; - intersectingDirections = rol4(intersectingDirections, _origin.direction); + intersectingDirections = Numerics::rol4(intersectingDirections, _origin.direction); for (int32_t i = 0; i < NumOrthogonalDirections; i++) { if (intersectingDirections & (1 << i)) diff --git a/src/openrct2/common.h b/src/openrct2/common.h index cc0e1d517a..5a5cae5ade 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -19,15 +19,12 @@ #endif #include "Diagnostic.h" -#include "core/Numerics.hpp" #include #include #include #include -using namespace Numerics; - using utf8 = char; using utf8string = utf8*; using const_utf8string = const utf8*; @@ -41,15 +38,6 @@ using const_utf8string = const utf8*; using codepoint_t = uint32_t; using colour_t = uint8_t; -const constexpr auto rol8 = rol; -const constexpr auto ror8 = ror; -const constexpr auto rol16 = rol; -const constexpr auto ror16 = ror; -const constexpr auto rol32 = rol; -const constexpr auto ror32 = ror; -const constexpr auto rol64 = rol; -const constexpr auto ror64 = ror; - namespace { [[maybe_unused]] constexpr bool is_power_of_2(int v) diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 0e5d570a47..0d01da1e42 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -16,6 +16,7 @@ #include "FileScanner.h" #include "FileStream.h" #include "JobPool.h" +#include "Numerics.hpp" #include "Path.hpp" #include @@ -156,7 +157,7 @@ private: stats.TotalFileSize += fileInfo->Size; stats.FileDateModifiedChecksum ^= static_cast(fileInfo->LastModified >> 32) ^ static_cast(fileInfo->LastModified & 0xFFFFFFFF); - stats.FileDateModifiedChecksum = ror32(stats.FileDateModifiedChecksum, 5); + stats.FileDateModifiedChecksum = Numerics::ror32(stats.FileDateModifiedChecksum, 5); stats.PathChecksum += GetPathChecksum(path); files.push_back(std::move(path)); diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp index 9c79c500f7..07662b1134 100644 --- a/src/openrct2/core/FileScanner.cpp +++ b/src/openrct2/core/FileScanner.cpp @@ -25,6 +25,7 @@ #include "FileScanner.h" #include "Memory.hpp" +#include "Numerics.hpp" #include "Path.hpp" #include "String.hpp" @@ -363,7 +364,7 @@ void Path::QueryDirectory(QueryDirectoryResult* result, const std::string& patte result->TotalFileSize += fileInfo->Size; result->FileDateModifiedChecksum ^= static_cast(fileInfo->LastModified >> 32) ^ static_cast(fileInfo->LastModified & 0xFFFFFFFF); - result->FileDateModifiedChecksum = ror32(result->FileDateModifiedChecksum, 5); + result->FileDateModifiedChecksum = Numerics::ror32(result->FileDateModifiedChecksum, 5); result->PathChecksum += GetPathChecksum(path); } } diff --git a/src/openrct2/core/Numerics.hpp b/src/openrct2/core/Numerics.hpp index 13c1b6a772..38855da2c4 100644 --- a/src/openrct2/core/Numerics.hpp +++ b/src/openrct2/core/Numerics.hpp @@ -68,4 +68,13 @@ namespace Numerics return (x >> shift | x << (4 - shift)) & 0x0F; } + const constexpr auto rol8 = rol; + const constexpr auto ror8 = ror; + const constexpr auto rol16 = rol; + const constexpr auto ror16 = ror; + const constexpr auto rol32 = rol; + const constexpr auto ror32 = ror; + const constexpr auto rol64 = rol; + const constexpr auto ror64 = ror; + } // namespace Numerics diff --git a/src/openrct2/drawing/TTF.cpp b/src/openrct2/drawing/TTF.cpp index 7887bb8e6f..c32039e870 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -19,6 +19,7 @@ # include "../OpenRCT2.h" # include "../config/Config.h" +# include "../core/Numerics.hpp" # include "../core/String.hpp" # include "../localisation/Localisation.h" # include "../localisation/LocalisationService.h" @@ -186,7 +187,7 @@ static uint32_t ttf_surface_cache_hash(TTF_Font* font, std::string_view text) uint32_t hash = static_cast(((reinterpret_cast(font) * 23) ^ 0xAAAAAAAA) & 0xFFFFFFFF); for (auto c : text) { - hash = ror32(hash, 3) ^ (c * 13); + hash = Numerics::ror32(hash, 3) ^ (c * 13); } return hash; } diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 528e236892..3afc9e1bb2 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -13,6 +13,7 @@ #include "../Game.h" #include "../Intro.h" #include "../config/Config.h" +#include "../core/Numerics.hpp" #include "../interface/Screenshot.h" #include "../interface/Viewport.h" #include "../interface/Window.h" @@ -583,7 +584,7 @@ void X8DrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, int3 for (int32_t i = 0; i < height; i++) { uint8_t* nextdst = dst + dpi->width + dpi->pitch; - uint32_t p = ror32(crossPattern, 1); + uint32_t p = Numerics::ror32(crossPattern, 1); p = (p & 0xFFFF0000) | width; // Fill every other pixel with the colour diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index ea19c419bf..4c8329323e 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -21,6 +21,7 @@ #include "../core/IStream.hpp" #include "../core/Memory.hpp" #include "../core/MemoryStream.h" +#include "../core/Numerics.hpp" #include "../core/Path.hpp" #include "../core/String.hpp" #include "../localisation/Localisation.h" @@ -757,11 +758,11 @@ int32_t object_calculate_checksum(const rct_object_entry* entry, const void* dat uint32_t checksum = 0xF369A75B; checksum ^= entryBytePtr[0]; - checksum = rol32(checksum, 11); + checksum = Numerics::rol32(checksum, 11); for (int32_t i = 4; i < 12; i++) { checksum ^= entryBytePtr[i]; - checksum = rol32(checksum, 11); + checksum = Numerics::rol32(checksum, 11); } const uint8_t* dataBytes = reinterpret_cast(data); @@ -772,12 +773,12 @@ int32_t object_calculate_checksum(const rct_object_entry* entry, const void* dat { checksum ^= dataBytes[j]; } - checksum = rol32(checksum, 11); + checksum = Numerics::rol32(checksum, 11); } for (size_t i = dataLength32; i < dataLength; i++) { checksum ^= dataBytes[i]; - checksum = rol32(checksum, 11); + checksum = Numerics::rol32(checksum, 11); } return static_cast(checksum); diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 5a332d641e..4e806ce90a 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -9,6 +9,7 @@ #include "../../Game.h" #include "../../config/Config.h" +#include "../../core/Numerics.hpp" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" #include "../../object/LargeSceneryObject.h" @@ -278,7 +279,7 @@ void PaintLargeScenery(paint_session* session, uint8_t direction, uint16_t heigh if (edi & 0xF00) { edi &= 0xF000; - edi = rol16(edi, direction); + edi = Numerics::rol16(edi, direction); esi = (edi & 0xF) | (edi >> 12); } const CoordsXYZ bbOffset = { s98E3C4[esi].offset, height }; diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 5f93c63949..33892bbe61 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -9,6 +9,7 @@ #include "../../Game.h" #include "../../config/Config.h" +#include "../../core/Numerics.hpp" #include "../../drawing/LightFX.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" @@ -174,7 +175,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(pathElement.GetAdditionStatus() & ror8(0x3, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & Numerics::ror8(0x3, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -195,7 +196,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(pathElement.GetAdditionStatus() & ror8(0xC, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & Numerics::ror8(0xC, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -217,7 +218,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(pathElement.GetAdditionStatus() & ror8(0x30, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & Numerics::ror8(0x30, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } @@ -239,7 +240,7 @@ static void path_bit_bins_paint( // Edges have been rotated around the rotation to check addition status // this will also need to be rotated. - binIsFull = !(pathElement.GetAdditionStatus() & ror8(0xC0, (2 * session->CurrentRotation))); + binIsFull = !(pathElement.GetAdditionStatus() & Numerics::ror8(0xC0, (2 * session->CurrentRotation))); if (binIsFull) imageId += 8; } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index fb6f601787..ba9f146089 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -14,6 +14,7 @@ #include "../../OpenRCT2.h" #include "../../config/Config.h" #include "../../core/Guard.hpp" +#include "../../core/Numerics.hpp" #include "../../drawing/Drawing.h" #include "../../interface/Colour.h" #include "../../interface/Viewport.h" @@ -950,7 +951,7 @@ static std::pair surface_get_height_above_water( } else { - localSurfaceShape = ror4(surfaceShape ^ TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK, 2); + localSurfaceShape = Numerics::ror4(surfaceShape ^ TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK, 2); } } } @@ -1340,7 +1341,7 @@ void PaintSurface(paint_session* session, uint8_t direction, uint16_t height, co // Owned land boundary fences session->InteractionType = ViewportInteractionItem::ParkEntrance; - uint8_t rotatedFences = rol4(tileElement.GetParkFences(), rotation); + uint8_t rotatedFences = Numerics::rol4(tileElement.GetParkFences(), rotation); for (const auto& fenceData : _tileSurfaceBoundaries) { diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 98eb889f2b..c6fa7c74e9 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -12,6 +12,7 @@ #include "../../Game.h" #include "../../Input.h" #include "../../config/Config.h" +#include "../../core/Numerics.hpp" #include "../../drawing/Drawing.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" @@ -427,7 +428,7 @@ void paint_util_set_segment_support_height(paint_session* session, int32_t segme uint16_t paint_util_rotate_segments(uint16_t segments, uint8_t rotation) { uint8_t temp = segments & 0xFF; - temp = rol8(temp, rotation * 2); + temp = Numerics::rol8(temp, rotation * 2); return (segments & 0xFF00) | temp; } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 747b8670f4..2e3a2da226 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -13,6 +13,7 @@ #include "../audio/audio.h" #include "../config/Config.h" #include "../core/Guard.hpp" +#include "../core/Numerics.hpp" #include "../interface/Window_internal.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" @@ -6001,7 +6002,7 @@ bool Guest::UpdateWalkingFindBin() uint8_t bin_quantities = pathElement->GetAdditionStatus(); // Rotate the bin to the correct edge. Makes it easier for next calc. - bin_quantities = ror8(ror8(bin_quantities, chosen_edge), chosen_edge); + bin_quantities = Numerics::ror8(Numerics::ror8(bin_quantities, chosen_edge), chosen_edge); for (uint8_t free_edge = 4; free_edge != 0; free_edge--) { @@ -6012,7 +6013,7 @@ bool Guest::UpdateWalkingFindBin() break; } chosen_edge = (chosen_edge + 1) & 0x3; - bin_quantities = ror8(bin_quantities, 2); + bin_quantities = Numerics::ror8(bin_quantities, 2); if ((free_edge - 1) == 0) return 0; } diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index 3ce28fadff..dee3fbfa20 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -10,6 +10,7 @@ #include "SawyerChunkReader.h" #include "../core/IStream.hpp" +#include "../core/Numerics.hpp" // malloc is very slow for large allocations in MSVC debug builds as it allocates // memory on a special debug heap and then initialises all the memory to 0xCC. @@ -295,7 +296,7 @@ size_t SawyerChunkReader::DecodeChunkRotate(void* dst, size_t dstCapacity, const uint8_t code = 1; for (size_t i = 0; i < srcLength; i++) { - dst8[i] = ror8(src8[i], code); + dst8[i] = Numerics::ror8(src8[i], code); code = (code + 2) % 8; } return srcLength; diff --git a/src/openrct2/rct12/SawyerChunkWriter.cpp b/src/openrct2/rct12/SawyerChunkWriter.cpp index 83a7dc944c..938a1176b3 100644 --- a/src/openrct2/rct12/SawyerChunkWriter.cpp +++ b/src/openrct2/rct12/SawyerChunkWriter.cpp @@ -10,6 +10,7 @@ #include "SawyerChunkWriter.h" #include "../core/IStream.hpp" +#include "../core/Numerics.hpp" #include "../util/SawyerCoding.h" // Maximum buffer size to store compressed data, maximum of 16 MiB @@ -99,7 +100,7 @@ void SawyerChunkWriter::WriteChunkTrack(const void* src, size_t length) { uint8_t newByte = ((checksum & 0xFF) + data[i]) & 0xFF; checksum = (checksum & 0xFFFFFF00) + newByte; - checksum = rol32(checksum, 3); + checksum = Numerics::rol32(checksum, 3); } checksum -= 0x1D4C1; diff --git a/src/openrct2/rct12/SawyerEncoding.cpp b/src/openrct2/rct12/SawyerEncoding.cpp index 0172d68d5b..758b6cb226 100644 --- a/src/openrct2/rct12/SawyerEncoding.cpp +++ b/src/openrct2/rct12/SawyerEncoding.cpp @@ -10,6 +10,7 @@ #include "SawyerEncoding.h" #include "../core/IStream.hpp" +#include "../core/Numerics.hpp" #include "RCT12.h" #include @@ -80,7 +81,7 @@ namespace SawyerEncoding { uint8_t newByte = ((checksum & 0xFF) + *data) & 0xFF; checksum = (checksum & 0xFFFFFF00) + newByte; - checksum = rol32(checksum, 3); + checksum = Numerics::rol32(checksum, 3); } uint32_t fileChecksum = stream->ReadValue(); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 2b155cc33f..8952fc624f 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -18,6 +18,7 @@ #include "../config/Config.h" #include "../core/FileStream.h" #include "../core/IStream.hpp" +#include "../core/Numerics.hpp" #include "../core/String.hpp" #include "../interface/Viewport.h" #include "../interface/Window.h" @@ -64,6 +65,8 @@ #include #include +#define ENCRYPT_MONEY(money) (static_cast(Numerics::ror32((money), 13) ^ 0xF4EC9621)) + S6Exporter::S6Exporter() { RemoveTracklessRides = false; @@ -597,11 +600,11 @@ uint32_t S6Exporter::GetLoanHash(money32 initialCash, money32 bankLoan, uint32_t { int32_t value = 0x70093A; value -= initialCash; - value = ror32(value, 5); + value = Numerics::ror32(value, 5); value -= bankLoan; - value = ror32(value, 7); + value = Numerics::ror32(value, 7); value += maxBankLoan; - value = ror32(value, 3); + value = Numerics::ror32(value, 3); return value; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index bee403a492..b92b7ed13c 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -18,6 +18,7 @@ #include "../core/Console.hpp" #include "../core/FileStream.h" #include "../core/IStream.hpp" +#include "../core/Numerics.hpp" #include "../core/Path.hpp" #include "../core/Random.hpp" #include "../core/String.hpp" @@ -70,6 +71,8 @@ #include +#define DECRYPT_MONEY(money) (static_cast(Numerics::rol32((money) ^ 0xF4EC9621, 13))) + /** * Class to import RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). */ diff --git a/src/openrct2/rct2/SeaDecrypt.cpp b/src/openrct2/rct2/SeaDecrypt.cpp index 0d7e1bb837..5ca8c7f4de 100644 --- a/src/openrct2/rct2/SeaDecrypt.cpp +++ b/src/openrct2/rct2/SeaDecrypt.cpp @@ -9,6 +9,7 @@ #include "../common.h" #include "../core/File.h" +#include "../core/Numerics.hpp" #include "../core/Path.hpp" #include "RCT2.h" @@ -53,8 +54,8 @@ static std::vector CreateMask(const EncryptionKey& key) { uint32_t s0 = seed0; uint32_t s1 = seed1 ^ 0xF7654321; - seed0 = rol32(s1, 25) + s0; - seed1 = rol32(s0, 29); + seed0 = Numerics::rol32(s1, 25) + s0; + seed1 = Numerics::rol32(s0, 29); result[i + 0] = (s0 >> 3) & 0xFF; result[i + 1] = (s0 >> 11) & 0xFF; result[i + 2] = (s0 >> 19) & 0xFF; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index d39f418e69..9975a6b51e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -24,6 +24,7 @@ #include "../config/Config.h" #include "../core/FixedVector.h" #include "../core/Guard.hpp" +#include "../core/Numerics.hpp" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -2234,7 +2235,7 @@ static void ride_shop_connected(Ride* ride) const auto& ted = GetTrackElementDescriptor(track_type); uint8_t entrance_directions = ted.SequenceProperties[0] & 0xF; uint8_t tile_direction = trackElement->GetDirection(); - entrance_directions = rol4(entrance_directions, tile_direction); + entrance_directions = Numerics::rol4(entrance_directions, tile_direction); // Now each bit in entrance_directions stands for an entrance direction to check if (entrance_directions == 0) @@ -3043,7 +3044,7 @@ static Vehicle* vehicle_create_car( vehicle->vehicle_type = vehicleEntryIndex; vehicle->SubType = carIndex == 0 ? Vehicle::Type::Head : Vehicle::Type::Tail; - vehicle->var_44 = ror32(vehicleEntry->spacing, 10) & 0xFFFF; + vehicle->var_44 = Numerics::ror32(vehicleEntry->spacing, 10) & 0xFFFF; auto edx = vehicleEntry->spacing >> 1; *remainingDistance -= edx; vehicle->remaining_distance = *remainingDistance; @@ -3666,9 +3667,9 @@ static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying) uint32_t ebx = 0; for (int32_t i = 0; i < 5; i++) { - uint32_t edx = ror32(0x15478, 10); + uint32_t edx = Numerics::ror32(0x15478, 10); uint16_t var_44 = edx & 0xFFFF; - edx = rol32(edx, 10) >> 1; + edx = Numerics::rol32(edx, 10) >> 1; ebx -= edx; int32_t remaining_distance = ebx; ebx -= edx; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 747430bc7c..3cbc658e65 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -33,6 +33,7 @@ #include "../audio/audio.h" #include "../core/DataSerialiser.h" #include "../core/File.h" +#include "../core/Numerics.hpp" #include "../core/String.hpp" #include "../drawing/X8DrawingEngine.h" #include "../localisation/Localisation.h" @@ -1420,7 +1421,7 @@ static std::optional track_design_place_maze(TrackDesign* td6, const Co } break; default: - maze_entry = rol16(maze_element.maze_entry, rotation * 4); + maze_entry = Numerics::rol16(maze_element.maze_entry, rotation * 4); if (_trackDesignPlaceOperation == PTD_OPERATION_PLACE_TRACK_PREVIEW) { diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index 51d75f9d5d..b46e1e4268 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../core/Numerics.hpp" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" @@ -49,7 +50,7 @@ static void maze_paint_setup( const TrackElement& trackElement) { uint16_t maze_entry = trackElement.GetMazeEntry(); - maze_entry = rol16(maze_entry, direction * 4); + maze_entry = Numerics::rol16(maze_entry, direction * 4); uint32_t rotation = session->CurrentRotation; // draw ground diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 822d884cf1..48b31d8d01 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -19,6 +19,7 @@ #include "../core/FileIndex.hpp" #include "../core/FileStream.h" #include "../core/MemoryStream.h" +#include "../core/Numerics.hpp" #include "../core/Path.hpp" #include "../core/String.hpp" #include "../localisation/Language.h" @@ -526,7 +527,7 @@ private: // Rotate each byte of mp.dat left by 4 bits to convert for (size_t i = 0; i < mpdat.size(); i++) { - mpdat[i] = rol8(mpdat[i], 4); + mpdat[i] = Numerics::rol8(mpdat[i], 4); } File::WriteAllBytes(dstPath, mpdat.data(), mpdat.size()); diff --git a/src/openrct2/util/SawyerCoding.cpp b/src/openrct2/util/SawyerCoding.cpp index b8c2fb586d..2c03a10910 100644 --- a/src/openrct2/util/SawyerCoding.cpp +++ b/src/openrct2/util/SawyerCoding.cpp @@ -9,6 +9,7 @@ #include "SawyerCoding.h" +#include "../core/Numerics.hpp" #include "../platform/platform.h" #include "../scenario/Scenario.h" #include "Util.h" @@ -113,10 +114,10 @@ size_t sawyercoding_decode_sc4(const uint8_t* src, uint8_t* dst, size_t length, for (size_t i = 0x60018; i <= std::min(decodedLength - 1, static_cast(0x1F8350)); i += 4) { - dst[i + 1] = ror8(dst[i + 1], 3); + dst[i + 1] = Numerics::ror8(dst[i + 1], 3); uint32_t* code = reinterpret_cast(&dst[i]); - *code = rol32(*code, 9); + *code = Numerics::rol32(*code, 9); } return decodedLength; @@ -148,7 +149,7 @@ size_t sawyercoding_encode_td6(const uint8_t* src, uint8_t* dst, size_t length) { uint8_t new_byte = ((checksum & 0xFF) + dst[i]) & 0xFF; checksum = (checksum & 0xFFFFFF00) + new_byte; - checksum = rol32(checksum, 3); + checksum = Numerics::rol32(checksum, 3); } checksum -= 0x1D4C1; @@ -167,7 +168,7 @@ int32_t sawyercoding_validate_track_checksum(const uint8_t* src, size_t length) { uint8_t new_byte = ((checksum & 0xFF) + src[i]) & 0xFF; checksum = (checksum & 0xFFFFFF00) + new_byte; - checksum = rol32(checksum, 3); + checksum = Numerics::rol32(checksum, 3); } if (checksum - 0x1D4C1 == file_checksum) @@ -383,7 +384,7 @@ static void encode_chunk_rotate(uint8_t* buffer, size_t length) uint8_t code = 1; for (i = 0; i < length; i++) { - buffer[i] = rol8(buffer[i], code); + buffer[i] = Numerics::rol8(buffer[i], code); code = (code + 2) % 8; } } @@ -401,7 +402,7 @@ int32_t sawyercoding_detect_file_type(const uint8_t* src, size_t length) for (i = 0; i < length - 4; i++) { actualChecksum = (actualChecksum & 0xFFFFFF00) | (((actualChecksum & 0xFF) + static_cast(src[i])) & 0xFF); - actualChecksum = rol32(actualChecksum, 3); + actualChecksum = Numerics::rol32(actualChecksum, 3); } return sawyercoding_detect_rct1_version(checksum - actualChecksum); diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 786d122e10..7f27f77076 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -13,9 +13,6 @@ #include "../ride/Ride.h" #include "Map.h" -#define DECRYPT_MONEY(money) (static_cast(rol32((money) ^ 0xF4EC9621, 13))) -#define ENCRYPT_MONEY(money) (static_cast(ror32((money), 13) ^ 0xF4EC9621)) - #define MAX_ENTRANCE_FEE MONEY(200, 00) constexpr const uint8_t ParkRatingHistoryUndefined = std::numeric_limits::max(); From f999b0acb2a09c468d24173da145a2753e0455a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 12 Sep 2021 15:44:28 +0300 Subject: [PATCH 379/681] Remove Nullable and use std::optional instead --- OpenRCT2.xcodeproj/project.pbxproj | 1 - src/openrct2/core/Nullable.hpp | 55 ---------------------------- src/openrct2/libopenrct2.vcxproj | 1 - src/openrct2/network/NetworkBase.cpp | 7 ++-- src/openrct2/network/NetworkUser.cpp | 8 ++-- src/openrct2/network/NetworkUser.h | 4 +- 6 files changed, 9 insertions(+), 67 deletions(-) delete mode 100644 src/openrct2/core/Nullable.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 1addaf0b3a..b42fb62b82 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -1685,7 +1685,6 @@ F76C838B1EC4E7CC00FA49E2 /* Memory.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Memory.hpp; sourceTree = ""; }; F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryStream.cpp; sourceTree = ""; }; F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MemoryStream.h; sourceTree = ""; }; - F76C838E1EC4E7CC00FA49E2 /* Nullable.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Nullable.hpp; sourceTree = ""; }; F76C838F1EC4E7CC00FA49E2 /* Path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Path.cpp; sourceTree = ""; }; F76C83901EC4E7CC00FA49E2 /* Path.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Path.hpp; sourceTree = ""; }; F76C83921EC4E7CC00FA49E2 /* String.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = ""; }; diff --git a/src/openrct2/core/Nullable.hpp b/src/openrct2/core/Nullable.hpp deleted file mode 100644 index 96774e4c7d..0000000000 --- a/src/openrct2/core/Nullable.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2020 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 "../common.h" - -#include - -template struct Nullable -{ -public: - Nullable() - { - _value = T(); - _hasValue = false; - } - - Nullable(std::nullptr_t) - { - _value = T(); - _hasValue = false; - } - - Nullable(const T& value) - { - _value = value; - _hasValue = true; - } - - bool HasValue() const - { - return _hasValue; - } - - T GetValue() const - { - return _value; - } - - T GetValueOrDefault(T defaultValue) const - { - return _hasValue ? _value : defaultValue; - } - -private: - T _value; - bool _hasValue; -}; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 70da83f6af..d49c087fba 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -175,7 +175,6 @@ - diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index d2c3334245..a2cb4da7a2 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -61,7 +61,6 @@ static constexpr uint32_t MaxPacketsPerUpdate = 100; # include "../core/Console.hpp" # include "../core/FileStream.h" # include "../core/MemoryStream.h" -# include "../core/Nullable.hpp" # include "../core/Path.hpp" # include "../core/String.hpp" # include "../interface/Chat.h" @@ -912,9 +911,9 @@ uint8_t NetworkBase::GetGroupIDByHash(const std::string& keyhash) const NetworkUser* networkUser = _userManager.GetUserByHash(keyhash); uint8_t groupId = GetDefaultGroup(); - if (networkUser != nullptr && networkUser->GroupId.HasValue()) + if (networkUser != nullptr && networkUser->GroupId.has_value()) { - const uint8_t assignedGroup = networkUser->GroupId.GetValue(); + const uint8_t assignedGroup = *networkUser->GroupId; if (GetGroupByID(assignedGroup) != nullptr) { groupId = assignedGroup; @@ -2058,7 +2057,7 @@ NetworkPlayer* NetworkBase::AddPlayer(const std::string& name, const std::string } else { - player->Group = networkUser->GroupId.GetValueOrDefault(GetDefaultGroup()); + player->Group = networkUser->GroupId.has_value() ? *networkUser->GroupId : GetDefaultGroup(); player->SetName(networkUser->Name); } diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index 456262e814..9d53100687 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -52,9 +52,9 @@ json_t NetworkUser::ToJson() const jsonData["name"] = Name; json_t jsonGroupId; - if (GroupId.HasValue()) + if (GroupId.has_value()) { - jsonGroupId = GroupId.GetValue(); + jsonGroupId = *GroupId; } jsonData["groupId"] = jsonGroupId; @@ -172,9 +172,9 @@ void NetworkUserManager::UnsetUsersOfGroup(uint8_t groupId) for (const auto& kvp : _usersByHash) { NetworkUser* networkUser = kvp.second; - if (networkUser->GroupId.HasValue() && networkUser->GroupId.GetValue() == groupId) + if (networkUser->GroupId.has_value() && *networkUser->GroupId == groupId) { - networkUser->GroupId = nullptr; + networkUser->GroupId = std::nullopt; } } } diff --git a/src/openrct2/network/NetworkUser.h b/src/openrct2/network/NetworkUser.h index 4cb750dd1d..4f114ecc2b 100644 --- a/src/openrct2/network/NetworkUser.h +++ b/src/openrct2/network/NetworkUser.h @@ -11,9 +11,9 @@ #include "../common.h" #include "../core/JsonFwd.hpp" -#include "../core/Nullable.hpp" #include +#include #include class NetworkUser final @@ -21,7 +21,7 @@ class NetworkUser final public: std::string Hash; std::string Name; - Nullable GroupId; + std::optional GroupId; bool Remove; /** From 4f319d6ed4cb4dc032e2625741195d1c3931ed19 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 3 Sep 2021 19:19:42 +0200 Subject: [PATCH 380/681] Prepare footpath handling for surfaces and railings --- src/openrct2-ui/windows/Footpath.cpp | 458 +++++++++++++----- src/openrct2-ui/windows/TileInspector.cpp | 1 + src/openrct2/actions/FootpathPlaceAction.cpp | 130 ++++- src/openrct2/actions/FootpathPlaceAction.h | 9 +- .../actions/FootpathPlaceFromTrackAction.cpp | 74 ++- .../actions/FootpathPlaceFromTrackAction.h | 7 +- .../actions/PlaceParkEntranceAction.cpp | 9 +- .../object/FootpathRailingsObject.cpp | 1 + src/openrct2/paint/Paint.h | 13 + src/openrct2/paint/Supports.cpp | 29 +- src/openrct2/paint/Supports.h | 6 +- .../paint/tile_element/Paint.Entrance.cpp | 4 + .../paint/tile_element/Paint.Path.cpp | 135 +++--- src/openrct2/ride/TrackDesign.cpp | 12 +- src/openrct2/ride/TrackDesign.h | 5 + src/openrct2/world/Footpath.cpp | 38 +- src/openrct2/world/Footpath.h | 38 +- src/openrct2/world/Map.cpp | 4 +- src/openrct2/world/TileElement.h | 6 +- 19 files changed, 719 insertions(+), 260 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index ed4915bccc..e58c686ed8 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,10 @@ #include #include #include +#include +#include #include +#include #include #include #include @@ -31,11 +35,12 @@ static constexpr const int32_t WH = 381; static constexpr const int32_t WW = 106; static constexpr const uint16_t ARROW_PULSE_DURATION = 200; -static uint8_t _footpathSelectedType; static uint8_t _footpathConstructDirection; static uint8_t _footpathConstructValidDirections; static uint8_t _footpathConstructionMode; +static std::vector> _dropdownEntries; + // clang-format off enum { @@ -178,7 +183,7 @@ static void window_footpath_start_bridge_at_point(const ScreenCoordsXY& screenCo static void window_footpath_construct(); static void window_footpath_remove(); static void window_footpath_set_enabled_and_pressed_widgets(); -static void footpath_get_next_path_info(int32_t* type, CoordsXYZ& footpathLoc, int32_t* slope); +static void footpath_get_next_path_info(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope); static bool footpath_select_default(); /** @@ -187,21 +192,10 @@ static bool footpath_select_default(); */ rct_window* window_footpath_open() { - // If a restricted path was selected when the game is no longer in Sandbox mode, reset it - const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); - if (legacyPathEntry != nullptr && legacyPathEntry->GetPathSurfaceDescriptor().IsEditorOnly() && !gCheatsSandboxMode) + if (!footpath_select_default()) { - legacyPathEntry = nullptr; - } - - // Select the default path if we don't have one - if (legacyPathEntry == nullptr) - { - if (!footpath_select_default()) - { - // No path objects to select from, don't open window - return nullptr; - } + // No path objects to select from, don't open window + return nullptr; } // Check if window is already open @@ -211,7 +205,7 @@ rct_window* window_footpath_open() return window; } - window = WindowCreate(ScreenCoordsXY(0, 29), 106, 381, &window_footpath_events, WC_FOOTPATH, 0); + window = WindowCreate(ScreenCoordsXY(0, 29), WW, WH, &window_footpath_events, WC_FOOTPATH, 0); window->widgets = window_footpath_widgets; window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_FOOTPATH_TYPE) | (1ULL << WIDX_QUEUELINE_TYPE) | (1ULL << WIDX_DIRECTION_NW) | (1ULL << WIDX_DIRECTION_NE) | (1ULL << WIDX_DIRECTION_SW) | (1ULL << WIDX_DIRECTION_SE) @@ -344,53 +338,41 @@ static void window_footpath_mousedown(rct_window* w, rct_widgetindex widgetIndex */ static void window_footpath_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) { + if (dropdownIndex < 0 || static_cast(dropdownIndex) >= _dropdownEntries.size()) + return; + + auto entryIndex = _dropdownEntries[dropdownIndex]; if (widgetIndex == WIDX_FOOTPATH_TYPE) { - _footpathSelectedType = SELECTED_PATH_TYPE_NORMAL; + 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) { - _footpathSelectedType = SELECTED_PATH_TYPE_QUEUE; + gFootpathSelection.IsQueueSelected = true; + if (entryIndex.first == ObjectType::Paths) + { + gFootpathSelection.LegacyPath = entryIndex.second; + } + else + { + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + gFootpathSelection.QueueSurface = entryIndex.second; + } } else { return; } - // Get path id - int32_t pathId = dropdownIndex; - if (pathId == -1) - { - pathId = gFootpathSelectedId; - } - else - { - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); - - int32_t i = 0, j = 0; - for (; i < MAX_PATH_OBJECTS; i++) - { - const auto* legacyPathEntry = GetLegacyFootpathEntry(i); - if (legacyPathEntry == nullptr) - continue; - - const PathSurfaceDescriptor& surfaceDescriptor = legacyPathEntry->GetPathSurfaceDescriptor(); - if (surfaceDescriptor.IsEditorOnly() && !showEditorPaths) - { - continue; - } - - if (j == pathId) - { - break; - } - j++; - } - pathId = i; - } - - // Set selected path id - gFootpathSelectedId = pathId; footpath_provisional_update(); _window_footpath_cost = MONEY32_UNDEFINED; w->Invalidate(); @@ -458,7 +440,7 @@ static void window_footpath_toolup(rct_window* w, rct_widgetindex widgetIndex, c */ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* w) { - int32_t type, slope; + int32_t slope; if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) { @@ -475,9 +457,21 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* // Update provisional bridge mode path if (!(gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)) { + ObjectEntryIndex type; + ObjectEntryIndex railings = gFootpathSelection.Railings; + CoordsXYZ footpathLoc; footpath_get_next_path_info(&type, footpathLoc, &slope); - _window_footpath_cost = footpath_provisional_set(type, footpathLoc, slope); + PathConstructFlags pathConstructFlags = 0; + if (gFootpathSelection.IsQueueSelected) + pathConstructFlags |= PathConstructFlag::IsQueue; + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; + type = gFootpathSelection.LegacyPath; + } + + _window_footpath_cost = footpath_provisional_set(type, railings, footpathLoc, slope, pathConstructFlags); widget_invalidate(w, WIDX_CONSTRUCT); } @@ -490,7 +484,7 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; CoordsXYZ footpathLoc; - footpath_get_next_path_info(&type, footpathLoc, &slope); + footpath_get_next_path_info(nullptr, footpathLoc, &slope); gMapSelectArrowPosition = footpathLoc; gMapSelectArrowDirection = _footpathConstructDirection; if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) @@ -564,25 +558,52 @@ static void window_footpath_invalidate(rct_window* w) // Press / unpress footpath and queue type buttons w->pressed_widgets &= ~(1ULL << WIDX_FOOTPATH_TYPE); w->pressed_widgets &= ~(1ULL << WIDX_QUEUELINE_TYPE); - w->pressed_widgets |= _footpathSelectedType == SELECTED_PATH_TYPE_NORMAL ? (1ULL << WIDX_FOOTPATH_TYPE) - : (1ULL << WIDX_QUEUELINE_TYPE); + w->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; - // Set footpath and queue type button images - auto pathImage = static_cast(SPR_NONE); - auto queueImage = static_cast(SPR_NONE); - const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); - if (legacyPathEntry != nullptr) + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) { - pathImage = legacyPathEntry->GetPathSurfaceDescriptor().PreviewImage; - queueImage = legacyPathEntry->GetQueueSurfaceDescriptor().PreviewImage; + // 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; + } + + window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; + window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage; + } + 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(); + } + + window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; + window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage; } - window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; - window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = queueImage; } /** @@ -607,22 +628,42 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) { slope = TILE_ELEMENT_SLOPE_E_CORNER_UP; } - int32_t image = ConstructionPreviewImages[slope][direction]; - const auto* legacyPathEntry = GetLegacyFootpathEntry(gFootpathSelectedId); - if (legacyPathEntry != nullptr) + std::optional baseImage; + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) { - if (_footpathSelectedType == SELECTED_PATH_TYPE_NORMAL) - image += legacyPathEntry->GetPathSurfaceDescriptor().Image; - else - image += legacyPathEntry->GetQueueSurfaceDescriptor().Image; + 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; + } } - // Draw construction image - screenCoords = w->windowPos - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), - window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 }; - gfx_draw_sprite(dpi, ImageId(image), screenCoords); + if (baseImage) + { + auto image = *baseImage + ConstructionPreviewImages[slope][direction]; + + // Draw construction image + screenCoords = w->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 }; + gfx_draw_sprite(dpi, ImageId(image), screenCoords); + } // Draw build this... label screenCoords = w->windowPos @@ -651,30 +692,63 @@ static void window_footpath_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_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) || gCheatsSandboxMode); - for (int32_t i = 0; i < MAX_PATH_OBJECTS; i++) + _dropdownEntries.clear(); + std::optional defaultIndex; + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) { - const auto* legacyPathEntry = GetLegacyFootpathEntry(i); - if (legacyPathEntry == nullptr) + const auto* pathType = static_cast(objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); + if (pathType == nullptr) { continue; } - - const auto& surfaceDescriptor = (showQueues) ? legacyPathEntry->GetQueueSurfaceDescriptor() - : legacyPathEntry->GetPathSurfaceDescriptor(); - - if (surfaceDescriptor.IsEditorOnly() && !showEditorPaths) + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) { continue; } - - const auto image = surfaceDescriptor.PreviewImage; + if (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; + } gDropdownItemsFormat[numPathTypes] = STR_NONE; - gDropdownItemsArgs[numPathTypes] = image; + gDropdownItemsArgs[numPathTypes] = 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; + } + + gDropdownItemsFormat[numPathTypes] = STR_NONE; + gDropdownItemsArgs[numPathTypes] = showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage(); + _dropdownEntries.push_back({ ObjectType::Paths, i }); numPathTypes++; } @@ -682,6 +756,8 @@ static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget WindowDropdownShowImage( w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() + 1, w->colours[1], 0, numPathTypes, 47, 36, itemsPerRow); + if (defaultIndex) + gDropdownDefaultIndex = static_cast(*defaultIndex); } /** @@ -777,9 +853,20 @@ static void window_footpath_set_provisional_path_at_point(const ScreenCoordsXY& slope &= ~RAISE_FOOTPATH_FLAG; z += PATH_HEIGHT_STEP; } - int32_t pathType = (_footpathSelectedType << 7) + (gFootpathSelectedId & 0xFF); - _window_footpath_cost = footpath_provisional_set(pathType, { info.Loc, z }, slope); + PathConstructFlags constructFlags = 0; + auto pathType = gFootpathSelection.GetSelectedSurface(); + if (gFootpathSelection.IsQueueSelected) + { + constructFlags |= PathConstructFlag::IsQueue; + } + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + constructFlags |= PathConstructFlag::IsLegacyPathObject; + pathType = gFootpathSelection.LegacyPath; + } + _window_footpath_cost = footpath_provisional_set( + pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); window_invalidate_by_class(WC_FOOTPATH); } } @@ -872,11 +959,22 @@ static void window_footpath_place_path_at_point(const ScreenCoordsXY& screenCoor slope &= ~RAISE_FOOTPATH_FLAG; z += PATH_HEIGHT_STEP; } - auto selectedType = (_footpathSelectedType << 7) + (gFootpathSelectedId & 0xFF); // Try and place path gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; - auto footpathPlaceAction = FootpathPlaceAction({ info.Loc, z }, slope, selectedType); + auto selectedType = gFootpathSelection.GetSelectedSurface(); + PathConstructFlags constructFlags = 0; + if (gFootpathSelection.IsQueueSelected) + { + constructFlags |= PathConstructFlag::IsQueue; + } + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + constructFlags |= PathConstructFlag::IsLegacyPathObject; + selectedType = gFootpathSelection.LegacyPath; + } + auto footpathPlaceAction = FootpathPlaceAction( + { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); footpathPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { @@ -960,12 +1058,22 @@ static void window_footpath_construct() _window_footpath_cost = MONEY32_UNDEFINED; footpath_provisional_update(); - int32_t type, slope; + ObjectEntryIndex type; + int32_t slope; CoordsXYZ footpathLoc; footpath_get_next_path_info(&type, footpathLoc, &slope); gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; - auto footpathPlaceAction = FootpathPlaceAction(footpathLoc, slope, type, _footpathConstructDirection); + PathConstructFlags constructFlags = 0; + if (gFootpathSelection.IsQueueSelected) + constructFlags |= PathConstructFlag::IsQueue; + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + constructFlags |= PathConstructFlag::IsLegacyPathObject; + type = gFootpathSelection.LegacyPath; + } + auto footpathPlaceAction = FootpathPlaceAction( + footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { @@ -1201,15 +1309,16 @@ static void window_footpath_set_enabled_and_pressed_widgets() * * rct2: 0x006A7B20 */ -static void footpath_get_next_path_info(int32_t* type, CoordsXYZ& footpathLoc, int32_t* slope) +static void footpath_get_next_path_info(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) { - int32_t direction; - - direction = _footpathConstructDirection; + auto direction = _footpathConstructDirection; footpathLoc.x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; footpathLoc.y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y; footpathLoc.z = gFootpathConstructFromPosition.z; - *type = (_footpathSelectedType << 7) + (gFootpathSelectedId & 0xFF); + if (type != nullptr) + { + *type = gFootpathSelection.GetSelectedSurface(); + } *slope = TILE_ELEMENT_SLOPE_FLAT; if (gFootpathConstructSlope != 0) { @@ -1222,34 +1331,141 @@ static void footpath_get_next_path_info(int32_t* type, CoordsXYZ& footpathLoc, i } } -static bool footpath_select_default() +static ObjectEntryIndex footpath_get_default_surface(bool queue) { - // Select first available footpath - int32_t footpathId = -1; - for (int32_t i = 0; i < object_entry_group_counts[EnumValue(ObjectType::Paths)]; i++) + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) { - const auto* footpathObject = GetLegacyFootpathEntry(i); - if (footpathObject == nullptr) - continue; - - footpathId = i; - - const PathSurfaceDescriptor& surfaceDescriptor = footpathObject->GetPathSurfaceDescriptor(); - // Prioritise non-restricted path - if (!surfaceDescriptor.IsEditorOnly()) + auto pathEntry = GetPathSurfaceEntry(i); + if (pathEntry != nullptr) { - break; + if (!showEditorPaths && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + { + continue; + } + if (queue == ((pathEntry->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + return i; + } } } - if (footpathId == -1) + return OBJECT_ENTRY_INDEX_NULL; +} + +static ObjectEntryIndex footpath_get_default_railing() +{ + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) { - return false; + const auto* railingEntry = GetPathRailingsEntry(i); + if (railingEntry != nullptr) + { + return i; + } } - else + return OBJECT_ENTRY_INDEX_NULL; +} + +static bool footpath_is_surface_okay(ObjectEntryIndex index, bool queue) +{ + auto pathEntry = GetPathSurfaceEntry(index); + if (pathEntry != nullptr) { - gFootpathSelectedId = footpathId; - return true; + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + if (!showEditorPaths && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) + { + return false; + } + if (queue == ((pathEntry->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + return true; + } } + return false; +} + +static bool footpath_is_legacy_path_okay(ObjectEntryIndex index) +{ + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto footpathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, index)); + if (footpathObj != nullptr) + { + auto pathEntry = reinterpret_cast(footpathObj->GetLegacyData()); + return showEditorPaths || !(pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR); + } + return false; +} + +static ObjectEntryIndex footpath_get_default_legacy_path() +{ + for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) + { + if (footpath_is_legacy_path_okay(i)) + { + return i; + } + } + return OBJECT_ENTRY_INDEX_NULL; +} + +static bool footpath_select_default() +{ + // Select default footpath + auto surfaceIndex = footpath_get_default_surface(false); + if (footpath_is_surface_okay(gFootpathSelection.NormalSurface, false)) + { + surfaceIndex = gFootpathSelection.NormalSurface; + } + + // Select default queue + auto queueIndex = footpath_get_default_surface(true); + if (footpath_is_surface_okay(gFootpathSelection.QueueSurface, true)) + { + queueIndex = gFootpathSelection.QueueSurface; + } + + // Select default railing + auto railingIndex = footpath_get_default_railing(); + const auto* railingEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + if (railingEntry != nullptr) + { + railingIndex = gFootpathSelection.Railings; + } + + // Select default legacy path + auto legacyPathIndex = footpath_get_default_legacy_path(); + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + if (footpath_is_legacy_path_okay(gFootpathSelection.LegacyPath)) + { + // Keep legacy path selected + legacyPathIndex = gFootpathSelection.LegacyPath; + } + else + { + // Reset legacy path, we default to a surface (if there are any) + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + } + } + + if (surfaceIndex == OBJECT_ENTRY_INDEX_NULL) + { + if (legacyPathIndex == OBJECT_ENTRY_INDEX_NULL) + { + // No surfaces or legacy paths available + return false; + } + else + { + // No surfaces available, so default to legacy path + gFootpathSelection.LegacyPath = legacyPathIndex; + } + } + + gFootpathSelection.NormalSurface = surfaceIndex; + gFootpathSelection.QueueSurface = queueIndex; + gFootpathSelection.Railings = railingIndex; + return true; } void window_footpath_keyboard_shortcut_turn_left() @@ -1349,5 +1565,5 @@ void window_footpath_keyboard_shortcut_build_current() void window_footpath_reset_selected_path() { - _footpathSelectedType = 0; + gFootpathSelection = {}; } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 575710c2ea..dbc2dfe747 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index b294f1ee2a..de6bda9fa8 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -25,11 +25,15 @@ using namespace OpenRCT2; -FootpathPlaceAction::FootpathPlaceAction(const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, Direction direction) +FootpathPlaceAction::FootpathPlaceAction( + const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, Direction direction, + PathConstructFlags constructFlags) : _loc(loc) , _slope(slope) , _type(type) + , _railingsType(railingsType) , _direction(direction) + , _constructFlags(constructFlags) { } @@ -37,8 +41,10 @@ void FootpathPlaceAction::AcceptParameters(GameActionParameterVisitor& visitor) { visitor.Visit(_loc); visitor.Visit("object", _type); + visitor.Visit("railingsObject", _railingsType); visitor.Visit("direction", _direction); visitor.Visit("slope", _slope); + visitor.Visit("constructFlags", _constructFlags); } uint16_t FootpathPlaceAction::GetActionFlags() const @@ -50,7 +56,8 @@ void FootpathPlaceAction::Serialise(DataSerialiser& stream) { GameAction::Serialise(stream); - stream << DS_TAG(_loc) << DS_TAG(_slope) << DS_TAG(_type) << DS_TAG(_direction); + stream << DS_TAG(_loc) << DS_TAG(_slope) << DS_TAG(_type) << DS_TAG(_railingsType) << DS_TAG(_direction) + << DS_TAG(_constructFlags); } GameActions::Result::Ptr FootpathPlaceAction::Query() const @@ -149,11 +156,64 @@ GameActions::Result::Ptr FootpathPlaceAction::Execute() const } } +bool FootpathPlaceAction::IsSameAsPathElement(const PathElement* pathElement) const +{ + // Check if both this action and the element is queue + if (pathElement->IsQueue() != ((_constructFlags & PathConstructFlag::IsQueue) != 0)) + return false; + + auto footpathObj = pathElement->GetLegacyPathEntry(); + if (footpathObj == nullptr) + { + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + else + { + return pathElement->GetSurfaceEntryIndex() == _type && pathElement->GetRailingsEntryIndex() == _railingsType; + } + } + else + { + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return pathElement->GetLegacyPathEntryIndex() == _type; + } + else + { + return false; + } + } +} + +bool FootpathPlaceAction::IsSameAsEntranceElement(const EntranceElement& entranceElement) const +{ + if (entranceElement.HasLegacyPathEntry()) + { + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return entranceElement.GetLegacyPathEntryIndex() == _type; + } + else + { + return false; + } + } + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + else + { + return entranceElement.GetSurfaceEntryIndex() == _type; + } +} + GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateQuery(PathElement* pathElement, GameActions::Result::Ptr res) const { - const int32_t newFootpathType = (_type & (FOOTPATH_PROPERTIES_TYPE_MASK >> 4)); - const bool newPathIsQueue = ((_type >> 7) == 1); - if (pathElement->GetLegacyPathEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (!IsSameAsPathElement(pathElement)) { res->Cost += MONEY(6, 00); } @@ -167,9 +227,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateQuery(PathElement* pa GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateExecute(PathElement* pathElement, GameActions::Result::Ptr res) const { - const int32_t newFootpathType = (_type & (FOOTPATH_PROPERTIES_TYPE_MASK >> 4)); - const bool newPathIsQueue = ((_type >> 7) == 1); - if (pathElement->GetLegacyPathEntryIndex() != newFootpathType || pathElement->IsQueue() != newPathIsQueue) + if (!IsSameAsPathElement(pathElement)) { res->Cost += MONEY(6, 00); } @@ -181,14 +239,22 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateExecute(PathElement* footpath_remove_edges_at(_loc, reinterpret_cast(pathElement)); } - pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); - bool isQueue = _type & FOOTPATH_ELEMENT_INSERT_QUEUE; - pathElement->SetIsQueue(isQueue); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + pathElement->SetLegacyPathEntryIndex(_type); + } + else + { + pathElement->SetSurfaceEntryIndex(_type); + pathElement->SetRailingsEntryIndex(_railingsType); + } + + pathElement->SetIsQueue((_constructFlags & PathConstructFlag::IsQueue) != 0); auto* elem = pathElement->GetAdditionEntry(); if (elem != nullptr) { - if (isQueue) + if (_constructFlags & PathConstructFlag::IsQueue) { // remove any addition that isn't a TV or a lamp if ((elem->flags & PATH_BIT_FLAG_IS_QUEUE_SCREEN) == 0 && (elem->flags & PATH_BIT_FLAG_LAMP) == 0) @@ -238,16 +304,16 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) + if (IsSameAsEntranceElement(*entranceElement)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); } - // Do not attempt to build a crossing with a queue or a sloped. - uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT) - ? CREATE_CROSSING_MODE_NONE - : CREATE_CROSSING_MODE_PATH_OVER_TRACK; + // Do not attempt to build a crossing with a queue or a sloped path. + auto isQueue = _constructFlags & PathConstructFlag::IsQueue; + uint8_t crossingMode = isQueue || (_slope != TILE_ELEMENT_SLOPE_FLAT) ? CREATE_CROSSING_MODE_NONE + : CREATE_CROSSING_MODE_PATH_OVER_TRACK; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GetFlags(), crossingMode); if (!entrancePath && canBuild->Error != GameActions::Status::Ok) @@ -304,16 +370,16 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) + if (IsSameAsEntranceElement(*entranceElement)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); } // Do not attempt to build a crossing with a queue or a sloped. - uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT) - ? CREATE_CROSSING_MODE_NONE - : CREATE_CROSSING_MODE_PATH_OVER_TRACK; + auto isQueue = _constructFlags & PathConstructFlag::IsQueue; + uint8_t crossingMode = isQueue || (_slope != TILE_ELEMENT_SLOPE_FLAT) ? CREATE_CROSSING_MODE_NONE + : CREATE_CROSSING_MODE_PATH_OVER_TRACK; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(), crossingMode); @@ -338,8 +404,14 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: { if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !entranceIsSamePath) { - // Set the path type but make sure it's not a queue as that will not show up - entranceElement->SetLegacyPathEntryIndex(_type & 0x7F); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + entranceElement->SetLegacyPathEntryIndex(_type); + } + else + { + entranceElement->SetSurfaceEntryIndex(_type); + } map_invalidate_tile_full(_loc); } } @@ -349,10 +421,18 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + pathElement->SetLegacyPathEntryIndex(_type); + } + else + { + pathElement->SetSurfaceEntryIndex(_type); + pathElement->SetRailingsEntryIndex(_railingsType); + } pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); - pathElement->SetIsQueue(_type & FOOTPATH_ELEMENT_INSERT_QUEUE); + pathElement->SetIsQueue(isQueue); pathElement->SetAddition(0); pathElement->SetRideIndex(RIDE_ID_NULL); pathElement->SetAdditionStatus(255); diff --git a/src/openrct2/actions/FootpathPlaceAction.h b/src/openrct2/actions/FootpathPlaceAction.h index f8b4ff83ce..94df946e20 100644 --- a/src/openrct2/actions/FootpathPlaceAction.h +++ b/src/openrct2/actions/FootpathPlaceAction.h @@ -18,12 +18,15 @@ private: CoordsXYZ _loc; uint8_t _slope{}; ObjectEntryIndex _type{}; + ObjectEntryIndex _railingsType{}; Direction _direction{ INVALID_DIRECTION }; + PathConstructFlags _constructFlags{}; public: FootpathPlaceAction() = default; - FootpathPlaceAction(const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, Direction direction = INVALID_DIRECTION); - + FootpathPlaceAction( + const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, + Direction direction = INVALID_DIRECTION, PathConstructFlags constructFlags = 0); void AcceptParameters(GameActionParameterVisitor & visitor) override; uint16_t GetActionFlags() const override; @@ -40,4 +43,6 @@ private: void AutomaticallySetPeepSpawn() const; void RemoveIntersectingWalls(PathElement * pathElement) const; PathElement* map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope) const; + bool IsSameAsPathElement(const PathElement* pathElement) const; + bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const; }; diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index 0c73ba201d..3a9e192aa6 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -22,11 +22,14 @@ #include "../world/Wall.h" FootpathPlaceFromTrackAction::FootpathPlaceFromTrackAction( - const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, uint8_t edges) + const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, + PathConstructFlags constructFlags) : _loc(loc) , _slope(slope) , _type(type) + , _railingsType(railingsType) , _edges(edges) + , _constructFlags(constructFlags) { } @@ -34,7 +37,8 @@ void FootpathPlaceFromTrackAction::Serialise(DataSerialiser& stream) { GameAction::Serialise(stream); - stream << DS_TAG(_loc) << DS_TAG(_slope) << DS_TAG(_type) << DS_TAG(_edges); + stream << DS_TAG(_loc) << DS_TAG(_slope) << DS_TAG(_type) << DS_TAG(_railingsType) << DS_TAG(_edges) + << DS_TAG(_constructFlags); } uint16_t FootpathPlaceFromTrackAction::GetActionFlags() const @@ -122,16 +126,16 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) + if (IsSameAsEntranceElement(*entranceElement)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); } - // Do not attempt to build a crossing with a queue or a sloped. - uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT) - ? CREATE_CROSSING_MODE_NONE - : CREATE_CROSSING_MODE_PATH_OVER_TRACK; + // Do not attempt to build a crossing with a queue or a sloped path. + auto isQueue = _constructFlags & PathConstructFlag::IsQueue; + uint8_t crossingMode = isQueue || (_slope != TILE_ELEMENT_SLOPE_FLAT) ? CREATE_CROSSING_MODE_NONE + : CREATE_CROSSING_MODE_PATH_OVER_TRACK; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GetFlags(), crossingMode); if (!entrancePath && canBuild->Error != GameActions::Status::Ok) @@ -189,16 +193,16 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game { entrancePath = true; // Make the price the same as replacing a path - if (entranceElement->GetLegacyPathEntryIndex() == (_type & 0xF)) + if (IsSameAsEntranceElement(*entranceElement)) entranceIsSamePath = true; else res->Cost -= MONEY(6, 00); } - // Do not attempt to build a crossing with a queue or a sloped. - uint8_t crossingMode = (_type & FOOTPATH_ELEMENT_INSERT_QUEUE) || (_slope != TILE_ELEMENT_SLOPE_FLAT) - ? CREATE_CROSSING_MODE_NONE - : CREATE_CROSSING_MODE_PATH_OVER_TRACK; + // Do not attempt to build a crossing with a queue or a sloped path. + auto isQueue = _constructFlags & PathConstructFlag::IsQueue; + uint8_t crossingMode = isQueue || (_slope != TILE_ELEMENT_SLOPE_FLAT) ? CREATE_CROSSING_MODE_NONE + : CREATE_CROSSING_MODE_PATH_OVER_TRACK; auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_non_scenery_clear_func, quarterTile, GAME_COMMAND_FLAG_APPLY | GetFlags(), crossingMode); @@ -222,8 +226,14 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game { if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !entranceIsSamePath) { - // Set the path type but make sure it's not a queue as that will not show up - entranceElement->SetLegacyPathEntryIndex(_type & 0x7F); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + entranceElement->SetLegacyPathEntryIndex(_type); + } + else + { + entranceElement->SetSurfaceEntryIndex(_type); + } map_invalidate_tile_full(_loc); } } @@ -233,10 +243,18 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game Guard::Assert(pathElement != nullptr); pathElement->SetClearanceZ(zHigh); - pathElement->SetLegacyPathEntryIndex(_type & ~FOOTPATH_ELEMENT_INSERT_QUEUE); + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + pathElement->SetLegacyPathEntryIndex(_type); + } + else + { + pathElement->SetSurfaceEntryIndex(_type); + pathElement->SetRailingsEntryIndex(_railingsType); + } pathElement->SetSlopeDirection(_slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK); pathElement->SetSloped(_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED); - pathElement->SetIsQueue(_type & FOOTPATH_ELEMENT_INSERT_QUEUE); + pathElement->SetIsQueue(isQueue); pathElement->SetAddition(0); pathElement->SetRideIndex(RIDE_ID_NULL); pathElement->SetAdditionStatus(255); @@ -254,3 +272,27 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game return res; } + +bool FootpathPlaceFromTrackAction::IsSameAsEntranceElement(const EntranceElement& entranceElement) const +{ + if (entranceElement.HasLegacyPathEntry()) + { + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return entranceElement.GetLegacyPathEntryIndex() == _type; + } + else + { + return false; + } + } + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) + { + return false; + } + else + { + return entranceElement.GetSurfaceEntryIndex() == _type; + } +} diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.h b/src/openrct2/actions/FootpathPlaceFromTrackAction.h index 33016bc45f..0eb0726dd7 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.h +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.h @@ -17,11 +17,15 @@ private: CoordsXYZ _loc; uint8_t _slope{}; ObjectEntryIndex _type{}; + ObjectEntryIndex _railingsType{}; uint8_t _edges{}; + PathConstructFlags _constructFlags{}; public: FootpathPlaceFromTrackAction() = default; - FootpathPlaceFromTrackAction(const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, uint8_t edges); + FootpathPlaceFromTrackAction( + const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, + PathConstructFlags constructFlags = 0); uint16_t GetActionFlags() const override; @@ -32,4 +36,5 @@ public: private: GameActions::Result::Ptr ElementInsertQuery(GameActions::Result::Ptr res) const; GameActions::Result::Ptr ElementInsertExecute(GameActions::Result::Ptr res) const; + bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const; }; diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 72c9d102b8..5ef8207e34 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -146,7 +146,14 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Execute() const entranceElement->SetDirection(_loc.direction); entranceElement->SetSequenceIndex(index); entranceElement->SetEntranceType(ENTRANCE_TYPE_PARK_ENTRANCE); - entranceElement->SetLegacyPathEntryIndex(_pathType); + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + entranceElement->SetSurfaceEntryIndex(gFootpathSelection.NormalSurface); + } + else + { + entranceElement->SetLegacyPathEntryIndex(gFootpathSelection.LegacyPath); + } if (!entranceElement->IsGhost()) { diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index 70b742339f..b1045726f1 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -31,6 +31,7 @@ void FootpathRailingsObject::Load() _descriptor.Flags = Flags; _descriptor.ScrollingMode = ScrollingMode; _descriptor.SupportType = SupportType; + _descriptor.SupportColour = Colour; _descriptor.RailingsImage = RailingsImageId; } diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 974b73f786..0117d4b2ad 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -20,6 +20,7 @@ #include struct TileElement; +enum class RailingEntrySupportType : uint8_t; enum class ViewportInteractionItem : uint8_t; struct attached_paint_struct @@ -251,6 +252,18 @@ struct paint_session : public PaintSessionCore } }; +struct FootpathPaintInfo +{ + uint32_t SurfaceImageId{}; + uint32_t BridgeImageId{}; + uint32_t RailingsImageId{}; + uint32_t SurfaceFlags{}; + uint32_t RailingFlags{}; + uint8_t ScrollingMode{}; + RailingEntrySupportType SupportType{}; + colour_t SupportColour = 255; +}; + struct RecordedPaintSession { PaintSessionCore Session; diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index ed60fe98ef..c60a18ad63 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -10,6 +10,7 @@ #include "Supports.h" #include "../interface/Viewport.h" +#include "../object/FootpathRailingsObject.h" #include "../sprites.h" #include "../world/Surface.h" #include "Paint.h" @@ -1168,7 +1169,7 @@ bool metal_b_supports_paint_setup( */ bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - const PathRailingsDescriptor* railingsDescriptor, bool* underground) + const FootpathPaintInfo& pathPaintInfo, bool* underground) { if (underground != nullptr) { @@ -1202,7 +1203,7 @@ bool path_a_supports_paint_setup( { // save dx2 PaintAddImageAsParent( - session, (railingsDescriptor->BridgeImage + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); + session, (pathPaintInfo.BridgeImageId + 48) | imageColourFlags, { 0, 0, baseHeight - 2 }, { 32, 32, 0 }); hasSupports = true; } else if (session->Support.slope & 0x10) @@ -1216,7 +1217,7 @@ bool path_a_supports_paint_setup( } uint32_t imageId = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingsDescriptor->BridgeImage; + + pathPaintInfo.BridgeImageId; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1239,7 +1240,7 @@ bool path_a_supports_paint_setup( } uint32_t ebx = (supportType * 24) + word_97B3C4[session->Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] - + railingsDescriptor->BridgeImage; + + pathPaintInfo.BridgeImageId; PaintAddImageAsParent(session, ebx | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, 11 }, { 0, 0, baseHeight + 2 }); @@ -1251,7 +1252,7 @@ bool path_a_supports_paint_setup( { if (baseHeight & 0x10 || heightSteps == 1 || baseHeight + 16 == session->WaterHeight) { - uint32_t imageId = (supportType * 24) + railingsDescriptor->BridgeImage + 23; + uint32_t imageId = (supportType * 24) + pathPaintInfo.BridgeImageId + 23; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 1) ? 7 : 12) }); @@ -1261,7 +1262,7 @@ bool path_a_supports_paint_setup( } else { - uint32_t imageId = (supportType * 24) + railingsDescriptor->BridgeImage + 22; + uint32_t imageId = (supportType * 24) + pathPaintInfo.BridgeImageId + 22; PaintAddImageAsParent( session, imageId | imageColourFlags, { 0, 0, baseHeight }, { 32, 32, ((heightSteps == 2) ? 23 : 28) }); @@ -1275,7 +1276,7 @@ bool path_a_supports_paint_setup( { uint16_t specialIndex = (special - 1) & 0xFFFF; - uint32_t imageId = railingsDescriptor->BridgeImage + 55 + specialIndex; + uint32_t imageId = pathPaintInfo.BridgeImageId + 55 + specialIndex; const unk_supports_desc& supportsDesc = byte_98D8D4[specialIndex]; const unk_supports_desc_bound_box& boundBox = supportsDesc.bounding_box; @@ -1320,7 +1321,7 @@ bool path_a_supports_paint_setup( */ bool path_b_supports_paint_setup( paint_session* session, int32_t segment, int32_t special, int32_t height, uint32_t imageColourFlags, - const PathRailingsDescriptor* railingsDescriptor) + const FootpathPaintInfo& pathPaintInfo) { support_height* supportSegments = session->SupportSegments; @@ -1342,7 +1343,7 @@ bool path_b_supports_paint_setup( uint16_t baseHeight; if ((supportSegments[segment].slope & 0x20) || (height - supportSegments[segment].height < 6) - || !(railingsDescriptor->Flags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) + || !(pathPaintInfo.RailingFlags & RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE)) { baseHeight = supportSegments[segment].height; } @@ -1352,7 +1353,7 @@ bool path_b_supports_paint_setup( baseHeight = supportSegments[segment].height; PaintAddImageAsParent( - session, (railingsDescriptor->BridgeImage + 37 + imageOffset) | imageColourFlags, + session, (pathPaintInfo.BridgeImageId + 37 + imageOffset) | imageColourFlags, { SupportBoundBoxes[segment].x, SupportBoundBoxes[segment].y, baseHeight }, { 0, 0, 5 }); baseHeight += 6; } @@ -1371,7 +1372,7 @@ bool path_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, (railingsDescriptor->BridgeImage + 20 + (heightDiff - 1)) | imageColourFlags, + session, (pathPaintInfo.BridgeImageId + 20 + (heightDiff - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } @@ -1404,7 +1405,7 @@ bool path_b_supports_paint_setup( } PaintAddImageAsParent( - session, (railingsDescriptor->BridgeImage + 20 + (z - 1)) | imageColourFlags, + session, (pathPaintInfo.BridgeImageId + 20 + (z - 1)) | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, (z - 1) }); baseHeight += z; @@ -1415,7 +1416,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingsDescriptor->BridgeImage + 20 + (z - 1); + uint32_t imageId = pathPaintInfo.BridgeImageId + 20 + (z - 1); if (z == 16) { imageId += 1; @@ -1449,7 +1450,7 @@ bool path_b_supports_paint_setup( break; } - uint32_t imageId = railingsDescriptor->BridgeImage + 20 + (z - 1); + uint32_t imageId = pathPaintInfo.BridgeImageId + 20 + (z - 1); PaintAddImageAsParent( session, imageId | imageColourFlags, { SupportBoundBoxes[segment], baseHeight }, { 0, 0, 0 }, { SupportBoundBoxes[segment], baseHeight }); diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 3e8ff8fb57..95c52baca3 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -12,6 +12,8 @@ #include "../common.h" #include "../world/Footpath.h" +struct FootpathPaintInfo; + constexpr const uint8_t NumVanillaWoodenSupportTypes = 49; bool wooden_a_supports_paint_setup( @@ -24,10 +26,10 @@ bool metal_b_supports_paint_setup( paint_session* session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, uint32_t imageColourFlags); bool path_a_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - const PathRailingsDescriptor* railingsDescriptor, bool* underground); + const FootpathPaintInfo& pathPaintInfo, bool* underground); bool path_b_supports_paint_setup( paint_session* session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags, - const PathRailingsDescriptor* railingsDescriptor); + const FootpathPaintInfo& pathPaintInfo); // There are 13 types of metal supports. A graphic showing all of them is available here: // https://cloud.githubusercontent.com/assets/737603/19420485/7eaba28e-93ec-11e6-83cb-03190accc094.png diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 7b0ab9c16d..bd08305a1c 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -14,6 +14,8 @@ #include "../../drawing/LightFX.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" +#include "../../object/FootpathObject.h" +#include "../../object/FootpathSurfaceObject.h" #include "../../object/StationObject.h" #include "../../ride/RideData.h" #include "../../ride/TrackDesign.h" @@ -260,6 +262,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 switch (part_index) { case 0: + { if (surfaceDescriptor != nullptr) { image_id = (surfaceDescriptor->Image + 5 * (1 + (direction & 1))) | ghost_id; @@ -317,6 +320,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 PaintAddImageAsChild(session, stsetup, 0, 0, 0x1C, 0x1C, 0x2F, text_height, 2, 2, text_height); } break; + } case 1: case 2: entrance = static_cast(object_entry_get_chunk(ObjectType::ParkEntrance, 0)); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 33892bbe61..c11d0991e3 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -7,13 +7,18 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../Context.h" #include "../../Game.h" #include "../../config/Config.h" #include "../../core/Numerics.hpp" #include "../../drawing/LightFX.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" +#include "../../object/FootpathObject.h" +#include "../../object/FootpathRailingsObject.h" +#include "../../object/FootpathSurfaceObject.h" #include "../../object/ObjectList.h" +#include "../../object/ObjectManager.h" #include "../../peep/Peep.h" #include "../../peep/Staff.h" #include "../../ride/Track.h" @@ -87,11 +92,11 @@ static constexpr const uint8_t byte_98D8A4[] = { // clang-format on void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, const PathSurfaceDescriptor* footpathEntry, - const PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, + bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, const PathSurfaceDescriptor* surfaceDescriptor, - const PathRailingsDescriptor* railingsDescriptor, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); + paint_session* session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, + bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags); /* rct2: 0x006A5AE5 */ static void path_bit_lights_paint( @@ -327,9 +332,9 @@ static void path_bit_jumping_fountains_paint( */ static void sub_6A4101( paint_session* session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool hasSupports, - const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags) + const FootpathPaintInfo& pathPaintInfo, uint32_t imageFlags) { - uint32_t base_image_id = railingsDescriptor->RailingsImage | imageFlags; + uint32_t base_image_id = pathPaintInfo.RailingsImageId | imageFlags; if (pathElement.IsQueue()) { @@ -448,7 +453,7 @@ static void sub_6A4101( auto ride = get_ride(pathElement.GetRideIndex()); if (direction < 2 && ride != nullptr && imageFlags == 0) { - uint16_t scrollingMode = railingsDescriptor->ScrollingMode; + uint16_t scrollingMode = pathPaintInfo.ScrollingMode; scrollingMode += direction; auto ft = Formatter(); @@ -496,7 +501,8 @@ static void sub_6A4101( drawnCorners = (connectedEdges & FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK) >> 4; } - if (pathElement.IsSloped()) + auto slopeRailingsSupported = !(pathPaintInfo.SurfaceFlags & FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS); + if ((hasSupports || slopeRailingsSupported) && pathElement.IsSloped()) { switch ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) { @@ -670,7 +676,7 @@ static void sub_6A4101( */ static void sub_6A3F61( paint_session* session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, - const PathRailingsDescriptor* railingsDescriptor, uint32_t imageFlags, uint32_t sceneryImageFlags, bool hasSupports) + const FootpathPaintInfo& pathPaintInfo, uint32_t imageFlags, uint32_t sceneryImageFlags, bool hasSupports) { // eax -- // ebx -- @@ -750,7 +756,7 @@ static void sub_6A3F61( // Redundant zoom-level check removed if (paintScenery) - sub_6A4101(session, pathElement, height, connectedEdges, hasSupports, railingsDescriptor, imageFlags); + sub_6A4101(session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo, imageFlags); } // This is about tunnel drawing @@ -800,6 +806,31 @@ static void sub_6A3F61( } } +static FootpathPaintInfo GetFootpathPaintInfo(const PathElement& pathEl) +{ + FootpathPaintInfo pathPaintInfo; + + const auto* surfaceDescriptor = pathEl.GetSurfaceDescriptor(); + if (surfaceDescriptor != nullptr) + { + pathPaintInfo.SurfaceImageId = surfaceDescriptor->Image; + pathPaintInfo.SurfaceFlags = surfaceDescriptor->Flags; + } + + const auto* railingsDescriptor = pathEl.GetRailingsDescriptor(); + if (railingsDescriptor != nullptr) + { + pathPaintInfo.BridgeImageId = railingsDescriptor->BridgeImage; + pathPaintInfo.RailingsImageId = railingsDescriptor->RailingsImage; + pathPaintInfo.RailingFlags = railingsDescriptor->Flags; + pathPaintInfo.ScrollingMode = railingsDescriptor->ScrollingMode; + pathPaintInfo.SupportType = railingsDescriptor->SupportType; + pathPaintInfo.SupportColour = railingsDescriptor->SupportColour; + } + + return pathPaintInfo; +} + /** * rct2: 0x0006A3590 */ @@ -870,7 +901,11 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } else if (surface->GetBaseZ() != height) { - hasSupports = true; + const auto* surfaceEntry = tileElement.GetSurfaceEntry(); + const bool showUndergroundRailings = surfaceEntry == nullptr + || !(surfaceEntry->Flags & FOOTPATH_ENTRY_FLAG_NO_SLOPE_RAILINGS); + if (surface->GetBaseZ() < height || showUndergroundRailings) + hasSupports = true; } else { @@ -944,23 +979,14 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE PaintAddImageAsParent(session, imageId, { 16, 16, heightMarkerBaseZ }, { 1, 1, 0 }); } - const PathSurfaceDescriptor* surfaceDescriptor = tileElement.GetSurfaceDescriptor(); - const PathRailingsDescriptor* railingsDescriptor = tileElement.GetRailingsDescriptor(); - - if (surfaceDescriptor != nullptr && railingsDescriptor != nullptr) + auto pathPaintInfo = GetFootpathPaintInfo(tileElement); + if (pathPaintInfo.SupportType == RailingEntrySupportType::Pole) { - if (railingsDescriptor->SupportType == RailingEntrySupportType::Pole) - { - path_paint_pole_support( - session, tileElement, height, surfaceDescriptor, railingsDescriptor, hasSupports, imageFlags, - sceneryImageFlags); - } - else - { - path_paint_box_support( - session, tileElement, height, surfaceDescriptor, railingsDescriptor, hasSupports, imageFlags, - sceneryImageFlags); - } + path_paint_pole_support(session, tileElement, height, pathPaintInfo, hasSupports, imageFlags, sceneryImageFlags); + } + else + { + path_paint_box_support(session, tileElement, height, pathPaintInfo, hasSupports, imageFlags, sceneryImageFlags); } #ifdef __ENABLE_LIGHTFX__ @@ -996,8 +1022,8 @@ void PaintPath(paint_session* session, uint16_t height, const PathElement& tileE } void path_paint_box_support( - paint_session* session, const PathElement& pathElement, int32_t height, const PathSurfaceDescriptor* footpathEntry, - const PathRailingsDescriptor* railingEntry, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, + bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1011,19 +1037,17 @@ void path_paint_box_support( uint16_t edi = edges | (corners << 4); - uint32_t imageId; + uint32_t imageId = pathPaintInfo.SurfaceImageId; if (pathElement.IsSloped()) { - imageId = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + imageId += ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) + 16; } else { - imageId = byte_98D6E0[edi]; + imageId += byte_98D6E0[edi]; } - imageId += footpathEntry->Image; - if (!session->DidPassSurface) { boundBoxOffset.x = 3; @@ -1057,18 +1081,17 @@ void path_paint_box_support( if (pathElement.IsSloped()) { image_id = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingEntry->BridgeImage + 51; + + pathPaintInfo.BridgeImageId + 51; } else { - image_id = byte_98D8A4[edges] + railingEntry->BridgeImage + 49; + image_id = byte_98D8A4[edges] + pathPaintInfo.BridgeImageId + 49; } PaintAddImageAsParent( session, image_id | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, { boundBoxOffset, height + boundingBoxZOffset }); - // TODO: Revert this when path import works correctly. if (!pathElement.IsQueue() && !pathElement.ShouldDrawPathOverSupports()) { // don't draw @@ -1081,7 +1104,7 @@ void path_paint_box_support( } } - sub_6A3F61(session, pathElement, edi, height, railingEntry, imageFlags, sceneryImageFlags, hasSupports); + sub_6A3F61(session, pathElement, edi, height, pathPaintInfo, imageFlags, sceneryImageFlags, hasSupports); uint16_t ax = 0; if (pathElement.IsSloped()) @@ -1089,14 +1112,8 @@ void path_paint_box_support( ax = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 0x3) + 1; } - if (byte_98D8A4[edges] == 0) - { - path_a_supports_paint_setup(session, 0, ax, height, imageFlags, railingEntry, nullptr); - } - else - { - path_a_supports_paint_setup(session, 1, ax, height, imageFlags, railingEntry, nullptr); - } + auto supportType = byte_98D8A4[edges] == 0 ? 0 : 1; + path_a_supports_paint_setup(session, supportType, ax, height, imageFlags, pathPaintInfo, nullptr); height += 32; if (pathElement.IsSloped()) @@ -1142,8 +1159,8 @@ void path_paint_box_support( } void path_paint_pole_support( - paint_session* session, const PathElement& pathElement, int16_t height, const PathSurfaceDescriptor* surfaceDescriptor, - const PathRailingsDescriptor* railingsDescriptor, bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) + paint_session* session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, + bool hasSupports, uint32_t imageFlags, uint32_t sceneryImageFlags) { // Rol edges around rotation uint8_t edges = ((pathElement.GetEdges() << session->CurrentRotation) & 0xF) @@ -1158,18 +1175,16 @@ void path_paint_pole_support( uint16_t edi = edges | (corners << 4); - uint32_t imageId; + uint32_t imageId = pathPaintInfo.SurfaceImageId; if (pathElement.IsSloped()) { - imageId = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 3) + 16; + imageId += ((pathElement.GetSlopeDirection() + session->CurrentRotation) & 3) + 16; } else { - imageId = byte_98D6E0[edi]; + imageId += byte_98D6E0[edi]; } - imageId += surfaceDescriptor->Image; - // Below Surface if (!session->DidPassSurface) { @@ -1205,11 +1220,11 @@ void path_paint_pole_support( { bridgeImage = ((pathElement.GetSlopeDirection() + session->CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) - + railingsDescriptor->BridgeImage + 16; + + pathPaintInfo.BridgeImageId + 16; } else { - bridgeImage = edges + railingsDescriptor->BridgeImage; + bridgeImage = edges + pathPaintInfo.BridgeImageId; bridgeImage |= imageFlags; } @@ -1217,7 +1232,6 @@ void path_paint_pole_support( session, bridgeImage | imageFlags, { 0, 0, height }, { boundBoxSize, 0 }, { boundBoxOffset, height + boundingBoxZOffset }); - // TODO: Revert this when path import works correctly. if (pathElement.IsQueue() || pathElement.ShouldDrawPathOverSupports()) { PaintAddImageAsChild( @@ -1226,8 +1240,8 @@ void path_paint_pole_support( } } - sub_6A3F61( - session, pathElement, edi, height, railingsDescriptor, imageFlags, sceneryImageFlags, hasSupports); // TODO: arguments + sub_6A3F61(session, pathElement, edi, height, pathPaintInfo, imageFlags, sceneryImageFlags, + hasSupports); // TODO: arguments uint16_t ax = 0; if (pathElement.IsSloped()) @@ -1246,7 +1260,10 @@ void path_paint_pole_support( { if (!(edges & (1 << i))) { - path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags, railingsDescriptor); + const int32_t extraFlags = (pathPaintInfo.SupportColour != COLOUR_NULL && !pathElement.IsGhost()) + ? SPRITE_ID_PALETTE_COLOUR_1(pathPaintInfo.SupportColour) + : 0; + path_b_supports_paint_setup(session, supports[i], ax, height, imageFlags | extraFlags, pathPaintInfo); } } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 3cbc658e65..3e720a163f 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1161,11 +1161,7 @@ static std::optional TrackDesignPlaceSceneryElement( z = (scenery.z * COORDS_Z_STEP + originZ) / COORDS_Z_STEP; if (mode == 0) { - if (scenery.flags & (1 << 7)) - { - // dh - entry_index |= (1 << 7); - } + auto isQueue = scenery.IsQueue(); uint8_t bh = ((scenery.flags & 0xF) << rotation); flags = bh >> 4; @@ -1195,8 +1191,12 @@ static std::optional TrackDesignPlaceSceneryElement( } uint8_t slope = ((bh >> 5) & 0x3) | ((bh >> 2) & 0x4); uint8_t edges = bh & 0xF; + PathConstructFlags constructFlags = PathConstructFlag::IsLegacyPathObject; + if (isQueue) + constructFlags |= PathConstructFlag::IsQueue; auto footpathPlaceAction = FootpathPlaceFromTrackAction( - { mapCoord.x, mapCoord.y, z * COORDS_Z_STEP }, slope, entry_index, edges); + { mapCoord.x, mapCoord.y, z * COORDS_Z_STEP }, slope, entry_index, OBJECT_ENTRY_INDEX_NULL, edges, + constructFlags); footpathPlaceAction.SetFlags(flags); auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&footpathPlaceAction) : GameActions::QueryNested(&footpathPlaceAction); diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index e78fa32c68..4cf7615825 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -39,6 +39,11 @@ struct TrackDesignSceneryElement uint8_t flags; // 0x13 direction quadrant tertiary colour uint8_t primary_colour; // 0x14 uint8_t secondary_colour; // 0x15 + + bool IsQueue() const + { + return (flags & (1 << 7)) != 0; + } }; /** diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c691b7d521..c3c78decda 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -43,6 +43,7 @@ using namespace OpenRCT2::TrackMetaData; void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement); +FootpathSelection gFootpathSelection; ProvisionalFootpath gProvisionalFootpath; uint16_t gFootpathSelectedId; CoordsXYZ gFootpathConstructFromPosition; @@ -139,21 +140,25 @@ money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags) * * rct2: 0x006A76FF */ -money32 footpath_provisional_set(int32_t type, const CoordsXYZ& footpathLoc, int32_t slope) +money32 footpath_provisional_set( + ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope, + PathConstructFlags constructFlags) { money32 cost; footpath_provisional_remove(); - auto footpathPlaceAction = FootpathPlaceAction(footpathLoc, slope, type); + auto footpathPlaceAction = FootpathPlaceAction(footpathLoc, slope, type, railingsType, INVALID_DIRECTION, constructFlags); footpathPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); auto res = GameActions::Execute(&footpathPlaceAction); cost = res->Error == GameActions::Status::Ok ? res->Cost : MONEY32_UNDEFINED; if (res->Error == GameActions::Status::Ok) { - gProvisionalFootpath.Type = type; + gProvisionalFootpath.SurfaceIndex = type; + gProvisionalFootpath.RailingsIndex = railingsType; gProvisionalFootpath.Position = footpathLoc; gProvisionalFootpath.Slope = slope; + gProvisionalFootpath.ConstructFlags = constructFlags; gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_1; if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) @@ -1653,13 +1658,13 @@ ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const } const FootpathObject* PathElement::GetLegacyPathEntry() const -{ + { return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); -} + } void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) { - SurfaceIndex = newIndex & ~FOOTPATH_ELEMENT_INSERT_QUEUE; + SurfaceIndex = newIndex; RailingsIndex = OBJECT_ENTRY_INDEX_NULL; Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; } @@ -1761,6 +1766,7 @@ void PathElement::SetQueueBannerDirection(uint8_t direction) bool PathElement::ShouldDrawPathOverSupports() const { + // TODO: make this an actual decision of the tile element. return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); } @@ -2331,6 +2337,26 @@ const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex) return footpathObject; } +const FootpathSurfaceObject* GetPathSurfaceEntry(ObjectEntryIndex entryIndex) +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = objMgr.GetLoadedObject(ObjectType::FootpathSurface, entryIndex); + if (obj == nullptr) + return nullptr; + + return static_cast(obj); +} + +const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex) +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = objMgr.GetLoadedObject(ObjectType::FootpathRailings, entryIndex); + if (obj == nullptr) + return nullptr; + + return static_cast(obj); +} + ride_id_t PathElement::GetRideIndex() const { return rideIndex; diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 8072c7ab10..82c198df7a 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -13,6 +13,10 @@ #include "../interface/Viewport.h" #include "../object/Object.h" +class FootpathObject; +class FootpathSurfaceObject; +class FootpathRailingsObject; + enum { PROVISIONAL_PATH_FLAG_SHOW_ARROW = (1 << 0), @@ -25,8 +29,6 @@ constexpr auto FootpathMinHeight = 2 * COORDS_Z_STEP; constexpr auto PATH_HEIGHT_STEP = 2 * COORDS_Z_STEP; constexpr auto PATH_CLEARANCE = 4 * COORDS_Z_STEP; -#define FOOTPATH_ELEMENT_INSERT_QUEUE 0x80 - class FootpathObject; enum class RailingEntrySupportType : uint8_t @@ -99,16 +101,41 @@ struct PathRailingsDescriptor uint32_t BridgeImage; uint32_t RailingsImage; RailingEntrySupportType SupportType; + colour_t SupportColour; uint8_t Flags; uint8_t ScrollingMode; }; +using PathConstructFlags = uint8_t; +namespace PathConstructFlag +{ + constexpr PathConstructFlags IsQueue = 1 << 0; + constexpr PathConstructFlags IsLegacyPathObject = 1 << 1; +} // namespace PathConstructFlag + +struct FootpathSelection +{ + ObjectEntryIndex LegacyPath = OBJECT_ENTRY_INDEX_NULL; + ObjectEntryIndex NormalSurface = OBJECT_ENTRY_INDEX_NULL; + ObjectEntryIndex QueueSurface = OBJECT_ENTRY_INDEX_NULL; + ObjectEntryIndex Railings = OBJECT_ENTRY_INDEX_NULL; + bool IsQueueSelected{}; + + ObjectEntryIndex GetSelectedSurface() const + { + return IsQueueSelected ? QueueSurface : NormalSurface; + } +}; + struct ProvisionalFootpath { ObjectEntryIndex Type; CoordsXYZ Position; uint8_t Slope; uint8_t Flags; + ObjectEntryIndex SurfaceIndex; + ObjectEntryIndex RailingsIndex; + PathConstructFlags ConstructFlags; }; // Masks for values stored in TileElement.type @@ -192,6 +219,7 @@ enum FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY = (1 << 7) }; +extern FootpathSelection gFootpathSelection; extern ProvisionalFootpath gProvisionalFootpath; extern uint16_t gFootpathSelectedId; extern CoordsXYZ gFootpathConstructFromPosition; @@ -206,7 +234,9 @@ extern const CoordsXY BenchUseOffsets[NumOrthogonalDirections * 2]; TileElement* map_get_footpath_element(const CoordsXYZ& coords); void footpath_interrupt_peeps(const CoordsXYZ& footpathPos); money32 footpath_remove(const CoordsXYZ& footpathLoc, int32_t flags); -money32 footpath_provisional_set(int32_t type, const CoordsXYZ& footpathLoc, int32_t slope); +money32 footpath_provisional_set( + ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope, + PathConstructFlags constructFlags); void footpath_provisional_remove(); void footpath_provisional_update(); CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement); @@ -224,6 +254,8 @@ int32_t footpath_is_connected_to_map_edge(const CoordsXYZ& footpathPos, int32_t void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement); const FootpathObject* GetLegacyFootpathEntry(ObjectEntryIndex entryIndex); +const FootpathSurfaceObject* GetPathSurfaceEntry(ObjectEntryIndex entryIndex); +const FootpathRailingsObject* GetPathRailingsEntry(ObjectEntryIndex entryIndex); void footpath_queue_chain_reset(); void footpath_queue_chain_push(ride_id_t rideIndex); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 04e5f8e4aa..3a5b9f00a2 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1574,7 +1574,9 @@ void map_restore_provisional_elements() if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) { gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_1; - footpath_provisional_set(gProvisionalFootpath.Type, gProvisionalFootpath.Position, gProvisionalFootpath.Slope); + footpath_provisional_set( + gProvisionalFootpath.SurfaceIndex, gProvisionalFootpath.RailingsIndex, gProvisionalFootpath.Position, + gProvisionalFootpath.Slope, gProvisionalFootpath.ConstructFlags); } if (window_find_by_class(WC_RIDE_CONSTRUCTION) != nullptr) { diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 68f289c8ce..7df39ad9d3 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -293,6 +293,9 @@ public: const PathSurfaceDescriptor* GetSurfaceDescriptor() const; const PathRailingsDescriptor* GetRailingsDescriptor() const; + bool ShouldDrawPathOverSupports() const; + void SetShouldDrawPathOverSupports(bool on); + uint8_t GetQueueBannerDirection() const; void SetQueueBannerDirection(uint8_t direction); @@ -341,9 +344,6 @@ public: uint8_t GetAdditionStatus() const; void SetAdditionStatus(uint8_t newStatus); - bool ShouldDrawPathOverSupports() const; - void SetShouldDrawPathOverSupports(bool on); - bool IsLevelCrossing(const CoordsXY& coords) const; }; assert_struct_size(PathElement, 16); From 866c66bc58379db41f665cbdd7551cd45888303f Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 8 Sep 2021 22:21:49 +0200 Subject: [PATCH 381/681] Use title case, scope slope variable --- src/openrct2-ui/windows/EditorMain.cpp | 2 +- src/openrct2-ui/windows/Footpath.cpp | 38 +++++++++++++------------- src/openrct2-ui/windows/Main.cpp | 2 +- src/openrct2-ui/windows/Window.h | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index 2df57c7f7a..d38822ea9a 100644 --- a/src/openrct2-ui/windows/EditorMain.cpp +++ b/src/openrct2-ui/windows/EditorMain.cpp @@ -47,7 +47,7 @@ rct_window* window_editor_main_open() gShowGridLinesRefCount = 0; gShowLandRightsRefCount = 0; gShowConstuctionRightsRefCount = 0; - window_footpath_reset_selected_path(); + WindowFootpathResetSelectedPath(); context_open_window(WC_TOP_TOOLBAR); context_open_window_view(WV_EDITOR_BOTTOM_TOOLBAR); diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index e58c686ed8..6442ba7180 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -184,7 +184,7 @@ static void window_footpath_construct(); static void window_footpath_remove(); static void window_footpath_set_enabled_and_pressed_widgets(); static void footpath_get_next_path_info(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope); -static bool footpath_select_default(); +static bool FootpathSelectDefault(); /** * @@ -192,7 +192,7 @@ static bool footpath_select_default(); */ rct_window* window_footpath_open() { - if (!footpath_select_default()) + if (!FootpathSelectDefault()) { // No path objects to select from, don't open window return nullptr; @@ -440,8 +440,6 @@ static void window_footpath_toolup(rct_window* w, rct_widgetindex widgetIndex, c */ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* w) { - int32_t slope; - if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) { return; @@ -461,6 +459,7 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* ObjectEntryIndex railings = gFootpathSelection.Railings; CoordsXYZ footpathLoc; + int32_t slope; footpath_get_next_path_info(&type, footpathLoc, &slope); PathConstructFlags pathConstructFlags = 0; if (gFootpathSelection.IsQueueSelected) @@ -484,6 +483,7 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; CoordsXYZ footpathLoc; + int32_t slope; footpath_get_next_path_info(nullptr, footpathLoc, &slope); gMapSelectArrowPosition = footpathLoc; gMapSelectArrowDirection = _footpathConstructDirection; @@ -1331,7 +1331,7 @@ static void footpath_get_next_path_info(ObjectEntryIndex* type, CoordsXYZ& footp } } -static ObjectEntryIndex footpath_get_default_surface(bool queue) +static ObjectEntryIndex FootpathGetDefaultSurface(bool queue) { bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) @@ -1352,7 +1352,7 @@ static ObjectEntryIndex footpath_get_default_surface(bool queue) return OBJECT_ENTRY_INDEX_NULL; } -static ObjectEntryIndex footpath_get_default_railing() +static ObjectEntryIndex FootpathGetDefaultRailings() { for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) { @@ -1365,7 +1365,7 @@ static ObjectEntryIndex footpath_get_default_railing() return OBJECT_ENTRY_INDEX_NULL; } -static bool footpath_is_surface_okay(ObjectEntryIndex index, bool queue) +static bool FootpathIsSurfaceEntryOkay(ObjectEntryIndex index, bool queue) { auto pathEntry = GetPathSurfaceEntry(index); if (pathEntry != nullptr) @@ -1383,7 +1383,7 @@ static bool footpath_is_surface_okay(ObjectEntryIndex index, bool queue) return false; } -static bool footpath_is_legacy_path_okay(ObjectEntryIndex index) +static bool FootpathIsLegacyPathEntryOkay(ObjectEntryIndex index) { bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); @@ -1396,11 +1396,11 @@ static bool footpath_is_legacy_path_okay(ObjectEntryIndex index) return false; } -static ObjectEntryIndex footpath_get_default_legacy_path() +static ObjectEntryIndex FootpathGetDefaultLegacyPath() { for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) { - if (footpath_is_legacy_path_okay(i)) + if (FootpathIsLegacyPathEntryOkay(i)) { return i; } @@ -1408,24 +1408,24 @@ static ObjectEntryIndex footpath_get_default_legacy_path() return OBJECT_ENTRY_INDEX_NULL; } -static bool footpath_select_default() +static bool FootpathSelectDefault() { // Select default footpath - auto surfaceIndex = footpath_get_default_surface(false); - if (footpath_is_surface_okay(gFootpathSelection.NormalSurface, false)) + auto surfaceIndex = FootpathGetDefaultSurface(false); + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.NormalSurface, false)) { surfaceIndex = gFootpathSelection.NormalSurface; } // Select default queue - auto queueIndex = footpath_get_default_surface(true); - if (footpath_is_surface_okay(gFootpathSelection.QueueSurface, true)) + auto queueIndex = FootpathGetDefaultSurface(true); + if (FootpathIsSurfaceEntryOkay(gFootpathSelection.QueueSurface, true)) { queueIndex = gFootpathSelection.QueueSurface; } // Select default railing - auto railingIndex = footpath_get_default_railing(); + auto railingIndex = FootpathGetDefaultRailings(); const auto* railingEntry = GetPathRailingsEntry(gFootpathSelection.Railings); if (railingEntry != nullptr) { @@ -1433,10 +1433,10 @@ static bool footpath_select_default() } // Select default legacy path - auto legacyPathIndex = footpath_get_default_legacy_path(); + auto legacyPathIndex = FootpathGetDefaultLegacyPath(); if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) { - if (footpath_is_legacy_path_okay(gFootpathSelection.LegacyPath)) + if (FootpathIsLegacyPathEntryOkay(gFootpathSelection.LegacyPath)) { // Keep legacy path selected legacyPathIndex = gFootpathSelection.LegacyPath; @@ -1563,7 +1563,7 @@ void window_footpath_keyboard_shortcut_build_current() window_event_mouse_up_call(w, WIDX_CONSTRUCT); } -void window_footpath_reset_selected_path() +void WindowFootpathResetSelectedPath() { gFootpathSelection = {}; } diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index a31f96226b..4013b9f1ae 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -47,7 +47,7 @@ rct_window* window_main_open() gShowGridLinesRefCount = 0; gShowLandRightsRefCount = 0; gShowConstuctionRightsRefCount = 0; - window_footpath_reset_selected_path(); + WindowFootpathResetSelectedPath(); return window; } diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 03844e94eb..0fb34b6ef9 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -47,7 +47,7 @@ rct_window* window_editor_main_open(); rct_window* window_editor_objective_options_open(); rct_window* window_editor_scenario_options_open(); rct_window* window_footpath_open(); -void window_footpath_reset_selected_path(); +void WindowFootpathResetSelectedPath(); rct_window* window_guest_open(Peep* peep); rct_window* window_land_open(); rct_window* window_land_rights_open(); From 024f836960741ed248fa3238640818377da6a238 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 8 Sep 2021 22:33:39 +0200 Subject: [PATCH 382/681] Create FootpathCreateConstructFlags --- src/openrct2-ui/windows/Footpath.cpp | 57 ++++++++++------------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 6442ba7180..8dfbfdd9d1 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -41,6 +41,8 @@ static uint8_t _footpathConstructionMode; static std::vector> _dropdownEntries; +static PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type); + // clang-format off enum { @@ -461,14 +463,7 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window* CoordsXYZ footpathLoc; int32_t slope; footpath_get_next_path_info(&type, footpathLoc, &slope); - PathConstructFlags pathConstructFlags = 0; - if (gFootpathSelection.IsQueueSelected) - pathConstructFlags |= PathConstructFlag::IsQueue; - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) - { - pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; - type = gFootpathSelection.LegacyPath; - } + auto pathConstructFlags = FootpathCreateConstructFlags(type); _window_footpath_cost = footpath_provisional_set(type, railings, footpathLoc, slope, pathConstructFlags); widget_invalidate(w, WIDX_CONSTRUCT); @@ -854,17 +849,8 @@ static void window_footpath_set_provisional_path_at_point(const ScreenCoordsXY& z += PATH_HEIGHT_STEP; } - PathConstructFlags constructFlags = 0; auto pathType = gFootpathSelection.GetSelectedSurface(); - if (gFootpathSelection.IsQueueSelected) - { - constructFlags |= PathConstructFlag::IsQueue; - } - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) - { - constructFlags |= PathConstructFlag::IsLegacyPathObject; - pathType = gFootpathSelection.LegacyPath; - } + auto constructFlags = FootpathCreateConstructFlags(pathType); _window_footpath_cost = footpath_provisional_set( pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); window_invalidate_by_class(WC_FOOTPATH); @@ -963,16 +949,8 @@ static void window_footpath_place_path_at_point(const ScreenCoordsXY& screenCoor // Try and place path gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; auto selectedType = gFootpathSelection.GetSelectedSurface(); - PathConstructFlags constructFlags = 0; - if (gFootpathSelection.IsQueueSelected) - { - constructFlags |= PathConstructFlag::IsQueue; - } - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) - { - constructFlags |= PathConstructFlag::IsLegacyPathObject; - selectedType = gFootpathSelection.LegacyPath; - } + PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); + auto footpathPlaceAction = FootpathPlaceAction( { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); footpathPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { @@ -1064,14 +1042,8 @@ static void window_footpath_construct() footpath_get_next_path_info(&type, footpathLoc, &slope); gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE; - PathConstructFlags constructFlags = 0; - if (gFootpathSelection.IsQueueSelected) - constructFlags |= PathConstructFlag::IsQueue; - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) - { - constructFlags |= PathConstructFlag::IsLegacyPathObject; - type = gFootpathSelection.LegacyPath; - } + PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); + auto footpathPlaceAction = FootpathPlaceAction( footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { @@ -1468,6 +1440,19 @@ static bool FootpathSelectDefault() return true; } +static 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; +} + void window_footpath_keyboard_shortcut_turn_left() { rct_window* w = window_find_by_class(WC_FOOTPATH); From 6715250d54a4422ef5f00c3786b1a8284ffe6ead Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 8 Sep 2021 22:33:58 +0200 Subject: [PATCH 383/681] Remove now-unused enum --- src/openrct2-ui/windows/Footpath.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 8dfbfdd9d1..2d5c92ee1a 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -51,12 +51,6 @@ enum PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL }; -enum -{ - SELECTED_PATH_TYPE_NORMAL, - SELECTED_PATH_TYPE_QUEUE -}; - enum WINDOW_FOOTPATH_WIDGET_IDX { WIDX_BACKGROUND, From 228c1ac7f51a8c41993914b22b8bb9a2a69bd955 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 10 Sep 2021 09:13:20 +0200 Subject: [PATCH 384/681] Fix formatting --- src/openrct2/world/Footpath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c3c78decda..a2bef0f98d 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1658,9 +1658,9 @@ ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const } const FootpathObject* PathElement::GetLegacyPathEntry() const - { +{ return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); - } +} void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) { @@ -2343,7 +2343,7 @@ const FootpathSurfaceObject* GetPathSurfaceEntry(ObjectEntryIndex entryIndex) auto obj = objMgr.GetLoadedObject(ObjectType::FootpathSurface, entryIndex); if (obj == nullptr) return nullptr; - + return static_cast(obj); } From c567ca09db58466282832b9db528bfe36fccc974 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 10 Sep 2021 09:19:20 +0200 Subject: [PATCH 385/681] Fix stray changes --- src/openrct2-ui/windows/TileInspector.cpp | 1 - src/openrct2/paint/tile_element/Paint.Entrance.cpp | 4 ---- src/openrct2/world/TileElement.h | 6 +++--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index dbc2dfe747..575710c2ea 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index bd08305a1c..7b0ab9c16d 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -14,8 +14,6 @@ #include "../../drawing/LightFX.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" -#include "../../object/FootpathObject.h" -#include "../../object/FootpathSurfaceObject.h" #include "../../object/StationObject.h" #include "../../ride/RideData.h" #include "../../ride/TrackDesign.h" @@ -262,7 +260,6 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 switch (part_index) { case 0: - { if (surfaceDescriptor != nullptr) { image_id = (surfaceDescriptor->Image + 5 * (1 + (direction & 1))) | ghost_id; @@ -320,7 +317,6 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 PaintAddImageAsChild(session, stsetup, 0, 0, 0x1C, 0x1C, 0x2F, text_height, 2, 2, text_height); } break; - } case 1: case 2: entrance = static_cast(object_entry_get_chunk(ObjectType::ParkEntrance, 0)); diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 7df39ad9d3..68f289c8ce 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -293,9 +293,6 @@ public: const PathSurfaceDescriptor* GetSurfaceDescriptor() const; const PathRailingsDescriptor* GetRailingsDescriptor() const; - bool ShouldDrawPathOverSupports() const; - void SetShouldDrawPathOverSupports(bool on); - uint8_t GetQueueBannerDirection() const; void SetQueueBannerDirection(uint8_t direction); @@ -344,6 +341,9 @@ public: uint8_t GetAdditionStatus() const; void SetAdditionStatus(uint8_t newStatus); + bool ShouldDrawPathOverSupports() const; + void SetShouldDrawPathOverSupports(bool on); + bool IsLevelCrossing(const CoordsXY& coords) const; }; assert_struct_size(PathElement, 16); From 0f183e9ad2af9c344fe60d192e1d70b9c030cd1e Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 12 Sep 2021 18:29:37 +0200 Subject: [PATCH 386/681] Make FreeEntity take a reference --- src/openrct2/world/Sprite.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 7faafd75c5..34571a5bce 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -44,7 +44,7 @@ constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex; -static void FreeEntity(EntityBase* entity); +static void FreeEntity(EntityBase& entity); constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) { @@ -238,7 +238,7 @@ void reset_sprite_list() { continue; } - FreeEntity(spr); + FreeEntity(*spr); spr->Type = EntityType::Null; spr->sprite_index = i; @@ -545,10 +545,10 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite) /** * Frees any dynamically attached memory to the entity, such as peep name. */ -static void FreeEntity(EntityBase* entity) +static void FreeEntity(EntityBase& entity) { - auto* guest = entity->As(); - auto* staff = entity->As(); + auto* guest = entity.As(); + auto* staff = entity.As(); if (staff != nullptr) { staff->SetName({}); @@ -567,7 +567,7 @@ static void FreeEntity(EntityBase* entity) */ void sprite_remove(EntityBase* sprite) { - FreeEntity(sprite); + FreeEntity(*sprite); EntityTweener::Get().RemoveEntity(sprite); RemoveFromEntityList(sprite); // remove from existing list From 3e1544aac8afceaa95a9a2f2af80bad54f506a53 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 12 Sep 2021 18:31:21 +0200 Subject: [PATCH 387/681] Add missing object types to ObjectTypeToString() --- .../scripting/bindings/object/ScObject.hpp | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/openrct2/scripting/bindings/object/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp index a2d1938ae9..ee2a8dc138 100644 --- a/src/openrct2/scripting/bindings/object/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -60,9 +60,25 @@ namespace OpenRCT2::Scripting static std::string_view ObjectTypeToString(uint8_t type) { - static const char* Types[] = { "ride", "small_scenery", "large_scenery", "wall", "banner", - "footpath", "footpath_addition", "scenery_group", "park_entrance", "water", - "stex", "terrain_surface", "terrain_edge", "station", "music" }; + static const char* Types[] = { + "ride", + "small_scenery", + "large_scenery", + "wall", + "banner", + "footpath", + "footpath_addition", + "scenery_group", + "park_entrance", + "water", + "stex", + "terrain_surface", + "terrain_edge", + "station", + "music", + "footpath_surface", + "footpath_railings", + }; if (type >= std::size(Types)) return "unknown"; return Types[type]; From 1426010652d5655c64266665cb6ebdfe2a78dcbe Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 12 Sep 2021 18:33:27 +0200 Subject: [PATCH 388/681] Plugin: use ObjectEntryIndex for music and entrance style --- src/openrct2/scripting/bindings/ride/ScRide.cpp | 8 ++++---- src/openrct2/scripting/bindings/ride/ScRide.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2/scripting/bindings/ride/ScRide.cpp b/src/openrct2/scripting/bindings/ride/ScRide.cpp index d03c54d141..6bdd07b4f7 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.cpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.cpp @@ -252,13 +252,13 @@ namespace OpenRCT2::Scripting } } - uint8_t ScRide::stationStyle_get() const + ObjectEntryIndex ScRide::stationStyle_get() const { auto ride = GetRide(); return ride != nullptr ? ride->entrance_style : 0; } - void ScRide::stationStyle_set(uint8_t value) + void ScRide::stationStyle_set(ObjectEntryIndex value) { ThrowIfGameStateNotMutable(); auto ride = GetRide(); @@ -268,13 +268,13 @@ namespace OpenRCT2::Scripting } } - uint8_t ScRide::music_get() const + ObjectEntryIndex ScRide::music_get() const { auto ride = GetRide(); return ride != nullptr ? ride->music : 0; } - void ScRide::music_set(uint8_t value) + void ScRide::music_set(ObjectEntryIndex value) { ThrowIfGameStateNotMutable(); auto ride = GetRide(); diff --git a/src/openrct2/scripting/bindings/ride/ScRide.hpp b/src/openrct2/scripting/bindings/ride/ScRide.hpp index 4b05584f3c..0ee26d3d46 100644 --- a/src/openrct2/scripting/bindings/ride/ScRide.hpp +++ b/src/openrct2/scripting/bindings/ride/ScRide.hpp @@ -109,13 +109,13 @@ namespace OpenRCT2::Scripting void colourSchemes_set(const std::vector& value); - uint8_t stationStyle_get() const; + ObjectEntryIndex stationStyle_get() const; - void stationStyle_set(uint8_t value); + void stationStyle_set(ObjectEntryIndex value); - uint8_t music_get() const; + ObjectEntryIndex music_get() const; - void music_set(uint8_t value); + void music_set(ObjectEntryIndex value); std::vector> stations_get() const; From 6202ecb281ea803681506128261bd4c9543db0bb Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 12 Sep 2021 18:36:50 +0200 Subject: [PATCH 389/681] Make util_zlib_inflate() take const --- src/openrct2/util/Util.cpp | 2 +- src/openrct2/util/Util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 78225880b7..2260f5f1b6 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -566,7 +566,7 @@ constexpr int32_t MAX_ZLIB_REALLOC = 4 * 1024 * 1024; * @return Returns a pointer to memory holding decompressed data or NULL on failure. * @note It is caller's responsibility to free() the returned pointer once done with it. */ -uint8_t* util_zlib_inflate(uint8_t* data, size_t data_in_size, size_t* data_out_size) +uint8_t* util_zlib_inflate(const uint8_t* data, size_t data_in_size, size_t* data_out_size) { int32_t ret = Z_OK; uLongf out_size = static_cast(*data_out_size); diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index e0db4f33a2..678da94245 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -56,7 +56,7 @@ bool str_is_null_or_empty(const char* str); uint32_t util_rand(); std::optional> util_zlib_deflate(const uint8_t* data, size_t data_in_size); -uint8_t* util_zlib_inflate(uint8_t* data, size_t data_in_size, size_t* data_out_size); +uint8_t* util_zlib_inflate(const uint8_t* data, size_t data_in_size, size_t* data_out_size); bool util_gzip_compress(FILE* source, FILE* dest); int8_t add_clamp_int8_t(int8_t value, int8_t value_to_add); From 5d039a5f55ab49878e804a4e9246dcbe88edc124 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 12 Sep 2021 18:45:53 +0200 Subject: [PATCH 390/681] Use std::string_view instead of C string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com> --- src/openrct2/scripting/bindings/object/ScObject.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/scripting/bindings/object/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp index ee2a8dc138..19f1b09399 100644 --- a/src/openrct2/scripting/bindings/object/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -60,7 +60,7 @@ namespace OpenRCT2::Scripting static std::string_view ObjectTypeToString(uint8_t type) { - static const char* Types[] = { + static constexpr std::string_view Types[] = { "ride", "small_scenery", "large_scenery", From 6ffb03dde011bbde089facbde7369f7205710386 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 13 Sep 2021 09:29:46 +0200 Subject: [PATCH 391/681] Add icon for path railings tab --- resources/g2/icons/path_railings_tab.png | Bin 0 -> 12466 bytes resources/g2/sprites.json | 4 ++++ .../windows/EditorObjectSelection.cpp | 8 +++++--- src/openrct2/sprites.h | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 resources/g2/icons/path_railings_tab.png diff --git a/resources/g2/icons/path_railings_tab.png b/resources/g2/icons/path_railings_tab.png new file mode 100644 index 0000000000000000000000000000000000000000..ffac83ff405c25d2fbfb77914e2b006610416c66 GIT binary patch literal 12466 zcmeAS@N?(olHy`uVBq!ia0y~yV31{CV36csW?*3Wb?2%!1B1-#s*s41pu}>8f};Gi z%$!t(lFEWqh1817GzNx>TWe=$_C47#Y3=`F(R@ys-X}#COnaN-{{7|?ooQ-T(D=?P zrDDnMm_<1j&4EwP)&IX<`oI7Gnx}7yR-WB8^ZEWe#r@6kv;O~+exLr~=ifj7HrCs5 z*Vo=}{rB1N$=V~?zy95P^ZZBr`}X_lKjPT-Pqm-BV(onXXYuwgem?*6HebE#zW1fB zFTc-o#s0Sp?7GkX@Hxxl-MaaEuiD=~WOM)Zdh43R2kS5Q-}$%eP5qzULVII(_;r0; zGQq|^`P6-;N&ncUv+WnDYfF)l2&&u9UbpPa>oCp}`;VUdpBeh@edN!-x9@M-bbY_N z>do?&$G!X6F4yh<_xkt3KX3oe7v3fQ$UfF`?fmWN>~@AKZ>`+WEA z2{(_o&zIHRee}DRSzXcpefF{Wr|utm|Ml<7Kbd{6VwcqXeyUy{_Cj&eH0h!ni7nFS zs$&y39+B~1v**|jk16-ES00lK|Mc!@r~SiYv#M^boOs5yO8EV;``MiDcm0jcYdzLl z{@{d!MdSnNi!YD=KRW;aN0;wf_Z2l}{Pt#e-Ic{PZQ+@h>h2RK6x3f0tYrN6_4)h% zn(I4xrinj0#>;2FKlqGLU6yz0l(|$~IxTk@vX<-7Zs7R!*8Vk8P*WhCq8$ z^Q??1Aw`-;y>!=pG17_LmXvmtrEc-ES=lSYvU9gyzZi6Stx5J))9Y2zw%=GRrseJZ zcCA{zxts5t&5v&n8Vu9sWIl^rcGl|ln_`_)=}$wat=%;%y0%xg{MLgb+hWUa*Y*qZ zEiL(^dEC$T?H6OcrDd1TZjaghb=&RtKjvQm2Ymi`x?S?qQ9|Ad|O&)&vw+IH0JwEB0WC1xQ3wTu2*JlG<5TVUni zHtC?P549^zPldo~ZY`*6uO?{?>KXQzvN*a*UFq0#*Yioq^Do@mG|OqtQ#q#4UwqTP&0*ZK?lHsq!_%eKY@V=d#pJ!; zB)=|uShXbT`mELb-G%vj+~OCqLiYzatl->a-EKeH##O8MN|^XsfqqpswyG+w(cegF0?uitqty>OEC->t$mTrooan}W*x zbrOWFn~$t9$*@@Bync;Tg4-tp%||{x$z_inrvB_^stMgE@%ME0&4t^XG+&&ayfk+9 z+I6lwXTN>@%UdLuV|A29GC$YixW4t1@8u?k&yKNIUHe)kzVmC|+GS_B8E&xMeZ0MU z+Y2=z&ir4_+;4Ys2CS6*c9%2h>$dohjds5*B-)=!O%_dB+v@mU_o9;drR(#=PR#kk z`nRQ^tY-h!*#9My?!4uzuTr09IX`pv#;hN&)Wp>SlUQe)mUCZ8v_1TbVR?oe-xKLn z^LMMx#XigX{H3NjH>&M{ToCsGhntC;Og_Cl9;KPax4&lL^G+`I?OeGNHu)_Rb5i>? zDa?s+asI3=Zxs&hTY5d4lY`YKeY2F&%r}{DBbGS&FWc~K-)*ZO-m6RPXIrhwTUw+r z_oe3~i{{lL{pQTPom=ZuZwq(tY7V|?W?uO`r$hWGSH$J>{M_&6*1Vl}K>GU1llR+K z@722(lC$Qv!<|{%_PgEFd}gDu+lb+~U7&ilQ0s<#(^uE^AH9_l-&pvfdAD#2Q^1zT z2XC<^Is{Ca`EJ_cR{<|w&Ux1_-kY`mz$HcNV^?F$W9uKKz1Vq!>%z8Gr!tyMJHsUJ zJYka7R@C1($@K!mzUaD@dv)@>RDI1eZXL~1XZ@#TsCVnX#E;F_nzrr8d1fRcC!Tje zId)?ZgBT}EjG)#9!%edt%X!y!94k7Ld)1>Ly79HecKt6Zxz-Qkx+It6Z82VPD?TOH zp=~R($GP+S`nat6OIK(Ju^3(Z%NHHLETZn_L?-Rr`zvq6&Sx-Lcye)j^yb|fckOpH zi9PXqyzkl%vG^IUa%OZ{S+`m_Z=1Y_Pp5U|eRXc@EghHq6<$8BYp8ONJir~swjkJs zmo!$j#Tn%w}y;$AqOyJJ%i)T;W?zrO1`bW3&HU7%5mg{{K4LC9P zN}#7`J>wq-ttos}b|&W4vt(aMJvcmX=9USq#gCUTNLlFLv~9%IxTCi7@a4L2 z$pyiMI(O`P0(Y=@Ex#ZvDD$t@#ZKArX@kzL>YqkQ_9g!<7YbJw_0C_&_Nn5kgZ}4P zytXM!ayPpse0Q~-;AOv9R_UzkESa}X8L>YYcRbmaaP!ioRT>o)k1k7QUP@W8%wlds zAitn=+r3AhREw+fCoA}@=G*Tgm^97okm4eNowsx^+-{inNa#ihxD{H%L)GK4cj zzRX+vYv*gXNrJO;-Q(3Qp32Kz5*Dw_3{iIA=vW|?G3)v|4(ZoLJsust^R2J={_S(; zQ&8Y|zV9r9&X;1>H}6(*HnKmtp#OpCxpwOw#cF}e>Srpe?N2h+`fhI8(~Ys&geH&k5^r9(7D|xpZ!s!|x2; z?sI!@O!>s}^`y)f7J-1Txyf1<8ZKR&>Mu_KB?_UbQt*eeu%?m$zCMT4*OdoD#!hyiAr+PbK84aEt zd~q{86f|yKO6lD7_3%R0r<)j8_%>5c5oGk-;1%&=%OcFQ0_B09A~FC#rbN?{d{@ z;(qY<(uIr#GfuHuon+JXe5fFDVSkZe+hBsPEzMRwxzdmK%Gv5tM-M_Hb?P!%gJhLfrmV9OV3x`h^G!#rl1s&362(_2G zEq1aroZ9QLA|mu`%}NJ7ZrgY2@>48ZnZ*RwGsPT8aW%YJ#{7?C(eHzwInox(a0q|m zp3_+FvCx*2BUhK9@w8Ax&(hu!*s0!vM*~AShlt%TXwu~iuJ9U zxF~Lwm{oTMZ`2H>v#Ss4x@S5(aj0vse!^g6xixA*pz`;LQ+|J3C1EJEv=%T$dsr%0Y0e$=BN4y#JF7_PBIkUAh?e3@F zKaB+w7|-;~mY*chyv}vugPV6Qg)6UV?#OuX?h?-<9>eV-x+l(wYH&^Jn!Yf#@GRS! zGl7p5URmLIUv+okLFeK%&|$SAw!p(=Ys zVvn1@fU@xBpxW>l`-$6bIK7;qp?N1UZh?K19dqVH|Hj0G*tqETMz*m`gFnhz3#o}+cXEgt?m2s?n_Q>Ru;-L!n{#=O_sX|^sy&cM` z8;d!w&u4$axvlYeh4#AXjh+ir-D~&dx-5@cCzBi!+G|!QcF#=<-FwZq(7ESj%xTHg*;ZLW%NW{RMMQGV1Eqo{el3qxIjgeABRD!GL^0GYcEg_Q zG5M}>JGP#B{baS~Z#apQm9tb z|BBR(#;31O6m~TV9XpZn`qS0TF-iYl?Nq&3wE4*OJ3A5;E^L$&dEt0prQ{wUoF(J!bBppplzi>isXst$>)|$Q@xRq ztn}Ta;`7s#cT!$+G8k`N*!bs6s*sH7=fFm;n++u;F4E%yJZJnc;kD=Mdw`?v|8@7wG^KSeVdBE+|g0HOMhfCS~ zgZpcb?kG(2+{Zl6pm&?X(~AElf9G)8w#G9z8rn?>Qce?&xUjL~Du;5S&%vdv9a<~c zPi{?D zE$>LGm8s{ZD?E*BU*tO5ee1)IFRPPwUHi=HxocI(nv1S{Y^P?ui+Vft=ypyp(6hBdn$uY0-fn9aqDp^~;&)!uA~ zvsR84J8(&iWx1m99j@1^8kr3zg<9?B^sg|oWYH8_qoKifZ{Y-?XC?w+*Xp-8YE2fq zH2bJBQz3(kd=FplcWr%+HH$Sq^d|`OeX=~OW?bbnJHnG~W#&6^8>dN&)@^W>?q%x9 z-^J7N+5eS6XPLHv+-}|L9-NlbCHTc9i!$T>GEevI5jxZ+)^f+_TbLLhpF8V;*#%67 zjyhiD_n&IqWIb51WsX8!R{0G7+O>~d?{E6D+ss(&Xxq}hSuFVTZ{D0` zyi8A)1ZN+!%nz~`RcXJ|_s!1a&7z%*t7kkt+qQ^zcV>x$cVot*txdOPcUcWD zKlSjr;WIh7A>(o#!wmbGyXsa(XfFE0ef_+^9u@9qT%NV-u6${gspj}Ixw`S!sa3ws z7AYoj3rlqP{JNjmNWa~|wbRk&LACIdl@-0|2MRY$`tZHX{#xLazn9o9x_x=ulyK>p z(DG$3*Z430xO9o@gd;qg89F^5FYce@!D;K3&cN(;R$1g@c<+=AIaOs@HHPfI&x6`r z^IR*}mHd0W4v$tyCCO%*Gf&xFDC3(xU&WCJoed{<| z|AWj~-pO}gc0cRmT+L)>7Uo+jt7*b>sNi+3nQ8A9{_H*Gbsr52@~7_-Sog#6m6z|{I`7#cNsQ+)D)@UeWRc6@a*>S4=04`zpi2RNsl?n z(8KXF^TdmmuATcPMzZuMO^UcKl*J;nd&z|Pj&4zxvt~tPKPo;aU{ucQZQ^92es;xf zSrzTm%JW*69k=}4D8m0C{Z=N^fmFX)W-BskUUWwvI=6a%#`-4$9|gSMs$8+UH)-3n zu($$dhN}y^IEAZUI2mwWxyTS=D%9|&ugNxIL7GKhXuxgn?Q9qQBbdAAte91EC8X2u zz$q8WMfv@wHP%*`#L3@&F!hUOVfckp2{F5090@Hvcw~Xz%!+kwK}-LxJFp~MU!%%k zQbgmu84OM<7uIS@o!ZslwMd^UL~C~IjHMb1WnZ2=T&=9uYtFLG@=(fE>3`pM*84p> zT{WA5^}fH;|4F4z`V)^Pwm81xF5R@VKKD&3&(3+Xm8QDA)h>AXvi8*R)|vNH{9bBa zo-EY6|DbG2!}i6xMw8Po&5^z0z9%!PQHU|k^rATrTZi4jH%GpzXYH1_TDAA0{jIV|yWqL8{+>G8!94$nq8u9RALy_byKdi=%V zZ?#X@KD0=`uFSiF*Jbh-@s)9XQYL3@7w|m!t8?e~p`zi`U5o-1@ZW zxyy~Xh>r6On@yWa8d zg;@%B=9twVR6h}9eecWsrRmE8C#9Va&7NHvbuwEgQp|Bg|6!Fk8Tw#4b{I#or* zoH}`~q0;rumsRRY0p};>RkpDH%{evsg;I8PVBGOr3h8Q!stfPNEW7bu+FI>bMTXLX zn&3%Q3m%kd-+wGqd1plyyEoUyX@{G>c(E86pNeAXEZLK#d)9kM#hDW23vwJe_ikW#pL$I%L-dA=NkPCP?|BB&*?y&|G6z! zEDWN$SM5#WDv5NJFJykQUE$z{HH9xY9a>8G^V=7COuWm)DdX20zvi#jt~*9&eIM2= z@4I<1X0t2r`Mw6Pwy4E-;+duMIHqRwI^?o^mv-SdlwE#M^wmqji(%`fem^lcs0{vM z%cymM-_7ZP8E-&B%B2$1=N`8V6_p=1u#0uZ#jeWLD%ttt7o)`itJ9ZX8{5uTVqWXM ze9PnyX@S0(tE-MUDY54?vaFo1`H{MZ~9epKUQc<#SX z@641Z-eYzAk7_f>~-EH~Tf_4iqO@Yj~!+Zu6GtgrUi z+vZ!DZ_nQlZhdaEh*o6$w1-neB#fANyQV7sKh&Dx{)RDP-lj=xvfB>|Rhclny(Z8q zVPClX$m(U~;lclVCEAw=&SiSQQn<3E@sOUuf$s<1?mT*UqGZB{@XLP7wNiK`<~KJz z?SAU-?Dksmk)@_HlY?wepZBl7nY%wk9x+LmFLa-^<=!&G^2l4?h2AJU{W?cnX74Q3 z_3aaXBrR<=@;*1qR!F9UL32}8$Z89QkUxj`|7&hF`eHHd+1~$uT6Q^lh((cqTx0yCLUcP(G#$v?lsmsim92mihx)1W0= z-sYOTOk~=^ZZu=og7%kO?dFYp&%K_vY;K3btqAiP=?f*oQ~mt-JBHL zTSX_n&Rr~5dC_9pxeIZ(qVG?hcSr4N#KVaj7euUozHY@!U1ojzUTM|b9dYK4USb*2 zhQH=T?B>?wuzBRH{*Se=_1x#$RkONZy}6#kG>iRdlEK?ODdHREJA8#A>M7$`<@z!Tin;4NBavk?(*q#Hq95DToTSqmeSjMcg_zHP6gqpVAGRty8x+`g-sA-`J|hsNH_w!(Hc7jd{nQ zMN9AgGH2eNd$U4!e&^Zdwjw_{j$gaPYR{>kc^?DcR<(Sno%Y0RRawA8h9I~8%Fe$( zdTa0H%HG+yY<~UU5B=w}jCmao+5dbaKG)K7XYa+5|MDyc;;!=_4*tZzz>tb{+B37D zBpEdAY3pUk*Wkc$yRy}vp=-HadjVe_-#>e^BN0x~QBQWwpR`oac|-eg!Qkf4hwpmH zO6MM081vaP_GH_|+>N%CtU_ugoHhKihBb^|Z-~c~Bwjhsz`)p&>FgZf>Ff-fXJufh zm{U8^*5j~)%+dJZZY5Dx>yD0;6@Fqat}TvrHWwT8+1=>2U{3!^fupWr$4*PlT^^nPy}5LgY%Ja#-(B6mySyPl-}vk+33ijaX2G31W}IBt zHFrJ7LjFV!iD@%a&v*t2?R)%Mj&a|;qZQNs@3eRCpS4*+K%g^yX5y_Q(nl`O-gdBZ zzQv)gOzu{i)gGalTYE~b3%4hH)<;1c#UXHVz?D+T0zi6J?_%C`v_1V{JclKXq zSMZHh&2MOSPT1mb^R?akcUkY>-Zwt`ua1FVzNlVtbx#cg1FuwONJL45ua8x7ey(0( zN`6wRUPW#J0|?mIR}>^BXQ!4ZB&DWj=GiK}-@RW+Av48RDcsc8z_-9TH6zobswg$M z$}c3jDm&RSMakZd%cjDrBDWwnwIorYA~z?m*s8)-32d%aUa=KOSYJs2tfVB{Rw=?a zK*2e`C{@8k&qU8a*R>+E%t* zm6W&?6cnI_SL7D>`ofLRD~5(ba(=FUMPh-zp`L+$ZmvGEj^Yy6vJ(6{ibE<3QuTvU zi}Op1l2cvFQu9ibk&Q@6hU+gVEy@9VCnZ@wH77MUHLs*t-%!sG#Y%Ti-vGD{P!ObN z<`#f;Rpb_+s4U4$Lj)FzZ$L6&?;ty*BDVl;E{bZH-@%H(VPxf!pIi!Zo~Mhg63Bk5 zl>Fq(6e}>(!qPIy!qVJC*U-=)QP;%Wz(UtD*}_!UI3?BC*x1-2DbX|$$tcgf;*!L? zC2vs)eq(Ns5t4N{VSpvVkSo zsFY+YxBQ~q#1dPj%-qEERQ-aybg%>{z^xnuJZ+VX^b8Op0Xc~!Y57IDwn{#kd8HKy ziIB|P)ZmgtP-q&O85tUynHyM|8krba7$NBnOD!tS%+CXvX=tElWCGR>iWV#XqRiC1 zl0;BCwN)|%i&x|pSUDG^CYIzEh2-bw*eZdXq+q0HXaG*$3O0~P@yIML$uFw31E*+k zz6nk(gzz9)ASV+nrJw*#wpNMB5KD>^%TiOo7Ae4_k~0$X(o<7xm7oa>C9Qa8PQZx}`iL6%Gk=ykGDU+z4-h4!|u`y@!AaK_6+^O?921n_jmJO zUoQOlwDkYy`u{)2|Nq_p|NmiS1_plyhIn@Ne186VY3Y7-^~KiKoBjQdr>9@9uYWy% z{{Q{^rHzG^?Zx%|<*nn@-Sf4>>y4B9t&3+nH?Q`dygPXD>G#E)G85oP2$H@#EFa@Apstetz};$A|fa z&DFKTjm^{Toy&uRyOWb=mzS^a?%qFt{`u|O?_a+B{{8#^4AS`w>eJbcm-9RCmJU9x zoqpfB{c-f-=jFTK_h0_J{`v3g-~V%K^YfdFi@VD!2W#smTU!@<`?tp@&n~ZC-#z*G z^7Xe5pZ|Q{o*~|wy*QY^K3={*TYGl3{p$AM-Lun=udctofA;h1hd+OQ{okH}A)JAs zn1P|6fnhZR!*K?N$LtLM*%|)(JO8gP{=a(h|J&F7)fw`Q87A8^Y|BLh=?uoz-1hzA{)^?~x2xyhw(fr)z4~+c?(fr2|K5K8|MmCk!VKo}?C$#f(f0D$ z!N%3;-u?C2iznCbUOoBz;nmM?AO8ROzPY#e|LqL_Z!`S=&%mCY%$}XB-rp|WT+N=H zY(9Is`RwVlA3rWWecF8Xbm!>k;Oy+=>gst^pyK*rD1EYzji(`n!`Kc2x z<{mcSaoO77c|M{0ipyIe$8V)eYf_m4g{Qc$)D_qwKb86R#mgU06np)TcRBL!H*=ZX zo7d*sW`2zMyno8|S@t1YpIo0+X#B!tY5)3Jhgb9M@8~VRzUoI=hPjft4D*@!Y`Qme zn?L5L#T@U8_6irfdPhU+(76p3HWwye^DAKFl+%s=qVsicG(-6N6&JSj-mLgyGO-Ty?nb^on>k=XvoFW)z4*}Q$iB}n5>F) literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 6250ec5297..041165287f 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -478,6 +478,10 @@ { "path": "icons/view.png" }, + { + "path": "icons/path_railings_tab.png", + "x_offset": 1 + }, { "path": "font/latin/ae-uc-small.png", "y_offset": 0, diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 86f7cd248d..489f8e85ef 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -108,10 +108,12 @@ static constexpr const ObjectPageDesc ObjectSelectionPages[] = { { STR_OBJECT_SELECTION_WATER, SPR_TAB_WATER, false }, // Currently hidden until new save format arrives: - // { STR_OBJECT_SELECTION_TERRAIN_SURFACES, SPR_G2_TAB_LAND, false }, - // { STR_OBJECT_SELECTION_TERRAIN_EDGES, SPR_G2_TAB_LAND, false }, - // { STR_OBJECT_SELECTION_STATIONS, SPR_TAB_PARK, false }, + // { STR_OBJECT_SELECTION_TERRAIN_SURFACES, SPR_G2_TAB_LAND, true }, + // { STR_OBJECT_SELECTION_TERRAIN_EDGES, SPR_G2_TAB_LAND, true }, + // { STR_OBJECT_SELECTION_STATIONS, SPR_TAB_PARK, true }, // { STR_OBJECT_SELECTION_MUSIC, SPR_TAB_MUSIC_0, false }, + // { STR_OBJECT_SELECTION_FOOTPATH_SURFACES, SPR_TAB_SCENERY_PATHS, false }, + // { STR_OBJECT_SELECTION_FOOTPATH_RAILINGS, SPR_G2_PATH_RAILINGS_TAB, false }, }; #pragma region Widgets diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 64d72de1cd..0965ea5fd0 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -864,7 +864,9 @@ enum SPR_G2_VIEW = SPR_G2_BEGIN + 137, - SPR_G2_CHAR_BEGIN = SPR_G2_BEGIN + 138, + SPR_G2_PATH_RAILINGS_TAB = SPR_G2_BEGIN + 138, + + SPR_G2_CHAR_BEGIN = SPR_G2_BEGIN + 139, SPR_G2_AE_UPPER = SPR_G2_CHAR_BEGIN, SPR_G2_AE_LOWER = SPR_G2_CHAR_BEGIN + 1, From b5eec55a0592c71233ab66841f2ff4ac3ae1621b Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Mon, 13 Sep 2021 14:50:58 +0100 Subject: [PATCH 392/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 622ac35946..6a8d3eaba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.51") +set(REPLAYS_VERSION "0.0.52") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "01086A05A3291B296906AE215855BC7CDB045A6A") +set(REPLAYS_SHA1 "3A1A6B5B25ACA3B8AADC618A9D2BE44F8A23A7BB") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index f2f33c624f..b0641bfc8c 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.51/replays.zip - 01086A05A3291B296906AE215855BC7CDB045A6A + https://github.com/OpenRCT2/replays/releases/download/v0.0.52/replays.zip + 3A1A6B5B25ACA3B8AADC618A9D2BE44F8A23A7BB From 59a6c34db45ae3fb60596984f9c23e6ae5253764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 13 Sep 2021 19:47:13 +0300 Subject: [PATCH 393/681] Make use of std::optional strict --- .../drawing/engines/opengl/TextureCache.cpp | 6 +- src/openrct2-ui/input/ShortcutInput.cpp | 4 +- src/openrct2-ui/input/ShortcutManager.cpp | 8 +-- src/openrct2-ui/windows/GameBottomToolbar.cpp | 6 +- src/openrct2-ui/windows/LandRights.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/News.cpp | 4 +- src/openrct2-ui/windows/Player.cpp | 8 +-- src/openrct2-ui/windows/Ride.cpp | 7 +- src/openrct2-ui/windows/RideConstruction.cpp | 10 +-- src/openrct2-ui/windows/TileInspector.cpp | 8 +-- src/openrct2-ui/windows/TopToolbar.cpp | 26 +++---- src/openrct2-ui/windows/ViewClipping.cpp | 10 +-- src/openrct2/CmdlineSprite.cpp | 2 +- src/openrct2/core/String.cpp | 2 +- src/openrct2/core/Zip.cpp | 18 ++--- src/openrct2/drawing/Drawing.Sprite.cpp | 14 ++-- src/openrct2/drawing/Drawing.String.cpp | 18 ++--- src/openrct2/drawing/Drawing.cpp | 4 +- src/openrct2/drawing/X8DrawingEngine.cpp | 5 +- src/openrct2/interface/Screenshot.cpp | 18 ++--- src/openrct2/interface/Viewport.cpp | 22 +++--- src/openrct2/interface/Window.cpp | 8 +-- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/object/Object.cpp | 4 +- src/openrct2/object/ObjectManager.cpp | 6 +- src/openrct2/object/SceneryGroupObject.cpp | 4 +- src/openrct2/peep/Guest.cpp | 70 +++++++++---------- src/openrct2/peep/Peep.cpp | 4 +- src/openrct2/peep/Staff.cpp | 36 +++++----- src/openrct2/platform/Crash.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 4 +- src/openrct2/rct2/S6Exporter.cpp | 16 ++--- src/openrct2/ride/Ride.cpp | 8 +-- src/openrct2/ride/RideConstruction.cpp | 8 +-- src/openrct2/ride/TrackDesign.cpp | 4 +- src/openrct2/ride/TrackDesignSave.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 16 ++--- src/openrct2/world/MoneyEffect.cpp | 4 +- 39 files changed, 204 insertions(+), 200 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index b762f293ec..11fe0029c8 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -221,10 +221,10 @@ void TextureCache::GeneratePaletteTexture() GLint y = PaletteToY(static_cast(i)); auto g1Index = GetPaletteG1Index(i); - if (g1Index) + if (g1Index.has_value()) { - auto element = gfx_get_g1_element(*g1Index); - gfx_draw_sprite_software(&dpi, ImageId(*g1Index), { -element->x_offset, y - element->y_offset }); + auto element = gfx_get_g1_element(g1Index.value()); + gfx_draw_sprite_software(&dpi, ImageId(g1Index.value()), { -element->x_offset, y - element->y_offset }); } } diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 0e22095bba..c1a4c0f1a8 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -152,11 +152,11 @@ ShortcutInput::ShortcutInput(std::string_view value) else { auto number = String::Parse(rem); - if (number) + if (number.has_value()) { Kind = InputDeviceKind::JoyButton; Modifiers = modifiers; - Button = *number - 1; + Button = number.value() - 1; } } } diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index d729ea8b30..86b0dc9750 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -167,10 +167,10 @@ void ShortcutManager::ProcessEvent(const InputEvent& e) if (shortcut != nullptr && shortcut->IsSuitableInputEvent(e)) { auto shortcutInput = ShortcutInput::FromInputEvent(e); - if (shortcutInput) + if (shortcutInput.has_value()) { shortcut->Current.clear(); - shortcut->Current.push_back(std::move(*shortcutInput)); + shortcut->Current.push_back(std::move(shortcutInput.value())); } _pendingShortcutChange.clear(); window_close_by_class(WC_CHANGE_KEYBOARD_SHORTCUT); @@ -273,9 +273,9 @@ void ShortcutManager::LoadLegacyBindings(const fs::path& path) { shortcut->Current.clear(); auto input = ConvertLegacyBinding(value); - if (input) + if (input.has_value()) { - shortcut->Current.push_back(std::move(*input)); + shortcut->Current.push_back(std::move(input.value())); } } } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 26e35e8d90..06b6aa9275 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -174,12 +174,12 @@ static void window_game_bottom_toolbar_mouseup(rct_window* w, rct_widgetindex wi auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); - if (subjectLoc == std::nullopt) + if (!subjectLoc.has_value()) break; rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) - window_scroll_to_location(mainWindow, *subjectLoc); + window_scroll_to_location(mainWindow, subjectLoc.value()); } break; case WIDX_RIGHT_OUTSET: @@ -315,7 +315,7 @@ static void window_game_bottom_toolbar_invalidate(rct_window* w) // Find out if the news item is no longer valid auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); - if (subjectLoc == std::nullopt) + if (!subjectLoc.has_value()) w->disabled_widgets |= (1ULL << WIDX_NEWS_LOCATE); if (!(newsItem->TypeHasSubject())) diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 2f61248a42..4a2d99326b 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -286,7 +286,7 @@ static void window_land_rights_tool_update_land_rights(const ScreenCoordsXY& scr auto mapTile = screen_get_map_xy(screenCoords, nullptr); - if (!mapTile) + if (!mapTile.has_value()) { if (_landRightsCost != MONEY32_UNDEFINED) { diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index dd8d141f48..a13f3f3bb9 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1187,7 +1187,7 @@ static void window_map_set_land_rights_tool_update(const ScreenCoordsXY& screenC map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapCoords = screen_get_map_xy(screenCoords, &viewport); - if (!mapCoords) + if (!mapCoords.has_value()) return; gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 2fa7db71f9..ade37acd2f 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -110,9 +110,9 @@ public: { static rct_window* _mainWindow; auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc); - if (subjectLoc != std::nullopt && (_mainWindow = window_get_main()) != nullptr) + if (subjectLoc.has_value() && (_mainWindow = window_get_main()) != nullptr) { - window_scroll_to_location(_mainWindow, *subjectLoc); + window_scroll_to_location(_mainWindow, subjectLoc.value()); } } } diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 4e10af0025..bbbff05b0b 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -610,7 +610,7 @@ static void window_player_update_viewport(rct_window* w, bool scroll) if (coord.x != 0 || coord.y != 0 || coord.z != 0) { auto centreLoc = centre_2d_coordinates(coord, viewport); - if (!centreLoc) + if (!centreLoc.has_value()) { return; } @@ -620,13 +620,13 @@ static void window_player_update_viewport(rct_window* w, bool scroll) scroll = false; } - if (!scroll || w->savedViewPos != centreLoc) + if (!scroll || w->savedViewPos != centreLoc.value()) { w->flags |= WF_SCROLLING_TO_LOCATION; - w->savedViewPos = *centreLoc; + w->savedViewPos = centreLoc.value(); if (!scroll) { - w->viewport->viewPos = *centreLoc; + w->viewport->viewPos = centreLoc.value(); } widget_invalidate(w, WIDX_VIEWPORT); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index acab395266..dd6ea8e985 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5009,9 +5009,9 @@ static std::optional GetMusicStyleOrder(ObjectEntryIndex musicObjectInde // Get the index in the order list auto originalStyleId = musicObj->GetOriginalStyleId(); - if (originalStyleId) + if (originalStyleId.has_value()) { - auto it = std::find(std::begin(MusicStyleOrder), std::end(MusicStyleOrder), *originalStyleId); + auto it = std::find(std::begin(MusicStyleOrder), std::end(MusicStyleOrder), originalStyleId.value()); if (it != std::end(MusicStyleOrder)) { return std::distance(std::begin(MusicStyleOrder), it); @@ -5046,7 +5046,8 @@ static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetInd { // Hide custom music if the WAV file does not exist auto originalStyleId = musicObj->GetOriginalStyleId(); - if (originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_1 || originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_2) + if (originalStyleId.has_value() + && (originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_1 || originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_2)) { auto numTracks = musicObj->GetTrackCount(); if (numTracks != 0) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 24fdf0f985..b480d393a3 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1889,7 +1889,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) track_type_t type = _currentTrackPieceType; auto newCoords = GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { window_ride_construction_update_active_elements(); return; @@ -1921,7 +1921,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) newCoords = GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { window_ride_construction_update_active_elements(); return; @@ -2178,9 +2178,9 @@ static std::optional ride_get_place_position_from_screen_position(Scre { auto mapZ = _trackPlaceCtrlZ; auto mapXYCoords = screen_get_map_xy_with_z(screenCoords, mapZ); - if (mapXYCoords) + if (mapXYCoords.has_value()) { - mapCoords = *mapXYCoords; + mapCoords = mapXYCoords.value(); } else { @@ -2604,7 +2604,7 @@ void UpdateGhostTrackAndArrow() : TRACK_ELEMENT_SET_HIGHLIGHT_FALSE; auto newCoords = GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { ride_construction_remove_ghosts(); _rideConstructionState = RideConstructionState::State0; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 575710c2ea..a128f0d6c4 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1232,10 +1232,10 @@ static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex wid if (clickedElement == nullptr) { auto mouseCoords = screen_pos_to_map_pos(screenCoords, nullptr); - if (mouseCoords) + if (mouseCoords.has_value()) { mouseOnViewport = true; - mapCoords = *mouseCoords; + mapCoords = mouseCoords.value(); } } @@ -1285,12 +1285,12 @@ static void window_tile_inspector_update_selected_tile(rct_window* w, const Scre { auto mouseCoords = screen_pos_to_map_pos(screenCoords, nullptr); - if (!mouseCoords) + if (!mouseCoords.has_value()) { return; } - mapCoords = *mouseCoords; + mapCoords = mouseCoords.value(); // Tile is already selected if (windowTileInspectorTileSelected && mapCoords.x == windowTileInspectorToolMap.x && mapCoords.y == windowTileInspectorToolMap.y) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index e2b01cd018..2de7cecde5 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1267,12 +1267,12 @@ static void sub_6E1F34_small_scenery( if (!gSceneryCtrlPressed) { auto gridCoords = screen_get_map_xy_quadrant(screenPos, &quadrant); - if (!gridCoords) + if (!gridCoords.has_value()) { gridPos.SetNull(); return; } - gridPos = *gridCoords; + gridPos = gridCoords.value(); gSceneryPlaceZ = 0; @@ -1300,12 +1300,12 @@ static void sub_6E1F34_small_scenery( int16_t z = gSceneryCtrlPressZ; auto mapCoords = screen_get_map_xy_quadrant_with_z(screenPos, z, &quadrant); - if (!mapCoords) + if (!mapCoords.has_value()) { gridPos.SetNull(); return; } - gridPos = *mapCoords; + gridPos = mapCoords.value(); // If SHIFT pressed if (gSceneryShiftPressed) @@ -1382,7 +1382,7 @@ static void sub_6E1F34_small_scenery( { int16_t z = gSceneryCtrlPressZ; auto coords = screen_get_map_xy_with_z(screenPos, z); - if (coords) + if (coords.has_value()) { gridPos = *coords; } @@ -1485,12 +1485,12 @@ static void sub_6E1F34_wall( if (!gSceneryCtrlPressed) { auto gridCoords = screen_get_map_xy_side(screenPos, &edge); - if (!gridCoords) + if (!gridCoords.has_value()) { gridPos.SetNull(); return; } - gridPos = *gridCoords; + gridPos = gridCoords.value(); gSceneryPlaceZ = 0; @@ -1517,12 +1517,12 @@ static void sub_6E1F34_wall( { int16_t z = gSceneryCtrlPressZ; auto mapCoords = screen_get_map_xy_side_with_z(screenPos, z, &edge); - if (!mapCoords) + if (!mapCoords.has_value()) { gridPos.SetNull(); return; } - gridPos = *mapCoords; + gridPos = mapCoords.value(); // If SHIFT pressed if (gSceneryShiftPressed) @@ -1608,7 +1608,7 @@ static void sub_6E1F34_large_scenery( { int16_t z = gSceneryCtrlPressZ; auto coords = screen_get_map_xy_with_z(screenPos, z); - if (coords) + if (coords.has_value()) { gridPos = *coords; } @@ -2005,7 +2005,7 @@ static uint8_t top_toolbar_tool_update_land_paint(const ScreenCoordsXY& screenPo auto mapTile = screen_get_map_xy(screenPos, nullptr); - if (!mapTile) + if (!mapTile.has_value()) { if (gClearSceneryCost != MONEY64_UNDEFINED) { @@ -2124,7 +2124,7 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) screen_pos_to_map_pos(screenPos, &selectionType); mapTile = screen_get_map_xy_side(screenPos, &side); - if (!mapTile) + if (!mapTile.has_value()) { money64 lower_cost = MONEY64_UNDEFINED; money64 raise_cost = MONEY64_UNDEFINED; @@ -2201,7 +2201,7 @@ static void top_toolbar_tool_update_land(const ScreenCoordsXY& screenPos) // Get map coordinates and the side of the tile that is being hovered over mapTile = screen_get_map_xy_side(screenPos, &side); - if (!mapTile) + if (!mapTile.has_value()) { money64 lower_cost = MONEY64_UNDEFINED; money64 raise_cost = MONEY64_UNDEFINED; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 52da8f5083..922b51d1b2 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -303,12 +303,12 @@ static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widg int32_t direction; auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords) + if (mapCoords.has_value()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; map_invalidate_tile_full(gMapSelectPositionA); - gMapSelectPositionA = gMapSelectPositionB = *mapCoords; - map_invalidate_tile_full(*mapCoords); + gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); + map_invalidate_tile_full(mapCoords.value()); gMapSelectType = MAP_SELECT_TYPE_FULL; } } @@ -317,10 +317,10 @@ static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widget { int32_t direction; auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords) + if (mapCoords.has_value()) { _dragging = true; - _selectionStart = *mapCoords; + _selectionStart = mapCoords.value(); } } diff --git a/src/openrct2/CmdlineSprite.cpp b/src/openrct2/CmdlineSprite.cpp index 1d2459f7ee..2a0234db4a 100644 --- a/src/openrct2/CmdlineSprite.cpp +++ b/src/openrct2/CmdlineSprite.cpp @@ -545,7 +545,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) } auto importResult = SpriteImageImport(imagePath, x_offset, y_offset, false, false, gSpriteMode); - if (importResult == std::nullopt) + if (!importResult.has_value()) return -1; auto spriteFile = SpriteFile::Open(spriteFilePath); diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index a1e9ff1370..1df821814f 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -821,7 +821,7 @@ namespace String { return trunc.substr(0, i); } - i += *length; + i += length.value(); } return trunc; diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp index 0ca6e6e533..10475bab1a 100644 --- a/src/openrct2/core/Zip.cpp +++ b/src/openrct2/core/Zip.cpp @@ -131,12 +131,12 @@ public: { std::vector result; auto index = GetIndexFromPath(path); - if (index) + if (index.has_value()) { - auto dataSize = GetFileSize(*index); + auto dataSize = GetFileSize(index.value()); if (dataSize > 0 && dataSize < SIZE_MAX) { - auto zipFile = zip_fopen_index(_zip, *index, 0); + auto zipFile = zip_fopen_index(_zip, index.value(), 0); if (zipFile != nullptr) { result.resize(static_cast(dataSize)); @@ -155,9 +155,9 @@ public: std::unique_ptr GetFileStream(std::string_view path) const override { auto index = GetIndexFromPath(path); - if (index) + if (index.has_value()) { - return std::make_unique(_zip, *index); + return std::make_unique(_zip, index.value()); } return {}; } @@ -171,9 +171,9 @@ public: auto source = zip_source_buffer(_zip, writeBuffer.data(), writeBuffer.size(), 0); auto index = GetIndexFromPath(path); - if (index) + if (index.has_value()) { - zip_replace(_zip, *index, source); + zip_replace(_zip, index.value(), source); } else { @@ -184,9 +184,9 @@ public: void DeleteFile(std::string_view path) override { auto index = GetIndexFromPath(path); - if (index) + if (index.has_value()) { - zip_delete(_zip, *index); + zip_delete(_zip, index.value()); } else { diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 786ec46fba..1bb8bfb66d 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -378,25 +378,27 @@ static std::optional FASTCALL gfx_draw_sprite_get_palette(ImageId im { paletteMap = PaletteMap(gOtherPalette); auto tertiaryPaletteMap = GetPaletteMapForColour(imageId.GetTertiary()); - if (tertiaryPaletteMap) + if (tertiaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_TERTIARY, *tertiaryPaletteMap, PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + PALETTE_OFFSET_REMAP_TERTIARY, tertiaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, + PALETTE_LENGTH_REMAP); } } auto primaryPaletteMap = GetPaletteMapForColour(imageId.GetPrimary()); - if (primaryPaletteMap) + if (primaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_PRIMARY, *primaryPaletteMap, PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + PALETTE_OFFSET_REMAP_PRIMARY, primaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); } auto secondaryPaletteMap = GetPaletteMapForColour(imageId.GetSecondary()); - if (secondaryPaletteMap) + if (secondaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_SECONDARY, *secondaryPaletteMap, PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + PALETTE_OFFSET_REMAP_SECONDARY, secondaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, + PALETTE_LENGTH_REMAP); } return paletteMap; diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 934c26e62f..78e8915014 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -57,7 +57,7 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fon if (token.kind == FormatToken::Newline || token.kind == FormatToken::NewlineSmall) { auto width = gfx_get_string_width(buffer, fontSpriteBase); - if (!maxWidth || maxWidth > width) + if (!maxWidth.has_value() || maxWidth.value() > width) { maxWidth = width; } @@ -68,11 +68,11 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fon buffer.append(token.text); } } - if (!maxWidth) + if (!maxWidth.has_value()) { maxWidth = gfx_get_string_width(buffer, fontSpriteBase); } - return *maxWidth; + return maxWidth.value(); } /** @@ -829,11 +829,11 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view auto codepoint = *it; if (ShouldUseSpriteForCodepoint(codepoint)) { - if (ttfRunIndex) + if (ttfRunIndex.has_value()) { // Draw the TTF run - auto len = it.GetIndex() - *ttfRunIndex; - ttf_draw_string_raw_ttf(dpi, text.substr(*ttfRunIndex, len), info); + auto len = it.GetIndex() - ttfRunIndex.value(); + ttf_draw_string_raw_ttf(dpi, text.substr(ttfRunIndex.value(), len), info); ttfRunIndex = std::nullopt; } @@ -842,18 +842,18 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view } else { - if (!ttfRunIndex) + if (!ttfRunIndex.has_value()) { ttfRunIndex = it.GetIndex(); } } } - if (ttfRunIndex) + if (ttfRunIndex.has_value()) { // Final TTF run auto len = text.size() - *ttfRunIndex; - ttf_draw_string_raw_ttf(dpi, text.substr(*ttfRunIndex, len), info); + ttf_draw_string_raw_ttf(dpi, text.substr(ttfRunIndex.value(), len), info); } } #endif // NO_TTF diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 0894323ff4..96b51b7f84 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -750,9 +750,9 @@ std::optional GetPaletteG1Index(colour_t paletteId) std::optional GetPaletteMapForColour(colour_t paletteId) { auto g1Index = GetPaletteG1Index(paletteId); - if (g1Index) + if (g1Index.has_value()) { - auto g1 = gfx_get_g1_element(*g1Index); + auto g1 = gfx_get_g1_element(g1Index.value()); if (g1 != nullptr) { return PaletteMap(g1->offset, g1->height, g1->width); diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 3afc9e1bb2..9cbbcdcf77 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -703,8 +703,9 @@ void X8DrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int32_t // Find colour in colour table? auto paletteMap = GetPaletteMapForColour(EnumValue(palette)); - if (paletteMap) + if (paletteMap.has_value()) { + const auto& paletteEntries = paletteMap.value(); const int32_t scaled_width = width / dpi->zoom_level; const int32_t step = ((dpi->width / dpi->zoom_level) + dpi->pitch); @@ -716,7 +717,7 @@ void X8DrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int32_t for (int32_t j = 0; j < scaled_width; j++) { auto index = *(nextdst + j); - *(nextdst + j) = (*paletteMap)[index]; + *(nextdst + j) = paletteEntries[index]; } } } diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 850a23b84f..972dbc0f49 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -161,14 +161,14 @@ std::string screenshot_dump_png(rct_drawpixelinfo* dpi) // Get a free screenshot path auto path = screenshot_get_next_path(); - if (path == std::nullopt) + if (!path.has_value()) { return ""; } - if (WriteDpiToFile(path->c_str(), dpi, gPalette)) + if (WriteDpiToFile(path.value(), dpi, gPalette)) { - return *path; + return path.value(); } else { @@ -180,7 +180,7 @@ std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* { auto path = screenshot_get_next_path(); - if (path == std::nullopt) + if (!path.has_value()) { return ""; } @@ -196,8 +196,8 @@ std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* image.Depth = 32; image.Stride = width * 4; image.Pixels = std::vector(pixels8, pixels8 + pixelsLen); - Imaging::WriteToFile(path->c_str(), image, IMAGE_FORMAT::PNG_32); - return *path; + Imaging::WriteToFile(path.value(), image, IMAGE_FORMAT::PNG_32); + return path.value(); } catch (const std::exception& e) { @@ -384,7 +384,7 @@ void screenshot_giant() try { auto path = screenshot_get_next_path(); - if (path == std::nullopt) + if (!path.has_value()) { throw std::runtime_error("Giant screenshot failed, unable to find a suitable destination path."); } @@ -412,7 +412,7 @@ void screenshot_giant() dpi = CreateDPI(viewport); RenderViewport(nullptr, viewport, dpi); - WriteDpiToFile(path->c_str(), &dpi, gPalette); + WriteDpiToFile(path.value(), &dpi, gPalette); // Show user that screenshot saved successfully Formatter ft; @@ -792,7 +792,7 @@ static std::string ResolveFilenameForCapture(const fs::path& filename) void CaptureImage(const CaptureOptions& options) { rct_viewport viewport{}; - if (options.View) + if (options.View.has_value()) { viewport.width = options.View->Width; viewport.height = options.View->Height; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 72ded2585a..86f2b4ec10 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -186,7 +186,7 @@ void viewport_create( } auto centreLoc = centre_2d_coordinates(centrePos, viewport); - if (!centreLoc) + if (!centreLoc.has_value()) { log_error("Invalid location for viewport."); return; @@ -597,9 +597,9 @@ void viewport_update_position(rct_window* window) if (at_map_edge) { auto centreLoc = centre_2d_coordinates({ mapCoord, 0 }, viewport); - if (centreLoc) + if (centreLoc.has_value()) { - window->savedViewPos = *centreLoc; + window->savedViewPos = centreLoc.value(); } } @@ -658,7 +658,7 @@ void viewport_update_sprite_follow(rct_window* window) viewport_set_underground_flag(underground, window, window->viewport); auto centreLoc = centre_2d_coordinates({ sprite->x, sprite->y, sprite->z }, window->viewport); - if (centreLoc) + if (centreLoc.has_value()) { window->savedViewPos = *centreLoc; viewport_move(*centreLoc, window, window->viewport); @@ -1080,7 +1080,7 @@ static void viewport_paint_weather_gloom(rct_drawpixelinfo* dpi) std::optional screen_pos_to_map_pos(const ScreenCoordsXY& screenCoords, int32_t* direction) { auto mapCoords = screen_get_map_xy(screenCoords, nullptr); - if (!mapCoords) + if (!mapCoords.has_value()) return std::nullopt; int32_t my_direction; @@ -1613,9 +1613,9 @@ static bool is_sprite_interacted_with(rct_drawpixelinfo* dpi, int32_t imageId, c { index &= 0x1F; } - if (auto pm = GetPaletteMapForColour(index)) + if (auto pm = GetPaletteMapForColour(index); pm.has_value()) { - paletteMap = *pm; + paletteMap = pm.value(); } } else @@ -1865,7 +1865,7 @@ std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoo std::optional screen_get_map_xy_quadrant(const ScreenCoordsXY& screenCoords, uint8_t* quadrant) { auto mapCoords = screen_get_map_xy(screenCoords, nullptr); - if (!mapCoords) + if (!mapCoords.has_value()) return std::nullopt; *quadrant = map_get_tile_quadrant(*mapCoords); @@ -1879,7 +1879,7 @@ std::optional screen_get_map_xy_quadrant(const ScreenCoordsXY& screenC std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* quadrant) { auto mapCoords = screen_get_map_xy_with_z(screenCoords, z); - if (!mapCoords) + if (!mapCoords.has_value()) return std::nullopt; *quadrant = map_get_tile_quadrant(*mapCoords); @@ -1893,7 +1893,7 @@ std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& std::optional screen_get_map_xy_side(const ScreenCoordsXY& screenCoords, uint8_t* side) { auto mapCoords = screen_get_map_xy(screenCoords, nullptr); - if (!mapCoords) + if (!mapCoords.has_value()) return std::nullopt; *side = map_get_tile_side(*mapCoords); @@ -1907,7 +1907,7 @@ std::optional screen_get_map_xy_side(const ScreenCoordsXY& screenCoord std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int32_t z, uint8_t* side) { auto mapCoords = screen_get_map_xy_with_z(screenCoords, z); - if (!mapCoords) + if (!mapCoords.has_value()) return std::nullopt; *side = map_get_tile_side(*mapCoords); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 4e2c6aa70d..82a8f009c8 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -909,7 +909,7 @@ void window_rotate_camera(rct_window* w, int32_t direction) // 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 || other != viewport) + if (!mapXYCoords.has_value() || other != viewport) { auto viewPos = ScreenCoordsXY{ (viewport->view_width >> 1), (viewport->view_height >> 1) } + viewport->viewPos; @@ -926,9 +926,9 @@ void window_rotate_camera(rct_window* w, int32_t direction) auto centreLoc = centre_2d_coordinates(coords, viewport); - if (centreLoc) + if (centreLoc.has_value()) { - w->savedViewPos = *centreLoc; + w->savedViewPos = centreLoc.value(); viewport->viewPos = *centreLoc; } @@ -976,7 +976,7 @@ void window_viewport_centre_tile_around_cursor(rct_window* w, int32_t map_x, int int32_t z = tile_element_height({ map_x, map_y }); auto centreLoc = centre_2d_coordinates({ map_x, map_y, z }, w->viewport); - if (!centreLoc) + if (!centreLoc.has_value()) { log_error("Invalid location."); return; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index a2cb4da7a2..d2a01bb1ff 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -1416,7 +1416,7 @@ std::vector NetworkBase::save_for_network(const std::vector(data), size); - if (compressed != std::nullopt) + if (compressed.has_value()) { std::string headerString = "open2_sv6_zlib"; header.resize(headerString.size() + 1 + compressed->size()); diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 7c7fd8a417..80710834e2 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -196,9 +196,9 @@ uint64_t ObjectAsset::GetSize() const if (zipArchive != nullptr) { auto index = zipArchive->GetIndexFromPath(_path); - if (index) + if (index.has_value()) { - auto size = zipArchive->GetFileSize(*index); + auto size = zipArchive->GetFileSize(index.value()); return size; } } diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 1651bc3cbf..c823f2f4a9 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -372,17 +372,17 @@ private: { slot = FindSpareSlot(objectType); } - if (slot) + if (slot.has_value()) { auto* object = GetOrLoadObject(ori); if (object != nullptr) { if (_loadedObjects.size() <= static_cast(*slot)) { - _loadedObjects.resize(*slot + 1); + _loadedObjects.resize(slot.value() + 1); } loadedObject = object; - _loadedObjects[*slot] = object; + _loadedObjects[slot.value()] = object; UpdateSceneryGroupIndexes(); ResetTypeToRideEntryIndexMap(); } diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 166245d8b1..88bf42acbc 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -85,9 +85,9 @@ void SceneryGroupObject::UpdateEntryIndexes() Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE); auto sceneryType = ori->ObjectEntry.GetSceneryType(); - if (sceneryType != std::nullopt) + if (sceneryType.has_value()) { - _legacyType.scenery_entries[_legacyType.entry_count] = { *sceneryType, entryIndex }; + _legacyType.scenery_entries[_legacyType.entry_count] = { sceneryType.value(), entryIndex }; _legacyType.entry_count++; } } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 2e3a2da226..4c91c65cd7 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -3411,7 +3411,7 @@ void Guest::UpdateRideAtEntrance() if (DestinationTolerance != 0) { int16_t xy_distance; - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { int16_t actionZ = z; if (xy_distance < 16) @@ -3419,7 +3419,7 @@ void Guest::UpdateRideAtEntrance() auto entrance = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZ(); actionZ = entrance.z + 2; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); } else { @@ -3600,7 +3600,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() auto ride_entry = ride->GetRideEntry(); - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { uint16_t distanceThreshold = 16; if (ride_entry != nullptr) @@ -3626,7 +3626,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -3978,9 +3978,9 @@ void Guest::UpdateRideFreeVehicleCheck() void Guest::UpdateRideApproachVehicle() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } RideSubState = PeepRideSubState::EnterVehicle; @@ -4310,9 +4310,9 @@ static void peep_update_ride_prepare_for_exit(Peep* peep) */ void Guest::UpdateRideApproachExit() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4331,19 +4331,19 @@ void Guest::UpdateRideInExit() int16_t xy_distance; - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { if (xy_distance >= 16) { int16_t actionZ = ride->stations[CurrentRideStation].GetBaseZ(); actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } SwitchToSpecialSprite(0); - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) @@ -4370,7 +4370,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() int16_t xy_distance; uint8_t waypoint = Var37 & 3; - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { int16_t actionZ; // Motion simulators have steps this moves the peeps up the steps @@ -4394,7 +4394,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() { actionZ = z; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -4448,7 +4448,7 @@ void Guest::UpdateRideApproachExitWaypoints() int16_t xy_distance; - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { int16_t actionZ; if (ride->type == RIDE_TYPE_MOTION_SIMULATOR) @@ -4467,7 +4467,7 @@ void Guest::UpdateRideApproachExitWaypoints() { actionZ = z; } - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -4543,9 +4543,9 @@ void Guest::UpdateRideApproachSpiralSlide() if (ride == nullptr) return; - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4676,9 +4676,9 @@ void Guest::UpdateRideOnSpiralSlide() } } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4702,9 +4702,9 @@ void Guest::UpdateRideLeaveSpiralSlide() { // Iterates through the spiral slide waypoints until it reaches // waypoint 0. Then it readies to leave the ride by the entrance. - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4775,9 +4775,9 @@ static constexpr const uint8_t _MazeCurrentDirectionToOpenHedge[][4] = { */ void Guest::UpdateRideMazePathfinding() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -4897,9 +4897,9 @@ void Guest::UpdateRideMazePathfinding() break; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } } @@ -4912,11 +4912,11 @@ void Guest::UpdateRideLeaveExit() { auto ride = get_ride(CurrentRide); - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { if (ride != nullptr) { - MoveTo({ *loc, ride->stations[CurrentRideStation].GetBaseZ() }); + MoveTo({ loc.value(), ride->stations[CurrentRideStation].GetBaseZ() }); } return; } @@ -4961,9 +4961,9 @@ void Guest::UpdateRideLeaveExit() */ void Guest::UpdateRideShopApproach() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } @@ -5027,9 +5027,9 @@ void Guest::UpdateRideShopInteract() */ void Guest::UpdateRideShopLeave() { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); if ((x & 0xFFE0) != NextLoc.x) return; @@ -5577,9 +5577,9 @@ void Guest::UpdateEnteringPark() } return; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } SetState(PeepState::Falling); @@ -5608,9 +5608,9 @@ void Guest::UpdateLeavingPark() return; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 7b1d0e5b3e..1ab1132cb0 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -2297,7 +2297,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) } std::optional loc; - if (!(loc = UpdateAction())) + if (loc = UpdateAction(); !loc.has_value()) { pathing_result |= PATHING_DESTINATION_REACHED; uint8_t result = 0; @@ -2315,7 +2315,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) if (result != 0) return; - if (!(loc = UpdateAction())) + if (loc = UpdateAction(); !loc.has_value()) return; } diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 3cf1d8dafe..cbc6e23b91 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1150,10 +1150,10 @@ void Staff::UpdateMowing() while (true) { - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { int16_t checkZ = tile_element_height(*loc); - MoveTo({ *loc, checkZ }); + MoveTo({ loc.value(), checkZ }); return; } @@ -1348,10 +1348,10 @@ void Staff::UpdateSweeping() StaffLitterSwept++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { int16_t actionZ = GetZOnSlope((*loc).x, (*loc).y); - MoveTo({ *loc, actionZ }); + MoveTo({ loc.value(), actionZ }); return; } @@ -1453,7 +1453,7 @@ void Staff::UpdateHeadingToInspect() } int16_t delta_y = abs(GetLocation().y - GetDestination().y); - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ(); @@ -1462,7 +1462,7 @@ void Staff::UpdateHeadingToInspect() newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, newZ }); + MoveTo({ loc.value(), newZ }); return; } @@ -1562,7 +1562,7 @@ void Staff::UpdateAnswering() } int16_t delta_y = abs(y - GetDestination().y); - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ(); @@ -1571,7 +1571,7 @@ void Staff::UpdateAnswering() newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, newZ }); + MoveTo({ loc.value(), newZ }); return; } @@ -2155,9 +2155,9 @@ bool Staff::UpdateFixingMoveToBrokenDownVehicle(bool firstRun, const Ride* ride) SetDestination(destination, 2); } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return false; } @@ -2305,9 +2305,9 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride) SetDestination(stationPos, 2); } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return false; } @@ -2411,9 +2411,9 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride) SetDestination(destination, 2); } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return false; } @@ -2524,9 +2524,9 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride) SetDestination(stationPosition, 2); } - if (auto loc = UpdateAction()) + if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ *loc, z }); + MoveTo({ loc.value(), z }); return false; } else @@ -2608,7 +2608,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride) } int16_t xy_distance; - if (auto loc = UpdateAction(xy_distance)) + if (auto loc = UpdateAction(xy_distance); loc.has_value()) { uint16_t stationHeight = ride->stations[CurrentRideStation].GetBaseZ(); @@ -2617,7 +2617,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride) stationHeight += ride->GetRideTypeDescriptor().Heights.PlatformHeight; } - MoveTo({ *loc, stationHeight }); + MoveTo({ loc.value(), stationHeight }); return false; } SetState(PeepState::Falling); diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index c1768fece5..69076260b0 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -85,9 +85,9 @@ static bool UploadMinidump(const std::map& files, in } auto assertMsg = Guard::GetLastAssertMessage(); - if (assertMsg) + if (assertMsg.has_value()) { - parameters[L"assert_failure"] = String::ToWideChar(*assertMsg); + parameters[L"assert_failure"] = String::ToWideChar(assertMsg.value()); } int timeout = 10000; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index bd9def7a5c..af331393da 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -869,9 +869,9 @@ namespace RCT1 { // Original RCT had no music settings, take default style auto style = GetStyleFromMusicIdentifier(GetRideTypeDescriptor(dst->type).DefaultMusic); - if (style) + if (style.has_value()) { - dst->music = *style; + dst->music = style.value(); } // Only merry-go-round and dodgems had music and used diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 8952fc624f..7a51974b18 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -612,9 +612,9 @@ void S6Exporter::ExportParkName() { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto stringId = AllocateUserString(park.Name); - if (stringId != std::nullopt) + if (stringId.has_value()) { - _s6.park_name = *stringId; + _s6.park_name = stringId.value(); _s6.park_name_args = 0; } else @@ -672,9 +672,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src) { // Custom name, allocate user string for ride auto stringId = AllocateUserString(src->custom_name); - if (stringId != std::nullopt) + if (stringId.has_value()) { - dst->name = *stringId; + dst->name = stringId.value(); dst->name_arguments = 0; useDefaultName = false; } @@ -1426,9 +1426,9 @@ void S6Exporter::ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src) if (src->Name != nullptr) { auto stringId = AllocateUserString(src->Name); - if (stringId != std::nullopt) + if (stringId.has_value()) { - dst->name_string_idx = *stringId; + dst->name_string_idx = stringId.value(); generateName = false; } else @@ -1718,9 +1718,9 @@ void S6Exporter::ExportBanner(RCT12Banner& dst, const Banner& src) bannerText.append(src.text); auto stringId = AllocateUserString(bannerText); - if (stringId != std::nullopt) + if (stringId.has_value()) { - dst.string_idx = *stringId; + dst.string_idx = stringId.value(); } if (src.flags & BANNER_FLAG_LINKED_TO_RIDE) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9975a6b51e..698d455d41 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2868,8 +2868,8 @@ static void ride_set_boat_hire_return_point(Ride* ride, CoordsXYE* startElement) trackType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); auto newCoords = GetTrackElementOriginAndApplyChanges( { trackCoords, static_cast(direction) }, trackType, 0, &returnPos.element, 0); - returnPos = newCoords == std::nullopt ? CoordsXYE{ trackCoords, returnPos.element } - : CoordsXYE{ *newCoords, returnPos.element }; + returnPos = !newCoords.has_value() ? CoordsXYE{ trackCoords, returnPos.element } + : CoordsXYE{ *newCoords, returnPos.element }; }; trackType = returnPos.element->AsTrack()->GetTrackType(); @@ -4855,7 +4855,7 @@ static std::optional ride_get_smallest_station_length(Ride* ride) { if (!station.Start.IsNull()) { - if (!result.has_value() || station.Length < *result) + if (!result.has_value() || station.Length < result.value()) { result = station.Length; } @@ -4968,7 +4968,7 @@ void Ride::UpdateMaxVehicles() if (!stationNumTiles.has_value()) return; - auto stationLength = (*stationNumTiles * 0x44180) - 0x16B2A; + auto stationLength = (stationNumTiles.value() * 0x44180) - 0x16B2A; int32_t maxMass = GetRideTypeDescriptor().MaxMass << 8; int32_t maxCarsPerTrain = 1; for (int32_t numCars = rideEntry->max_cars_in_train; numCars > 0; numCars--) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 722bea5ecc..b48053cc75 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -752,7 +752,7 @@ void ride_select_next_section() TileElement* tileElement; auto newCoords = GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { _rideConstructionState = RideConstructionState::State0; window_ride_construction_update_active_elements(); @@ -1037,12 +1037,12 @@ bool ride_modify(CoordsXYE* input) auto direction = tileElement.element->GetDirection(); auto type = tileElement.element->AsTrack()->GetTrackType(); auto newCoords = GetTrackElementOriginAndApplyChanges({ tileCoords, direction }, type, 0, nullptr, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) return false; _currentRideIndex = rideIndex; _rideConstructionState = RideConstructionState::Selected; - _currentTrackBegin = *newCoords; + _currentTrackBegin = newCoords.value(); _currentTrackPieceDirection = direction; _currentTrackPieceType = type; _currentTrackSelectionFlags = 0; @@ -1281,7 +1281,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC auto stationBaseZ = ride->stations[gRideEntranceExitPlaceStationIndex].GetBaseZ(); auto coordsAtHeight = screen_get_map_xy_with_z(screenCoords, stationBaseZ); - if (!coordsAtHeight) + if (!coordsAtHeight.has_value()) { entranceExitCoords.SetNull(); return entranceExitCoords; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 3cbc658e65..9e80677c12 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -179,7 +179,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) auto newCoords = GetTrackElementOriginAndApplyChanges( { trackElement, z, direction }, trackType, 0, &trackElement.element, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; } @@ -236,7 +236,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) newCoords = GetTrackElementOriginAndApplyChanges( { trackElement, z, direction }, trackType, 0, &trackElement.element, 0); - if (newCoords == std::nullopt) + if (!newCoords.has_value()) { break; } diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index a345852212..eba7b9031a 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -246,7 +246,7 @@ static void track_design_save_add_large_scenery(const CoordsXY& loc, LargeScener auto sceneryOrigin = map_large_scenery_get_origin( { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); - if (!sceneryOrigin) + if (!sceneryOrigin.has_value()) { return; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index a13689a586..9551f0847f 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -2340,7 +2340,7 @@ void Vehicle::UpdateWaitingForPassengers() } auto trainIndex = ride_get_train_index_from_vehicle(curRide, sprite_index); - if (!trainIndex) + if (!trainIndex.has_value()) { return; } @@ -2348,7 +2348,7 @@ void Vehicle::UpdateWaitingForPassengers() if (curRide->stations[current_station].TrainAtStation != RideStation::NO_TRAIN) return; - curRide->stations[current_station].TrainAtStation = *trainIndex; + curRide->stations[current_station].TrainAtStation = trainIndex.value(); sub_state = 1; time_waiting = 0; @@ -3607,12 +3607,12 @@ void Vehicle::UpdateCollisionSetup() { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(curRide, frontVehicle->sprite_index); - if (!trainIndex) + if (!trainIndex.has_value()) { return; } - curRide->Crash(*trainIndex); + curRide->Crash(trainIndex.value()); if (curRide->status != RideStatus::Closed) { @@ -5382,12 +5382,12 @@ void Vehicle::CrashOnLand() { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(curRide, frontVehicle->sprite_index); - if (!trainIndex) + if (!trainIndex.has_value()) { return; } - curRide->Crash(*trainIndex); + curRide->Crash(trainIndex.value()); if (curRide->status != RideStatus::Closed) { @@ -5448,12 +5448,12 @@ void Vehicle::CrashOnWater() { auto frontVehicle = GetHead(); auto trainIndex = ride_get_train_index_from_vehicle(curRide, frontVehicle->sprite_index); - if (!trainIndex) + if (!trainIndex.has_value()) { return; } - curRide->Crash(*trainIndex); + curRide->Crash(trainIndex.value()); if (curRide->status != RideStatus::Closed) { diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 90aed63694..9bfe2b68c7 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -83,10 +83,10 @@ void MoneyEffect::Create(money64 value, const CoordsXYZ& loc) rct_viewport* mainViewport = window_get_viewport(mainWindow); auto mapPositionXY = screen_get_map_xy( { mainViewport->pos.x + (mainViewport->width / 2), mainViewport->pos.y + (mainViewport->height / 2) }, nullptr); - if (!mapPositionXY) + if (!mapPositionXY.has_value()) return; - offsetLoc = { *mapPositionXY, tile_element_height(*mapPositionXY) }; + offsetLoc = { mapPositionXY.value(), tile_element_height(*mapPositionXY) }; } offsetLoc.z += 10; CreateAt(-value, offsetLoc, false); From 1dde081468cfb983820f1f0f032f14f5af18ed6c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 7 Aug 2021 12:54:13 +0200 Subject: [PATCH 394/681] Bump Xcode deployment target to macOS 10.14 --- OpenRCT2.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index b42fb62b82..647207345e 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -4532,7 +4532,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -4541,7 +4541,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -4598,7 +4598,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_NO_PIE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -4656,7 +4656,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_NO_PIE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; @@ -4697,7 +4697,7 @@ "$(PROJECT_DIR)/libxc/lib", "$(PROJECT_DIR)/discord-rpc/build/src", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = io.openrct2.OpenRCT2; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -4738,7 +4738,7 @@ "$(PROJECT_DIR)/libxc/lib", "$(PROJECT_DIR)/discord-rpc/build/src", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_BUNDLE_IDENTIFIER = io.openrct2.OpenRCT2; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -4859,7 +4859,7 @@ "$(PROJECT_DIR)/libxc/lib", "$(PROJECT_DIR)/discord-rpc/build/src", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -4889,7 +4889,7 @@ "$(PROJECT_DIR)/libxc/lib", "$(PROJECT_DIR)/discord-rpc/build/src", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; From b35fd28c559a4c0bc241b9cbaeee6fa7106eb219 Mon Sep 17 00:00:00 2001 From: Kane Date: Mon, 2 Aug 2021 04:14:38 +1000 Subject: [PATCH 395/681] Feature #7682: Lock camera to vehicle in main window Pressing the "Locate" button in the Ride window when selected on a "Vehicle/Train" will now have the main viewport track the vehicle. --- data/language/en-GB.txt | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/windows/Guest.cpp | 55 ++++++++++- src/openrct2-ui/windows/Ride.cpp | 63 +++++++++++- src/openrct2-ui/windows/Staff.cpp | 135 ++++++++++++++++---------- src/openrct2/interface/Viewport.cpp | 3 +- src/openrct2/localisation/StringIds.h | 2 + 7 files changed, 202 insertions(+), 58 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index d78cd83530..e3c577fa64 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3655,6 +3655,7 @@ STR_6454 :Can’t rename banner… STR_6455 :Can’t rename sign… STR_6456 :Giant Screenshot STR_6457 :Report a bug on GitHub +STR_6458 :Follow this on Main View ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f1e4eab986..160dcffa53 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.3.4.1+ (in development) ------------------------------------------------------------------------ - Feature: [#3868] Initial support for using TTF in OpenGL mode (still contains bugs). +- Feature: [#7682] Follow ride/guest/staff in main window viewport. - Feature: [#13407] Allow building chain lifts on enclosed dinghy slide pieces when cheats are on. - Feature: [#15084] [Plugin] Add "vehicle.crash" hook. - Feature: [#15143] Added a shortcut key for Giant Screenshot. diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index cbdb074338..3d0d2565a9 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include @@ -148,6 +149,8 @@ static void window_guest_common_invalidate(rct_window* w); static void window_guest_overview_close(rct_window *w); static void window_guest_overview_resize(rct_window *w); static void window_guest_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex); +static void window_guest_overview_mouse_down(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); +static void window_guest_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); static void window_guest_overview_paint(rct_window *w, rct_drawpixelinfo *dpi); static void window_guest_overview_invalidate(rct_window *w); static void window_guest_overview_viewport_rotate(rct_window *w); @@ -156,6 +159,8 @@ static void window_guest_overview_text_input(rct_window *w, rct_widgetindex widg static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_guest_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex); +static void window_guest_follow(rct_window *w); +static void window_guest_show_locate_dropdown(rct_window* w, rct_widget* widget); static void window_guest_mouse_up(rct_window *w, rct_widgetindex widgetIndex); @@ -186,6 +191,8 @@ static rct_window_event_list window_guest_overview_events([](auto& events) { events.close = &window_guest_overview_close; events.mouse_up = &window_guest_overview_mouse_up; + events.mouse_down = &window_guest_overview_mouse_down; + events.dropdown = &window_guest_overview_dropdown; events.resize = &window_guest_overview_resize; events.update = &window_guest_overview_update; events.tool_update = &window_guest_overview_tool_update; @@ -606,9 +613,6 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex) w, widgetIndex, STR_GUEST_RENAME_TITLE, STR_GUEST_RENAME_PROMPT, {}, peepName.c_str(), 32); break; } - case WIDX_LOCATE: - w->ScrollToViewport(); - break; case WIDX_TRACK: { uint32_t flags = peep->PeepFlags ^ PEEP_FLAGS_TRACKING; @@ -620,6 +624,51 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex) } } +static void window_guest_overview_mouse_down(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) +{ + switch (widgetIndex) + { + case WIDX_LOCATE: + window_guest_show_locate_dropdown(w, widget); + break; + } +} + +static void window_guest_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) +{ + switch (widgetIndex) + { + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + w->ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + window_guest_follow(w); + } + break; + } + } +} + +static void window_guest_show_locate_dropdown(rct_window* w, rct_widget* widget) +{ + gDropdownItemsFormat[0] = STR_LOCATE_SUBJECT_TIP; + gDropdownItemsFormat[1] = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, 2); + gDropdownDefaultIndex = 0; +} + +static void window_guest_follow(rct_window* w) +{ + rct_window* w_main = window_get_main(); + window_follow_sprite(w_main, w->number); +} + /** * * rct2: 0x696AA0 diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index acab395266..b9358cd04e 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -537,6 +537,7 @@ static void window_ride_main_textinput(rct_window *w, rct_widgetindex widgetInde static void window_ride_main_viewport_rotate(rct_window *w); static void window_ride_main_invalidate(rct_window *w); static void window_ride_main_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_main_follow_ride(rct_window *w); static void window_ride_vehicle_mouseup(rct_window *w, rct_widgetindex widgetIndex); static void window_ride_vehicle_resize(rct_window *w); @@ -1766,9 +1767,6 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_RENAME: window_ride_rename(w); break; - case WIDX_LOCATE: - w->ScrollToViewport(); - break; case WIDX_DEMOLISH: context_open_detail_window(WD_DEMOLISH_RIDE, w->number); break; @@ -2064,6 +2062,49 @@ static void window_ride_show_ride_type_dropdown(rct_window* w, rct_widget* widge Dropdown::SetChecked(pos, true); } +static void window_ride_show_locate_dropdown(rct_window* w, rct_widget* widget) +{ + auto ride = get_ride(w->rideId); + if (ride == nullptr) + return; + + gDropdownItemsFormat[0] = STR_LOCATE_SUBJECT_TIP; + gDropdownItemsFormat[1] = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, 2); + gDropdownDefaultIndex = 0; + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + { + // Disable if we're a flat ride + Dropdown::SetDisabled(1, true); + } +} + +static void window_ride_main_follow_ride(rct_window* w) +{ + auto ride = get_ride(w->rideId); + if (ride != nullptr) + { + if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) + { + if (w->ride.view > 0) + { + if (w->ride.view <= ride->num_vehicles) + { + Vehicle* vehicle = GetEntity(ride->vehicles[w->ride.view - 1]); + if (vehicle != nullptr) + { + uint16_t headVehicleSpriteIndex = vehicle->sprite_index; + rct_window* w_main = window_get_main(); + window_follow_sprite(w_main, headVehicleSpriteIndex); + } + } + } + } + } +} + static void populate_vehicle_type_dropdown(Ride* ride) { auto& objManager = GetContext()->GetObjectManager(); @@ -2179,6 +2220,9 @@ static void window_ride_main_mousedown(rct_window* w, rct_widgetindex widgetInde case WIDX_RIDE_TYPE_DROPDOWN: window_ride_show_ride_type_dropdown(w, widget); break; + case WIDX_LOCATE: + window_ride_show_locate_dropdown(w, widget); + break; } } @@ -2263,6 +2307,19 @@ static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex GameActions::Execute(&rideSetSetting); } } + break; + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + w->ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + window_ride_main_follow_ride(w); + } + break; + } } } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index c6eb21d957..4545948c59 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -134,6 +134,8 @@ static void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetI static void window_staff_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex); static void window_staff_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text); static void window_staff_overview_viewport_rotate(rct_window *w); +static void window_staff_follow(rct_window *w); +static void window_staff_show_locate_dropdown(rct_window* w, rct_widget* widget); static void window_staff_options_mouseup(rct_window *w, rct_widgetindex widgetIndex); static void window_staff_options_update(rct_window* w); @@ -408,9 +410,6 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_TAB_3: window_staff_set_page(w, widgetIndex - WIDX_TAB_1); break; - case WIDX_LOCATE: - w->ScrollToViewport(); - break; case WIDX_PICKUP: { w->picked_peep_old_x = peep->x; @@ -509,30 +508,34 @@ void window_staff_overview_resize(rct_window* w) */ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - if (widgetIndex != WIDX_PATROL) + switch (widgetIndex) { - return; - } + case WIDX_LOCATE: + window_staff_show_locate_dropdown(w, widget); + break; + case WIDX_PATROL: + { + // Dropdown names + gDropdownItemsFormat[0] = STR_SET_PATROL_AREA; + gDropdownItemsFormat[1] = STR_CLEAR_PATROL_AREA; - // Dropdown names - gDropdownItemsFormat[0] = STR_SET_PATROL_AREA; - gDropdownItemsFormat[1] = STR_CLEAR_PATROL_AREA; + auto dropdownPos = ScreenCoordsXY{ widget->left + w->windowPos.x, widget->top + w->windowPos.y }; + int32_t extray = widget->height() + 1; + WindowDropdownShowText(dropdownPos, extray, w->colours[1], 0, 2); + gDropdownDefaultIndex = 0; - auto dropdownPos = ScreenCoordsXY{ widget->left + w->windowPos.x, widget->top + w->windowPos.y }; - int32_t extray = widget->height() + 1; - WindowDropdownShowText(dropdownPos, extray, w->colours[1], 0, 2); - gDropdownDefaultIndex = 0; + const auto peep = GetStaff(w); + if (peep == nullptr) + { + return; + } - const auto peep = GetStaff(w); - if (peep == nullptr) - { - return; - } - - // Disable clear patrol area if no area is set. - if (gStaffModes[peep->StaffId] != StaffMode::Patrol) - { - Dropdown::SetDisabled(1, true); + // Disable clear patrol area if no area is set. + if (gStaffModes[peep->StaffId] != StaffMode::Patrol) + { + Dropdown::SetDisabled(1, true); + } + } } } @@ -542,38 +545,68 @@ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex, */ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) { - if (widgetIndex != WIDX_PATROL) + switch (widgetIndex) { - return; - } + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + w->ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + window_staff_follow(w); + } + break; + } + case WIDX_PATROL: + { + // Clear patrol + if (dropdownIndex == 1) + { + const auto peep = GetStaff(w); + if (peep == nullptr) + { + return; + } + for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + { + gStaffPatrolAreas[peep->StaffId * STAFF_PATROL_AREA_SIZE + i] = 0; + } + assert(gStaffModes[peep->StaffId] == StaffMode::Patrol); + gStaffModes[peep->StaffId] = StaffMode::Walk; - // Clear patrol - if (dropdownIndex == 1) - { - const auto peep = GetStaff(w); - if (peep == nullptr) - { - return; + gfx_invalidate_screen(); + staff_update_greyed_patrol_areas(); + } + else + { + if (!tool_set(w, widgetIndex, Tool::WalkDown)) + { + show_gridlines(); + gStaffDrawPatrolAreas = w->number; + gfx_invalidate_screen(); + } + } + break; } - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[peep->StaffId * STAFF_PATROL_AREA_SIZE + i] = 0; - } - assert(gStaffModes[peep->StaffId] == StaffMode::Patrol); - gStaffModes[peep->StaffId] = StaffMode::Walk; + } +} - gfx_invalidate_screen(); - staff_update_greyed_patrol_areas(); - } - else - { - if (!tool_set(w, widgetIndex, Tool::WalkDown)) - { - show_gridlines(); - gStaffDrawPatrolAreas = w->number; - gfx_invalidate_screen(); - } - } +static void window_staff_show_locate_dropdown(rct_window* w, rct_widget* widget) +{ + gDropdownItemsFormat[0] = STR_LOCATE_SUBJECT_TIP; + gDropdownItemsFormat[1] = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, 2); + gDropdownDefaultIndex = 0; +} + +static void window_staff_follow(rct_window* w) +{ + rct_window* w_main = window_get_main(); + window_follow_sprite(w_main, w->number); } /** diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 72ded2585a..4133f90fc5 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -519,7 +519,8 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp // rct2: 0x006E7A15 static void viewport_set_underground_flag(int32_t underground, rct_window* window, rct_viewport* viewport) { - if (window->classification != WC_MAIN_WINDOW) + if (window->classification != WC_MAIN_WINDOW + || (window->classification == WC_MAIN_WINDOW && window->viewport_smart_follow_sprite != SPRITE_INDEX_NULL)) { if (!underground) { diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 66bf283cc2..67e5a98bfd 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3911,6 +3911,8 @@ enum STR_FILE_BUG_ON_GITHUB = 6457, + STR_FOLLOW_SUBJECT_TIP = 6458, + // 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 cf78d6841d580b9884820bf56a5e98bd7219c4ed Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 13 Sep 2021 23:24:57 +0200 Subject: [PATCH 396/681] return nullopt instead of {} --- src/openrct2-ui/input/ShortcutManager.cpp | 2 +- src/openrct2-ui/scripting/ScTitleSequence.hpp | 4 ++-- src/openrct2-ui/windows/Ride.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index d729ea8b30..7934d3d7f0 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -234,7 +234,7 @@ std::optional ShortcutManager::ConvertLegacyBinding(uint16_t bind if (binding == nullBinding) { - return {}; + return std::nullopt; } else { diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 5b158d176b..5c53bd8c67 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -248,7 +248,7 @@ namespace OpenRCT2::Scripting return i; } } - return {}; + return std::nullopt; } }; @@ -489,7 +489,7 @@ namespace OpenRCT2::Scripting return i; } } - return {}; + return std::nullopt; } const TitleSequenceManagerItem* GetItem() const diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b9358cd04e..9b877ca0dc 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1556,12 +1556,12 @@ static std::optional GetStationIndexFromViewSelection(const rct_wi { const auto* ride = get_ride(static_cast(w.number)); if (ride == nullptr) - return {}; + return std::nullopt; int32_t viewSelectionIndex = w.ride.view - 1 - ride->num_vehicles; if (viewSelectionIndex < 0) { - return {}; + return std::nullopt; } for (StationIndex index = 0; index < sizeof(ride->stations); ++index) @@ -1575,7 +1575,7 @@ static std::optional GetStationIndexFromViewSelection(const rct_wi } } } - return {}; + return std::nullopt; } /** From 2af5e0dc8224b13f46d647b0c601882da1a74077 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 13 Sep 2021 23:25:33 +0200 Subject: [PATCH 397/681] Remove unnecessary else block --- src/openrct2-ui/input/ShortcutManager.cpp | 28 +++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index 7934d3d7f0..6741ad08e3 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -236,21 +236,19 @@ std::optional ShortcutManager::ConvertLegacyBinding(uint16_t bind { return std::nullopt; } - else - { - ShortcutInput result; - result.Kind = InputDeviceKind::Keyboard; - if (binding & shift) - result.Modifiers |= KMOD_SHIFT; - if (binding & ctrl) - result.Modifiers |= KMOD_CTRL; - if (binding & alt) - result.Modifiers |= KMOD_ALT; - if (binding & cmd) - result.Modifiers |= KMOD_GUI; - result.Button = SDL_GetKeyFromScancode(static_cast(binding & 0xFF)); - return result; - } + + ShortcutInput result; + result.Kind = InputDeviceKind::Keyboard; + if (binding & shift) + result.Modifiers |= KMOD_SHIFT; + if (binding & ctrl) + result.Modifiers |= KMOD_CTRL; + if (binding & alt) + result.Modifiers |= KMOD_ALT; + if (binding & cmd) + result.Modifiers |= KMOD_GUI; + result.Button = SDL_GetKeyFromScancode(static_cast(binding & 0xFF)); + return result; } void ShortcutManager::LoadLegacyBindings(const fs::path& path) From 2ed7c217bfeb47ce19877ec993b00f13c5366782 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 13 Sep 2021 23:26:14 +0200 Subject: [PATCH 398/681] Remove local instances of std::optional --- src/openrct2-ui/scripting/ScTileSelection.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/scripting/ScTileSelection.hpp b/src/openrct2-ui/scripting/ScTileSelection.hpp index 850d180378..365c99f91c 100644 --- a/src/openrct2-ui/scripting/ScTileSelection.hpp +++ b/src/openrct2-ui/scripting/ScTileSelection.hpp @@ -139,7 +139,6 @@ namespace OpenRCT2::Scripting private: static std::optional GetCoordsXY(const DukValue& dukCoords) { - std::optional result; if (dukCoords.type() == DukValue::Type::OBJECT) { auto dukX = dukCoords["x"]; @@ -148,16 +147,15 @@ namespace OpenRCT2::Scripting auto dukY = dukCoords["y"]; if (dukY.type() == DukValue::Type::NUMBER) { - result = { dukX.as_int(), dukY.as_int() }; + return CoordsXY(dukX.as_int(), dukY.as_int()); } } } - return result; + return std::nullopt; } static std::optional GetMapRange(const DukValue& dukMapRange) { - std::optional result; if (dukMapRange.type() == DukValue::Type::OBJECT) { auto leftTop = GetCoordsXY(dukMapRange["leftTop"]); @@ -166,11 +164,11 @@ namespace OpenRCT2::Scripting auto rightBottom = GetCoordsXY(dukMapRange["rightBottom"]); if (rightBottom.has_value()) { - result = MapRange(leftTop->x, leftTop->y, rightBottom->x, rightBottom->y); + return MapRange(leftTop->x, leftTop->y, rightBottom->x, rightBottom->y); } } } - return result; + return std::nullopt; } }; } // namespace OpenRCT2::Scripting From 3f8f78ac8f5795c5105798de9c35f9f01dc80b94 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 14 Sep 2021 04:11:10 +0000 Subject: [PATCH 399/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ko-KR.txt | 1 + data/language/pt-BR.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 06f8c104de..7d0be43e29 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -3657,6 +3657,7 @@ STR_6453 :버전 정보 복사 STR_6454 :팻말 이름을 변경할 수 없습니다… STR_6455 :팻말 이름을 변경할 수 없습니다… STR_6456 :초대형 스크린 샷 +STR_6457 :GitHub에 버그 제보 ############# # Scenarios # diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 78ac8aaa3e..ab507675e4 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -3655,6 +3655,7 @@ STR_6454 :Não é possível renomear o banner… STR_6455 :Não é possível renomear a placa… STR_6456 :Captura Gigante de Tela STR_6457 :Relatar um problema pelo GitHub +STR_6458 :Seguir isto na Visão Principal ############# # Scenarios # From 687b6c000e8c7bdea9f1c13ca05902e29bfce350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:21:18 -0700 Subject: [PATCH 400/681] Apply review suggestion Co-authored-by: Tulio Leao Co-authored-by: Hielke Morsink --- src/openrct2/ride/Ride.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 698d455d41..337f269f5e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2868,8 +2868,8 @@ static void ride_set_boat_hire_return_point(Ride* ride, CoordsXYE* startElement) trackType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); auto newCoords = GetTrackElementOriginAndApplyChanges( { trackCoords, static_cast(direction) }, trackType, 0, &returnPos.element, 0); - returnPos = !newCoords.has_value() ? CoordsXYE{ trackCoords, returnPos.element } - : CoordsXYE{ *newCoords, returnPos.element }; + returnPos = newCoords.has_value() ? CoordsXYE{ newCoords.value(), returnPos.element } + : CoordsXYE{ trackCoords, returnPos.element }; }; trackType = returnPos.element->AsTrack()->GetTrackType(); From 42254d774d96f8929d150b0f9066f5bb379afafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 12 Sep 2021 18:24:55 +0300 Subject: [PATCH 401/681] Allow game actions to store custom data instead of using inheritance --- src/openrct2-ui/windows/TopToolbar.cpp | 5 +++-- src/openrct2/actions/BannerPlaceAction.cpp | 24 ++-------------------- src/openrct2/actions/BannerPlaceAction.h | 10 ++------- src/openrct2/actions/GameAction.h | 15 ++++++++++++++ 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 2de7cecde5..a55bf14190 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1983,11 +1983,12 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos CoordsXYZD loc{ gridPos, z, direction }; auto primaryColour = gWindowSceneryPrimaryColour; auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, primaryColour); - bannerPlaceAction.SetCallback([=](const GameAction* ga, const BannerPlaceActionResult* result) { + 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); - context_open_detail_window(WD_BANNER, result->bannerId); + context_open_detail_window(WD_BANNER, data.bannerId); } }); GameActions::Execute(&bannerPlaceAction); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 88e6860d27..5fcc570d31 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -18,26 +18,6 @@ using namespace OpenRCT2; -BannerPlaceActionResult::BannerPlaceActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_CANT_POSITION_THIS_HERE) -{ -} - -BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err) - : GameActions::Result(err, STR_CANT_POSITION_THIS_HERE) -{ -} - -BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err, rct_string_id msg) - : GameActions::Result(err, STR_CANT_POSITION_THIS_HERE, msg) -{ -} - -BannerPlaceActionResult::BannerPlaceActionResult(GameActions::Status err, rct_string_id title, rct_string_id message) - : GameActions::Result(err, title, message) -{ -} - BannerPlaceAction::BannerPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex bannerType, colour_t primaryColour) : _loc(loc) , _bannerType(bannerType) @@ -117,6 +97,7 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); } res->Cost = bannerEntry->price; + return res; } @@ -155,8 +136,7 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const banner->colour = _primaryColour; banner->position = TileCoordsXY(_loc); - res->bannerId = banner->id; - + res->SetData(BannerPlaceActionResult{ banner->id }); auto* bannerElement = TileElementInsert({ _loc, _loc.z + (2 * COORDS_Z_STEP) }, 0b0000); Guard::Assert(bannerElement != nullptr); diff --git a/src/openrct2/actions/BannerPlaceAction.h b/src/openrct2/actions/BannerPlaceAction.h index c4195a18ca..5de3d37e82 100644 --- a/src/openrct2/actions/BannerPlaceAction.h +++ b/src/openrct2/actions/BannerPlaceAction.h @@ -11,18 +11,12 @@ #include "GameAction.h" -class BannerPlaceActionResult final : public GameActions::Result +struct BannerPlaceActionResult { -public: - BannerPlaceActionResult(); - BannerPlaceActionResult(GameActions::Status err); - BannerPlaceActionResult(GameActions::Status err, rct_string_id msg); - BannerPlaceActionResult(GameActions::Status err, rct_string_id title, rct_string_id message); - BannerIndex bannerId = BANNER_INDEX_NULL; }; -DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, BannerPlaceActionResult) +DEFINE_GAME_ACTION(BannerPlaceAction, GameCommand::PlaceBanner, GameActions::Result) { private: CoordsXYZD _loc; diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 856470f356..03ee95fe5f 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -16,6 +16,7 @@ #include "../localisation/StringIds.h" #include "../world/Map.h" +#include #include #include #include @@ -130,6 +131,7 @@ namespace GameActions CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL }; money32 Cost = 0; ExpenditureType Expenditure = ExpenditureType::Count; + std::any ResultData; Result() = default; Result(GameActions::Status error, rct_string_id message); @@ -140,6 +142,19 @@ namespace GameActions std::string GetErrorTitle() const; std::string GetErrorMessage() const; + + // It is recommended to use strong types since a type alias such as 'using MyType = uint32_t' + // is still just uint32_t, this guarantees the data is associated with the correct type. + template void SetData(const T&& data) + { + ResultData = std::forward(data); + } + + // This function will throw std::bad_any_cast if the type mismatches. + template T GetData() const + { + return std::any_cast(ResultData); + } }; class ConstructClearResult final : public Result From 1a35cdafb364fe5f94c0edfb4e763371c61b8208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 15 Sep 2021 08:25:55 +0200 Subject: [PATCH 402/681] Add limits include to Object.h (#15415) PPA builds seem to complain about this --- src/openrct2/object/Object.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 6d961edba4..a9e9ddf7cf 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -15,6 +15,7 @@ #include "ImageTable.h" #include "StringTable.h" +#include #include #include #include From bdab3219cb5110a11c4abc64bd11b6074ab8261c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 12 Sep 2021 21:25:22 +0200 Subject: [PATCH 403/681] Modify object loading for JSON-only objects --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/scripting/ScTitleSequence.hpp | 2 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 4 +- src/openrct2-ui/windows/InstallTrack.cpp | 4 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 90 +++++------- src/openrct2-ui/windows/TitleEditor.cpp | 2 +- src/openrct2-ui/windows/Window.h | 2 +- src/openrct2/Context.cpp | 9 +- src/openrct2/EditorObjectSelectionSession.cpp | 134 +++++++++-------- src/openrct2/EditorObjectSelectionSession.h | 3 +- src/openrct2/ParkImporter.h | 10 +- src/openrct2/ReplayManager.cpp | 2 +- src/openrct2/actions/TrackDesignAction.cpp | 40 +++-- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/object/BannerObject.h | 5 - src/openrct2/object/EntranceObject.h | 5 - src/openrct2/object/FootpathItemObject.h | 5 - src/openrct2/object/FootpathObject.h | 5 - src/openrct2/object/FootpathRailingsObject.h | 5 - src/openrct2/object/FootpathSurfaceObject.h | 5 - src/openrct2/object/LargeSceneryObject.h | 5 - src/openrct2/object/MusicObject.h | 5 - src/openrct2/object/Object.cpp | 138 ++++++++++++++++-- src/openrct2/object/Object.h | 80 +++++----- src/openrct2/object/ObjectFactory.cpp | 71 +++++---- src/openrct2/object/ObjectFactory.h | 3 +- src/openrct2/object/ObjectList.cpp | 137 +++++++++++++++-- src/openrct2/object/ObjectList.h | 39 +++++ src/openrct2/object/ObjectManager.cpp | 119 ++++++++------- src/openrct2/object/ObjectManager.h | 8 +- src/openrct2/object/ObjectRepository.cpp | 122 ++++++++-------- src/openrct2/object/ObjectRepository.h | 5 +- src/openrct2/object/RideObject.h | 5 - src/openrct2/object/SceneryGroupObject.h | 5 - src/openrct2/object/SceneryObject.h | 4 - src/openrct2/object/SmallSceneryObject.h | 5 - src/openrct2/object/StationObject.h | 5 - src/openrct2/object/TerrainEdgeObject.h | 5 - src/openrct2/object/TerrainSurfaceObject.h | 5 - src/openrct2/object/WallObject.h | 5 - src/openrct2/object/WaterObject.h | 5 - src/openrct2/platform/platform.h | 1 - src/openrct2/rct1/S4Importer.cpp | 15 +- src/openrct2/rct1/T4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 4 +- src/openrct2/rct2/S6Importer.cpp | 15 +- src/openrct2/rct2/T6Importer.cpp | 4 +- src/openrct2/ride/TrackDesign.cpp | 36 +++-- src/openrct2/ride/TrackDesign.h | 2 +- src/openrct2/ride/TrackDesignRepository.cpp | 2 +- src/openrct2/ride/TrackDesignSave.cpp | 8 +- 52 files changed, 706 insertions(+), 499 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 4b9366ecb1..be2ace022c 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -256,7 +256,7 @@ public: case WC_OBJECT_LOAD_ERROR: { std::string path = intent->GetStringExtra(INTENT_EXTRA_PATH); - const rct_object_entry* objects = static_cast(intent->GetPointerExtra(INTENT_EXTRA_LIST)); + auto objects = static_cast(intent->GetPointerExtra(INTENT_EXTRA_LIST)); size_t count = intent->GetUIntExtra(INTENT_EXTRA_LIST_COUNT); window_object_load_error_open(const_cast(path.c_str()), count, objects); diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 5c53bd8c67..0d9e80db33 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -210,7 +210,7 @@ namespace OpenRCT2::Scripting auto& objectMgr = GetContext()->GetObjectManager(); auto parkImporter = ParkImporter::Create(handle->HintPath); auto result = parkImporter->LoadFromStream(handle->Stream.get(), isScenario); - objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectMgr.LoadObjects(result.RequiredObjects); parkImporter->Import(); auto old = gLoadKeepWindowsOpen; diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 8a624e6bd1..e9271b8212 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -374,7 +374,7 @@ private: auto result = parkImporter->Load(path); auto& objectManager = GetContext()->GetObjectManager(); - objectManager.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectManager.LoadObjects(result.RequiredObjects); parkImporter->Import(); } @@ -413,7 +413,7 @@ private: auto result = parkImporter->LoadFromStream(stream, isScenario); auto& objectManager = GetContext()->GetObjectManager(); - objectManager.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectManager.LoadObjects(result.RequiredObjects); parkImporter->Import(); } diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 489f8e85ef..15aeeb1dd1 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -694,7 +694,7 @@ static void window_editor_object_selection_scroll_mousedown( if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - if (!window_editor_object_selection_select_object(0, INPUT_FLAG_EDITOR_OBJECT_SELECT, listItem->entry)) + if (!window_editor_object_selection_select_object(0, INPUT_FLAG_EDITOR_OBJECT_SELECT, listItem->repositoryItem)) return; // Close any other open windows such as options/colour schemes to prevent a crash. @@ -712,7 +712,7 @@ static void window_editor_object_selection_scroll_mousedown( flags |= INPUT_FLAG_EDITOR_OBJECT_SELECT; _maxObjectsWasHit = false; - if (!window_editor_object_selection_select_object(0, flags, listItem->entry)) + if (!window_editor_object_selection_select_object(0, flags, listItem->repositoryItem)) { rct_string_id error_title = (flags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 739e722b5f..bdf2613455 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -94,7 +94,7 @@ rct_window* window_install_track_open(const utf8* path) log_error("Failed to load track (ride type null): %s", path); return nullptr; } - if (object_manager_load_object(&_trackDesign->vehicle_object) == nullptr) + if (object_manager_load_object(&_trackDesign->vehicle_object.Entry) == nullptr) { log_error("Failed to load track (vehicle load fail): %s", path); return nullptr; @@ -242,7 +242,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi) { auto ft = Formatter(); - const auto* objectEntry = object_manager_load_object(&td6->vehicle_object); + const auto* objectEntry = object_manager_load_object(&td6->vehicle_object.Entry); if (objectEntry != nullptr) { auto groupIndex = object_manager_get_loaded_object_entry_index(objectEntry); diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 7c7ea87945..cf7f56037a 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -20,7 +20,9 @@ #include #include #include +#include #include +#include #include #include @@ -48,8 +50,8 @@ private: } }; - std::vector _entries; - std::vector _downloadedEntries; + std::vector _entries; + std::vector _downloadedEntries; size_t _currentDownloadIndex{}; std::mutex _downloadedEntriesMutex; std::mutex _queueMutex; @@ -64,7 +66,7 @@ private: inline static bool _downloadingObjects; public: - void Begin(const std::vector& entries) + void Begin(const std::vector& entries) { _lastDownloadStatusInfo = {}; _downloadStatusInfo = {}; @@ -80,7 +82,7 @@ public: return _downloadingObjects; } - std::vector GetDownloadedEntries() + std::vector GetDownloadedEntries() { std::lock_guard guard(_downloadedEntriesMutex); return _downloadedEntries; @@ -150,7 +152,7 @@ private: _nextDownloadQueued = true; } - void DownloadObject(const rct_object_entry& entry, const std::string& name, const std::string& url) + void DownloadObject(const ObjectEntryDescriptor& entry, const std::string& name, const std::string& url) { try { @@ -168,7 +170,7 @@ private: auto dataLen = response.body.size(); auto& objRepo = OpenRCT2::GetContext()->GetObjectRepository(); - objRepo.AddObjectFromFile(name, data, dataLen); + objRepo.AddObjectFromFile(ObjectGeneration::DAT, name, data, dataLen); std::lock_guard guard(_downloadedEntriesMutex); _downloadedEntries.push_back(entry); @@ -199,7 +201,7 @@ private: } auto& entry = _entries[_currentDownloadIndex]; - auto name = String::Trim(std::string(entry.name, sizeof(entry.name))); + auto name = String::Trim(std::string(entry.GetName())); log_verbose("Downloading object: [%s]:", name.c_str()); _currentDownloadIndex++; UpdateProgress({ name, _lastDownloadSource, _currentDownloadIndex, _entries.size() }); @@ -283,7 +285,7 @@ static rct_widget window_object_load_error_widgets[] = { { WIDGETS_END }, }; -static rct_string_id get_object_type_string(const rct_object_entry *entry); +static rct_string_id get_object_type_string(ObjectType type); static void window_object_load_error_close(rct_window *w); static void window_object_load_error_update(rct_window *w); static void window_object_load_error_mouseup(rct_window *w, rct_widgetindex widgetIndex); @@ -310,7 +312,7 @@ static rct_window_event_list window_object_load_error_events([](auto& events) }); // clang-format on -static std::vector _invalid_entries; +static std::vector _invalid_entries; static int32_t highlighted_index = -1; static std::string file_path; #ifndef DISABLE_HTTP @@ -324,10 +326,10 @@ static bool _updatedListAfterDownload; * Could possibly be moved out of the window file if other * uses exist and a suitable location is found. */ -static rct_string_id get_object_type_string(const rct_object_entry* entry) +static rct_string_id get_object_type_string(ObjectType type) { rct_string_id result; - switch (entry->GetType()) + switch (type) { case ObjectType::Ride: result = STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS; @@ -371,39 +373,21 @@ static rct_string_id get_object_type_string(const rct_object_entry* entry) */ static void copy_object_names_to_clipboard(rct_window* w) { - // Something has gone wrong, this shouldn't happen. - // We don't want to allocate stupidly large amounts of memory for no reason - assert(w->no_list_items > 0 && w->no_list_items <= OBJECT_ENTRY_COUNT); - - // No system has a newline over 2 characters - size_t line_sep_len = strnlen(PLATFORM_NEWLINE, 2); - size_t buffer_len = (w->no_list_items * (8 + line_sep_len)) + 1; - utf8* buffer = new utf8[buffer_len]{}; - - size_t cur_len = 0; + std::stringstream stream; for (uint16_t i = 0; i < w->no_list_items; i++) { - cur_len += (8 + line_sep_len); - assert(cur_len < buffer_len); - - uint16_t nameLength = 8; - for (; nameLength > 0; nameLength--) - { - if (_invalid_entries[i].name[nameLength - 1] != ' ') - break; - } - - strncat(buffer, _invalid_entries[i].name, nameLength); - strncat(buffer, PLATFORM_NEWLINE, buffer_len - strlen(buffer) - 1); + const auto& entry = _invalid_entries[i]; + stream << entry.GetName(); + stream << PLATFORM_NEWLINE; } - platform_place_string_on_clipboard(buffer); - delete[] buffer; + auto clip = stream.str(); + OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(clip.c_str()); } -rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const rct_object_entry* missingObjects) +rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { - _invalid_entries = std::vector(missingObjects, missingObjects + numMissingObjects); + _invalid_entries = std::vector(missingObjects, missingObjects + numMissingObjects); // Check if window is already open rct_window* window = window_bring_to_front_by_class(WC_OBJECT_LOAD_ERROR); @@ -476,14 +460,8 @@ static void window_object_load_error_mouseup(rct_window* w, rct_widgetindex widg case WIDX_COPY_CURRENT: if (w->selected_list_item > -1 && w->selected_list_item < w->no_list_items) { - utf8 selectedName[32]{}; - strncpy(selectedName, _invalid_entries[w->selected_list_item].name, 8); - - utf8* strp = strchr(selectedName, ' '); - if (strp != nullptr) - *strp = '\0'; - - platform_place_string_on_clipboard(selectedName); + auto name = std::string(_invalid_entries[w->selected_list_item].GetName()); + OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(name.c_str()); } break; case WIDX_COPY_ALL: @@ -580,16 +558,22 @@ static void window_object_load_error_scrollpaint(rct_window* w, rct_drawpixelinf // Draw the actual object entry's name... screenCoords.x = NAME_COL_LEFT - 3; - utf8 nameBuf[32]{}; - strncpy(nameBuf, _invalid_entries[i].name, 8); - gfx_draw_string(dpi, screenCoords, nameBuf, { COLOUR_DARK_GREEN }); + const auto& entry = _invalid_entries[i]; - // ... source game ... - rct_string_id sourceStringId = object_manager_get_source_game_string(_invalid_entries[i].GetSourceGame()); - DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); + auto name = entry.GetName(); + char buffer[256]; + String::Set(buffer, sizeof(buffer), name.data(), name.size()); + gfx_draw_string(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); + + if (entry.Generation == ObjectGeneration::DAT) + { + // ... source game ... + rct_string_id sourceStringId = object_manager_get_source_game_string(entry.Entry.GetSourceGame()); + DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); + } // ... and type - rct_string_id type = get_object_type_string(&_invalid_entries[i]); + rct_string_id type = get_object_type_string(entry.GetType()); DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); } } @@ -613,7 +597,7 @@ static void window_object_load_error_update_list(rct_window* w) _invalid_entries.erase( std::remove_if( _invalid_entries.begin(), _invalid_entries.end(), - [de](const rct_object_entry& e) { return std::memcmp(de.name, e.name, sizeof(e.name)) == 0; }), + [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), _invalid_entries.end()); w->no_list_items = static_cast(_invalid_entries.size()); } diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index fb29c329e9..0c5c782975 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -354,7 +354,7 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); auto parkImporter = ParkImporter::Create(handle->HintPath); auto result = parkImporter->LoadFromStream(handle->Stream.get(), isScenario); - objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectMgr.LoadObjects(result.RequiredObjects); parkImporter->Import(); if (isScenario) diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 0fb34b6ef9..408e5bda6c 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -163,7 +163,7 @@ void window_text_input_open( std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, std::function okCallback, std::function cancelCallback); -rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const rct_object_entry* missingObjects); +rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); rct_window* window_ride_construction_open(); void window_ride_construction_update_active_elements_impl(); diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 805e1a5657..d7bdaf38e5 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -644,7 +644,7 @@ namespace OpenRCT2 // so reload the title screen if that happens. loadTitleScreenFirstOnFail = true; - _objectManager->LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + _objectManager->LoadObjects(result.RequiredObjects); parkImporter->Import(); gScenarioSavePath = path; gCurrentLoadedPath = path; @@ -717,7 +717,7 @@ namespace OpenRCT2 // which the window function doesn't like auto intent = Intent(WC_OBJECT_LOAD_ERROR); intent.putExtra(INTENT_EXTRA_PATH, path); - intent.putExtra(INTENT_EXTRA_LIST, const_cast(e.MissingObjects.data())); + intent.putExtra(INTENT_EXTRA_LIST, const_cast(e.MissingObjects.data())); intent.putExtra(INTENT_EXTRA_LIST_COUNT, static_cast(e.MissingObjects.size())); auto windowManager = _uiContext->GetWindowManager(); @@ -1534,11 +1534,6 @@ utf8* platform_open_directory_browser(const utf8* title) } } -bool platform_place_string_on_clipboard(utf8* target) -{ - return GetContext()->GetUiContext()->SetClipboardText(target); -} - /** * This function is deprecated. * Use IPlatformEnvironment instead. diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index bafce4fc47..c74a861a48 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -55,8 +55,7 @@ static void setup_track_manager_objects() { uint8_t* selectionFlags = &_objectSelectionFlags[i]; const ObjectRepositoryItem* item = &items[i]; - ObjectType object_type = item->ObjectEntry.GetType(); - if (object_type == ObjectType::Ride) + if (item->Type == ObjectType::Ride) { *selectionFlags |= OBJECT_SELECTION_FLAG_6; @@ -85,8 +84,7 @@ static void setup_track_designer_objects() { uint8_t* selectionFlags = &_objectSelectionFlags[i]; const ObjectRepositoryItem* item = &items[i]; - ObjectType objectType = item->ObjectEntry.GetType(); - if (objectType == ObjectType::Ride) + if (item->Type == ObjectType::Ride) { *selectionFlags |= OBJECT_SELECTION_FLAG_6; @@ -259,7 +257,7 @@ void sub_6AB211() const ObjectRepositoryItem* items = object_repository_get_items(); for (int32_t i = 0; i < numObjects; i++) { - ObjectType objectType = items[i].ObjectEntry.GetType(); + ObjectType objectType = items[i].Type; _numAvailableObjectsForType[EnumValue(objectType)]++; } @@ -302,33 +300,40 @@ void editor_object_flags_free() * * rct2: 0x00685791 */ -static void remove_selected_objects_from_research(const rct_object_entry* installedObject) +static void remove_selected_objects_from_research(ObjectEntryDescriptor& descriptor) { - ObjectType entry_type; - ObjectEntryIndex entry_index; - if (!find_object_in_entry_group(installedObject, &entry_type, &entry_index)) - return; - - if (entry_type == ObjectType::Ride) + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = objManager.GetLoadedObject(descriptor); + if (obj != nullptr) { - auto rideEntry = get_ride_entry(entry_index); - - for (auto rideType : rideEntry->ride_type) + auto entryIndex = objManager.GetLoadedObjectEntryIndex(obj); + switch (obj->GetObjectType()) { - ResearchItem tmp = {}; - tmp.type = Research::EntryType::Ride; - tmp.entryIndex = entry_index; - tmp.baseRideType = rideType; - research_remove(&tmp); + case ObjectType::Ride: + { + auto rideEntry = get_ride_entry(entryIndex); + for (auto rideType : rideEntry->ride_type) + { + ResearchItem tmp = {}; + tmp.type = Research::EntryType::Ride; + tmp.entryIndex = entryIndex; + tmp.baseRideType = rideType; + research_remove(&tmp); + } + break; + } + case ObjectType::SceneryGroup: + { + ResearchItem tmp = {}; + tmp.type = Research::EntryType::Scenery; + tmp.entryIndex = entryIndex; + research_remove(&tmp); + break; + } + default: + break; } } - else if (entry_type == ObjectType::SceneryGroup) - { - ResearchItem tmp = {}; - tmp.type = Research::EntryType::Scenery; - tmp.entryIndex = entry_index; - research_remove(&tmp); - } } /** @@ -337,18 +342,17 @@ static void remove_selected_objects_from_research(const rct_object_entry* instal */ void unload_unselected_objects() { - int32_t numItems = static_cast(object_repository_get_items_count()); - const ObjectRepositoryItem* items = object_repository_get_items(); - std::vector objectsToUnload; + auto numItems = static_cast(object_repository_get_items_count()); + const auto* items = object_repository_get_items(); + std::vector objectsToUnload; for (int32_t i = 0; i < numItems; i++) { if (!(_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED)) { - const rct_object_entry* entry = &items[i].ObjectEntry; - - remove_selected_objects_from_research(entry); - objectsToUnload.push_back(*entry); + auto descriptor = ObjectEntryDescriptor(items[i]); + remove_selected_objects_from_research(descriptor); + objectsToUnload.push_back(descriptor); } } object_manager_unload_objects(objectsToUnload); @@ -368,7 +372,7 @@ static void window_editor_object_selection_select_default_objects() 0, INPUT_FLAG_EDITOR_OBJECT_SELECT | INPUT_FLAG_EDITOR_OBJECT_1 | INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP, - defaultSelectedObject); + ObjectEntryDescriptor(defaultSelectedObject)); } } } @@ -383,7 +387,7 @@ static void SelectDesignerObjects() 0, INPUT_FLAG_EDITOR_OBJECT_SELECT | INPUT_FLAG_EDITOR_OBJECT_1 | INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP, - designerSelectedObject); + ObjectEntryDescriptor(designerSelectedObject)); } } } @@ -394,24 +398,22 @@ static void SelectDesignerObjects() static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item) { auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); - Object* oldPalette = objectManager.GetLoadedObject(ObjectType::Water, 0); + auto* oldPalette = objectManager.GetLoadedObject(ObjectType::Water, 0); if (oldPalette != nullptr) { - const std::vector oldEntries = { *(oldPalette->GetObjectEntry()) }; + const std::vector oldEntries = { oldPalette->GetDescriptor() }; objectManager.UnloadObjects(oldEntries); } - const rct_object_entry& newPaletteEntry = item->ObjectEntry; - - if (objectManager.GetLoadedObject(ObjectEntryDescriptor(newPaletteEntry)) != nullptr - || objectManager.LoadObject(&newPaletteEntry) != nullptr) + auto newPaletteEntry = ObjectEntryDescriptor(*item); + if (objectManager.GetLoadedObject(newPaletteEntry) != nullptr || objectManager.LoadObject(newPaletteEntry) != nullptr) { load_palette(); } else { - log_error("Failed to load selected palette %.8s", newPaletteEntry.name); + log_error("Failed to load selected palette %s", std::string(newPaletteEntry.GetName()).c_str()); } } @@ -430,7 +432,7 @@ void reset_selected_object_count_and_size() const ObjectRepositoryItem* items = object_repository_get_items(); for (int32_t i = 0; i < numObjects; i++) { - ObjectType objectType = items[i].ObjectEntry.GetType(); + ObjectType objectType = items[i].Type; if (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED) { _numSelectedObjectsForType[EnumValue(objectType)]++; @@ -512,7 +514,7 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_ return false; } - ObjectType objectType = item->ObjectEntry.GetType(); + ObjectType objectType = item->Type; if (objectType == ObjectType::SceneryGroup && (flags & INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP)) { for (const auto& sgEntry : item->SceneryGroupInfo.Entries) @@ -539,7 +541,7 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_ return true; } - ObjectType objectType = item->ObjectEntry.GetType(); + ObjectType objectType = item->Type; uint16_t maxObjects = object_entry_group_counts[EnumValue(objectType)]; if (maxObjects <= _numSelectedObjectsForType[EnumValue(objectType)]) @@ -587,27 +589,14 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_ } } -bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, std::string_view identifier) +bool window_editor_object_selection_select_object( + uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& descriptor) { auto& objectRepository = OpenRCT2::GetContext()->GetObjectRepository(); - const auto* item = objectRepository.FindObject(identifier); + const auto* item = objectRepository.FindObject(descriptor); return window_editor_object_selection_select_object(isMasterObject, flags, item); } -bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const rct_object_entry* entry) -{ - const ObjectRepositoryItem* item = object_repository_find_object_by_entry(entry); - return window_editor_object_selection_select_object(isMasterObject, flags, item); -} - -bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& entry) -{ - if (entry.Generation == ObjectGeneration::DAT) - return window_editor_object_selection_select_object(isMasterObject, flags, &entry.Entry); - - return window_editor_object_selection_select_object(isMasterObject, flags, entry.Identifier); -} - bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType) { auto numObjects = std::min(object_repository_get_items_count(), _objectSelectionFlags.size()); @@ -615,7 +604,7 @@ bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType) for (size_t i = 0; i < numObjects; i++) { - ObjectType objectType = items[i].ObjectEntry.GetType(); + auto objectType = items[i].Type; if (checkObjectType == objectType && (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED)) { return true; @@ -624,6 +613,23 @@ bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType) return false; } +bool editor_check_object_group_at_least_one_surface_selected(bool queue) +{ + auto numObjects = std::min(object_repository_get_items_count(), _objectSelectionFlags.size()); + const auto* items = object_repository_get_items(); + for (size_t i = 0; i < numObjects; i++) + { + const auto& ori = items[i]; + auto isQueue = (ori.FootpathSurfaceInfo.Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0; + if (ori.Type == ObjectType::FootpathSurface && (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED) + && queue == isQueue) + { + return true; + } + } + return false; +} + int32_t editor_remove_unused_objects() { sub_6AB211(); @@ -641,7 +647,7 @@ int32_t editor_remove_unused_objects() && !(_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED)) { const ObjectRepositoryItem* item = &items[i]; - ObjectType objectType = item->ObjectEntry.GetType(); + ObjectType objectType = item->Type; if (objectType >= ObjectType::SceneryGroup) { diff --git a/src/openrct2/EditorObjectSelectionSession.h b/src/openrct2/EditorObjectSelectionSession.h index 45f4f8b482..9df783e8b7 100644 --- a/src/openrct2/EditorObjectSelectionSession.h +++ b/src/openrct2/EditorObjectSelectionSession.h @@ -28,14 +28,13 @@ extern std::vector _objectSelectionFlags; extern int32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)]; bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType); +bool editor_check_object_group_at_least_one_surface_selected(bool queue); void editor_object_flags_free(); void unload_unselected_objects(); void sub_6AB211(); void reset_selected_object_count_and_size(); void finish_object_selection(); bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const ObjectRepositoryItem* item); -bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, std::string_view identifier); -bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const rct_object_entry* entry); bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& entry); /** diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index ff2272dd8e..eded50014c 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -12,6 +12,7 @@ #include "common.h" #include "core/String.hpp" #include "object/Object.h" +#include "object/ObjectList.h" #include #include @@ -19,6 +20,7 @@ struct IObjectManager; struct IObjectRepository; + namespace OpenRCT2 { struct IStream; @@ -29,9 +31,9 @@ struct scenario_index_entry; struct ParkLoadResult final { public: - std::vector RequiredObjects; + ObjectList RequiredObjects; - explicit ParkLoadResult(std::vector&& requiredObjects) + explicit ParkLoadResult(ObjectList&& requiredObjects) : RequiredObjects(std::move(requiredObjects)) { } @@ -68,9 +70,9 @@ namespace ParkImporter class ObjectLoadException : public std::exception { public: - std::vector const MissingObjects; + std::vector const MissingObjects; - explicit ObjectLoadException(std::vector&& missingObjects) + explicit ObjectLoadException(std::vector&& missingObjects) : MissingObjects(std::move(missingObjects)) { } diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 94fae3d0ba..ad17d560f7 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -524,7 +524,7 @@ namespace OpenRCT2 auto importer = ParkImporter::CreateS6(context->GetObjectRepository()); auto loadResult = importer->LoadFromStream(&data.parkData, false); - objManager.LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size()); + objManager.LoadObjects(loadResult.RequiredObjects); importer->Import(); diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index e72f07d692..8b34c92053 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -86,18 +86,16 @@ GameActions::Result::Ptr TrackDesignAction::Query() const return MakeResult(GameActions::Status::InvalidParameters); } - const rct_object_entry* rideEntryObject = &_td.vehicle_object; - - ObjectType entryType; - ObjectEntryIndex entryIndex; - if (!find_object_in_entry_group(rideEntryObject, &entryType, &entryIndex)) + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); + if (entryIndex == OBJECT_ENTRY_INDEX_NULL) { - 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. - else if (!ride_entry_is_invented(entryIndex) && !gCheatsIgnoreResearchStatus) - { - 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 (!ride_entry_is_invented(entryIndex) && !gCheatsIgnoreResearchStatus) + { + entryIndex = OBJECT_ENTRY_INDEX_NULL; + } } // Colours do not matter as will be overwritten @@ -149,18 +147,16 @@ GameActions::Result::Ptr TrackDesignAction::Execute() const res->Position.z = _loc.z; res->Expenditure = ExpenditureType::RideConstruction; - const rct_object_entry* rideEntryObject = &_td.vehicle_object; - - ObjectType entryType; - ObjectEntryIndex entryIndex; - if (!find_object_in_entry_group(rideEntryObject, &entryType, &entryIndex)) + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); + if (entryIndex == OBJECT_ENTRY_INDEX_NULL) { - 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. - else if (!ride_entry_is_invented(entryIndex) && !gCheatsIgnoreResearchStatus) - { - 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 (!ride_entry_is_invented(entryIndex) && !gCheatsIgnoreResearchStatus) + { + entryIndex = OBJECT_ENTRY_INDEX_NULL; + } } // Colours do not matter as will be overwritten diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index d2a01bb1ff..819391f03a 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -2735,7 +2735,7 @@ bool NetworkBase::LoadMap(IStream* stream) auto& objManager = context.GetObjectManager(); auto importer = ParkImporter::CreateS6(context.GetObjectRepository()); auto loadResult = importer->LoadFromStream(stream, false); - objManager.LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size()); + objManager.LoadObjects(loadResult.RequiredObjects); importer->Import(); EntityTweener::Get().Reset(); diff --git a/src/openrct2/object/BannerObject.h b/src/openrct2/object/BannerObject.h index 4ee48e5bb5..7793e35568 100644 --- a/src/openrct2/object/BannerObject.h +++ b/src/openrct2/object/BannerObject.h @@ -19,11 +19,6 @@ private: BannerSceneryEntry _legacyType = {}; public: - explicit BannerObject(const rct_object_entry& entry) - : SceneryObject(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/EntranceObject.h b/src/openrct2/object/EntranceObject.h index 45e4d8dc72..beefbce10e 100644 --- a/src/openrct2/object/EntranceObject.h +++ b/src/openrct2/object/EntranceObject.h @@ -18,11 +18,6 @@ private: rct_entrance_type _legacyType = {}; public: - explicit EntranceObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/FootpathItemObject.h b/src/openrct2/object/FootpathItemObject.h index 53cdf51ad5..56ed5b91b2 100644 --- a/src/openrct2/object/FootpathItemObject.h +++ b/src/openrct2/object/FootpathItemObject.h @@ -18,11 +18,6 @@ private: PathBitEntry _legacyType = {}; public: - explicit FootpathItemObject(const rct_object_entry& entry) - : SceneryObject(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/FootpathObject.h b/src/openrct2/object/FootpathObject.h index 5d481cec80..ebe409ae58 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -21,11 +21,6 @@ private: PathRailingsDescriptor _pathRailingsDescriptor = {}; public: - explicit FootpathObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/FootpathRailingsObject.h b/src/openrct2/object/FootpathRailingsObject.h index 205ebebd8f..15bc15edd0 100644 --- a/src/openrct2/object/FootpathRailingsObject.h +++ b/src/openrct2/object/FootpathRailingsObject.h @@ -26,11 +26,6 @@ public: PathRailingsDescriptor _descriptor = {}; public: - explicit FootpathRailingsObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/FootpathSurfaceObject.h b/src/openrct2/object/FootpathSurfaceObject.h index fd23e06a81..b6c3e7cfa2 100644 --- a/src/openrct2/object/FootpathSurfaceObject.h +++ b/src/openrct2/object/FootpathSurfaceObject.h @@ -22,11 +22,6 @@ public: PathSurfaceDescriptor _descriptor = {}; public: - explicit FootpathSurfaceObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/LargeSceneryObject.h b/src/openrct2/object/LargeSceneryObject.h index d1711336db..84c587100d 100644 --- a/src/openrct2/object/LargeSceneryObject.h +++ b/src/openrct2/object/LargeSceneryObject.h @@ -24,11 +24,6 @@ private: std::unique_ptr _3dFont; public: - explicit LargeSceneryObject(const rct_object_entry& entry) - : SceneryObject(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/MusicObject.h b/src/openrct2/object/MusicObject.h index 43b519fadd..850aa27f14 100644 --- a/src/openrct2/object/MusicObject.h +++ b/src/openrct2/object/MusicObject.h @@ -42,11 +42,6 @@ private: public: rct_string_id NameStringId{}; - explicit MusicObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 80710834e2..e4c8d05f43 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -33,9 +33,74 @@ ObjectType& operator++(ObjectType& d, int) return d = (d == ObjectType::Count) ? ObjectType::Ride : static_cast(static_cast(d) + 1); } -Object::Object(const rct_object_entry& entry) +ObjectEntryDescriptor::ObjectEntryDescriptor(const rct_object_entry& newEntry) { - _objectEntry = entry; + if (!newEntry.IsEmpty()) + { + Generation = ObjectGeneration::DAT; + Entry = newEntry; + } +} + +ObjectEntryDescriptor::ObjectEntryDescriptor(std::string_view newIdentifier) +{ + Generation = ObjectGeneration::JSON; + Identifier = std::string(newIdentifier); +} + +ObjectEntryDescriptor::ObjectEntryDescriptor(ObjectType type, std::string_view newIdentifier) +{ + Generation = ObjectGeneration::JSON; + Identifier = std::string(newIdentifier); + Type = type; +} + +ObjectEntryDescriptor::ObjectEntryDescriptor(const ObjectRepositoryItem& ori) +{ + if (!ori.Identifier.empty()) + { + Generation = ObjectGeneration::JSON; + Identifier = std::string(ori.Identifier); + } + else + { + Generation = ObjectGeneration::DAT; + Entry = ori.ObjectEntry; + } +} + +bool ObjectEntryDescriptor::HasValue() const +{ + return Generation != ObjectGeneration::JSON || !Identifier.empty(); +}; + +ObjectType ObjectEntryDescriptor::GetType() const +{ + return Generation == ObjectGeneration::JSON ? Type : Entry.GetType(); +} + +std::string_view ObjectEntryDescriptor::GetName() const +{ + return Generation == ObjectGeneration::JSON ? Identifier : Entry.GetName(); +} + +bool ObjectEntryDescriptor::operator==(const ObjectEntryDescriptor& rhs) const +{ + if (Generation != rhs.Generation) + return false; + if (Generation == ObjectGeneration::DAT) + { + return Entry == rhs.Entry; + } + else + { + return Type == rhs.Type && Identifier == rhs.Identifier; + } +} + +bool ObjectEntryDescriptor::operator!=(const ObjectEntryDescriptor& rhs) const +{ + return !(*this == rhs); } void* Object::GetLegacyData() @@ -171,6 +236,61 @@ std::optional rct_object_entry::GetSceneryType() const } } +bool rct_object_entry::IsEmpty() const +{ + uint64_t a, b; + std::memcpy(&a, reinterpret_cast(this), 8); + std::memcpy(&b, reinterpret_cast(this) + 8, 8); + + if (a == 0xFFFFFFFFFFFFFFFF && b == 0xFFFFFFFFFFFFFFFF) + return true; + if (a == 0 && b == 0) + return true; + return false; +} + +bool rct_object_entry::operator==(const rct_object_entry& rhs) const +{ + const auto a = this; + const auto b = &rhs; + + // If an official object don't bother checking checksum + if ((a->flags & 0xF0) || (b->flags & 0xF0)) + { + if (a->GetType() != b->GetType()) + { + return false; + } + int32_t match = memcmp(a->name, b->name, 8); + if (match) + { + return false; + } + } + else + { + if (a->flags != b->flags) + { + return false; + } + int32_t match = memcmp(a->name, b->name, 8); + if (match) + { + return false; + } + if (a->checksum != b->checksum) + { + return false; + } + } + return true; +} + +bool rct_object_entry::operator!=(const rct_object_entry& rhs) const +{ + return !(*this == rhs); +} + bool ObjectAsset::IsAvailable() const { if (_zipPath.empty()) @@ -227,20 +347,6 @@ std::unique_ptr ObjectAsset::GetStream() const return {}; } -ObjectEntryDescriptor::ObjectEntryDescriptor(const ObjectRepositoryItem& ori) -{ - if (!ori.Identifier.empty()) - { - Generation = ObjectGeneration::JSON; - Identifier = std::string(ori.Identifier); - } - else - { - Generation = ObjectGeneration::DAT; - Entry = ori.ObjectEntry; - } -} - #ifdef __WARN_SUGGEST_FINAL_METHODS__ # pragma GCC diagnostic pop #endif diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index a9e9ddf7cf..db6dbb858d 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -125,6 +125,10 @@ struct rct_object_entry { return static_cast((flags & 0xF0) >> 4); } + + bool IsEmpty() const; + bool operator==(const rct_object_entry& rhs) const; + bool operator!=(const rct_object_entry& rhs) const; }; assert_struct_size(rct_object_entry, 0x10); @@ -162,30 +166,27 @@ enum class ObjectGeneration : uint8_t struct ObjectEntryDescriptor { - ObjectGeneration Generation; - std::string Identifier; // For JSON objects - rct_object_entry Entry; // For DAT objects + ObjectGeneration Generation = ObjectGeneration::JSON; - ObjectEntryDescriptor() - : Generation(ObjectGeneration::JSON) - , Identifier() - , Entry() - { - } + // DAT + rct_object_entry Entry{}; - explicit ObjectEntryDescriptor(const rct_object_entry& newEntry) - { - Generation = ObjectGeneration::DAT; - Entry = newEntry; - } - - explicit ObjectEntryDescriptor(std::string_view newIdentifier) - { - Generation = ObjectGeneration::JSON; - Identifier = std::string(newIdentifier); - } + // JSON + ObjectType Type{}; + std::string Identifier; + std::string Version; + ObjectEntryDescriptor() = default; + explicit ObjectEntryDescriptor(const rct_object_entry& newEntry); + explicit ObjectEntryDescriptor(std::string_view newIdentifier); + explicit ObjectEntryDescriptor(ObjectType type, std::string_view newIdentifier); explicit ObjectEntryDescriptor(const ObjectRepositoryItem& ori); + bool HasValue() const; + ObjectType GetType() const; + std::string_view GetName() const; + + bool operator==(const ObjectEntryDescriptor& rhs) const; + bool operator!=(const ObjectEntryDescriptor& rhs) const; }; struct IObjectRepository; @@ -254,12 +255,12 @@ class Object { private: std::string _identifier; - rct_object_entry _objectEntry{}; + ObjectEntryDescriptor _descriptor{}; StringTable _stringTable; ImageTable _imageTable; std::vector _sourceGames; std::vector _authors; - bool _isJsonObject{}; + ObjectGeneration _generation{}; protected: StringTable& GetStringTable() @@ -290,7 +291,6 @@ protected: std::string GetString(int32_t language, ObjectStringID index) const; public: - explicit Object(const rct_object_entry& entry); virtual ~Object() = default; std::string_view GetIdentifier() const @@ -304,22 +304,38 @@ public: void MarkAsJsonObject() { - _isJsonObject = true; + _generation = ObjectGeneration::JSON; } - bool IsJsonObject() const + ObjectGeneration GetGeneration() const { - return _isJsonObject; + return _generation; }; + ObjectType GetObjectType() const + { + return _descriptor.GetType(); + } + + ObjectEntryDescriptor GetDescriptor() const + { + return _descriptor; + } + void SetDescriptor(const ObjectEntryDescriptor& value) + { + _descriptor = value; + } + // Legacy data structures std::string_view GetLegacyIdentifier() const { - return _objectEntry.GetName(); + return _descriptor.GetName(); } - const rct_object_entry* GetObjectEntry() const + + // TODO remove this, we should no longer assume objects have a legacy object entry + const rct_object_entry& GetObjectEntry() const { - return &_objectEntry; + return _descriptor.Entry; } virtual void* GetLegacyData(); @@ -337,10 +353,6 @@ public: { } - virtual ObjectType GetObjectType() const final - { - return _objectEntry.GetType(); - } virtual std::string GetName() const; virtual std::string GetName(int32_t language) const; @@ -374,8 +386,6 @@ public: extern int32_t object_entry_group_counts[]; extern int32_t object_entry_group_encoding[]; -bool object_entry_is_empty(const rct_object_entry* entry); -bool object_entry_compare(const rct_object_entry* a, const rct_object_entry* b); int32_t object_calculate_checksum(const rct_object_entry* entry, const void* data, size_t dataLength); bool find_object_in_entry_group(const rct_object_entry* entry, ObjectType* entry_type, ObjectEntryIndex* entryIndex); void object_create_identifier_name(char* string_buffer, size_t size, const rct_object_entry* object); diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index 854d3ed70b..bb011d0884 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -255,7 +255,8 @@ namespace ObjectFactory if (entry.GetType() != ObjectType::ScenarioText) { - result = CreateObject(entry); + result = CreateObject(entry.GetType()); + result->SetDescriptor(ObjectEntryDescriptor(entry)); utf8 objectName[DAT_NAME_LENGTH + 1] = { 0 }; object_entry_get_name_fixed(objectName, sizeof(objectName), &entry); @@ -287,9 +288,11 @@ namespace ObjectFactory Guard::ArgumentNotNull(entry, GUARD_LINE); Guard::ArgumentNotNull(data, GUARD_LINE); - auto result = CreateObject(*entry); + auto result = CreateObject(entry->GetType()); if (result != nullptr) { + result->SetDescriptor(ObjectEntryDescriptor(*entry)); + utf8 objectName[DAT_NAME_LENGTH + 1]; object_entry_get_name_fixed(objectName, sizeof(objectName), entry); @@ -309,60 +312,60 @@ namespace ObjectFactory return result; } - std::unique_ptr CreateObject(const rct_object_entry& entry) + std::unique_ptr CreateObject(ObjectType type) { std::unique_ptr result; - switch (entry.GetType()) + switch (type) { case ObjectType::Ride: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::SmallScenery: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::LargeScenery: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Walls: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Banners: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Paths: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::PathBits: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::SceneryGroup: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::ParkEntrance: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Water: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::ScenarioText: break; case ObjectType::TerrainSurface: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::TerrainEdge: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Station: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::Music: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::FootpathSurface: - result = std::make_unique(entry); + result = std::make_unique(); break; case ObjectType::FootpathRailings: - result = std::make_unique(entry); + result = std::make_unique(); break; default: throw std::runtime_error("Invalid object type"); @@ -497,22 +500,28 @@ namespace ObjectFactory { auto id = Json::GetString(jRoot["id"]); - rct_object_entry entry = {}; + ObjectEntryDescriptor descriptor; auto originalId = Json::GetString(jRoot["originalId"]); - auto originalName = originalId; if (originalId.length() == 8 + 1 + 8 + 1 + 8) { - entry.flags = std::stoul(originalId.substr(0, 8), nullptr, 16); - originalName = originalId.substr(9, 8); - entry.checksum = std::stoul(originalId.substr(18, 8), nullptr, 16); - } - // Always set, since originalId might be missing or incorrect. - entry.SetType(objectType); - auto minLength = std::min(8, originalName.length()); - std::memcpy(entry.name, originalName.c_str(), minLength); + auto originalName = originalId.substr(9, 8); - result = CreateObject(entry); + rct_object_entry entry = {}; + entry.flags = std::stoul(originalId.substr(0, 8), nullptr, 16); + entry.checksum = std::stoul(originalId.substr(18, 8), nullptr, 16); + entry.SetType(objectType); + auto minLength = std::min(8, originalName.length()); + std::memcpy(entry.name, originalName.c_str(), minLength); + descriptor = ObjectEntryDescriptor(entry); + } + else + { + descriptor = ObjectEntryDescriptor(objectType, id); + } + + result = CreateObject(objectType); result->SetIdentifier(id); + result->SetDescriptor(descriptor); result->MarkAsJsonObject(); auto readContext = ReadObjectContext(objectRepository, id, !gOpenRCT2NoGraphics, fileRetriever); result->ReadJson(&readContext, jRoot); diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index ecbdf9f611..6aef398f28 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -17,6 +17,7 @@ struct IObjectRepository; class Object; struct rct_object_entry; +enum class ObjectType : uint8_t; namespace ObjectFactory { @@ -24,7 +25,7 @@ namespace ObjectFactory [[nodiscard]] std::unique_ptr CreateObjectFromLegacyData( IObjectRepository& objectRepository, const rct_object_entry* entry, const void* data, size_t dataSize); [[nodiscard]] std::unique_ptr CreateObjectFromZipFile(IObjectRepository& objectRepository, std::string_view path); - [[nodiscard]] std::unique_ptr CreateObject(const rct_object_entry& entry); + [[nodiscard]] std::unique_ptr CreateObject(ObjectType type); [[nodiscard]] std::unique_ptr CreateObjectFromJsonFile( IObjectRepository& objectRepository, const std::string& path); diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index ab94ef62f4..808696ddcf 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -60,17 +60,134 @@ int32_t object_entry_group_encoding[] = { }; // clang-format on -bool object_entry_is_empty(const rct_object_entry* entry) +ObjectList::const_iterator::const_iterator(const ObjectList* parent, bool end) { - uint64_t a, b; - std::memcpy(&a, reinterpret_cast(entry), 8); - std::memcpy(&b, reinterpret_cast(entry) + 8, 8); + _parent = parent; + _subList = _parent->_subLists.size(); + _index = 0; +} - if (a == 0xFFFFFFFFFFFFFFFF && b == 0xFFFFFFFFFFFFFFFF) - return true; - if (a == 0 && b == 0) - return true; - return false; +void ObjectList::const_iterator::MoveToNextEntry() +{ + do + { + if (_subList < _parent->_subLists.size()) + { + auto subListSize = _parent->_subLists[_subList].size(); + if (_index < subListSize) + { + _index++; + if (_index == subListSize) + { + _subList++; + _index = 0; + } + } + } + else + { + break; + } + } while (!_parent->_subLists[_subList][_index].HasValue()); +} + +ObjectList::const_iterator& ObjectList::const_iterator::operator++() +{ + MoveToNextEntry(); + return *this; +} + +ObjectList::const_iterator ObjectList::const_iterator::operator++(int) +{ + return *this; +} + +const ObjectEntryDescriptor& ObjectList::const_iterator::operator*() +{ + return _parent->_subLists[_subList][_index]; +} + +bool ObjectList::const_iterator::operator==(const_iterator& rhs) +{ + return _parent == rhs._parent && _subList == rhs._subList && _index == rhs._index; +} + +bool ObjectList::const_iterator::operator!=(const_iterator& rhs) +{ + return !(*this == rhs); +} + +ObjectList::const_iterator ObjectList::begin() const +{ + return const_iterator(this, false); +} + +ObjectList::const_iterator ObjectList::end() const +{ + return const_iterator(this, true); +} + +std::vector& ObjectList::GetList(ObjectType type) +{ + auto index = static_cast(type); + while (_subLists.size() <= index) + { + _subLists.resize(static_cast(index) + 1); + } + return _subLists[index]; +} + +std::vector& ObjectList::GetList(ObjectType type) const +{ + return const_cast(this)->GetList(type); +} + +const ObjectEntryDescriptor& ObjectList::GetObject(ObjectType type, ObjectEntryIndex index) const +{ + const auto& subList = GetList(type); + if (subList.size() > index) + { + return subList[index]; + } + + static ObjectEntryDescriptor placeholder; + return placeholder; +} + +void ObjectList::Add(const ObjectEntryDescriptor& entry) +{ + auto& subList = GetList(entry.GetType()); + subList.push_back(entry); +} + +void ObjectList::SetObject(ObjectEntryIndex index, const ObjectEntryDescriptor& entry) +{ + auto& subList = GetList(entry.GetType()); + if (subList.size() <= index) + { + subList.resize(static_cast(index) + 1); + } + subList[index] = entry; +} + +void ObjectList::SetObject(ObjectType type, ObjectEntryIndex index, std::string_view identifier) +{ + auto entry = ObjectEntryDescriptor(identifier); + entry.Type = type; + SetObject(index, entry); +} + +ObjectEntryIndex ObjectList::Find(ObjectType type, std::string_view identifier) +{ + auto& subList = GetList(type); + for (size_t i = 0; i < subList.size(); i++) + { + if (subList[i].Identifier == identifier) + { + return static_cast(i); + } + } + return OBJECT_ENTRY_INDEX_NULL; } /** @@ -104,7 +221,7 @@ bool find_object_in_entry_group(const rct_object_entry* entry, ObjectType* entry if (loadedObj != nullptr) { auto thisEntry = object_entry_get_object(objectType, i)->GetObjectEntry(); - if (object_entry_compare(thisEntry, entry)) + if (thisEntry == *entry) { *entry_type = objectType; *entryIndex = i; diff --git a/src/openrct2/object/ObjectList.h b/src/openrct2/object/ObjectList.h index b1048fd82c..ceae5ec119 100644 --- a/src/openrct2/object/ObjectList.h +++ b/src/openrct2/object/ObjectList.h @@ -15,6 +15,45 @@ #include "../world/Footpath.h" #include "../world/Scenery.h" #include "../world/Water.h" +#include "Object.h" #include "ObjectLimits.h" +#include + +class ObjectList +{ +private: + std::vector> _subLists; + +public: + void Add(const ObjectEntryDescriptor& entry); + std::vector& GetList(ObjectType type); + std::vector& GetList(ObjectType type) const; + const ObjectEntryDescriptor& GetObject(ObjectType type, ObjectEntryIndex index) const; + void SetObject(ObjectEntryIndex index, const ObjectEntryDescriptor& entry); + void SetObject(ObjectType type, ObjectEntryIndex index, std::string_view identifier); + ObjectEntryIndex Find(ObjectType type, std::string_view identifier); + + struct const_iterator + { + private: + const ObjectList* _parent; + size_t _subList; + size_t _index; + + void MoveToNextEntry(); + + public: + const_iterator(const ObjectList* parent, bool end); + const ObjectEntryDescriptor& operator*(); + bool operator==(const_iterator& rhs); + bool operator!=(const_iterator& rhs); + const_iterator& operator++(); + const_iterator operator++(int); + }; + + const_iterator begin() const; + const_iterator end() const; +}; + void get_type_entry_index(size_t index, ObjectType* outObjectType, ObjectEntryIndex* outEntryIndex); diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index c823f2f4a9..b23e79a3b7 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -133,10 +133,16 @@ public: return RepositoryItemToObject(ori); } - void LoadObjects(const rct_object_entry* entries, size_t count) override + Object* LoadObject(const ObjectEntryDescriptor& descriptor) override + { + const ObjectRepositoryItem* ori = _objectRepository.FindObject(descriptor); + return RepositoryItemToObject(ori); + } + + void LoadObjects(const ObjectList& objectList) override { // Find all the required objects - auto requiredObjects = GetRequiredObjects(entries, count); + auto requiredObjects = GetRequiredObjects(objectList); // Load the required objects LoadObjects(requiredObjects); @@ -149,19 +155,19 @@ public: ResetTypeToRideEntryIndexMap(); } - void UnloadObjects(const std::vector& entries) override + void UnloadObjects(const std::vector& entries) override { // TODO there are two performance issues here: // - FindObject for every entry which is a dictionary lookup // - GetLoadedObjectIndex for every entry which enumerates _loadedList size_t numObjectsUnloaded = 0; - for (const auto& entry : entries) + for (const auto& descriptor : entries) { - const ObjectRepositoryItem* ori = _objectRepository.FindObject(&entry); + const auto* ori = _objectRepository.FindObject(descriptor); if (ori != nullptr) { - Object* loadedObject = ori->LoadedObject.get(); + auto* loadedObject = ori->LoadedObject.get(); if (loadedObject != nullptr) { UnloadObject(loadedObject); @@ -209,7 +215,7 @@ public: { const ObjectRepositoryItem* item = &_objectRepository.GetObjects()[i]; if (item->LoadedObject != nullptr && IsObjectCustom(item) && item->LoadedObject->GetLegacyData() != nullptr - && !item->LoadedObject->IsJsonObject()) + && item->LoadedObject->GetGeneration() == ObjectGeneration::DAT) { objects.push_back(item); } @@ -352,42 +358,42 @@ private: Object* RepositoryItemToObject(const ObjectRepositoryItem* ori, std::optional slot = {}) { - if (ori == nullptr) - return nullptr; - - Object* loadedObject = ori->LoadedObject.get(); - if (loadedObject != nullptr) - return loadedObject; - - ObjectType objectType = ori->ObjectEntry.GetType(); - if (slot) + Object* loadedObject = nullptr; + if (ori != nullptr) { - if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) + loadedObject = ori->LoadedObject.get(); + if (loadedObject == nullptr) { - // Slot already taken - return nullptr; - } - } - else - { - slot = FindSpareSlot(objectType); - } - if (slot.has_value()) - { - auto* object = GetOrLoadObject(ori); - if (object != nullptr) - { - if (_loadedObjects.size() <= static_cast(*slot)) + ObjectType objectType = ori->Type; + if (slot) { + if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) + { + // Slot already taken + return nullptr; + } + } + else + { + slot = FindSpareSlot(objectType); + } + if (slot.has_value()) + { + auto object = GetOrLoadObject(ori); + if (object != nullptr) + { + if (_loadedObjects.size() <= static_cast(*slot)) + { _loadedObjects.resize(slot.value() + 1); + } + loadedObject = object; + _loadedObjects[slot.value()] = std::move(object); + UpdateSceneryGroupIndexes(); + ResetTypeToRideEntryIndexMap(); + } } - loadedObject = object; - _loadedObjects[slot.value()] = object; - UpdateSceneryGroupIndexes(); - ResetTypeToRideEntryIndexMap(); } } - return loadedObject; } @@ -431,7 +437,7 @@ private: object->Unload(); // TODO try to prevent doing a repository search - const ObjectRepositoryItem* ori = _objectRepository.FindObject(object->GetObjectEntry()); + const auto* ori = _objectRepository.FindObject(object->GetDescriptor()); if (ori != nullptr) { _objectRepository.UnregisterLoadedObject(ori, object); @@ -535,25 +541,29 @@ private: return entryIndex; } - std::vector GetRequiredObjects(const rct_object_entry* entries, size_t count) + std::vector GetRequiredObjects(const ObjectList& objectList) { std::vector requiredObjects; - std::vector missingObjects; + std::vector missingObjects; - for (size_t i = 0; i < count; i++) + for (auto objectType = ObjectType::Ride; objectType < ObjectType::Count; objectType++) { - const rct_object_entry* entry = &entries[i]; - const ObjectRepositoryItem* ori = nullptr; - if (!object_entry_is_empty(entry)) + auto maxObjectsOfType = static_cast(object_entry_group_counts[EnumValue(objectType)]); + for (ObjectEntryIndex i = 0; i < maxObjectsOfType; i++) { - ori = _objectRepository.FindObject(entry); - if (ori == nullptr && entry->GetType() != ObjectType::ScenarioText) + const ObjectRepositoryItem* ori = nullptr; + const auto& entry = objectList.GetObject(objectType, i); + if (entry.HasValue()) { - missingObjects.push_back(*entry); - ReportMissingObject(entry); + ori = _objectRepository.FindObject(entry); + if (ori == nullptr && entry.GetType() != ObjectType::ScenarioText) + { + missingObjects.push_back(entry); + ReportMissingObject(entry); + } } + requiredObjects.push_back(ori); } - requiredObjects.push_back(ori); } if (!missingObjects.empty()) @@ -592,7 +602,7 @@ private: { std::vector objects; std::vector newLoadedObjects; - std::vector badObjects; + std::vector badObjects; objects.resize(OBJECT_ENTRY_COUNT); newLoadedObjects.reserve(OBJECT_ENTRY_COUNT); @@ -612,7 +622,7 @@ private: std::lock_guard guard(commonMutex); if (newObject == nullptr) { - badObjects.push_back(requiredObject->ObjectEntry); + badObjects.push_back(ObjectEntryDescriptor(requiredObject->ObjectEntry)); ReportObjectLoadProblem(&requiredObject->ObjectEntry); } else @@ -714,11 +724,10 @@ private: } } - static void ReportMissingObject(const rct_object_entry* entry) + static void ReportMissingObject(const ObjectEntryDescriptor& entry) { - utf8 objName[DAT_NAME_LENGTH + 1] = { 0 }; - std::copy_n(entry->name, DAT_NAME_LENGTH, objName); - Console::Error::WriteLine("[%s] Object not found.", objName); + std::string name(entry.GetName()); + Console::Error::WriteLine("[%s] Object not found.", name.c_str()); } void ReportObjectLoadProblem(const rct_object_entry* entry) @@ -771,7 +780,7 @@ Object* object_manager_load_object(const rct_object_entry* entry) return loadedObject; } -void object_manager_unload_objects(const std::vector& entries) +void object_manager_unload_objects(const std::vector& entries) { auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); objectManager.UnloadObjects(entries); diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 09f2609403..e5083bfabc 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -16,6 +16,7 @@ struct IObjectRepository; class Object; +class ObjectList; struct ObjectRepositoryItem; struct IObjectManager @@ -33,9 +34,10 @@ struct IObjectManager virtual Object* LoadObject(std::string_view identifier) abstract; virtual Object* LoadObject(const rct_object_entry* entry) abstract; - virtual void LoadObjects(const rct_object_entry* entries, size_t count) abstract; + virtual Object* LoadObject(const ObjectEntryDescriptor& descriptor) abstract; + virtual void LoadObjects(const ObjectList& entries) abstract; virtual void LoadDefaultObjects() abstract; - virtual void UnloadObjects(const std::vector& entries) abstract; + virtual void UnloadObjects(const std::vector& entries) abstract; virtual void UnloadAll() abstract; virtual void ResetObjects() abstract; @@ -50,6 +52,6 @@ struct IObjectManager [[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const Object* loadedObject); [[nodiscard]] ObjectEntryIndex object_manager_get_loaded_object_entry_index(const ObjectEntryDescriptor& entry); Object* object_manager_load_object(const rct_object_entry* entry); -void object_manager_unload_objects(const std::vector& entries); +void object_manager_unload_objects(const std::vector& entries); void object_manager_unload_all_objects(); [[nodiscard]] rct_string_id object_manager_get_source_game_string(const ObjectSourceGame sourceGame); diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 4c8329323e..3979bbf001 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -77,7 +77,7 @@ class ObjectFileIndex final : public FileIndex { private: static constexpr uint32_t MAGIC_NUMBER = 0x5844494F; // OIDX - static constexpr uint16_t VERSION = 27; + static constexpr uint16_t VERSION = 28; static constexpr auto PATTERN = "*.dat;*.pob;*.json;*.parkobj"; IObjectRepository& _objectRepository; @@ -114,8 +114,10 @@ public: if (object != nullptr) { ObjectRepositoryItem item = {}; + item.Type = object->GetObjectType(); + item.Generation = object->GetGeneration(); item.Identifier = object->GetIdentifier(); - item.ObjectEntry = *object->GetObjectEntry(); + item.ObjectEntry = object->GetObjectEntry(); item.Path = path; item.Name = object->GetName(); item.Authors = object->GetAuthors(); @@ -129,6 +131,8 @@ public: protected: void Serialise(DataSerialiser& ds, ObjectRepositoryItem& item) const override { + ds << item.Type; + ds << item.Generation; ds << item.Identifier; ds << item.ObjectEntry; ds << item.Path; @@ -137,7 +141,7 @@ protected: ds << item.Sources; ds << item.Authors; - switch (item.ObjectEntry.GetType()) + switch (item.Type) { case ObjectType::Ride: ds << item.RideInfo.RideFlags; @@ -149,6 +153,9 @@ protected: ds << item.SceneryGroupInfo.Entries; break; } + case ObjectType::FootpathSurface: + ds << item.FootpathSurfaceInfo.Flags; + break; default: // Switch processes only ObjectType::Ride and ObjectType::SceneryGroup break; @@ -298,7 +305,7 @@ public: else { log_verbose("Adding object: [%s]", objectName); - auto path = GetPathForNewObject(objectName); + auto path = GetPathForNewObject(ObjectGeneration::DAT, objectName); try { SaveObject(path, objectEntry, data, dataSize); @@ -311,10 +318,10 @@ public: } } - void AddObjectFromFile(std::string_view objectName, const void* data, size_t dataSize) override + void AddObjectFromFile(ObjectGeneration generation, std::string_view objectName, const void* data, size_t dataSize) override { log_verbose("Adding object: [%s]", std::string(objectName).c_str()); - auto path = GetPathForNewObject(objectName); + auto path = GetPathForNewObject(generation, objectName); try { File::WriteAllBytes(path, data, dataSize); @@ -415,7 +422,15 @@ private: bool AddItem(const ObjectRepositoryItem& item) { - auto conflict = FindObject(&item.ObjectEntry); + const ObjectRepositoryItem* conflict{}; + if (item.ObjectEntry.name[0] != '\0') + { + conflict = FindObject(&item.ObjectEntry); + } + if (conflict == nullptr) + { + conflict = FindObject(item.Identifier); + } if (conflict == nullptr) { size_t index = _items.size(); @@ -426,7 +441,10 @@ private: { _newItemMap[item.Identifier] = index; } - _itemMap[item.ObjectEntry] = index; + if (!item.ObjectEntry.IsEmpty()) + { + _itemMap[item.ObjectEntry] = index; + } return true; } else @@ -555,45 +573,53 @@ private: return salt; } - std::string GetPathForNewObject(std::string_view name) + std::string GetPathForNewObject(ObjectGeneration generation, std::string_view name) { // Get object directory and create it if it doesn't exist auto userObjPath = _env->GetDirectoryPath(DIRBASE::USER, DIRID::OBJECT); Path::CreateDirectory(userObjPath); // Find a unique file name - auto fileName = GetFileNameForNewObject(name); - auto fullPath = Path::Combine(userObjPath, fileName + ".DAT"); + auto fileName = GetFileNameForNewObject(generation, name); + auto extension = (generation == ObjectGeneration::DAT ? ".DAT" : ".parkobj"); + auto fullPath = Path::Combine(userObjPath, fileName + extension); auto counter = 1U; while (File::Exists(fullPath)) { counter++; - fullPath = Path::Combine(userObjPath, String::StdFormat("%s-%02X.DAT", fileName.c_str(), counter)); + fullPath = Path::Combine(userObjPath, String::StdFormat("%s-%02X%s", fileName.c_str(), counter, extension)); } return fullPath; } - std::string GetFileNameForNewObject(std::string_view name) + std::string GetFileNameForNewObject(ObjectGeneration generation, std::string_view name) { - // Trim name - char normalisedName[9] = { 0 }; - auto maxLength = std::min(name.size(), 8); - for (size_t i = 0; i < maxLength; i++) + if (generation == ObjectGeneration::DAT) { - if (name[i] != ' ') + // Trim name + char normalisedName[9] = { 0 }; + auto maxLength = std::min(name.size(), 8); + for (size_t i = 0; i < maxLength; i++) { - normalisedName[i] = toupper(name[i]); + if (name[i] != ' ') + { + normalisedName[i] = toupper(name[i]); + } + else + { + normalisedName[i] = '\0'; + break; + } } - else - { - normalisedName[i] = '\0'; - break; - } - } - // Convert to UTF-8 filename - return String::Convert(normalisedName, CODE_PAGE::CP_1252, CODE_PAGE::CP_UTF8); + // Convert to UTF-8 filename + return String::Convert(normalisedName, CODE_PAGE::CP_1252, CODE_PAGE::CP_UTF8); + } + else + { + return std::string(name); + } } void WritePackedObject(OpenRCT2::IStream* stream, const rct_object_entry* entry) @@ -607,7 +633,7 @@ private: // Read object data from file auto fs = OpenRCT2::FileStream(item->Path, OpenRCT2::FILE_MODE_OPEN); auto fileEntry = fs.ReadValue(); - if (!object_entry_compare(entry, &fileEntry)) + if (*entry != fileEntry) { throw std::runtime_error("Header found in object file does not match object to pack."); } @@ -632,14 +658,16 @@ bool IsObjectCustom(const ObjectRepositoryItem* object) // Do not count our new object types as custom yet, otherwise the game // will try to pack them into saved games. - auto type = object->ObjectEntry.GetType(); - if (type > ObjectType::ScenarioText) + if (object->Type > ObjectType::ScenarioText) { return false; } switch (object->GetFirstSourceGame()) { + case ObjectSourceGame::RCT1: + case ObjectSourceGame::AddedAttractions: + case ObjectSourceGame::LoopyLandscapes: case ObjectSourceGame::RCT2: case ObjectSourceGame::WackyWorlds: case ObjectSourceGame::TimeTwister: @@ -718,40 +746,6 @@ const ObjectRepositoryItem* object_repository_find_object_by_name(const char* na return objectRepository.FindObjectLegacy(name); } -bool object_entry_compare(const rct_object_entry* a, const rct_object_entry* b) -{ - // If an official object don't bother checking checksum - if ((a->flags & 0xF0) || (b->flags & 0xF0)) - { - if (a->GetType() != b->GetType()) - { - return false; - } - int32_t match = memcmp(a->name, b->name, 8); - if (match) - { - return false; - } - } - else - { - if (a->flags != b->flags) - { - return false; - } - int32_t match = memcmp(a->name, b->name, 8); - if (match) - { - return false; - } - if (a->checksum != b->checksum) - { - return false; - } - } - return true; -} - int32_t object_calculate_checksum(const rct_object_entry* entry, const void* data, size_t dataLength) { const uint8_t* entryBytePtr = reinterpret_cast(entry); diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index e6de1cce14..d77c8ec2b1 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -37,6 +37,8 @@ struct rct_drawpixelinfo; struct ObjectRepositoryItem { size_t Id; + ObjectType Type; + ObjectGeneration Generation; std::string Identifier; // e.g. rct2.c3d rct_object_entry ObjectEntry; std::string Path; @@ -86,7 +88,8 @@ struct IObjectRepository virtual void UnregisterLoadedObject(const ObjectRepositoryItem* ori, Object* object) abstract; virtual void AddObject(const rct_object_entry* objectEntry, const void* data, size_t dataSize) abstract; - virtual void AddObjectFromFile(std::string_view objectName, const void* data, size_t dataSize) abstract; + virtual void AddObjectFromFile( + ObjectGeneration generation, std::string_view objectName, const void* data, size_t dataSize) abstract; virtual void ExportPackedObject(OpenRCT2::IStream* stream) abstract; virtual void WritePackedObjects(OpenRCT2::IStream* stream, std::vector& objects) abstract; diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index c7c9202781..4c14deb6b5 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -24,11 +24,6 @@ private: std::vector> _peepLoadingWaypoints[MAX_VEHICLES_PER_RIDE_ENTRY]; public: - explicit RideObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/SceneryGroupObject.h b/src/openrct2/object/SceneryGroupObject.h index 09ed0e6256..fed7094cb5 100644 --- a/src/openrct2/object/SceneryGroupObject.h +++ b/src/openrct2/object/SceneryGroupObject.h @@ -25,11 +25,6 @@ private: std::vector _items; public: - explicit SceneryGroupObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/SceneryObject.h b/src/openrct2/object/SceneryObject.h index 9c15a1c397..e4e351a59c 100644 --- a/src/openrct2/object/SceneryObject.h +++ b/src/openrct2/object/SceneryObject.h @@ -19,10 +19,6 @@ private: ObjectEntryDescriptor _primarySceneryGroupEntry = {}; public: - explicit SceneryObject(const rct_object_entry& entry) - : Object(entry) - { - } virtual ~SceneryObject() = default; const ObjectEntryDescriptor& GetPrimarySceneryGroup() const diff --git a/src/openrct2/object/SmallSceneryObject.h b/src/openrct2/object/SmallSceneryObject.h index 48c8bdb2d7..c5684a965c 100644 --- a/src/openrct2/object/SmallSceneryObject.h +++ b/src/openrct2/object/SmallSceneryObject.h @@ -21,11 +21,6 @@ private: std::vector _frameOffsets; public: - explicit SmallSceneryObject(const rct_object_entry& entry) - : SceneryObject(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index 8f45a92405..6965a81592 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -29,11 +29,6 @@ public: int32_t Height{}; uint8_t ScrollingMode{}; - explicit StationObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/TerrainEdgeObject.h b/src/openrct2/object/TerrainEdgeObject.h index d55fb84d42..269acd67d3 100644 --- a/src/openrct2/object/TerrainEdgeObject.h +++ b/src/openrct2/object/TerrainEdgeObject.h @@ -21,11 +21,6 @@ public: uint32_t NumImagesLoaded{}; bool HasDoors{}; - explicit TerrainEdgeObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/TerrainSurfaceObject.h b/src/openrct2/object/TerrainSurfaceObject.h index c273ad42d6..fa50f885e9 100644 --- a/src/openrct2/object/TerrainSurfaceObject.h +++ b/src/openrct2/object/TerrainSurfaceObject.h @@ -56,11 +56,6 @@ public: uint32_t NumImagesLoaded{}; - explicit TerrainSurfaceObject(const rct_object_entry& entry) - : Object(entry) - { - } - void ReadJson(IReadObjectContext* context, json_t& root) override; void Load() override; void Unload() override; diff --git a/src/openrct2/object/WallObject.h b/src/openrct2/object/WallObject.h index a0948326ea..1189963071 100644 --- a/src/openrct2/object/WallObject.h +++ b/src/openrct2/object/WallObject.h @@ -18,11 +18,6 @@ private: WallSceneryEntry _legacyType = {}; public: - explicit WallObject(const rct_object_entry& entry) - : SceneryObject(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/object/WaterObject.h b/src/openrct2/object/WaterObject.h index bac5e274b5..34275a7ea4 100644 --- a/src/openrct2/object/WaterObject.h +++ b/src/openrct2/object/WaterObject.h @@ -20,11 +20,6 @@ private: rct_water_type _legacyType = {}; public: - explicit WaterObject(const rct_object_entry& entry) - : Object(entry) - { - } - void* GetLegacyData() override { return &_legacyType; diff --git a/src/openrct2/platform/platform.h b/src/openrct2/platform/platform.h index d3d898178b..af85318121 100644 --- a/src/openrct2/platform/platform.h +++ b/src/openrct2/platform/platform.h @@ -96,7 +96,6 @@ bool platform_ensure_directory_exists(const utf8* path); bool platform_directory_delete(const utf8* path); std::string platform_get_absolute_path(const utf8* relative_path, const utf8* base_path); bool platform_lock_single_instance(); -bool platform_place_string_on_clipboard(utf8* target); // Returns the bitmask of the GetLogicalDrives function for windows, 0 for other systems int32_t platform_get_drives(); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index af331393da..9b92a32d41 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1464,7 +1464,7 @@ namespace RCT1 } } - std::vector GetRequiredObjects() + ObjectList GetRequiredObjects() { std::vector result; AppendRequiredObjects(result, ObjectType::Ride, _rideEntries); @@ -1489,7 +1489,14 @@ namespace RCT1 })); AppendRequiredObjects(result, ObjectType::ParkEntrance, std::vector({ "PKENT1 " })); AppendRequiredObjects(result, ObjectType::Water, _waterEntry); - return result; + + ObjectList objectList; + for (rct_object_entry entry : result) + { + objectList.Add(ObjectEntryDescriptor(entry)); + } + + return objectList; } void ImportTileElements() @@ -3056,7 +3063,7 @@ void load_from_sv4(const utf8* path) auto& objectMgr = GetContext()->GetObjectManager(); auto s4Importer = std::make_unique(); auto result = s4Importer->LoadSavedGame(path); - objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectMgr.LoadObjects(result.RequiredObjects); s4Importer->Import(); } @@ -3065,6 +3072,6 @@ void load_from_sc4(const utf8* path) auto& objectMgr = GetContext()->GetObjectManager(); auto s4Importer = std::make_unique(); auto result = s4Importer->LoadScenario(path); - objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectMgr.LoadObjects(result.RequiredObjects); s4Importer->Import(); } diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 536eeabc4d..7905057840 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -161,7 +161,7 @@ namespace RCT1 assert(vehObjName != nullptr); std::memcpy(vehicleObject.name, vehObjName, std::min(String::SizeOf(vehObjName), static_cast(8))); } - std::memcpy(&td->vehicle_object, &vehicleObject, sizeof(rct_object_entry)); + td->vehicle_object = ObjectEntryDescriptor(vehicleObject); td->vehicle_type = td4Base.vehicle_type; td->flags = td4Base.flags; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 7a51974b18..aaad917ed9 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -266,14 +266,14 @@ static void ExportObjectList(IObjectManager& objMgr, T& objects) auto& dst = objects[i]; const auto* object = objMgr.GetLoadedObject(TObjectType, i); - if (object == nullptr || object->GetObjectEntry() == nullptr) + if (object == nullptr || object->GetGeneration() != ObjectGeneration::DAT) { // The sv6 format expects null/invalid entries to be filled with 0xFF. std::memset(&dst, 0xFF, sizeof(dst)); } else { - dst = *object->GetObjectEntry(); + dst = object->GetObjectEntry(); } } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index b92b7ed13c..4c1383cad6 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -32,6 +32,7 @@ #include "../management/Research.h" #include "../network/network.h" #include "../object/ObjectLimits.h" +#include "../object/ObjectList.h" #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" #include "../peep/Peep.h" @@ -1585,7 +1586,7 @@ public: } } - std::vector GetRequiredObjects() + ObjectList GetRequiredObjects() { std::vector result; @@ -1601,7 +1602,13 @@ public: AddRequiredObjects(result, _s6.WaterObjects); AddRequiredObjects(result, _s6.ScenarioTextObjects); - return result; + ObjectList objectList; + for (rct_object_entry entry : result) + { + objectList.Add(ObjectEntryDescriptor(entry)); + } + + return objectList; } }; @@ -1987,7 +1994,7 @@ void load_from_sv6(const char* path) { auto& objectMgr = context->GetObjectManager(); auto result = s6Importer->LoadSavedGame(path); - objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objectMgr.LoadObjects(result.RequiredObjects); s6Importer->Import(); game_fix_save_vars(); AutoCreateMapAnimations(); @@ -2027,7 +2034,7 @@ void load_from_sc6(const char* path) try { auto result = s6Importer->LoadScenario(path); - objManager.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size()); + objManager.LoadObjects(result.RequiredObjects); s6Importer->Import(); game_fix_save_vars(); AutoCreateMapAnimations(); diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index d45d97aa73..5893b357f4 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -128,7 +128,7 @@ public: td->track_support_colour[i] = td6.track_support_colour[i]; } td->flags2 = td6.flags2; - td->vehicle_object = td6.vehicle_object; + td->vehicle_object = ObjectEntryDescriptor(td6.vehicle_object); td->space_required_x = td6.space_required_x; td->space_required_y = td6.space_required_y; td->lift_hill_speed = td6.lift_hill_speed_num_circuits & 0b00011111; @@ -224,7 +224,7 @@ public: if (RCT2RideTypeNeedsConversion(td->type)) { std::scoped_lock lock(_objectLookupMutex); - auto rawObject = object_repository_load_object(&td->vehicle_object); + auto rawObject = object_repository_load_object(&td->vehicle_object.Entry); if (rawObject != nullptr) { const auto* rideEntry = static_cast( diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 3ea6e6d34d..7057a234d3 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -92,11 +92,18 @@ static void track_design_preview_clear_map(); rct_string_id TrackDesign::CreateTrackDesign(const Ride& ride) { type = ride.type; - auto object = object_entry_get_object(ObjectType::Ride, ride.subtype); - // Note we are only copying rct_object_entry in size and - // not the extended as we don't need the chunk size. - std::memcpy(&vehicle_object, object->GetObjectEntry(), sizeof(rct_object_entry)); + auto object = object_entry_get_object(ObjectType::Ride, ride.subtype); + if (object != nullptr) + { + auto entry = object->GetObjectEntry(); + if (entry.IsEmpty()) + { + // TODO create a new error message for `JSON objects are unsupported` + return STR_UNKNOWN_OBJECT_TYPE; + } + vehicle_object = ObjectEntryDescriptor(entry); + } ride_mode = ride.mode; colour_scheme = ride.colour_scheme_type & 3; @@ -595,7 +602,7 @@ void TrackDesign::Serialise(DataSerialiser& stream) stream << DS_TAG(track_rail_colour); stream << DS_TAG(track_support_colour); stream << DS_TAG(flags2); - stream << DS_TAG(vehicle_object); + stream << DS_TAG(vehicle_object.Entry); stream << DS_TAG(space_required_x); stream << DS_TAG(space_required_y); stream << DS_TAG(vehicle_additional_colour); @@ -632,11 +639,14 @@ std::unique_ptr track_design_open(const utf8* path) */ static void track_design_load_scenery_objects(TrackDesign* td6) { - object_manager_unload_all_objects(); + auto& objectManager = OpenRCT2::GetContext()->GetObjectManager(); + objectManager.UnloadAll(); // Load ride object - rct_object_entry* rideEntry = &td6->vehicle_object; - object_manager_load_object(rideEntry); + if (td6->vehicle_object.HasValue()) + { + objectManager.LoadObject(td6->vehicle_object); + } // Load scenery objects for (const auto& scenery : td6->scenery_elements) @@ -1886,12 +1896,8 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o *outRide = nullptr; *flags = 0; - ObjectType entry_type; - ObjectEntryIndex entry_index; - if (!find_object_in_entry_group(&td6->vehicle_object, &entry_type, &entry_index)) - { - entry_index = OBJECT_ENTRY_INDEX_NULL; - } + auto& objManager = GetContext()->GetObjectManager(); + auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicle_object); ride_id_t rideIndex; uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND; @@ -1956,7 +1962,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o if (resultCost != MONEY32_UNDEFINED) { - if (!find_object_in_entry_group(&td6->vehicle_object, &entry_type, &entry_index)) + if (entry_index == OBJECT_ENTRY_INDEX_NULL) { *flags |= TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE; } diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 4cf7615825..4bbfd49ed5 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -119,7 +119,7 @@ struct TrackDesign uint8_t track_rail_colour[RCT12_NUM_COLOUR_SCHEMES]; uint8_t track_support_colour[RCT12_NUM_COLOUR_SCHEMES]; uint32_t flags2; - rct_object_entry vehicle_object; + ObjectEntryDescriptor vehicle_object; uint8_t space_required_x; uint8_t space_required_y; uint8_t vehicle_additional_colour[RCT2_MAX_CARS_PER_TRAIN]; diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index 9af88aa3b8..cde8188203 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -82,7 +82,7 @@ public: item.Name = GetNameFromTrackPath(path); item.Path = path; item.RideType = td6->type; - item.ObjectEntry = std::string(td6->vehicle_object.name, 8); + item.ObjectEntry = std::string(td6->vehicle_object.Entry.name, 8); item.Flags = 0; if (IsTrackReadOnly(path)) { diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index eba7b9031a..3bd391b3be 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -193,11 +193,11 @@ static void track_design_save_push_tile_element(const CoordsXY& loc, TileElement * rct2: 0x006D2FA7 */ static void track_design_save_push_tile_element_desc( - const rct_object_entry* entry, const CoordsXYZ& loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour) + const rct_object_entry& entry, const CoordsXYZ& loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour) { auto tileLoc = TileCoordsXYZ(loc); TrackDesignSceneryElement item{}; - item.scenery_object = *entry; + item.scenery_object = entry; item.x = tileLoc.x; item.y = tileLoc.y; item.z = tileLoc.z; @@ -370,7 +370,7 @@ static void track_design_save_pop_tile_element(const CoordsXY& loc, TileElement* * * rct2: 0x006D2FDD */ -static void track_design_save_pop_tile_element_desc(const rct_object_entry* entry, const CoordsXYZ& loc, uint8_t flags) +static void track_design_save_pop_tile_element_desc(const rct_object_entry& entry, const CoordsXYZ& loc, uint8_t flags) { size_t removeIndex = SIZE_MAX; auto tileLoc = TileCoordsXYZ(loc); @@ -385,7 +385,7 @@ static void track_design_save_pop_tile_element_desc(const rct_object_entry* entr continue; if (item->flags != flags) continue; - if (!object_entry_compare(&item->scenery_object, entry)) + if (item->scenery_object != entry) continue; removeIndex = i; From 8cdece0252961e8a46e332c2984bb31763c9f116 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 13 Sep 2021 19:24:42 +0100 Subject: [PATCH 404/681] Fix incorrect objects in S6 import --- src/openrct2/rct2/S6Importer.cpp | 13 +++++++++++-- test/tests/PlayTests.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 4c1383cad6..d352da994f 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1603,9 +1603,18 @@ public: AddRequiredObjects(result, _s6.ScenarioTextObjects); ObjectList objectList; - for (rct_object_entry entry : result) + for (size_t i = 0; i < result.size(); i++) { - objectList.Add(ObjectEntryDescriptor(entry)); + ObjectType objectType; + ObjectEntryIndex entryIndex; + get_type_entry_index(i, &objectType, &entryIndex); + + auto desc = ObjectEntryDescriptor(result[i]); + if (desc.HasValue()) + { + assert(desc.GetType() == objectType); + objectList.SetObject(entryIndex, desc); + } } return objectList; diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 9ff2d3846e..55b5695373 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -46,7 +46,7 @@ static std::unique_ptr localStartGame(const std::string& parkPath) auto importer = ParkImporter::CreateS6(context->GetObjectRepository()); auto loadResult = importer->LoadSavedGame(parkPath.c_str(), false); - context->GetObjectManager().LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size()); + context->GetObjectManager().LoadObjects(loadResult.RequiredObjects); importer->Import(); reset_sprite_spatial_index(); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 327042c350..b878970784 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -78,7 +78,7 @@ static bool ImportSave(MemoryStream& stream, std::unique_ptr& context, auto importer = ParkImporter::CreateS6(context->GetObjectRepository()); auto loadResult = importer->LoadFromStream(&stream, false); - objManager.LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size()); + objManager.LoadObjects(loadResult.RequiredObjects); importer->Import(); GameInit(retainSpatialIndices); From 6a7084aa4d3b2d624c8f564467506b2b822d8379 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 15 Sep 2021 17:54:39 +0200 Subject: [PATCH 405/681] Fix formatting and TODO note --- src/openrct2/object/ObjectManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index b23e79a3b7..48ab6a226b 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -213,6 +213,7 @@ public: size_t numObjects = _objectRepository.GetNumObjects(); for (size_t i = 0; i < numObjects; i++) { + // TODO: remove ObjectGeneration::DAT check when the NSF is here const ObjectRepositoryItem* item = &_objectRepository.GetObjects()[i]; if (item->LoadedObject != nullptr && IsObjectCustom(item) && item->LoadedObject->GetLegacyData() != nullptr && item->LoadedObject->GetGeneration() == ObjectGeneration::DAT) @@ -377,14 +378,14 @@ private: { slot = FindSpareSlot(objectType); } - if (slot.has_value()) + if (slot.has_value()) { auto object = GetOrLoadObject(ori); if (object != nullptr) { if (_loadedObjects.size() <= static_cast(*slot)) { - _loadedObjects.resize(slot.value() + 1); + _loadedObjects.resize(slot.value() + 1); } loadedObject = object; _loadedObjects[slot.value()] = std::move(object); From adce8c998e3bffc1d5ba7bec1c63a5e5a5e5cc76 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 15 Sep 2021 17:58:42 +0200 Subject: [PATCH 406/681] Return early in RepositoryItemToObject() --- src/openrct2/object/ObjectManager.cpp | 59 +++++++++++++-------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 48ab6a226b..5bd6b55cb2 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -359,40 +359,39 @@ private: Object* RepositoryItemToObject(const ObjectRepositoryItem* ori, std::optional slot = {}) { - Object* loadedObject = nullptr; - if (ori != nullptr) + if (ori == nullptr) + return nullptr; + + Object* loadedObject = ori->LoadedObject.get(); + if (loadedObject != nullptr) + return loadedObject; + + ObjectType objectType = ori->Type; + if (slot) { - loadedObject = ori->LoadedObject.get(); - if (loadedObject == nullptr) + if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) { - ObjectType objectType = ori->Type; - if (slot) + // Slot already taken + return nullptr; + } + } + else + { + slot = FindSpareSlot(objectType); + } + if (slot.has_value()) + { + auto object = GetOrLoadObject(ori); + if (object != nullptr) + { + if (_loadedObjects.size() <= static_cast(*slot)) { - if (_loadedObjects.size() > static_cast(*slot) && _loadedObjects[*slot] != nullptr) - { - // Slot already taken - return nullptr; - } - } - else - { - slot = FindSpareSlot(objectType); - } - if (slot.has_value()) - { - auto object = GetOrLoadObject(ori); - if (object != nullptr) - { - if (_loadedObjects.size() <= static_cast(*slot)) - { - _loadedObjects.resize(slot.value() + 1); - } - loadedObject = object; - _loadedObjects[slot.value()] = std::move(object); - UpdateSceneryGroupIndexes(); - ResetTypeToRideEntryIndexMap(); - } + _loadedObjects.resize(slot.value() + 1); } + loadedObject = object; + _loadedObjects[slot.value()] = std::move(object); + UpdateSceneryGroupIndexes(); + ResetTypeToRideEntryIndexMap(); } } return loadedObject; From ecaf3617438c3dfd917de0336630a9956cea2fc5 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 15 Sep 2021 18:27:15 +0200 Subject: [PATCH 407/681] Revert porting errors --- src/openrct2/object/ObjectManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 5bd6b55cb2..38d24b1b1c 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -381,7 +381,7 @@ private: } if (slot.has_value()) { - auto object = GetOrLoadObject(ori); + auto* object = GetOrLoadObject(ori); if (object != nullptr) { if (_loadedObjects.size() <= static_cast(*slot)) @@ -389,7 +389,7 @@ private: _loadedObjects.resize(slot.value() + 1); } loadedObject = object; - _loadedObjects[slot.value()] = std::move(object); + _loadedObjects[slot.value()] = object; UpdateSceneryGroupIndexes(); ResetTypeToRideEntryIndexMap(); } From 51a7c2ad44e9f7ace8daa03662a599601c4692c3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 15 Sep 2021 22:42:32 +0200 Subject: [PATCH 408/681] Fix log_warning spam for OBJECT_ENTRY_INDEX_NULL --- src/openrct2/object/ObjectManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 38d24b1b1c..522a9b4963 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -69,6 +69,12 @@ public: Object* GetLoadedObject(ObjectType objectType, size_t index) override { + // This is sometimes done deliberately (to avoid boilerplate), so no need to log_warn for this. + if (index == OBJECT_ENTRY_INDEX_NULL) + { + return nullptr; + } + if (index >= static_cast(object_entry_group_counts[EnumValue(objectType)])) { #ifdef DEBUG From 16472a400f1c7e4e080c88712a1b310dada2ed65 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 16 Sep 2021 04:07:59 +0000 Subject: [PATCH 409/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ko-KR.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 7d0be43e29..5224b36576 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -412,7 +412,7 @@ STR_1023 :1대당 차량 {POP16}{POP16}{POP16}{COMMA16}개 STR_1024 :1대당 차량 {COMMA16}개 STR_1025 :1대당 차량 {COMMA16}개 STR_1026 :탑승장이 너무 깁니다! -STR_1027 :여기로 이동합니다 +STR_1027 :이동 STR_1028 :지도 끝을 벗어납니다! STR_1029 :일부분만 수면 위로 나오도록 건설할 수 없습니다! STR_1030 :수중에만 건설할 수 있습니다! @@ -3658,6 +3658,7 @@ STR_6454 :팻말 이름을 변경할 수 없습니다… STR_6455 :팻말 이름을 변경할 수 없습니다… STR_6456 :초대형 스크린 샷 STR_6457 :GitHub에 버그 제보 +STR_6458 :따라가기 ############# # Scenarios # From 427bb7b330c18fcef8bf2f602d28858208090658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 16 Sep 2021 06:28:02 -0700 Subject: [PATCH 410/681] Fix sv6 export not adding all objects (#15419) --- src/openrct2/rct2/S6Exporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index aaad917ed9..5fea5c0f05 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -266,7 +266,7 @@ static void ExportObjectList(IObjectManager& objMgr, T& objects) auto& dst = objects[i]; const auto* object = objMgr.GetLoadedObject(TObjectType, i); - if (object == nullptr || object->GetGeneration() != ObjectGeneration::DAT) + if (object == nullptr) { // The sv6 format expects null/invalid entries to be filled with 0xFF. std::memset(&dst, 0xFF, sizeof(dst)); From 4b4b3333d68c9594737c54f6a07585ae23237081 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 15 Sep 2021 22:22:15 +0200 Subject: [PATCH 411/681] Remove unnecessary else blocks --- src/openrct2-ui/UiContext.Linux.cpp | 3 +- src/openrct2-ui/WindowManager.cpp | 5 +- src/openrct2-ui/drawing/BitmapReader.cpp | 8 +- .../engines/opengl/TransparencyDepth.cpp | 4 +- src/openrct2-ui/input/InputManager.cpp | 28 +- src/openrct2-ui/input/MouseInput.cpp | 20 +- src/openrct2-ui/input/ShortcutInput.cpp | 58 ++-- src/openrct2-ui/interface/LandTool.cpp | 6 +- src/openrct2-ui/interface/Theme.cpp | 6 +- .../interface/ViewportInteraction.cpp | 8 +- src/openrct2-ui/scripting/CustomWindow.cpp | 16 +- .../scripting/ScGraphicsContext.hpp | 38 ++- src/openrct2-ui/scripting/ScTileSelection.hpp | 8 +- src/openrct2-ui/scripting/ScViewport.hpp | 12 +- src/openrct2-ui/scripting/ScWidget.hpp | 4 +- src/openrct2-ui/windows/Cheats.cpp | 5 +- .../windows/EditorObjectSelection.cpp | 12 +- src/openrct2-ui/windows/Footpath.cpp | 10 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/News.cpp | 4 +- src/openrct2-ui/windows/Options.cpp | 10 +- src/openrct2-ui/windows/Ride.cpp | 13 +- src/openrct2-ui/windows/RideConstruction.cpp | 20 +- src/openrct2-ui/windows/SavePrompt.cpp | 56 ++-- src/openrct2-ui/windows/ScenarioSelect.cpp | 4 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 6 +- src/openrct2-ui/windows/TopToolbar.cpp | 35 +-- src/openrct2/CmdlineSprite.cpp | 73 ++--- src/openrct2/Context.cpp | 12 +- src/openrct2/EditorObjectSelectionSession.cpp | 113 +++---- src/openrct2/actions/FootpathPlaceAction.cpp | 42 +-- .../actions/FootpathPlaceFromTrackAction.cpp | 12 +- src/openrct2/actions/FootpathRemoveAction.cpp | 3 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 3 +- src/openrct2/actions/RideSetSettingAction.cpp | 5 +- src/openrct2/actions/RideSetStatusAction.cpp | 3 +- src/openrct2/cmdline/CommandLine.cpp | 46 +-- src/openrct2/cmdline/RootCommands.cpp | 8 +- src/openrct2/cmdline/UriHandler.cpp | 8 +- src/openrct2/config/IniReader.cpp | 3 +- src/openrct2/core/EnumMap.hpp | 9 +- src/openrct2/core/Imaging.cpp | 9 +- src/openrct2/core/Path.cpp | 20 +- src/openrct2/core/String.cpp | 46 +-- src/openrct2/core/String.hpp | 6 +- src/openrct2/core/Zip.cpp | 14 +- src/openrct2/drawing/Drawing.Sprite.cpp | 123 ++++---- src/openrct2/drawing/Drawing.String.cpp | 275 +++++++++--------- src/openrct2/drawing/Drawing.cpp | 8 +- src/openrct2/drawing/Font.cpp | 16 +- src/openrct2/drawing/Image.cpp | 3 +- src/openrct2/drawing/Rect.cpp | 6 +- src/openrct2/drawing/ScrollingText.cpp | 6 +- src/openrct2/drawing/TTF.cpp | 6 +- src/openrct2/drawing/TTFSDLPort.cpp | 4 +- src/openrct2/interface/InteractiveConsole.cpp | 18 +- src/openrct2/interface/Screenshot.cpp | 44 ++- src/openrct2/interface/StdInOutConsole.cpp | 8 +- src/openrct2/interface/Viewport.cpp | 6 +- src/openrct2/interface/Window.cpp | 18 +- src/openrct2/interface/Window.h | 4 +- src/openrct2/interface/ZoomLevel.h | 8 +- .../localisation/ConversionTables.cpp | 5 +- src/openrct2/localisation/Convert.cpp | 8 +- src/openrct2/localisation/FormatCodes.cpp | 12 +- src/openrct2/localisation/Formatting.cpp | 7 +- src/openrct2/localisation/Formatting.h | 18 +- src/openrct2/localisation/Language.h | 18 +- src/openrct2/localisation/LanguagePack.cpp | 32 +- src/openrct2/localisation/Localisation.cpp | 6 +- src/openrct2/localisation/UTF8.cpp | 9 +- src/openrct2/management/NewsItem.cpp | 10 +- src/openrct2/management/Research.cpp | 41 +-- src/openrct2/network/NetworkBase.cpp | 38 +-- src/openrct2/network/NetworkKey.cpp | 4 +- src/openrct2/network/NetworkPacket.cpp | 10 +- src/openrct2/network/NetworkUser.cpp | 10 +- src/openrct2/network/ServerList.cpp | 22 +- src/openrct2/network/Socket.cpp | 48 ++- src/openrct2/object/MusicObject.cpp | 14 +- src/openrct2/object/Object.cpp | 38 +-- src/openrct2/object/ObjectManager.cpp | 2 +- src/openrct2/object/ObjectRepository.cpp | 18 +- src/openrct2/object/ObjectRepository.h | 4 +- src/openrct2/object/RideObject.cpp | 4 +- src/openrct2/paint/PaintHelpers.cpp | 47 ++- src/openrct2/paint/VirtualFloor.cpp | 3 +- src/openrct2/peep/Guest.cpp | 42 ++- src/openrct2/peep/GuestPathfinding.cpp | 12 +- src/openrct2/peep/Peep.cpp | 51 ++-- src/openrct2/peep/Staff.cpp | 10 +- src/openrct2/platform/Linux.cpp | 4 +- src/openrct2/platform/Platform.Posix.cpp | 26 +- src/openrct2/platform/Platform.Win32.cpp | 10 +- src/openrct2/platform/Windows.cpp | 58 ++-- src/openrct2/rct1/S4Importer.cpp | 30 +- src/openrct2/rct1/T4Importer.cpp | 12 +- src/openrct2/rct1/Tables.cpp | 4 +- src/openrct2/rct12/RCT12.cpp | 14 +- src/openrct2/rct12/SawyerEncoding.cpp | 8 +- src/openrct2/rct2/RCT2.cpp | 15 +- src/openrct2/rct2/S6Importer.cpp | 10 +- src/openrct2/rct2/T6Importer.cpp | 6 +- src/openrct2/ride/CableLift.cpp | 38 +-- src/openrct2/ride/Ride.cpp | 42 ++- src/openrct2/ride/RideAudio.cpp | 24 +- src/openrct2/ride/Track.cpp | 66 ++--- src/openrct2/ride/TrackDesign.cpp | 26 +- src/openrct2/ride/TrackDesignRepository.cpp | 6 +- src/openrct2/ride/Vehicle.cpp | 124 ++++---- src/openrct2/scenario/Scenario.cpp | 6 +- src/openrct2/scenario/ScenarioRepository.cpp | 65 ++--- src/openrct2/scripting/Duktape.hpp | 40 ++- src/openrct2/scripting/ScriptEngine.cpp | 66 ++--- .../scripting/bindings/entity/ScEntity.hpp | 6 +- .../bindings/game/ScConfiguration.hpp | 8 +- .../scripting/bindings/world/ScScenario.hpp | 2 +- src/openrct2/title/TitleSequence.cpp | 2 +- src/openrct2/title/TitleSequenceManager.cpp | 2 +- src/openrct2/util/SawyerCoding.cpp | 6 +- src/openrct2/util/Util.cpp | 21 +- src/openrct2/windows/_legacy.cpp | 83 +++--- src/openrct2/world/Climate.cpp | 18 +- src/openrct2/world/Entrance.cpp | 8 +- src/openrct2/world/Footpath.cpp | 37 ++- src/openrct2/world/Location.hpp | 6 +- src/openrct2/world/Map.cpp | 32 +- src/openrct2/world/MapAnimation.cpp | 6 +- src/openrct2/world/MapGen.cpp | 4 +- src/openrct2/world/Park.cpp | 6 +- src/openrct2/world/TileInspector.cpp | 6 +- 132 files changed, 1257 insertions(+), 1632 deletions(-) diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index 8c31867de2..4e032c452f 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -204,8 +204,7 @@ namespace OpenRCT2::Ui ShowMessageBox(window, msg); return ShowFileDialog(window, desc); } - else if ( - desc.Type == FILE_DIALOG_TYPE::SAVE && access(result.c_str(), F_OK) != -1 && dtype == DIALOG_TYPE::KDIALOG) + if (desc.Type == FILE_DIALOG_TYPE::SAVE && access(result.c_str(), F_OK) != -1 && dtype == DIALOG_TYPE::KDIALOG) { std::string cmd = String::StdFormat("%s --yesno \"Overwrite %s?\"", executablePath.c_str(), result.c_str()); if (Platform::Execute(cmd) != 0) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index be2ace022c..813806aa18 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -156,10 +156,7 @@ public: { return this->OpenWindow(WC_RESEARCH); } - else - { - return window_new_ride_open_research(); - } + return window_new_ride_open_research(); case WV_MAZE_CONSTRUCTION: return window_maze_construction_open(); case WV_NETWORK_PASSWORD: diff --git a/src/openrct2-ui/drawing/BitmapReader.cpp b/src/openrct2-ui/drawing/BitmapReader.cpp index 78b565d81d..0058118a00 100644 --- a/src/openrct2-ui/drawing/BitmapReader.cpp +++ b/src/openrct2-ui/drawing/BitmapReader.cpp @@ -88,11 +88,9 @@ static Image ReadBitmap(std::istream& istream, IMAGE_FORMAT format) return image; } - else - { - SDL_FreeSurface(bitmap); - throw std::runtime_error("Unable to lock surface."); - } + + SDL_FreeSurface(bitmap); + throw std::runtime_error("Unable to lock surface."); } else { diff --git a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp index 7fe9d33021..928c24d8e1 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp @@ -57,8 +57,8 @@ static inline SweepLine CreateXList(const RectCommandBatch& transparent) 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; - else - return !a.begin && b.begin; + + return !a.begin && b.begin; }); return x_sweep; diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 4110975caf..2cbd626821 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -188,28 +188,28 @@ void InputManager::Process(const InputEvent& e) } return; } - else if (gChatOpen) + + if (gChatOpen) { ProcessChat(e); return; } - else + + if (e.DeviceKind == InputDeviceKind::Keyboard) { - if (e.DeviceKind == InputDeviceKind::Keyboard) + auto w = window_find_by_class(WC_TEXTINPUT); + if (w != nullptr) { - auto w = window_find_by_class(WC_TEXTINPUT); - if (w != nullptr) + if (e.State == InputEventState::Release) { - if (e.State == InputEventState::Release) - { - window_text_input_key(w, e.Button); - } - return; - } - else if (gUsingWidgetTextBox) - { - return; + window_text_input_key(w, e.Button); } + return; + } + + if (gUsingWidgetTextBox) + { + return; } } } diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index b875acab4c..40186e2f5f 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -145,12 +145,10 @@ static MouseState GameGetNextInput(ScreenCoordsXY& screenCoords) screenCoords = cursorState->position; return MouseState::Released; } - else - { - screenCoords.x = input->x; - screenCoords.y = input->y; - return input->state; - } + + screenCoords.x = input->x; + screenCoords.y = input->y; + return input->state; } /** @@ -164,12 +162,10 @@ static RCTMouseData* GetMouseInput() { return nullptr; } - else - { - RCTMouseData* result = &_mouseInputQueue[_mouseInputQueueReadIndex]; - _mouseInputQueueReadIndex = (_mouseInputQueueReadIndex + 1) % std::size(_mouseInputQueue); - return result; - } + + RCTMouseData* result = &_mouseInputQueue[_mouseInputQueueReadIndex]; + _mouseInputQueueReadIndex = (_mouseInputQueueReadIndex + 1) % std::size(_mouseInputQueue); + return result; } /** diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index c1a4c0f1a8..5607b009b5 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -27,54 +27,52 @@ static uint32_t ParseModifier(std::string_view text) { return KMOD_CTRL; } - else if (String::Equals(text, "LCTRL", true)) + if (String::Equals(text, "LCTRL", true)) { return KMOD_LCTRL; } - else if (String::Equals(text, "RCTRL", true)) + if (String::Equals(text, "RCTRL", true)) { return KMOD_RCTRL; } - else if (String::Equals(text, "SHIFT", true)) + if (String::Equals(text, "SHIFT", true)) { return KMOD_SHIFT; } - else if (String::Equals(text, "LSHIFT", true)) + if (String::Equals(text, "LSHIFT", true)) { return KMOD_LSHIFT; } - else if (String::Equals(text, "RSHIFT", true)) + if (String::Equals(text, "RSHIFT", true)) { return KMOD_RSHIFT; } - else if (String::Equals(text, "ALT", true)) + if (String::Equals(text, "ALT", true)) { return KMOD_ALT; } - else if (String::Equals(text, "LALT", true)) + if (String::Equals(text, "LALT", true)) { return KMOD_LALT; } - else if (String::Equals(text, "RALT", true)) + if (String::Equals(text, "RALT", true)) { return KMOD_RALT; } - else if (String::Equals(text, "GUI", true)) + if (String::Equals(text, "GUI", true)) { return KMOD_GUI; } - else if (String::Equals(text, "LCTRL", true)) + if (String::Equals(text, "LCTRL", true)) { return KMOD_LGUI; } - else if (String::Equals(text, "RGUI", true)) + if (String::Equals(text, "RGUI", true)) { return KMOD_RGUI; } - else - { - return 0; - } + + return 0; } static uint32_t ParseKey(std::string_view text) @@ -99,10 +97,8 @@ static size_t FindPlus(std::string_view s, size_t index) index++; continue; } - else - { - break; - } + + break; } return index; } @@ -209,15 +205,11 @@ std::string_view ShortcutInput::GetModifierName(uint32_t key, bool localised) { return language_get_string(r->second.second); } - else - { - return r->second.first; - } - } - else - { - return {}; + + return r->second.first; } + + return {}; } std::string_view ShortcutInput::GetLocalisedKeyName(uint32_t key) @@ -260,10 +252,8 @@ std::string_view ShortcutInput::GetLocalisedKeyName(uint32_t key) { return language_get_string(r->second); } - else - { - return {}; - } + + return {}; } std::string ShortcutInput::ToString() const @@ -350,13 +340,13 @@ bool ShortcutInput::AppendModifier(std::string& s, uint32_t left, uint32_t right s += "+"; return true; } - else if (Modifiers & left) + if (Modifiers & left) { s += GetModifierName(left, localised); s += "+"; return true; } - else if (Modifiers & right) + if (Modifiers & right) { s += GetModifierName(right, localised); s += "+"; @@ -379,7 +369,7 @@ static bool HasModifier(uint32_t shortcut, uint32_t actual, uint32_t left, uint3 } return false; } - else if (actual & (left | right)) + if (actual & (left | right)) { return false; } diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 8301bd02ed..f6a0a0deb4 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -50,10 +50,8 @@ uint32_t LandTool::SizeToSpriteIndex(uint16_t size) { return toolSizeSpriteIndices[size]; } - else - { - return 0xFFFFFFFF; - } + + return 0xFFFFFFFF; } void LandTool::ShowSurfaceStyleDropdown(rct_window* w, rct_widget* widget, ObjectEntryIndex currentSurfaceType) diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 192d04d23a..5384a6287d 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -743,10 +743,8 @@ uint8_t ThemeGetColour(rct_windowclass wc, uint8_t index) } return desc->DefaultTheme.Colours[index]; } - else - { - return entry->Theme.Colours[index]; - } + + return entry->Theme.Colours[index]; } void ThemeSetColour(rct_windowclass wc, uint8_t index, colour_t colour) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 9b77d36303..214affeb64 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -79,11 +79,9 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord { if (info.SpriteType == ViewportInteractionItem::Entity && (sprite->Is() || sprite->Is())) return info; - else - { - info.SpriteType = ViewportInteractionItem::None; - return info; - } + + info.SpriteType = ViewportInteractionItem::None; + return info; } switch (info.SpriteType) diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 2765c06daf..5573233436 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -354,17 +354,15 @@ namespace OpenRCT2::Ui::Windows { return &Desc.Widgets[widgetDescIndex]; } - else + + auto page = static_cast(w->page); + if (Desc.Tabs.size() > page) { - auto page = static_cast(w->page); - if (Desc.Tabs.size() > page) + auto& widgets = Desc.Tabs[page].Widgets; + auto tabWidgetIndex = widgetDescIndex - Desc.Widgets.size(); + if (tabWidgetIndex < widgets.size()) { - auto& widgets = Desc.Tabs[page].Widgets; - auto tabWidgetIndex = widgetDescIndex - Desc.Widgets.size(); - if (tabWidgetIndex < widgets.size()) - { - return &widgets[widgetDescIndex]; - } + return &widgets[widgetDescIndex]; } } } diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index 046ad972e6..08c0edf1cd 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -152,29 +152,27 @@ namespace OpenRCT2::Scripting { return ToDuk(_ctx, undefined); } + + DukObject obj(_ctx); + obj.Set("id", id); + obj.Set("offset", ToDuk(_ctx, { g1->x_offset, g1->y_offset })); + obj.Set("width", g1->width); + obj.Set("height", g1->height); + + obj.Set("isBMP", (g1->flags & G1_FLAG_BMP) != 0); + obj.Set("isRLE", (g1->flags & G1_FLAG_RLE_COMPRESSION) != 0); + obj.Set("isPalette", (g1->flags & G1_FLAG_PALETTE) != 0); + obj.Set("noZoom", (g1->flags & G1_FLAG_NO_ZOOM_DRAW) != 0); + + if (g1->flags & G1_FLAG_HAS_ZOOM_SPRITE) + { + obj.Set("nextZoomId", id - g1->zoomed_offset); + } else { - DukObject obj(_ctx); - obj.Set("id", id); - obj.Set("offset", ToDuk(_ctx, { g1->x_offset, g1->y_offset })); - obj.Set("width", g1->width); - obj.Set("height", g1->height); - - obj.Set("isBMP", (g1->flags & G1_FLAG_BMP) != 0); - obj.Set("isRLE", (g1->flags & G1_FLAG_RLE_COMPRESSION) != 0); - obj.Set("isPalette", (g1->flags & G1_FLAG_PALETTE) != 0); - obj.Set("noZoom", (g1->flags & G1_FLAG_NO_ZOOM_DRAW) != 0); - - if (g1->flags & G1_FLAG_HAS_ZOOM_SPRITE) - { - obj.Set("nextZoomId", id - g1->zoomed_offset); - } - else - { - obj.Set("nextZoomId", undefined); - } - return obj.Take(); + obj.Set("nextZoomId", undefined); } + return obj.Take(); } DukValue measureText(const std::string& text) diff --git a/src/openrct2-ui/scripting/ScTileSelection.hpp b/src/openrct2-ui/scripting/ScTileSelection.hpp index 365c99f91c..b504d54d20 100644 --- a/src/openrct2-ui/scripting/ScTileSelection.hpp +++ b/src/openrct2-ui/scripting/ScTileSelection.hpp @@ -45,11 +45,9 @@ namespace OpenRCT2::Scripting range.Set("rightBottom", rightBottom.Take()); return range.Take(); } - else - { - duk_push_null(_ctx); - return DukValue::take_from_stack(_ctx); - } + + duk_push_null(_ctx); + return DukValue::take_from_stack(_ctx); } void range_set(DukValue value) diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 88d0251bd6..c95570b2b4 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -245,8 +245,8 @@ namespace OpenRCT2::Scripting { if (_class == WC_MAIN_WINDOW) return window_get_main(); - else - return window_find_by_number(_class, _number); + + return window_find_by_number(_class, _number); } rct_viewport* GetViewport() const @@ -292,11 +292,9 @@ namespace OpenRCT2::Scripting { return CoordsXYZ(x, y, dukZ.as_int()); } - else - { - auto z = tile_element_height(CoordsXY(x, y)); - return CoordsXYZ(x, y, z); - } + + auto z = tile_element_height(CoordsXY(x, y)); + return CoordsXYZ(x, y, z); } } return std::nullopt; diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index cc719a8312..79e16f913d 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -386,8 +386,8 @@ namespace OpenRCT2::Scripting { if (_class == WC_MAIN_WINDOW) return window_get_main(); - else - return window_find_by_number(_class, _number); + + return window_find_by_number(_class, _number); } rct_widget* GetWidget() const diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index c763c26f2e..fed09f35f9 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -1003,11 +1003,12 @@ private: { return; } - else if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) + + if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) { CheatsSet(CheatType::ForceWeather, dropdownIndex); } - else if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) + if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) { int32_t speed = CHEATS_STAFF_FAST_SPEED; switch (dropdownIndex) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 15aeeb1dd1..16d586ecb0 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1452,14 +1452,12 @@ static bool filter_selected(uint8_t objectFlag) { return true; } - else if (_FILTER_NONSELECTED && !(objectFlag & OBJECT_SELECTION_FLAG_SELECTED)) + if (_FILTER_NONSELECTED && !(objectFlag & OBJECT_SELECTION_FLAG_SELECTED)) { return true; } - else - { - return false; - } + + return false; } static bool filter_string(const ObjectRepositoryItem* item) @@ -1611,6 +1609,6 @@ static ObjectType get_selected_object_type(rct_window* w) auto tab = w->selected_tab; if (tab >= EnumValue(ObjectType::ScenarioText)) return static_cast(tab + 1); - else - return static_cast(tab); + + return static_cast(tab); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 2d5c92ee1a..d8f5ba97ef 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1158,7 +1158,7 @@ static TileElement* footpath_get_tile_element_to_remove() return tileElement; } - else if (tileElement->GetBaseZ() == zLow) + if (tileElement->GetBaseZ() == zLow) { if (!tileElement->AsPath()->IsSloped()) { @@ -1421,11 +1421,9 @@ static bool FootpathSelectDefault() // No surfaces or legacy paths available return false; } - else - { - // No surfaces available, so default to legacy path - gFootpathSelection.LegacyPath = legacyPathIndex; - } + + // No surfaces available, so default to legacy path + gFootpathSelection.LegacyPath = legacyPathIndex; } gFootpathSelection.NormalSurface = surfaceIndex; diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index c601b19dba..d35e4b6145 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -821,8 +821,8 @@ static void window_new_ride_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i { if (rideEntry->ride_type[i] == listItem->Type) break; - else - imageId++; + + imageId++; } gfx_draw_sprite_raw_masked(dpi, coords + ScreenCoordsXY{ 2, 2 }, SPR_NEW_RIDE_MASK, imageId); diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index ade37acd2f..fe03f1c266 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -139,12 +139,12 @@ public: buttonIndex = 0; break; } - else if (mutableScreenCoords.x < 351 && newsItem.TypeHasSubject()) + if (mutableScreenCoords.x < 351 && newsItem.TypeHasSubject()) { buttonIndex = 1; break; } - else if (mutableScreenCoords.x < 376 && newsItem.TypeHasLocation()) + if (mutableScreenCoords.x < 376 && newsItem.TypeHasLocation()) { buttonIndex = 2; break; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index b1aba0fa3a..6299fcc0f1 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2172,12 +2172,10 @@ static OpenRCT2String window_options_advanced_tooltip( // No tooltip if the path is empty return { STR_NONE, {} }; } - else - { - auto ft = Formatter(); - ft.Add(gConfigGeneral.rct1_path); - return { fallback, ft }; - } + + auto ft = Formatter(); + ft.Add(gConfigGeneral.rct1_path); + return { fallback, ft }; } return { fallback, {} }; } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index c6952972b6..a4249d37c9 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1911,14 +1911,11 @@ static RideStatus window_ride_get_next_default_status(const Ride* ride) { return RideStatus::Closed; } - else if (ride->SupportsStatus(RideStatus::Testing) && !(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + if (ride->SupportsStatus(RideStatus::Testing) && !(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) { return RideStatus::Testing; } - else - { - return RideStatus::Open; - } + return RideStatus::Open; case RideStatus::Simulating: return RideStatus::Testing; case RideStatus::Testing: @@ -6023,10 +6020,8 @@ static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widget ft.Add(measurement->vehicle_index + 1); return { fallback, ft }; } - else - { - return message; - } + + return message; } } else diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b480d393a3..6d252746dc 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1315,21 +1315,21 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownLarge | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL && _currentTrackBankEnd == TRACK_BANK_LEFT) + if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL && _currentTrackBankEnd == TRACK_BANK_LEFT) { _currentTrackCurve = TrackElemType::LeftHalfBankedHelixDownSmall | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT_SMALL && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT_SMALL && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownSmall | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1346,7 +1346,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeDown | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1365,7 +1365,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT) { _currentTrackCurve = TrackElemType::RightQuarterHelixLargeDown | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1447,21 +1447,21 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpLarge | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL && _currentTrackBankEnd == TRACK_BANK_LEFT) + if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL && _currentTrackBankEnd == TRACK_BANK_LEFT) { _currentTrackCurve = TrackElemType::LeftHalfBankedHelixUpSmall | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT_SMALL && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT_SMALL && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpSmall | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1478,7 +1478,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT && _currentTrackBankEnd == TRACK_BANK_RIGHT) { _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeUp | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; @@ -1497,7 +1497,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi window_ride_construction_update_active_elements(); break; } - else if (_currentTrackCurve == TRACK_CURVE_RIGHT) + if (_currentTrackCurve == TRACK_CURVE_RIGHT) { _currentTrackCurve = TrackElemType::RightQuarterHelixLargeUp | RideConstructionSpecialPieceSelected; _currentTrackPrice = MONEY32_UNDEFINED; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 96e8b886ea..476e1f647f 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -208,38 +208,36 @@ static void window_save_prompt_mouseup(rct_window* w, rct_widgetindex widgetInde } return; } - else - { - switch (widgetIndex) - { - case WIDX_SAVE: - { - Intent* intent; - if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) - { - intent = new Intent(WC_LOADSAVE); - intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent->putExtra(INTENT_EXTRA_PATH, gScenarioName); - } - else - { - intent = static_cast(create_save_game_as_intent()); - } - window_close(w); - intent->putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(window_save_prompt_callback)); - context_open_intent(intent); - delete intent; - break; + switch (widgetIndex) + { + case WIDX_SAVE: + { + Intent* intent; + + if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) + { + intent = new Intent(WC_LOADSAVE); + intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent->putExtra(INTENT_EXTRA_PATH, gScenarioName); } - case WIDX_DONT_SAVE: - game_load_or_quit_no_save_prompt(); - return; - case WIDX_CLOSE: - case WIDX_CANCEL: - window_close(w); - return; + else + { + intent = static_cast(create_save_game_as_intent()); + } + window_close(w); + intent->putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(window_save_prompt_callback)); + context_open_intent(intent); + delete intent; + break; } + case WIDX_DONT_SAVE: + game_load_or_quit_no_save_prompt(); + return; + case WIDX_CLOSE: + case WIDX_CANCEL: + window_close(w); + return; } } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 46884719ba..99f14c0f87 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -147,8 +147,8 @@ static int32_t ScenarioSelectGetWindowWidth() // Shrink the window if we're showing scenarios by difficulty level. if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_DIFFICULTY && !_titleEditor) return 610; - else - return WW; + + return WW; } rct_window* window_scenarioselect_open(scenarioselect_callback callback, bool titleEditor) diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 0f01475ba5..6c5ad604f0 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -350,10 +350,8 @@ private: } return true; } - else - { - return group == groupFilter; - } + + return group == groupFilter; } void InitialiseList() diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 2de7cecde5..9dab6e0c82 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1706,7 +1706,8 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos repaint_scenery_tool_down(windowPos, widgetIndex); return; } - else if (gWindowSceneryEyedropperEnabled) + + if (gWindowSceneryEyedropperEnabled) { scenery_eyedropper_tool_down(windowPos, widgetIndex); return; @@ -3008,16 +3009,14 @@ static money64 selection_raise_land(uint8_t flags) : GameActions::Query(&landSmoothAction); return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } - else - { - auto landRaiseAction = LandRaiseAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); - auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landRaiseAction) - : GameActions::Query(&landRaiseAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; - } + auto landRaiseAction = LandRaiseAction( + { centreX, centreY }, { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gMapSelectType); + auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landRaiseAction) + : GameActions::Query(&landRaiseAction); + + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } /** @@ -3041,16 +3040,14 @@ static money64 selection_lower_land(uint8_t flags) : GameActions::Query(&landSmoothAction); return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } - else - { - auto landLowerAction = LandLowerAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); - auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landLowerAction) - : GameActions::Query(&landLowerAction); - return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; - } + auto landLowerAction = LandLowerAction( + { centreX, centreY }, { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gMapSelectType); + auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landLowerAction) + : GameActions::Query(&landLowerAction); + + return res->Error == GameActions::Status::Ok ? res->Cost : MONEY64_UNDEFINED; } /** diff --git a/src/openrct2/CmdlineSprite.cpp b/src/openrct2/CmdlineSprite.cpp index 2a0234db4a..78bbe21145 100644 --- a/src/openrct2/CmdlineSprite.cpp +++ b/src/openrct2/CmdlineSprite.cpp @@ -267,7 +267,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) fprintf(stdout, "usage: sprite details [idx]\n"); return -1; } - else if (argc == 2) + + if (argc == 2) { const char* spriteFilePath = argv[1]; auto spriteFile = SpriteFile::Open(spriteFilePath); @@ -281,33 +282,32 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) printf("data size: %u\n", spriteFile->Header.total_size); return 1; } - else + + const char* spriteFilePath = argv[1]; + int32_t spriteIndex = atoi(argv[2]); + auto spriteFile = SpriteFile::Open(spriteFilePath); + if (!spriteFile.has_value()) { - const char* spriteFilePath = argv[1]; - int32_t spriteIndex = atoi(argv[2]); - auto spriteFile = SpriteFile::Open(spriteFilePath); - if (!spriteFile.has_value()) - { - fprintf(stderr, "Unable to open input sprite file.\n"); - return -1; - } - - if (spriteIndex < 0 || spriteIndex >= static_cast(spriteFile->Header.num_entries)) - { - fprintf(stderr, "Sprite #%d does not exist in sprite file.\n", spriteIndex); - return -1; - } - - rct_g1_element* g1 = &spriteFile->Entries[spriteIndex]; - printf("width: %d\n", g1->width); - printf("height: %d\n", g1->height); - printf("x offset: %d\n", g1->x_offset); - printf("y offset: %d\n", g1->y_offset); - printf("data offset: %p\n", g1->offset); - return 1; + fprintf(stderr, "Unable to open input sprite file.\n"); + return -1; } + + if (spriteIndex < 0 || spriteIndex >= static_cast(spriteFile->Header.num_entries)) + { + fprintf(stderr, "Sprite #%d does not exist in sprite file.\n", spriteIndex); + return -1; + } + + rct_g1_element* g1 = &spriteFile->Entries[spriteIndex]; + printf("width: %d\n", g1->width); + printf("height: %d\n", g1->height); + printf("x offset: %d\n", g1->x_offset); + printf("y offset: %d\n", g1->y_offset); + printf("data offset: %p\n", g1->offset); + return 1; } - else if (_strcmpi(argv[0], "export") == 0) + + if (_strcmpi(argv[0], "export") == 0) { if (argc < 4) { @@ -339,7 +339,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) } return 1; } - else if (_strcmpi(argv[0], "exportall") == 0) + + if (_strcmpi(argv[0], "exportall") == 0) { if (argc < 3) { @@ -409,7 +410,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) } return 1; } - else if (_strcmpi(argv[0], "exportalldat") == 0) + + if (_strcmpi(argv[0], "exportalldat") == 0) { if (argc < 3) { @@ -498,7 +500,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) } return 1; } - else if (_strcmpi(argv[0], "create") == 0) + + if (_strcmpi(argv[0], "create") == 0) { if (argc < 2) { @@ -512,7 +515,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) spriteFile.Save(spriteFilePath); return 1; } - else if (_strcmpi(argv[0], "append") == 0) + + if (_strcmpi(argv[0], "append") == 0) { if (argc != 3 && argc != 5) { @@ -562,7 +566,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) return 1; } - else if (_strcmpi(argv[0], "build") == 0) + + if (_strcmpi(argv[0], "build") == 0) { if (argc < 3) { @@ -650,9 +655,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) fprintf(stdout, "Finished\n"); return 1; } - else - { - fprintf(stderr, "Unknown sprite command.\n"); - return 1; - } + + fprintf(stderr, "Unknown sprite command.\n"); + return 1; } diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d7bdaf38e5..b0db04d1f8 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -588,15 +588,13 @@ namespace OpenRCT2 } return true; } - else + + auto fs = FileStream(path, FILE_MODE_OPEN); + if (!LoadParkFromStream(&fs, path, loadTitleScreenOnFail)) { - auto fs = FileStream(path, FILE_MODE_OPEN); - if (!LoadParkFromStream(&fs, path, loadTitleScreenOnFail)) - { - return false; - } - return true; + return false; } + return true; } catch (const std::exception& e) { diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index c74a861a48..7b276dfe11 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -503,12 +503,14 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_ { return true; } - else if (*selectionFlags & OBJECT_SELECTION_FLAG_IN_USE) + + if (*selectionFlags & OBJECT_SELECTION_FLAG_IN_USE) { set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_CURRENTLY_IN_USE); return false; } - else if (*selectionFlags & OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED) + + if (*selectionFlags & OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED) { set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_ALWAYS_REQUIRED); return false; @@ -527,66 +529,65 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_ *selectionFlags &= ~OBJECT_SELECTION_FLAG_SELECTED; return true; } - else + + if (isMasterObject == 0) { - if (isMasterObject == 0) + if (flags & INPUT_FLAG_EDITOR_OBJECT_ALWAYS_REQUIRED) { - if (flags & INPUT_FLAG_EDITOR_OBJECT_ALWAYS_REQUIRED) - { - *selectionFlags |= OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED; - } - } - if (*selectionFlags & OBJECT_SELECTION_FLAG_SELECTED) - { - return true; + *selectionFlags |= OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED; } + } - ObjectType objectType = item->Type; - uint16_t maxObjects = object_entry_group_counts[EnumValue(objectType)]; - - if (maxObjects <= _numSelectedObjectsForType[EnumValue(objectType)]) - { - set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED); - return false; - } - - if (objectType == ObjectType::SceneryGroup && (flags & INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP)) - { - for (const auto& sgEntry : item->SceneryGroupInfo.Entries) - { - if (!window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry)) - { - _maxObjectsWasHit = true; - } - } - } - else if (objectType == ObjectType::Water) - { - // Replace old palette with newly selected palette immediately. - ReplaceSelectedWaterPalette(item); - } - - if (isMasterObject != 0 && !(flags & INPUT_FLAG_EDITOR_OBJECT_1)) - { - char objectName[64]; - object_create_identifier_name(objectName, 64, &item->ObjectEntry); - auto ft = Formatter::Common(); - ft.Add(objectName); - set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_SHOULD_SELECT_X_FIRST); - return false; - } - - if (maxObjects <= _numSelectedObjectsForType[EnumValue(objectType)]) - { - set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED); - return false; - } - - _numSelectedObjectsForType[EnumValue(objectType)]++; - - *selectionFlags |= OBJECT_SELECTION_FLAG_SELECTED; + if (*selectionFlags & OBJECT_SELECTION_FLAG_SELECTED) + { return true; } + + ObjectType objectType = item->Type; + uint16_t maxObjects = object_entry_group_counts[EnumValue(objectType)]; + + if (maxObjects <= _numSelectedObjectsForType[EnumValue(objectType)]) + { + set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED); + return false; + } + + if (objectType == ObjectType::SceneryGroup && (flags & INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP)) + { + for (const auto& sgEntry : item->SceneryGroupInfo.Entries) + { + if (!window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry)) + { + _maxObjectsWasHit = true; + } + } + } + else if (objectType == ObjectType::Water) + { + // Replace old palette with newly selected palette immediately. + ReplaceSelectedWaterPalette(item); + } + + if (isMasterObject != 0 && !(flags & INPUT_FLAG_EDITOR_OBJECT_1)) + { + char objectName[64]; + object_create_identifier_name(objectName, 64, &item->ObjectEntry); + auto ft = Formatter::Common(); + ft.Add(objectName); + set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_SHOULD_SELECT_X_FIRST); + return false; + } + + if (maxObjects <= _numSelectedObjectsForType[EnumValue(objectType)]) + { + set_object_selection_error(isMasterObject, STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED); + return false; + } + + _numSelectedObjectsForType[EnumValue(objectType)]++; + + *selectionFlags |= OBJECT_SELECTION_FLAG_SELECTED; + return true; } bool window_editor_object_selection_select_object( diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index de6bda9fa8..df93c33327 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -106,10 +106,7 @@ GameActions::Result::Ptr FootpathPlaceAction::Query() const { return ElementInsertQuery(std::move(res)); } - else - { - return ElementUpdateQuery(tileElement, std::move(res)); - } + return ElementUpdateQuery(tileElement, std::move(res)); } GameActions::Result::Ptr FootpathPlaceAction::Execute() const @@ -150,10 +147,7 @@ GameActions::Result::Ptr FootpathPlaceAction::Execute() const { return ElementInsertExecute(std::move(res)); } - else - { - return ElementUpdateExecute(tileElement, std::move(res)); - } + return ElementUpdateExecute(tileElement, std::move(res)); } bool FootpathPlaceAction::IsSameAsPathElement(const PathElement* pathElement) const @@ -169,22 +163,16 @@ bool FootpathPlaceAction::IsSameAsPathElement(const PathElement* pathElement) co { return false; } - else - { - return pathElement->GetSurfaceEntryIndex() == _type && pathElement->GetRailingsEntryIndex() == _railingsType; - } + + return pathElement->GetSurfaceEntryIndex() == _type && pathElement->GetRailingsEntryIndex() == _railingsType; } - else + + if (_constructFlags & PathConstructFlag::IsLegacyPathObject) { - if (_constructFlags & PathConstructFlag::IsLegacyPathObject) - { - return pathElement->GetLegacyPathEntryIndex() == _type; - } - else - { - return false; - } + return pathElement->GetLegacyPathEntryIndex() == _type; } + + return false; } bool FootpathPlaceAction::IsSameAsEntranceElement(const EntranceElement& entranceElement) const @@ -195,20 +183,16 @@ bool FootpathPlaceAction::IsSameAsEntranceElement(const EntranceElement& entranc { return entranceElement.GetLegacyPathEntryIndex() == _type; } - else - { - return false; - } + + return false; } if (_constructFlags & PathConstructFlag::IsLegacyPathObject) { return false; } - else - { - return entranceElement.GetSurfaceEntryIndex() == _type; - } + + return entranceElement.GetSurfaceEntryIndex() == _type; } GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateQuery(PathElement* pathElement, GameActions::Result::Ptr res) const diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index 3a9e192aa6..80a67d0ddb 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -281,18 +281,14 @@ bool FootpathPlaceFromTrackAction::IsSameAsEntranceElement(const EntranceElement { return entranceElement.GetLegacyPathEntryIndex() == _type; } - else - { - return false; - } + + return false; } if (_constructFlags & PathConstructFlag::IsLegacyPathObject) { return false; } - else - { - return entranceElement.GetSurfaceEntryIndex() == _type; - } + + return entranceElement.GetSurfaceEntryIndex() == _type; } diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index a68db18e53..fda653f89d 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -165,7 +165,8 @@ GameActions::Result::Ptr FootpathRemoveAction::RemoveBannersAtElement(const Coor { if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) return result; - else if (tileElement->GetType() != TILE_ELEMENT_TYPE_BANNER) + + if (tileElement->GetType() != TILE_ELEMENT_TYPE_BANNER) continue; auto bannerRemoveAction = BannerRemoveAction({ loc, tileElement->GetBaseZ(), tileElement->AsBanner()->GetPosition() }); diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 0186df8e7e..bc63e30825 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -335,7 +335,7 @@ namespace GameActions { if (network_get_mode() == NETWORK_MODE_CLIENT) return "cl"; - else if (network_get_mode() == NETWORK_MODE_SERVER) + if (network_get_mode() == NETWORK_MODE_SERVER) return "sv"; return "sp"; } diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 5275232f34..c636a7cf81 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -198,7 +198,8 @@ rct_string_id LandSetHeightAction::CheckParameters() const { return STR_TOO_HIGH; } - else if (_height > MAXIMUM_LAND_HEIGHT - 2 && (_style & TILE_ELEMENT_SURFACE_SLOPE_MASK) != 0) + + if (_height > MAXIMUM_LAND_HEIGHT - 2 && (_style & TILE_ELEMENT_SURFACE_SLOPE_MASK) != 0) { return STR_TOO_HIGH; } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 1c5a5ac262..37a4e6a572 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -291,9 +291,6 @@ rct_string_id RideSetSettingAction::GetOperationErrorMessage(Ride* ride) const { return STR_CANT_CHANGE_THIS; } - else - { - return STR_CANT_CHANGE_LAUNCH_SPEED; - } + return STR_CANT_CHANGE_LAUNCH_SPEED; } } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 9743b311a0..6ed78ec399 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -89,7 +89,8 @@ GameActions::Result::Ptr RideSetStatusAction::Query() const res->ErrorMessage = STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING; return res; } - else if (_status == RideStatus::Testing || _status == RideStatus::Simulating) + + if (_status == RideStatus::Testing || _status == RideStatus::Simulating) { if (!ride->Test(_status, false)) { diff --git a/src/openrct2/cmdline/CommandLine.cpp b/src/openrct2/cmdline/CommandLine.cpp index 150b6e541f..78ceadaac8 100644 --- a/src/openrct2/cmdline/CommandLine.cpp +++ b/src/openrct2/cmdline/CommandLine.cpp @@ -38,10 +38,8 @@ bool CommandLineArgEnumerator::Backtrack() _index--; return true; } - else - { - return false; - } + + return false; } bool CommandLineArgEnumerator::TryPop() @@ -51,10 +49,8 @@ bool CommandLineArgEnumerator::TryPop() _index++; return true; } - else - { - return false; - } + + return false; } bool CommandLineArgEnumerator::TryPopInteger(int32_t* result) @@ -89,10 +85,8 @@ bool CommandLineArgEnumerator::TryPopString(const char** result) _index++; return true; } - else - { - return false; - } + + return false; } #pragma endregion @@ -317,11 +311,9 @@ namespace CommandLine // Found matching command return command; } - else - { - // Recurse for the sub command table - return FindCommandFor(command->SubCommands, argEnumerator); - } + + // Recurse for the sub command table + return FindCommandFor(command->SubCommands, argEnumerator); } } @@ -364,10 +356,8 @@ namespace CommandLine Console::Error::WriteLine("All options must be passed at the end of the command line."); return false; } - else - { - continue; - } + + continue; } return true; @@ -424,12 +414,10 @@ namespace CommandLine Console::Error::WriteLine("Option is a switch: %s", optionName); return false; } - else + + if (!ParseOptionValue(option, equalsCh + 1)) { - if (!ParseOptionValue(option, equalsCh + 1)) - { - return false; - } + return false; } } @@ -563,8 +551,6 @@ int32_t cmdline_run(const char** argv, int32_t argc) { return CommandLine::HandleCommandDefault(); } - else - { - return command->Func(&argEnumerator); - } + + return command->Func(&argEnumerator); } diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 60782dd77a..f5a3b5c776 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -387,11 +387,9 @@ static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator* enumerator) Console::WriteLine("Updated config.ini"); return EXITCODE_OK; } - else - { - Console::Error::WriteLine("Unable to update config.ini"); - return EXITCODE_FAIL; - } + + Console::Error::WriteLine("Unable to update config.ini"); + return EXITCODE_FAIL; } static exitcode_t HandleCommandScanObjects([[maybe_unused]] CommandLineArgEnumerator* enumerator) diff --git a/src/openrct2/cmdline/UriHandler.cpp b/src/openrct2/cmdline/UriHandler.cpp index 44c4a78e92..9d1f21e368 100644 --- a/src/openrct2/cmdline/UriHandler.cpp +++ b/src/openrct2/cmdline/UriHandler.cpp @@ -68,11 +68,9 @@ static exitcode_t HandleUriJoin(const std::vector& args) gNetworkStartPort = port; return EXITCODE_CONTINUE; } - else - { - Console::Error::WriteLine("Expected hostname:port after join"); - return EXITCODE_FAIL; - } + + Console::Error::WriteLine("Expected hostname:port after join"); + return EXITCODE_FAIL; } static bool TryParseHostnamePort( diff --git a/src/openrct2/config/IniReader.cpp b/src/openrct2/config/IniReader.cpp index ddc4078b7a..ca070248e6 100644 --- a/src/openrct2/config/IniReader.cpp +++ b/src/openrct2/config/IniReader.cpp @@ -327,7 +327,8 @@ private: { return s.substr(0, i); } - else if (c == inQuotes && !escaped) + + if (c == inQuotes && !escaped) { inQuotes = 0; } diff --git a/src/openrct2/core/EnumMap.hpp b/src/openrct2/core/EnumMap.hpp index 95f539421a..ae571d83db 100644 --- a/src/openrct2/core/EnumMap.hpp +++ b/src/openrct2/core/EnumMap.hpp @@ -31,7 +31,8 @@ private: return true; else if constexpr (std::is_integral_v) return true; - return false; + else + return false; } static constexpr auto ValueDistance(T a, T b) @@ -134,10 +135,8 @@ public: auto index = static_cast(k); return _map.begin() + index; } - else - { - return binarySearchValue(); - } + + return binarySearchValue(); } else { diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index 1374afacd5..63339b2726 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -257,14 +257,13 @@ namespace Imaging { return IMAGE_FORMAT::PNG; } - else if (String::EndsWith(path, ".bmp", true)) + + if (String::EndsWith(path, ".bmp", true)) { return IMAGE_FORMAT::BITMAP; } - else - { - return IMAGE_FORMAT::UNKNOWN; - } + + return IMAGE_FORMAT::UNKNOWN; } static ImageReaderFunc GetReader(IMAGE_FORMAT format) diff --git a/src/openrct2/core/Path.cpp b/src/openrct2/core/Path.cpp index 33a3667d28..93a0e2c54d 100644 --- a/src/openrct2/core/Path.cpp +++ b/src/openrct2/core/Path.cpp @@ -42,22 +42,16 @@ namespace Path { return std::string(a) + std::string(b.substr(1)); } - else - { - return std::string(a) + std::string(b); - } + + return std::string(a) + std::string(b); } - else + + if (Platform::IsPathSeparator(bBegin)) { - if (Platform::IsPathSeparator(bBegin)) - { - return std::string(a) + std::string(b); - } - else - { - return std::string(a) + PATH_SEPARATOR + std::string(b); - } + return std::string(a) + std::string(b); } + + return std::string(a) + PATH_SEPARATOR + std::string(b); } std::string GetDirectory(const std::string& path) diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index 1df821814f..c1d3ee4c96 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -45,8 +45,8 @@ namespace String { if (str == nullptr) return std::string(); - else - return std::string(str); + + return std::string(str); } std::string StdFormat_VA(const utf8* format, va_list args) @@ -138,10 +138,8 @@ namespace String { break; } - else - { - len++; - } + + len++; } return std::string_view(ch, len); } @@ -168,10 +166,8 @@ namespace String { return _stricmp(a, b); } - else - { - return strcmp(a, b); - } + + return strcmp(a, b); } bool Equals(std::string_view a, std::string_view b, bool ignoreCase) @@ -189,15 +185,11 @@ namespace String } return true; } - else - { - return false; - } - } - else - { - return a == b; + + return false; } + + return a == b; } bool Equals(const std::string& a, const std::string& b, bool ignoreCase) @@ -251,10 +243,8 @@ namespace String { return _stricmp(a, b) == 0; } - else - { - return strcmp(a, b) == 0; - } + + return strcmp(a, b) == 0; } bool StartsWith(std::string_view str, std::string_view match, bool ignoreCase) @@ -306,10 +296,8 @@ namespace String { return -1; } - else - { - return lastOccurance - str; - } + + return lastOccurance - str; } size_t LengthOf(const utf8* str) @@ -791,10 +779,8 @@ namespace String log_warning("LCMapStringEx failed with %d", error); return std::string(src); } - else - { - return String::ToUtf8(dstW); - } + + return String::ToUtf8(dstW); # else std::string dst = std::string(src); std::transform(dst.begin(), dst.end(), dst.begin(), [](unsigned char c) { return std::toupper(c); }); diff --git a/src/openrct2/core/String.hpp b/src/openrct2/core/String.hpp index 8c590ee207..e621e1caa1 100644 --- a/src/openrct2/core/String.hpp +++ b/src/openrct2/core/String.hpp @@ -157,15 +157,15 @@ namespace String { return { 1 }; } - else if (v.size() >= 2 && ((v[0] & 0xE0) == 0xC0)) + if (v.size() >= 2 && ((v[0] & 0xE0) == 0xC0)) { return { 2 }; } - else if (v.size() >= 3 && ((v[0] & 0xF0) == 0xE0)) + if (v.size() >= 3 && ((v[0] & 0xF0) == 0xE0)) { return { 3 }; } - else if (v.size() >= 4 && ((v[0] & 0xF8) == 0xF0)) + if (v.size() >= 4 && ((v[0] & 0xF8) == 0xF0)) { return { 4 }; } diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp index 10475bab1a..d87644dc4b 100644 --- a/src/openrct2/core/Zip.cpp +++ b/src/openrct2/core/Zip.cpp @@ -121,10 +121,8 @@ public: { return zipFileStat.size; } - else - { - return 0; - } + + return 0; } std::vector GetFileData(std::string_view path) const override @@ -306,11 +304,9 @@ private: { return 0; } - else - { - _pos += readBytes; - return static_cast(readBytes); - } + + _pos += readBytes; + return static_cast(readBytes); } const void* GetData() const override diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 1bb8bfb66d..a9286f3d91 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -56,15 +56,15 @@ sprite_peep_pickup_starts[15] = static inline uint32_t rctc_to_rct2_index(uint32_t image) { - if ( image < 1542) return image; - else if (image >= 1574 && image < 4983) return image - 32; - else if (image >= 4986 && image < 17189) return image - 35; - else if (image >= 17191 && image < 18121) return image - 37; - else if (image >= 18123 && image < 23800) return image - 39; - else if (image >= 23804 && image < 24670) return image - 43; - else if (image >= 24674 && image < 28244) return image - 47; - else if (image >= 28246 ) return image - 49; - else throw std::runtime_error("Invalid RCTC g1.dat file"); + if ( image < 1542) return image; + if (image >= 1574 && image < 4983) return image - 32; + if (image >= 4986 && image < 17189) return image - 35; + if (image >= 17191 && image < 18121) return image - 37; + if (image >= 18123 && image < 23800) return image - 39; + if (image >= 23804 && image < 24670) return image - 43; + if (image >= 24674 && image < 28244) return image - 47; + if (image >= 28246 ) return image - 49; + throw std::runtime_error("Invalid RCTC g1.dat file"); } // clang-format on @@ -371,38 +371,34 @@ static std::optional FASTCALL gfx_draw_sprite_get_palette(ImageId im } return GetPaletteMapForColour(paletteId); } - else + + auto paletteMap = PaletteMap(gPeepPalette); + if (imageId.HasTertiary()) { - auto paletteMap = PaletteMap(gPeepPalette); - if (imageId.HasTertiary()) - { - paletteMap = PaletteMap(gOtherPalette); - auto tertiaryPaletteMap = GetPaletteMapForColour(imageId.GetTertiary()); - if (tertiaryPaletteMap.has_value()) - { - paletteMap.Copy( - PALETTE_OFFSET_REMAP_TERTIARY, tertiaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, - PALETTE_LENGTH_REMAP); - } - } - - auto primaryPaletteMap = GetPaletteMapForColour(imageId.GetPrimary()); - if (primaryPaletteMap.has_value()) + paletteMap = PaletteMap(gOtherPalette); + auto tertiaryPaletteMap = GetPaletteMapForColour(imageId.GetTertiary()); + if (tertiaryPaletteMap.has_value()) { paletteMap.Copy( - PALETTE_OFFSET_REMAP_PRIMARY, primaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + PALETTE_OFFSET_REMAP_TERTIARY, tertiaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); } - - auto secondaryPaletteMap = GetPaletteMapForColour(imageId.GetSecondary()); - if (secondaryPaletteMap.has_value()) - { - paletteMap.Copy( - PALETTE_OFFSET_REMAP_SECONDARY, secondaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, - PALETTE_LENGTH_REMAP); - } - - return paletteMap; } + + auto primaryPaletteMap = GetPaletteMapForColour(imageId.GetPrimary()); + if (primaryPaletteMap.has_value()) + { + paletteMap.Copy( + PALETTE_OFFSET_REMAP_PRIMARY, primaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + } + + auto secondaryPaletteMap = GetPaletteMapForColour(imageId.GetSecondary()); + if (secondaryPaletteMap.has_value()) + { + paletteMap.Copy( + PALETTE_OFFSET_REMAP_SECONDARY, secondaryPaletteMap.value(), PALETTE_OFFSET_REMAP_PRIMARY, PALETTE_LENGTH_REMAP); + } + + return paletteMap; } void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, ImageId imageId, const ScreenCoordsXY& spriteCoords) @@ -667,11 +663,13 @@ const rct_g1_element* gfx_get_g1_element(int32_t image_id) { return nullptr; } - else if (offset == SPR_TEMP) + + if (offset == SPR_TEMP) { return &_g1Temp; } - else if (offset < SPR_RCTC_G1_END) + + if (offset < SPR_RCTC_G1_END) { if (offset < _g1.elements.size()) { @@ -685,10 +683,8 @@ const rct_g1_element* gfx_get_g1_element(int32_t image_id) { return &_g2.elements[idx]; } - else - { - log_warning("Invalid entry in g2.dat requested, idx = %u. You may have to update your g2.dat.", idx); - } + + log_warning("Invalid entry in g2.dat requested, idx = %u. You may have to update your g2.dat.", idx); } else if (offset < SPR_CSG_END) { @@ -699,10 +695,8 @@ const rct_g1_element* gfx_get_g1_element(int32_t image_id) { return &_csg.elements[idx]; } - else - { - log_warning("Invalid entry in csg.dat requested, idx = %u.", idx); - } + + log_warning("Invalid entry in csg.dat requested, idx = %u.", idx); } } else if (offset < SPR_SCROLLING_TEXT_END) @@ -796,31 +790,28 @@ size_t g1_calculate_data_size(const rct_g1_element* g1) { return g1->width * 3; } - else if (g1->flags & G1_FLAG_RLE_COMPRESSION) + + if (g1->flags & G1_FLAG_RLE_COMPRESSION) { if (g1->offset == nullptr) { return 0; } - else + + auto idx = (g1->height - 1) * 2; + uint16_t offset = g1->offset[idx] | (g1->offset[idx + 1] << 8); + uint8_t* ptr = g1->offset + offset; + bool endOfLine = false; + do { - auto idx = (g1->height - 1) * 2; - uint16_t offset = g1->offset[idx] | (g1->offset[idx + 1] << 8); - uint8_t* ptr = g1->offset + offset; - bool endOfLine = false; - do - { - uint8_t chunk0 = *ptr++; - ptr++; // offset - uint8_t chunkSize = chunk0 & 0x7F; - ptr += chunkSize; - endOfLine = (chunk0 & 0x80) != 0; - } while (!endOfLine); - return ptr - g1->offset; - } - } - else - { - return g1->width * g1->height; + uint8_t chunk0 = *ptr++; + ptr++; // offset + uint8_t chunkSize = chunk0 & 0x7F; + ptr += chunkSize; + endOfLine = (chunk0 & 0x80) != 0; + } while (!endOfLine); + return ptr - g1->offset; } + + return g1->width * g1->height; } diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 78e8915014..421485132d 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -376,7 +376,8 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) height += 10; break; } - else if (fontBase == FontSpriteBase::TINY) + + if (fontBase == FontSpriteBase::TINY) { height += 6; break; @@ -389,7 +390,8 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) height += 5; break; } - else if (fontBase == FontSpriteBase::TINY) + + if (fontBase == FontSpriteBase::TINY) { height += 3; break; @@ -546,164 +548,161 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex info->x += ttf_getwidth_cache_get_or_add(fontDesc->font, text); return; } - else + + uint8_t colour = info->palette[1]; + TTFSurface* surface = ttf_surface_cache_get_or_add(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; + + if (OpenRCT2::GetContext()->GetDrawingEngineType() == DrawingEngine::OpenGL) { - uint8_t colour = info->palette[1]; - TTFSurface* surface = ttf_surface_cache_get_or_add(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; - - if (OpenRCT2::GetContext()->GetDrawingEngineType() == DrawingEngine::OpenGL) + auto pixels = reinterpret_cast(const_cast(surface->pixels)); + auto pixelsLen = static_cast(surface->pitch) * surface->h; + for (size_t pp = 0; pp < pixelsLen; pp++) { - auto pixels = reinterpret_cast(const_cast(surface->pixels)); - auto pixelsLen = static_cast(surface->pitch) * surface->h; - for (size_t pp = 0; pp < pixelsLen; pp++) + if (pixels[pp] != 0) { - if (pixels[pp] != 0) - { - pixels[pp] = colour; - } - else - { - pixels[pp] = PALETTE_INDEX_0; - } + pixels[pp] = colour; } - - auto baseId = uint32_t(0x7FFFF) - 1024; - auto imageId = baseId + _ttfGlId; - auto drawingEngine = dpi->DrawingEngine; - auto drawingContext = drawingEngine->GetDrawingContext(dpi); - drawingEngine->InvalidateImage(imageId); - drawingContext->DrawBitmap(imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); - - _ttfGlId++; - if (_ttfGlId >= 1023) + else { - _ttfGlId = 0; + pixels[pp] = PALETTE_INDEX_0; } - 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 baseId = uint32_t(0x7FFFF) - 1024; + auto imageId = baseId + _ttfGlId; + auto drawingEngine = dpi->DrawingEngine; + auto drawingContext = drawingEngine->GetDrawingContext(dpi); + drawingEngine->InvalidateImage(imageId); + drawingContext->DrawBitmap(imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); - auto src = static_cast(surface->pixels); - uint8_t* dst = dpi->bits; - - if (skipX < 0) + _ttfGlId++; + if (_ttfGlId >= 1023) { - width += skipX; - src += -skipX; - skipX = 0; + _ttfGlId = 0; } - if (skipY < 0) + 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; + + if (skipX < 0) + { + width += skipX; + src += -skipX; + skipX = 0; + } + if (skipY < 0) + { + height += skipY; + src += (-skipY * surface->pitch); + 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; + const uint8_t* src_orig = src; + + // Draw shadow/outline + if (info->flags & TEXT_DRAW_FLAG_OUTLINE) + { + for (int32_t yy = 0; yy < height - 0; yy++) { - height += skipY; - src += (-skipY * surface->pitch); - 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; - const uint8_t* src_orig = src; - - // Draw shadow/outline - if (info->flags & TEXT_DRAW_FLAG_OUTLINE) - { - for (int32_t yy = 0; yy < height - 0; yy++) + for (int32_t xx = 0; xx < width - 0; xx++) { - for (int32_t xx = 0; xx < width - 0; xx++) + if (*src != 0) { - if (*src != 0) + // right + if (xx + skipX < dpi->width + dpi->pitch - 1) { - // right - if (xx + skipX < dpi->width + dpi->pitch - 1) - { - *(dst + 1) = info->palette[3]; - } - // left - if (xx + skipX > 1) - { - *(dst - 1) = info->palette[3]; - } - // top - if (yy + skipY > 1) - { - *(dst - width - dstScanSkip) = info->palette[3]; - } - // bottom - if (yy + skipY < dpi->height - 1) - { - *(dst + width + dstScanSkip) = info->palette[3]; - } + *(dst + 1) = info->palette[3]; } - src++; - dst++; - } - // Skip any remaining bits - src += srcScanSkip; - dst += dstScanSkip; - } - } - { - dst = dst_orig; - src = src_orig; - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; - for (int32_t yy = 0; yy < height; yy++) - { - for (int32_t xx = 0; xx < width; xx++) - { - if (*src != 0) + // left + if (xx + skipX > 1) { - if (info->flags & TEXT_DRAW_FLAG_INSET) - { - *(dst + width + dstScanSkip + 1) = info->palette[3]; - } - - 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) - { - // As outlines are black, these texts should always use a darker shade - // of the foreground colour for font hinting. - *dst = blendColours(colour, PALETTE_INDEX_0); - } - else - { - *dst = blendColours(colour, *dst); - } - } + *(dst - 1) = info->palette[3]; + } + // top + if (yy + skipY > 1) + { + *(dst - width - dstScanSkip) = info->palette[3]; + } + // bottom + if (yy + skipY < dpi->height - 1) + { + *(dst + width + dstScanSkip) = info->palette[3]; } - src++; - dst++; } - src += srcScanSkip; - dst += dstScanSkip; + src++; + dst++; } + // Skip any remaining bits + src += srcScanSkip; + dst += dstScanSkip; } } + + dst = dst_orig; + src = src_orig; + bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; + for (int32_t yy = 0; yy < height; yy++) + { + for (int32_t xx = 0; xx < width; xx++) + { + if (*src != 0) + { + if (info->flags & TEXT_DRAW_FLAG_INSET) + { + *(dst + width + dstScanSkip + 1) = info->palette[3]; + } + + 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) + { + // As outlines are black, these texts should always use a darker shade + // of the foreground colour for font hinting. + *dst = blendColours(colour, PALETTE_INDEX_0); + } + else + { + *dst = blendColours(colour, *dst); + } + } + } + src++; + dst++; + } + src += srcScanSkip; + dst += dstScanSkip; + } } #endif // NO_TTF diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 96b51b7f84..520bb6ddb6 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -528,19 +528,19 @@ ImageCatalogue ImageId::GetCatalogue() const { return ImageCatalogue::TEMPORARY; } - else if (index < SPR_RCTC_G1_END) + if (index < SPR_RCTC_G1_END) { return ImageCatalogue::G1; } - else if (index < SPR_G2_END) + if (index < SPR_G2_END) { return ImageCatalogue::G2; } - else if (index < SPR_CSG_END) + if (index < SPR_CSG_END) { return ImageCatalogue::CSG; } - else if (index < SPR_IMAGE_LIST_END) + if (index < SPR_IMAGE_LIST_END) { return ImageCatalogue::OBJECT; } diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index c68b4dcd0a..ee4fbdb8b4 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -306,7 +306,8 @@ int32_t font_sprite_get_codepoint_width(FontSpriteBase fontSpriteBase, int32_t c } return _additionalSpriteFontCharacterWidth[baseFontIndex][glyphIndex]; } - else if (glyphIndex < 0 || glyphIndex >= static_cast(FONT_SPRITE_GLYPH_COUNT)) + + if (glyphIndex < 0 || glyphIndex >= static_cast(FONT_SPRITE_GLYPH_COUNT)) { log_warning("Invalid glyph index %u", glyphIndex); glyphIndex = 0; @@ -362,13 +363,8 @@ int32_t font_get_line_height(FontSpriteBase fontSpriteBase) { return gCurrentTTFFontSet->size[fontSize].line_height; } - else - { -#endif // NO_TTF - return SpriteFontLineHeight[fontSize]; -#ifndef NO_TTF - } #endif // NO_TTF + return SpriteFontLineHeight[fontSize]; } int32_t font_get_line_height_small(FontSpriteBase fontSpriteBase) @@ -434,8 +430,6 @@ bool font_supports_string(const utf8* text, int32_t fontSize) { return font_supports_string_ttf(text, fontSize); } - else - { - return font_supports_string_sprite(text); - } + + return font_supports_string_sprite(text); } diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index 3e54059abd..f3bec68d23 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -178,7 +178,8 @@ static void FreeImageList(uint32_t baseImageId, uint32_t count) it->Count += count; return; } - else if (baseImageId + count == it->BaseId) + + if (baseImageId + count == it->BaseId) { it->BaseId = baseImageId; it->Count += count; diff --git a/src/openrct2/drawing/Rect.cpp b/src/openrct2/drawing/Rect.cpp index 4110287f0d..556f97f037 100644 --- a/src/openrct2/drawing/Rect.cpp +++ b/src/openrct2/drawing/Rect.cpp @@ -40,10 +40,8 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t assert(false); return; } - else - { - palette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; - } + + palette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; if (flags & INSET_RECT_FLAG_BORDER_NONE) { diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 4cca9f85ef..f348a8eb64 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -128,10 +128,8 @@ static uint8_t* font_sprite_get_codepoint_bitmap(int32_t codepoint) { return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + FONT_SPRITE_GLYPH_COUNT]; } - else - { - return _characterBitmaps[offset]; - } + + return _characterBitmaps[offset]; } static int32_t scrolling_text_get_matching_or_oldest( diff --git a/src/openrct2/drawing/TTF.cpp b/src/openrct2/drawing/TTF.cpp index c32039e870..2c430f3672 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -373,10 +373,8 @@ static TTFSurface* ttf_render(TTF_Font* font, std::string_view text) { return TTF_RenderUTF8_Shaded(font, buffer.c_str(), 0x000000FF, 0x000000FF); } - else - { - return TTF_RenderUTF8_Solid(font, buffer.c_str(), 0x000000FF); - } + + return TTF_RenderUTF8_Solid(font, buffer.c_str(), 0x000000FF); } void ttf_free_surface(TTFSurface* surface) diff --git a/src/openrct2/drawing/TTFSDLPort.cpp b/src/openrct2/drawing/TTFSDLPort.cpp index 9b4b02b7a0..030bb3aeef 100644 --- a/src/openrct2/drawing/TTFSDLPort.cpp +++ b/src/openrct2/drawing/TTFSDLPort.cpp @@ -1553,9 +1553,9 @@ int TTF_GetFontHinting(const TTF_Font* font) { if (font->hinting == FT_LOAD_TARGET_ALT(FT_RENDER_MODE_LIGHT)) return TTF_HINTING_LIGHT; - else if (font->hinting == FT_LOAD_TARGET_ALT(FT_RENDER_MODE_MONO)) + if (font->hinting == FT_LOAD_TARGET_ALT(FT_RENDER_MODE_MONO)) return TTF_HINTING_MONO; - else if (font->hinting == FT_LOAD_NO_HINTING) + if (font->hinting == FT_LOAD_NO_HINTING) return TTF_HINTING_NONE; return 0; } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index a4f4e2b559..9a89012429 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1403,19 +1403,15 @@ static int32_t cc_say(InteractiveConsole& console, const arguments_t& argv) console.WriteFormatLine("This command only works in multiplayer mode."); return 0; } - else + + if (!argv.empty()) { - if (!argv.empty()) - { - network_send_chat(argv[0].c_str()); - return 1; - } - else - { - console.WriteFormatLine("Input your message"); - return 0; - } + network_send_chat(argv[0].c_str()); + return 1; } + + console.WriteFormatLine("Input your message"); + return 0; } static int32_t cc_replay_startrecord(InteractiveConsole& console, const arguments_t& argv) diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 972dbc0f49..8d784d4fd9 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -170,10 +170,8 @@ std::string screenshot_dump_png(rct_drawpixelinfo* dpi) { return path.value(); } - else - { - return ""; - } + + return ""; } std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* pixels) @@ -765,28 +763,26 @@ static std::string ResolveFilenameForCapture(const fs::path& filename) } return *path; } - else + + auto screenshotDirectory = fs::u8path(screenshot_get_directory()); + auto screenshotPath = fs::absolute(screenshotDirectory / filename); + + // Check the filename isn't attempting to leave the screenshot directory for security + if (!IsPathChildOf(screenshotPath, screenshotDirectory)) { - auto screenshotDirectory = fs::u8path(screenshot_get_directory()); - auto screenshotPath = fs::absolute(screenshotDirectory / filename); - - // Check the filename isn't attempting to leave the screenshot directory for security - if (!IsPathChildOf(screenshotPath, screenshotDirectory)) - { - throw std::runtime_error("Filename is not a child of the screenshot directory."); - } - - auto directory = screenshotPath.parent_path(); - if (!fs::is_directory(directory)) - { - if (!fs::create_directory(directory, screenshotDirectory)) - { - throw std::runtime_error("Unable to create directory."); - } - } - - return screenshotPath.string(); + throw std::runtime_error("Filename is not a child of the screenshot directory."); } + + auto directory = screenshotPath.parent_path(); + if (!fs::is_directory(directory)) + { + if (!fs::create_directory(directory, screenshotDirectory)) + { + throw std::runtime_error("Unable to create directory."); + } + } + + return screenshotPath.string(); } void CaptureImage(const CaptureOptions& options) diff --git a/src/openrct2/interface/StdInOutConsole.cpp b/src/openrct2/interface/StdInOutConsole.cpp index 42217dfed2..95bb45a52f 100644 --- a/src/openrct2/interface/StdInOutConsole.cpp +++ b/src/openrct2/interface/StdInOutConsole.cpp @@ -50,11 +50,9 @@ void StdInOutConsole::Start() openrct2_finish(); break; } - else - { - lastPromptQuit = true; - std::puts("(To exit, press ^C again)"); - } + + lastPromptQuit = true; + std::puts("(To exit, press ^C again)"); } else { diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 1f9fb894a5..57f4134d93 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -1972,8 +1972,6 @@ ZoomLevel ZoomLevel::min() { return -2; } - else - { - return 0; - } + + return 0; } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 82a8f009c8..42bf213b8a 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -432,7 +432,8 @@ rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsX { break; } - else if (widget->type != WindowWidgetType::Empty && widget->IsVisible()) + + if (widget->type != WindowWidgetType::Empty && widget->IsVisible()) { if (screenCoords.x >= w->windowPos.x + widget->left && screenCoords.x <= w->windowPos.x + widget->right && screenCoords.y >= w->windowPos.y + widget->top && screenCoords.y <= w->windowPos.y + widget->bottom) @@ -1337,10 +1338,8 @@ bool tool_set(rct_window* w, rct_widgetindex widgetIndex, Tool tool) tool_cancel(); return true; } - else - { - tool_cancel(); - } + + tool_cancel(); } input_set_flag(INPUT_FLAG_TOOL_ACTIVE, true); @@ -1580,14 +1579,13 @@ OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex wi { return w->OnTooltip(widgetIndex, fallback); } - else if (w->event_handlers->tooltip != nullptr) + + if (w->event_handlers->tooltip != nullptr) { return w->event_handlers->tooltip(w, widgetIndex, fallback); } - else - { - return { fallback, {} }; - } + + return { fallback, {} }; } CursorID window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 26102c41bb..2eb24fb286 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -130,8 +130,8 @@ struct rct_widget { if (height() >= 10) return std::max(top, top + (height() / 2) - 5); - else - return top - 1; + + return top - 1; } bool IsVisible() const diff --git a/src/openrct2/interface/ZoomLevel.h b/src/openrct2/interface/ZoomLevel.h index 84b7ce0d45..18e0f91001 100644 --- a/src/openrct2/interface/ZoomLevel.h +++ b/src/openrct2/interface/ZoomLevel.h @@ -51,16 +51,16 @@ public: { if (rhs._level < 0) return lhs >> -rhs._level; - else - return lhs << rhs._level; + + return lhs << rhs._level; } template friend T operator/(const T& lhs, const ZoomLevel& rhs) { if (rhs._level < 0) return lhs << -rhs._level; - else - return lhs >> rhs._level; + + return lhs >> rhs._level; } static ZoomLevel min(); diff --git a/src/openrct2/localisation/ConversionTables.cpp b/src/openrct2/localisation/ConversionTables.cpp index a4e745cb97..445ce2f236 100644 --- a/src/openrct2/localisation/ConversionTables.cpp +++ b/src/openrct2/localisation/ConversionTables.cpp @@ -111,8 +111,9 @@ static int32_t encoding_search_compare(const void *pKey, const void *pEntry) static wchar_t encoding_convert_x_to_unicode(wchar_t code, const encoding_convert_entry *table, size_t count) { encoding_convert_entry * entry = static_cast(std::bsearch(&code, table, count, sizeof(encoding_convert_entry), encoding_search_compare)); - if (entry == nullptr) return code; - else return entry->unicode; + if (entry == nullptr) + return code; + return entry->unicode; } wchar_t encoding_convert_rct2_to_unicode(wchar_t rct2str) diff --git a/src/openrct2/localisation/Convert.cpp b/src/openrct2/localisation/Convert.cpp index 3d9966b152..a18ff4e74d 100644 --- a/src/openrct2/localisation/Convert.cpp +++ b/src/openrct2/localisation/Convert.cpp @@ -149,11 +149,9 @@ std::string rct2_to_utf8(std::string_view src, RCT2LanguageId languageId) // The code page used by RCT2 was not quite 1252 as some codes were used for Polish characters. return DecodeConvertWithTable(src, encoding_convert_rct2_to_unicode); } - else - { - auto decoded = DecodeToMultiByte(src); - return String::Convert(decoded, codePage, CODE_PAGE::CP_UTF8); - } + + auto decoded = DecodeToMultiByte(src); + return String::Convert(decoded, codePage, CODE_PAGE::CP_UTF8); } std::string utf8_to_rct2(std::string_view src) diff --git a/src/openrct2/localisation/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 2b5c408520..1b4b9d569f 100644 --- a/src/openrct2/localisation/FormatCodes.cpp +++ b/src/openrct2/localisation/FormatCodes.cpp @@ -96,14 +96,12 @@ std::string_view FormatTokenToString(FormatToken token, bool withBraces) { return GetFormatTokenStringWithBraces(token); } - else - { - auto it = FormatTokenMap.find(token); - if (it != FormatTokenMap.end()) - return it->first; - return {}; - } + auto it = FormatTokenMap.find(token); + if (it != FormatTokenMap.end()) + return it->first; + + return {}; } bool FormatTokenTakesArgument(FormatToken token) diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 3cb8188cf7..464185b2f5 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -131,7 +131,8 @@ namespace OpenRCT2 current = token(FormatToken::Move, str.substr(startIndex, i - startIndex), p); return; } - else if (inner == "INLINE_SPRITE") + + if (inner == "INLINE_SPRITE") { uint32_t p = 0; auto p0 = ParseNumericToken(str, i); @@ -178,12 +179,12 @@ namespace OpenRCT2 { return token(FormatToken::Escaped, sztoken); } - else if (sztoken.size() >= 2 && sztoken[0] == '{' && sztoken[1] != '{') + if (sztoken.size() >= 2 && sztoken[0] == '{' && sztoken[1] != '{') { auto kind = FormatTokenFromString(sztoken.substr(1, len - 2)); return token(kind, sztoken); } - else if (sztoken == "\n" || sztoken == "\r") + if (sztoken == "\n" || sztoken == "\r") { return token(FormatToken::Newline, sztoken); } diff --git a/src/openrct2/localisation/Formatting.h b/src/openrct2/localisation/Formatting.h index 9726a89141..e67c2cf9df 100644 --- a/src/openrct2/localisation/Formatting.h +++ b/src/openrct2/localisation/Formatting.h @@ -243,13 +243,11 @@ namespace OpenRCT2 FormatRealName(ss, stringId); return FormatString(ss, stack, argN...); } - else - { - auto subfmt = GetFmtStringById(stringId); - auto subit = subfmt.begin(); - stack.push(subit); - return FormatString(ss, stack, argN...); - } + + auto subfmt = GetFmtStringById(stringId); + auto subit = subfmt.begin(); + stack.push(subit); + return FormatString(ss, stack, argN...); } } else if (FormatTokenTakesArgument(token.kind)) @@ -257,10 +255,8 @@ namespace OpenRCT2 FormatArgument(ss, token.kind, arg0); return FormatString(ss, stack, argN...); } - else - { - ss << token.text; - } + + ss << token.text; } stack.pop(); } diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index 9723da13f1..a7b1889226 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -114,25 +114,23 @@ constexpr utf8* utf8_write_codepoint(utf8* dst, uint32_t codepoint) dst[0] = static_cast(codepoint); return dst + 1; } - else if (codepoint <= 0x7FF) + if (codepoint <= 0x7FF) { dst[0] = 0xC0 | ((codepoint >> 6) & 0x1F); dst[1] = 0x80 | (codepoint & 0x3F); return dst + 2; } - else if (codepoint <= 0xFFFF) + if (codepoint <= 0xFFFF) { dst[0] = 0xE0 | ((codepoint >> 12) & 0x0F); dst[1] = 0x80 | ((codepoint >> 6) & 0x3F); dst[2] = 0x80 | (codepoint & 0x3F); return dst + 3; } - else - { - dst[0] = 0xF0 | ((codepoint >> 18) & 0x07); - dst[1] = 0x80 | ((codepoint >> 12) & 0x3F); - dst[2] = 0x80 | ((codepoint >> 6) & 0x3F); - dst[3] = 0x80 | (codepoint & 0x3F); - return dst + 4; - } + + dst[0] = 0xF0 | ((codepoint >> 18) & 0x07); + dst[1] = 0x80 | ((codepoint >> 12) & 0x3F); + dst[2] = 0x80 | ((codepoint >> 6) & 0x3F); + dst[3] = 0x80 | (codepoint & 0x3F); + return dst + 4; } diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index 4f75eab211..65a7f220e8 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -158,12 +158,11 @@ public: { return _scenarioOverrides[ooIndex].strings[ooStringIndex].c_str(); } - else - { - return nullptr; - } + + return nullptr; } - else if (stringId >= ObjectOverrideBase) + + if (stringId >= ObjectOverrideBase) { int32_t offset = stringId - ObjectOverrideBase; int32_t ooIndex = offset / ObjectOverrideMaxStringCount; @@ -174,22 +173,16 @@ public: { return _objectOverrides[ooIndex].strings[ooStringIndex].c_str(); } - else - { - return nullptr; - } + + return nullptr; } - else + + if ((_strings.size() > static_cast(stringId)) && !_strings[stringId].empty()) { - if ((_strings.size() > static_cast(stringId)) && !_strings[stringId].empty()) - { - return _strings[stringId].c_str(); - } - else - { - return nullptr; - } + return _strings[stringId].c_str(); } + + return nullptr; } rct_string_id GetObjectOverrideStringId(std::string_view legacyIdentifier, uint8_t index) override @@ -469,7 +462,8 @@ private: // Unexpected new line, ignore line entirely return; } - else if (!IsWhitespace(codepoint) && codepoint != ':') + + if (!IsWhitespace(codepoint) && codepoint != ':') { reader->Skip(); sb.Append(codepoint); diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 48728c7844..27d9660a24 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -445,8 +445,7 @@ money32 string_to_money(const char* string_to_monetise) { if (hasDecSep) return MONEY32_UNDEFINED; - else - hasDecSep = true; + hasDecSep = true; // Replace localised decimal separator with an English one. *dst_ptr++ = '.'; @@ -457,8 +456,7 @@ money32 string_to_money(const char* string_to_monetise) { if (hasMinus) return MONEY32_UNDEFINED; - else - hasMinus = true; + hasMinus = true; } else { diff --git a/src/openrct2/localisation/UTF8.cpp b/src/openrct2/localisation/UTF8.cpp index 6854c2bab3..2585764fa1 100644 --- a/src/openrct2/localisation/UTF8.cpp +++ b/src/openrct2/localisation/UTF8.cpp @@ -77,18 +77,15 @@ int32_t utf8_get_codepoint_length(char32_t codepoint) { return 1; } - else if (codepoint <= 0x7FF) + if (codepoint <= 0x7FF) { return 2; } - else if (codepoint <= 0xFFFF) + if (codepoint <= 0xFFFF) { return 3; } - else - { - return 4; - } + return 4; } /** diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index bbd1d07af6..34e4172a5a 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -62,8 +62,8 @@ const News::Item& News::ItemQueues::operator[](size_t index) const { if (index < Recent.capacity()) return Recent[index]; - else - return Archived[index - Recent.capacity()]; + + return Archived[index - Recent.capacity()]; } News::Item* News::ItemQueues::At(int32_t index) @@ -77,10 +77,8 @@ const News::Item* News::ItemQueues::At(int32_t index) const { return &(*this)[index]; } - else - { - return nullptr; - } + + return nullptr; } bool News::IsQueueEmpty() diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 5c0041927c..45e60590c8 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -159,13 +159,12 @@ static void research_next_design() it = gResearchItemsUninvented.begin(); continue; } - else - { - research_mark_as_fully_completed(); - return; - } + + research_mark_as_fully_completed(); + return; } - else if (ignoreActiveResearchTypes || (gResearchPriorities & EnumToFlag(researchItem.category))) + + if (ignoreActiveResearchTypes || (gResearchPriorities & EnumToFlag(researchItem.category))) { break; } @@ -561,11 +560,9 @@ bool scenery_is_invented(const ScenerySelection& sceneryItem) { return _researchedSceneryItems[sceneryItem.SceneryType][sceneryItem.EntryIndex]; } - else - { - log_warning("Invalid Scenery Type"); - return false; - } + + log_warning("Invalid Scenery Type"); + return false; } void scenery_set_invented(const ScenerySelection& sceneryItem) @@ -697,23 +694,17 @@ rct_string_id ResearchItem::GetName() const { return STR_EMPTY; } - else - { - return rideEntry->naming.Name; - } + + return rideEntry->naming.Name; } - else + + rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(entryIndex); + if (sceneryEntry == nullptr) { - rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(entryIndex); - if (sceneryEntry == nullptr) - { - return STR_EMPTY; - } - else - { - return sceneryEntry->name; - } + return STR_EMPTY; } + + return sceneryEntry->name; } /** diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 819391f03a..581b125e5f 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -421,7 +421,7 @@ NetworkAuth NetworkBase::GetAuthStatus() { return _serverConnection->AuthStatus; } - else if (GetMode() == NETWORK_MODE_SERVER) + if (GetMode() == NETWORK_MODE_SERVER) { return NetworkAuth::Ok; } @@ -858,10 +858,8 @@ std::string NetworkBase::GetMasterServerUrl() { return OPENRCT2_MASTER_SERVER_URL; } - else - { - return gConfigNetwork.master_server_url; - } + + return gConfigNetwork.master_server_url; } NetworkGroup* NetworkBase::AddGroup() @@ -3742,10 +3740,8 @@ rct_string_id network_get_action_name_string_id(uint32_t index) { return NetworkActions::Actions[index].Name; } - else - { - return STR_NONE; - } + + return STR_NONE; } int32_t network_can_perform_action(uint32_t groupindex, NetworkPermission index) @@ -3788,15 +3784,13 @@ Peep* network_get_pickup_peep(uint8_t playerid) { return _pickup_peep; } - else + + NetworkPlayer* player = network.GetPlayerByID(playerid); + if (player) { - NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) - { - return player->PickupPeep; - } - return nullptr; + return player->PickupPeep; } + return nullptr; } void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x) @@ -3823,15 +3817,13 @@ int32_t network_get_pickup_peep_old_x(uint8_t playerid) { return _pickup_peep_old_x; } - else + + NetworkPlayer* player = network.GetPlayerByID(playerid); + if (player) { - NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) - { - return player->PickupPeepOldX; - } - return -1; + return player->PickupPeepOldX; } + return -1; } int32_t network_get_current_player_group_index() diff --git a/src/openrct2/network/NetworkKey.cpp b/src/openrct2/network/NetworkKey.cpp index 42d123004d..b6dc4899d7 100644 --- a/src/openrct2/network/NetworkKey.cpp +++ b/src/openrct2/network/NetworkKey.cpp @@ -54,7 +54,7 @@ bool NetworkKey::LoadPrivate(OpenRCT2::IStream* stream) log_error("unknown size, refusing to load key"); return false; } - else if (size > 4 * 1024 * 1024) + if (size > 4 * 1024 * 1024) { log_error("Key file suspiciously large, refusing to load it"); return false; @@ -86,7 +86,7 @@ bool NetworkKey::LoadPublic(OpenRCT2::IStream* stream) log_error("unknown size, refusing to load key"); return false; } - else if (size > 4 * 1024 * 1024) + if (size > 4 * 1024 * 1024) { log_error("Key file suspiciously large, refusing to load it"); return false; diff --git a/src/openrct2/network/NetworkPacket.cpp b/src/openrct2/network/NetworkPacket.cpp index 9efca470db..078fd7eab6 100644 --- a/src/openrct2/network/NetworkPacket.cpp +++ b/src/openrct2/network/NetworkPacket.cpp @@ -77,12 +77,10 @@ const uint8_t* NetworkPacket::Read(size_t size) { return nullptr; } - else - { - const uint8_t* data = Data.data() + BytesRead; - BytesRead += size; - return data; - } + + const uint8_t* data = Data.data() + BytesRead; + BytesRead += size; + return data; } const utf8* NetworkPacket::ReadString() diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index 9d53100687..31fc00412f 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -143,12 +143,10 @@ void NetworkUserManager::Save() // erase advances the iterator so make sure we don't do it again continue; } - else - { - // replace the existing element in jsonUsers - *it = networkUser->ToJson(); - savedHashes.insert(hashString); - } + + // replace the existing element in jsonUsers + *it = networkUser->ToJson(); + savedHashes.insert(hashString); } it++; diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index 45fa0ffff1..820e81fc02 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -95,20 +95,18 @@ std::optional ServerListEntry::FromJson(json_t& server) return std::nullopt; } - else - { - ServerListEntry entry; - entry.Address = ip + ":" + std::to_string(port); - entry.Name = name; - entry.Description = description; - entry.Version = version; - entry.RequiresPassword = requiresPassword; - entry.Players = players; - entry.MaxPlayers = maxPlayers; + ServerListEntry entry; - return entry; - } + entry.Address = ip + ":" + std::to_string(port); + entry.Name = name; + entry.Description = description; + entry.Version = version; + entry.RequiresPassword = requiresPassword; + entry.Players = players; + entry.MaxPlayers = maxPlayers; + + return entry; } void ServerList::Sort() diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp index 73bca48b76..389df1d022 100644 --- a/src/openrct2/network/Socket.cpp +++ b/src/openrct2/network/Socket.cpp @@ -164,10 +164,8 @@ public: { return reinterpret_cast(&_address)->sin_port; } - else - { - return reinterpret_cast(&_address)->sin6_port; - } + + return reinterpret_cast(&_address)->sin6_port; } std::string GetHostname() const override @@ -233,17 +231,16 @@ private: log_error("Resolution error message: %s.", gai_strerror(errorcode)); return false; } + if (result == nullptr) { return false; } - else - { - std::memcpy(ss, result->ai_addr, result->ai_addrlen); - *ss_len = static_cast(result->ai_addrlen); - freeaddrinfo(result); - return true; - } + + std::memcpy(ss, result->ai_addr, result->ai_addrlen); + *ss_len = static_cast(result->ai_addrlen); + freeaddrinfo(result); + return true; } }; @@ -579,7 +576,8 @@ public: *sizeReceived = 0; return NetworkReadPacket::Disconnected; } - else if (readBytes == SOCKET_ERROR) + + if (readBytes == SOCKET_ERROR) { *sizeReceived = 0; # ifndef _WIN32 @@ -598,16 +596,12 @@ public: { return NetworkReadPacket::Disconnected; } - else - { - return NetworkReadPacket::NoData; - } - } - else - { - *sizeReceived = readBytes; - return NetworkReadPacket::Success; + + return NetworkReadPacket::NoData; } + + *sizeReceived = readBytes; + return NetworkReadPacket::Success; } void Close() override @@ -810,15 +804,13 @@ public: *sizeReceived = 0; return NetworkReadPacket::NoData; } - else + + *sizeReceived = readBytes; + if (sender != nullptr) { - *sizeReceived = readBytes; - if (sender != nullptr) - { - *sender = std::make_unique(reinterpret_cast(&senderAddr), senderAddrLen); - } - return NetworkReadPacket::Success; + *sender = std::make_unique(reinterpret_cast(&senderAddr), senderAddrLen); } + return NetworkReadPacket::Success; } void Close() override diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index f61b6f65b2..b5c3ebac51 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -133,11 +133,9 @@ bool MusicObject::SupportsRideType(uint8_t rideType) // Default behaviour for music is to only exclude from merry-go-round return rideType != RIDE_TYPE_MERRY_GO_ROUND; } - else - { - auto it = std::find(_rideTypes.begin(), _rideTypes.end(), rideType); - return it != _rideTypes.end(); - } + + auto it = std::find(_rideTypes.begin(), _rideTypes.end(), rideType); + return it != _rideTypes.end(); } size_t MusicObject::GetTrackCount() const @@ -163,8 +161,6 @@ ObjectAsset MusicObject::GetAsset(IReadObjectContext& context, std::string_view auto path2 = Path::Combine(dir, std::string(path.substr(11))); return ObjectAsset(path2); } - else - { - return context.GetAsset(path); - } + + return context.GetAsset(path); } diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index e4c8d05f43..927e92ca5b 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -297,11 +297,9 @@ bool ObjectAsset::IsAvailable() const { return File::Exists(_path); } - else - { - auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); - return zipArchive != nullptr && zipArchive->Exists(_path); - } + + auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); + return zipArchive != nullptr && zipArchive->Exists(_path); } uint64_t ObjectAsset::GetSize() const @@ -310,17 +308,15 @@ uint64_t ObjectAsset::GetSize() const { return File::GetSize(_path); } - else + + auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); + if (zipArchive != nullptr) { - auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); - if (zipArchive != nullptr) + auto index = zipArchive->GetIndexFromPath(_path); + if (index.has_value()) { - auto index = zipArchive->GetIndexFromPath(_path); - if (index.has_value()) - { - auto size = zipArchive->GetFileSize(index.value()); - return size; - } + auto size = zipArchive->GetFileSize(index.value()); + return size; } } return 0; @@ -332,16 +328,14 @@ std::unique_ptr ObjectAsset::GetStream() const { return std::make_unique(_path, FILE_MODE_OPEN); } - else + + auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); + if (zipArchive != nullptr) { - auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ); - if (zipArchive != nullptr) + auto stream = zipArchive->GetFileStream(_path); + if (stream != nullptr) { - auto stream = zipArchive->GetFileStream(_path); - if (stream != nullptr) - { - return std::make_unique(std::move(zipArchive), std::move(stream)); - } + return std::make_unique(std::move(zipArchive), std::move(stream)); } } return {}; diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 522a9b4963..dd9fcf8bfc 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -414,7 +414,7 @@ private: _loadedObjects.resize(i + 1); return static_cast(i); } - else if (_loadedObjects[i] == nullptr) + if (_loadedObjects[i] == nullptr) { return static_cast(i); } diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 3979bbf001..4663730a63 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -264,14 +264,12 @@ public: { return ObjectFactory::CreateObjectFromJsonFile(*this, ori->Path); } - else if (String::Equals(extension, ".parkobj", true)) + if (String::Equals(extension, ".parkobj", true)) { return ObjectFactory::CreateObjectFromZipFile(*this, ori->Path); } - else - { - return ObjectFactory::CreateObjectFromLegacyFile(*this, ori->Path.c_str()); - } + + return ObjectFactory::CreateObjectFromLegacyFile(*this, ori->Path.c_str()); } void RegisterLoadedObject(const ObjectRepositoryItem* ori, std::unique_ptr&& object) override @@ -447,12 +445,10 @@ private: } return true; } - else - { - Console::Error::WriteLine("Object conflict: '%s'", conflict->Path.c_str()); - Console::Error::WriteLine(" : '%s'", item.Path.c_str()); - return false; - } + + Console::Error::WriteLine("Object conflict: '%s'", conflict->Path.c_str()); + Console::Error::WriteLine(" : '%s'", item.Path.c_str()); + return false; } void ScanObject(const std::string& path) diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index d77c8ec2b1..f967591db2 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -65,8 +65,8 @@ struct ObjectRepositoryItem { if (Sources.empty()) return ObjectSourceGame::Custom; - else - return static_cast(Sources[0]); + + return static_cast(Sources[0]); } }; diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index fa2f76a39a..bcb40af3fa 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -387,8 +387,8 @@ void RideObject::DrawPreview(rct_drawpixelinfo* dpi, [[maybe_unused]] int32_t wi { if (rideType != RIDE_TYPE_NULL) break; - else - imageId++; + + imageId++; } gfx_draw_sprite(dpi, imageId, { 0, 0 }, 0); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index 1868ef8afa..243e5bca95 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -21,12 +21,9 @@ paint_struct* PaintAddImageAsParentRotated( session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }); } - else - { - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, - { bound_box_length_x, bound_box_length_y, bound_box_length_z }); - } + + return PaintAddImageAsParent( + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }); } paint_struct* PaintAddImageAsParentRotated( @@ -40,12 +37,10 @@ paint_struct* PaintAddImageAsParentRotated( session, image_id, { y_offset, x_offset, z_offset }, { bound_box_length_y, bound_box_length_x, bound_box_length_z }, { bound_box_offset_y, bound_box_offset_x, bound_box_offset_z }); } - else - { - return PaintAddImageAsParent( - session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, - { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); - } + + return PaintAddImageAsParent( + session, image_id, { x_offset, y_offset, z_offset }, { bound_box_length_x, bound_box_length_y, bound_box_length_z }, + { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } paint_struct* PaintAddImageAsParentRotated( @@ -58,10 +53,8 @@ paint_struct* PaintAddImageAsParentRotated( session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); } - else - { - return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, boundBoxOffset); - } + + return PaintAddImageAsParent(session, image_id, offset, boundBoxSize, boundBoxOffset); } paint_struct* PaintAddImageAsParentRotated( @@ -73,10 +66,8 @@ paint_struct* PaintAddImageAsParentRotated( return PaintAddImageAsParent( session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }); } - else - { - return PaintAddImageAsParent(session, image_id, offset, boundBoxSize); - } + + return PaintAddImageAsParent(session, image_id, offset, boundBoxSize); } paint_struct* PaintAddImageAsChildRotated( @@ -90,12 +81,10 @@ paint_struct* PaintAddImageAsChildRotated( session, image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, bound_box_offset_y, bound_box_offset_x, bound_box_offset_z); } - else - { - return PaintAddImageAsChild( - session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, - bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); - } + + return PaintAddImageAsChild( + session, image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, + bound_box_offset_x, bound_box_offset_y, bound_box_offset_z); } paint_struct* PaintAddImageAsChildRotated( @@ -108,10 +97,8 @@ paint_struct* PaintAddImageAsChildRotated( session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); } - else - { - return PaintAddImageAsChild(session, image_id, offset, boundBoxSize, boundBoxOffset); - } + + return PaintAddImageAsChild(session, image_id, offset, boundBoxSize, boundBoxOffset); } void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, uint16_t height, uint8_t type) diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index 7731ec8b0c..ae73f422f6 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -186,7 +186,8 @@ bool virtual_floor_tile_is_floor(const CoordsXY& loc) { return true; } - else if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) + + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) { // Check if we are anywhere near the selection tiles (larger scenery / rides) for (const auto& tile : gMapSelectionTiles) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 4c91c65cd7..170734532d 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -906,10 +906,8 @@ void Guest::Tick128UpdateGuest(int32_t index) Remove(); return; } - else - { - PeepFlags &= ~PEEP_FLAGS_EXPLODE; - } + + PeepFlags &= ~PEEP_FLAGS_EXPLODE; } if (PeepFlags & PEEP_FLAGS_HUNGER) @@ -1478,7 +1476,8 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price) InsertNewThought(PeepThoughtType::HaventFinished, food); return false; } - else if (Nausea >= 145) + + if (Nausea >= 145) return false; } @@ -3641,30 +3640,28 @@ void Guest::UpdateRideAdvanceThroughEntrance() peep_update_ride_leave_entrance_maze(this, ride, entranceLocation); return; } - else if (ride->type == RIDE_TYPE_SPIRAL_SLIDE) + if (ride->type == RIDE_TYPE_SPIRAL_SLIDE) { peep_update_ride_leave_entrance_spiral_slide(this, ride, entranceLocation); return; } - else + + // If the ride type was changed guests will become stuck. + // Inform the player about this if its a new issue or hasn't been addressed within 120 seconds. + if ((ride->current_issues & RIDE_ISSUE_GUESTS_STUCK) == 0 || gCurrentTicks - ride->last_issue_time > 3000) { - // If the ride type was changed guests will become stuck. - // Inform the player about this if its a new issue or hasn't been addressed within 120 seconds. - if ((ride->current_issues & RIDE_ISSUE_GUESTS_STUCK) == 0 || gCurrentTicks - ride->last_issue_time > 3000) + ride->current_issues |= RIDE_ISSUE_GUESTS_STUCK; + ride->last_issue_time = gCurrentTicks; + + auto ft = Formatter(); + ride->FormatNameTo(ft); + if (gConfigNotifications.ride_warnings) { - ride->current_issues |= RIDE_ISSUE_GUESTS_STUCK; - ride->last_issue_time = gCurrentTicks; - - auto ft = Formatter(); - ride->FormatNameTo(ft); - if (gConfigNotifications.ride_warnings) - { - News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, EnumValue(CurrentRide), ft); - } + News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, EnumValue(CurrentRide), ft); } - - return; } + + return; } Vehicle* vehicle = GetEntity(ride->vehicles[CurrentTrain]); @@ -4559,7 +4556,8 @@ void Guest::UpdateRideApproachSpiralSlide() MoveTo({ LOCATION_NULL, y, z }); return; } - else if (waypoint == 2) + + if (waypoint == 2) { bool lastRide = false; if (ride->status != RideStatus::Open) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 91a3e633f7..68582bfa2b 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -1669,8 +1669,8 @@ static int32_t guest_path_find_entering_park(Peep* peep, uint8_t edges) if (chosenDirection == INVALID_DIRECTION) return guest_path_find_aimless(peep, edges); - else - return peep_move_one_tile(chosenDirection, peep); + + return peep_move_one_tile(chosenDirection, peep); } /** @@ -1724,8 +1724,8 @@ static int32_t guest_path_find_leaving_park(Peep* peep, uint8_t edges) direction = peep_pathfind_choose_direction(TileCoordsXYZ{ peep->NextLoc }, peep); if (direction == INVALID_DIRECTION) return guest_path_find_aimless(peep, edges); - else - return peep_move_one_tile(direction, peep); + + return peep_move_one_tile(direction, peep); } /** @@ -1782,8 +1782,8 @@ static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges) if (chosenDirection == INVALID_DIRECTION) return guest_path_find_aimless(peep, edges); - else - return peep_move_one_tile(chosenDirection, peep); + + return peep_move_one_tile(chosenDirection, peep); } /** diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 1ab1132cb0..1d0ae3c95c 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -313,17 +313,16 @@ PeepActionSpriteType Peep::GetActionSpriteType() { // PeepActionType::None1 or PeepActionType::None2 return PeepSpecialSpriteToSpriteTypeMap[SpecialSprite]; } - else if (EnumValue(Action) < std::size(PeepActionToSpriteTypeMap)) + + if (EnumValue(Action) < std::size(PeepActionToSpriteTypeMap)) { return PeepActionToSpriteTypeMap[EnumValue(Action)]; } - else - { - openrct2_assert( - EnumValue(Action) >= std::size(PeepActionToSpriteTypeMap) && Action < PeepActionType::Idle, - "Invalid peep action %u", EnumValue(Action)); - return PeepActionSpriteType::None; - } + + openrct2_assert( + EnumValue(Action) >= std::size(PeepActionToSpriteTypeMap) && Action < PeepActionType::Idle, "Invalid peep action %u", + EnumValue(Action)); + return PeepActionSpriteType::None; } /* @@ -1513,17 +1512,15 @@ bool Peep::SetName(std::string_view value) Name = nullptr; return true; } - else + + auto newNameMemory = static_cast(std::malloc(value.size() + 1)); + if (newNameMemory != nullptr) { - auto newNameMemory = static_cast(std::malloc(value.size() + 1)); - if (newNameMemory != nullptr) - { - std::memcpy(newNameMemory, value.data(), value.size()); - newNameMemory[value.size()] = '\0'; - std::free(Name); - Name = newNameMemory; - return true; - } + std::memcpy(newNameMemory, value.data(), value.size()); + newNameMemory[value.size()] = '\0'; + std::free(Name); + Name = newNameMemory; + return true; } return false; } @@ -1835,15 +1832,13 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin found = true; break; } - else + + if (z != nextTileElement->base_height) { - if (z != nextTileElement->base_height) - { - continue; - } - found = true; - break; + continue; } + found = true; + break; } while (!(nextTileElement++)->IsLastForTile()); } @@ -1963,7 +1958,8 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool crowded++; continue; } - else if (auto litter = entity->As(); litter != nullptr) + + if (auto litter = entity->As(); litter != nullptr) { if (abs(litter->z - guest->NextLoc.z) > 16) continue; @@ -2359,7 +2355,8 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) tile_result = tileElement; return; } - else if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) + + if (tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK) { if (peep_interact_with_shop(this, { newLoc, tileElement })) { diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index cbc6e23b91..b61136f668 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1495,7 +1495,7 @@ void Staff::UpdateAnswering() peep_window_state_update(this); return; } - else if (SubState == 1) + if (SubState == 1) { if (IsActionWalking()) { @@ -1509,7 +1509,7 @@ void Staff::UpdateAnswering() Invalidate(); return; } - else if (SubState <= 3) + if (SubState <= 3) { MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) @@ -2529,10 +2529,8 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride) MoveTo({ loc.value(), z }); return false; } - else - { - return true; - } + + return true; } /** diff --git a/src/openrct2/platform/Linux.cpp b/src/openrct2/platform/Linux.cpp index e345ba6470..1c5cd97a0a 100644 --- a/src/openrct2/platform/Linux.cpp +++ b/src/openrct2/platform/Linux.cpp @@ -83,11 +83,11 @@ uint16_t platform_get_locale_language() { return LANGUAGE_ENGLISH_US; } - else if (!fnmatch(pattern, "zh_CN", 0)) + if (!fnmatch(pattern, "zh_CN", 0)) { return LANGUAGE_CHINESE_SIMPLIFIED; } - else if (!fnmatch(pattern, "zh_TW", 0)) + if (!fnmatch(pattern, "zh_TW", 0)) { return LANGUAGE_CHINESE_TRADITIONAL; } diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index dc1184564d..8c3c7753ec 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -42,18 +42,14 @@ namespace Platform { return std::string(); } - else + + auto colon = std::strchr(value, ':'); + if (colon == nullptr) { - auto colon = std::strchr(value, ':'); - if (colon == nullptr) - { - return std::string(value); - } - else - { - return std::string(value, colon); - } + return std::string(value); } + + return std::string(value, colon); } std::string GetHomePath() @@ -207,12 +203,10 @@ namespace Platform { return String::Set(buffer, bufferSize, relativePath); } - else - { - String::Set(buffer, bufferSize, absolutePath); - Memory::Free(absolutePath); - return buffer; - } + + String::Set(buffer, bufferSize, absolutePath); + Memory::Free(absolutePath); + return buffer; } std::string ResolveCasing(const std::string& path, bool fileExists) diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 4a7f203e96..1cd6a50026 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -589,12 +589,10 @@ namespace Platform { return String::Set(buffer, bufferSize, relativePath); } - else - { - auto absolutePath = String::ToUtf8(absolutePathW); - String::Set(buffer, bufferSize, absolutePath.c_str()); - return buffer; - } + + auto absolutePath = String::ToUtf8(absolutePathW); + String::Set(buffer, bufferSize, absolutePath.c_str()); + return buffer; } std::string ResolveCasing(const std::string& path, bool fileExists) diff --git a/src/openrct2/platform/Windows.cpp b/src/openrct2/platform/Windows.cpp index 580662bb31..594dcdf7e1 100644 --- a/src/openrct2/platform/Windows.cpp +++ b/src/openrct2/platform/Windows.cpp @@ -120,12 +120,10 @@ bool platform_lock_single_instance() return true; } - else - { - // Already running - CloseHandle(mutex); - return false; - } + + // Already running + CloseHandle(mutex); + return false; } int32_t platform_get_drives() @@ -223,55 +221,55 @@ uint16_t platform_get_locale_language() { return LANGUAGE_ENGLISH_UK; } - else if (strcmp(langCode, "ENU") == 0) + if (strcmp(langCode, "ENU") == 0) { return LANGUAGE_ENGLISH_US; } - else if (strcmp(langCode, "DEU") == 0) + if (strcmp(langCode, "DEU") == 0) { return LANGUAGE_GERMAN; } - else if (strcmp(langCode, "NLD") == 0) + if (strcmp(langCode, "NLD") == 0) { return LANGUAGE_DUTCH; } - else if (strcmp(langCode, "FRA") == 0) + if (strcmp(langCode, "FRA") == 0) { return LANGUAGE_FRENCH; } - else if (strcmp(langCode, "HUN") == 0) + if (strcmp(langCode, "HUN") == 0) { return LANGUAGE_HUNGARIAN; } - else if (strcmp(langCode, "PLK") == 0) + if (strcmp(langCode, "PLK") == 0) { return LANGUAGE_POLISH; } - else if (strcmp(langCode, "ESP") == 0) + if (strcmp(langCode, "ESP") == 0) { return LANGUAGE_SPANISH; } - else if (strcmp(langCode, "SVE") == 0) + if (strcmp(langCode, "SVE") == 0) { return LANGUAGE_SWEDISH; } - else if (strcmp(langCode, "ITA") == 0) + if (strcmp(langCode, "ITA") == 0) { return LANGUAGE_ITALIAN; } - else if (strcmp(langCode, "POR") == 0) + if (strcmp(langCode, "POR") == 0) { return LANGUAGE_PORTUGUESE_BR; } - else if (strcmp(langCode, "FIN") == 0) + if (strcmp(langCode, "FIN") == 0) { return LANGUAGE_FINNISH; } - else if (strcmp(langCode, "NOR") == 0) + if (strcmp(langCode, "NOR") == 0) { return LANGUAGE_NORWEGIAN; } - else if (strcmp(langCode, "DAN") == 0) + if (strcmp(langCode, "DAN") == 0) { return LANGUAGE_DANISH; } @@ -347,8 +345,8 @@ TemperatureUnit platform_get_locale_temperature_format() if (fahrenheit) return TemperatureUnit::Fahrenheit; - else - return TemperatureUnit::Celsius; + + return TemperatureUnit::Celsius; } uint8_t platform_get_locale_date_format() @@ -381,21 +379,19 @@ uint8_t platform_get_locale_date_format() { return DATE_FORMAT_DAY_MONTH_YEAR; } - else if (wcsncmp(L"M", first, 1) == 0) + if (wcsncmp(L"M", first, 1) == 0) { return DATE_FORMAT_MONTH_DAY_YEAR; } - else if (wcsncmp(L"y", first, 1) == 0) + if (wcsncmp(L"y", first, 1) == 0) { if (wcsncmp(L"d", second, 1) == 0) { return DATE_FORMAT_YEAR_DAY_MONTH; } - else - { - // Closest possible option - return DATE_FORMAT_YEAR_MONTH_DAY; - } + + // Closest possible option + return DATE_FORMAT_YEAR_MONTH_DAY; } # endif @@ -421,10 +417,8 @@ bool platform_get_font_path(TTFFontDescriptor* font, utf8* buffer, size_t size) safe_strcat_path(buffer, font->filename, size); return true; } - else - { - return false; - } + + return false; # else log_warning("Compatibility hack: falling back to C:\\Windows\\Fonts"); safe_strcpy(buffer, "C:\\Windows\\Fonts\\", size); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 9b92a32d41..fc2186e46b 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -157,14 +157,12 @@ namespace RCT1 { return LoadScenario(path); } - else if (String::Equals(extension, ".sv4", true)) + if (String::Equals(extension, ".sv4", true)) { return LoadSavedGame(path); } - else - { - throw std::runtime_error("Invalid RCT1 park extension."); - } + + throw std::runtime_error("Invalid RCT1 park extension."); } ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) override @@ -333,10 +331,8 @@ namespace RCT1 std::memcpy(s4.get(), decodedData.get(), sizeof(S4)); return s4; } - else - { - throw std::runtime_error("Unable to decode park."); - } + + throw std::runtime_error("Unable to decode park."); } void Initialise() @@ -364,10 +360,8 @@ namespace RCT1 { return ""; } - else - { - return path_get_filename(scenarioEntry->path); - } + + return path_get_filename(scenarioEntry->path); } void InitialiseEntryMaps() @@ -2051,7 +2045,7 @@ namespace RCT1 { continue; } - else if (researchItem.item == RCT1_RESEARCH_END) + if (researchItem.item == RCT1_RESEARCH_END) { break; } @@ -2433,11 +2427,9 @@ namespace RCT1 *count = std::size(_s4.research_items_LL); return _s4.research_items_LL; } - else - { - *count = std::size(_s4.research_items); - return _s4.research_items; - } + + *count = std::size(_s4.research_items); + return _s4.research_items; } std::string GetUserString(rct_string_id stringId) diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 7905057840..ba7b2fba32 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -47,10 +47,8 @@ namespace RCT1 auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); return LoadFromStream(&fs); } - else - { - throw std::runtime_error("Invalid RCT1 track extension."); - } + + throw std::runtime_error("Invalid RCT1 track extension."); } bool LoadFromStream(OpenRCT2::IStream* stream) override @@ -85,10 +83,8 @@ namespace RCT1 { return ImportAA(); } - else - { - return ImportTD4(); - } + + return ImportTD4(); } private: diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 597c4ca81b..344535359a 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -1252,8 +1252,8 @@ namespace RCT1 }; if (wallType < std::size(map)) return map[wallType]; - else - return map[0]; + + return map[0]; } const char * GetPathObject(uint8_t pathType) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 560cd73cfd..e36f81845d 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -436,10 +436,8 @@ int32_t RCT12WallElement::GetRCT1WallType(int32_t edge) const { return typeA | (typeB << 2); } - else - { - return -1; - } + + return -1; } colour_t RCT12WallElement::GetRCT1WallColour() const @@ -1282,11 +1280,9 @@ std::string GetTruncatedRCT2String(std::string_view src, size_t maxLength) rct2encoded.resize(i); break; } - else - { - // Skip the next two bytes which represent the unicode character - i += 2; - } + + // Skip the next two bytes which represent the unicode character + i += 2; } } } diff --git a/src/openrct2/rct12/SawyerEncoding.cpp b/src/openrct2/rct12/SawyerEncoding.cpp index 758b6cb226..b944c3d1b1 100644 --- a/src/openrct2/rct12/SawyerEncoding.cpp +++ b/src/openrct2/rct12/SawyerEncoding.cpp @@ -90,12 +90,12 @@ namespace SawyerEncoding if (checksum - 0x1D4C1 == fileChecksum) return RCT12TrackDesignVersion::TD6; - else if (checksum - 0x1A67C == fileChecksum) + if (checksum - 0x1A67C == fileChecksum) return RCT12TrackDesignVersion::TD4; - else if (checksum - 0x1A650 == fileChecksum) + if (checksum - 0x1A650 == fileChecksum) return RCT12TrackDesignVersion::TD4; - else - return RCT12TrackDesignVersion::unknown; + + return RCT12TrackDesignVersion::unknown; } catch (const std::exception&) { diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index dbead6fffd..2fba4a88c6 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -21,28 +21,23 @@ ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const rct_ case RIDE_TYPE_CORKSCREW_ROLLER_COASTER: if (rideEntry != nullptr && !(ride_entry_get_supported_track_pieces(rideEntry) & (1ULL << TRACK_VERTICAL_LOOP))) return RIDE_TYPE_HYPERCOASTER; - else - return RIDE_TYPE_CORKSCREW_ROLLER_COASTER; + return RIDE_TYPE_CORKSCREW_ROLLER_COASTER; case RIDE_TYPE_JUNIOR_ROLLER_COASTER: if (rideEntry != nullptr && ride_entry_get_supported_track_pieces(rideEntry) & (1ULL << TRACK_SLOPE_STEEP)) return RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER; - else - return RIDE_TYPE_JUNIOR_ROLLER_COASTER; + return RIDE_TYPE_JUNIOR_ROLLER_COASTER; case RIDE_TYPE_CAR_RIDE: if (rideEntry != nullptr && ride_entry_get_supported_track_pieces(rideEntry) & (1ULL << TRACK_SLOPE_STEEP)) return RIDE_TYPE_MONSTER_TRUCKS; - else - return RIDE_TYPE_CAR_RIDE; + return RIDE_TYPE_CAR_RIDE; case RIDE_TYPE_TWISTER_ROLLER_COASTER: if (rideEntry != nullptr && rideEntry->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS) return RIDE_TYPE_HYPER_TWISTER; - else - return RIDE_TYPE_TWISTER_ROLLER_COASTER; + return RIDE_TYPE_TWISTER_ROLLER_COASTER; case RIDE_TYPE_STEEL_WILD_MOUSE: if (rideEntry != nullptr && !(ride_entry_get_supported_track_pieces(rideEntry) & (1ULL << TRACK_SLOPE_STEEP))) return RIDE_TYPE_SPINNING_WILD_MOUSE; - else - return RIDE_TYPE_STEEL_WILD_MOUSE; + return RIDE_TYPE_STEEL_WILD_MOUSE; default: return rct2RideType; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d352da994f..2c29d1a939 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -100,14 +100,12 @@ public: { return LoadScenario(path); } - else if (String::Equals(extension, ".sv6", true)) + if (String::Equals(extension, ".sv6", true)) { return LoadSavedGame(path); } - else - { - throw std::runtime_error("Invalid RCT2 park extension."); - } + + throw std::runtime_error("Invalid RCT2 park extension."); } ParkLoadResult LoadSavedGame(const utf8* path, bool skipObjectCheck = false) override @@ -970,7 +968,7 @@ public: invented = false; continue; } - else if (researchItem.IsUninventedEndMarker() || researchItem.IsRandomEndMarker()) + if (researchItem.IsUninventedEndMarker() || researchItem.IsRandomEndMarker()) { break; } diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index 5893b357f4..55794068e4 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -49,10 +49,8 @@ public: auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); return LoadFromStream(&fs); } - else - { - throw std::runtime_error("Invalid RCT2 track extension."); - } + + throw std::runtime_error("Invalid RCT2 track extension."); } bool LoadFromStream(OpenRCT2::IStream* stream) override diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index a42310440b..9d44297b5a 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -404,31 +404,25 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() { break; } - else - { - _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; - _vehicleVelocityF64E0C -= vehicle->remaining_distance - 13962; - vehicle->remaining_distance = 13962; - vehicle->acceleration += dword_9A2970[vehicle->Pitch]; - _vehicleUnkF64E10++; - continue; - } + + _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; + _vehicleVelocityF64E0C -= vehicle->remaining_distance - 13962; + vehicle->remaining_distance = 13962; + vehicle->acceleration += dword_9A2970[vehicle->Pitch]; + _vehicleUnkF64E10++; + continue; } - else + + if (vehicle->CableLiftUpdateTrackMotionForwards()) { - if (vehicle->CableLiftUpdateTrackMotionForwards()) - { - break; - } - else - { - _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; - _vehicleVelocityF64E0C -= vehicle->remaining_distance + 1; - vehicle->remaining_distance = -1; - vehicle->acceleration += dword_9A2970[vehicle->Pitch]; - _vehicleUnkF64E10++; - } + break; } + + _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_5; + _vehicleVelocityF64E0C -= vehicle->remaining_distance + 1; + vehicle->remaining_distance = -1; + vehicle->acceleration += dword_9A2970[vehicle->Pitch]; + _vehicleUnkF64E10++; } vehicle->MoveTo(unk_F64E20); } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 337f269f5e..9aea952e77 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2015,13 +2015,11 @@ std::pair Ride::GetMeasurement() { return { measurement.get(), { STR_EMPTY, {} } }; } - else - { - auto ft = Formatter(); - ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.vehicle).singular); - ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.station).singular); - return { nullptr, { STR_DATA_LOGGING_WILL_START_WHEN_NEXT_LEAVES, ft } }; - } + + auto ft = Formatter(); + ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.vehicle).singular); + ft.Add(GetRideComponentName(GetRideTypeDescriptor().NameConvention.station).singular); + return { nullptr, { STR_DATA_LOGGING_WILL_START_WHEN_NEXT_LEAVES, ft } }; } #pragma endregion @@ -4255,10 +4253,8 @@ RideNaming get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry) { return GetRideTypeDescriptor(rideType).Naming; } - else - { - return rideEntry->naming; - } + + return rideEntry->naming; } /* @@ -4741,22 +4737,20 @@ uint8_t ride_entry_get_vehicle_at_position(int32_t rideEntryIndex, int32_t numCa { return rideEntry->front_vehicle; } - else if (position == 1 && rideEntry->second_vehicle != 255) + if (position == 1 && rideEntry->second_vehicle != 255) { return rideEntry->second_vehicle; } - else if (position == 2 && rideEntry->third_vehicle != 255) + if (position == 2 && rideEntry->third_vehicle != 255) { return rideEntry->third_vehicle; } - else if (position == numCarsPerTrain - 1 && rideEntry->rear_vehicle != 255) + if (position == numCarsPerTrain - 1 && rideEntry->rear_vehicle != 255) { return rideEntry->rear_vehicle; } - else - { - return rideEntry->default_vehicle; - } + + return rideEntry->default_vehicle; } // Finds track pieces that a given ride entry has sprites for @@ -5401,16 +5395,14 @@ int32_t get_booster_speed(uint8_t rideType, int32_t rawSpeed) { return rawSpeed; } - else if (shiftFactor > 0) + if (shiftFactor > 0) { return (rawSpeed << shiftFactor); } - else - { - // Workaround for an issue with older compilers (GCC 6, Clang 4) which would fail the build - int8_t shiftFactorAbs = std::abs(shiftFactor); - return (rawSpeed >> shiftFactorAbs); - } + + // Workaround for an issue with older compilers (GCC 6, Clang 4) which would fail the build + int8_t shiftFactorAbs = std::abs(shiftFactor); + return (rawSpeed >> shiftFactorAbs); } void fix_invalid_vehicle_sprite_sizes() diff --git a/src/openrct2/ride/RideAudio.cpp b/src/openrct2/ride/RideAudio.cpp index c87e34fc95..e98d04249c 100644 --- a/src/openrct2/ride/RideAudio.cpp +++ b/src/openrct2/ride/RideAudio.cpp @@ -221,10 +221,8 @@ namespace OpenRCT2::RideAudio { return true; } - else - { - return false; - } + + return false; }), _musicChannels.end()); } @@ -272,18 +270,16 @@ namespace OpenRCT2::RideAudio { return { 1378, 12427456 }; } - else + + auto& objManager = GetContext()->GetObjectManager(); + auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, ride.music)); + if (musicObj != nullptr) { - auto& objManager = GetContext()->GetObjectManager(); - auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, ride.music)); - if (musicObj != nullptr) + auto numTracks = musicObj->GetTrackCount(); + if (ride.music_tune_id < numTracks) { - auto numTracks = musicObj->GetTrackCount(); - if (ride.music_tune_id < numTracks) - { - auto track = musicObj->GetTrack(ride.music_tune_id); - return { track->BytesPerTick, track->Size }; - } + auto track = musicObj->GetTrack(ride.music_tune_id); + return { track->BytesPerTick, track->Size }; } } return { 0, 0 }; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index e27ee73ed0..c7996973a1 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -335,10 +335,8 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in gGameCommandErrorText = STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE; return false; } - else - { - return true; - } + + return true; } currentLoc = stationFrontLoc; @@ -432,31 +430,27 @@ bool track_circuit_iterator_previous(track_circuit_iterator* it) it->first = it->current.element; return true; } - else + + if (!it->firstIteration && it->first == it->current.element) { - if (!it->firstIteration && it->first == it->current.element) - { - it->looped = true; - return false; - } - - it->firstIteration = false; - it->last = it->current; - - if (track_block_get_previous({ it->last.x, it->last.y, it->last.element }, &trackBeginEnd)) - { - it->current.x = trackBeginEnd.end_x; - it->current.y = trackBeginEnd.end_y; - it->current.element = trackBeginEnd.begin_element; - it->currentZ = trackBeginEnd.begin_z; - it->currentDirection = trackBeginEnd.begin_direction; - return true; - } - else - { - return false; - } + it->looped = true; + return false; } + + it->firstIteration = false; + it->last = it->current; + + if (track_block_get_previous({ it->last.x, it->last.y, it->last.element }, &trackBeginEnd)) + { + it->current.x = trackBeginEnd.end_x; + it->current.y = trackBeginEnd.end_y; + it->current.element = trackBeginEnd.begin_element; + it->currentZ = trackBeginEnd.begin_z; + it->currentDirection = trackBeginEnd.begin_direction; + return true; + } + + return false; } bool track_circuit_iterator_next(track_circuit_iterator* it) @@ -469,18 +463,16 @@ bool track_circuit_iterator_next(track_circuit_iterator* it) it->first = it->current.element; return true; } - else - { - if (!it->firstIteration && it->first == it->current.element) - { - it->looped = true; - return false; - } - it->firstIteration = false; - it->last = it->current; - return track_block_get_next(&it->last, &it->current, &it->currentZ, &it->currentDirection); + if (!it->firstIteration && it->first == it->current.element) + { + it->looped = true; + return false; } + + it->firstIteration = false; + it->last = it->current; + return track_block_get_next(&it->last, &it->current, &it->currentZ, &it->currentDirection); } bool track_circuit_iterators_match(const track_circuit_iterator* firstIt, const track_circuit_iterator* secondIt) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 7057a234d3..0cd32121f5 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -163,10 +163,8 @@ rct_string_id TrackDesign::CreateTrackDesign(const Ride& ride) { return CreateTrackDesignMaze(ride); } - else - { - return CreateTrackDesignTrack(ride); - } + + return CreateTrackDesignTrack(ride); } rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) @@ -1771,11 +1769,9 @@ static std::optional track_design_place_ride(TrackDesign* td6, const Co { return std::nullopt; } - else - { - totalCost += res->Cost; - _trackDesignPlaceStateEntranceExitPlaced = true; - } + + totalCost += res->Cost; + _trackDesignPlaceStateEntranceExitPlaced = true; } break; } @@ -1977,13 +1973,11 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o *outRide = ride; return true; } - else - { - _currentTrackPieceDirection = backup_rotation; - ride->Delete(); - _trackDesignDrawingPreview = false; - return false; - } + + _currentTrackPieceDirection = backup_rotation; + ride->Delete(); + _trackDesignDrawingPreview = false; + return false; } #pragma region Track Design Preview diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index cde8188203..468fcb14b9 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -90,10 +90,8 @@ public: } return std::make_tuple(true, item); } - else - { - return std::make_tuple(true, TrackRepositoryItem()); - } + + return std::make_tuple(true, TrackRepositoryItem()); } protected: diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 9551f0847f..1481176041 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1983,12 +1983,10 @@ static SoundIdVolume sub_6D7AC0( currentVolume = std::min(currentVolume + 15, targetVolume); return { currentSoundId, currentVolume }; } - else - { - currentVolume -= 9; - if (currentVolume >= 80) - return { currentSoundId, currentVolume }; - } + + currentVolume -= 9; + if (currentVolume >= 80) + return { currentSoundId, currentVolume }; } // Begin sound at quarter volume @@ -2307,7 +2305,7 @@ static std::optional ride_get_train_index_from_vehicle(Ride* ride, uin // track type to, e.g., Crooked House break; } - else if (trainIndex >= std::size(ride->vehicles)) + if (trainIndex >= std::size(ride->vehicles)) { return std::nullopt; } @@ -2355,7 +2353,7 @@ void Vehicle::UpdateWaitingForPassengers() Invalidate(); return; } - else if (sub_state == 1) + if (sub_state == 1) { if (time_waiting != 0xFFFF) time_waiting++; @@ -3030,13 +3028,11 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex * trains can depart! */ return false; } - else - { - /* Sync exception - train is not arriving at the station - * and there are less than half the trains for the ride - * travelling. */ - continue; - } + + /* Sync exception - train is not arriving at the station + * and there are less than half the trains for the ride + * travelling. */ + continue; } } } @@ -3377,13 +3373,13 @@ void Vehicle::UpdateDeparting() UpdateDepartingBoatHire(); return; } - else if (curRide->mode == RideMode::ReverseInclineLaunchedShuttle) + if (curRide->mode == RideMode::ReverseInclineLaunchedShuttle) { velocity = -velocity; FinishDeparting(); return; } - else if (curRide->mode == RideMode::Shuttle) + if (curRide->mode == RideMode::Shuttle) { update_flags ^= VEHICLE_UPDATE_FLAG_REVERSING_SHUTTLE; velocity = 0; @@ -3827,7 +3823,7 @@ void Vehicle::UpdateTravelling() UpdateTravellingBoatHireSetup(); return; } - else if (curRide->mode == RideMode::Shuttle) + if (curRide->mode == RideMode::Shuttle) { update_flags ^= VEHICLE_UPDATE_FLAG_REVERSING_SHUTTLE; velocity = 0; @@ -6922,10 +6918,7 @@ int32_t Vehicle::GetSwingAmount() const { return 14; } - else - { - return -15; - } + return -15; case TrackElemType::SBendRight: case TrackElemType::SBendRightCovered: @@ -6934,10 +6927,7 @@ int32_t Vehicle::GetSwingAmount() const { return -14; } - else - { - return 15; - } + return 15; case TrackElemType::LeftQuarterTurn3Tiles: case TrackElemType::LeftBankedQuarterTurn3Tiles: @@ -7002,32 +6992,32 @@ static uint8_t GetSwingSprite(int16_t swingPosition) { if (swingPosition < -10012) return 11; - else if (swingPosition > 10012) + if (swingPosition > 10012) return 12; if (swingPosition < -8191) return 9; - else if (swingPosition > 8191) + if (swingPosition > 8191) return 10; if (swingPosition < -6371) return 7; - else if (swingPosition > 6371) + if (swingPosition > 6371) return 8; if (swingPosition < -4550) return 5; - else if (swingPosition > 4550) + if (swingPosition > 4550) return 6; if (swingPosition < -2730) return 3; - else if (swingPosition > 2730) + if (swingPosition > 2730) return 4; if (swingPosition < -910) return 1; - else if (swingPosition > 910) + if (swingPosition > 910) return 2; return 0; @@ -7247,30 +7237,28 @@ void Vehicle::UpdateAnimationAnimalFlying() animationState--; return; } - else + + if (animation_frame == 0) { - if (animation_frame == 0) + auto trackType = GetTrackType(); + TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + if (trackElement != nullptr && trackElement->AsTrack()->HasChain()) { - auto trackType = GetTrackType(); - TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); - if (trackElement != nullptr && trackElement->AsTrack()->HasChain()) - { - // start flapping, bird - animation_frame = 1; - animationState = 5; - Invalidate(); - } - } - else - { - // continue flapping until reaching frame 0 - animation_frame = (animation_frame + 1) % 4; + // start flapping, bird + animation_frame = 1; + animationState = 5; Invalidate(); } - // number of frames to skip before updating again - constexpr std::array frameWaitTimes = { 5, 3, 5, 3 }; - animationState = frameWaitTimes[animation_frame]; } + else + { + // continue flapping until reaching frame 0 + animation_frame = (animation_frame + 1) % 4; + Invalidate(); + } + // number of frames to skip before updating again + constexpr std::array frameWaitTimes = { 5, 3, 5, 3 }; + animationState = frameWaitTimes[animation_frame]; } /** @@ -9276,10 +9264,8 @@ static constexpr int32_t GetAccelerationDecrease2(const int32_t velocity, const { return accelerationDecrease2 / totalMass; } - else - { - return accelerationDecrease2; - } + + return accelerationDecrease2; } int32_t Vehicle::UpdateTrackMotionMiniGolfCalculateAcceleration(const rct_ride_entry_vehicle& vehicleEntry) @@ -9610,16 +9596,14 @@ int32_t Vehicle::UpdateTrackMotion(int32_t* outStation) { break; } - else + + if (car->remaining_distance < 0x368A) { - if (car->remaining_distance < 0x368A) - { - break; - } - car->acceleration += dword_9A2970[car->Pitch]; - _vehicleUnkF64E10++; - continue; + break; } + car->acceleration += dword_9A2970[car->Pitch]; + _vehicleUnkF64E10++; + continue; } if (car->remaining_distance < 0x368A) { @@ -9630,16 +9614,14 @@ int32_t Vehicle::UpdateTrackMotion(int32_t* outStation) { break; } - else + + if (car->remaining_distance >= 0) { - if (car->remaining_distance >= 0) - { - break; - } - car->acceleration = dword_9A2970[car->Pitch]; - _vehicleUnkF64E10++; - continue; + break; } + car->acceleration = dword_9A2970[car->Pitch]; + _vehicleUnkF64E10++; + continue; } // loc_6DBF20 car->MoveTo(unk_F64E20); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index c6ce4644e7..9586f1fd2c 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -609,7 +609,8 @@ ObjectiveStatus Objective::CheckGuestsBy() const { return ObjectiveStatus::Success; } - else if (currentMonthYear == MONTH_COUNT * Year) + + if (currentMonthYear == MONTH_COUNT * Year) { return ObjectiveStatus::Failure; } @@ -630,7 +631,8 @@ ObjectiveStatus Objective::CheckParkValueBy() const { return ObjectiveStatus::Success; } - else if (currentMonthYear == MONTH_COUNT * Year) + + if (currentMonthYear == MONTH_COUNT * Year) { return ObjectiveStatus::Failure; } diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 48b31d8d01..a2aa515876 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -51,8 +51,7 @@ static int32_t ScenarioCategoryCompare(int32_t categoryA, int32_t categoryB) return 1; if (categoryA < categoryB) return -1; - else - return 1; + return 1; } static int32_t scenario_index_entry_CompareByCategory(const scenario_index_entry& entryA, const scenario_index_entry& entryB) @@ -97,23 +96,19 @@ static int32_t scenario_index_entry_CompareByIndex(const scenario_index_entry& e { return scenario_index_entry_CompareByCategory(entryA, entryB); } - else - { - return ScenarioCategoryCompare(entryA.category, entryB.category); - } + + return ScenarioCategoryCompare(entryA.category, entryB.category); } - else if (entryA.source_index == -1) + if (entryA.source_index == -1) { return 1; } - else if (entryB.source_index == -1) + if (entryB.source_index == -1) { return -1; } - else - { - return entryA.source_index - entryB.source_index; - } + return entryA.source_index - entryB.source_index; + case ScenarioSource::Real: return scenario_index_entry_CompareByCategory(entryA, entryB); } @@ -154,10 +149,8 @@ protected: { return std::make_tuple(true, entry); } - else - { - return std::make_tuple(true, scenario_index_entry()); - } + + return std::make_tuple(true, scenario_index_entry()); } void Serialise(DataSerialiser& ds, scenario_index_entry& item) const override @@ -224,32 +217,28 @@ private: } return result; } - else + + // RCT2 or RCTC scenario + auto stream = GetStreamFromRCT2Scenario(path); + auto chunkReader = SawyerChunkReader(stream.get()); + + rct_s6_header header = chunkReader.ReadChunkAs(); + if (header.type == S6_TYPE_SCENARIO) { - // RCT2 or RCTC scenario - auto stream = GetStreamFromRCT2Scenario(path); - auto chunkReader = SawyerChunkReader(stream.get()); - - rct_s6_header header = chunkReader.ReadChunkAs(); - if (header.type == S6_TYPE_SCENARIO) + rct_s6_info info = chunkReader.ReadChunkAs(); + // If the name or the details contain a colour code, they might be in UTF-8 already. + // This is caused by a bug that was in OpenRCT2 for 3 years. + if (!IsLikelyUTF8(info.name) && !IsLikelyUTF8(info.details)) { - rct_s6_info info = chunkReader.ReadChunkAs(); - // If the name or the details contain a colour code, they might be in UTF-8 already. - // This is caused by a bug that was in OpenRCT2 for 3 years. - if (!IsLikelyUTF8(info.name) && !IsLikelyUTF8(info.details)) - { - rct2_to_utf8_self(info.name, sizeof(info.name)); - rct2_to_utf8_self(info.details, sizeof(info.details)); - } + rct2_to_utf8_self(info.name, sizeof(info.name)); + rct2_to_utf8_self(info.details, sizeof(info.details)); + } - *entry = CreateNewScenarioEntry(path, timestamp, &info); - return true; - } - else - { - log_verbose("%s is not a scenario", path.c_str()); - } + *entry = CreateNewScenarioEntry(path, timestamp, &info); + return true; } + + log_verbose("%s is not a scenario", path.c_str()); } catch (const std::exception&) { diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index a168c2bb5c..4f3881dc75 100644 --- a/src/openrct2/scripting/Duktape.hpp +++ b/src/openrct2/scripting/Duktape.hpp @@ -244,12 +244,10 @@ namespace OpenRCT2::Scripting { return DukValue::take_from_stack(ctx); } - else - { - // Pop error off stack - duk_pop(ctx); - return std::nullopt; - } + + // Pop error off stack + duk_pop(ctx); + return std::nullopt; } std::string ProcessString(const DukValue& value); @@ -345,14 +343,12 @@ namespace OpenRCT2::Scripting { return ToDuk(ctx, nullptr); } - else - { - DukObject dukCoords(ctx); - dukCoords.Set("x", value.x); - dukCoords.Set("y", value.y); - dukCoords.Set("z", value.z); - return dukCoords.Take(); - } + + DukObject dukCoords(ctx); + dukCoords.Set("x", value.x); + dukCoords.Set("y", value.y); + dukCoords.Set("z", value.z); + return dukCoords.Take(); } template<> inline CoordsXYZ FromDuk(const DukValue& value) @@ -377,15 +373,13 @@ namespace OpenRCT2::Scripting { return ToDuk(ctx, nullptr); } - else - { - DukObject dukCoords(ctx); - dukCoords.Set("x", value.x); - dukCoords.Set("y", value.y); - dukCoords.Set("z", value.z); - dukCoords.Set("direction", value.direction); - return dukCoords.Take(); - } + + DukObject dukCoords(ctx); + dukCoords.Set("x", value.x); + dukCoords.Set("y", value.y); + dukCoords.Set("z", value.z); + dukCoords.Set("direction", value.direction); + return dukCoords.Take(); } template<> inline DukValue ToDuk(duk_context* ctx, const GForces& value) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 3f5cf95324..c38ae2f90d 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -189,12 +189,10 @@ private: } break; } - else + + if (duk_get_prop_index(_context, -1, i)) { - if (duk_get_prop_index(_context, -1, i)) - { - Stringify(DukValue::take_from_stack(_context), false, nestLevel + 1); - } + Stringify(DukValue::take_from_stack(_context), false, nestLevel + 1); } } _ss << " ]"; @@ -735,12 +733,10 @@ DukValue ScriptEngine::ExecutePluginCall( { return DukValue::take_from_stack(_context); } - else - { - auto message = duk_safe_to_string(_context, -1); - LogPluginInfo(plugin, message); - duk_pop(_context); - } + + auto message = duk_safe_to_string(_context, -1); + LogPluginInfo(plugin, message); + duk_pop(_context); } return DukValue(); } @@ -798,13 +794,11 @@ std::unique_ptr ScriptEngine::QueryOrExecuteCustomGameActio } return DukToGameActionResult(dukResult); } - else - { - auto action = std::make_unique(); - action->Error = GameActions::Status::Unknown; - action->ErrorTitle = "Unknown custom action"; - return action; - } + + auto action = std::make_unique(); + action->Error = GameActions::Status::Unknown; + action->ErrorTitle = "Unknown custom action"; + return action; } std::unique_ptr ScriptEngine::DukToGameActionResult(const DukValue& d) @@ -1184,23 +1178,21 @@ std::unique_ptr ScriptEngine::CreateGameAction(const std::string& ac } return action; } + + // Serialise args to json so that it can be sent + auto ctx = args.context(); + if (args.type() == DukValue::Type::OBJECT) + { + args.push(); + } else { - // Serialise args to json so that it can be sent - auto ctx = args.context(); - if (args.type() == DukValue::Type::OBJECT) - { - args.push(); - } - else - { - duk_push_object(ctx); - } - auto jsonz = duk_json_encode(ctx, -1); - auto json = std::string(jsonz); - duk_pop(ctx); - return std::make_unique(actionid, json); + duk_push_object(ctx); } + auto jsonz = duk_json_encode(ctx, -1); + auto json = std::string(jsonz); + duk_pop(ctx); + return std::make_unique(actionid, json); } void ScriptEngine::InitSharedStorage() @@ -1406,12 +1398,10 @@ bool OpenRCT2::Scripting::IsGameStateMutable() { return true; } - else - { - auto& scriptEngine = GetContext()->GetScriptEngine(); - auto& execInfo = scriptEngine.GetExecInfo(); - return execInfo.IsGameStateMutable(); - } + + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& execInfo = scriptEngine.GetExecInfo(); + return execInfo.IsGameStateMutable(); } void OpenRCT2::Scripting::ThrowIfGameStateNotMutable() diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 30a9670412..55053439bd 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -58,13 +58,11 @@ namespace OpenRCT2::Scripting case EntityType::Guest: if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) return "peep"; - else - return "guest"; + return "guest"; case EntityType::Staff: if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) return "peep"; - else - return "staff"; + return "staff"; case EntityType::SteamParticle: return "steam_particle"; case EntityType::MoneyEffect: diff --git a/src/openrct2/scripting/bindings/game/ScConfiguration.hpp b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp index 0a63b35065..a7d1477653 100644 --- a/src/openrct2/scripting/bindings/game/ScConfiguration.hpp +++ b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp @@ -54,10 +54,8 @@ namespace OpenRCT2::Scripting { return std::make_pair(input, std::string_view()); } - else - { - return std::make_pair(input.substr(0, pos), input.substr(pos + 1)); - } + + return std::make_pair(input.substr(0, pos), input.substr(pos + 1)); } std::pair GetNamespaceAndKey(std::string_view input) const @@ -179,7 +177,7 @@ namespace OpenRCT2::Scripting duk_push_string(ctx, locale); return DukValue::take_from_stack(ctx); } - else if (key == "general.showFps") + if (key == "general.showFps") { duk_push_boolean(ctx, gConfigGeneral.show_fps); return DukValue::take_from_stack(ctx); diff --git a/src/openrct2/scripting/bindings/world/ScScenario.hpp b/src/openrct2/scripting/bindings/world/ScScenario.hpp index 944f7a47b9..d912be2d0f 100644 --- a/src/openrct2/scripting/bindings/world/ScScenario.hpp +++ b/src/openrct2/scripting/bindings/world/ScScenario.hpp @@ -263,7 +263,7 @@ namespace OpenRCT2::Scripting { if (gScenarioCompletedCompanyValue == MONEY64_UNDEFINED) return "inProgress"; - else if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) + if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) return "failed"; return "completed"; } diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index 66b2b39515..83960d0990 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -425,7 +425,7 @@ static void LegacyScriptGetLine(OpenRCT2::IStream* stream, char* parts) parts[part * 128 + cindex] = 0; return; } - else if (c == '#') + if (c == '#') { parts[part * 128 + cindex] = 0; comment = 1; diff --git a/src/openrct2/title/TitleSequenceManager.cpp b/src/openrct2/title/TitleSequenceManager.cpp index 553c061596..605e6a07d4 100644 --- a/src/openrct2/title/TitleSequenceManager.cpp +++ b/src/openrct2/title/TitleSequenceManager.cpp @@ -185,7 +185,7 @@ namespace TitleSequenceManager { return true; } - else if (a.PredefinedIndex > b.PredefinedIndex) + if (a.PredefinedIndex > b.PredefinedIndex) { return false; } diff --git a/src/openrct2/util/SawyerCoding.cpp b/src/openrct2/util/SawyerCoding.cpp index 2c03a10910..0456aa6a9c 100644 --- a/src/openrct2/util/SawyerCoding.cpp +++ b/src/openrct2/util/SawyerCoding.cpp @@ -415,12 +415,12 @@ int32_t sawyercoding_detect_rct1_version(int32_t gameVersion) if (gameVersion >= 108000 && gameVersion < 110000) return (FILE_VERSION_RCT1 | fileType); - else if (gameVersion >= 110000 && gameVersion < 120000) + if (gameVersion >= 110000 && gameVersion < 120000) return (FILE_VERSION_RCT1_AA | fileType); - else if (gameVersion >= 120000 && gameVersion < 130000) + if (gameVersion >= 120000 && gameVersion < 130000) return (FILE_VERSION_RCT1_LL | fileType); // RCTOA Acres sets this, and possibly some other user-created scenarios as well - else if (gameVersion == 0) + if (gameVersion == 0) return (FILE_VERSION_RCT1_LL | fileType); return -1; diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 2260f5f1b6..67e08c80d7 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -351,17 +351,15 @@ int32_t strlogicalcmp(const char* s1, const char* s2) { if (*s2 == '\0') return *s1 != '\0'; - else if (*s1 == '\0') + if (*s1 == '\0') return -1; - else if (!(isdigit(*s1) && isdigit(*s2))) + if (!(isdigit(*s1) && isdigit(*s2))) { if (toupper(*s1) != toupper(*s2)) return toupper(*s1) - toupper(*s2); - else - { - ++s1; - ++s2; - } + + ++s1; + ++s2; } else { @@ -370,8 +368,9 @@ int32_t strlogicalcmp(const char* s1, const char* s2) unsigned long n2 = strtoul(s2, &lim2, 10); if (n1 > n2) return 1; - else if (n1 < n2) + if (n1 < n2) return -1; + s1 = lim1; s2 = lim2; } @@ -458,10 +457,8 @@ char* safe_strcat(char* destination, const char* source, size_t size) { break; } - else - { - destination++; - } + + destination++; } bool terminated = false; diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 12a005b4c5..1d6947d88b 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -77,52 +77,49 @@ money32 place_provisional_track_piece( return result; } + + auto trackPlaceAction = TrackPlaceAction( + rideIndex, trackType, { trackPos, static_cast(trackDirection) }, 0, 0, 0, liftHillAndAlternativeState, false); + trackPlaceAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + // This command must not be sent over the network + auto res = GameActions::Execute(&trackPlaceAction); + auto tpar = dynamic_cast(res.get()); + result = ((tpar == nullptr) || (res->Error == GameActions::Status::Ok)) ? res->Cost : MONEY32_UNDEFINED; + if (result == MONEY32_UNDEFINED) + return result; + + int16_t z_begin, z_end; + const auto& ted = GetTrackElementDescriptor(trackType); + const rct_track_coordinates& coords = ted.Coordinates; + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) + { + z_begin = coords.z_begin; + z_end = coords.z_end; + } else { - auto trackPlaceAction = TrackPlaceAction( - rideIndex, trackType, { trackPos, static_cast(trackDirection) }, 0, 0, 0, liftHillAndAlternativeState, - false); - trackPlaceAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); - // This command must not be sent over the network - auto res = GameActions::Execute(&trackPlaceAction); - auto tpar = dynamic_cast(res.get()); - result = ((tpar == nullptr) || (res->Error == GameActions::Status::Ok)) ? res->Cost : MONEY32_UNDEFINED; - if (result == MONEY32_UNDEFINED) - return result; - - int16_t z_begin, z_end; - const auto& ted = GetTrackElementDescriptor(trackType); - const rct_track_coordinates& coords = ted.Coordinates; - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) - { - z_begin = coords.z_begin; - z_end = coords.z_end; - } - else - { - z_end = z_begin = coords.z_begin; - } - - _unkF440C5 = { trackPos.x, trackPos.y, trackPos.z + z_begin, static_cast(trackDirection) }; - _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK; - if (tpar != nullptr) - { - viewport_set_visibility((tpar->GroundFlags & ELEMENT_IS_UNDERGROUND) ? 1 : 3); - } - if (_currentTrackSlopeEnd != 0) - viewport_set_visibility(2); - - // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); - - if (!scenery_tool_is_active()) - { - // Set height to where the next track piece would begin - virtual_floor_set_height(trackPos.z - z_begin + z_end); - } - - return result; + z_end = z_begin = coords.z_begin; } + + _unkF440C5 = { trackPos.x, trackPos.y, trackPos.z + z_begin, static_cast(trackDirection) }; + _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK; + if (tpar != nullptr) + { + viewport_set_visibility((tpar->GroundFlags & ELEMENT_IS_UNDERGROUND) ? 1 : 3); + } + if (_currentTrackSlopeEnd != 0) + viewport_set_visibility(2); + + // Invalidate previous track piece (we may not be changing height!) + virtual_floor_invalidate(); + + if (!scenery_tool_is_active()) + { + // Set height to where the next track piece would begin + virtual_floor_set_height(trackPos.z - z_begin + z_end); + } + + return result; } static std::tuple window_ride_construction_update_state_get_track_element() diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 731922ab31..e7f40fd650 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -222,10 +222,8 @@ bool climate_is_raining() { return true; } - else - { - return false; - } + + return false; } bool climate_is_snowing() @@ -235,10 +233,8 @@ bool climate_is_snowing() { return true; } - else - { - return false; - } + + return false; } bool WeatherIsDry(WeatherType weatherType) @@ -274,10 +270,8 @@ static int8_t climate_step_weather_level(int8_t currentWeatherLevel, int8_t next { return currentWeatherLevel + 1; } - else - { - return currentWeatherLevel - 1; - } + + return currentWeatherLevel - 1; } /** diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 6710bead7b..49685c3508 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -267,8 +267,8 @@ ObjectEntryIndex EntranceElement::GetLegacyPathEntryIndex() const { if (HasLegacyPathEntry()) return PathType; - else - return OBJECT_ENTRY_INDEX_NULL; + + return OBJECT_ENTRY_INDEX_NULL; } const FootpathObject* EntranceElement::GetLegacyPathEntry() const @@ -287,8 +287,8 @@ ObjectEntryIndex EntranceElement::GetSurfaceEntryIndex() const { if (HasLegacyPathEntry()) return OBJECT_ENTRY_INDEX_NULL; - else - return PathType; + + return PathType; } const FootpathSurfaceObject* EntranceElement::GetSurfaceEntry() const diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index a2bef0f98d..0b0fd586cb 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -586,19 +586,16 @@ static int32_t rct_neighbour_compare(const void* a, const void* b) uint8_t vb = (static_cast(b))->order; if (va < vb) return 1; - else if (va > vb) + if (va > vb) return -1; - else - { - uint8_t da = (static_cast(a))->direction; - uint8_t db = (static_cast(b))->direction; - if (da < db) - return -1; - else if (da > db) - return 1; - else - return 0; - } + + uint8_t da = (static_cast(a))->direction; + uint8_t db = (static_cast(b))->direction; + if (da < db) + return -1; + if (da > db) + return 1; + return 0; } static void neighbour_list_init(rct_neighbour_list* neighbourList) @@ -860,7 +857,7 @@ static void loc_6A6D7E( } return; } - else if (tileElement->GetBaseZ() == initialTileElementPos.z - LAND_HEIGHT_STEP) + if (tileElement->GetBaseZ() == initialTileElementPos.z - LAND_HEIGHT_STEP) { if (tileElement->AsPath()->IsSloped() && tileElement->AsPath()->GetSlopeDirection() == direction_reverse(direction)) @@ -1653,8 +1650,8 @@ ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const { if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) return SurfaceIndex; - else - return OBJECT_ENTRY_INDEX_NULL; + + return OBJECT_ENTRY_INDEX_NULL; } const FootpathObject* PathElement::GetLegacyPathEntry() const @@ -1717,8 +1714,8 @@ ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const { if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) return OBJECT_ENTRY_INDEX_NULL; - else - return SurfaceIndex; + + return SurfaceIndex; } const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const @@ -1737,8 +1734,8 @@ ObjectEntryIndex PathElement::GetRailingsEntryIndex() const { if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) return OBJECT_ENTRY_INDEX_NULL; - else - return RailingsIndex; + + return RailingsIndex; } const FootpathRailingsObject* PathElement::GetRailingsEntry() const @@ -2163,7 +2160,7 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co if (!tileElement->AsPath()->IsSloped()) // The footpath is flat, it can be connected to from any direction return true; - else if (tileElement->AsPath()->GetSlopeDirection() == direction_reverse(coords.direction)) + if (tileElement->AsPath()->GetSlopeDirection() == direction_reverse(coords.direction)) // The footpath is sloped and its lowest point matches the edge connection return true; } diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 55855570fc..42e2915565 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -539,10 +539,8 @@ inline constexpr Direction DirectionFromTo(const CoordsXY& from, const CoordsXY& { return y_diff < 0 ? 3 : 1; } - else - { - return x_diff < 0 ? 0 : 2; - } + + return x_diff < 0 ? 0 : 2; } /* diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 3a5b9f00a2..2046c91388 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -207,25 +207,23 @@ static bool map_check_free_elements_and_reorganise(size_t numElementsOnTile, siz { return true; } - else - { - // if space issue is due to fragmentation then Reorg Tiles without increasing capacity - if (_tileElements.size() > totalElementsRequired + _tileElementsInUse) - { - ReorganiseTileElements(); - // This check is not expected to fail - freeElements = _tileElements.capacity() - _tileElements.size(); - if (freeElements >= totalElementsRequired) - { - return true; - } - } - // Capacity must increase to handle the space (Note capacity can go above MAX_TILE_ELEMENTS) - auto newCapacity = _tileElements.capacity() * 2; - ReorganiseTileElements(newCapacity); - return true; + // if space issue is due to fragmentation then Reorg Tiles without increasing capacity + if (_tileElements.size() > totalElementsRequired + _tileElementsInUse) + { + ReorganiseTileElements(); + // This check is not expected to fail + freeElements = _tileElements.capacity() - _tileElements.size(); + if (freeElements >= totalElementsRequired) + { + return true; + } } + + // Capacity must increase to handle the space (Note capacity can go above MAX_TILE_ELEMENTS) + auto newCapacity = _tileElements.capacity() * 2; + ReorganiseTileElements(newCapacity); + return true; } static size_t CountElementsOnTile(const CoordsXY& loc); diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 5f6d7c467b..e5f75f9a4d 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -337,10 +337,8 @@ static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) tileElement->AsTrack()->DecrementPhotoTimeout(); return false; } - else - { - return true; - } + + return true; } } while (!(tileElement++)->IsLastForTile()); diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index cefb0081e6..235ed65636 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -102,8 +102,8 @@ static int32_t get_height(int32_t x, int32_t y) { if (x >= 0 && y >= 0 && x < _heightSize && y < _heightSize) return _height[x + y * _heightSize]; - else - return 0; + + return 0; } static void set_height(int32_t x, int32_t y, int32_t height) diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 85c337b416..d9314bfe0a 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -88,10 +88,8 @@ static PeepSpawn* get_random_peep_spawn() { return &gPeepSpawns[scenario_rand() % gPeepSpawns.size()]; } - else - { - return nullptr; - } + + return nullptr; } void park_set_open(bool open) diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 3520dcfcd4..e032676314 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -482,17 +482,17 @@ namespace OpenRCT2::TileInspector { return std::make_unique(GameActions::Status::TooLow, STR_CANT_LOWER_ELEMENT_HERE, STR_TOO_LOW); } - else if (newBaseHeight > MAX_ELEMENT_HEIGHT) + if (newBaseHeight > MAX_ELEMENT_HEIGHT) { return std::make_unique( GameActions::Status::TooHigh, STR_CANT_RAISE_ELEMENT_HERE, STR_TOO_HIGH); } - else if (newClearanceHeight < 0) + if (newClearanceHeight < 0) { return std::make_unique( GameActions::Status::NoClearance, STR_CANT_LOWER_ELEMENT_HERE, STR_NO_CLEARANCE); } - else if (newClearanceHeight > MAX_ELEMENT_HEIGHT) + if (newClearanceHeight > MAX_ELEMENT_HEIGHT) { return std::make_unique( GameActions::Status::NoClearance, STR_CANT_RAISE_ELEMENT_HERE, STR_NO_CLEARANCE); From fc8e0cf9d7fff2ab297255701b3547c170e569c3 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 16 Sep 2021 23:05:50 +0200 Subject: [PATCH 412/681] A couple more nullopt returns (#15422) --- src/openrct2/core/String.hpp | 2 +- src/openrct2/object/ObjectManager.cpp | 2 +- src/openrct2/rct12/RCT12.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/core/String.hpp b/src/openrct2/core/String.hpp index 8c590ee207..82347978b9 100644 --- a/src/openrct2/core/String.hpp +++ b/src/openrct2/core/String.hpp @@ -169,7 +169,7 @@ namespace String { return { 4 }; } - return {}; + return std::nullopt; } /** diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 522a9b4963..46eb2f9ea5 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -419,7 +419,7 @@ private: return static_cast(i); } } - return {}; + return std::nullopt; } size_t GetLoadedObjectIndex(const Object* object) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 560cd73cfd..a371a02f8c 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -1410,5 +1410,5 @@ std::optional GetStyleFromMusicIdentifier(std::string_view identifier) { return std::distance(std::begin(_musicStyles), it); } - return {}; + return std::nullopt; } From 2529568bfc6ce905aa5e486de881248c0c3870ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 17 Sep 2021 23:46:58 +0300 Subject: [PATCH 413/681] Use std::string_view where appropriate in network code Co-authored-by: Ted John --- src/openrct2/interface/Chat.cpp | 6 +- src/openrct2/interface/Chat.h | 4 +- src/openrct2/localisation/Formatting.cpp | 1 + src/openrct2/network/NetworkBase.cpp | 88 +++++++++++----------- src/openrct2/network/NetworkBase.h | 6 +- src/openrct2/network/NetworkConnection.cpp | 18 +---- src/openrct2/network/NetworkConnection.h | 5 +- src/openrct2/network/NetworkGroup.cpp | 2 +- src/openrct2/network/NetworkGroup.h | 3 +- src/openrct2/network/NetworkPacket.cpp | 13 ++-- src/openrct2/network/NetworkPacket.h | 4 +- src/openrct2/network/NetworkPlayer.cpp | 4 +- src/openrct2/network/NetworkPlayer.h | 3 +- src/openrct2/network/network.h | 3 +- 14 files changed, 77 insertions(+), 83 deletions(-) diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 820352ccbe..27e52fae64 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -207,7 +207,7 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor) } } -void chat_history_add(const char* src) +void chat_history_add(std::string_view s) { // Format a timestamp time_t timer{}; @@ -217,7 +217,7 @@ void chat_history_add(const char* src) strcatftime(timeBuffer, sizeof(timeBuffer), "[%H:%M] ", tmInfo); std::string buffer = timeBuffer; - buffer += src; + buffer += s; // Add to history list int32_t index = _chatHistoryIndex % CHAT_HISTORY_SIZE; @@ -227,7 +227,7 @@ void chat_history_add(const char* src) _chatHistoryIndex++; // Log to file (src only as logging does its own timestamp) - network_append_chat_log(src); + network_append_chat_log(s); Mixer_Play_Effect(OpenRCT2::Audio::SoundId::NewsItem, 0, MIXER_VOLUME_MAX, 0.5f, 1.5f, true); } diff --git a/src/openrct2/interface/Chat.h b/src/openrct2/interface/Chat.h index a51cba25a8..40db7583b9 100644 --- a/src/openrct2/interface/Chat.h +++ b/src/openrct2/interface/Chat.h @@ -11,6 +11,8 @@ #include "../common.h" +#include + #define CHAT_HISTORY_SIZE 10 #define CHAT_INPUT_SIZE 1024 #define CHAT_MAX_MESSAGE_LENGTH 200 @@ -37,7 +39,7 @@ void chat_init(); void chat_update(); void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColour); -void chat_history_add(const char* src); +void chat_history_add(std::string_view s); void chat_input(ChatInput input); int32_t chat_string_wrapped_get_height(void* args, int32_t width); diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 464185b2f5..a3a6289311 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -619,6 +619,7 @@ namespace OpenRCT2 template void FormatArgument(FormatBuffer&, FormatToken, uint32_t); template void FormatArgument(FormatBuffer&, FormatToken, uint64_t); template void FormatArgument(FormatBuffer&, FormatToken, const char*); + template void FormatArgument(FormatBuffer&, FormatToken, std::string_view); bool IsRealNameStringId(rct_string_id id) { diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 581b125e5f..e88238c4cd 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -19,6 +19,7 @@ #include "../actions/PeepPickupAction.h" #include "../core/Guard.hpp" #include "../core/Json.hpp" +#include "../localisation/Formatting.h" #include "../platform/Platform2.h" #include "../scripting/ScriptEngine.h" #include "../ui/UiContext.h" @@ -1064,7 +1065,7 @@ std::string NetworkBase::BeginLog(const std::string& directory, const std::strin return Path::Combine(directory, midName, filename); } -void NetworkBase::AppendLog(std::ostream& fs, const std::string& s) +void NetworkBase::AppendLog(std::ostream& fs, std::string_view s) { if (fs.fail()) { @@ -1079,7 +1080,7 @@ void NetworkBase::AppendLog(std::ostream& fs, const std::string& s) auto tmInfo = localtime(&timer); if (strftime(buffer, sizeof(buffer), "[%Y/%m/%d %H:%M:%S] ", tmInfo) != 0) { - String::Append(buffer, sizeof(buffer), s.c_str()); + String::Append(buffer, sizeof(buffer), std::string(s).c_str()); String::Append(buffer, sizeof(buffer), PLATFORM_NEWLINE); fs.write(buffer, strlen(buffer)); @@ -1105,7 +1106,7 @@ void NetworkBase::BeginChatLog() # endif } -void NetworkBase::AppendChatLog(const std::string& s) +void NetworkBase::AppendChatLog(std::string_view s) { if (gConfigNetwork.log_chat && _chat_log_fs.is_open()) { @@ -2230,8 +2231,9 @@ void NetworkBase::Client_Handle_AUTH(NetworkConnection& connection, NetworkPacke break; case NetworkAuth::BadVersion: { - const char* version = packet.ReadString(); - connection.SetLastDisconnectReason(STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, &version); + auto version = std::string(packet.ReadString()); + auto versionp = version.c_str(); + connection.SetLastDisconnectReason(STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, &versionp); connection.Disconnect(); break; } @@ -2261,9 +2263,9 @@ void NetworkBase::Client_Handle_AUTH(NetworkConnection& connection, NetworkPacke } } -void NetworkBase::Server_Client_Joined(const char* name, const std::string& keyhash, NetworkConnection& connection) +void NetworkBase::Server_Client_Joined(std::string_view name, const std::string& keyhash, NetworkConnection& connection) { - auto player = AddPlayer(name, keyhash); + auto player = AddPlayer(std::string(name), keyhash); connection.Player = player; if (player != nullptr) { @@ -2510,15 +2512,14 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke { if (connection.AuthStatus != NetworkAuth::Ok) { - const char* hostName = connection.Socket->GetHostName(); - - const char* gameversion = packet.ReadString(); - const char* name = packet.ReadString(); - const char* password = packet.ReadString(); - const char* pubkey = packet.ReadString(); + auto* hostName = connection.Socket->GetHostName(); + auto gameversion = packet.ReadString(); + auto name = packet.ReadString(); + auto password = packet.ReadString(); + auto pubkey = packet.ReadString(); uint32_t sigsize; packet >> sigsize; - if (pubkey == nullptr) + if (pubkey.empty()) { connection.AuthStatus = NetworkAuth::VerificationFailure; } @@ -2537,7 +2538,7 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke std::memcpy(signature.data(), signatureData, sigsize); - auto ms = MemoryStream(pubkey, strlen(pubkey)); + auto ms = MemoryStream(pubkey.data(), pubkey.size()); if (!connection.Key.LoadPublic(&ms)) { throw std::runtime_error("Failed to load public key."); @@ -2577,24 +2578,24 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.Key.PublicKeyHash())); passwordless = group->CanPerformCommand(GameCommand::PasswordlessLogin); } - if (!gameversion || network_get_version() != gameversion) + if (gameversion != network_get_version()) { connection.AuthStatus = NetworkAuth::BadVersion; log_info("Connection %s: Bad version.", hostName); } - else if (!name) + else if (name.empty()) { connection.AuthStatus = NetworkAuth::BadName; log_info("Connection %s: Bad name.", connection.Socket->GetHostName()); } else if (!passwordless) { - if ((!password || strlen(password) == 0) && !_password.empty()) + if (password.empty() && !_password.empty()) { connection.AuthStatus = NetworkAuth::RequirePassword; log_info("Connection %s: Requires password.", hostName); } - else if (password && _password != password) + else if (!password.empty() && _password != password) { connection.AuthStatus = NetworkAuth::BadPassword; log_info("Connection %s: Bad password.", hostName); @@ -2830,10 +2831,10 @@ bool NetworkBase::SaveMap(IStream* stream, const std::vectorId, text)) @@ -3025,8 +3026,8 @@ void NetworkBase::Client_Handle_TICK([[maybe_unused]] NetworkConnection& connect if (flags & NETWORK_TICK_FLAG_CHECKSUMS) { - const char* text = packet.ReadString(); - if (text != nullptr) + auto text = packet.ReadString(); + if (!text.empty()) { tickData.spriteHash = text; } @@ -3110,12 +3111,10 @@ void NetworkBase::Client_Handle_PINGLIST([[maybe_unused]] NetworkConnection& con void NetworkBase::Client_Handle_SETDISCONNECTMSG(NetworkConnection& connection, NetworkPacket& packet) { - static std::string msg; - const char* disconnectmsg = packet.ReadString(); - if (disconnectmsg) + auto disconnectmsg = packet.ReadString(); + if (!disconnectmsg.empty()) { - msg = disconnectmsg; - connection.SetLastDisconnectReason(msg.c_str()); + connection.SetLastDisconnectReason(disconnectmsg); } } @@ -3147,32 +3146,31 @@ void NetworkBase::Client_Handle_GROUPLIST([[maybe_unused]] NetworkConnection& co void NetworkBase::Client_Handle_EVENT([[maybe_unused]] NetworkConnection& connection, NetworkPacket& packet) { - char text[256]; uint16_t eventType; packet >> eventType; switch (eventType) { case SERVER_EVENT_PLAYER_JOINED: { - const char* playerName = packet.ReadString(); - format_string(text, 256, STR_MULTIPLAYER_PLAYER_HAS_JOINED_THE_GAME, &playerName); - chat_history_add(text); + auto playerName = packet.ReadString(); + auto message = FormatStringId(STR_MULTIPLAYER_PLAYER_HAS_JOINED_THE_GAME, playerName); + chat_history_add(message.c_str()); break; } case SERVER_EVENT_PLAYER_DISCONNECTED: { - const char* playerName = packet.ReadString(); - const char* reason = packet.ReadString(); - const char* args[] = { playerName, reason }; - if (str_is_null_or_empty(reason)) + auto playerName = packet.ReadString(); + auto reason = packet.ReadString(); + std::string message; + if (reason.empty()) { - format_string(text, 256, STR_MULTIPLAYER_PLAYER_HAS_DISCONNECTED_NO_REASON, args); + message = FormatStringId(STR_MULTIPLAYER_PLAYER_HAS_DISCONNECTED_NO_REASON, playerName); } else { - format_string(text, 256, STR_MULTIPLAYER_PLAYER_HAS_DISCONNECTED_WITH_REASON, args); + message = FormatStringId(STR_MULTIPLAYER_PLAYER_HAS_DISCONNECTED_WITH_REASON, playerName, reason); } - chat_history_add(text); + chat_history_add(message.c_str()); break; } } @@ -3187,7 +3185,7 @@ void NetworkBase::Client_Send_GAMEINFO() void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& connection, NetworkPacket& packet) { - const char* jsonString = packet.ReadString(); + auto jsonString = packet.ReadString(); packet >> _serverState.gamestateSnapshotsEnabled; json_t jsonData = Json::FromString(jsonString); @@ -3915,7 +3913,7 @@ void network_set_password(const char* password) network.SetPassword(password); } -void network_append_chat_log(const utf8* text) +void network_append_chat_log(std::string_view text) { auto& network = OpenRCT2::GetContext()->GetNetwork(); network.AppendChatLog(text); @@ -4216,7 +4214,7 @@ int32_t network_get_current_player_group_index() { return 0; } -void network_append_chat_log(const utf8* text) +void network_append_chat_log(std::string_view) { } void network_append_server_log(const utf8* text) diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 73f31cf726..95d6dc8db2 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -43,9 +43,9 @@ public: // Common void SetPassword(const char* password); uint8_t GetDefaultGroup(); std::string BeginLog(const std::string& directory, const std::string& midName, const std::string& filenameFormat); - void AppendLog(std::ostream& fs, const std::string& s); + void AppendLog(std::ostream& fs, std::string_view s); void BeginChatLog(); - void AppendChatLog(const std::string& s); + void AppendChatLog(std::string_view text); void CloseChatLog(); NetworkStats_t GetStats() const; json_t GetServerInfoAsJson() const; @@ -102,7 +102,7 @@ public: // Server void Server_Handle_REQUEST_GAMESTATE(NetworkConnection& connection, NetworkPacket& packet); void Server_Handle_HEARTBEAT(NetworkConnection& connection, NetworkPacket& packet); void Server_Handle_AUTH(NetworkConnection& connection, NetworkPacket& packet); - void Server_Client_Joined(const char* name, const std::string& keyhash, NetworkConnection& connection); + void Server_Client_Joined(std::string_view name, const std::string& keyhash, NetworkConnection& connection); void Server_Handle_CHAT(NetworkConnection& connection, NetworkPacket& packet); void Server_Handle_GAME_ACTION(NetworkConnection& connection, NetworkPacket& packet); void Server_Handle_PING(NetworkConnection& connection, NetworkPacket& packet); diff --git a/src/openrct2/network/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index 14039d7888..6419ae95a6 100644 --- a/src/openrct2/network/NetworkConnection.cpp +++ b/src/openrct2/network/NetworkConnection.cpp @@ -27,7 +27,6 @@ NetworkConnection::NetworkConnection() NetworkConnection::~NetworkConnection() { - delete[] _lastDisconnectReason; } NetworkReadPacket NetworkConnection::ReadPacket() @@ -192,23 +191,12 @@ bool NetworkConnection::ReceivedPacketRecently() const utf8* NetworkConnection::GetLastDisconnectReason() const { - return this->_lastDisconnectReason; + return this->_lastDisconnectReason.c_str(); } -void NetworkConnection::SetLastDisconnectReason(const utf8* src) +void NetworkConnection::SetLastDisconnectReason(std::string_view src) { - if (src == nullptr) - { - delete[] _lastDisconnectReason; - _lastDisconnectReason = nullptr; - return; - } - - if (_lastDisconnectReason == nullptr) - { - _lastDisconnectReason = new utf8[NETWORK_DISCONNECT_REASON_BUFFER_SIZE]; - } - String::Set(_lastDisconnectReason, NETWORK_DISCONNECT_REASON_BUFFER_SIZE, src); + _lastDisconnectReason = src; } void NetworkConnection::SetLastDisconnectReason(const rct_string_id string_id, void* args) diff --git a/src/openrct2/network/NetworkConnection.h b/src/openrct2/network/NetworkConnection.h index d5a94d5056..66bc5bb480 100644 --- a/src/openrct2/network/NetworkConnection.h +++ b/src/openrct2/network/NetworkConnection.h @@ -18,6 +18,7 @@ # include # include +# include # include class NetworkPlayer; @@ -58,13 +59,13 @@ public: bool ReceivedPacketRecently(); const utf8* GetLastDisconnectReason() const; - void SetLastDisconnectReason(const utf8* src); + void SetLastDisconnectReason(std::string_view src); void SetLastDisconnectReason(const rct_string_id string_id, void* args = nullptr); private: std::deque _outboundPackets; uint32_t _lastPacketTime = 0; - utf8* _lastDisconnectReason = nullptr; + std::string _lastDisconnectReason; void RecordPacketStats(const NetworkPacket& packet, bool sending); bool SendPacket(NetworkPacket& packet); diff --git a/src/openrct2/network/NetworkGroup.cpp b/src/openrct2/network/NetworkGroup.cpp index 50b7eb343e..a95d7c5098 100644 --- a/src/openrct2/network/NetworkGroup.cpp +++ b/src/openrct2/network/NetworkGroup.cpp @@ -69,7 +69,7 @@ const std::string& NetworkGroup::GetName() const return _name; } -void NetworkGroup::SetName(std::string name) +void NetworkGroup::SetName(std::string_view name) { _name = name; } diff --git a/src/openrct2/network/NetworkGroup.h b/src/openrct2/network/NetworkGroup.h index 0083a2406e..1038f163b7 100644 --- a/src/openrct2/network/NetworkGroup.h +++ b/src/openrct2/network/NetworkGroup.h @@ -15,6 +15,7 @@ #include #include +#include enum class NetworkPermission : uint32_t; @@ -34,7 +35,7 @@ public: static NetworkGroup FromJson(json_t& json); const std::string& GetName() const; - void SetName(std::string name); + void SetName(std::string_view name); void Read(NetworkPacket& packet); void Write(NetworkPacket& packet); diff --git a/src/openrct2/network/NetworkPacket.cpp b/src/openrct2/network/NetworkPacket.cpp index 078fd7eab6..44ed917bf4 100644 --- a/src/openrct2/network/NetworkPacket.cpp +++ b/src/openrct2/network/NetworkPacket.cpp @@ -66,9 +66,10 @@ void NetworkPacket::Write(const void* bytes, size_t size) Data.insert(Data.end(), src, src + size); } -void NetworkPacket::WriteString(const utf8* string) +void NetworkPacket::WriteString(std::string_view s) { - Write(reinterpret_cast(string), strlen(string) + 1); + Write(s.data(), s.size()); + Data.push_back(0); } const uint8_t* NetworkPacket::Read(size_t size) @@ -83,10 +84,10 @@ const uint8_t* NetworkPacket::Read(size_t size) return data; } -const utf8* NetworkPacket::ReadString() +std::string_view NetworkPacket::ReadString() { if (BytesRead >= Data.size()) - return nullptr; + return {}; const char* str = reinterpret_cast(Data.data() + BytesRead); @@ -98,12 +99,12 @@ const utf8* NetworkPacket::ReadString() } if (str[stringLen] != '\0') - return nullptr; + return {}; // Skip null terminator. BytesRead++; - return str; + return std::string_view(str, stringLen); } #endif diff --git a/src/openrct2/network/NetworkPacket.h b/src/openrct2/network/NetworkPacket.h index ffa464333a..be4c0fd3ae 100644 --- a/src/openrct2/network/NetworkPacket.h +++ b/src/openrct2/network/NetworkPacket.h @@ -39,10 +39,10 @@ struct NetworkPacket final bool CommandRequiresAuth(); const uint8_t* Read(size_t size); - const utf8* ReadString(); + std::string_view ReadString(); void Write(const void* bytes, size_t size); - void WriteString(const utf8* string); + void WriteString(std::string_view s); template NetworkPacket& operator>>(T& value) { diff --git a/src/openrct2/network/NetworkPlayer.cpp b/src/openrct2/network/NetworkPlayer.cpp index 09cdd51ee6..9492216eb8 100644 --- a/src/openrct2/network/NetworkPlayer.cpp +++ b/src/openrct2/network/NetworkPlayer.cpp @@ -15,7 +15,7 @@ # include "../localisation/Localisation.h" # include "NetworkPacket.h" -void NetworkPlayer::SetName(const std::string& name) +void NetworkPlayer::SetName(std::string_view name) { // 36 == 31 + strlen(" #255"); Name = name.substr(0, 36); @@ -23,7 +23,7 @@ void NetworkPlayer::SetName(const std::string& name) void NetworkPlayer::Read(NetworkPacket& packet) { - const utf8* name = packet.ReadString(); + auto name = packet.ReadString(); SetName(name); packet >> Id >> Flags >> Group >> LastAction >> LastActionCoord.x >> LastActionCoord.y >> LastActionCoord.z >> MoneySpent >> CommandsRan; diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index c589900b56..f68afa95e1 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -15,6 +15,7 @@ #include "../world/Map.h" #include +#include #include struct NetworkPacket; @@ -40,7 +41,7 @@ public: std::unordered_map CooldownTime; NetworkPlayer() = default; - void SetName(const std::string& name); + void SetName(std::string_view name); void Read(NetworkPacket& packet); void Write(NetworkPacket& packet); diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 310a04b339..3bde48a7ee 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -22,6 +22,7 @@ #include #include +#include #include struct GameAction; @@ -98,7 +99,7 @@ void network_send_password(const std::string& password); void network_set_password(const char* password); -void network_append_chat_log(const utf8* text); +void network_append_chat_log(std::string_view text); void network_append_server_log(const utf8* text); [[nodiscard]] const utf8* network_get_server_name(); [[nodiscard]] const utf8* network_get_server_description(); From c05068e8d11272da99b39abcc452b536ce8322c3 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 18 Sep 2021 19:07:35 +0100 Subject: [PATCH 414/681] Replace sprite_left,t,r,b with SpriteRect (#15408) * Replace sprite_left,t,r,b with SpriteRect This is required for the NSF. I had to add a silly constructor to rct_sprite for now. Will eventually be removed one day... * Fix compilation and memory leak * Add some UB to prevent some other UB * Make review change --- .../interface/ViewportInteraction.cpp | 6 ++-- src/openrct2/paint/sprite/Paint.Sprite.cpp | 4 +-- src/openrct2/peep/Peep.cpp | 10 +++--- src/openrct2/rct1/S4Importer.cpp | 5 +-- src/openrct2/rct2/S6Exporter.cpp | 8 ++--- src/openrct2/rct2/S6Importer.cpp | 5 +-- src/openrct2/ride/Vehicle.cpp | 10 +++--- src/openrct2/world/EntityBase.h | 8 ++--- src/openrct2/world/Sprite.cpp | 32 ++++++++++++------- src/openrct2/world/Sprite.h | 5 +++ 10 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 214affeb64..8cd139cc03 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -711,11 +711,11 @@ PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t { for (auto peep : EntityList()) { - if (peep->sprite_left == LOCATION_NULL) + if (peep->x == LOCATION_NULL) continue; - auto distance = abs(((peep->sprite_left + peep->sprite_right) / 2) - viewportCoords.x) - + abs(((peep->sprite_top + peep->sprite_bottom) / 2) - viewportCoords.y); + auto distance = abs(((peep->SpriteRect.GetLeft() + peep->SpriteRect.GetRight()) / 2) - viewportCoords.x) + + abs(((peep->SpriteRect.GetTop() + peep->SpriteRect.GetBottom()) / 2) - viewportCoords.y); if (distance > maxDistance) continue; diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 2db53b9db1..8d15249dac 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -92,8 +92,8 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t dpi = &session->DPI; - if (dpi->y + dpi->height <= spr->sprite_top || spr->sprite_bottom <= dpi->y || dpi->x + dpi->width <= spr->sprite_left - || spr->sprite_right <= dpi->x) + if (dpi->y + dpi->height <= spr->SpriteRect.GetTop() || spr->SpriteRect.GetBottom() <= dpi->y + || dpi->x + dpi->width <= spr->SpriteRect.GetLeft() || spr->SpriteRect.GetRight() <= dpi->x) { continue; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 1d0ae3c95c..a4dbe31d87 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1177,15 +1177,15 @@ void peep_update_crowd_noise() for (auto peep : EntityList()) { - if (peep->sprite_left == LOCATION_NULL) + if (peep->x == LOCATION_NULL) continue; - if (viewport->viewPos.x > peep->sprite_right) + if (viewport->viewPos.x > peep->SpriteRect.GetRight()) continue; - if (viewport->viewPos.x + viewport->view_width < peep->sprite_left) + if (viewport->viewPos.x + viewport->view_width < peep->SpriteRect.GetLeft()) continue; - if (viewport->viewPos.y > peep->sprite_bottom) + if (viewport->viewPos.y > peep->SpriteRect.GetBottom()) continue; - if (viewport->viewPos.y + viewport->view_height < peep->sprite_top) + if (viewport->viewPos.y + viewport->view_height < peep->SpriteRect.GetTop()) continue; visiblePeeps += peep->State == PeepState::Queuing ? 1 : 2; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fc2186e46b..6916c69a81 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2688,10 +2688,7 @@ namespace RCT1 dst->sprite_height_positive = src->sprite_height_positive; dst->sprite_direction = src->sprite_direction; - dst->sprite_left = src->sprite_left; - dst->sprite_top = src->sprite_top; - dst->sprite_right = src->sprite_right; - dst->sprite_bottom = src->sprite_bottom; + dst->SpriteRect = ScreenRect(src->sprite_left, src->sprite_top, src->sprite_right, src->sprite_bottom); dst->mass = src->mass; dst->num_seats = src->num_seats; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 5fea5c0f05..29871290be 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1227,10 +1227,10 @@ void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const Entity dst->z = src->z; dst->sprite_width = src->sprite_width; dst->sprite_height_positive = src->sprite_height_positive; - dst->sprite_left = src->sprite_left; - dst->sprite_top = src->sprite_top; - dst->sprite_right = src->sprite_right; - dst->sprite_bottom = src->sprite_bottom; + dst->sprite_left = src->SpriteRect.GetLeft(); + dst->sprite_top = src->SpriteRect.GetTop(); + dst->sprite_right = src->SpriteRect.GetRight(); + dst->sprite_bottom = src->SpriteRect.GetBottom(); dst->sprite_direction = src->sprite_direction; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 2c29d1a939..5c7c7145a4 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1546,10 +1546,7 @@ public: dst->z = src->z; dst->sprite_width = src->sprite_width; dst->sprite_height_positive = src->sprite_height_positive; - dst->sprite_left = src->sprite_left; - dst->sprite_top = src->sprite_top; - dst->sprite_right = src->sprite_right; - dst->sprite_bottom = src->sprite_bottom; + dst->SpriteRect = ScreenRect(src->sprite_left, src->sprite_top, src->sprite_right, src->sprite_bottom); dst->sprite_direction = src->sprite_direction; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 1481176041..ce35781f99 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -967,7 +967,7 @@ bool Vehicle::SoundCanPlay() const if (sound1_id == OpenRCT2::Audio::SoundId::Null && sound2_id == OpenRCT2::Audio::SoundId::Null) return false; - if (sprite_left == LOCATION_NULL) + if (x == LOCATION_NULL) return false; if (g_music_tracking_viewport == nullptr) @@ -984,7 +984,7 @@ bool Vehicle::SoundCanPlay() const bottom -= quarter_h; } - if (left >= sprite_right || bottom >= sprite_bottom) + if (left >= SpriteRect.GetRight() || bottom >= SpriteRect.GetBottom()) return false; int16_t right = g_music_tracking_viewport->view_width + left; @@ -996,7 +996,7 @@ bool Vehicle::SoundCanPlay() const top += quarter_h + quarter_h; } - if (right < sprite_left || top < sprite_top) + if (right < SpriteRect.GetRight() || top < SpriteRect.GetTop()) return false; return true; @@ -1026,7 +1026,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) { OpenRCT2::Audio::VehicleSoundParams param; param.priority = priority; - int32_t panX = (sprite_left / 2) + (sprite_right / 2) - g_music_tracking_viewport->viewPos.x; + int32_t panX = (SpriteRect.GetLeft() / 2) + (SpriteRect.GetRight() / 2) - g_music_tracking_viewport->viewPos.x; panX = panX / g_music_tracking_viewport->zoom; panX += g_music_tracking_viewport->pos.x; @@ -1037,7 +1037,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) } param.pan_x = ((((panX * 65536) / screenWidth) - 0x8000) >> 4); - int32_t panY = (sprite_top / 2) + (sprite_bottom / 2) - g_music_tracking_viewport->viewPos.y; + int32_t panY = (SpriteRect.GetTop() / 2) + (SpriteRect.GetBottom() / 2) - g_music_tracking_viewport->viewPos.y; panY = panY / g_music_tracking_viewport->zoom; panY += g_music_tracking_viewport->pos.y; diff --git a/src/openrct2/world/EntityBase.h b/src/openrct2/world/EntityBase.h index 294e0f6004..3824a59955 100644 --- a/src/openrct2/world/EntityBase.h +++ b/src/openrct2/world/EntityBase.h @@ -1,8 +1,7 @@ #pragma once #include "../common.h" - -struct CoordsXYZ; +#include "../world/Location.hpp" enum class EntityType : uint8_t { @@ -37,10 +36,7 @@ struct EntityBase // Height from centre of sprite to top uint8_t sprite_height_positive; // Screen Coordinates of sprite - int16_t sprite_left; - int16_t sprite_top; - int16_t sprite_right; - int16_t sprite_bottom; + ScreenRect SpriteRect; uint8_t sprite_direction; diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 34571a5bce..aefecb5ee3 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -163,7 +163,7 @@ const std::vector& GetEntityTileList(const CoordsXY& spritePos) void EntityBase::Invalidate() { - if (sprite_left == LOCATION_NULL) + if (x == LOCATION_NULL) return; int32_t maxZoom = 0; @@ -196,7 +196,7 @@ void EntityBase::Invalidate() break; } - viewports_invalidate(sprite_left, sprite_top, sprite_right, sprite_bottom, maxZoom); + viewports_invalidate(SpriteRect.GetLeft(), SpriteRect.GetTop(), SpriteRect.GetRight(), SpriteRect.GetBottom(), maxZoom); } static void ResetEntityLists() @@ -228,7 +228,19 @@ const std::list& GetEntityList(const EntityType id) void reset_sprite_list() { gSavedAge = 0; - std::memset(static_cast(_spriteList), 0, sizeof(_spriteList)); + + // Free all associated Entity pointers prior to zeroing memory + for (int32_t i = 0; i < MAX_ENTITIES; ++i) + { + auto* spr = GetEntity(i); + if (spr == nullptr) + { + continue; + } + FreeEntity(*spr); + } + + std::fill(std::begin(_spriteList), std::end(_spriteList), rct_sprite()); OpenRCT2::RideUse::GetHistory().Clear(); OpenRCT2::RideUse::GetTypeHistory().Clear(); for (int32_t i = 0; i < MAX_ENTITIES; ++i) @@ -238,7 +250,6 @@ void reset_sprite_list() { continue; } - FreeEntity(*spr); spr->Type = EntityType::Null; spr->sprite_index = i; @@ -313,7 +324,8 @@ static void sprite_reset(EntityBase* sprite) uint16_t sprite_index = sprite->sprite_index; _spriteFlashingList[sprite_index] = false; - std::memset(sprite, 0, sizeof(rct_sprite)); + rct_sprite* spr = reinterpret_cast(sprite); + *spr = rct_sprite(); sprite->sprite_index = sprite_index; sprite->Type = EntityType::Null; @@ -370,7 +382,7 @@ static void PrepareNewEntity(EntityBase* base, const EntityType type) base->sprite_width = 0x10; base->sprite_height_negative = 0x14; base->sprite_height_positive = 0x8; - base->sprite_left = LOCATION_NULL; + base->SpriteRect = {}; SpriteSpatialInsert(base, { LOCATION_NULL, 0 }); } @@ -505,7 +517,6 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation) if (loc.x == LOCATION_NULL) { - sprite_left = LOCATION_NULL; x = loc.x; y = loc.y; z = loc.z; @@ -533,10 +544,9 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite) { auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), spritePos); - sprite->sprite_left = screenCoords.x - sprite->sprite_width; - sprite->sprite_right = screenCoords.x + sprite->sprite_width; - sprite->sprite_top = screenCoords.y - sprite->sprite_height_negative; - sprite->sprite_bottom = screenCoords.y + sprite->sprite_height_positive; + sprite->SpriteRect = ScreenRect( + screenCoords - ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_negative }, + screenCoords + ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_positive }); sprite->x = spritePos.x; sprite->y = spritePos.y; sprite->z = spritePos.z; diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 3438888ea6..c148046607 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -23,6 +23,11 @@ union rct_sprite { uint8_t pad_00[0x200]; EntityBase base; + // Provide a constructor as EntityBase is not trivialy constructable + rct_sprite() + : pad_00() + { + } }; assert_struct_size(rct_sprite, 0x200); From fa57b6aea07f357ecc8dc90f7872fbbca8188c31 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 18 Sep 2021 20:34:38 +0100 Subject: [PATCH 415/681] Remove focus union and replace with typed focus (#15426) * Remove focus union and replace with typed focus This if for the NSF to allow for CoordsXYZ * Remove legacy structures * Rework viewport_create to deduplicate logic * Simplify yet further * Apply review comments * Remove intermediate --- src/openrct2-ui/interface/Window.cpp | 6 +- src/openrct2-ui/scripting/CustomWindow.cpp | 8 +- src/openrct2-ui/windows/Banner.cpp | 3 +- src/openrct2-ui/windows/EditorMain.cpp | 3 +- src/openrct2-ui/windows/Guest.cpp | 21 +--- src/openrct2-ui/windows/Main.cpp | 3 +- src/openrct2-ui/windows/Park.cpp | 34 +---- src/openrct2-ui/windows/Player.cpp | 8 +- src/openrct2-ui/windows/Ride.cpp | 68 +++------- src/openrct2-ui/windows/ScenarioSelect.cpp | 1 - src/openrct2-ui/windows/Sign.cpp | 7 +- src/openrct2-ui/windows/Staff.cpp | 25 +--- .../windows/TitleCommandEditor.cpp | 6 +- src/openrct2-ui/windows/Viewport.cpp | 3 +- src/openrct2/interface/Viewport.cpp | 117 +++++++++--------- src/openrct2/interface/Viewport.h | 6 +- src/openrct2/interface/Window.h | 66 ++++------ src/openrct2/interface/Window_internal.cpp | 22 +--- src/openrct2/interface/Window_internal.h | 3 +- 19 files changed, 140 insertions(+), 270 deletions(-) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index bf11d1c644..14aee560f7 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -274,11 +274,7 @@ rct_window* WindowCreate( w->min_height = height; w->max_height = height; - w->viewport_focus_coordinates.var_480 = 0; - w->viewport_focus_coordinates.x = 0; - w->viewport_focus_coordinates.y = 0; - w->viewport_focus_coordinates.z = 0; - w->viewport_focus_coordinates.rotation = 0; + w->focus2 = std::nullopt; w->page = 0; w->var_48C = 0; w->var_492 = 0; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 5573233436..4e01689373 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -786,12 +786,8 @@ namespace OpenRCT2::Ui::Windows auto wheight = viewportWidget->height() - 1; if (viewport == nullptr) { - auto mapX = 0; - auto mapY = 0; - auto mapZ = 0; - viewport_create( - this, { left, top }, wwidth, wheight, 0, { mapX, mapY, mapZ }, VIEWPORT_FOCUS_TYPE_COORDINATE, - SPRITE_INDEX_NULL); + const auto focus = Focus2(CoordsXYZ(0, 0, 0)); + viewport_create(this, { left, top }, wwidth, wheight, focus); flags |= WF_NO_SCROLLING; Invalidate(); } diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 2ec3a3e9a6..3959bc29de 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -79,9 +79,10 @@ private: void CreateViewport() { rct_widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT]; + const auto focus = Focus2(_bannerViewPos); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, 0, _bannerViewPos, 0, SPRITE_INDEX_NULL); + (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, focus); if (viewport != nullptr) viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index d38822ea9a..121b8e4ac3 100644 --- a/src/openrct2-ui/windows/EditorMain.cpp +++ b/src/openrct2-ui/windows/EditorMain.cpp @@ -40,7 +40,8 @@ rct_window* window_editor_main_open() &window_editor_main_events, WC_MAIN_WINDOW, WF_STICK_TO_BACK); window->widgets = window_editor_main_widgets; - viewport_create(window, window->windowPos, window->width, window->height, 0, { 0x0FFF, 0x0FFF, 0 }, 0x1, SPRITE_INDEX_NULL); + const auto focus = Focus2(CoordsXYZ(0x0FFF, 0x0FFF, 0)); + viewport_create(window, window->windowPos, window->width, window->height, focus); window->viewport->flags |= 0x0400; gCurrentRotation = 0; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 3d0d2565a9..d96bcf206d 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -398,7 +398,6 @@ rct_window* window_guest_open(Peep* peep) window->enabled_widgets = window_guest_page_enabled_widgets[0]; window->number = peep->sprite_index; window->page = 0; - window->viewport_focus_coordinates.y = 0; window->frame_no = 0; window->list_information_type = 0; window->picked_peep_frame = 0; @@ -410,8 +409,6 @@ rct_window* window_guest_open(Peep* peep) window->max_height = 450; window->no_list_items = 0; window->selected_list_item = -1; - - window->viewport_focus_coordinates.y = -1; } window->page = 0; @@ -730,16 +727,12 @@ void window_guest_viewport_init(rct_window* w) return; } - auto focus = viewport_update_smart_guest_follow(w, peep); + viewport_update_smart_guest_follow(w, peep); bool reCreateViewport = false; uint16_t origViewportFlags{}; if (w->viewport != nullptr) { - // Check all combos, for now skipping y and rot - if (focus.coordinate.x == w->viewport_focus_coordinates.x - && (focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK) == w->viewport_focus_coordinates.y - && focus.coordinate.z == w->viewport_focus_coordinates.z - && focus.coordinate.rotation == w->viewport_focus_coordinates.rotation) + if (w->focus2.has_value()) return; origViewportFlags = w->viewport->flags; @@ -750,11 +743,6 @@ void window_guest_viewport_init(rct_window* w) window_event_invalidate_call(w); - w->viewport_focus_coordinates.x = focus.coordinate.x; - w->viewport_focus_coordinates.y = focus.coordinate.y; - w->viewport_focus_coordinates.z = focus.coordinate.z; - w->viewport_focus_coordinates.rotation = focus.coordinate.rotation; - if (peep->State != PeepState::Picked && w->viewport == nullptr) { auto view_widget = &w->widgets[WIDX_VIEWPORT]; @@ -762,10 +750,7 @@ void window_guest_viewport_init(rct_window* w) int32_t width = view_widget->width() - 1; int32_t height = view_widget->height() - 1; - viewport_create( - w, screenPos, width, height, 0, - { focus.coordinate.x, focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK, focus.coordinate.z }, - focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id); + viewport_create(w, screenPos, width, height, w->focus2.value()); if (w->viewport != nullptr && reCreateViewport) { w->viewport->flags = origViewportFlags; diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 4013b9f1ae..347f2cc49f 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -41,7 +41,8 @@ rct_window* window_main_open() WF_STICK_TO_BACK); window->widgets = window_main_widgets; - viewport_create(window, window->windowPos, window->width, window->height, 0, { 0x0FFF, 0x0FFF, 0 }, 0x1, SPRITE_INDEX_NULL); + const auto focus = Focus2(CoordsXYZ(0x0FFF, 0x0FFF, 0)); + viewport_create(window, window->windowPos, window->width, window->height, focus); window->viewport->flags |= VIEWPORT_FLAG_SOUND_ON; gCurrentRotation = 0; gShowGridLinesRefCount = 0; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 4ac9087e87..6b477ad3b4 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -415,7 +415,6 @@ static rct_window* window_park_open() w->enabled_widgets = window_park_page_enabled_widgets[WINDOW_PARK_PAGE_ENTRANCE]; w->number = 0; w->page = WINDOW_PARK_PAGE_ENTRANCE; - w->viewport_focus_coordinates.y = 0; w->frame_no = 0; w->list_information_type = std::numeric_limits::max(); w->numberOfStaff = -1; @@ -459,8 +458,6 @@ rct_window* window_park_entrance_open() if (window == nullptr) { window = window_park_open(); - window->viewport_focus_coordinates.y = -1; - window->viewport_focus_coordinates.x = -1; } window->page = WINDOW_PARK_PAGE_ENTRANCE; @@ -738,22 +735,16 @@ static void window_park_entrance_paint(rct_window* w, rct_drawpixelinfo* dpi) */ static void window_park_init_viewport(rct_window* w) { - int32_t x, y, z, r, xy, zr, viewportFlags; - x = y = z = r = xy = zr = 0; + int32_t viewportFlags; if (w->page != WINDOW_PARK_PAGE_ENTRANCE) return; + std::optional focus = std::nullopt; if (!gParkEntrances.empty()) { const auto& entrance = gParkEntrances[0]; - x = entrance.x + 16; - y = entrance.y + 16; - z = entrance.z + 32; - r = get_current_rotation(); - - xy = IMAGE_TYPE_TRANSPARENT | (y << 16) | x; - zr = (z << 16) | (r << 8); + focus = Focus2(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 }); } if (w->viewport == nullptr) @@ -769,13 +760,9 @@ static void window_park_init_viewport(rct_window* w) // Call invalidate event window_event_invalidate_call(w); - w->viewport_focus_coordinates.x = x; - w->viewport_focus_coordinates.y = y; - w->viewport_focus_sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; - w->viewport_focus_coordinates.z = z; - w->viewport_focus_coordinates.rotation = r; + w->focus2 = focus; - if (zr != 0xFFFF) + if (focus.has_value()) { // Create viewport if (w->viewport == nullptr) @@ -783,8 +770,7 @@ static void window_park_init_viewport(rct_window* w) rct_widget* viewportWidget = &window_park_entrance_widgets[WIDX_VIEWPORT]; viewport_create( w, w->windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - viewportWidget->width() - 1, viewportWidget->height() - 1, 0, { x, y, z }, - w->viewport_focus_sprite.type & VIEWPORT_FOCUS_TYPE_MASK, SPRITE_INDEX_NULL); + viewportWidget->width() - 1, viewportWidget->height() - 1, focus.value()); w->flags |= (1 << 2); w->Invalidate(); } @@ -811,8 +797,6 @@ rct_window* window_park_rating_open() if (window == nullptr) { window = window_park_open(); - window->viewport_focus_coordinates.x = -1; - window->viewport_focus_coordinates.y = -1; } if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) @@ -947,8 +931,6 @@ rct_window* window_park_guests_open() if (window == nullptr) { window = window_park_open(); - window->viewport_focus_coordinates.x = -1; - window->viewport_focus_coordinates.y = -1; } if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) @@ -1356,8 +1338,6 @@ rct_window* window_park_objective_open() if (window == nullptr) { window = window_park_open(); - window->viewport_focus_coordinates.x = -1; - window->viewport_focus_coordinates.y = -1; } if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) @@ -1549,8 +1529,6 @@ rct_window* window_park_awards_open() if (window == nullptr) { window = window_park_open(); - window->viewport_focus_coordinates.x = -1; - window->viewport_focus_coordinates.y = -1; } if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index bbbff05b0b..fab5a3df40 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -155,7 +155,6 @@ rct_window* window_player_open(uint8_t id) window = WindowCreateAutoPos(240, 170, &window_player_overview_events, WC_PLAYER, WF_RESIZABLE); window->number = id; window->page = 0; - window->viewport_focus_coordinates.y = 0; window->frame_no = 0; window->list_information_type = 0; window->picked_peep_frame = 0; @@ -164,10 +163,9 @@ rct_window* window_player_open(uint8_t id) window->min_height = 134; window->max_width = 500; window->max_height = 450; + window->no_list_items = 0; window->selected_list_item = -1; - - window->viewport_focus_coordinates.y = -1; } window->page = 0; @@ -549,8 +547,8 @@ static void window_player_set_page(rct_window* w, int32_t page) { if (w->viewport == nullptr) { - viewport_create( - w, w->windowPos, w->width, w->height, 0, TileCoordsXYZ(128, 128, 0).ToCoordsXYZ(), 1, SPRITE_INDEX_NULL); + const auto focus = Focus2(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); + viewport_create(w, w->windowPos, w->width, w->height, focus); w->flags |= WF_NO_SCROLLING; window_event_invalidate_call(w); window_player_update_viewport(w, false); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index a4249d37c9..0805b3d36d 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1591,42 +1591,29 @@ static void window_ride_init_viewport(rct_window* w) if (ride == nullptr) return; - int32_t viewSelectionIndex = w->viewport_focus_coordinates.var_480 - 1; + int32_t viewSelectionIndex = w->ride.view - 1; - union - { - sprite_focus sprite; - coordinate_focus coordinate; - } focus; - - focus.coordinate.x = 0; - focus.coordinate.y = 0; - focus.coordinate.z = 0; - focus.sprite.sprite_id = SPRITE_INDEX_NULL; - focus.coordinate.zoom = 0; - focus.coordinate.rotation = get_current_rotation(); - focus.coordinate.width = 0; - focus.coordinate.height = 0; + std::optional focus; if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { - focus.sprite.sprite_id = ride->vehicles[viewSelectionIndex]; + uint16_t vehId = ride->vehicles[viewSelectionIndex]; rct_ride_entry* ride_entry = ride->GetRideEntry(); if (ride_entry && ride_entry->tab_vehicle != 0) { - Vehicle* vehicle = GetEntity(focus.sprite.sprite_id); + Vehicle* vehicle = GetEntity(vehId); if (vehicle == nullptr) { - focus.sprite.sprite_id = SPRITE_INDEX_NULL; + vehId = SPRITE_INDEX_NULL; } else if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) { - focus.sprite.sprite_id = vehicle->next_vehicle_on_train; + vehId = vehicle->next_vehicle_on_train; } } - if (focus.sprite.sprite_id != SPRITE_INDEX_NULL) + if (vehId != SPRITE_INDEX_NULL) { - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_SPRITE; + focus = Focus2(vehId); } } else if (viewSelectionIndex >= ride->num_vehicles && viewSelectionIndex < (ride->num_vehicles + ride->num_stations)) @@ -1634,41 +1621,28 @@ static void window_ride_init_viewport(rct_window* w) auto stationIndex = GetStationIndexFromViewSelection(*w); if (stationIndex) { - auto location = ride->stations[*stationIndex].GetStart(); - focus.coordinate.x = location.x; - focus.coordinate.y = location.y; - focus.coordinate.z = location.z; - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + const auto location = ride->stations[*stationIndex].GetStart(); + focus = Focus2(location); } } else { if (viewSelectionIndex > 0) { - w->viewport_focus_coordinates.var_480 = 0; + w->ride.view = 0; } if (w->number < ride_overall_views.size()) { const auto& view = ride_overall_views[w->number]; - focus.coordinate.x = view.x; - focus.coordinate.y = view.y; - focus.coordinate.z = view.z; - focus.coordinate.zoom = view.zoom; - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + CoordsXYZ loc = { view.x, view.y, view.z }; + focus = Focus2(loc, view.zoom); } } - focus.coordinate.var_480 = w->viewport_focus_coordinates.var_480; uint16_t viewport_flags = 0; - if (w->viewport != nullptr) { - if (focus.coordinate.x == w->viewport_focus_coordinates.x - && (focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK) == w->viewport_focus_coordinates.y - && focus.coordinate.z == w->viewport_focus_coordinates.z - && focus.coordinate.rotation == w->viewport_focus_coordinates.rotation - && focus.coordinate.zoom == w->viewport_focus_coordinates.zoom && focus.coordinate.width == w->width - && focus.coordinate.height == w->height) + if (focus == w->focus2) { return; } @@ -1682,13 +1656,7 @@ static void window_ride_init_viewport(rct_window* w) window_event_invalidate_call(w); - w->viewport_focus_coordinates.x = focus.coordinate.x; - w->viewport_focus_coordinates.y = focus.coordinate.y; - w->viewport_focus_coordinates.z = focus.coordinate.z; - w->viewport_focus_coordinates.rotation = focus.coordinate.rotation; - w->viewport_focus_coordinates.zoom = focus.coordinate.zoom; - w->viewport_focus_coordinates.width = w->width; - w->viewport_focus_coordinates.height = w->height; + w->focus2 = focus; // rct2: 0x006aec9c only used here so brought it into the function if (!w->viewport && !ride->overall_view.IsNull()) @@ -1698,10 +1666,8 @@ static void window_ride_init_viewport(rct_window* w) auto screenPos = w->windowPos + ScreenCoordsXY{ view_widget->left + 1, view_widget->top + 1 }; int32_t width = view_widget->width() - 1; int32_t height = view_widget->height() - 1; - viewport_create( - w, screenPos, width, height, focus.coordinate.zoom, - { focus.coordinate.x, focus.coordinate.y & VIEWPORT_FOCUS_Y_MASK, focus.coordinate.z }, - focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id); + + viewport_create(w, screenPos, width, height, w->focus2.value()); w->flags |= WF_NO_SCROLLING; w->Invalidate(); diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 99f14c0f87..19f24afbf1 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -196,7 +196,6 @@ rct_window* window_scenarioselect_open(std::function cal initialise_list_items(window); WindowInitScrollWidgets(window); - window->viewport_focus_coordinates.var_480 = -1; window->highlighted_scenario = nullptr; return window; diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index f9e62a7477..bddfd0dd20 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -127,10 +127,10 @@ public: // Create viewport rct_widget& viewportWidget = window_sign_widgets[WIDX_VIEWPORT]; - + const auto focus = Focus2(CoordsXYZ{ signViewPosition, viewZ }); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, - viewportWidget.height() - 1, 0, { signViewPosition, viewZ }, 0, SPRITE_INDEX_NULL); + viewportWidget.height() - 1, focus); viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); @@ -300,9 +300,10 @@ public: // Create viewport rct_widget* viewportWidget = &window_sign_widgets[WIDX_VIEWPORT]; + const auto focus = Focus2(CoordsXYZ{ signViewPos }); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, - viewportWidget->height() - 1, 0, signViewPos, 0, SPRITE_INDEX_NULL); + viewportWidget->height() - 1, focus); if (viewport != nullptr) viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 4545948c59..2a691c0fab 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -267,7 +267,6 @@ rct_window* window_staff_open(Peep* peep) w->number = peep->sprite_index; w->page = 0; - w->viewport_focus_coordinates.y = 0; w->frame_no = 0; w->highlighted_item = 0; @@ -1347,9 +1346,7 @@ void window_staff_viewport_init(rct_window* w) if (w->page != WINDOW_STAFF_OVERVIEW) return; - sprite_focus focus = {}; - - focus.sprite_id = w->number; + std::optional focus; const auto peep = GetStaff(w); if (peep == nullptr) @@ -1357,23 +1354,16 @@ void window_staff_viewport_init(rct_window* w) return; } - if (peep->State == PeepState::Picked) + if (peep->State != PeepState::Picked) { - focus.sprite_id = SPRITE_INDEX_NULL; - } - else - { - focus.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; - focus.rotation = get_current_rotation(); + focus = Focus2(peep->sprite_index); } uint16_t viewport_flags; if (w->viewport) { - // Check all combos, for now skipping y and rot - if (focus.sprite_id == w->viewport_focus_sprite.sprite_id && focus.type == w->viewport_focus_sprite.type - && focus.rotation == w->viewport_focus_sprite.rotation) + if (focus == w->focus2) return; viewport_flags = w->viewport->flags; @@ -1388,9 +1378,7 @@ void window_staff_viewport_init(rct_window* w) window_event_invalidate_call(w); - w->viewport_focus_sprite.sprite_id = focus.sprite_id; - w->viewport_focus_sprite.type = focus.type; - w->viewport_focus_sprite.rotation = focus.rotation; + w->focus2 = focus; if (peep->State != PeepState::Picked) { @@ -1402,8 +1390,7 @@ void window_staff_viewport_init(rct_window* w) int32_t width = view_widget->width() - 1; int32_t height = view_widget->height() - 1; - viewport_create( - w, screenPos, width, height, 0, { 0, 0, 0 }, focus.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite_id); + viewport_create(w, screenPos, width, height, focus.value()); w->flags |= WF_NO_SCROLLING; w->Invalidate(); } diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index 718964cefd..4b15b97904 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -227,9 +227,10 @@ void window_title_command_editor_open(TitleSequence* sequence, int32_t index, bo WindowInitScrollWidgets(window); rct_widget* const viewportWidget = &window_title_command_editor_widgets[WIDX_VIEWPORT]; + const auto focus = Focus2(CoordsXYZ{ 0, 0, 0 }); viewport_create( window, window->windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - viewportWidget->width() - 1, viewportWidget->height() - 1, 0, { 0, 0, 0 }, 0, SPRITE_INDEX_NULL); + viewportWidget->width() - 1, viewportWidget->height() - 1, focus); _window_title_command_editor_index = index; _window_title_command_editor_insert = insert; @@ -476,7 +477,8 @@ static void window_title_command_editor_dropdown(rct_window* w, rct_widgetindex _command.SpriteIndex = SPRITE_INDEX_NULL; _command.SpriteName[0] = '\0'; window_unfollow_sprite(w); - w->viewport->flags &= ~VIEWPORT_FOCUS_TYPE_SPRITE; + // This is incorrect + w->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; break; case TitleScript::Speed: _command.Speed = 1; diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 821ede093a..abcd712170 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -76,7 +76,8 @@ public: enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_ZOOM_IN) | (1ULL << WIDX_ZOOM_OUT) | (1ULL << WIDX_LOCATE); // Create viewport - viewport_create(this, windowPos, width, height, 0, TileCoordsXYZ(128, 128, 0).ToCoordsXYZ(), 1, SPRITE_INDEX_NULL); + const auto focus = Focus2(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); + viewport_create(this, windowPos, width, height, focus); if (viewport == nullptr) { Close(); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 57f4134d93..65e093703f 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -117,6 +117,30 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi return { screenCoord }; } +CoordsXYZ Focus2::GetPos() const +{ + return std::visit( + [](auto&& arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + return arg; + else if constexpr (std::is_same_v) + { + auto* centreEntity = GetEntity(arg); + if (centreEntity != nullptr) + { + return CoordsXYZ{ centreEntity->x, centreEntity->y, centreEntity->z }; + } + else + { + log_error("Invalid entity for focus."); + return CoordsXYZ{}; + } + } + }, + data); +} + /** * Viewport will look at sprite or at coordinates as specified in flags 0b_1X * for sprite 0b_0X for coordinates @@ -134,9 +158,7 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi * flags: edx top most 2 bits 0b_X1 for zoom clear see below for 2nd bit. * w: esi */ -void viewport_create( - rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, int32_t zoom, CoordsXYZ centrePos, - char flags, uint16_t sprite) +void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus2& focus) { rct_viewport* viewport = nullptr; if (_viewports.size() >= MAX_VIEWPORT_COUNT) @@ -151,11 +173,7 @@ void viewport_create( viewport->pos = screenCoords; viewport->width = width; viewport->height = height; - - if (!(flags & VIEWPORT_FOCUS_TYPE_COORDINATE)) - { - zoom = 0; - } + const auto zoom = focus.zoom; viewport->view_width = width << zoom; viewport->view_height = height << zoom; @@ -166,24 +184,16 @@ void viewport_create( viewport->flags |= VIEWPORT_FLAG_GRIDLINES; w->viewport = viewport; - if (flags & VIEWPORT_FOCUS_TYPE_SPRITE) - { - w->viewport_target_sprite = sprite; - auto* centreEntity = GetEntity(sprite); - if (centreEntity != nullptr) - { - centrePos = { centreEntity->x, centreEntity->y, centreEntity->z }; - } - else - { - log_error("Invalid entity for viewport."); - return; - } - } - else - { - w->viewport_target_sprite = SPRITE_INDEX_NULL; - } + CoordsXYZ centrePos = focus.GetPos(); + w->viewport_target_sprite = std::visit( + [](auto&& arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) + return SPRITE_INDEX_NULL; + else if constexpr (std::is_same_v) + return arg; + }, + focus.data); auto centreLoc = centre_2d_coordinates(centrePos, viewport); if (!centreLoc.has_value()) @@ -692,24 +702,23 @@ void viewport_update_smart_sprite_follow(rct_window* window) break; default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. - window->viewport_focus_sprite.sprite_id = window->viewport_smart_follow_sprite; + window->focus2 = Focus2(window->viewport_smart_follow_sprite); window->viewport_target_sprite = window->viewport_smart_follow_sprite; break; } } -viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) +void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) { - viewport_focus focus{}; - focus.type = VIEWPORT_FOCUS_TYPE_SPRITE; - focus.sprite.sprite_id = peep->sprite_index; + Focus2 focus = Focus2(peep->sprite_index); + window->viewport_target_sprite = peep->sprite_index; if (peep->State == PeepState::Picked) { - focus.sprite.sprite_id = SPRITE_INDEX_NULL; window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; - return focus; + window->focus2 = std::nullopt; // No focus + return; } bool overallFocus = true; @@ -725,8 +734,9 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Gues const auto car = train->GetCar(peep->CurrentCar); if (car != nullptr) { - focus.sprite.sprite_id = car->sprite_index; + focus = Focus2(car->sprite_index); overallFocus = false; + window->viewport_target_sprite = car->sprite_index; } } } @@ -738,51 +748,36 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Gues if (ride != nullptr) { auto xy = ride->overall_view.ToTileCentre(); - focus.type = VIEWPORT_FOCUS_TYPE_COORDINATE; - focus.coordinate.x = xy.x; - focus.coordinate.y = xy.y; - focus.coordinate.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE; + CoordsXYZ coordFocus; + coordFocus.x = xy.x; + coordFocus.y = xy.y; + coordFocus.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); + focus = Focus2(coordFocus); + window->viewport_target_sprite = SPRITE_INDEX_NULL; } } - else - { - focus.sprite.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; - focus.sprite.pad_486 &= 0xFFFF; - } - focus.coordinate.rotation = get_current_rotation(); - window->viewport_focus_sprite = focus.sprite; - window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; - return focus; + window->focus2 = focus; } void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep) { - sprite_focus focus = {}; - - focus.sprite_id = window->viewport_smart_follow_sprite; - if (peep->State == PeepState::Picked) { window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; + window->focus2 = std::nullopt; return; } - focus.type |= VIEWPORT_FOCUS_TYPE_SPRITE | VIEWPORT_FOCUS_TYPE_COORDINATE; - - window->viewport_focus_sprite = focus; - window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; + window->focus2 = Focus2(window->viewport_smart_follow_sprite); + window->viewport_target_sprite = window->viewport_smart_follow_sprite; } void viewport_update_smart_vehicle_follow(rct_window* window) { - sprite_focus focus = {}; - focus.sprite_id = window->viewport_smart_follow_sprite; - - window->viewport_focus_sprite = focus; - window->viewport_target_sprite = window->viewport_focus_sprite.sprite_id; + window->focus2 = Focus2(window->viewport_smart_follow_sprite); + window->viewport_target_sprite = window->viewport_smart_follow_sprite; } /** diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 09091e511b..d9b22283ac 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -104,15 +104,13 @@ extern uint8_t gCurrentRotation; void viewport_init_all(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_viewport* viewport); -void viewport_create( - rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, int32_t zoom, CoordsXYZ centrePos, - char flags, uint16_t sprite); +void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus2& focus); void viewport_remove(rct_viewport* viewport); void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t maxZoom = -1); void viewport_update_position(rct_window* window); void viewport_update_sprite_follow(rct_window* window); void viewport_update_smart_sprite_follow(rct_window* window); -viewport_focus viewport_update_smart_guest_follow(rct_window* window, const Guest* peep); +void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep); void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep); void viewport_update_smart_vehicle_follow(rct_window* window); void viewport_render( diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 2eb24fb286..929a0b9141 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -20,6 +20,7 @@ #include #include #include +#include struct rct_drawpixelinfo; struct rct_window; @@ -194,51 +195,34 @@ struct rct_scroll constexpr auto WINDOW_SCROLL_UNDEFINED = std::numeric_limits::max(); -/** - * Viewport focus structure. - * size: 0xA - * Use sprite.type to work out type. - */ -struct coordinate_focus +struct Focus2 { - int16_t var_480; - int16_t x; // 0x482 - int16_t y; // 0x484 & VIEWPORT_FOCUS_Y_MASK - int16_t z; // 0x486 - uint8_t rotation; // 0x488 - uint8_t zoom; // 0x489 - int16_t width; - int16_t height; -}; + using CoordinateFocus = CoordsXYZ; + using EntityFocus = uint16_t; -// Type is viewport_target_sprite_id & 0x80000000 != 0 -struct sprite_focus -{ - int16_t var_480; - uint16_t sprite_id; // 0x482 - uint8_t pad_484; - uint8_t type; // 0x485 & VIEWPORT_FOCUS_TYPE_MASK - uint16_t pad_486; - uint8_t rotation; // 0x488 - uint8_t zoom; // 0x489 -}; + uint8_t zoom = 0; + std::variant data; -#define VIEWPORT_FOCUS_TYPE_MASK 0xC0 -enum VIEWPORT_FOCUS_TYPE : uint8_t -{ - VIEWPORT_FOCUS_TYPE_COORDINATE = (1 << 6), - VIEWPORT_FOCUS_TYPE_SPRITE = (1 << 7) -}; -#define VIEWPORT_FOCUS_Y_MASK 0x3FFF - -struct viewport_focus -{ - VIEWPORT_FOCUS_TYPE type{}; - union + template constexpr explicit Focus2(T newValue, uint8_t newZoom = 0) { - sprite_focus sprite; - coordinate_focus coordinate; - }; + data = newValue; + zoom = newZoom; + } + + CoordsXYZ GetPos() const; + + constexpr bool operator==(const Focus2& other) const + { + if (zoom != other.zoom) + { + return false; + } + return data == other.data; + } + constexpr bool operator!=(const Focus2& other) const + { + return !(*this == other); + } }; struct rct_window_event_list diff --git a/src/openrct2/interface/Window_internal.cpp b/src/openrct2/interface/Window_internal.cpp index 3db47f0186..576212edc7 100644 --- a/src/openrct2/interface/Window_internal.cpp +++ b/src/openrct2/interface/Window_internal.cpp @@ -12,28 +12,10 @@ void rct_window::SetLocation(const CoordsXYZ& coords) void rct_window::ScrollToViewport() { - // In original checked to make sure x and y were not -1 as well. - if (viewport == nullptr || viewport_focus_coordinates.y == -1) + if (viewport == nullptr || !focus2.has_value()) return; - CoordsXYZ newCoords = {}; - if (viewport_focus_sprite.type & VIEWPORT_FOCUS_TYPE_SPRITE) - { - auto* sprite = GetEntity(viewport_focus_sprite.sprite_id); - if (sprite == nullptr) - { - return; - } - newCoords.x = sprite->x; - newCoords.y = sprite->y; - newCoords.z = sprite->z; - } - else - { - newCoords.x = viewport_focus_coordinates.x; - newCoords.y = viewport_focus_coordinates.y & VIEWPORT_FOCUS_Y_MASK; - newCoords.z = viewport_focus_coordinates.z; - } + CoordsXYZ newCoords = focus2.value().GetPos(); auto mainWindow = window_get_main(); if (mainWindow != nullptr) diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index ed63206e35..b699aa0b06 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -55,10 +55,9 @@ struct rct_window uint32_t list_item_positions[1024]{}; uint16_t no_list_items{}; // 0 for no items int16_t selected_list_item{}; // -1 for none selected + std::optional focus2; union { - coordinate_focus viewport_focus_coordinates; - sprite_focus viewport_focus_sprite; campaign_variables campaign; new_ride_variables new_ride; news_variables news; From 81051f2d2138617598b10bab478729a8b5ce179c Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 18 Sep 2021 21:31:23 +0100 Subject: [PATCH 416/681] Add crypt files from NSF --- OpenRCT2.xcodeproj/project.pbxproj | 4 ++ src/openrct2/core/Crypt.OpenRCT2.cpp | 101 +++++++++++++++++++++++++++ src/openrct2/core/Crypt.h | 7 ++ src/openrct2/libopenrct2.vcxproj | 1 + 4 files changed, 113 insertions(+) create mode 100644 src/openrct2/core/Crypt.OpenRCT2.cpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 647207345e..b53a9e1c1d 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -802,6 +802,7 @@ E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA720D496604387806AC168 /* RideUseSystem.h */; }; C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4D523B8782E4C458AF1490D /* GroupVector.hpp */; }; B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F28A181D311D4E078FDB090C /* ZipStream.hpp */; }; + 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1907,6 +1908,7 @@ 2DA720D496604387806AC168 /* RideUseSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RideUseSystem.h; path = src/openrct2/peep/RideUseSystem.h; sourceTree = SOURCE_ROOT; }; F4D523B8782E4C458AF1490D /* GroupVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GroupVector.hpp; path = src/openrct2/core/GroupVector.hpp; sourceTree = SOURCE_ROOT; }; F28A181D311D4E078FDB090C /* ZipStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ZipStream.hpp; path = src/openrct2/core/ZipStream.hpp; sourceTree = SOURCE_ROOT; }; + 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Crypt.OpenRCT2.cpp; path = src/openrct2/core/Crypt.OpenRCT2.cpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2578,6 +2580,7 @@ BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */, F4D523B8782E4C458AF1490D /* GroupVector.hpp */, F28A181D311D4E078FDB090C /* ZipStream.hpp */, + 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */, ); path = core; sourceTree = ""; @@ -4484,6 +4487,7 @@ 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */, 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */, 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */, + 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/core/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp new file mode 100644 index 0000000000..f3ad2d17d5 --- /dev/null +++ b/src/openrct2/core/Crypt.OpenRCT2.cpp @@ -0,0 +1,101 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "Crypt.h" + +#include +#include +#include +#include +#include + +using namespace Crypt; + +class OpenRCT2FNV1aAlgorithm : public FNV1aAlgorithm +{ +private: + static constexpr uint64_t Offset = 0xCBF29CE484222325ULL; + static constexpr uint64_t Prime = 0x00000100000001B3ULL; + + uint64_t _data = Offset; + uint8_t _rem[8]{}; + size_t _remLen{}; + + void ProcessRemainder() + { + if (_remLen > 0) + { + uint64_t temp{}; + std::memcpy(&temp, _rem, _remLen); + _data ^= temp; + _data *= Prime; + _remLen = 0; + } + } + +public: + HashAlgorithm* Clear() override + { + _data = Offset; + return this; + } + + HashAlgorithm* Update(const void* data, size_t dataLen) override + { + if (dataLen == 0) + return this; + + auto src = reinterpret_cast(data); + if (_remLen > 0) + { + // We have remainder, so fill rest of it with bytes from src + auto fillLen = sizeof(uint64_t) - _remLen; + assert(_remLen + fillLen <= sizeof(uint64_t)); + std::memcpy(_rem + _remLen, src, fillLen); + src = reinterpret_cast(reinterpret_cast(src) + fillLen); + _remLen += fillLen; + dataLen -= fillLen; + ProcessRemainder(); + } + + // Process every block of 8 bytes + while (dataLen >= sizeof(uint64_t)) + { + auto temp = *src++; + _data ^= temp; + _data *= Prime; + dataLen -= sizeof(uint64_t); + } + + // Store the remaining data (< 8 bytes) + if (dataLen > 0) + { + _remLen = dataLen; + std::memcpy(&_rem, src, dataLen); + } + return this; + } + + Result Finish() override + { + ProcessRemainder(); + + Result res; + std::memcpy(res.data(), &_data, sizeof(_data)); + return res; + } +}; + +namespace Crypt +{ + std::unique_ptr CreateFNV1a() + { + return std::make_unique(); + } +} // namespace Crypt diff --git a/src/openrct2/core/Crypt.h b/src/openrct2/core/Crypt.h index 18967bd875..87baf9c751 100644 --- a/src/openrct2/core/Crypt.h +++ b/src/openrct2/core/Crypt.h @@ -48,13 +48,20 @@ namespace Crypt using Sha1Algorithm = HashAlgorithm<20>; using Sha256Algorithm = HashAlgorithm<32>; + using FNV1aAlgorithm = HashAlgorithm<8>; // Factories + [[nodiscard]] std::unique_ptr CreateFNV1a(); [[nodiscard]] std::unique_ptr CreateSHA1(); [[nodiscard]] std::unique_ptr CreateSHA256(); [[nodiscard]] std::unique_ptr CreateRSA(); [[nodiscard]] std::unique_ptr CreateRSAKey(); + inline FNV1aAlgorithm::Result FNV1a(const void* data, size_t dataLen) + { + return CreateFNV1a()->Update(data, dataLen)->Finish(); + } + inline Sha1Algorithm::Result SHA1(const void* data, size_t dataLen) { return CreateSHA1()->Update(data, dataLen)->Finish(); diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index d49c087fba..7010f9cf3e 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -598,6 +598,7 @@ + From 99e3883b6e158e50dfb46fcf54a4dbff1fbe35c9 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sun, 19 Sep 2021 04:07:58 +0000 Subject: [PATCH 417/681] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-OO.txt | 1 + data/language/fr-FR.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index f5d4b63906..e2267e339f 100644 --- a/data/language/eo-OO.txt +++ b/data/language/eo-OO.txt @@ -3655,6 +3655,7 @@ STR_6454 :Ne povas renomi rubandon… STR_6455 :Ne povas renomi surskribaĵon… STR_6456 :Giganta Ekrankopio STR_6457 :Raporti cimon sur GitHub +STR_6458 :Sekvi ĉi tion en Ĉefa Vido ############# # Scenarios # diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index b3ddbd05ea..cdd6b22c0f 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -413,7 +413,7 @@ STR_1023 :{POP16}{POP16}{POP16}{COMMA16} voitures par train STR_1024 :{COMMA16} voiture par train STR_1025 :{COMMA16} voitures par train STR_1026 :Le quai est trop long ! -STR_1027 :Localiser sur la vue générale +STR_1027 :Localiser sur la vue principale STR_1028 :En dehors de la carte ! STR_1029 :Impossible de construire à la fois au-dessus et en-dessous de l’eau ! STR_1030 :Ne peut être construit que sous l’eau ! @@ -3662,6 +3662,7 @@ STR_6454 :Impossible de renommer la bannière… STR_6455 :Impossible de renommer le panneau… STR_6456 :Capture d’écran géante STR_6457 :Signaler un bug sur GitHub +STR_6458 :Suivre sur la vue principale ############# # Scenarios # From 938792e6be6c2cde0a03e1d9771bbe61c2817bb9 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 19 Sep 2021 07:19:32 +0100 Subject: [PATCH 418/681] Use CoordsXYZ for ride view (#15434) * Use CoordsXYZ for ride view Part of the NSF but also took the time to refactor slightly to use the more appropriate types. Annoyingly there isn't a operator/ for CoordsXYZ otherwise this could have been further simplified. * Fix missed minx/maxx occurrence Co-authored-by: Michael Steenbeek --- src/openrct2-ui/windows/Ride.cpp | 37 ++++++++++++++------------------ 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 0805b3d36d..ec0286cbb8 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -781,7 +781,7 @@ static std::unique_ptr _trackDesign; // Cached overall view for each ride // (Re)calculated when the ride window is opened struct ride_overall_view { - int16_t x, y, z; + CoordsXYZ loc; uint8_t zoom; }; @@ -1167,10 +1167,10 @@ static void window_ride_update_overall_view(Ride* ride) tile_element_iterator_begin(&it); - int32_t minx = std::numeric_limits::max(), miny = std::numeric_limits::max(), - minz = std::numeric_limits::max(); - int32_t maxx = std::numeric_limits::min(), maxy = std::numeric_limits::min(), - maxz = std::numeric_limits::min(); + 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 (tile_element_iterator_next(&it)) { @@ -1184,13 +1184,13 @@ static void window_ride_update_overall_view(Ride* ride) int32_t baseZ = it.element->GetBaseZ(); int32_t clearZ = it.element->GetClearanceZ(); - minx = std::min(minx, location.x); - miny = std::min(miny, location.y); - minz = std::min(minz, baseZ); + min.x = std::min(min.x, location.x); + min.y = std::min(min.y, location.y); + min.z = std::min(min.z, baseZ); - maxx = std::max(maxx, location.x); - maxy = std::max(maxy, location.y); - maxz = std::max(maxz, clearZ); + 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 = EnumValue(ride->id); @@ -1200,16 +1200,12 @@ static void window_ride_update_overall_view(Ride* ride) } auto& view = ride_overall_views[rideIndex]; - view.x = (minx + maxx) / 2 + 16; - view.y = (miny + maxy) / 2 + 16; - view.z = (minz + maxz) / 2 - 8; + 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 - int32_t dx = maxx - minx; - int32_t dy = maxy - miny; - int32_t dz = maxz - minz; + const auto diff = max - min; - int32_t size = static_cast(std::sqrt(dx * dx + dy * dy + dz * dz)); + const int32_t size = static_cast(std::sqrt(diff.x * diff.x + diff.y * diff.y + diff.z * diff.z)); if (size >= 80) { @@ -1564,7 +1560,7 @@ static std::optional GetStationIndexFromViewSelection(const rct_wi return std::nullopt; } - for (StationIndex index = 0; index < sizeof(ride->stations); ++index) + for (StationIndex index = 0; index < std::size(ride->stations); ++index) { const auto& station = ride->stations[index]; if (!station.Start.IsNull()) @@ -1634,8 +1630,7 @@ static void window_ride_init_viewport(rct_window* w) if (w->number < ride_overall_views.size()) { const auto& view = ride_overall_views[w->number]; - CoordsXYZ loc = { view.x, view.y, view.z }; - focus = Focus2(loc, view.zoom); + focus = Focus2(view.loc, view.zoom); } } From ca689c3948a56a3ecc660f90d002d4be9ba19f10 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 19 Sep 2021 08:28:25 +0100 Subject: [PATCH 419/681] Introduce methods from NSF These methods still call the same legacy functionality for now --- src/openrct2-ui/windows/Staff.cpp | 10 ++---- src/openrct2-ui/windows/StaffList.cpp | 4 +-- .../actions/StaffSetPatrolAreaAction.cpp | 9 +++-- src/openrct2/peep/Peep.h | 5 +++ src/openrct2/peep/Staff.cpp | 35 ++++++++++++++++--- src/openrct2/peep/Staff.h | 2 -- src/openrct2/rct1/S4Importer.cpp | 2 +- 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 2a691c0fab..19780be13f 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -530,7 +530,7 @@ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex, } // Disable clear patrol area if no area is set. - if (gStaffModes[peep->StaffId] != StaffMode::Patrol) + if (!peep->HasPatrolArea()) { Dropdown::SetDisabled(1, true); } @@ -568,12 +568,8 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, { return; } - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[peep->StaffId * STAFF_PATROL_AREA_SIZE + i] = 0; - } - assert(gStaffModes[peep->StaffId] == StaffMode::Patrol); - gStaffModes[peep->StaffId] = StaffMode::Walk; + // TODO: THIS SHOULD BE NETWORKED + peep->ClearPatrolArea(); gfx_invalidate_screen(); staff_update_greyed_patrol_areas(); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index ef633b3bb2..61fae8ff24 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -414,7 +414,7 @@ public: DrawTextEllipsised(&dpi, { actionOffset, y }, actionColumnSize, format, ft); // True if a patrol path is set for the worker - if (gStaffModes[peep->StaffId] == StaffMode::Patrol) + if (peep->HasPatrolArea()) { gfx_draw_sprite(&dpi, ImageId(SPR_STAFF_PATROL_PATH), { nameColumnSize + 5, y }); } @@ -566,7 +566,7 @@ private: if (isPatrolAreaSet) { - if (gStaffModes[peep->StaffId] != StaffMode::Patrol) + if (!peep->HasPatrolArea()) { continue; } diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 8f981a9468..13aff35e18 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -63,14 +63,13 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); } - int32_t patrolOffset = staff->StaffId * STAFF_PATROL_AREA_SIZE; - - staff_toggle_patrol_area(staff->StaffId, _loc); + staff->TogglePatrolArea(_loc); bool isPatrolling = false; - for (int32_t i = 0; i < 128; i++) + const auto peepOffset = staff->StaffId * STAFF_PATROL_AREA_SIZE; + for (int32_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) { - if (gStaffPatrolAreas[patrolOffset + i]) + if (gStaffPatrolAreas[i] != 0) { isPatrolling = true; break; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 08ca29df35..8dbced8f2c 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -881,6 +881,11 @@ public: static void ResetStats(); void Serialise(DataSerialiser& stream); + void ClearPatrolArea(); + void TogglePatrolArea(const CoordsXY& coords); + void SetPatrolArea(const CoordsXY& coords, bool value); + bool HasPatrolArea() const; + private: void UpdatePatrolling(); void UpdateMowing(); diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index b61136f668..91727cf43f 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -174,7 +174,7 @@ bool Staff::IsLocationInPatrol(const CoordsXY& loc) const return false; // Check if staff has patrol area - if (gStaffModes[StaffId] != StaffMode::Patrol) + if (!HasPatrolArea()) return true; return IsPatrolAreaSet(loc); @@ -392,9 +392,9 @@ bool staff_is_patrol_area_set_for_type(StaffType type, const CoordsXY& coords) return staff_is_patrol_area_set(STAFF_MAX_COUNT + static_cast(type), coords); } -void staff_set_patrol_area(int32_t staffIndex, const CoordsXY& coords, bool value) +void Staff::SetPatrolArea(const CoordsXY& coords, bool value) { - int32_t peepOffset = staffIndex * STAFF_PATROL_AREA_SIZE; + int32_t peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); uint32_t* addr = &gStaffPatrolAreas[peepOffset + offset]; if (value) @@ -407,13 +407,38 @@ void staff_set_patrol_area(int32_t staffIndex, const CoordsXY& coords, bool valu } } -void staff_toggle_patrol_area(int32_t staffIndex, const CoordsXY& coords) +void Staff::ClearPatrolArea() { - int32_t peepOffset = staffIndex * STAFF_PATROL_AREA_SIZE; + const auto peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; + std::fill_n(&gStaffPatrolAreas[peepOffset], STAFF_PATROL_AREA_SIZE, 0); + gStaffModes[StaffId] = StaffMode::Walk; +} + +void Staff::TogglePatrolArea(const CoordsXY& coords) +{ + int32_t peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); gStaffPatrolAreas[peepOffset + offset] ^= (1 << bitIndex); } +bool Staff::HasPatrolArea() const +{ + if (gStaffModes[StaffId] != StaffMode::Patrol) + { + return false; + } + + const auto peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; + for (int32_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) + { + if (gStaffPatrolAreas[i] != 0) + { + return true; + } + } + return false; +} + /** * * rct2: 0x006BFBE8 diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 795b9d0fcc..cbd4f05482 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -65,8 +65,6 @@ void staff_set_name(uint16_t spriteIndex, const char* name); bool staff_hire_new_member(StaffType staffType, EntertainerCostume entertainerType); void staff_update_greyed_patrol_areas(); bool staff_is_patrol_area_set_for_type(StaffType type, const CoordsXY& coords); -void staff_set_patrol_area(int32_t staffIndex, const CoordsXY& coords, bool value); -void staff_toggle_patrol_area(int32_t staffIndex, const CoordsXY& coords); colour_t staff_get_colour(StaffType staffType); bool staff_set_colour(StaffType staffType, colour_t value); uint32_t staff_get_available_entertainer_costumes(); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6916c69a81..536177741c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1293,7 +1293,7 @@ namespace RCT1 x <<= 7; int32_t y = val & 0x3E0; y <<= 2; - staff_set_patrol_area(staffmember->StaffId, { x, y }, true); + staffmember->SetPatrolArea({ x, y }, true); } } } From 73f5c48c941b23b120a6372699f6c97460eab2f9 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 19 Sep 2021 08:39:08 +0100 Subject: [PATCH 420/681] Port over getPatrolAreaOffset and revert hasPatrol HasPatrol shouldn't perform the expensive loop check as it was only used in StaffSetPatrolAreaAction and used incorrectly. --- src/openrct2/peep/Staff.cpp | 24 ++++++++---------------- src/openrct2/peep/Staff.h | 3 ++- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 91727cf43f..71cc5b0714 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -365,8 +365,13 @@ void Staff::ResetStats() static std::pair getPatrolAreaOffsetIndex(const CoordsXY& coords) { // Patrol areas are 4 * 4 tiles (32 * 4) = 128 = 2^^7 - auto hash = ((coords.x & 0x1F80) >> 7) | ((coords.y & 0x1F80) >> 1); - return { hash >> 5, hash & 0x1F }; + auto tilePos = TileCoordsXY(coords); + auto x = tilePos.x / 4; + auto y = tilePos.y / 4; + auto bitIndex = (y * STAFF_PATROL_AREA_BLOCKS_PER_LINE) + x; + auto byteIndex = int32_t(bitIndex / 32); + auto byteBitIndex = int32_t(bitIndex % 32); + return { byteIndex, byteBitIndex }; } static bool staff_is_patrol_area_set(int32_t staffIndex, const CoordsXY& coords) @@ -423,20 +428,7 @@ void Staff::TogglePatrolArea(const CoordsXY& coords) bool Staff::HasPatrolArea() const { - if (gStaffModes[StaffId] != StaffMode::Patrol) - { - return false; - } - - const auto peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; - for (int32_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) - { - if (gStaffPatrolAreas[i] != 0) - { - return true; - } - } - return false; + return gStaffModes[StaffId] == StaffMode::Patrol; } /** diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index cbd4f05482..16b28ab2e2 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -15,7 +15,8 @@ #define STAFF_MAX_COUNT 200 // The number of elements in the gStaffPatrolAreas 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. -#define STAFF_PATROL_AREA_SIZE 128 +constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = MAXIMUM_MAP_SIZE_TECHNICAL / 4; +constexpr size_t STAFF_PATROL_AREA_SIZE = (STAFF_PATROL_AREA_BLOCKS_PER_LINE * STAFF_PATROL_AREA_BLOCKS_PER_LINE) / 32; enum class StaffMode : uint8_t { From 5b92f3f9ae6f42654bb17b226f353270e3f7bba6 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 19 Sep 2021 09:00:51 +0100 Subject: [PATCH 421/681] Fix conversion error --- src/openrct2/actions/StaffSetPatrolAreaAction.cpp | 2 +- src/openrct2/peep/Staff.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 13aff35e18..fce035a3b2 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -67,7 +67,7 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const bool isPatrolling = false; const auto peepOffset = staff->StaffId * STAFF_PATROL_AREA_SIZE; - for (int32_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) + for (size_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) { if (gStaffPatrolAreas[i] != 0) { diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 71cc5b0714..2b0e27fd4c 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -143,8 +143,8 @@ void staff_update_greyed_patrol_areas() { for (int32_t staff_type = 0; staff_type < static_cast(StaffType::Count); ++staff_type) { - int32_t staffPatrolOffset = (staff_type + STAFF_MAX_COUNT) * STAFF_PATROL_AREA_SIZE; - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + const size_t staffPatrolOffset = (staff_type + STAFF_MAX_COUNT) * STAFF_PATROL_AREA_SIZE; + for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) { gStaffPatrolAreas[staffPatrolOffset + i] = 0; } @@ -153,8 +153,8 @@ void staff_update_greyed_patrol_areas() { if (static_cast(peep->AssignedStaffType) == staff_type) { - int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + const size_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; + for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) { gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i]; } From 6295473c9464e545ebb9e6b4648d3551da4c2093 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 19 Sep 2021 09:15:10 +0100 Subject: [PATCH 422/681] Fix merged patrol area bug --- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- src/openrct2/peep/Peep.cpp | 1 + src/openrct2/peep/Staff.cpp | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index e2ca9cd4b7..6119942b31 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -226,7 +226,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const gStaffModes[staffIndex] = StaffMode::Walk; - for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) { gStaffPatrolAreas[staffIndex * STAFF_PATROL_AREA_SIZE + i] = 0; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index a4dbe31d87..496d687ddd 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -652,6 +652,7 @@ void peep_sprite_remove(Peep* peep) } else { + staff->ClearPatrolArea(); gStaffModes[staff->StaffId] = StaffMode::None; staff_update_greyed_patrol_areas(); diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 2b0e27fd4c..80afd039fe 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -151,6 +151,10 @@ void staff_update_greyed_patrol_areas() for (auto peep : EntityList()) { + if (!peep->HasPatrolArea()) + { + continue; + } if (static_cast(peep->AssignedStaffType) == staff_type) { const size_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; From ce75fbcae966f909e242f1254e3d9bf927dbc86f Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 19 Sep 2021 09:17:11 +0100 Subject: [PATCH 423/681] Fix graphics issues with staff fire --- src/openrct2/actions/StaffFireAction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index f8138d93a8..4624d4357f 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -57,5 +57,7 @@ GameActions::Result::Ptr StaffFireAction::Execute() const } window_close_by_class(WC_FIRE_PROMPT); peep_sprite_remove(staff); + // Due to patrol areas best to invalidate the whole screen on removal of staff + gfx_invalidate_screen(); return MakeResult(); } From d3f7660a46453af38c255c01d58d14edf94f1ee2 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 19 Sep 2021 17:18:23 +0200 Subject: [PATCH 424/681] Use min/max water height defines in mapgen --- src/openrct2-ui/windows/MapGen.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 7c18c563f7..dce4f7304b 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -45,7 +45,6 @@ enum { WIDX_TAB_3, WIDX_TAB_4, - TAB_BEGIN, WIDX_MAP_GENERATE = TAB_BEGIN, @@ -822,7 +821,7 @@ static void window_mapgen_simplex_mouseup(rct_window* w, rct_widgetindex widgetI mapgenSettings.mapSize = _mapSize; mapgenSettings.height = _baseHeight; - mapgenSettings.water_level = _waterLevel + 2; + mapgenSettings.water_level = _waterLevel + MINIMUM_WATER_HEIGHT; mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; mapgenSettings.trees = _placeTrees; @@ -883,11 +882,11 @@ static void window_mapgen_simplex_mousedown(rct_window* w, rct_widgetindex widge w->Invalidate(); break; case WIDX_SIMPLEX_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + 2, 54); + _waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT); w->Invalidate(); break; case WIDX_SIMPLEX_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - 2, 0); + _waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0); w->Invalidate(); break; case WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX: @@ -1116,11 +1115,11 @@ static void window_mapgen_heightmap_mousedown(rct_window* w, rct_widgetindex wid widget_invalidate(w, WIDX_HEIGHTMAP_HIGH); break; case WIDX_HEIGHTMAP_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + 2, 54); + _waterLevel = std::min(_waterLevel + MINIMUM_WATER_HEIGHT, MINIMUM_WATER_HEIGHT + MAXIMUM_WATER_HEIGHT); widget_invalidate(w, WIDX_HEIGHTMAP_WATER_LEVEL); break; case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - 2, 0); + _waterLevel = std::max(_waterLevel - MINIMUM_WATER_HEIGHT, 0); widget_invalidate(w, WIDX_HEIGHTMAP_WATER_LEVEL); break; } From 3eaf1d4300abcb00e7ee2b1a61872d845600ecef Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 19 Sep 2021 20:21:24 +0200 Subject: [PATCH 425/681] Add 'new save format' as option for issue area --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 3d1071dee6..ac81d2325d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -36,6 +36,7 @@ body: description: What things had an issue? Check all that apply. multiple: true options: + - New Save Format (NSF) - The bug also exists in RCT2 (vanilla) - This bug is specific to multiplayer - Building the game From a37c8539e7dc7976f51df51fe402bd89cfe71d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 19 Sep 2021 22:38:25 +0200 Subject: [PATCH 426/681] Fix bounds check in Litter::GetName --- src/openrct2/world/Litter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index f2fa1d8108..91f721e620 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -121,7 +121,7 @@ static const rct_string_id litterNames[12] = { rct_string_id Litter::GetName() const { - if (EnumValue(SubType) >= sizeof(litterNames)) + if (EnumValue(SubType) >= std::size(litterNames)) return STR_NONE; return litterNames[EnumValue(SubType)]; } From fddf009afcd6c3e84bc8358e2fdcafb50c2dd4c3 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 21 Sep 2021 04:08:19 +0000 Subject: [PATCH 427/681] Merge Localisation/master into OpenRCT2/develop --- data/language/nl-NL.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 1b022c114a..52f2d18e6a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -3649,7 +3649,12 @@ STR_6449 :{WINDOW_COLOUR_2}Tracks: STR_6450 :{BLACK}“{STRING}” STR_6451 :{BLACK}“{STRING}” - {STRING} STR_6452 :{WINDOW_COLOUR_2}Verkoopt: {BLACK}{STRING} -STR_6453 :Versie-informatie kopiëren +STR_6453 :Versie-informatie kopiëren +STR_6454 :Kan de tekst van de lichtkrant niet veranderen… +STR_6455 :Kan de tekst van dit bord niet veranderen… +STR_6456 :Reuzenscreenshot +STR_6457 :Bug rapporteren op GitHub +STR_6458 :Volgen in het hoofdvenster ############# # Scenarios # From c56810e6a51971b84f60dc4b4a27e15a95f047f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 21 Sep 2021 01:34:58 -0700 Subject: [PATCH 428/681] Fix #15442: Use after free in object manager --- src/openrct2/Editor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index d72df4dd1c..37ec3865ee 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -63,15 +63,18 @@ namespace Editor static void object_list_load() { + auto* context = GetContext(); + + // Unload objects first, the repository is re-populated which owns the objects. + auto& objectManager = context->GetObjectManager(); + objectManager.UnloadAll(); + // Scan objects if necessary - auto context = GetContext(); const auto& localisationService = context->GetLocalisationService(); auto& objectRepository = context->GetObjectRepository(); objectRepository.LoadOrConstruct(localisationService.GetCurrentLanguage()); // Reset loaded objects to just defaults - auto& objectManager = context->GetObjectManager(); - objectManager.UnloadAll(); objectManager.LoadDefaultObjects(); } From 355019f97f7508b042ee00976c8c057ba7c8ecf1 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Tue, 14 Sep 2021 19:36:58 -0400 Subject: [PATCH 429/681] #15367: Encode RideType in TrackElement --- src/openrct2-ui/windows/RideConstruction.cpp | 1 + src/openrct2/actions/MazePlaceTrackAction.cpp | 1 + src/openrct2/actions/MazeSetTrackAction.cpp | 1 + src/openrct2/actions/TrackPlaceAction.cpp | 1 + src/openrct2/rct1/S4Importer.cpp | 1 + src/openrct2/rct2/S6Importer.cpp | 3 ++- src/openrct2/ride/Track.cpp | 12 ++++++++++++ src/openrct2/ride/TrackPaint.cpp | 4 +++- src/openrct2/world/TileElement.h | 7 ++++++- 9 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 6d252746dc..13ad0e23de 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2444,6 +2444,7 @@ static void sub_6CBCE2( _tempTrackTileElement.SetBaseZ(baseZ); _tempTrackTileElement.SetClearanceZ(clearanceZ); _tempTrackTileElement.AsTrack()->SetTrackType(trackType); + _tempTrackTileElement.AsTrack()->SetRideType(ride->type); _tempTrackTileElement.AsTrack()->SetSequenceIndex(trackBlock->index); _tempTrackTileElement.AsTrack()->SetHasCableLift(false); _tempTrackTileElement.AsTrack()->SetInverted((liftHillAndInvertedState & CONSTRUCTION_INVERTED_TRACK_SELECTED) != 0); diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index c62e469524..a2e01c3642 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -168,6 +168,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const trackElement->SetClearanceZ(clearanceHeight); trackElement->SetTrackType(TrackElemType::Maze); + trackElement->SetRideType(ride->type); trackElement->SetRideIndex(_rideIndex); trackElement->SetMazeEntry(_mazeEntry); trackElement->SetGhost(flags & GAME_COMMAND_FLAG_GHOST); diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 19e38f95d0..3605a425d7 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -183,6 +183,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const trackElement->SetClearanceZ(_loc.z + MAZE_CLEARANCE_HEIGHT); trackElement->SetTrackType(TrackElemType::Maze); + trackElement->SetRideType(ride->type); trackElement->SetRideIndex(_rideIndex); trackElement->SetMazeEntry(0xFFFF); trackElement->SetGhost(flags & GAME_COMMAND_FLAG_GHOST); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index f0fc1898cb..39b508c804 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -561,6 +561,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const trackElement->SetSequenceIndex(trackBlock->index); trackElement->SetRideIndex(_rideIndex); trackElement->SetTrackType(_trackType); + trackElement->SetRideType(ride->type); trackElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); switch (_trackType) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6916c69a81..a4a7e1cc1d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1631,6 +1631,7 @@ namespace RCT1 auto rideType = (ride != nullptr) ? ride->type : RIDE_TYPE_NULL; dst2->SetTrackType(RCT1TrackTypeToOpenRCT2(src2->GetTrackType(), rideType)); + dst2->SetRideType(rideType); dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); dst2->SetColourScheme(src2->GetColourScheme()); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5c7c7145a4..de66b3eede 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1198,7 +1198,8 @@ public: auto rideType = _s6.rides[src2->GetRideIndex()].type; track_type_t trackType = static_cast(src2->GetTrackType()); - dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, _s6.rides[src2->GetRideIndex()].type)); + dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, rideType)); + dst2->SetRideType(rideType); dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); dst2->SetColourScheme(src2->GetColourScheme()); diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index c7996973a1..cb90d20660 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -244,6 +244,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag targetTrackType = TrackElemType::MiddleStation; } stationElement->AsTrack()->SetTrackType(targetTrackType); + stationElement->AsTrack()->SetRideType(ride->type); map_invalidate_element(loc, stationElement); @@ -389,6 +390,7 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in } } stationElement->AsTrack()->SetTrackType(targetTrackType); + stationElement->AsTrack()->SetRideType(ride->type); map_invalidate_element(currentLoc, stationElement); } @@ -730,6 +732,16 @@ void TrackElement::SetTrackType(uint16_t newType) TrackType = newType; } +uint8_t TrackElement::GetRideType() const +{ + return RideType; +} + +void TrackElement::SetRideType(const uint8_t rideType) +{ + RideType = rideType; +} + uint8_t TrackElement::GetSequenceIndex() const { return Sequence; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index b2529b4da2..259a6e89d7 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2276,7 +2276,9 @@ void PaintTrack(paint_session* session, Direction direction, int32_t height, con { return; } - TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = ride->GetRideTypeDescriptor().TrackPaintFunction; + + const auto& rtd = GetRideTypeDescriptor(trackElement.GetRideType()); + TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = rtd.TrackPaintFunction; if (paintFunctionGetter != nullptr) { TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType); diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 68f289c8ce..ecea23c948 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -380,13 +380,18 @@ private: ride_id_t RideIndex; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t pad[2]; + // uint8_t pad[2]; + uint8_t RideType; + uint8_t pad; #pragma clang diagnostic pop public: track_type_t GetTrackType() const; void SetTrackType(track_type_t newEntryIndex); + uint8_t GetRideType() const; + void SetRideType(const uint8_t rideType); + uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); From f21b941b462219dc5db93faf170f5d1b81382b9a Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 19 Sep 2021 21:02:24 +0200 Subject: [PATCH 430/681] Introduce ride_type_t --- src/openrct2/ride/RideTypes.h | 2 ++ src/openrct2/ride/Track.cpp | 4 ++-- src/openrct2/world/TileElement.h | 11 +++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/openrct2/ride/RideTypes.h b/src/openrct2/ride/RideTypes.h index 7d8b11b344..b9747b58c8 100644 --- a/src/openrct2/ride/RideTypes.h +++ b/src/openrct2/ride/RideTypes.h @@ -20,6 +20,8 @@ struct Ride; constexpr const ride_id_t RIDE_ID_NULL = static_cast(std::numeric_limits>::max()); +using ride_type_t = uint16_t; + /** * Couples a ride type and subtype together. */ diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index cb90d20660..b4550ba438 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -732,12 +732,12 @@ void TrackElement::SetTrackType(uint16_t newType) TrackType = newType; } -uint8_t TrackElement::GetRideType() const +ride_type_t TrackElement::GetRideType() const { return RideType; } -void TrackElement::SetRideType(const uint8_t rideType) +void TrackElement::SetRideType(const ride_type_t rideType) { RideType = rideType; } diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index ecea23c948..893b3f06b5 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -378,19 +378,14 @@ private: }; uint8_t Flags2; ride_id_t RideIndex; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - // uint8_t pad[2]; - uint8_t RideType; - uint8_t pad; -#pragma clang diagnostic pop + ride_type_t RideType; public: track_type_t GetTrackType() const; void SetTrackType(track_type_t newEntryIndex); - uint8_t GetRideType() const; - void SetRideType(const uint8_t rideType); + ride_type_t GetRideType() const; + void SetRideType(const ride_type_t rideType); uint8_t GetSequenceIndex() const; void SetSequenceIndex(uint8_t newSequenceIndex); From 1e17304e766b285fae0880f332bd06f1b3e00135 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 19 Sep 2021 21:10:40 +0200 Subject: [PATCH 431/681] Show the appropriate ride type in the TI --- src/openrct2-ui/windows/TileInspector.cpp | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index a128f0d6c4..05df9f2b03 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1928,28 +1928,31 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) case TILE_ELEMENT_TYPE_TRACK: { - // Details - // Ride auto trackElement = tileElement->AsTrack(); ride_id_t rideId = trackElement->GetRideIndex(); auto ride = get_ride(rideId); - if (ride != nullptr) - { - auto ft = Formatter(); - ft.Add(ride->GetRideTypeDescriptor().Naming.Name); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { COLOUR_WHITE }); - } + + // Ride ID auto ft = Formatter(); - ft.Add(trackElement->GetRideIndex()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { COLOUR_WHITE }); + ft.Add(rideId); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { COLOUR_WHITE }); + + // Ride name if (ride != nullptr) { ft = Formatter(); ride->FormatNameTo(ft); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { COLOUR_WHITE }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { COLOUR_WHITE }); } + + // Ride type. Individual pieces may be of a different ride type from the ride it belongs to. + 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, { COLOUR_WHITE }); + // Track ft = Formatter(); ft.Add(trackElement->GetTrackType()); From 11607f525db1c7b9657b9764d413b5c31e552e34 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 19 Sep 2021 23:01:47 +0200 Subject: [PATCH 432/681] const auto& --- src/openrct2-ui/windows/TileInspector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 05df9f2b03..656940b942 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1947,7 +1947,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) } // Ride type. Individual pieces may be of a different ride type from the ride it belongs to. - auto rtd = GetRideTypeDescriptor(trackElement->GetRideType()); + const auto& rtd = GetRideTypeDescriptor(trackElement->GetRideType()); ft = Formatter(); ft.Add(rtd.Naming.Name); DrawTextBasic( From 8fb8b2a4c1dde92fd06ceaec63b0404c206d2bde Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 21 Sep 2021 10:50:38 +0200 Subject: [PATCH 433/681] Do not overwrite ride type when extending station --- src/openrct2/ride/Track.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index b4550ba438..33406d53bb 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -244,7 +244,6 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag targetTrackType = TrackElemType::MiddleStation; } stationElement->AsTrack()->SetTrackType(targetTrackType); - stationElement->AsTrack()->SetRideType(ride->type); map_invalidate_element(loc, stationElement); @@ -390,7 +389,6 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in } } stationElement->AsTrack()->SetTrackType(targetTrackType); - stationElement->AsTrack()->SetRideType(ride->type); map_invalidate_element(currentLoc, stationElement); } From a268350615182dbc3e6bcbf3e39a5f3cec03508f Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 21 Sep 2021 10:06:04 +0100 Subject: [PATCH 434/681] Fix #15439: Ride viewport is partially grey The ride viewport does not work the same as other viewports due to the selection of views that it has. After refactoring the focus system to use a more streamlined approach the ride viewport lost its invalidation on resizing. If the ride window was to use the same viewport update code as say the guest window then the viewport focus still ends up incorrect due to it no longer centring the focus. Therefore the best approach was to lose the focus on resize and force a recalculation of it. Also renamed Focus2 to Focus as Focus2 was meant to just be fill in whilst removing the original focus structs. --- src/openrct2-ui/interface/Window.cpp | 2 +- src/openrct2-ui/scripting/CustomWindow.cpp | 3 +- src/openrct2-ui/windows/Banner.cpp | 3 +- src/openrct2-ui/windows/EditorMain.cpp | 3 +- src/openrct2-ui/windows/Guest.cpp | 4 +-- src/openrct2-ui/windows/Main.cpp | 3 +- src/openrct2-ui/windows/Park.cpp | 6 ++-- src/openrct2-ui/windows/Player.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 16 +++++----- src/openrct2-ui/windows/Sign.cpp | 6 ++-- src/openrct2-ui/windows/Staff.cpp | 8 ++--- .../windows/TitleCommandEditor.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 3 +- src/openrct2/interface/Viewport.cpp | 30 +++++++++---------- src/openrct2/interface/Viewport.h | 2 +- src/openrct2/interface/Window.h | 8 ++--- src/openrct2/interface/Window_internal.cpp | 4 +-- src/openrct2/interface/Window_internal.h | 2 +- 18 files changed, 51 insertions(+), 56 deletions(-) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 14aee560f7..7ffc99deb4 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -274,7 +274,7 @@ rct_window* WindowCreate( w->min_height = height; w->max_height = height; - w->focus2 = std::nullopt; + w->focus = std::nullopt; w->page = 0; w->var_48C = 0; w->var_492 = 0; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 4e01689373..874427ef14 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -786,8 +786,7 @@ namespace OpenRCT2::Ui::Windows auto wheight = viewportWidget->height() - 1; if (viewport == nullptr) { - const auto focus = Focus2(CoordsXYZ(0, 0, 0)); - viewport_create(this, { left, top }, wwidth, wheight, focus); + viewport_create(this, { left, top }, wwidth, wheight, Focus(CoordsXYZ(0, 0, 0))); flags |= WF_NO_SCROLLING; Invalidate(); } diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 3959bc29de..534f908b7e 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -79,10 +79,9 @@ private: void CreateViewport() { rct_widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT]; - const auto focus = Focus2(_bannerViewPos); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, focus); + (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, Focus(_bannerViewPos)); if (viewport != nullptr) viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index 121b8e4ac3..d0186f17db 100644 --- a/src/openrct2-ui/windows/EditorMain.cpp +++ b/src/openrct2-ui/windows/EditorMain.cpp @@ -40,8 +40,7 @@ rct_window* window_editor_main_open() &window_editor_main_events, WC_MAIN_WINDOW, WF_STICK_TO_BACK); window->widgets = window_editor_main_widgets; - const auto focus = Focus2(CoordsXYZ(0x0FFF, 0x0FFF, 0)); - viewport_create(window, window->windowPos, window->width, window->height, focus); + viewport_create(window, window->windowPos, window->width, window->height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); window->viewport->flags |= 0x0400; gCurrentRotation = 0; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index d96bcf206d..db53bce639 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -732,7 +732,7 @@ void window_guest_viewport_init(rct_window* w) uint16_t origViewportFlags{}; if (w->viewport != nullptr) { - if (w->focus2.has_value()) + if (w->focus.has_value()) return; origViewportFlags = w->viewport->flags; @@ -750,7 +750,7 @@ void window_guest_viewport_init(rct_window* w) int32_t width = view_widget->width() - 1; int32_t height = view_widget->height() - 1; - viewport_create(w, screenPos, width, height, w->focus2.value()); + viewport_create(w, screenPos, width, height, w->focus.value()); if (w->viewport != nullptr && reCreateViewport) { w->viewport->flags = origViewportFlags; diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 347f2cc49f..ed7bab0503 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -41,8 +41,7 @@ rct_window* window_main_open() WF_STICK_TO_BACK); window->widgets = window_main_widgets; - const auto focus = Focus2(CoordsXYZ(0x0FFF, 0x0FFF, 0)); - viewport_create(window, window->windowPos, window->width, window->height, focus); + viewport_create(window, window->windowPos, window->width, window->height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); window->viewport->flags |= VIEWPORT_FLAG_SOUND_ON; gCurrentRotation = 0; gShowGridLinesRefCount = 0; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 6b477ad3b4..9f3bf92f0d 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -740,11 +740,11 @@ static void window_park_init_viewport(rct_window* w) if (w->page != WINDOW_PARK_PAGE_ENTRANCE) return; - std::optional focus = std::nullopt; + std::optional focus = std::nullopt; if (!gParkEntrances.empty()) { const auto& entrance = gParkEntrances[0]; - focus = Focus2(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 }); + focus = Focus(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 }); } if (w->viewport == nullptr) @@ -760,7 +760,7 @@ static void window_park_init_viewport(rct_window* w) // Call invalidate event window_event_invalidate_call(w); - w->focus2 = focus; + w->focus = focus; if (focus.has_value()) { diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index fab5a3df40..9a6c6352de 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -547,7 +547,7 @@ static void window_player_set_page(rct_window* w, int32_t page) { if (w->viewport == nullptr) { - const auto focus = Focus2(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); + const auto focus = Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); viewport_create(w, w->windowPos, w->width, w->height, focus); w->flags |= WF_NO_SCROLLING; window_event_invalidate_call(w); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index ec0286cbb8..1f2d68054b 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1589,7 +1589,7 @@ static void window_ride_init_viewport(rct_window* w) int32_t viewSelectionIndex = w->ride.view - 1; - std::optional focus; + std::optional focus; if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->num_vehicles && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { @@ -1609,7 +1609,7 @@ static void window_ride_init_viewport(rct_window* w) } if (vehId != SPRITE_INDEX_NULL) { - focus = Focus2(vehId); + focus = Focus(vehId); } } else if (viewSelectionIndex >= ride->num_vehicles && viewSelectionIndex < (ride->num_vehicles + ride->num_stations)) @@ -1618,7 +1618,7 @@ static void window_ride_init_viewport(rct_window* w) if (stationIndex) { const auto location = ride->stations[*stationIndex].GetStart(); - focus = Focus2(location); + focus = Focus(location); } } else @@ -1630,14 +1630,14 @@ static void window_ride_init_viewport(rct_window* w) if (w->number < ride_overall_views.size()) { const auto& view = ride_overall_views[w->number]; - focus = Focus2(view.loc, view.zoom); + focus = Focus(view.loc, view.zoom); } } uint16_t viewport_flags = 0; if (w->viewport != nullptr) { - if (focus == w->focus2) + if (focus == w->focus) { return; } @@ -1651,7 +1651,7 @@ static void window_ride_init_viewport(rct_window* w) window_event_invalidate_call(w); - w->focus2 = focus; + w->focus = focus; // rct2: 0x006aec9c only used here so brought it into the function if (!w->viewport && !ride->overall_view.IsNull()) @@ -1662,7 +1662,7 @@ static void window_ride_init_viewport(rct_window* w) int32_t width = view_widget->width() - 1; int32_t height = view_widget->height() - 1; - viewport_create(w, screenPos, width, height, w->focus2.value()); + viewport_create(w, screenPos, width, height, w->focus.value()); w->flags |= WF_NO_SCROLLING; w->Invalidate(); @@ -1796,6 +1796,8 @@ static void window_ride_main_resize(rct_window* w) w->flags |= WF_RESIZABLE; window_set_resize(w, 316, minHeight, 500, 450); + // Unlike with other windows, the focus needs to be recentred so it’s best to just reset it. + w->focus = std::nullopt; window_ride_init_viewport(w); } diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index bddfd0dd20..b111f95c9b 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -127,10 +127,9 @@ public: // Create viewport rct_widget& viewportWidget = window_sign_widgets[WIDX_VIEWPORT]; - const auto focus = Focus2(CoordsXYZ{ signViewPosition, viewZ }); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, - viewportWidget.height() - 1, focus); + viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); @@ -300,10 +299,9 @@ public: // Create viewport rct_widget* viewportWidget = &window_sign_widgets[WIDX_VIEWPORT]; - const auto focus = Focus2(CoordsXYZ{ signViewPos }); viewport_create( this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, - viewportWidget->height() - 1, focus); + viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); if (viewport != nullptr) viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 2a691c0fab..727e755429 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1346,7 +1346,7 @@ void window_staff_viewport_init(rct_window* w) if (w->page != WINDOW_STAFF_OVERVIEW) return; - std::optional focus; + std::optional focus; const auto peep = GetStaff(w); if (peep == nullptr) @@ -1356,14 +1356,14 @@ void window_staff_viewport_init(rct_window* w) if (peep->State != PeepState::Picked) { - focus = Focus2(peep->sprite_index); + focus = Focus(peep->sprite_index); } uint16_t viewport_flags; if (w->viewport) { - if (focus == w->focus2) + if (focus == w->focus) return; viewport_flags = w->viewport->flags; @@ -1378,7 +1378,7 @@ void window_staff_viewport_init(rct_window* w) window_event_invalidate_call(w); - w->focus2 = focus; + w->focus = focus; if (peep->State != PeepState::Picked) { diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index 4b15b97904..b02e3fc1a3 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -227,7 +227,7 @@ void window_title_command_editor_open(TitleSequence* sequence, int32_t index, bo WindowInitScrollWidgets(window); rct_widget* const viewportWidget = &window_title_command_editor_widgets[WIDX_VIEWPORT]; - const auto focus = Focus2(CoordsXYZ{ 0, 0, 0 }); + const auto focus = Focus(CoordsXYZ{ 0, 0, 0 }); viewport_create( window, window->windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, viewportWidget->height() - 1, focus); diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index abcd712170..66ee0f3a33 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -76,8 +76,7 @@ public: enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_ZOOM_IN) | (1ULL << WIDX_ZOOM_OUT) | (1ULL << WIDX_LOCATE); // Create viewport - const auto focus = Focus2(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); - viewport_create(this, windowPos, width, height, focus); + viewport_create(this, windowPos, width, height, Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ())); if (viewport == nullptr) { Close(); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 65e093703f..28cab048bd 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -117,14 +117,14 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi return { screenCoord }; } -CoordsXYZ Focus2::GetPos() const +CoordsXYZ Focus::GetPos() const { return std::visit( [](auto&& arg) { using T = std::decay_t; - if constexpr (std::is_same_v) + if constexpr (std::is_same_v) return arg; - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { auto* centreEntity = GetEntity(arg); if (centreEntity != nullptr) @@ -158,7 +158,7 @@ CoordsXYZ Focus2::GetPos() const * flags: edx top most 2 bits 0b_X1 for zoom clear see below for 2nd bit. * w: esi */ -void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus2& focus) +void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus) { rct_viewport* viewport = nullptr; if (_viewports.size() >= MAX_VIEWPORT_COUNT) @@ -188,9 +188,9 @@ void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t w->viewport_target_sprite = std::visit( [](auto&& arg) { using T = std::decay_t; - if constexpr (std::is_same_v) + if constexpr (std::is_same_v) return SPRITE_INDEX_NULL; - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return arg; }, focus.data); @@ -702,7 +702,7 @@ void viewport_update_smart_sprite_follow(rct_window* window) break; default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. - window->focus2 = Focus2(window->viewport_smart_follow_sprite); + window->focus = Focus(window->viewport_smart_follow_sprite); window->viewport_target_sprite = window->viewport_smart_follow_sprite; break; } @@ -710,14 +710,14 @@ void viewport_update_smart_sprite_follow(rct_window* window) void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) { - Focus2 focus = Focus2(peep->sprite_index); + Focus focus = Focus(peep->sprite_index); window->viewport_target_sprite = peep->sprite_index; if (peep->State == PeepState::Picked) { window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; - window->focus2 = std::nullopt; // No focus + window->focus = std::nullopt; // No focus return; } @@ -734,7 +734,7 @@ void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) const auto car = train->GetCar(peep->CurrentCar); if (car != nullptr) { - focus = Focus2(car->sprite_index); + focus = Focus(car->sprite_index); overallFocus = false; window->viewport_target_sprite = car->sprite_index; } @@ -752,12 +752,12 @@ void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) coordFocus.x = xy.x; coordFocus.y = xy.y; coordFocus.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); - focus = Focus2(coordFocus); + focus = Focus(coordFocus); window->viewport_target_sprite = SPRITE_INDEX_NULL; } } - window->focus2 = focus; + window->focus = focus; } void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep) @@ -766,17 +766,17 @@ void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep) { window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; window->viewport_target_sprite = SPRITE_INDEX_NULL; - window->focus2 = std::nullopt; + window->focus = std::nullopt; return; } - window->focus2 = Focus2(window->viewport_smart_follow_sprite); + window->focus = Focus(window->viewport_smart_follow_sprite); window->viewport_target_sprite = window->viewport_smart_follow_sprite; } void viewport_update_smart_vehicle_follow(rct_window* window) { - window->focus2 = Focus2(window->viewport_smart_follow_sprite); + window->focus = Focus(window->viewport_smart_follow_sprite); window->viewport_target_sprite = window->viewport_smart_follow_sprite; } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index d9b22283ac..697eb65510 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -104,7 +104,7 @@ extern uint8_t gCurrentRotation; void viewport_init_all(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_viewport* viewport); -void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus2& focus); +void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); void viewport_remove(rct_viewport* viewport); void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t maxZoom = -1); void viewport_update_position(rct_window* window); diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 929a0b9141..f6fbbba70c 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -195,7 +195,7 @@ struct rct_scroll constexpr auto WINDOW_SCROLL_UNDEFINED = std::numeric_limits::max(); -struct Focus2 +struct Focus { using CoordinateFocus = CoordsXYZ; using EntityFocus = uint16_t; @@ -203,7 +203,7 @@ struct Focus2 uint8_t zoom = 0; std::variant data; - template constexpr explicit Focus2(T newValue, uint8_t newZoom = 0) + template constexpr explicit Focus(T newValue, uint8_t newZoom = 0) { data = newValue; zoom = newZoom; @@ -211,7 +211,7 @@ struct Focus2 CoordsXYZ GetPos() const; - constexpr bool operator==(const Focus2& other) const + constexpr bool operator==(const Focus& other) const { if (zoom != other.zoom) { @@ -219,7 +219,7 @@ struct Focus2 } return data == other.data; } - constexpr bool operator!=(const Focus2& other) const + constexpr bool operator!=(const Focus& other) const { return !(*this == other); } diff --git a/src/openrct2/interface/Window_internal.cpp b/src/openrct2/interface/Window_internal.cpp index 576212edc7..35aaa071db 100644 --- a/src/openrct2/interface/Window_internal.cpp +++ b/src/openrct2/interface/Window_internal.cpp @@ -12,10 +12,10 @@ void rct_window::SetLocation(const CoordsXYZ& coords) void rct_window::ScrollToViewport() { - if (viewport == nullptr || !focus2.has_value()) + if (viewport == nullptr || !focus.has_value()) return; - CoordsXYZ newCoords = focus2.value().GetPos(); + CoordsXYZ newCoords = focus.value().GetPos(); auto mainWindow = window_get_main(); if (mainWindow != nullptr) diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index b699aa0b06..56dab05199 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -55,7 +55,7 @@ struct rct_window uint32_t list_item_positions[1024]{}; uint16_t no_list_items{}; // 0 for no items int16_t selected_list_item{}; // -1 for none selected - std::optional focus2; + std::optional focus; union { campaign_variables campaign; From 9060a0d2286499df4af8d481885dbfd3a3cbd5d8 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Tue, 21 Sep 2021 23:34:33 +0200 Subject: [PATCH 435/681] Add missing headers to VS project file (#15457) --- src/openrct2/libopenrct2.vcxproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 7010f9cf3e..128fabe6d8 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -310,12 +310,15 @@ + + + @@ -332,6 +335,7 @@ + @@ -356,6 +360,7 @@ + @@ -396,7 +401,9 @@ + + From 74e8988dd8a8067218e89af851a65e801a0b1427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 18 Sep 2021 01:46:42 +0300 Subject: [PATCH 436/681] Remove scenario ticks and adjust export/import Co-authored-by: Ted John --- src/openrct2-ui/windows/Guest.cpp | 4 +- src/openrct2-ui/windows/GuestList.cpp | 4 +- src/openrct2/Context.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/drawing/Weather.cpp | 45 ++++++++++--------- .../localisation/Localisation.Date.cpp | 1 - src/openrct2/management/Research.cpp | 2 +- src/openrct2/peep/Guest.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 18 ++++++-- src/openrct2/ride/Ride.cpp | 8 ++-- src/openrct2/ride/TrackPaint.cpp | 3 +- src/openrct2/ride/water/RiverRapids.cpp | 6 +-- src/openrct2/scenario/Scenario.cpp | 1 - src/openrct2/scenario/Scenario.h | 1 - src/openrct2/world/Litter.cpp | 3 +- src/openrct2/world/Park.cpp | 2 +- 18 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 3d0d2565a9..ff288b5a4d 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1426,7 +1426,7 @@ void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) int32_t guestEntryTime = peep->GetParkEntryTime(); if (guestEntryTime != -1) { - int32_t timeInPark = (gScenarioTicks - guestEntryTime) >> 11; + int32_t timeInPark = (gCurrentTicks - guestEntryTime) >> 11; auto ft = Formatter(); ft.Add(timeInPark & 0xFFFF); DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); @@ -1496,7 +1496,7 @@ void window_guest_rides_update(rct_window* w) } // Every 2048 ticks do a full window_invalidate - int32_t number_of_ticks = gScenarioTicks - guest->GetParkEntryTime(); + int32_t number_of_ticks = gCurrentTicks - guest->GetParkEntryTime(); if (!(number_of_ticks & 0x7FF)) w->Invalidate(); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index cc3b1254c9..a276b5fad3 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -807,7 +807,7 @@ private: bool IsRefreshOfGroupsRequired() { - uint32_t tick256 = floor2(gScenarioTicks, 256); + uint32_t tick256 = floor2(gCurrentTicks, 256); if (_selectedView == _lastFindGroupsSelectedView) { if (_lastFindGroupsWait != 0 || _lastFindGroupsTick == tick256) @@ -834,7 +834,7 @@ private: void RefreshGroups() { - _lastFindGroupsTick = floor2(gScenarioTicks, 256); + _lastFindGroupsTick = floor2(gCurrentTicks, 256); _lastFindGroupsSelectedView = _selectedView; _lastFindGroupsWait = 320; _groups.clear(); diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index b0db04d1f8..6f8cbfb6df 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -495,7 +495,7 @@ namespace OpenRCT2 #endif } - gScenarioTicks = 0; + gCurrentTicks = 0; input_reset_place_obj_modifier(); viewport_init_all(); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index def2b810aa..043f46dd1e 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -56,6 +56,7 @@ GameState::GameState() void GameState::InitAll(int32_t mapSize) { gInMapInitCode = true; + gCurrentTicks = 0; map_init(mapSize); _park->Initialise(); @@ -367,7 +368,6 @@ void GameState::UpdateLogic(LogicTimings* timings) report_time(LogicTimePart::NetworkFlush); gCurrentTicks++; - gScenarioTicks++; gSavedAge++; #ifdef ENABLE_SCRIPTING diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index 35eb7e0cff..c8fdb13670 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -9,6 +9,7 @@ #include "Weather.h" +#include "../Game.h" #include "../config/Config.h" #include "../interface/Viewport.h" #include "../ride/TrackDesign.h" @@ -77,15 +78,15 @@ void DrawWeather(rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer) */ static void DrawLightRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { - int32_t x_start = -static_cast(gScenarioTicks) + 8; - int32_t y_start = (gScenarioTicks * 3) + 7; + int32_t x_start = -static_cast(gCurrentTicks) + 8; + int32_t y_start = (gCurrentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); - x_start = -static_cast(gScenarioTicks) + 0x18; - y_start = (gScenarioTicks * 4) + 0x0D; + x_start = -static_cast(gCurrentTicks) + 0x18; + y_start = (gCurrentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; @@ -98,29 +99,29 @@ static void DrawLightRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t t */ static void DrawHeavyRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { - int32_t x_start = -static_cast(gScenarioTicks); - int32_t y_start = gScenarioTicks * 5; + int32_t x_start = -static_cast(gCurrentTicks); + int32_t y_start = gCurrentTicks * 5; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); - x_start = -static_cast(gScenarioTicks) + 0x10; - y_start = (gScenarioTicks * 6) + 5; + x_start = -static_cast(gCurrentTicks) + 0x10; + y_start = (gCurrentTicks * 6) + 5; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); - x_start = -static_cast(gScenarioTicks) + 8; - y_start = (gScenarioTicks * 3) + 7; + x_start = -static_cast(gCurrentTicks) + 8; + y_start = (gCurrentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); - x_start = -static_cast(gScenarioTicks) + 0x18; - y_start = (gScenarioTicks * 4) + 0x0D; + x_start = -static_cast(gCurrentTicks) + 0x18; + y_start = (gCurrentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; @@ -129,9 +130,9 @@ static void DrawHeavyRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t t static void DrawLightSnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { - const uint32_t t = gScenarioTicks / 2; + const uint32_t t = gCurrentTicks / 2; const int32_t negT = -static_cast(t); - const double cosTick = static_cast(gScenarioTicks) * 0.05; + const double cosTick = static_cast(gCurrentTicks) * 0.05; int32_t x_start = negT + 1 + (cos(1.0 + cosTick) * 6); int32_t y_start = t + 1; @@ -150,29 +151,29 @@ static void DrawLightSnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t t static void DrawHeavySnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { - int32_t x_start = -static_cast(gScenarioTicks * 3) + 1; - int32_t y_start = gScenarioTicks + 23; + int32_t x_start = -static_cast(gCurrentTicks * 3) + 1; + int32_t y_start = gCurrentTicks + 23; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); - x_start = -static_cast(gScenarioTicks * 4) + 6; - y_start = gScenarioTicks + 5; + x_start = -static_cast(gCurrentTicks * 4) + 6; + y_start = gCurrentTicks + 5; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); - x_start = -static_cast(gScenarioTicks * 2) + 11; - y_start = gScenarioTicks + 18; + x_start = -static_cast(gCurrentTicks * 2) + 11; + y_start = gCurrentTicks + 18; y_start = -y_start; x_start += left; y_start += top; weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); - x_start = -static_cast(gScenarioTicks * 3) + 17; - y_start = gScenarioTicks + 11; + x_start = -static_cast(gCurrentTicks * 3) + 17; + y_start = gCurrentTicks + 11; y_start = -y_start; x_start += left; y_start += top; diff --git a/src/openrct2/localisation/Localisation.Date.cpp b/src/openrct2/localisation/Localisation.Date.cpp index 7d7dd6f7ec..ce4330600b 100644 --- a/src/openrct2/localisation/Localisation.Date.cpp +++ b/src/openrct2/localisation/Localisation.Date.cpp @@ -61,7 +61,6 @@ void date_reset() { gDateMonthsElapsed = 0; gDateMonthTicks = 0; - gCurrentTicks = 0; gCurrentRealTimeTicks = 0; } diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 45e60590c8..456667b110 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -315,7 +315,7 @@ void research_update() return; } - if (gScenarioTicks % 32 != 0) + if (gCurrentTicks % 32 != 0) { return; } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 170734532d..9895036e18 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -989,7 +989,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (State == PeepState::Walking && !OutsideOfPark && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && GuestNumRides == 0 && GuestHeadingToRideId == RIDE_ID_NULL) { - uint32_t time_duration = gScenarioTicks - ParkEntryTime; + uint32_t time_duration = gCurrentTicks - ParkEntryTime; time_duration /= 2048; if (time_duration >= 5) @@ -5583,7 +5583,7 @@ void Guest::UpdateEnteringPark() SetState(PeepState::Falling); OutsideOfPark = false; - ParkEntryTime = gScenarioTicks; + ParkEntryTime = gCurrentTicks; increment_guests_in_park(); decrement_guests_heading_for_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fc2186e46b..f505ccc928 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2091,7 +2091,7 @@ namespace RCT1 void ImportParkFlags() { // Date and srand - gScenarioTicks = _s4.ticks; + gCurrentTicks = _s4.ticks; scenario_rand_seed(_s4.random_a, _s4.random_b); gDateMonthsElapsed = static_cast(_s4.month); gDateMonthTicks = _s4.day; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 5fea5c0f05..809157c82f 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -316,7 +316,7 @@ void S6Exporter::Export() _s6.elapsed_months = static_cast(gDateMonthsElapsed); _s6.current_day = gDateMonthTicks; - _s6.scenario_ticks = gScenarioTicks; + _s6.scenario_ticks = gCurrentTicks; auto state = scenario_rand_state(); _s6.scenario_srand_0 = state.s0; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 2c29d1a939..55870d20fb 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -225,7 +225,7 @@ public: gDateMonthsElapsed = static_cast(_s6.elapsed_months); gDateMonthTicks = _s6.current_day; - gScenarioTicks = _s6.scenario_ticks; + gCurrentTicks = _s6.game_ticks_1; scenario_rand_seed(_s6.scenario_srand_0, _s6.scenario_srand_1); @@ -401,7 +401,6 @@ public: String::Set(gScenarioFileName, sizeof(gScenarioFileName), _s6.scenario_filename); } std::memcpy(gScenarioExpansionPacks, _s6.saved_expansion_pack_names, sizeof(_s6.saved_expansion_pack_names)); - gCurrentTicks = _s6.game_ticks_1; gCurrentRealTimeTicks = 0; ImportRides(); @@ -480,6 +479,7 @@ public: research_determine_first_of_type(); } + void FixLandOwnership() const { if (String::Equals(_s6.scenario_filename, "Europe - European Cultural Festival.SC6")) @@ -1727,6 +1727,15 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->IsCrashedVehicle = src->flags & RCT12_SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE; } +static uint32_t AdjustScenarioToCurrentTicks(const rct_s6_data& s6, uint32_t tick) +{ + // Previously gScenarioTicks was used as a time point, now it's gCurrentTicks. + // gCurrentTicks and gScenarioTicks are now exported as the same, older saves that have a different + // scenario tick must account for the difference between the two. + uint32_t ticksElapsed = s6.scenario_ticks - tick; + return s6.game_ticks_1 - ticksElapsed; +} + template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) { auto dst = CreateEntityAt(baseSrc.sprite_index); @@ -1759,7 +1768,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) dst->TimeInQueue = src->time_in_queue; dst->CashInPocket = src->cash_in_pocket; dst->CashSpent = src->cash_spent; - dst->ParkEntryTime = src->park_entry_time; + dst->ParkEntryTime = AdjustScenarioToCurrentTicks(_s6, src->park_entry_time); dst->RejoinQueueTimeout = src->rejoin_queue_timeout; dst->PreviousRide = RCT12RideIdToOpenRCT2RideId(src->previous_ride); dst->PreviousRideTimeOut = src->previous_ride_time_out; @@ -1809,6 +1818,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) dst->AssignedStaffType = StaffType(src->staff_type); dst->MechanicTimeSinceCall = src->mechanic_time_since_call; + dst->HireDate = src->park_entry_time; dst->StaffId = src->staff_id; dst->StaffOrders = src->staff_orders; @@ -1927,7 +1937,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); dst->SubType = Litter::Type(src->type); - dst->creationTick = src->creationTick; + dst->creationTick = AdjustScenarioToCurrentTicks(_s6, src->creationTick); } void S6Importer::ImportEntity(const RCT12SpriteBase& src) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9aea952e77..bd8ed63a82 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1885,7 +1885,7 @@ static void ride_measurement_update(Ride& ride, RideMeasurement& measurement) gForces.VerticalG = std::clamp(gForces.VerticalG / 8, -127, 127); gForces.LateralG = std::clamp(gForces.LateralG / 8, -127, 127); - if (gScenarioTicks & 1) + if (gCurrentTicks & 1) { gForces.VerticalG = (gForces.VerticalG + measurement.vertical[measurement.current_item]) / 2; gForces.LateralG = (gForces.LateralG + measurement.lateral[measurement.current_item]) / 2; @@ -1898,7 +1898,7 @@ static void ride_measurement_update(Ride& ride, RideMeasurement& measurement) auto velocity = std::min(std::abs((vehicle->velocity * 5) >> 16), 255); auto altitude = std::min(vehicle->z / 8, 255); - if (gScenarioTicks & 1) + if (gCurrentTicks & 1) { velocity = (velocity + measurement.velocity[measurement.current_item]) / 2; altitude = (altitude + measurement.altitude[measurement.current_item]) / 2; @@ -1907,7 +1907,7 @@ static void ride_measurement_update(Ride& ride, RideMeasurement& measurement) measurement.velocity[measurement.current_item] = velocity & 0xFF; measurement.altitude[measurement.current_item] = altitude & 0xFF; - if (gScenarioTicks & 1) + if (gCurrentTicks & 1) { measurement.current_item++; measurement.num_items = std::max(measurement.num_items, measurement.current_item); @@ -2010,7 +2010,7 @@ std::pair Ride::GetMeasurement() assert(measurement != nullptr); } - measurement->last_use_tick = gScenarioTicks; + measurement->last_use_tick = gCurrentTicks; if (measurement->flags & 1) { return { measurement.get(), { STR_EMPTY, {} } }; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index b2529b4da2..39645719be 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -9,6 +9,7 @@ #include "TrackPaint.h" +#include "../Game.h" #include "../config/Config.h" #include "../drawing/Drawing.h" #include "../drawing/LightFX.h" @@ -2048,7 +2049,7 @@ void track_paint_util_left_quarter_turn_1_tile_tunnel( void track_paint_util_spinning_tunnel_paint(paint_session* session, int8_t thickness, int16_t height, Direction direction) { - int32_t frame = gScenarioTicks >> 2 & 3; + int32_t frame = gCurrentTicks >> 2 & 3; uint32_t colourFlags = session->TrackColours[SCHEME_SUPPORTS]; uint32_t colourFlags2 = session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index 5564e9ba5c..7ca899d9e9 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -676,7 +676,7 @@ static void paint_river_rapids_track_waterfall( { uint32_t imageId; - uint16_t frameNum = (gScenarioTicks / 2) & 7; + uint16_t frameNum = (gCurrentTicks / 2) & 7; if (direction & 1) { @@ -739,7 +739,7 @@ static void paint_river_rapids_track_rapids( { uint32_t imageId; - uint16_t frameNum = (gScenarioTicks / 2) & 7; + uint16_t frameNum = (gCurrentTicks / 2) & 7; if (direction & 1) { @@ -790,7 +790,7 @@ static void paint_river_rapids_track_whirlpool( { uint32_t imageId; - uint8_t frameNum = (gScenarioTicks / 4) % 16; + uint8_t frameNum = (gCurrentTicks / 4) % 16; if (direction & 1) { diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 9586f1fd2c..4228cae01a 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -68,7 +68,6 @@ bool gFirstTimeSaving = true; uint16_t gSavedAge; uint32_t gLastAutoSaveUpdate = 0; -uint32_t gScenarioTicks; random_engine_t gScenarioRand; Objective gScenarioObjective; diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 3d63931f9b..50f3b43af2 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -149,7 +149,6 @@ static constexpr money64 COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x8000000000000001; extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; -extern uint32_t gScenarioTicks; extern random_engine_t gScenarioRand; extern Objective gScenarioObjective; diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index f2fa1d8108..5c6bc92e94 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -1,6 +1,7 @@ #include "Litter.h" #include "../Cheats.h" +#include "../Game.h" #include "../localisation/StringIds.h" #include "../scenario/Scenario.h" #include "EntityList.h" @@ -77,7 +78,7 @@ void Litter::Create(const CoordsXYZD& litterPos, Type type) litter->sprite_height_positive = 3; litter->SubType = type; litter->MoveTo(offsetLitterPos); - litter->creationTick = gScenarioTicks; + litter->creationTick = gCurrentTicks; } /** diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index d9314bfe0a..22e1301ad3 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -468,7 +468,7 @@ int32_t Park::CalculateParkRating() const for (auto litter : EntityList()) { // Ignore recently dropped litter - if (litter->creationTick - gScenarioTicks >= 7680) + if (litter->creationTick - gCurrentTicks >= 7680) { litterCount++; } From c61f141cdc2f775b23bbca4d5497fbf4e52ac812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 18 Sep 2021 02:07:18 +0300 Subject: [PATCH 437/681] Bump up network version --- 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 581b125e5f..b89197f939 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -37,7 +37,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "9" +#define NETWORK_STREAM_VERSION "10" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 7302cb806a8faddc98b3beaa2c220b0355db3a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 18 Sep 2021 02:58:27 +0300 Subject: [PATCH 438/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a8d3eaba0..12ed42f22d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.52") +set(REPLAYS_VERSION "0.0.53") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "3A1A6B5B25ACA3B8AADC618A9D2BE44F8A23A7BB") +set(REPLAYS_SHA1 "8DDA5F2CC0B101D477396A3B016FF5F3EDFD074F") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index b0641bfc8c..8e90ba9d3b 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.52/replays.zip - 3A1A6B5B25ACA3B8AADC618A9D2BE44F8A23A7BB + https://github.com/OpenRCT2/replays/releases/download/v0.0.53/replays.zip + 8DDA5F2CC0B101D477396A3B016FF5F3EDFD074F From 53c22c9b4bae8b8ed907271dbbe3944f9a8d4d7e Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 24 Sep 2021 20:05:50 +0200 Subject: [PATCH 439/681] Check for nullptr explicitly (#15458) --- src/openrct2/Editor.cpp | 10 ++-- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/ReplayManager.cpp | 4 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/PeepPickupAction.cpp | 6 +-- src/openrct2/actions/SignSetStyleAction.cpp | 2 +- src/openrct2/audio/Audio.cpp | 2 +- src/openrct2/drawing/LightFX.cpp | 4 +- src/openrct2/drawing/TTFSDLPort.cpp | 10 ++-- src/openrct2/interface/Viewport.cpp | 4 +- src/openrct2/interface/Window.cpp | 2 +- src/openrct2/network/NetworkBase.cpp | 48 +++++++++---------- src/openrct2/paint/Paint.cpp | 4 +- .../paint/tile_element/Paint.Path.cpp | 4 +- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/peep/GuestPathfinding.cpp | 2 +- src/openrct2/peep/Peep.cpp | 6 +-- src/openrct2/rct2/S6Exporter.cpp | 4 +- src/openrct2/ride/TrainManager.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 8 ++-- .../ride/transport/MiniatureRailway.cpp | 4 +- src/openrct2/world/Map.cpp | 4 +- src/openrct2/world/MapHelpers.cpp | 2 +- src/openrct2/world/TileInspector.cpp | 2 +- 24 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 37ec3865ee..cbc88b6d31 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -377,12 +377,12 @@ namespace Editor switch (gEditorStep) { case EditorStep::ObjectSelection: - if (window_find_by_class(WC_EDITOR_OBJECT_SELECTION)) + if (window_find_by_class(WC_EDITOR_OBJECT_SELECTION) != nullptr) { return; } - if (window_find_by_class(WC_INSTALL_TRACK)) + if (window_find_by_class(WC_INSTALL_TRACK) != nullptr) { return; } @@ -395,7 +395,7 @@ namespace Editor context_open_window(WC_EDITOR_OBJECT_SELECTION); break; case EditorStep::InventionsListSetUp: - if (window_find_by_class(WC_EDITOR_INVENTION_LIST)) + if (window_find_by_class(WC_EDITOR_INVENTION_LIST) != nullptr) { return; } @@ -403,7 +403,7 @@ namespace Editor context_open_window(WC_EDITOR_INVENTION_LIST); break; case EditorStep::OptionsSelection: - if (window_find_by_class(WC_EDITOR_SCENARIO_OPTIONS)) + if (window_find_by_class(WC_EDITOR_SCENARIO_OPTIONS) != nullptr) { return; } @@ -411,7 +411,7 @@ namespace Editor context_open_window(WC_EDITOR_SCENARIO_OPTIONS); break; case EditorStep::ObjectiveSelection: - if (window_find_by_class(WC_EDITOR_OBJECTIVE_OPTIONS)) + if (window_find_by_class(WC_EDITOR_OBJECTIVE_OPTIONS) != nullptr) { return; } diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 0090e08e09..bde55168e2 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -745,7 +745,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots auto outputBuffer = GetCompareDataText(cmpData); FILE* fp = fopen(fileName.c_str(), "wt"); - if (!fp) + if (fp == nullptr) return false; fputs(outputBuffer.c_str(), fp); diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index ad17d560f7..d2090aa077 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -321,7 +321,7 @@ namespace OpenRCT2 const std::string& outFile = _currentRecording->filePath; FILE* fp = fopen(outFile.c_str(), "wb"); - if (fp) + if (fp != nullptr) { const auto& fileStream = fileSerialiser.GetStream(); fwrite(fileStream.GetData(), 1, fileStream.GetLength(), fp); @@ -554,7 +554,7 @@ namespace OpenRCT2 bool ReadReplayFromFile(const std::string& file, MemoryStream& stream) { FILE* fp = fopen(file.c_str(), "rb"); - if (!fp) + if (fp == nullptr) return false; char buffer[128]; diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index bc63e30825..0856d018a3 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -502,7 +502,7 @@ namespace GameActions bool commandExecutes = (flags & GAME_COMMAND_FLAG_GHOST) == 0 && (flags & GAME_COMMAND_FLAG_NO_SPEND) == 0; bool recordAction = false; - if (replayManager) + if (replayManager != nullptr) { if (replayManager->IsRecording() && commandExecutes) recordAction = true; diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index db89689ddd..ef29ca21e8 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -67,7 +67,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const return MakeResult(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE); } Peep* existing = network_get_pickup_peep(_owner); - if (existing) + if (existing != nullptr) { // already picking up a peep PeepPickupAction existingPickupAction{ @@ -122,7 +122,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const res->Position = { peep->x, peep->y, peep->z }; Peep* existing = network_get_pickup_peep(_owner); - if (existing) + if (existing != nullptr) { // already picking up a peep PeepPickupAction existingPickupAction{ @@ -151,7 +151,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const res->Position = { peep->x, peep->y, peep->z }; Peep* const pickedUpPeep = network_get_pickup_peep(_owner); - if (pickedUpPeep) + if (pickedUpPeep != nullptr) { pickedUpPeep->PickupAbort(_loc.x); } diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index e38319c71d..60599db6aa 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -64,7 +64,7 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const { WallElement* wallElement = banner_get_scrolling_wall_tile_element(_bannerIndex); - if (!wallElement) + if (wallElement == nullptr) { log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 454a81dd1f..6fb3c4f673 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -207,7 +207,7 @@ namespace OpenRCT2::Audio params.pan = 0; auto element = map_get_surface_element_at(location); - if (element && (element->GetBaseZ()) - 5 > location.z) + if (element != nullptr && (element->GetBaseZ()) - 5 > location.z) { volumeDown = 10; } diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 837742d48b..0b8f31751b 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -331,7 +331,7 @@ void lightfx_prepare_light_list() int32_t minDist = 0; int32_t baseHeight = (-999) * COORDS_Z_STEP; - if (interactionType != ViewportInteractionItem::Entity && tileElement) + if (interactionType != ViewportInteractionItem::Entity && tileElement != nullptr) { baseHeight = tileElement->GetBaseZ(); } @@ -440,7 +440,7 @@ void lightfx_swap_buffers() void lightfx_update_viewport_settings() { rct_window* mainWindow = window_get_main(); - if (mainWindow) + if (mainWindow != nullptr) { rct_viewport* viewport = window_get_viewport(mainWindow); _current_view_x_back = viewport->viewPos.x; diff --git a/src/openrct2/drawing/TTFSDLPort.cpp b/src/openrct2/drawing/TTFSDLPort.cpp index 030bb3aeef..0df6e8697c 100644 --- a/src/openrct2/drawing/TTFSDLPort.cpp +++ b/src/openrct2/drawing/TTFSDLPort.cpp @@ -550,12 +550,12 @@ static void Flush_Glyph(c_glyph* glyph) { glyph->stored = 0; glyph->index = 0; - if (glyph->bitmap.buffer) + if (glyph->bitmap.buffer != nullptr) { free(glyph->bitmap.buffer); glyph->bitmap.buffer = 0; } - if (glyph->pixmap.buffer) + if (glyph->pixmap.buffer != nullptr) { free(glyph->pixmap.buffer); glyph->pixmap.buffer = 0; @@ -754,7 +754,7 @@ static FT_Error Load_Glyph(TTF_Font* font, uint16_t ch, c_glyph* cached, int wan if (dst->rows != 0) { dst->buffer = static_cast(malloc(dst->pitch * dst->rows)); - if (!dst->buffer) + if (dst->buffer == nullptr) { return FT_Err_Out_Of_Memory; } @@ -1236,12 +1236,12 @@ int TTF_SizeUTF8(TTF_Font* font, const char* text, int* w, int* h) } /* Fill the bounds rectangle */ - if (w) + if (w != nullptr) { /* Add outline extra width */ *w = (maxx - minx) + outline_delta; } - if (h) + if (h != nullptr) { /* Some fonts descend below font height (FletcherGothicFLF) */ /* Add outline extra height */ diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 28cab048bd..a3d53b70d7 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -559,7 +559,7 @@ void viewport_update_position(rct_window* window) window_event_resize_call(window); rct_viewport* viewport = window->viewport; - if (!viewport) + if (viewport == nullptr) return; if (window->viewport_smart_follow_sprite != SPRITE_INDEX_NULL) @@ -656,7 +656,7 @@ void viewport_update_position(rct_window* window) void viewport_update_sprite_follow(rct_window* window) { - if (window->viewport_target_sprite != SPRITE_INDEX_NULL && window->viewport) + if (window->viewport_target_sprite != SPRITE_INDEX_NULL && window->viewport != nullptr) { auto* sprite = GetEntity(window->viewport_target_sprite); if (sprite == nullptr) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 42bf213b8a..5bd3668607 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -806,7 +806,7 @@ void window_scroll_to_location(rct_window* w, const CoordsXYZ& coords) { assert(w != nullptr); window_unfollow_sprite(w); - if (w->viewport) + if (w->viewport != nullptr) { int16_t height = tile_element_height(coords); if (coords.z < height - 16) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 137ef0c030..ee2555fdc6 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -700,7 +700,7 @@ const char* NetworkBase::FormatChat(NetworkPlayer* fromplayer, const char* text) static std::string formatted; formatted.clear(); formatted += "{OUTLINE}"; - if (fromplayer) + if (fromplayer != nullptr) { formatted += "{BABYBLUE}"; formatted += fromplayer->Name; @@ -934,7 +934,7 @@ uint8_t NetworkBase::GetDefaultGroup() void NetworkBase::SetDefaultGroup(uint8_t id) { - if (GetGroupByID(id)) + if (GetGroupByID(id) != nullptr) { default_group = id; } @@ -1336,7 +1336,7 @@ NetworkStats_t NetworkBase::GetStats() const void NetworkBase::Server_Send_AUTH(NetworkConnection& connection) { uint8_t new_playerid = 0; - if (connection.Player) + if (connection.Player != nullptr) { new_playerid = connection.Player->Id; } @@ -1356,7 +1356,7 @@ void NetworkBase::Server_Send_AUTH(NetworkConnection& connection) void NetworkBase::Server_Send_MAP(NetworkConnection* connection) { std::vector objects; - if (connection) + if (connection != nullptr) { objects = connection->RequestedObjects; } @@ -1372,7 +1372,7 @@ void NetworkBase::Server_Send_MAP(NetworkConnection* connection) auto header = save_for_network(objects); if (header.empty()) { - if (connection) + if (connection != nullptr) { connection->SetLastDisconnectReason(STR_MULTIPLAYER_CONNECTION_CLOSED); connection->Disconnect(); @@ -1386,7 +1386,7 @@ void NetworkBase::Server_Send_MAP(NetworkConnection* connection) NetworkPacket packet(NetworkCommand::Map); packet << static_cast(header.size()) << static_cast(i); packet.Write(&header[i], datasize); - if (connection) + if (connection != nullptr) { connection->QueuePacket(std::move(packet)); } @@ -1844,7 +1844,7 @@ void NetworkBase::ProcessPlayerList() { // Add new player. player = AddPlayer("", ""); - if (player) + if (player != nullptr) { *player = pendingPlayer; if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) @@ -1965,7 +1965,7 @@ void NetworkBase::ServerClientDisconnected(std::unique_ptr& c connection_player->Name.c_str(), connection->GetLastDisconnectReason(), }; - if (has_disconnected_args[1]) + if (has_disconnected_args[1] != nullptr) { format_string(text, 256, STR_MULTIPLAYER_PLAYER_HAS_DISCONNECTED_WITH_REASON, has_disconnected_args); } @@ -1976,7 +1976,7 @@ void NetworkBase::ServerClientDisconnected(std::unique_ptr& c chat_history_add(text); Peep* pickup_peep = network_get_pickup_peep(connection_player->Id); - if (pickup_peep) + if (pickup_peep != nullptr) { PeepPickupAction pickupAction{ PeepPickupType::Cancel, pickup_peep->sprite_index, @@ -2181,7 +2181,7 @@ void NetworkBase::Server_Handle_REQUEST_GAMESTATE(NetworkConnection& connection, IGameStateSnapshots* snapshots = GetContext().GetGameStateSnapshots(); const GameStateSnapshot_t* snapshot = snapshots->GetLinkedSnapshot(tick); - if (snapshot) + if (snapshot != nullptr) { MemoryStream snapshotMemory; DataSerialiser ds(true, snapshotMemory); @@ -2426,7 +2426,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network snapshots->SerialiseSnapshot(serverSnapshot, ds); const GameStateSnapshot_t* desyncSnapshot = snapshots->GetLinkedSnapshot(tick); - if (desyncSnapshot) + if (desyncSnapshot != nullptr) { GameStateCompareData_t cmpData = snapshots->Compare(serverSnapshot, *desyncSnapshot); @@ -2468,7 +2468,7 @@ void NetworkBase::Server_Handle_MAPREQUEST(NetworkConnection& connection, Networ connection.SetLastDisconnectReason(STR_MULTIPLAYER_CLIENT_INVALID_REQUEST); connection.Disconnect(); std::string playerName = "(unknown)"; - if (connection.Player) + if (connection.Player != nullptr) { playerName = connection.Player->Name; } @@ -2880,10 +2880,10 @@ void NetworkBase::Server_Handle_CHAT(NetworkConnection& connection, NetworkPacke if (szText.empty()) return; - if (connection.Player) + if (connection.Player != nullptr) { NetworkGroup* group = GetGroupByID(connection.Player->Group); - if (!group || !group->CanPerformCommand(GameCommand::Chat)) + if (group == nullptr || !group->CanPerformCommand(GameCommand::Chat)) { return; } @@ -3084,7 +3084,7 @@ void NetworkBase::Server_Handle_PING(NetworkConnection& connection, [[maybe_unus { ping = 0; } - if (connection.Player) + if (connection.Player != nullptr) { connection.Player->Ping = ping; window_invalidate_by_number(WC_PLAYER, connection.Player->Id); @@ -3101,7 +3101,7 @@ void NetworkBase::Client_Handle_PINGLIST([[maybe_unused]] NetworkConnection& con uint16_t ping; packet >> id >> ping; NetworkPlayer* player = GetPlayerByID(id); - if (player) + if (player != nullptr) { player->Ping = ping; } @@ -3510,7 +3510,7 @@ GameActions::Result::Ptr network_set_player_group( return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); } - if (!network.GetGroupByID(groupId)) + if (network.GetGroupByID(groupId) == nullptr) { return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); } @@ -3521,7 +3521,7 @@ GameActions::Result::Ptr network_set_player_group( GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO); } - if (groupId == 0 && fromgroup && fromgroup->Id != 0) + if (groupId == 0 && fromgroup != nullptr && fromgroup->Id != 0) { return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP); } @@ -3701,7 +3701,7 @@ GameActions::Result::Ptr network_kick_player(NetworkPlayerId_t playerId, bool is return std::make_unique(GameActions::Status::Unknown, STR_NONE); } - if (player && player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) + if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { return std::make_unique(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST); } @@ -3768,7 +3768,7 @@ void network_set_pickup_peep(uint8_t playerid, Peep* peep) else { NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) + if (player != nullptr) { player->PickupPeep = peep; } @@ -3784,7 +3784,7 @@ Peep* network_get_pickup_peep(uint8_t playerid) } NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) + if (player != nullptr) { return player->PickupPeep; } @@ -3801,7 +3801,7 @@ void network_set_pickup_peep_old_x(uint8_t playerid, int32_t x) else { NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) + if (player != nullptr) { player->PickupPeepOldX = x; } @@ -3817,7 +3817,7 @@ int32_t network_get_pickup_peep_old_x(uint8_t playerid) } NetworkPlayer* player = network.GetPlayerByID(playerid); - if (player) + if (player != nullptr) { return player->PickupPeepOldX; } @@ -3828,7 +3828,7 @@ int32_t network_get_current_player_group_index() { auto& network = OpenRCT2::GetContext()->GetNetwork(); NetworkPlayer* player = network.GetPlayerByID(network.GetPlayerID()); - if (player) + if (player != nullptr) { return network_get_group_index(player->Group); } diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 862a5a8b10..aab007274d 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -525,7 +525,7 @@ void PaintDrawStructs(paint_session* session) { paint_struct* ps = &session->PaintHead; - for (ps = ps->next_quadrant_ps; ps;) + for (ps = ps->next_quadrant_ps; ps != nullptr;) { PaintDrawStruct(session, ps); @@ -541,7 +541,7 @@ void PaintDrawStructs(paint_session* session) static void PaintAttachedPS(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t viewFlags) { attached_paint_struct* attached_ps = ps->attached_ps; - for (; attached_ps; attached_ps = attached_ps->next) + for (; attached_ps != nullptr; attached_ps = attached_ps->next) { auto screenCoords = ScreenCoordsXY{ attached_ps->x + ps->x, attached_ps->y + ps->y }; diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c11d0991e3..24625f0bc0 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -1061,7 +1061,7 @@ void path_paint_box_support( // If we are on the same tile as a straight track, add the offset 2 so we // can clip above gravel part of the track sprite - if (session->TrackElementOnSameHeight) + if (session->TrackElementOnSameHeight != nullptr) { if (session->TrackElementOnSameHeight->AsTrack()->GetTrackType() == TrackElemType::Flat) { @@ -1199,7 +1199,7 @@ void path_paint_pole_support( // If we are on the same tile as a straight track, add the offset 2 so we // can clip above gravel part of the track sprite - if (session->TrackElementOnSameHeight) + if (session->TrackElementOnSameHeight != nullptr) { if (session->TrackElementOnSameHeight->AsTrack()->GetTrackType() == TrackElemType::Flat) { diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 9895036e18..33cea3719d 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1407,7 +1407,7 @@ void Guest::CheckCantFindRide() GuestHeadingToRideId = RIDE_ID_NULL; rct_window* w = window_find_by_number(WC_PEEP, sprite_index); - if (w) + if (w != nullptr) { window_event_invalidate_call(w); } diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 2f27e93843..8eb9dbced2 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -88,7 +88,7 @@ static TileElement* get_banner_on_path(TileElement* path_element) if (bannerElement->IsLastForTile()) return nullptr; - } while (bannerElement++); + } while (bannerElement++ != nullptr); return nullptr; } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 4a36e8622b..288b096b81 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -573,12 +573,12 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, { auto* pathElement = map_get_path_element_at(location); TileElement* tileElement = reinterpret_cast(pathElement); - if (!pathElement) + if (pathElement == nullptr) { tileElement = reinterpret_cast(map_get_surface_element_at(location.ToCoordsXYZ())); } - if (!tileElement) + if (tileElement == nullptr) return std::make_unique(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); // Set the coordinate of destination to be exactly @@ -2056,7 +2056,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords) auto* guest = peep->As(); if (map_is_location_owned({ coords, z })) { - if (guest && guest->OutsideOfPark) + if (guest != nullptr && guest->OutsideOfPark) { peep_return_to_centre_of_tile(guest); return; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 7ef6c5f03e..7015d66994 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1148,7 +1148,7 @@ constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const EntityBase* src) case EntityType::Vehicle: { auto veh = src->As(); - if (veh && veh->IsHead()) + if (veh != nullptr && veh->IsHead()) { output = RCT12EntityLinkListOffset::TrainHead; } @@ -1863,7 +1863,7 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, const TileElement* src // This has to be done last, since the maze entry shares fields with the colour and sequence fields. auto ride = get_ride(static_cast(dst2->GetRideIndex())); - if (ride) + if (ride != nullptr) { if (ride->type == RIDE_TYPE_MAZE) { diff --git a/src/openrct2/ride/TrainManager.cpp b/src/openrct2/ride/TrainManager.cpp index 52b6e75028..eea7d347ef 100644 --- a/src/openrct2/ride/TrainManager.cpp +++ b/src/openrct2/ride/TrainManager.cpp @@ -22,7 +22,7 @@ namespace TrainManager while (iter != end && Entity == nullptr) { Entity = GetEntity(*iter++); - if (Entity && !Entity->IsHead()) + if (Entity != nullptr && !Entity->IsHead()) { Entity = nullptr; } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 44e8a8cfd7..014527677b 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -9802,7 +9802,7 @@ void Vehicle::UpdateCrossings() const frontVehicle->TrackLocation, frontVehicle->GetTrackType(), 0) }; int32_t curZ = frontVehicle->TrackLocation.z; - if (xyElement.element && status != Vehicle::Status::Arriving) + if (xyElement.element != nullptr && status != Vehicle::Status::Arriving) { int16_t autoReserveAhead = 4 + abs(velocity) / 150000; int16_t crossingBonus = 0; @@ -9822,7 +9822,7 @@ void Vehicle::UpdateCrossings() const // Many New Element parks have invisible rides hacked into the path. // Limit path blocking to rides actually supporting level crossings to prevent peeps getting stuck everywhere. - if (pathElement && curRide != nullptr + if (pathElement != nullptr && curRide != nullptr && GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)) { if (!playedClaxon && !pathElement->IsBlockedByVehicle()) @@ -9873,7 +9873,7 @@ void Vehicle::UpdateCrossings() const map_get_track_element_at_of_type_seq(backVehicle->TrackLocation, backVehicle->GetTrackType(), 0) }; curZ = backVehicle->TrackLocation.z; - if (xyElement.element) + if (xyElement.element != nullptr) { uint8_t freeCount = travellingForwards ? 3 : 1; @@ -9890,7 +9890,7 @@ void Vehicle::UpdateCrossings() const } auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() })); - if (pathElement) + if (pathElement != nullptr) { pathElement->SetIsBlockedByVehicle(false); } diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 3acb96aa18..613e90d8d5 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -558,7 +558,7 @@ static uint32_t miniature_railway_track_to_grooved(uint32_t imageId) static uint32_t miniature_railway_track_to_grooved_indent( uint32_t imageId, const TileElement* path, uint8_t direction, uint8_t rotation) { - if (!path) + if (path == nullptr) { return 0; } @@ -598,7 +598,7 @@ static void paint_miniature_railway_track_flat( bool paintAsGravel = false; bool paintGrooved = false; - if (session->PathElementOnSameHeight) + if (session->PathElementOnSameHeight != nullptr) { paintAsGravel = true; paintGrooved = true; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index cda70e0a21..7f9be950eb 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1691,7 +1691,7 @@ void map_extend_boundary_surface() existingTileElement = map_get_surface_element_at(TileCoordsXY{ x, y - 1 }.ToCoordsXY()); newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - if (existingTileElement && newTileElement) + if (existingTileElement != nullptr && newTileElement != nullptr) { map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); } @@ -1705,7 +1705,7 @@ void map_extend_boundary_surface() existingTileElement = map_get_surface_element_at(TileCoordsXY{ x - 1, y }.ToCoordsXY()); newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - if (existingTileElement && newTileElement) + if (existingTileElement != nullptr && newTileElement != nullptr) { map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); } diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index 0fc73a2221..b8857f6302 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -17,7 +17,7 @@ static uint8_t getBaseHeightOrZero(int32_t x, int32_t y) { auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); - return surfaceElement ? surfaceElement->base_height : 0; + return surfaceElement != nullptr ? surfaceElement->base_height : 0; } /** diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index e032676314..56c5613875 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -212,7 +212,7 @@ namespace OpenRCT2::TileInspector } auto largeScenery = tileElement->AsLargeScenery(); - if (largeScenery) + if (largeScenery != nullptr) { // Only delete the banner entry if there are no other parts of the large scenery to delete if (numLargeScenerySequences(loc, largeScenery) == 1) From a8b84989eb00de695f47c15e956cc7629cdfe8d2 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 25 Sep 2021 08:45:06 +0200 Subject: [PATCH 440/681] Check for nullptr explicitly in operct2-ui (#15460) --- src/openrct2-ui/input/MouseInput.cpp | 23 ++++++++++---------- src/openrct2-ui/windows/Changelog.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 8 +++---- src/openrct2-ui/windows/Options.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 14 +++++------- src/openrct2-ui/windows/RideConstruction.cpp | 15 +++++++------ src/openrct2-ui/windows/SavePrompt.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 17 +++++++-------- src/openrct2-ui/windows/TopToolbar.cpp | 14 ++++++------ 9 files changed, 48 insertions(+), 49 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 40186e2f5f..d03500d4b5 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -748,7 +748,7 @@ static void InputScrollPartUpdateHThumb(rct_window* w, rct_widgetindex widgetInd { rct_widget* widget = &w->widgets[widgetIndex]; - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newLeft; newLeft = w->scrolls[scroll_id].h_right; @@ -787,7 +787,7 @@ static void InputScrollPartUpdateVThumb(rct_window* w, rct_widgetindex widgetInd assert(w != nullptr); rct_widget* widget = &w->widgets[widgetIndex]; - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newTop; newTop = w->scrolls[scroll_id].v_bottom; @@ -824,7 +824,7 @@ static void InputScrollPartUpdateVThumb(rct_window* w, rct_widgetindex widgetInd static void InputScrollPartUpdateHLeft(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id) { assert(w != nullptr); - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= HSCROLLBAR_LEFT_PRESSED; if (w->scrolls[scroll_id].h_left >= 3) @@ -842,7 +842,7 @@ static void InputScrollPartUpdateHRight(rct_window* w, rct_widgetindex widgetInd { assert(w != nullptr); rct_widget* widget = &w->widgets[widgetIndex]; - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= HSCROLLBAR_RIGHT_PRESSED; w->scrolls[scroll_id].h_left += 3; @@ -867,7 +867,7 @@ static void InputScrollPartUpdateHRight(rct_window* w, rct_widgetindex widgetInd static void InputScrollPartUpdateVTop(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id) { assert(w != nullptr); - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= VSCROLLBAR_UP_PRESSED; if (w->scrolls[scroll_id].v_top >= 3) @@ -885,7 +885,7 @@ static void InputScrollPartUpdateVBottom(rct_window* w, rct_widgetindex widgetIn { assert(w != nullptr); rct_widget* widget = &w->widgets[widgetIndex]; - if (window_find_by_number(w->classification, w->number)) + if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= VSCROLLBAR_DOWN_PRESSED; w->scrolls[scroll_id].v_top += 3; @@ -1170,7 +1170,7 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords) { rct_window* w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); - if (!w) + if (w == nullptr) tool_cancel(); else window_event_tool_update_call(w, gCurrentToolWidget.widget_index, screenCoords); @@ -1200,7 +1200,8 @@ void InputStateWidgetPressed( switch (state) { case MouseState::Released: - if (!w || cursor_w_class != w->classification || cursor_w_number != w->number || widgetIndex != cursor_widgetIndex) + if (w == nullptr || cursor_w_class != w->classification || cursor_w_number != w->number + || widgetIndex != cursor_widgetIndex) break; if (w->disabled_widgets & (1ULL << widgetIndex)) @@ -1237,7 +1238,7 @@ void InputStateWidgetPressed( case MouseState::RightPress: if (_inputState == InputState::DropdownActive) { - if (w) + if (w != nullptr) { auto wClass = w->classification; auto wNumber = w->number; @@ -1317,10 +1318,10 @@ void InputStateWidgetPressed( gTooltipTimeout = 0; gTooltipWidget.widget_index = cursor_widgetIndex; - if (!w) + if (w == nullptr) break; - if (!widget) + if (widget == nullptr) break; { diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 61bdc07687..20e9ef3818 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -175,7 +175,7 @@ public: Close(); break; case WIDX_OPEN_URL: - if (_newVersionInfo) + if (_newVersionInfo != nullptr) { GetContext()->GetUiContext()->OpenURL(_newVersionInfo->url); } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index c7063690af..c956f3556c 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -595,7 +595,7 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex) if (result->Error != GameActions::Status::Ok) return; rct_window* wind = window_find_by_number(WC_PEEP, peepnum); - if (wind) + if (wind != nullptr) { tool_set(wind, WC_PEEP__WIDX_PICKUP, Tool::Picker); } @@ -678,7 +678,7 @@ void window_guest_set_page(rct_window* w, int32_t page) tool_cancel(); } int32_t listen = 0; - if (page == WINDOW_GUEST_OVERVIEW && w->page == WINDOW_GUEST_OVERVIEW && w->viewport) + if (page == WINDOW_GUEST_OVERVIEW && w->page == WINDOW_GUEST_OVERVIEW && w->viewport != nullptr) { if (!(w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)) listen = 1; @@ -703,7 +703,7 @@ void window_guest_set_page(rct_window* w, int32_t page) WindowInitScrollWidgets(w); w->Invalidate(); - if (listen && w->viewport) + if (listen && w->viewport != nullptr) w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON; } @@ -986,7 +986,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) window_guest_debug_tab_paint(w, dpi); // Draw the viewport no sound sprite - if (w->viewport) + if (w->viewport != nullptr) { window_draw_viewport(dpi, w); rct_viewport* viewport = w->viewport; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 6299fcc0f1..a328ed206f 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2011,7 +2011,7 @@ static void window_options_advanced_mouseup(rct_window* w, rct_widgetindex widge case WIDX_PATH_TO_RCT1_BUTTON: { utf8string rct1path = platform_open_directory_browser(language_get_string(STR_PATH_TO_RCT1_BROWSER)); - if (rct1path) + if (rct1path != nullptr) { // Check if this directory actually contains RCT1 if (Csg1datPresentAtLocation(rct1path)) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 1f2d68054b..51d7d275d0 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1485,7 +1485,7 @@ static void window_ride_set_page(rct_window* w, int32_t page) if (page == WINDOW_RIDE_PAGE_VEHICLE) { auto constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); - if (constructionWindow && constructionWindow->number == w->number) + if (constructionWindow != nullptr && constructionWindow->number == w->number) { window_close_by_class(WC_RIDE_CONSTRUCTION); // Closing the construction window sets the tab to the first page, which we don't want here, @@ -1595,7 +1595,7 @@ static void window_ride_init_viewport(rct_window* w) { uint16_t vehId = ride->vehicles[viewSelectionIndex]; rct_ride_entry* ride_entry = ride->GetRideEntry(); - if (ride_entry && ride_entry->tab_vehicle != 0) + if (ride_entry != nullptr && ride_entry->tab_vehicle != 0) { Vehicle* vehicle = GetEntity(vehId); if (vehicle == nullptr) @@ -1654,7 +1654,7 @@ static void window_ride_init_viewport(rct_window* w) w->focus = focus; // rct2: 0x006aec9c only used here so brought it into the function - if (!w->viewport && !ride->overall_view.IsNull()) + if (w->viewport == nullptr && !ride->overall_view.IsNull()) { rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT]; @@ -1667,7 +1667,7 @@ static void window_ride_init_viewport(rct_window* w) w->flags |= WF_NO_SCROLLING; w->Invalidate(); } - if (w->viewport) + if (w->viewport != nullptr) { w->viewport->flags = viewport_flags; w->Invalidate(); @@ -5225,8 +5225,7 @@ static void cancel_scenery_selection() OpenRCT2::Audio::Resume(); rct_window* main_w = window_get_main(); - - if (main_w) + if (main_w != nullptr) { main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); } @@ -5258,8 +5257,7 @@ static void setup_scenery_selection(rct_window* w) OpenRCT2::Audio::StopAll(); rct_window* w_main = window_get_main(); - - if (w_main) + if (w_main != nullptr) { w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8a34c04e84..15ca93958e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2139,7 +2139,7 @@ static std::optional ride_get_place_position_from_screen_position(Scre _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; // Scale delta by zoom to match mouse position. auto* mainWnd = window_get_main(); - if (mainWnd && mainWnd->viewport) + if (mainWnd != nullptr && mainWnd->viewport != nullptr) { _trackPlaceShiftZ = _trackPlaceShiftZ * mainWnd->viewport->zoom; } @@ -3566,17 +3566,18 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) { pathsByDir[i] = map_get_footpath_element({ *mapCoords + CoordsDirectionDelta[i], z }); - if (pathsByDir[i] && (pathsByDir[i])->AsPath()->IsSloped() && (pathsByDir[i])->AsPath()->GetSlopeDirection() != i) + if (pathsByDir[i] != nullptr && (pathsByDir[i])->AsPath()->IsSloped() + && (pathsByDir[i])->AsPath()->GetSlopeDirection() != i) { pathsByDir[i] = nullptr; } // Sloped path on the level below - if (!pathsByDir[i]) + if (pathsByDir[i] == nullptr) { pathsByDir[i] = map_get_footpath_element({ *mapCoords + CoordsDirectionDelta[i], z - PATH_HEIGHT_STEP }); - if (pathsByDir[i] + if (pathsByDir[i] != nullptr && (!(pathsByDir[i])->AsPath()->IsSloped() || (pathsByDir[i])->AsPath()->GetSlopeDirection() != direction_reverse(i))) { @@ -3584,12 +3585,12 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) } } - if (pathsByDir[i] && (pathsByDir[i])->AsPath()->IsQueue()) + if (pathsByDir[i] != nullptr && (pathsByDir[i])->AsPath()->IsQueue()) { pathsByDir[i] = nullptr; } - if (pathsByDir[i] && i == _currentTrackPieceDirection) + if (pathsByDir[i] != nullptr && i == _currentTrackPieceDirection) { keepOrientation = true; break; @@ -3600,7 +3601,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) { for (int8_t i = 0; i < 4; i++) { - if (pathsByDir[i]) + if (pathsByDir[i] != nullptr) { _currentTrackPieceDirection = i; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 476e1f647f..4c36ac67e6 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -121,7 +121,7 @@ rct_window* window_save_prompt_open() // Check if window is already open window = window_bring_to_front_by_class(WC_SAVE_PROMPT); - if (window) + if (window != nullptr) { window_close(window); } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 727e755429..8f9ea88b71 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -357,7 +357,7 @@ void window_staff_set_page(rct_window* w, int32_t page) } int32_t listen = 0; - if (page == WINDOW_STAFF_OVERVIEW && w->page == WINDOW_STAFF_OVERVIEW && w->viewport) + if (page == WINDOW_STAFF_OVERVIEW && w->page == WINDOW_STAFF_OVERVIEW && w->viewport != nullptr) { if (!(w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)) listen = 1; @@ -383,7 +383,7 @@ void window_staff_set_page(rct_window* w, int32_t page) WindowInitScrollWidgets(w); w->Invalidate(); - if (listen && w->viewport) + if (listen && w->viewport != nullptr) w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON; } @@ -419,7 +419,7 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex) if (result->Error != GameActions::Status::Ok) return; rct_window* wind = window_find_by_number(WC_PEEP, peepnum); - if (wind) + if (wind != nullptr) { tool_set(wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); } @@ -482,8 +482,7 @@ void window_staff_overview_resize(rct_window* w) } rct_viewport* viewport = w->viewport; - - if (viewport) + if (viewport != nullptr) { int32_t new_width = w->width - 30; int32_t new_height = w->height - 62; @@ -954,7 +953,7 @@ void window_staff_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) window_staff_stats_tab_paint(w, dpi); // Draw the viewport no sound sprite - if (w->viewport) + if (w->viewport != nullptr) { window_draw_viewport(dpi, w); rct_viewport* viewport = w->viewport; @@ -1361,7 +1360,7 @@ void window_staff_viewport_init(rct_window* w) uint16_t viewport_flags; - if (w->viewport) + if (w->viewport != nullptr) { if (focus == w->focus) return; @@ -1382,7 +1381,7 @@ void window_staff_viewport_init(rct_window* w) if (peep->State != PeepState::Picked) { - if (!(w->viewport)) + if (w->viewport == nullptr) { rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT]; @@ -1396,7 +1395,7 @@ void window_staff_viewport_init(rct_window* w) } } - if (w->viewport) + if (w->viewport != nullptr) w->viewport->flags = viewport_flags; w->Invalidate(); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 4ea2643e09..a7f7660dfa 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1215,7 +1215,7 @@ static void sub_6E1F34_update_screen_coords_and_buttons_pressed(bool canRaiseIte gSceneryShiftPressZOffset = (gSceneryShiftPressY - screenPos.y + 4); // Scale delta by zoom to match mouse position. auto* mainWnd = window_get_main(); - if (mainWnd && mainWnd->viewport) + if (mainWnd != nullptr && mainWnd->viewport != nullptr) { gSceneryShiftPressZOffset = gSceneryShiftPressZOffset * mainWnd->viewport->zoom; } @@ -3058,7 +3058,7 @@ static money64 selection_lower_land(uint8_t flags) static void window_top_toolbar_land_tool_drag(const ScreenCoordsXY& screenPos) { rct_window* window = window_find_from_point(screenPos); - if (!window) + if (window == nullptr) return; rct_widgetindex widget_index = window_find_widget_from_point(window, screenPos); if (widget_index == -1) @@ -3067,7 +3067,7 @@ static void window_top_toolbar_land_tool_drag(const ScreenCoordsXY& screenPos) if (widget->type != WindowWidgetType::Viewport) return; rct_viewport* viewport = window->viewport; - if (!viewport) + if (viewport == nullptr) return; int16_t tile_height = -16 / viewport->zoom; @@ -3110,7 +3110,7 @@ static void window_top_toolbar_water_tool_drag(const ScreenCoordsXY& screenPos) if (widget->type != WindowWidgetType::Viewport) return; rct_viewport* viewport = window->viewport; - if (!viewport) + if (viewport == nullptr) return; int16_t dx = -16 / viewport->zoom; @@ -3555,7 +3555,7 @@ static void top_toolbar_init_network_menu(rct_window* w, rct_widget* widget) static void top_toolbar_debug_menu_dropdown(int16_t dropdownIndex) { rct_window* w = window_get_main(); - if (w) + if (w != nullptr) { switch (dropdownIndex) { @@ -3582,7 +3582,7 @@ static void top_toolbar_debug_menu_dropdown(int16_t dropdownIndex) static void top_toolbar_network_menu_dropdown(int16_t dropdownIndex) { rct_window* w = window_get_main(); - if (w) + if (w != nullptr) { switch (dropdownIndex) { @@ -3678,7 +3678,7 @@ static void top_toolbar_init_view_menu(rct_window* w, rct_widget* widget) static void top_toolbar_view_menu_dropdown(int16_t dropdownIndex) { rct_window* w = window_get_main(); - if (w) + if (w != nullptr) { switch (dropdownIndex) { From 2ba515fb37862ca9acad922f141f8377ee33b034 Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Sun, 26 Sep 2021 04:21:38 +0900 Subject: [PATCH 441/681] Improve #15322: Circus Music Not Playing Alleviates the issue, though the circus in European Extravaganza still does not work correctly. --- src/openrct2/ride/Ride.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 8075bca203..7465c4ff6e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1757,22 +1757,25 @@ Staff* ride_get_assigned_mechanic(Ride* ride) */ static void ride_music_update(Ride* ride) { - const auto& rtd = ride->GetRideTypeDescriptor(); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) - { - return; - } - - if (ride->status != RideStatus::Open || !(ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) - { - ride->music_tune_id = 255; - return; - } - + // The circus does not have music in the normal sense - its “music” is a sound effect. if (ride->type == RIDE_TYPE_CIRCUS) { Vehicle* vehicle = GetEntity(ride->vehicles[0]); - if (vehicle != nullptr && vehicle->status != Vehicle::Status::DoingCircusShow) + if (vehicle == nullptr || vehicle->status != Vehicle::Status::DoingCircusShow) + { + ride->music_tune_id = 255; + return; + } + } + else + { + const auto& rtd = ride->GetRideTypeDescriptor(); + if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + return; + } + + if (ride->status != RideStatus::Open || !(ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) { ride->music_tune_id = 255; return; From 9dd9b27db4eff78a967d137faec0880c3877e205 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 26 Sep 2021 11:11:42 +0200 Subject: [PATCH 442/681] Make WIDGETS_END constexpr --- src/openrct2-ui/scripting/CustomWindow.cpp | 2 +- src/openrct2-ui/windows/About.cpp | 4 ++-- 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 | 4 ++-- src/openrct2-ui/windows/Dropdown.cpp | 2 +- .../windows/EditorBottomToolbar.cpp | 2 +- .../windows/EditorInventionsList.cpp | 4 ++-- src/openrct2-ui/windows/EditorMain.cpp | 2 +- .../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 | 2 +- src/openrct2-ui/windows/Guest.cpp | 14 ++++++------- 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 | 4 ++-- 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/Player.cpp | 4 ++-- src/openrct2-ui/windows/Research.cpp | 4 ++-- src/openrct2-ui/windows/Ride.cpp | 20 +++++++++---------- 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 | 2 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/ServerStart.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 6 +++--- src/openrct2-ui/windows/Sign.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 6 +++--- 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 | 20 +++++++++---------- .../windows/TitleCommandEditor.cpp | 2 +- src/openrct2-ui/windows/TitleEditor.cpp | 2 +- src/openrct2-ui/windows/TitleExit.cpp | 2 +- src/openrct2-ui/windows/TitleLogo.cpp | 2 +- src/openrct2-ui/windows/TitleMenu.cpp | 2 +- src/openrct2-ui/windows/TitleOptions.cpp | 2 +- src/openrct2-ui/windows/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/ViewClipping.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 2 +- src/openrct2-ui/windows/Water.cpp | 2 +- src/openrct2/interface/Widget.h | 2 +- 74 files changed, 139 insertions(+), 139 deletions(-) diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 874427ef14..d522e0b35e 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -965,7 +965,7 @@ namespace OpenRCT2::Ui::Windows } } - widgetList.push_back({ WIDGETS_END }); + widgetList.push_back(WIDGETS_END); widgets = widgetList.data(); WindowInitScrollWidgets(this); diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index b164360a30..c068081b12 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -70,12 +70,12 @@ static rct_widget window_about_openrct2_widgets[] = { MakeWidget({168, 115 + 72}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_JOIN_DISCORD ), // "join discord" button MakeWidget({10, 250}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION_2), // Contributors MakeWidget({10, 300}, {WW - 20, 50}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION_3), // Copyright - { WIDGETS_END } + WIDGETS_END, }; static rct_widget window_about_rct2_widgets[] = { WIDGETS_MAIN, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_about_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 79310f0f81..0dbdec371f 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -66,7 +66,7 @@ static rct_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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 20e9ef3818..ff2039715a 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -46,7 +46,7 @@ static rct_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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index fed09f35f9..67341f7537 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -212,7 +212,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget window_cheats_guests_widgets[] = @@ -245,7 +245,7 @@ static rct_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 }, + WIDGETS_END, }; //Strings for following moved to window_cheats_paint() @@ -281,7 +281,7 @@ static rct_widget window_cheats_misc_widgets[] = MakeWidget ({ 5, 347}, {238, 35}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_STAFF_GROUP ), // Staff group MakeWidget ({126, 361}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Staff speed MakeWidget ({225, 362}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), // Staff speed - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_cheats_rides_widgets[] = { @@ -307,7 +307,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget *window_cheats_page_widgets[] = diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 597f50f22b..f870705565 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -41,7 +41,7 @@ static rct_widget window_clear_scenery_widgets[] = { MakeRemapWidget({ 7, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery MakeRemapWidget({37, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery MakeRemapWidget({67, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP), // footpaths - { WIDGETS_END }, + WIDGETS_END, }; static void window_clear_scenery_close(rct_window *w); diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index ce1fbf068f..a19229282f 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -39,7 +39,7 @@ static rct_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 }, + WIDGETS_END, }; diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index c67f5275c0..1c365b4785 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -42,7 +42,7 @@ static rct_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 }, + WIDGETS_END, }; static void window_debug_paint_mouseup(rct_window * w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 94fc63ea8a..783c9a9fa3 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -36,14 +36,14 @@ static rct_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 } + WIDGETS_END, }; static rct_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 } + WIDGETS_END, }; static void window_ride_demolish_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index a8ea39dd92..77aa199642 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -33,7 +33,7 @@ enum static rct_widget window_dropdown_widgets[] = { MakeWidget({ 0, 0 }, { 1, 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END }, + WIDGETS_END, }; static int32_t _dropdown_num_columns; diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 4301a10584..edbf0a48cf 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -40,7 +40,7 @@ static rct_widget window_editor_bottom_toolbar_widgets[] = { 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 }, + WIDGETS_END, }; static void window_editor_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 2f95e67c32..d785a8fd40 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -55,12 +55,12 @@ static rct_widget window_editor_inventions_list_widgets[] = { 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 } + WIDGETS_END, }; static rct_widget window_editor_inventions_list_drag_widgets[] = { MakeWidget({0, 0}, {150, 14}, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index d0186f17db..b87bbfec46 100644 --- a/src/openrct2-ui/windows/EditorMain.cpp +++ b/src/openrct2-ui/windows/EditorMain.cpp @@ -24,7 +24,7 @@ static rct_window_event_list window_editor_main_events([](auto& events) { static rct_widget window_editor_main_widgets[] = { MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::Viewport, WindowColour::Primary, STR_VIEWPORT), - { WIDGETS_END }, + WIDGETS_END, }; /** diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 16d586ecb0..574ae7f761 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -170,7 +170,7 @@ static std::vector _window_editor_object_selection_widgets = { MakeTab ({ 3, 17}, STR_STRING_DEFINED_TOOLTIP ), // Copied object type times... - { WIDGETS_END } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 5bd5919deb..efb6d4eb02 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -102,13 +102,13 @@ static rct_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 } + WIDGETS_END, }; static rct_widget window_editor_objective_options_rides_widgets[] = { MAIN_OBJECTIVE_OPTIONS_WIDGETS, MakeWidget({ 3, 60}, {374, 161}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), - { WIDGETS_END } + WIDGETS_END, }; static rct_widget *window_editor_objective_options_widgets[] = { diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index fdf8721212..5e59ff842a 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -129,7 +129,7 @@ static rct_widget window_editor_scenario_options_financial_widgets[] = { MakeSpinnerWidgets({168, 99}, { 100, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 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 ), - { WIDGETS_END } + WIDGETS_END, }; static rct_widget window_editor_scenario_options_guests_widgets[] = { @@ -144,7 +144,7 @@ static rct_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 } + WIDGETS_END, }; static rct_widget window_editor_scenario_options_park_widgets[] = { @@ -165,7 +165,7 @@ static rct_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 } + WIDGETS_END, }; static rct_widget *window_editor_scenario_options_widgets[] = { diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 0aa501a991..b903b300a7 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -24,7 +24,7 @@ enum { static rct_widget window_error_widgets[] = { MakeWidget({0, 0}, {200, 42}, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END } + WIDGETS_END, }; static void window_error_unknown5(rct_window *w); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 7b9c5a852e..385dade6c2 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -100,7 +100,7 @@ static rct_widget _windowFinancesSummaryWidgets[] = TAB_WIDGETS, 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 }, + WIDGETS_END, }; static rct_widget _windowFinancesCashWidgets[] = @@ -108,7 +108,7 @@ static rct_widget _windowFinancesCashWidgets[] = WINDOW_SHIM(STR_FINANCIAL_GRAPH, WW_OTHER_TABS, WH_OTHER_TABS), MakeWidget({0, 43}, {WW_OTHER_TABS, 214}, WindowWidgetType::Resize, WindowColour::Secondary), TAB_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget _windowFinancesParkValueWidgets[] = @@ -116,7 +116,7 @@ static rct_widget _windowFinancesParkValueWidgets[] = WINDOW_SHIM(STR_PARK_VALUE_GRAPH, WW_OTHER_TABS, WH_OTHER_TABS), MakeWidget({0, 43}, {WW_OTHER_TABS, 214}, WindowWidgetType::Resize, WindowColour::Secondary), TAB_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget _windowFinancesProfitWidgets[] = @@ -124,7 +124,7 @@ static rct_widget _windowFinancesProfitWidgets[] = WINDOW_SHIM(STR_PROFIT_GRAPH, WW_OTHER_TABS, WH_OTHER_TABS), MakeWidget({0, 43}, {WW_OTHER_TABS, 214}, WindowWidgetType::Resize, WindowColour::Secondary), TAB_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget _windowFinancesMarketingWidgets[] = @@ -140,7 +140,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget _windowFinancesResearchWidgets[] = @@ -159,7 +159,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget *_windowFinancesPageWidgets[] = diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index d8f5ba97ef..fec970f248 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -106,7 +106,7 @@ static rct_widget window_footpath_widgets[] = { MakeWidget({ 3, 321}, {100, 54}, WindowWidgetType::Groupbox, WindowColour::Primary ), MakeWidget({13, 332}, { 36, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_CONSTRUCTION_FOOTPATH_LAND, STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP ), MakeWidget({57, 332}, { 36, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_CONSTRUCTION_FOOTPATH_BRIDGE, STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP ), - {WIDGETS_END}, + WIDGETS_END, }; static void window_footpath_close(rct_window * w); diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 06b6aa9275..08cad14dd6 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -62,7 +62,7 @@ static rct_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 }, + WIDGETS_END, }; uint8_t gToolbarDirtyFlags; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index c956f3556c..3f198ca9d6 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -95,38 +95,38 @@ static rct_widget window_guest_overview_widgets[] = { MakeWidget({167, 69}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_RENAME, STR_NAME_GUEST_TIP ), // Rename Button MakeWidget({167, 93}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_LOCATE, STR_LOCATE_SUBJECT_TIP ), // Locate Button MakeWidget({167, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_TRACK_PEEP, STR_TOGGLE_GUEST_TRACKING_TIP), // Track Button - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_stats_widgets[] = { MAIN_GUEST_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_rides_widgets[] = { MAIN_GUEST_WIDGETS, MakeWidget({3, 57}, {186, 87}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_finance_widgets[] = { MAIN_GUEST_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_thoughts_widgets[] = { MAIN_GUEST_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_inventory_widgets[] = { MAIN_GUEST_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_guest_debug_widgets[] = { MAIN_GUEST_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; // 0x981D0C diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index a276b5fad3..9909718c7a 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -60,7 +60,7 @@ static rct_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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index bdf2613455..2163010e98 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -48,7 +48,7 @@ static rct_widget window_install_track_widgets[] = { MakeWidget({PREVIEW_BUTTONS_LEFT, 398}, { 22, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, 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 }, + WIDGETS_END, }; static void window_install_track_close(rct_window *w); diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 70922089fc..f1147c4629 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -47,7 +47,7 @@ static rct_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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 4a2d99326b..9ed75e4f1a 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -43,7 +43,7 @@ static rct_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 }, + WIDGETS_END, }; static void window_land_rights_close(rct_window *w); diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 2da04b1186..4ec600b212 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -73,7 +73,7 @@ static rct_widget window_loadsave_widgets[] = MakeWidget({(WW - 5) / 2 + 1, 55}, {170, 14}, WindowWidgetType::TableHeader, WindowColour::Primary ), // Date MakeWidget({ 4, 68}, {342, 303}, WindowWidgetType::Scroll, WindowColour::Primary , SCROLL_VERTICAL ), // File list MakeWidget({ 4, WH - 24}, {197, 19}, WindowWidgetType::Button, WindowColour::Primary , STR_FILEBROWSER_USE_SYSTEM_WINDOW ), // Use native browser - { WIDGETS_END } + WIDGETS_END, }; #pragma endregion @@ -1142,7 +1142,7 @@ static rct_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 } + WIDGETS_END, }; static void window_overwrite_prompt_mouseup(rct_window* w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index ed7bab0503..30e6fe8c8a 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -17,7 +17,7 @@ // clang-format off static rct_widget window_main_widgets[] = { MakeWidget({0, 0}, {0, 0}, WindowWidgetType::Viewport, WindowColour::Primary, STR_VIEWPORT), - { WIDGETS_END }, + WIDGETS_END, }; void window_main_paint(rct_window *w, rct_drawpixelinfo *dpi); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index a13f3f3bb9..f0a7d65b61 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -117,7 +117,7 @@ static rct_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, 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 }, + WIDGETS_END, }; // 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 dce4f7304b..68cd87ec92 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -129,7 +129,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget RandomWidgets[] = { @@ -137,7 +137,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget SimplexWidgets[] = { @@ -154,7 +154,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget HeightmapWidgets[] = { @@ -167,7 +167,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget *PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 130bcdff8b..42025473a0 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -19,7 +19,7 @@ // clang-format off static rct_widget window_map_tooltip_widgets[] = { MakeWidget({0, 0}, {200, 30}, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END } + WIDGETS_END, }; static void window_map_tooltip_update(rct_window *w); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index e82f43edbc..2a5bff1041 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -78,7 +78,7 @@ static rct_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 } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index ed64397ffd..0705f3c7d4 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -69,7 +69,7 @@ enum WINDOW_MULTIPLAYER_WIDGET_IDX { static rct_widget window_multiplayer_information_widgets[] = { MAIN_MULTIPLAYER_WIDGETS, - { WIDGETS_END } + WIDGETS_END, }; static rct_widget window_multiplayer_players_widgets[] = { @@ -79,7 +79,7 @@ static rct_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 } + WIDGETS_END, }; static rct_widget window_multiplayer_groups_widgets[] = { @@ -92,7 +92,7 @@ static rct_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 } + WIDGETS_END, }; static rct_widget window_multiplayer_options_widgets[] = { @@ -100,7 +100,7 @@ static rct_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 } + WIDGETS_END, }; static rct_widget *window_multiplayer_page_widgets[] = { diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 984a9458bc..a8d1be0c4e 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -28,7 +28,7 @@ static rct_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 }, + WIDGETS_END, }; static char window_network_status_text[1024]; diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index b091ac7a4a..bcfe8e0f53 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -49,7 +49,7 @@ static rct_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 } + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index d35e4b6145..f7e14cc34b 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -204,7 +204,7 @@ static rct_widget window_new_ride_widgets[] = { MakeWidget({ 3, 124}, {290, 65}, WindowWidgetType::Groupbox, WindowColour::Tertiary , STR_LAST_DEVELOPMENT ), MakeWidget({265, 161}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary , 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP ), MakeWidget({265, 68}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary , SPR_FINANCE, STR_FINANCES_RESEARCH_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index fe03f1c266..290557a448 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -38,7 +38,7 @@ static rct_widget window_news_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({372, 18}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, SPR_TAB_GEARS_0), // settings MakeWidget({ 4, 44}, {392, 252}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_VERTICAL), // scroll - { WIDGETS_END }, + WIDGETS_END, }; class NewsWindow final : public Window diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 5c0cc4c564..3473c720be 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -80,7 +80,7 @@ static rct_widget window_news_options_widgets[] = { 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 }, + WIDGETS_END, }; static void window_news_options_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index cf7f56037a..1e58bdd72b 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -282,7 +282,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_string_id get_object_type_string(ObjectType type); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index a328ed206f..58ddd2034b 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -226,7 +226,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget window_options_rendering_widgets[] = { @@ -250,7 +250,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget window_options_culture_widgets[] = { @@ -267,7 +267,7 @@ static rct_widget window_options_culture_widgets[] = { MakeWidget({288, 114}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_HEIGHT_LABELS_UNITS_TIP), MakeWidget({155, 128}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Date format MakeWidget({288, 129}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DATE_FORMAT_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_options_audio_widgets[] = { @@ -284,7 +284,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget window_options_controls_and_interface_widgets[] = { @@ -312,7 +312,7 @@ static rct_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 }, + WIDGETS_END, #undef TOOLBAR_GROUP_START }; @@ -343,7 +343,7 @@ static rct_widget window_options_misc_widgets[] = { 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 #undef TWEAKS_START - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_options_advanced_widgets[] = { @@ -359,7 +359,7 @@ static rct_widget window_options_advanced_widgets[] = { MakeWidget ({ 23, 169}, {276, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_PATH_TO_RCT1, STR_PATH_TO_RCT1_TIP ), // RCT 1 path text 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 - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_options_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 9f3bf92f0d..bfbc5ad5db 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -99,40 +99,40 @@ static rct_widget window_park_entrance_widgets[] = { MakeWidget({205, 121}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_RENAME, STR_NAME_PARK_TIP ), // rename MakeWidget({210, 51}, { 14, 15}, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_RCT1_CLOSE_BUTTON_0, STR_CLOSE_PARK_TIP ), MakeWidget({210, 66}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_RCT1_OPEN_BUTTON_0, STR_OPEN_PARK_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_park_rating_widgets[] = { MAIN_PARK_WIDGETS(255), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_park_guests_widgets[] = { MAIN_PARK_WIDGETS(255), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_park_price_widgets[] = { 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 }, + WIDGETS_END, }; static rct_widget window_park_stats_widgets[] = { MAIN_PARK_WIDGETS(230), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_park_objective_widgets[] = { MAIN_PARK_WIDGETS(230), MakeWidget({7, 207}, {216, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_ENTER_NAME_INTO_SCENARIO_CHART), // enter name - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_park_awards_widgets[] = { MAIN_PARK_WIDGETS(230), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_park_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 9a6c6352de..35001e9efc 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -63,12 +63,12 @@ static rct_widget window_player_overview_widgets[] = { MakeWidget({179, 45}, { 12, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_LOCATE, STR_LOCATE_PLAYER_TIP), // Locate button MakeWidget({179, 69}, { 12, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_KICK_PLAYER_TIP ), // Kick button MakeWidget({ 3, 60}, {175, 61}, WindowWidgetType::Viewport, WindowColour::Secondary ), // Viewport - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget window_player_statistics_widgets[] = { WINDOW_PLAYER_COMMON_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_player_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 54ab4c7b2e..0d881d6d57 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -68,7 +68,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget window_research_funding_widgets[] = { @@ -87,7 +87,7 @@ static rct_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 }, + WIDGETS_END, }; static rct_widget *window_research_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 51d7d275d0..f9b5ae7485 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -246,7 +246,7 @@ static rct_widget window_ride_main_widgets[] = { MakeWidget({296, 76}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, 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 }, + WIDGETS_END, }; // 0x009ADDA8 @@ -257,7 +257,7 @@ static rct_widget window_ride_vehicle_widgets[] = { MakeWidget ({ 7, 147}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), MakeSpinnerWidgets({ 7, 196}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_RIDE_VEHICLE_COUNT, STR_MAX_VEHICLES_TIP ), MakeSpinnerWidgets({164, 196}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_1_CAR_PER_TRAIN, STR_MAX_CARS_PER_TRAIN_TIP), - { WIDGETS_END }, + WIDGETS_END, }; // 0x009ADEFC @@ -280,7 +280,7 @@ static rct_widget window_ride_operating_widgets[] = { 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 }, + WIDGETS_END, }; // 0x009AE190 @@ -291,7 +291,7 @@ static rct_widget window_ride_maintenance_widgets[] = { 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, SPR_CONSTRUCTION, STR_REFURBISH_RIDE_TIP ), MakeWidget({241, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_NO_ENTRY, STR_DEBUG_FORCE_BREAKDOWN_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; // 0x009AE2A4 @@ -317,7 +317,7 @@ static rct_widget window_ride_colour_widgets[] = { MakeWidget({ 79, 190}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_MAIN_COLOUR_TIP ), 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 ), - { WIDGETS_END }, + WIDGETS_END, }; // 0x009AE4C8 @@ -326,7 +326,7 @@ static rct_widget window_ride_music_widgets[] = { MakeWidget({ 7, 47}, {302, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_PLAY_MUSIC, STR_SELECT_MUSIC_TIP ), MakeWidget({ 7, 62}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY ), MakeWidget({297, 63}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_MUSIC_STYLE_TIP), - { WIDGETS_END }, + WIDGETS_END, }; // 0x009AE5DC @@ -337,7 +337,7 @@ static rct_widget window_ride_measurements_widgets[] = { 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 }, + WIDGETS_END, }; // 0x009AE710 @@ -348,7 +348,7 @@ static rct_widget window_ride_graphs_widgets[] = { 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 }, + WIDGETS_END, }; // 0x009AE844 @@ -360,7 +360,7 @@ static rct_widget window_ride_income_widgets[] = { 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 }, + WIDGETS_END, }; // 0x009AE9C8 @@ -369,7 +369,7 @@ static rct_widget window_ride_customer_widgets[] = { MakeWidget({289, 54}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 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, SPR_SHOW_GUESTS_ON_THIS_RIDE_ATTRACTION, STR_SHOW_GUESTS_ON_THIS_RIDE_ATTRACTION_TIP ), MakeWidget({289, 102}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_SHOW_GUESTS_QUEUING_FOR_THIS_RIDE_ATTRACTION, STR_SHOW_GUESTS_QUEUING_FOR_THIS_RIDE_ATTRACTION_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_ride_page_widgets[] = { diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 3044c96961..f23755bae5 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -132,7 +132,7 @@ static rct_widget window_ride_construction_widgets[] = { MakeWidget ({ 96, 120}, { 67, 41}, WindowWidgetType::Groupbox, WindowColour::Primary , STR_RIDE_CONSTRUCTION_SEAT_ROT ), MakeSpinnerWidgets({101, 138}, { 58, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, 0, STR_RIDE_CONSTRUCTION_SELECT_SEAT_ROTATION_ANGLE_TIP), MakeWidget ({139, 338}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SIMULATE, STR_SIMULATE_RIDE_TIP ), - { WIDGETS_END } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index de3ecf4b09..7cbfb545c3 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -69,7 +69,7 @@ static rct_widget window_ride_list_widgets[] = { MakeWidget({320, 62}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_RCT1_CLOSE_BUTTON_0 ), MakeWidget({320, 76}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_RCT1_OPEN_BUTTON_0 ), MakeWidget({315, 90}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_QUICK_DEMOLISH_RIDE ), - { WIDGETS_END }, + WIDGETS_END, }; static bool _quickDemolishMode = false; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 4c36ac67e6..d4e39769e7 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -42,7 +42,7 @@ static rct_widget window_save_prompt_widgets[] = { 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 }, + WIDGETS_END, }; enum WINDOW_QUIT_PROMPT_WIDGET_IDX { @@ -57,7 +57,7 @@ static rct_widget window_quit_prompt_widgets[] = { 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 }, + WIDGETS_END, }; static constexpr const rct_string_id window_save_prompt_labels[][2] = { diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 19f24afbf1..6bdd3285a0 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -86,7 +86,7 @@ static rct_widget window_scenarioselect_widgets[] = { MakeRemapWidget({594, 17}, { 91, 34}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB_LARGE), // tab 7 MakeRemapWidget({685, 17}, { 91, 34}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB_LARGE), // tab 8 MakeWidget ({ 3, 54}, { WW - SidebarWidth, 276 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // level list - { WIDGETS_END }, + WIDGETS_END, }; static constexpr const rct_string_id ScenarioOriginStringIds[] = { diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 1112dd9286..014cba9029 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -171,7 +171,7 @@ static rct_widget window_scenery_widgets[] = { MakeWidget ({615, 117}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_TERNARY_COLOUR ), // 20000000 0x009DE468 MakeWidget ({609, 130}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_EYEDROPPER, STR_SCENERY_EYEDROPPER_TIP ), // 40000000 0x009DE478 MakeWidget ({609, 154}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_SCENERY_CLUSTER, STR_SCENERY_CLUSTER_TIP ), // 40000000 0x009DE478 - { WIDGETS_END }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index b2f9ff10f5..ff4c6d6900 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -47,7 +47,7 @@ static rct_widget window_scenery_scatter_widgets[] = { 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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 0a8556219b..77ae121f0b 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -66,7 +66,7 @@ static rct_widget window_server_list_widgets[] = { 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 }, + WIDGETS_END, }; static void window_server_list_close(rct_window *w); diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 8bb70c9b73..cb7a57be58 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -62,7 +62,7 @@ static rct_widget window_server_start_widgets[] = { 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 }, + WIDGETS_END, }; static void window_server_start_close(rct_window *w); diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 6c5ad604f0..7739f5420b 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -42,7 +42,7 @@ static rct_widget window_shortcut_widgets[] = { MakeWidget({0, 43}, {350, 287}, WindowWidgetType::Resize, WindowColour::Secondary), MakeWidget({4, 47}, {412, 245}, 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 } + WIDGETS_END, }; // clang-format on @@ -59,7 +59,7 @@ enum static rct_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 } + WIDGETS_END, }; // clang-format on @@ -435,7 +435,7 @@ private: enabled_widgets |= (1ULL << (WIDX_TAB_0 + i)); } - _widgets.push_back({ WIDGETS_END }); + _widgets.push_back(WIDGETS_END); widgets = _widgets.data(); WindowInitScrollWidgets(this); diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index b111f95c9b..6ed249807b 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -49,7 +49,7 @@ static rct_widget window_sign_widgets[] = { MakeWidget({WW - 25, 67}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 8f9ea88b71..a64159e13b 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -86,7 +86,7 @@ static rct_widget window_staff_overview_widgets[] = { MakeWidget ({WW - 25, 93}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_RENAME, STR_NAME_STAFF_TIP ), // Rename Button MakeWidget ({WW - 25, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_LOCATE, STR_LOCATE_SUBJECT_TIP), // Locate Button MakeWidget ({WW - 25, 141}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_FIRE_STAFF_TIP ), // Fire Button - { WIDGETS_END }, + WIDGETS_END, }; //0x9AF910 @@ -98,13 +98,13 @@ static rct_widget window_staff_options_widgets[] = { 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 }, + WIDGETS_END, }; //0x9AF9F4 static rct_widget window_staff_stats_widgets[] = { MAIN_STAFF_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *window_staff_page_widgets[] = { diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 91f86d50e9..b7c434798d 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -34,7 +34,7 @@ static rct_widget window_staff_fire_widgets[] = { 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 } + WIDGETS_END, }; static void window_staff_fire_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index ef633b3bb2..ac007f0b9a 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -77,7 +77,7 @@ static rct_widget window_staff_list_widgets[] = { MakeWidget({243, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_QUICK_FIRE_STAFF ), // quick fire staff MakeWidget({267, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_PATROL_BTN, STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool MakeWidget({291, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_MAP, STR_SHOW_STAFF_ON_MAP_TIP ), // show staff on map button - { WIDGETS_END }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index da2c137154..7e52aeb1ac 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -34,7 +34,7 @@ static rct_widget window_text_input_widgets[] = { 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 } + WIDGETS_END, }; class TextInputWindow final : public Window diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index fed6d74985..6861f3c471 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -123,7 +123,7 @@ static rct_widget window_themes_widgets[] = { 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 }, + WIDGETS_END, }; static int32_t window_themes_tab_animation_loops[] = { diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 656940b942..09fbcbceb6 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -241,7 +241,7 @@ constexpr int32_t BUTTONH = 17; static rct_widget DefaultWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, - { WIDGETS_END }, + WIDGETS_END, }; // Group boxes .top and .bottom for a given window height offsets from the bottom @@ -259,7 +259,7 @@ static rct_widget SurfaceWidgets[] = { { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SUR_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_S { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - SUR_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SURFACE_CHECK_CORNER_W { WindowWidgetType::Checkbox, 1, GBBF(WH - SUR_GBPT, 0, 4), STR_TILE_INSPECTOR_SURFACE_DIAGONAL, STR_NONE }, // WIDX_SURFACE_CHECK_DIAGONAL - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t PAT_GBPB = PADDING_BOTTOM; // Path group box properties bottom @@ -279,7 +279,7 @@ static rct_widget PathWidgets[] = { { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - PAT_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_W { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - PAT_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_NW { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - PAT_GBPT, 2) + 7 * 0), STR_NONE, STR_NONE }, // WIDX_PATH_CHECK_EDGE_N - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t TRA_GBPB = PADDING_BOTTOM; // Track group box properties bottom @@ -293,7 +293,7 @@ static rct_widget TrackWidgets[] = { { WindowWidgetType::Checkbox, 1, GBBF(WH - TRA_GBPT, 0, 2), STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT, STR_NONE }, // WIDX_TRACK_CHECK_CHAIN_LIFT { WindowWidgetType::Checkbox, 1, GBBF(WH - TRA_GBPT, 0, 3), STR_TILE_INSPECTOR_TRACK_BLOCK_BRAKE, STR_NONE }, // WIDX_PATH_CHECK_BLOCK_BRAKE_CLOSED { WindowWidgetType::Checkbox, 1, GBBF(WH - TRA_GBPT, 0, 4), STR_TILE_INSPECTOR_TRACK_IS_INDESTRUCTIBLE, STR_NONE }, // WIDX_PATH_CHECK_IS_INDESTRUCTIBLE - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t SCE_GBPB = PADDING_BOTTOM; // Scenery group box properties bottom @@ -311,7 +311,7 @@ static rct_widget SceneryWidgets[] = { { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 2, GBBT(WH - SCE_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_E { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - SCE_GBPT, 2) + 7 * 2), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_S { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 0, GBBT(WH - SCE_GBPT, 2) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_SCENERY_CHECK_COLLISION_W - { WIDGETS_END }, + WIDGETS_END, }; @@ -323,7 +323,7 @@ static rct_widget EntranceWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - ENT_GBPT, 0) + 3, GBBB(WH - ENT_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE} { WindowWidgetType::Button, 1, GBB(WH - ENT_GBPT, 0, 1), STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE_TIP }, // WIDX_ENTRANCE_BUTTON_MAKE_USABLE - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t WALL_GBPB = PADDING_BOTTOM; // Wall group box properties bottom @@ -336,7 +336,7 @@ static rct_widget WallWidgets[] = { { WindowWidgetType::DropdownMenu, 1, GBD(WH - WALL_GBPT, 1, 1), STR_NONE, STR_NONE }, // WIDX_WALL_DROPDOWN_SLOPE { WindowWidgetType::Button, 1, GBDB(WH - WALL_GBPT, 1, 1), STR_DROPDOWN_GLYPH, STR_NONE }, // WIDX_WALL_DROPDOWN_SLOPE_BUTTON SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - WALL_GBPT, 2) + 3, GBBB(WH - WALL_GBPT, 2) - 3, STR_NONE, STR_NONE), // WIDX_WALL_SPINNER_ANIMATION_FRAME{,_INCREASE,_DECREASE} - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t LAR_GBPB = PADDING_BOTTOM; // Large scenery group box properties bottom @@ -346,7 +346,7 @@ constexpr int32_t LAR_GBDT = LAR_GBDB + 20 + 3 * 11; // Large scenery grou static rct_widget LargeSceneryWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - LAR_GBPT, 0) + 3, GBBB(WH - LAR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE} - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t BAN_GBPB = PADDING_BOTTOM; // Banner group box properties bottom @@ -361,7 +361,7 @@ static rct_widget BannerWidgets[] = { { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - BAN_GBPT, 1) + 7 * 3), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_SW { WindowWidgetType::Checkbox, 1, CHK(GBBL(1) + 14 * 1, GBBT(WH - BAN_GBPT, 1) + 7 * 1), STR_NONE, STR_NONE }, // WIDX_BANNER_CHECK_BLOCK_NW - { WIDGETS_END }, + WIDGETS_END, }; constexpr int32_t COR_GBPB = PADDING_BOTTOM; // Corrupt element group box properties bottom @@ -372,7 +372,7 @@ static rct_widget CorruptWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - COR_GBPT, 0) + 3, GBBB(WH - COR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_CORRUPT_SPINNER_HEIGHT{,_INCREASE,_DECREASE} { WindowWidgetType::Button, 1, GBB(WH - SUR_GBPT, 0, 1), STR_TILE_INSPECTOR_CLAMP_TO_NEXT, STR_TILE_INSPECTOR_CLAMP_TO_NEXT_TIP }, // WIDX_CORRUPT_BUTTON_CLAMP - { WIDGETS_END }, + WIDGETS_END, }; static rct_widget *PageWidgets[] = { diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index b02e3fc1a3..1e70e17288 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -106,7 +106,7 @@ static rct_widget window_title_command_editor_widgets[] = { MakeWidget({ 10, 99}, { 71, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_OK ), // OKAY MakeWidget({120, 99}, { 71, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL ), // Cancel - { WIDGETS_END }, + WIDGETS_END, }; static void window_title_command_editor_close(rct_window * w); diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index 0c5c782975..bca3f5f4db 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -171,7 +171,7 @@ static rct_widget window_title_editor_widgets[] = { MakeWidget ({ 26, 238}, PLAYBACK_BTN, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_TITLE_STOP, STR_TITLE_EDITOR_ACTION_STOP_TIP ), // Stop MakeWidget ({ 44, 238}, PLAYBACK_BTN, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_TITLE_PLAY, STR_TITLE_EDITOR_ACTION_PLAY_TIP ), // Play MakeWidget ({ 62, 238}, PLAYBACK_BTN, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_TITLE_SKIP, STR_TITLE_EDITOR_ACTION_SKIP_TIP ), // Skip - { WIDGETS_END }, + WIDGETS_END, }; static size_t _selectedTitleSequence = SIZE_MAX; diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 8f24b28130..0f736b6c3a 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -22,7 +22,7 @@ enum WINDOW_TITLE_EXIT_WIDGET_IDX { static rct_widget window_title_exit_widgets[] = { MakeWidget({0, 0}, {40, 64}, WindowWidgetType::ImgBtn, WindowColour::Tertiary, SPR_MENU_EXIT, STR_EXIT), - { WIDGETS_END }, + WIDGETS_END, }; static void window_title_exit_paint(rct_window *w, rct_drawpixelinfo *dpi); diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 1986efed15..d54d759c82 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -24,7 +24,7 @@ enum static rct_widget window_title_logo_widgets[] = { MakeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END }, + WIDGETS_END, }; static void window_title_menu_mouseup(rct_window* w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 11bfcd8cfd..a9e98a8107 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -41,7 +41,7 @@ static rct_widget window_title_menu_widgets[] = { MakeWidget({0, UpdateButtonDims.height}, MenuButtonDims, WindowWidgetType::ImgBtn, WindowColour::Tertiary, SPR_G2_MENU_MULTIPLAYER, STR_SHOW_MULTIPLAYER_TIP), MakeWidget({0, UpdateButtonDims.height}, MenuButtonDims, WindowWidgetType::ImgBtn, WindowColour::Tertiary, SPR_MENU_TOOLBOX, STR_GAME_TOOLS_TIP), MakeWidget({0, 0}, UpdateButtonDims, WindowWidgetType::Empty, WindowColour::Secondary, STR_UPDATE_AVAILABLE), - { WIDGETS_END }, + WIDGETS_END, }; static void window_title_menu_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 7041328100..2d401becaa 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -21,7 +21,7 @@ enum WINDOW_TITLE_OPTIONS_WIDGET_IDX { static rct_widget window_title_options_widgets[] = { MakeWidget({0, 0}, {80, 15}, WindowWidgetType::Button, WindowColour::Tertiary, STR_OPTIONS, STR_OPTIONS_TIP), - { WIDGETS_END }, + WIDGETS_END, }; static void window_title_options_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index f388ba217a..3372b4f0ea 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -22,7 +22,7 @@ enum { static rct_widget window_tooltip_widgets[] = { MakeWidget({0, 0}, {200, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary), - { WIDGETS_END }, + WIDGETS_END, }; static void window_tooltip_update(rct_window *w); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index a7f7660dfa..eb694a4a76 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -263,7 +263,7 @@ static rct_widget window_top_toolbar_widgets[] = { 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 }, + WIDGETS_END, }; static void window_top_toolbar_mouseup(rct_window *w, rct_widgetindex widgetIndex); diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 14696ba31d..4cb72f6932 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -40,14 +40,14 @@ static rct_widget window_track_manage_widgets[] = { 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 } + WIDGETS_END, }; static rct_widget window_track_delete_prompt_widgets[] = { 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 } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 9cc6a33cc7..44397b4ceb 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -67,7 +67,7 @@ static rct_widget window_track_place_widgets[] = { MakeWidget({173, 59}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, 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 }, + WIDGETS_END, }; static void window_track_place_close(rct_window *w); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index a1feeb4218..03045137d2 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -57,7 +57,7 @@ static rct_widget window_track_list_widgets[] = { 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 , SPR_ROTATE_ARROW, STR_ROTATE_90_TIP ), MakeWidget({572, 381}, { ROTATE_AND_SCENERY_BUTTON_SIZE, ROTATE_AND_SCENERY_BUTTON_SIZE}, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_SCENERY, STR_TOGGLE_SCENERY_TIP ), - { WIDGETS_END }, + WIDGETS_END, }; static void window_track_list_close(rct_window *w); diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 922b51d1b2..59a42072c4 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -59,7 +59,7 @@ static rct_widget window_view_clipping_widgets[] = { 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 } + WIDGETS_END, }; #pragma endregion diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 66ee0f3a33..a78d2f8b7a 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -47,7 +47,7 @@ static rct_widget window_viewport_widgets[] = MakeWidget({WW - 25, 17}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_IN, STR_ZOOM_IN_TIP ), // zoom in MakeWidget({WW - 25, 41}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_G2_ZOOM_OUT, STR_ZOOM_OUT_TIP ), // zoom out MakeWidget({WW - 25, 65}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , SPR_LOCATE, STR_LOCATE_SUBJECT_TIP), // locate - { WIDGETS_END }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 96b27f8e5a..c186ddd977 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -35,7 +35,7 @@ static rct_widget window_water_widgets[] = { MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , 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 }, + WIDGETS_END, }; // clang-format on diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index c7ec7a485a..b7c4510784 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -40,7 +40,7 @@ enum class WindowWidgetType : uint8_t Last = 26, }; -#define WIDGETS_END WindowWidgetType::Last, 0, 0, 0, 0, 0, 0, 0 +constexpr const auto WIDGETS_END = rct_widget{ WindowWidgetType::Last, 0, 0, 0, 0, 0, 0, 0 }; #define BAR_BLINK (1u << 31) #define SPINNER_INCREASE(l, r, t, b) (r) - 12, (r)-1, (t) + 1, (b)-1 From f7d61c67e6bd84ba42cb289259b1bfd53abbc4be Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 26 Sep 2021 16:21:34 +0200 Subject: [PATCH 443/681] Fix arbitrary ride type cheat not working --- src/openrct2/actions/RideSetSettingAction.cpp | 1 + src/openrct2/ride/Ride.cpp | 26 +++++++++++++++++++ src/openrct2/ride/Ride.h | 5 ++++ 3 files changed, 32 insertions(+) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 37a4e6a572..64df3d3c0d 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -223,6 +223,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const break; case RideSetSetting::RideType: ride->type = _value; + ride->UpdateRideTypeForAllPieces(); gfx_invalidate_screen(); break; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 7465c4ff6e..63eaebdb7f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5734,3 +5734,29 @@ void Ride::IncreaseNumShelteredSections() num_sheltered_sections &= ~ShelteredSectionsBits::NumShelteredSectionsMask; num_sheltered_sections |= newNumShelteredSections; } + +void Ride::UpdateRideTypeForAllPieces() +{ + for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + { + for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + { + auto* tileElement = map_get_first_element_at(TileCoordsXY(x, y)); + if (tileElement == nullptr) + continue; + + do + { + if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) + continue; + + auto* trackElement = tileElement->AsTrack(); + if (trackElement->GetRideIndex() != id) + continue; + + trackElement->SetRideType(type); + + } while (!(tileElement++)->IsLastForTile()); + } + } +} diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 6fa62d0c2e..b278ce19f8 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -468,6 +468,11 @@ public: void IncreaseNumShelteredSections(); void RemoveVehicles(); + /** + * Updates all pieces of the ride to match the internal ride type. (Track pieces can have different ride types from the ride + * they belong to, to enable “merging”.) + */ + void UpdateRideTypeForAllPieces(); }; #pragma pack(push, 1) From e88f96a15c95204d08a79892a67a4826945ac4b7 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 26 Sep 2021 19:55:16 +0200 Subject: [PATCH 444/681] Move StaticLayout out of header file --- src/openrct2/drawing/Text.cpp | 93 ++++++++++++++++++++--------------- src/openrct2/drawing/Text.h | 20 -------- 2 files changed, 52 insertions(+), 61 deletions(-) diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 8782f5c85b..3246d772cb 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -18,56 +18,67 @@ static void DrawText( static void DrawText( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, rct_string_id format, const void* args); -StaticLayout::StaticLayout(utf8string source, const TextPaint& paint, int32_t width) +class StaticLayout { - Buffer = source; - Paint = paint; +private: + utf8string Buffer; + TextPaint Paint; + int32_t LineCount = 0; + int32_t LineHeight; + int32_t MaxWidth; - MaxWidth = gfx_wrap_string(Buffer, width, paint.SpriteBase, &LineCount); - LineCount += 1; - LineHeight = font_get_line_height(paint.SpriteBase); -} - -void StaticLayout::Draw(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords) -{ - TextPaint tempPaint = Paint; - - auto lineCoords = coords; - switch (Paint.Alignment) +public: + StaticLayout(utf8string source, const TextPaint& paint, int32_t width) { - case TextAlignment::LEFT: - break; - case TextAlignment::CENTRE: - lineCoords.x += MaxWidth / 2; - break; - case TextAlignment::RIGHT: - lineCoords.x += MaxWidth; - break; + Buffer = source; + Paint = paint; + + MaxWidth = gfx_wrap_string(Buffer, width, paint.SpriteBase, &LineCount); + LineCount += 1; + LineHeight = font_get_line_height(paint.SpriteBase); } - utf8* buffer = Buffer; - for (int32_t line = 0; line < LineCount; ++line) + + void Draw(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords) { - DrawText(dpi, lineCoords, tempPaint, buffer); - tempPaint.Colour = TEXT_COLOUR_254; - buffer = get_string_end(buffer) + 1; - lineCoords.y += LineHeight; + TextPaint tempPaint = Paint; + + auto lineCoords = coords; + switch (Paint.Alignment) + { + case TextAlignment::LEFT: + break; + case TextAlignment::CENTRE: + lineCoords.x += MaxWidth / 2; + break; + case TextAlignment::RIGHT: + lineCoords.x += MaxWidth; + break; + } + utf8* buffer = Buffer; + for (int32_t line = 0; line < LineCount; ++line) + { + DrawText(dpi, lineCoords, tempPaint, buffer); + tempPaint.Colour = TEXT_COLOUR_254; + buffer = get_string_end(buffer) + 1; + lineCoords.y += LineHeight; + } } -} -int32_t StaticLayout::GetHeight() -{ - return LineHeight * LineCount; -} + int32_t GetHeight() const + { + return LineHeight * LineCount; + } -int32_t StaticLayout::GetWidth() -{ - return MaxWidth; -} + int32_t GetWidth() const + { + return MaxWidth; + } -int32_t StaticLayout::GetLineCount() -{ - return LineCount; -} + int32_t GetLineCount() const + { + return LineCount; + } +}; static void DrawText( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting) diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index 87f3c63cfd..40261dabb8 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -124,26 +124,6 @@ struct TextPaint } }; -class StaticLayout -{ -private: - utf8string Buffer; - TextPaint Paint; - int32_t LineCount = 0; - int32_t LineHeight; - int32_t MaxWidth; - - StaticLayout(); - StaticLayout(const StaticLayout&); - -public: - StaticLayout(utf8string source, const TextPaint& paint, int32_t width); - void Draw(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords); - int32_t GetHeight(); - int32_t GetWidth(); - int32_t GetLineCount(); -}; - void DrawTextBasic( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, rct_string_id format, const Formatter& ft = {}, TextPaint textPaint = {}); From c234abfbb8aff6360504be89cd8721133866c758 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 27 Sep 2021 15:03:25 +0200 Subject: [PATCH 445/681] Fix #15213: Freeze when reading a partially cut unicode character --- src/openrct2/drawing/Text.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 3246d772cb..af6ad01080 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -157,10 +157,9 @@ int32_t DrawTextWrapped( { const void* args = ft.Data(); - utf8 buffer[512]; - format_string(buffer, sizeof(buffer), format, args); - - StaticLayout layout(buffer, textPaint, width); + // TODO: Refactor StaticLayout to take a std::string_view instead. It shouldn't have to write to the buffer. + const std::string buffer = format_string(format, args); + StaticLayout layout(const_cast(buffer.c_str()), textPaint, width); if (textPaint.Alignment == TextAlignment::CENTRE) { From 219a4efa0f56dadbd2b124a118d5ee8adf743f62 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 27 Sep 2021 15:09:08 +0200 Subject: [PATCH 446/681] Add changelog entry --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 160dcffa53..73c06bd2a6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15199] Construction window is not closed when a ride gets demolished. +- Fix: [#15213] Freeze when hovering over Reverse Freefall Coaster in Russian. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. From cecf4ac2024448784a5f5142a513768ab4562c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:29:12 +0300 Subject: [PATCH 447/681] Use CoordsXY for sprite_paint_setup Co-authored-by: Ted John --- src/openrct2/paint/sprite/Paint.Sprite.cpp | 9 ++------- src/openrct2/paint/sprite/Paint.Sprite.h | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 8d15249dac..83863d4c0a 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -32,13 +32,8 @@ * Paint Quadrant * rct2: 0x0069E8B0 */ -void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t y) +void sprite_paint_setup(paint_session* session, const CoordsXY& pos) { - if ((x & 0xe000) | (y & 0xe000)) - { - return; - } - if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) { return; @@ -52,7 +47,7 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t const bool highlightPathIssues = (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES); - for (const auto* spr : EntityTileList({ x, y })) + for (const auto* spr : EntityTileList(pos)) { if (highlightPathIssues) { diff --git a/src/openrct2/paint/sprite/Paint.Sprite.h b/src/openrct2/paint/sprite/Paint.Sprite.h index 12e843a157..68a1d4e8e5 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.h +++ b/src/openrct2/paint/sprite/Paint.Sprite.h @@ -12,8 +12,9 @@ #include "../../common.h" struct paint_session; +struct CoordsXY; -void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t y); +void sprite_paint_setup(paint_session* session, const CoordsXY& pos); template void PaintEntity(paint_session* session, const T* entity, int32_t imageDirection); From 4ea89025879e8b9922d6308c51edb84ce940fa72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:48:06 +0300 Subject: [PATCH 448/681] Refactor arg passing to sprite_paint_setup --- src/openrct2/paint/Paint.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index aab007274d..be5c3420da 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -218,17 +218,17 @@ template void PaintSessionGenerateRotate(paint_session* sessi for (; numVerticalTiles > 0; --numVerticalTiles) { tile_element_paint_setup(session, mapTile); - sprite_paint_setup(session, mapTile.x, mapTile.y); + sprite_paint_setup(session, mapTile); - auto loc1 = mapTile + adjacentTiles[0]; - sprite_paint_setup(session, loc1.x, loc1.y); + const auto loc1 = mapTile + adjacentTiles[0]; + sprite_paint_setup(session, loc1); - auto loc2 = mapTile + adjacentTiles[1]; + const auto loc2 = mapTile + adjacentTiles[1]; tile_element_paint_setup(session, loc2); - sprite_paint_setup(session, loc2.x, loc2.y); + sprite_paint_setup(session, loc2); - auto loc3 = mapTile + adjacentTiles[2]; - sprite_paint_setup(session, loc3.x, loc3.y); + const auto loc3 = mapTile + adjacentTiles[2]; + sprite_paint_setup(session, loc3); mapTile += nextVerticalTile; } From 50118ae0399265f9f2a4e052f246ef4d607007c2 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 27 Sep 2021 21:54:41 +0100 Subject: [PATCH 449/681] Move function for NSF use --- src/openrct2/object/Object.cpp | 19 ------------------- src/openrct2/object/Object.h | 2 -- src/openrct2/object/SceneryGroupObject.cpp | 21 ++++++++++++++++++++- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 927e92ca5b..fcf5477b67 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -217,25 +217,6 @@ void Object::SetAuthors(std::vector&& authors) _authors = std::move(authors); } -std::optional rct_object_entry::GetSceneryType() const -{ - switch (GetType()) - { - case ObjectType::SmallScenery: - return SCENERY_TYPE_SMALL; - case ObjectType::LargeScenery: - return SCENERY_TYPE_LARGE; - case ObjectType::Walls: - return SCENERY_TYPE_WALL; - case ObjectType::Banners: - return SCENERY_TYPE_BANNER; - case ObjectType::PathBits: - return SCENERY_TYPE_PATH_ITEM; - default: - return std::nullopt; - } -} - bool rct_object_entry::IsEmpty() const { uint64_t a, b; diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index db6dbb858d..666ae1555d 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -119,8 +119,6 @@ struct rct_object_entry flags |= (static_cast(newType) & 0x0F); } - std::optional GetSceneryType() const; - ObjectSourceGame GetSourceGame() const { return static_cast((flags & 0xF0) >> 4); diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 88bf42acbc..7c026dfcdc 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -66,6 +66,25 @@ void SceneryGroupObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3 gfx_draw_sprite(dpi, imageId, screenCoords - ScreenCoordsXY{ 15, 14 }, 0); } +static std::optional GetSceneryType(const ObjectType type) +{ + switch (type) + { + case ObjectType::SmallScenery: + return SCENERY_TYPE_SMALL; + case ObjectType::LargeScenery: + return SCENERY_TYPE_LARGE; + case ObjectType::Walls: + return SCENERY_TYPE_WALL; + case ObjectType::Banners: + return SCENERY_TYPE_BANNER; + case ObjectType::PathBits: + return SCENERY_TYPE_PATH_ITEM; + default: + return std::nullopt; + } +} + void SceneryGroupObject::UpdateEntryIndexes() { auto context = GetContext(); @@ -84,7 +103,7 @@ void SceneryGroupObject::UpdateEntryIndexes() auto entryIndex = objectManager.GetLoadedObjectEntryIndex(ori->LoadedObject.get()); Guard::Assert(entryIndex != OBJECT_ENTRY_INDEX_NULL, GUARD_LINE); - auto sceneryType = ori->ObjectEntry.GetSceneryType(); + auto sceneryType = GetSceneryType(ori->Type); if (sceneryType.has_value()) { _legacyType.scenery_entries[_legacyType.entry_count] = { sceneryType.value(), entryIndex }; From 185cfdea0fa8e42681c12b36c6f233de502156a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 27 Sep 2021 23:05:48 +0300 Subject: [PATCH 450/681] Refactor GetSpatialIndexOffset and fix overflow --- src/openrct2/world/Sprite.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index aefecb5ee3..b3363565e2 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -48,21 +48,18 @@ static void FreeEntity(EntityBase& entity); constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) { - size_t index = SPATIAL_INDEX_LOCATION_NULL; - if (x != LOCATION_NULL) - { - x = std::clamp(x, 0, 0xFFFF); - y = std::clamp(y, 0, 0xFFFF); + if (x == LOCATION_NULL) + return SPATIAL_INDEX_LOCATION_NULL; - int16_t flooredX = floor2(x, 32); - uint8_t tileY = y >> 5; - index = (flooredX << 3) | tileY; - } + const auto tileX = std::clamp(x / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); + const auto tileY = std::clamp(y / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); + const auto index = tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; if (index >= sizeof(gSpriteSpatialIndex)) { return SPATIAL_INDEX_LOCATION_NULL; } + return index; } From 274bc039af96d7ecafddc7f0d8a3bbaa69d6a258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 28 Sep 2021 01:24:51 +0300 Subject: [PATCH 451/681] Fix out of bounds access --- src/openrct2/world/Sprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index b3363565e2..2af9e1e6fe 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -55,7 +55,7 @@ constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) const auto tileY = std::clamp(y / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); const auto index = tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; - if (index >= sizeof(gSpriteSpatialIndex)) + if (index >= std::size(gSpriteSpatialIndex)) { return SPATIAL_INDEX_LOCATION_NULL; } From eb2de0222b74a6abc3093feee77d9798d77dc7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 28 Sep 2021 03:16:04 +0300 Subject: [PATCH 452/681] Use GetLocation in more places --- src/openrct2/Game.cpp | 2 +- src/openrct2/actions/GuestSetNameAction.cpp | 5 +- src/openrct2/actions/PeepPickupAction.cpp | 8 +- src/openrct2/actions/StaffHireNewAction.cpp | 15 +-- .../actions/StaffSetCostumeAction.cpp | 5 +- src/openrct2/actions/StaffSetNameAction.cpp | 5 +- src/openrct2/actions/StaffSetOrdersAction.cpp | 5 +- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/management/NewsItem.cpp | 6 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 17 ++-- src/openrct2/paint/sprite/Paint.Sprite.cpp | 12 ++- src/openrct2/peep/Guest.cpp | 36 ++++---- src/openrct2/peep/Peep.cpp | 5 +- src/openrct2/peep/Staff.cpp | 4 +- src/openrct2/ride/CableLift.cpp | 4 +- src/openrct2/ride/Vehicle.cpp | 92 ++++++++++--------- src/openrct2/world/EntityTweener.cpp | 8 +- src/openrct2/world/Sprite.cpp | 4 +- test/tests/Pathfinding.cpp | 2 +- 19 files changed, 115 insertions(+), 122 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 50c8afb43f..5379cfc28e 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -593,7 +593,7 @@ void reset_all_sprite_quadrant_placements() auto* spr = GetEntity(i); if (spr != nullptr && spr->Type != EntityType::Null) { - spr->MoveTo({ spr->x, spr->y, spr->z }); + spr->MoveTo(spr->GetLocation()); } } } diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 8142c97462..aee4dd9298 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -100,8 +100,7 @@ GameActions::Result::Ptr GuestSetNameAction::Execute() const context_broadcast_intent(&intent); auto res = std::make_unique(); - res->Position.x = guest->x; - res->Position.y = guest->y; - res->Position.z = guest->z; + res->Position = guest->GetLocation(); + return res; } diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index ef29ca21e8..750c886891 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -61,7 +61,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const { case PeepPickupType::Pickup: { - res->Position = { peep->x, peep->y, peep->z }; + res->Position = peep->GetLocation(); if (!peep->CanBePickedUp()) { return MakeResult(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE); @@ -83,7 +83,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const } break; case PeepPickupType::Cancel: - res->Position = { peep->x, peep->y, peep->z }; + res->Position = peep->GetLocation(); break; case PeepPickupType::Place: res->Position = _loc; @@ -119,7 +119,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const { case PeepPickupType::Pickup: { - res->Position = { peep->x, peep->y, peep->z }; + res->Position = peep->GetLocation(); Peep* existing = network_get_pickup_peep(_owner); if (existing != nullptr) @@ -148,7 +148,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const break; case PeepPickupType::Cancel: { - res->Position = { peep->x, peep->y, peep->z }; + res->Position = peep->GetLocation(); Peep* const pickedUpPeep = network_get_pickup_peep(_owner); if (pickedUpPeep != nullptr) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index e2ca9cd4b7..cbca98459b 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -203,7 +203,8 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const // NOTE: This state is required for the window to act. newPeep->State = PeepState::Picked; - newPeep->MoveTo({ newPeep->x, newPeep->y, newPeep->z }); + // INVESTIGATE: x and y are LOCATION_NULL at this point. + newPeep->MoveTo(newPeep->GetLocation()); } // Staff uses this @@ -285,17 +286,13 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const if (chosenGuest != nullptr) { - newLocation.x = chosenGuest->x; - newLocation.y = chosenGuest->y; - newLocation.z = chosenGuest->z; + newLocation = chosenGuest->GetLocation(); } else { // User must pick a location newPeep->State = PeepState::Picked; - newLocation.x = newPeep->x; - newLocation.y = newPeep->y; - newLocation.z = newPeep->z; + newLocation = newPeep->GetLocation(); } } else @@ -315,9 +312,7 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const { // User must pick a location newPeep->State = PeepState::Picked; - newLocation.x = newPeep->x; - newLocation.y = newPeep->y; - newLocation.z = newPeep->z; + newLocation = newPeep->GetLocation(); } } diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 6f475563b5..fff8813b11 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -102,8 +102,7 @@ GameActions::Result::Ptr StaffSetCostumeAction::Execute() const context_broadcast_intent(&intent); auto res = std::make_unique(); - res->Position.x = staff->x; - res->Position.y = staff->y; - res->Position.z = staff->z; + res->Position = staff->GetLocation(); + return res; } diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index aa1b2feb92..eebfbd7715 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -85,8 +85,7 @@ GameActions::Result::Ptr StaffSetNameAction::Execute() const context_broadcast_intent(&intent); auto res = std::make_unique(); - res->Position.x = staff->x; - res->Position.y = staff->y; - res->Position.z = staff->z; + res->Position = staff->GetLocation(); + return res; } diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 8ab821aa96..6c6bcf9e9f 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -68,8 +68,7 @@ GameActions::Result::Ptr StaffSetOrdersAction::Execute() const context_broadcast_intent(&intent); auto res = std::make_unique(); - res->Position.x = staff->x; - res->Position.y = staff->y; - res->Position.z = staff->z; + res->Position = staff->GetLocation(); + return res; } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index a3d53b70d7..0d74381859 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -668,7 +668,7 @@ void viewport_update_sprite_follow(rct_window* window) viewport_set_underground_flag(underground, window, window->viewport); - auto centreLoc = centre_2d_coordinates({ sprite->x, sprite->y, sprite->z }, window->viewport); + auto centreLoc = centre_2d_coordinates(sprite->GetLocation(), window->viewport); if (centreLoc.has_value()) { window->savedViewPos = *centreLoc; diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 34e4172a5a..14c9654de2 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -224,7 +224,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s if (peep == nullptr) break; - subjectLoc = CoordsXYZ{ peep->x, peep->y, peep->z }; + subjectLoc = peep->GetLocation(); if (subjectLoc->x != LOCATION_NULL) break; @@ -251,7 +251,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s } if (sprite != nullptr) { - subjectLoc = CoordsXYZ{ sprite->x, sprite->y, sprite->z }; + subjectLoc = sprite->GetLocation(); } break; } @@ -260,7 +260,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s auto peep = TryGetEntity(subject); if (peep != nullptr) { - subjectLoc = CoordsXYZ{ peep->x, peep->y, peep->z }; + subjectLoc = peep->GetLocation(); } break; } diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 7083f70fd2..77d27a950f 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -25,31 +25,26 @@ template<> void PaintEntity(paint_session* session, const Peep* peep, int32_t im { if (peep->Is()) { - int16_t peep_x, peep_y, peep_z; - - peep_x = peep->x; - peep_y = peep->y; - peep_z = peep->z; - + auto loc = peep->GetLocation(); switch (peep->sprite_direction) { case 0: - peep_x -= 10; + loc.x -= 10; break; case 8: - peep_y += 10; + loc.y += 10; break; case 16: - peep_x += 10; + loc.x += 10; break; case 24: - peep_y -= 10; + loc.y -= 10; break; default: return; } - LightfxAdd3DLight(*peep, 0, { peep_x, peep_y, peep_z }, LightType::Spot1); + LightfxAdd3DLight(*peep, 0, loc, LightType::Spot1); } } #endif diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 83863d4c0a..26fd9afe96 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -65,21 +65,23 @@ void sprite_paint_setup(paint_session* session, const CoordsXY& pos) } } + const auto entityPos = spr->GetLocation(); + // Only paint sprites that are below the clip height and inside the clip selection. // Here converting from land/path/etc height scale to pixel height scale. // Note: peeps/scenery on slopes will be above the base // height of the slope element, and consequently clipped. if ((session->ViewFlags & VIEWPORT_FLAG_CLIP_VIEW)) { - if (spr->z > (gClipHeight * COORDS_Z_STEP)) + if (entityPos.z > (gClipHeight * COORDS_Z_STEP)) { continue; } - if (spr->x < gClipSelectionA.x || spr->x > gClipSelectionB.x) + if (entityPos.x < gClipSelectionA.x || entityPos.x > gClipSelectionB.x) { continue; } - if (spr->y < gClipSelectionA.y || spr->y > gClipSelectionB.y) + if (entityPos.y < gClipSelectionA.y || entityPos.y > gClipSelectionB.y) { continue; } @@ -99,8 +101,8 @@ void sprite_paint_setup(paint_session* session, const CoordsXY& pos) image_direction &= 0x1F; session->CurrentlyDrawnItem = spr; - session->SpritePosition.x = spr->x; - session->SpritePosition.y = spr->y; + session->SpritePosition.x = entityPos.x; + session->SpritePosition.y = entityPos.y; session->InteractionType = ViewportInteractionItem::Entity; switch (spr->Type) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 33cea3719d..3a09bc14cd 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -898,7 +898,7 @@ void Guest::Tick128UpdateGuest(int32_t index) { if (State == PeepState::Walking || State == PeepState::Sitting) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, GetLocation()); ExplosionCloud::Create({ x, y, z + 16 }); ExplosionFlare::Create({ x, y, z + 16 }); @@ -1237,7 +1237,7 @@ void Guest::UpdateSitting() if (!(pathingResult & PATHING_DESTINATION_REACHED)) return; - auto loc = CoordsXYZ{ x, y, z }.ToTileStart() + CoordsXYZ{ BenchUseOffsets[Var37 & 0x7], 0 }; + auto loc = GetLocation().ToTileStart() + CoordsXYZ{ BenchUseOffsets[Var37 & 0x7], 0 }; MoveTo(loc); @@ -1770,7 +1770,7 @@ void Guest::OnExitRide(Ride* ride) int32_t laughType = scenario_rand() & 7; if (laughType < 3) { - OpenRCT2::Audio::Play3D(laughs[laughType], { x, y, z }); + OpenRCT2::Audio::Play3D(laughs[laughType], GetLocation()); } } @@ -2289,11 +2289,11 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp // needing to be synchronised if (network_get_mode() == NETWORK_MODE_NONE && !gOpenRCT2Headless) { - MoneyEffect::CreateAt(amount, { x, y, z }, true); + MoneyEffect::CreateAt(amount, GetLocation(), true); } } - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Purchase, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Purchase, GetLocation()); } void Guest::SetHasRidden(const Ride* ride) @@ -5007,7 +5007,7 @@ void Guest::UpdateRideShopInteract() // Do not play toilet flush sound on title screen as it's considered loud and annoying if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::ToiletFlush, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::ToiletFlush, GetLocation()); } RideSubState = PeepRideSubState::LeaveShop; @@ -5027,11 +5027,13 @@ void Guest::UpdateRideShopLeave() { if (auto loc = UpdateAction(); loc.has_value()) { - MoveTo({ loc.value(), z }); + const auto curLoc = GetLocation(); - if ((x & 0xFFE0) != NextLoc.x) + MoveTo({ loc.value(), curLoc.z }); + + if ((curLoc.x & 0xFFE0) != NextLoc.x) return; - if ((y & 0xFFE0) != NextLoc.y) + if ((curLoc.y & 0xFFE0) != NextLoc.y) return; } @@ -5238,11 +5240,12 @@ void Guest::UpdateWalking() Litter::Type::EmptyCup, }; auto litterType = litter_types[scenario_rand() & 0x3]; - int32_t litterX = x + (scenario_rand() & 0x7) - 3; - int32_t litterY = y + (scenario_rand() & 0x7) - 3; + const auto loc = GetLocation(); + int32_t litterX = loc.x + (scenario_rand() & 0x7) - 3; + int32_t litterY = loc.y + (scenario_rand() & 0x7) - 3; Direction litterDirection = (scenario_rand() & 0x3); - Litter::Create({ litterX, litterY, z, litterDirection }, litterType); + Litter::Create({ litterX, litterY, loc.z, litterDirection }, litterType); } } } @@ -5264,16 +5267,17 @@ void Guest::UpdateWalking() WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; UpdateSpriteType(); - int32_t litterX = x + (scenario_rand() & 0x7) - 3; - int32_t litterY = y + (scenario_rand() & 0x7) - 3; + const auto loc = GetLocation(); + int32_t litterX = loc.x + (scenario_rand() & 0x7) - 3; + int32_t litterY = loc.y + (scenario_rand() & 0x7) - 3; Direction litterDirection = (scenario_rand() & 0x3); - Litter::Create({ litterX, litterY, z, litterDirection }, litterType); + Litter::Create({ litterX, litterY, loc.z, litterDirection }, litterType); } } // Check if vehicle is blocking the destination tile - auto curPos = TileCoordsXYZ(CoordsXYZ{ x, y, z }); + auto curPos = TileCoordsXYZ(GetLocation()); auto dstPos = TileCoordsXYZ(CoordsXYZ{ GetDestination(), NextLoc.z }); if (curPos.x != dstPos.x || curPos.y != dstPos.y) { diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 288b096b81..832070280d 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -474,13 +474,14 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_2; // Create sick at location - Litter::Create({ x, y, z, sprite_direction }, (sprite_index & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); + const auto curLoc = GetLocation(); + Litter::Create({ curLoc, sprite_direction }, (sprite_index & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); static constexpr OpenRCT2::Audio::SoundId coughs[4] = { OpenRCT2::Audio::SoundId::Cough1, OpenRCT2::Audio::SoundId::Cough2, OpenRCT2::Audio::SoundId::Cough3, OpenRCT2::Audio::SoundId::Cough4 }; auto soundId = coughs[scenario_rand() & 3]; - OpenRCT2::Audio::Play3D(soundId, { x, y, z }); + OpenRCT2::Audio::Play3D(soundId, curLoc); return { { x, y } }; } diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index b61136f668..a1b43455d9 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1344,7 +1344,7 @@ void Staff::UpdateSweeping() if (Action == PeepActionType::StaffSweep && ActionFrame == 8) { // Remove sick at this location - Litter::RemoveAt({ x, y, z }); + Litter::RemoveAt(GetLocation()); StaffLitterSwept++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; } @@ -2489,7 +2489,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) if (ActionFrame == 0x13 || ActionFrame == 0x19 || ActionFrame == 0x1F || ActionFrame == 0x25 || ActionFrame == 0x2B) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::MechanicFix, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::MechanicFix, GetLocation()); } return false; diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 9d44297b5a..8532e08256 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -391,9 +391,7 @@ int32_t Vehicle::CableLiftUpdateTrackMotion() if (vehicle->remaining_distance < 0 || vehicle->remaining_distance >= 13962) { - unk_F64E20.x = vehicle->x; - unk_F64E20.y = vehicle->y; - unk_F64E20.z = vehicle->z; + unk_F64E20 = vehicle->GetLocation(); vehicle->Invalidate(); while (true) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 014527677b..f7b9c61bad 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3274,12 +3274,12 @@ void Vehicle::UpdateDeparting() auto soundId = (rideEntry->vehicles[0].sound_range == 4) ? OpenRCT2::Audio::SoundId::Tram : OpenRCT2::Audio::SoundId::TrainDeparting; - OpenRCT2::Audio::Play3D(soundId, { x, y, z }); + OpenRCT2::Audio::Play3D(soundId, GetLocation()); } if (curRide->mode == RideMode::UpwardLaunch || (curRide->mode == RideMode::DownwardLaunch && var_CE > 1)) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, GetLocation()); } if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) @@ -3492,7 +3492,7 @@ void Vehicle::FinishDeparting() if (var_CE >= 1 && (14 << 16) > velocity) return; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, GetLocation()); } if (curRide->mode == RideMode::UpwardLaunch) @@ -3500,7 +3500,7 @@ void Vehicle::FinishDeparting() if ((curRide->launch_speed << 16) > velocity) return; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, GetLocation()); } if (curRide->mode != RideMode::Race && !curRide->IsBlockSectioned()) @@ -3633,14 +3633,15 @@ void Vehicle::UpdateCollisionSetup() #ifdef ENABLE_SCRIPTING InvokeVehicleCrashHook(train->sprite_index, "another_vehicle"); #endif + const auto trainLoc = train->GetLocation(); - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { train->x, train->y, train->z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, trainLoc); - ExplosionCloud::Create({ train->x, train->y, train->z }); + ExplosionCloud::Create(trainLoc); for (int32_t i = 0; i < 10; i++) { - VehicleCrashParticle::Create(train->colours, { train->x, train->y, train->z }); + VehicleCrashParticle::Create(train->colours, trainLoc); } train->IsCrashedVehicle = true; @@ -3651,7 +3652,7 @@ void Vehicle::UpdateCollisionSetup() train->sprite_height_negative = 45; train->sprite_height_positive = 5; - train->MoveTo({ train->x, train->y, train->z }); + train->MoveTo(trainLoc); train->SwingSpeed = 0; } @@ -3694,7 +3695,7 @@ void Vehicle::UpdateCrashSetup() if (NumPeepsUntilTrainTail() != 0) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, GetLocation()); } int32_t edx = velocity >> 10; @@ -4131,7 +4132,7 @@ void Vehicle::UpdateArriving() if ((curRide->mode == RideMode::UpwardLaunch || curRide->mode == RideMode::DownwardLaunch) && var_CE < 2) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, GetLocation()); velocity = 0; acceleration = 0; SetState(Vehicle::Status::Departing, 1); @@ -4421,9 +4422,7 @@ void Vehicle::UpdateMotionBoatHire() if (remaining_distance >= 0x368A) { sound2_flags &= ~VEHICLE_SOUND2_FLAGS_LIFT_HILL; - unk_F64E20.x = x; - unk_F64E20.y = y; - unk_F64E20.z = z; + unk_F64E20 = GetLocation(); Invalidate(); for (;;) @@ -5124,24 +5123,24 @@ void Vehicle::UpdateHauntedHouseOperating() switch (current_time) { case 45: - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, GetLocation()); break; case 75: Pitch = 1; Invalidate(); break; case 400: - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream1, GetLocation()); break; case 745: - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, GetLocation()); break; case 775: Pitch = 1; Invalidate(); break; case 1100: - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, GetLocation()); break; } } @@ -5401,15 +5400,17 @@ void Vehicle::CrashOnLand() } sub_state = 2; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { x, y, z }); - ExplosionCloud::Create({ x, y, z }); - ExplosionFlare::Create({ x, y, z }); + const auto curLoc = GetLocation(); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, curLoc); + + ExplosionCloud::Create(curLoc); + ExplosionFlare::Create(curLoc); uint8_t numParticles = std::min(sprite_width, static_cast(7)); while (numParticles-- != 0) - VehicleCrashParticle::Create(colours, { x, y, z }); + VehicleCrashParticle::Create(colours, curLoc); IsCrashedVehicle = true; animation_frame = 0; @@ -5418,7 +5419,7 @@ void Vehicle::CrashOnLand() sprite_height_negative = 45; sprite_height_positive = 5; - MoveTo({ x, y, z }); + MoveTo(curLoc); crash_z = 0; } @@ -5467,16 +5468,18 @@ void Vehicle::CrashOnWater() } sub_state = 2; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Water1, { x, y, z }); - CrashSplashParticle::Create({ x, y, z }); - CrashSplashParticle::Create({ x - 8, y - 9, z }); - CrashSplashParticle::Create({ x + 11, y - 9, z }); - CrashSplashParticle::Create({ x + 11, y + 8, z }); - CrashSplashParticle::Create({ x - 4, y + 8, z }); + const auto curLoc = GetLocation(); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Water1, curLoc); + + CrashSplashParticle::Create(curLoc); + CrashSplashParticle::Create(curLoc + CoordsXYZ{ -8, -9, 0 }); + CrashSplashParticle::Create(curLoc + CoordsXYZ{ 11, -9, 0 }); + CrashSplashParticle::Create(curLoc + CoordsXYZ{ 11, 8, 0 }); + CrashSplashParticle::Create(curLoc + CoordsXYZ{ -4, 8, 0 }); for (int32_t i = 0; i < 10; ++i) - VehicleCrashParticle::Create(colours, { x - 4, y + 8, z }); + VehicleCrashParticle::Create(colours, curLoc + CoordsXYZ{ -4, 8, 0 }); IsCrashedVehicle = true; animation_frame = 0; @@ -5485,7 +5488,7 @@ void Vehicle::CrashOnWater() sprite_height_negative = 45; sprite_height_positive = 5; - MoveTo({ x, y, z }); + MoveTo(curLoc); crash_z = -1; } @@ -5499,6 +5502,8 @@ void Vehicle::UpdateCrash() for (Vehicle* curVehicle = GetEntity(sprite_index); curVehicle != nullptr; curVehicle = GetEntity(curVehicle->next_vehicle_on_train)) { + CoordsXYZ curPos = curVehicle->GetLocation(); + if (curVehicle->sub_state > 1) { if (curVehicle->crash_z <= 96) @@ -5508,7 +5513,8 @@ void Vehicle::UpdateCrash() { int32_t xOffset = (scenario_rand() & 2) - 1; int32_t yOffset = (scenario_rand() & 2) - 1; - ExplosionCloud::Create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); + + ExplosionCloud::Create(curPos + CoordsXYZ{ xOffset, yOffset, 0 }); } } if (curVehicle->animationState <= 0xe388) @@ -5526,7 +5532,7 @@ void Vehicle::UpdateCrash() continue; } - TileElement* collideElement = vehicle_check_collision({ curVehicle->x, curVehicle->y, curVehicle->z }); + TileElement* collideElement = vehicle_check_collision(curPos); if (collideElement == nullptr) { curVehicle->sub_state = 1; @@ -5537,12 +5543,12 @@ void Vehicle::UpdateCrash() continue; } - int16_t height = tile_element_height({ curVehicle->x, curVehicle->y }); - int16_t waterHeight = tile_element_water_height({ curVehicle->x, curVehicle->y }); + int16_t height = tile_element_height(curPos); + int16_t waterHeight = tile_element_water_height(curPos); int16_t zDiff; if (waterHeight != 0) { - zDiff = curVehicle->z - waterHeight; + zDiff = curPos.z - waterHeight; if (zDiff <= 0 && zDiff >= -20) { curVehicle->CrashOnWater(); @@ -5550,8 +5556,8 @@ void Vehicle::UpdateCrash() } } - zDiff = curVehicle->z - height; - if ((zDiff <= 0 && zDiff >= -20) || curVehicle->z < 16) + zDiff = curPos.z - height; + if ((zDiff <= 0 && zDiff >= -20) || curPos.z < 16) { curVehicle->CrashOnLand(); continue; @@ -5559,20 +5565,18 @@ void Vehicle::UpdateCrash() curVehicle->Invalidate(); - CoordsXYZ curPosition = { curVehicle->x, curVehicle->y, curVehicle->z }; - - curPosition.x += static_cast(curVehicle->crash_x >> 8); - curPosition.y += static_cast(curVehicle->crash_y >> 8); - curPosition.z += static_cast(curVehicle->crash_z >> 8); + curPos.x += static_cast(curVehicle->crash_x >> 8); + curPos.y += static_cast(curVehicle->crash_y >> 8); + curPos.z += static_cast(curVehicle->crash_z >> 8); curVehicle->TrackLocation = { (curVehicle->crash_x << 8), (curVehicle->crash_y << 8), (curVehicle->crash_z << 8) }; - if (!map_is_location_valid(curPosition)) + if (!map_is_location_valid(curPos)) { curVehicle->CrashOnLand(); continue; } - curVehicle->MoveTo(curPosition); + curVehicle->MoveTo(curPos); if (curVehicle->sub_state == 1) { diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index 4261421971..419f08976e 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -20,17 +20,17 @@ void EntityTweener::PopulateEntities() for (auto ent : EntityList()) { Entities.push_back(ent); - PrePos.emplace_back(ent->x, ent->y, ent->z); + PrePos.emplace_back(ent->GetLocation()); } for (auto ent : EntityList()) { Entities.push_back(ent); - PrePos.emplace_back(ent->x, ent->y, ent->z); + PrePos.emplace_back(ent->GetLocation()); } for (auto ent : EntityList()) { Entities.push_back(ent); - PrePos.emplace_back(ent->x, ent->y, ent->z); + PrePos.emplace_back(ent->GetLocation()); } } @@ -52,7 +52,7 @@ void EntityTweener::PostTick() } else { - PostPos.emplace_back(ent->x, ent->y, ent->z); + PostPos.emplace_back(ent->GetLocation()); } } } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 2af9e1e6fe..ad1991df89 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -544,9 +544,7 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite) sprite->SpriteRect = ScreenRect( screenCoords - ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_negative }, screenCoords + ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_positive }); - sprite->x = spritePos.x; - sprite->y = spritePos.y; - sprite->z = spritePos.z; + sprite->SetLocation(spritePos); } /** diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index c34ea49c8f..5090ae3429 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -109,7 +109,7 @@ protected: peep->PerformNextAction(pathingResult); ++step; - *pos = TileCoordsXYZ(CoordsXYZ(peep->x, peep->y, peep->z)); + *pos = TileCoordsXYZ(peep->GetLocation()); EXPECT_PRED_FORMAT1(AssertIsNotForbiddenPosition, *pos); From c284aa2ce2e8d49c6c7353099916c355d1fb3f62 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Wed, 29 Sep 2021 04:08:29 +0000 Subject: [PATCH 453/681] Merge Localisation/master into OpenRCT2/develop --- data/language/fi-FI.txt | 238 ++++++++++++++++++++-------------------- 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 4607f77fb4..97bd1cb552 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -533,11 +533,11 @@ STR_1144 :Ei pysty rakentamaan/siirtämään tämän laitteen/kohteen sisää STR_1145 :Ei pysty rakentamaan/siirtämään tämän laitteen/kohteen uloskäyntiä… STR_1146 :Sisäänkäyntiä ei ole vielä rakennettu STR_1147 :Uloskäyntiä ei ole vielä rakennettu -STR_1148 :Neljänneskuorma -STR_1149 :Puolikas kuorma -STR_1150 :Kolmeneljäsosakuorma -STR_1151 :Täysi kuorma -STR_1152 :Mikä tahansa kuorma +STR_1148 :Neljänneslasti +STR_1149 :Puolikas lasti +STR_1150 :Kolmeneljäsosalasti +STR_1151 :Täysi lasti +STR_1152 :Mikä tahansa lasti STR_1153 :Korkeusmerkinnät radoissa STR_1154 :Korkeusmerkinnät maanpinnassa STR_1155 :Korkeusmerkinnät poluissa @@ -548,8 +548,8 @@ STR_1159 :Sijoita maisemointeja, kasveja ja somisteita STR_1160 :Luo/säädä järviä ja vettä STR_1161 :Tätä ei voi sijoittaa tähän… STR_1162 :{OUTLINE}{TOPAZ}{STRINGID} -STR_1163 :{STRINGID}{NEWLINE}(Oikea klikkaus muokkaa) -STR_1164 :{STRINGID}{NEWLINE}(Oikea klikkaus poistaa) +STR_1163 :{STRINGID}{NEWLINE}(Muokkaa oikealla painikkeella) +STR_1164 :{STRINGID}{NEWLINE}(Poista oikealla painikkeella) STR_1165 :{STRINGID} - {STRINGID} {COMMA16} STR_1166 :Veden tasoa ei voi laskea tässä… STR_1167 :Veden tasoa ei voi nostaa tässä… @@ -873,7 +873,7 @@ STR_1482 :“Voin pahoin” STR_1483 :“Voin erittäin pahoin” STR_1484 :“Tahdon mennä johonkin jännittävämpään kuin {STRINGID}” STR_1485 :“{STRINGID} näyttää liian hurjalta minulle” -STR_1486 :“En ole nauttinut {STRINGID} loppuun vielä” +STR_1486 :“Minulla on vielä {STRINGID} jäljellä” STR_1487 :“Pelkästään laitteen {STRINGID} katsominen saa minut voimaan pahoin” STR_1488 :“En aio maksaa noin paljon laitteesta {STRINGID}” STR_1489 :“Haluan kotiin” @@ -898,7 +898,7 @@ STR_1507 :“En löydä puiston uloskäyntiä” STR_1508 :“Tahdon pois kohteesta {STRINGID}” STR_1509 :“Tahdon ulos kohteesta {STRINGID}” STR_1510 :“En mene kohteeseen {STRINGID} - se ei ole turvallinen” -STR_1511 :“Tämä tie on kuvottava” +STR_1511 :“Tämä polku on kuvottava” STR_1512 :“Täällä on liikaa tungosta” STR_1513 :“Täällä on todella paljon ilkivaltaa” STR_1514 :“Mahtava maisema!” @@ -918,7 +918,7 @@ STR_1527 :“Tämä hattara kojusta {STRINGID} on todella reilun hintainen” STR_1528 : STR_1529 : STR_1530 : -STR_1531 :“Tämä pitsa kojusta {STRINGID} on todella reilun hintainen” +STR_1531 :“Tämä pizza kojusta {STRINGID} on todella reilun hintainen” STR_1532 : STR_1533 :“Tämä popcorn kojusta {STRINGID} on todella reilun hintainen” STR_1534 :“Tämä nakkisämpylä kojusta {STRINGID} on todella reilun hintainen” @@ -939,32 +939,32 @@ STR_1548 : STR_1549 : STR_1550 :“Vau!” STR_1551 :“Minulla on outo fiilis että joku katselee minua” -STR_1552 :“En maksa noin paljon ilmapallosta kojussa {STRINGID}” -STR_1553 :“En maksa noin paljon pehmolelusta kojussa {STRINGID}” -STR_1554 :“En maksa noin paljon puiston kartasta kojussa {STRINGID}” +STR_1552 :“En maksa noin paljon ilmapallosta kojusta {STRINGID}” +STR_1553 :“En maksa noin paljon pehmolelusta kojusta {STRINGID}” +STR_1554 :“En maksa noin paljon puiston kartasta kojusta {STRINGID}” STR_1555 :“En maksa noin paljon kuvasta laitteesta {STRINGID}” -STR_1556 :“En maksa noin paljon sateenvarjosta kojussa {STRINGID}” -STR_1557 :“En maksa noin paljon juomasta kojussa {STRINGID}” -STR_1558 :“En maksa noin paljon hampurilaisesta kojussa {STRINGID}” -STR_1559 :“En maksa noin paljon ranskalaisista kojussa {STRINGID}” -STR_1560 :“En maksa noin paljon jäätelöstä kojussa {STRINGID}” -STR_1561 :“En maksa noin paljon hattarasta kojussa {STRINGID}” +STR_1556 :“En maksa noin paljon sateenvarjosta kojusta {STRINGID}” +STR_1557 :“En maksa noin paljon juomasta kojusta {STRINGID}” +STR_1558 :“En maksa noin paljon hampurilaisesta kojusta {STRINGID}” +STR_1559 :“En maksa noin paljon ranskalaisista kojusta {STRINGID}” +STR_1560 :“En maksa noin paljon jäätelöstä kojusta {STRINGID}” +STR_1561 :“En maksa noin paljon hattarasta kojusta {STRINGID}” STR_1562 : STR_1563 : STR_1564 : -STR_1565 :“En maksa noin paljon pitsasta kojussa {STRINGID}” +STR_1565 :“En maksa noin paljon pizzasta kojusta {STRINGID}” STR_1566 : -STR_1567 :“En maksa noin paljon popcornista kojussa {STRINGID}” -STR_1568 :“En maksa noin paljon nakkisämpylästä kojussa {STRINGID}” -STR_1569 :“En maksa noin paljon lonkerosta kojussa {STRINGID}” -STR_1570 :“En maksa noin paljon hatusta kojussa {STRINGID}” -STR_1571 :“En maksa noin paljon toffeeomenasta kojussa {STRINGID}” -STR_1572 :“En maksa noin paljon t-paidasta kojussa {STRINGID}” -STR_1573 :“En maksa noin paljon donitsista kojussa {STRINGID}” -STR_1574 :“En maksa noin paljon kahvista kojussa {STRINGID}” +STR_1567 :“En maksa noin paljon popcornista kojusta {STRINGID}” +STR_1568 :“En maksa noin paljon nakkisämpylästä kojusta {STRINGID}” +STR_1569 :“En maksa noin paljon lonkerosta kojusta {STRINGID}” +STR_1570 :“En maksa noin paljon hatusta kojusta {STRINGID}” +STR_1571 :“En maksa noin paljon toffeeomenasta kojusta {STRINGID}” +STR_1572 :“En maksa noin paljon t-paidasta kojusta {STRINGID}” +STR_1573 :“En maksa noin paljon donitsista kojusta {STRINGID}” +STR_1574 :“En maksa noin paljon kahvista kojusta {STRINGID}” STR_1575 : -STR_1576 :“En maksa noin paljon paistetusta kanasta kojussa {STRINGID}” -STR_1577 :“En maksa noin paljon limsasta kojussa {STRINGID}” +STR_1576 :“En maksa noin paljon paistetusta kanasta kojusta {STRINGID}” +STR_1577 :“En maksa noin paljon limsasta kojusta {STRINGID}” STR_1578 : STR_1579 : STR_1580 : @@ -986,7 +986,7 @@ STR_1595 :“Tämä lihapullakeitto kojusta {STRINGID} on todella reilun hint STR_1596 :“Tämä hedelmämehu kojusta {STRINGID} on todella reilun hintainen” STR_1597 :“Tämä soijamaito kojusta {STRINGID} on todella reilun hintainen” STR_1598 :“Tämä sujongkwa kojusta {STRINGID} on todella reilun hintainen” -STR_1599 :“Tämä pantonki kojusta {STRINGID} on todella reilun hintainen” +STR_1599 :“Tämä voileipä kojusta {STRINGID} on todella reilun hintainen” STR_1600 :“Tämä keksi kojusta {STRINGID} on todella reilun hintainen” STR_1601 : STR_1602 : @@ -1006,24 +1006,24 @@ STR_1615 : STR_1616 :“En maksa noin paljon kuvasta laitteesta {STRINGID}” STR_1617 :“En maksa noin paljon kuvasta laitteesta {STRINGID}” STR_1618 :“En maksa noin paljon kuvasta laitteesta {STRINGID}” -STR_1619 :“En maksa noin paljon rinkelistä kojussa {STRINGID}” -STR_1620 :“En maksa noin paljon kaakaosta kojussa {STRINGID}” -STR_1621 :“En maksa noin paljon jääteestä kojussa {STRINGID}” -STR_1622 :“En maksa noin paljon tippaleivästä kojussa {STRINGID}” -STR_1623 :“En maksa noin paljon aurinkolaseista kojussa {STRINGID}” -STR_1624 :“En maksa noin paljon häränlihanuudeleista kojussa {STRINGID}” -STR_1625 :“En maksa noin paljon paistetuista riisinuudeleista kojussa {STRINGID}” -STR_1626 :“En maksa noin paljon wontonkeitosta kojussa {STRINGID}” -STR_1627 :“En maksa noin paljon lihapullakeitosta kojussa {STRINGID}” -STR_1628 :“En maksa noin paljon hedelmämehusta kojussa {STRINGID}” -STR_1629 :“En maksa noin paljon soijamaidosta kojussa {STRINGID}” -STR_1630 :“En maksa noin paljon sujongkwasta kojussa {STRINGID}” -STR_1631 :“En maksa noin paljon patongista kojussa {STRINGID}” -STR_1632 :“En maksa noin paljon keksistä kojussa {STRINGID}” +STR_1619 :“En maksa noin paljon rinkelistä kojusta {STRINGID}” +STR_1620 :“En maksa noin paljon kaakaosta kojusta {STRINGID}” +STR_1621 :“En maksa noin paljon jääteestä kojusta {STRINGID}” +STR_1622 :“En maksa noin paljon tippaleivästä kojusta {STRINGID}” +STR_1623 :“En maksa noin paljon aurinkolaseista kojusta {STRINGID}” +STR_1624 :“En maksa noin paljon häränlihanuudeleista kojusta {STRINGID}” +STR_1625 :“En maksa noin paljon paistetuista riisinuudeleista kojusta {STRINGID}” +STR_1626 :“En maksa noin paljon wontonkeitosta kojusta {STRINGID}” +STR_1627 :“En maksa noin paljon lihapullakeitosta kojusta {STRINGID}” +STR_1628 :“En maksa noin paljon hedelmämehusta kojusta {STRINGID}” +STR_1629 :“En maksa noin paljon soijamaidosta kojusta {STRINGID}” +STR_1630 :“En maksa noin paljon sujongkwasta kojusta {STRINGID}” +STR_1631 :“En maksa noin paljon voileivästä kojusta {STRINGID}” +STR_1632 :“En maksa noin paljon keksistä kojusta {STRINGID}” STR_1633 : STR_1634 : STR_1635 : -STR_1636 :“En maksa noin paljon grillimakkarasta kojussa {STRINGID}” +STR_1636 :“En maksa noin paljon grillimakkarasta kojusta {STRINGID}” STR_1637 : STR_1638 : STR_1639 : @@ -1199,7 +1199,7 @@ STR_1816 :Valitse kävijälistan näyttämä tietotyyppi STR_1817 :({COMMA32}) STR_1818 :{WINDOW_COLOUR_2}Kaikki kävijät STR_1819 :{WINDOW_COLOUR_2}Kaikki kävijät (yhteenvetona) -STR_1820 :{WINDOW_COLOUR_2}Kävijät {STRINGID} +STR_1820 :{WINDOW_COLOUR_2}Kävijät: {STRINGID} STR_1821 :{WINDOW_COLOUR_2}Kävijät, jotka ajattelevat {SMALLFONT}{STRINGID} STR_1822 :{WINDOW_COLOUR_2}Kävijöiden ajatukset kohteesta {POP16}{STRINGID} STR_1823 :Näytä kävijöiden ajatukset tästä laitteesta/kohteesta @@ -1364,34 +1364,34 @@ STR_1984 :{WINDOW_COLOUR_2}Paistetun kanan hinta: STR_1985 :{WINDOW_COLOUR_2}Limsan hinta: STR_1986 :{WINDOW_COLOUR_2} STR_1987 :{WINDOW_COLOUR_2} -STR_1988 :ilmapalloani -STR_1989 :pehmoleluani -STR_1990 :puiston karttaani -STR_1991 :valokuvaani -STR_1992 :sateenvarjoani -STR_1993 :juomaani -STR_1994 :hampurilaistani -STR_1995 :ranskalaisiani -STR_1996 :jäätelöäni -STR_1997 :hattaraani -STR_1998 :tyhjää tölkkiäni -STR_1999 :roskaani -STR_2000 :tyhjää hampurilaisrasiaani -STR_2001 :pizzaani -STR_2002 :kuponkiani -STR_2003 :popcorniani -STR_2004 :nakkisämpylääni -STR_2005 :lonkeroani -STR_2006 :hattuani -STR_2007 :toffeeomenaani -STR_2008 :t-paitaani -STR_2009 :donitsiani -STR_2010 :kahviani -STR_2011 :tyhjää kuppiani -STR_2012 :paistettua kanaani -STR_2013 :limsaani -STR_2014 :tyhjää rasiaani -STR_2015 :tyhjää pulloani +STR_1988 :ilmapallo +STR_1989 :pehmolelu +STR_1990 :puiston kartta +STR_1991 :valokuva +STR_1992 :sateenvarjo +STR_1993 :juoma +STR_1994 :hampurilainen +STR_1995 :ranskalaisannos +STR_1996 :jäätelö +STR_1997 :hattara +STR_1998 :tyhjä tölkki +STR_1999 :roska +STR_2000 :tyhjä hampurilaisrasia +STR_2001 :pizza +STR_2002 :kuponki +STR_2003 :popcorn +STR_2004 :nakkisämpylä +STR_2005 :lonkero +STR_2006 :hattu +STR_2007 :toffeeomena +STR_2008 :t-paita +STR_2009 :donitsi +STR_2010 :kahvi +STR_2011 :tyhjä kuppi +STR_2012 :paistettu kana +STR_2013 :limsa +STR_2014 :tyhjä rasia +STR_2015 :tyhjä pullo STR_2016 :Ilmapalloja STR_2017 :Pehmoleluja STR_2018 :Puistokarttoja @@ -1488,32 +1488,32 @@ STR_2111 :{WINDOW_COLOUR_2}Lihapullakeiton hinta: STR_2112 :{WINDOW_COLOUR_2}Hedelmämehun hinta: STR_2113 :{WINDOW_COLOUR_2}Soijapapumaidon hinta: STR_2114 :{WINDOW_COLOUR_2}Sujongkwan hinta: -STR_2115 :{WINDOW_COLOUR_2}Patongin hinta: +STR_2115 :{WINDOW_COLOUR_2}Voileivän hinta: STR_2116 :{WINDOW_COLOUR_2}Piparin hinta: STR_2117 :{WINDOW_COLOUR_2} STR_2118 :{WINDOW_COLOUR_2} STR_2119 :{WINDOW_COLOUR_2} STR_2120 :{WINDOW_COLOUR_2}Grillimakkaran hinta: STR_2121 :{WINDOW_COLOUR_2} -STR_2125 :rinkeliäni -STR_2126 :kaakaotani -STR_2127 :jääteetäni -STR_2128 :tippaleipääni -STR_2129 :aurinkolasejani -STR_2130 :häränlihanuudeleitani -STR_2131 :paistettuja riisinuudeleitani -STR_2132 :wontonkeittoani -STR_2133 :lihapullakeittoani -STR_2134 :hedelmämehuani -STR_2135 :soijapapumaitoani -STR_2136 :sujongkwaani -STR_2137 :patonkiani -STR_2138 :pipariani -STR_2139 :tyhjää kulhoani -STR_2140 :tyhjää juomatölkkiäni -STR_2141 :tyhjää mehukuppiani -STR_2142 :grillimakkaraani -STR_2143 :tyhjää kulhoani +STR_2125 :rinkeli +STR_2126 :kaakao +STR_2127 :jäätee +STR_2128 :tippaleipä +STR_2129 :aurinkolasi +STR_2130 :häränlihanuudeli +STR_2131 :paistettu riisinuudeli +STR_2132 :wontonkeitto +STR_2133 :lihapullakeitto +STR_2134 :hedelmämehu +STR_2135 :soijapapumaito +STR_2136 :sujongkwa +STR_2137 :voileipä +STR_2138 :pipari +STR_2139 :tyhjää kulho +STR_2140 :tyhjää juomatölkki +STR_2141 :tyhjää mehukuppi +STR_2142 :grillimakkara +STR_2143 :tyhjää kulho STR_2147 :Rinkeleitä STR_2148 :Kaakaoita STR_2149 :Jääteitä @@ -1526,7 +1526,7 @@ STR_2155 :Lihapullakeittoja STR_2156 :Hedelmämehuja STR_2157 :Soijapapumaitoja STR_2158 :Sujongkwoita -STR_2159 :Patonkeja +STR_2159 :Voileipiä STR_2160 :Pipareita STR_2161 :Tyhjiä kulhoja STR_2162 :Tyhjiä juomatölkkejä @@ -1545,7 +1545,7 @@ STR_2177 :lihapullakeittoa STR_2178 :hedelmämehu STR_2179 :soijapapumaitoa STR_2180 :sujongkwaa -STR_2181 :patonki +STR_2181 :voileipä STR_2182 :pipari STR_2183 :tyhjä kulho STR_2184 :tyhjä juomatölkki @@ -1564,7 +1564,7 @@ STR_2199 :Lihapullakeitto STR_2200 :Hedelmämehu STR_2201 :Soijapapumaito STR_2202 :Sujongkwa -STR_2203 :Patonki +STR_2203 :Voileipä STR_2204 :Pipari STR_2205 :Tyhjä kulho STR_2206 :Tyhjä juomatölkki @@ -1579,7 +1579,7 @@ STR_2214 :Rakentaminen ei ole mahdollista pelin ollessa pysäytettynä! STR_2215 :{STRINGID}{NEWLINE}({STRINGID}) STR_2216 :{WINDOW_COLOUR_2}{COMMA16}°C STR_2217 :{WINDOW_COLOUR_2}{COMMA16}°F -STR_2218 :{RED}{STRINGID} laitteessa {STRINGID} ei ole vielä palautunut {STRINGID}lle!{NEWLINE}Tarkista, onko se jumissa tai juuttunut +STR_2218 :{RED}{STRINGID} laitteessa {STRINGID} ei ole vielä palannut {STRINGID}lle!{NEWLINE}Tarkista, onko se jumissa tai juuttunut STR_2219 :{RED}{COMMA16} henkilöä on kuollut laitteen {STRINGID} onnettomuudessa STR_2220 :{WINDOW_COLOUR_2}Puiston taso: {BLACK}{COMMA16} STR_2221 :Puiston taso: {COMMA16} @@ -1740,17 +1740,17 @@ 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_2387 :{BLACK}Saavuta puiston arvoksi vähintään {POP16}{POP16}{CURRENCY} vuoden {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} loppuun mennessä +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_2387 :{BLACK}Saavuta puiston arvoksi vähintään {POP16}{POP16}{CURRENCY} {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_2392 :{BLACK}Sinun tulee saada {POP16}{POP16}{CURRENCY} kuukausituloja laitteiden lipputuloista +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} -STR_2395 :{BLACK}Maksa lainasi takaisin ja saavuta puistolle arvo {POP16}{POP16}{CURRENCY} -STR_2396 :{BLACK}Sinun tulee saada {POP16}{POP16}{CURRENCY} kuukausituloja ruoan, juomien ja tavaroiden myynnistä +STR_2395 :{BLACK}Maksa lainasi takaisin, ja saavuta puiston arvoksi vähintään {POP16}{POP16}{CURRENCY} +STR_2396 :{BLACK}Sinun tulee ansaita {POP16}{POP16}{CURRENCY} kuukausituloja ruoan, juomien ja tavaroiden myynnistä STR_2397 :Ei mitään STR_2398 :Kävijöiden määrä tiettynä päivänä STR_2399 :Puiston arvo tiettynä päivänä @@ -1792,12 +1792,12 @@ STR_2436 :1 viikko STR_2443 :{WINDOW_COLOUR_2}Viikottainen kustannus: {BLACK}{CURRENCY2DP} STR_2444 :{WINDOW_COLOUR_2}Kokonaiskustannus: {BLACK}{CURRENCY2DP} STR_2445 :Aloita tämä markkinointikampanja -STR_2446 :{YELLOW}Markkinointikampanjasi ilmaiseen sisäänpääsyyn on loppunut -STR_2447 :{YELLOW}Markkinointikampanjasi ilmaiseen pääsyyn laitteeseen {STRINGID} on loppunut -STR_2448 :{YELLOW}Markkinointikampanjasi sisäänpääsyyn puoleen hintaan on loppunut -STR_2449 :{YELLOW}Markkinointikampanjasi ilmaisia {STRINGID} varten on loppunut -STR_2450 :{YELLOW}Mainoskampanjasi puistolle on loppunut -STR_2451 :{YELLOW}Mainoskampanjasi laitteelle {STRINGID} on loppunut +STR_2446 :{YELLOW}Markkinointikampanjasi ilmaiseen sisäänpääsyyn on päättynyt +STR_2447 :{YELLOW}Markkinointikampanjasi ilmaiseen pääsyyn laitteeseen {STRINGID} on päättynyt +STR_2448 :{YELLOW}Markkinointikampanjasi sisäänpääsyyn puoleen hintaan on päättynyt +STR_2449 :{YELLOW}Markkinointikampanjasi ilmaisia {STRINGID} varten on päättynyt +STR_2450 :{YELLOW}Mainoskampanjasi puistolle on päättynyt +STR_2451 :{YELLOW}Mainoskampanjasi laitteelle {STRINGID} on päättynyt STR_2452 :{WINDOW_COLOUR_2}Varat (miinus velka): {BLACK}{CURRENCY2DP} STR_2453 :{WINDOW_COLOUR_2}Varat (miinus velka): {RED}{CURRENCY2DP} STR_2454 :{BLACK}{CURRENCY2DP} - @@ -2000,8 +2000,8 @@ STR_2793 :(Suorittanut {STRINGID}) STR_2794 :{WINDOW_COLOUR_2}Suorittanut: {BLACK}{STRINGID}{NEWLINE}{WINDOW_COLOUR_2}Yhtiön arvolla: {BLACK}{CURRENCY} STR_2795 :Järjestä STR_2796 :Järjestä laitelistaus valitun tietotyypin mukaan -STR_2797 :Vieritä näkymää kun hiiri on näytön reunassa -STR_2798 :Valitse vieritetäänkö näkymää kun hiiri on näytön reunassa +STR_2797 :Vieritä näkymää kun osoitin on näytön reunassa +STR_2798 :Valitse vieritetäänkö näkymää kun osoitin on näytön reunassa STR_2799 :Näytä ja aseta näppäinasetukset STR_2800 :{WINDOW_COLOUR_2}Sisäänpääsyt: {BLACK}{COMMA32} STR_2801 :{WINDOW_COLOUR_2}Tulot sisäänpääsyistä: {BLACK}{CURRENCY2DP} @@ -2015,10 +2015,10 @@ STR_2808 :{RED}Kävijät valittavat puistosi ilkivallasta{NEWLINE}Tarkista ja STR_2809 :{RED}Kävijät ovat nälkäisiä eivätkä löydä paikkaa josta saisi ruokaa STR_2810 :{RED}Kävijät ovat janoisia eivätkä löydä paikkaa josta saisi juotavaa STR_2811 :{RED}Kävijät valittavat etteivät löydä vessaa puistostasi -STR_2812 :{RED}Kävijät eksyvät tai jäävät jumiink{NEWLINE}Tarkista polkusi että kävijät löytävä tiensä paikasta toiseen -STR_2813 :{RED}Sisäänpääsyn hinta on liian korkea!{NEWLINE}Laske sisäänpääsyhintaa tai paranna puiston arvoa jotta puistosi houkuttelee enemmän kävijöitä +STR_2812 :{RED}Kävijät eksyvät tai jäävät jumiin{NEWLINE}Tarkista polkuasettelusi, jotta kävijät löytävät tiensä paikasta toiseen +STR_2813 :{RED}Puiston sisäänpääsyhinta on liian korkea!{NEWLINE}Laske sisäänpääsyhintaa tai paranna puiston arvoa jotta puistosi houkuttelee enemmän kävijöitä STR_2814 :{WINDOW_COLOUR_2}Sotkuisin puisto -palkinto -STR_2815 :{WINDOW_COLOUR_2}Siistein puisto -palkinto +STR_2815 :{WINDOW_COLOUR_2}Puhtain puisto -palkinto STR_2816 :{WINDOW_COLOUR_2}Parhaimmat vuoristoradat -palkinto STR_2817 :{WINDOW_COLOUR_2}Paras hinta/laatu-suhde -palkinto STR_2818 :{WINDOW_COLOUR_2}Kaunein puisto -palkinto @@ -2035,7 +2035,7 @@ STR_2828 :{WINDOW_COLOUR_2}Häikäisevimmät värivalinnat -palkinto STR_2829 :{WINDOW_COLOUR_2}Sekavin asettelu -palkinto STR_2830 :{WINDOW_COLOUR_2}Parhaat lempeät laitteet -palkinto STR_2831 :{TOPAZ}Puistosi sai ”Maan sotkuisin puisto” -palkinnon! -STR_2832 :{TOPAZ}Puistosi sai ”Maan siistein puisto” -palkinnon! +STR_2832 :{TOPAZ}Puistosi sai ”Maan puhtain puisto” -palkinnon! STR_2833 :{TOPAZ}Puistosi sai ”Parhaimmat vuoristoradat” -palkinnon! STR_2834 :{TOPAZ}Puistosi sai ”Maan paras hinta/laatu-suhde” -palkinnon! STR_2835 :{TOPAZ}Puistosi sai ”Maan kaunein puisto” -palkinnon! @@ -2051,7 +2051,7 @@ STR_2844 :{TOPAZ}Puistosi sai ”Maan parhaat mukautetut laitteet” -palkinn STR_2845 :{TOPAZ}Puistosi sai ”Häikäisevimmät värivalinnat” -palkinnon! STR_2846 :{TOPAZ}Puistosi sai ”Sekavin asettelu” -palkinnon! STR_2847 :{TOPAZ}Puistosi sai ”Maan parhaat lempeät laitteet” -palkinnon! -STR_2848 :{WINDOW_COLOUR_2}Ei tuoreita palkintoja +STR_2848 :{WINDOW_COLOUR_2}Ei viimeaikaisia palkintoja STR_2849 :Uusi skenaario asennettiin onnistuneesti STR_2850 :Uusi ratamalli asennettiin onnistuneesti STR_2851 :Skenaario on jo asennettu @@ -2152,7 +2152,7 @@ STR_3062 :Perusvuoristorata STR_3063 :Vesikanava (vedenalainen rata) STR_3064 :Aloittelijoiden puistot STR_3065 :Haastavat puistot -STR_3066 :Asiantuntijoiden puistot +STR_3066 :Vaativat puistot STR_3067 :“Oikeat” puistot STR_3068 :Muut puistot STR_3069 :Yläosa @@ -3585,7 +3585,7 @@ STR_6377 :{WINDOW_COLOUR_2}Tyyppi: {BLACK}{STRINGID} laitteelle {STRINGID} STR_6378 :Vastaanotetaan esinelistaa: {INT32} / {INT32} STR_6379 :Vastaanotettiin epäkelpoja tietoja STR_6380 :Päivitys saatavilla! -STR_6381 :Liity OpenRCT2 -Discordiin! +STR_6381 :Liity OpenRCT2:n Discordiin! STR_6382 :Uusi OpenRCT2-versio on saatavilla: {STRING}! STR_6383 :Avaa lataussivusto STR_6384 :Lumisade From 2906cb8c891a9b2871c3ecc946dfbc426604bd8b Mon Sep 17 00:00:00 2001 From: frutiemax Date: Wed, 29 Sep 2021 11:46:03 -0400 Subject: [PATCH 454/681] Fix #14474: Map size can be synced in multiplayer (#15312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #14474: Map size can be synced in multiplayer * Bump up network version Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com> --- OpenRCT2.xcodeproj/project.pbxproj | 8 ++ src/openrct2-ui/windows/Map.cpp | 40 ++-------- src/openrct2/Game.h | 1 + src/openrct2/actions/ChangeMapSizeAction.cpp | 77 +++++++++++++++++++ src/openrct2/actions/ChangeMapSizeAction.h | 30 ++++++++ .../actions/GameActionRegistration.cpp | 2 + src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/network/NetworkAction.cpp | 1 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/world/Map.cpp | 8 +- 10 files changed, 133 insertions(+), 38 deletions(-) create mode 100644 src/openrct2/actions/ChangeMapSizeAction.cpp create mode 100644 src/openrct2/actions/ChangeMapSizeAction.h diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index b53a9e1c1d..2277e03052 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -803,6 +803,8 @@ C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4D523B8782E4C458AF1490D /* GroupVector.hpp */; }; B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F28A181D311D4E078FDB090C /* ZipStream.hpp */; }; 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */; }; + 4653963391E945D397BCCA0C /* ChangeMapSizeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */; }; + F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1909,6 +1911,8 @@ F4D523B8782E4C458AF1490D /* GroupVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GroupVector.hpp; path = src/openrct2/core/GroupVector.hpp; sourceTree = SOURCE_ROOT; }; F28A181D311D4E078FDB090C /* ZipStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ZipStream.hpp; path = src/openrct2/core/ZipStream.hpp; sourceTree = SOURCE_ROOT; }; 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Crypt.OpenRCT2.cpp; path = src/openrct2/core/Crypt.OpenRCT2.cpp; sourceTree = SOURCE_ROOT; }; + 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChangeMapSizeAction.cpp; path = src/openrct2/actions/ChangeMapSizeAction.cpp; sourceTree = SOURCE_ROOT; }; + C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChangeMapSizeAction.h; path = src/openrct2/actions/ChangeMapSizeAction.h; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2225,6 +2229,8 @@ 66A10FC3257F1E2E00DD651A /* WaterRaiseAction.h */, 66A10FC7257F1E2E00DD651A /* WaterSetHeightAction.cpp */, 66A10FC8257F1E2F00DD651A /* WaterSetHeightAction.h */, + 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */, + C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */, ); path = actions; sourceTree = ""; @@ -3665,6 +3671,7 @@ E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */, C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */, B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */, + F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4488,6 +4495,7 @@ 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */, 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */, 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */, + 4653963391E945D397BCCA0C /* ChangeMapSizeAction.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index f0a7d65b61..f04b0f44ce 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -655,17 +656,8 @@ static void window_map_textinput(rct_window* w, rct_widgetindex widgetIndex, cha size += 2; size = std::clamp(size, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); - int32_t currentSize = gMapSize; - while (size < currentSize) - { - map_window_decrease_map_size(); - currentSize--; - } - while (size > currentSize) - { - map_window_increase_map_size(); - currentSize++; - } + auto changeMapSizeAction = ChangeMapSizeAction(size); + GameActions::Execute(&changeMapSizeAction); w->Invalidate(); } break; @@ -1370,17 +1362,8 @@ static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoor */ static void map_window_increase_map_size() { - if (gMapSize >= MAXIMUM_MAP_SIZE_TECHNICAL) - { - context_show_error(STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE, {}); - return; - } - - gMapSize++; - map_extend_boundary_surface(); - window_map_init_map(); - window_map_centre_on_view_point(); - gfx_invalidate_screen(); + auto increaseMapSizeAction = ChangeMapSizeAction(gMapSize + 1); + GameActions::Execute(&increaseMapSizeAction); } /** @@ -1389,17 +1372,8 @@ static void map_window_increase_map_size() */ static void map_window_decrease_map_size() { - if (gMapSize < 16) - { - context_show_error(STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_NONE, {}); - return; - } - - gMapSize--; - map_remove_out_of_range_elements(); - window_map_init_map(); - window_map_centre_on_view_point(); - gfx_invalidate_screen(); + auto decreaseMapSizeAction = ChangeMapSizeAction(gMapSize - 1); + GameActions::Execute(&decreaseMapSizeAction); } static constexpr const uint16_t WaterColour = MapColour(PALETTE_INDEX_195); diff --git a/src/openrct2/Game.h b/src/openrct2/Game.h index 897f6eb518..107a66e207 100644 --- a/src/openrct2/Game.h +++ b/src/openrct2/Game.h @@ -103,6 +103,7 @@ enum class GameCommand : int32_t GuestSetFlags, // GA SetDate, // GA Custom, // GA + ChangeMapSize, Count, }; diff --git a/src/openrct2/actions/ChangeMapSizeAction.cpp b/src/openrct2/actions/ChangeMapSizeAction.cpp new file mode 100644 index 0000000000..fb55284220 --- /dev/null +++ b/src/openrct2/actions/ChangeMapSizeAction.cpp @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "ChangeMapSizeAction.h" + +#include "../Context.h" +#include "../drawing/IDrawingEngine.h" +#include "../ui/UiContext.h" +#include "../ui/WindowManager.h" +#include "../windows/Intent.h" + +ChangeMapSizeAction::ChangeMapSizeAction(const int32_t targetSize) + : _targetSize(targetSize) +{ +} + +uint16_t ChangeMapSizeAction::GetActionFlags() const +{ + return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused; +} + +void ChangeMapSizeAction::Serialise(DataSerialiser& stream) +{ + GameAction::Serialise(stream); + stream << DS_TAG(_targetSize); +} + +GameActions::Result::Ptr ChangeMapSizeAction::Query() const +{ + if (_targetSize >= MAXIMUM_MAP_SIZE_TECHNICAL) + { + return std::make_unique( + GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); + } + if (_targetSize < 16) + { + return std::make_unique( + GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); + } + return std::make_unique(); +} + +GameActions::Result::Ptr ChangeMapSizeAction::Execute() const +{ + while (gMapSize != _targetSize) + { + if (_targetSize < gMapSize) + { + gMapSize--; + map_remove_out_of_range_elements(); + } + else + { + gMapSize++; + map_extend_boundary_surface(); + } + } + + auto* ctx = OpenRCT2::GetContext(); + auto uiContext = ctx->GetUiContext(); + auto* windowManager = uiContext->GetWindowManager(); + + windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP)); + gfx_invalidate_screen(); + return std::make_unique(); +} + +void ChangeMapSizeAction::AcceptParameters(GameActionParameterVisitor& visitor) +{ + visitor.Visit("targetSize", _targetSize); +} diff --git a/src/openrct2/actions/ChangeMapSizeAction.h b/src/openrct2/actions/ChangeMapSizeAction.h new file mode 100644 index 0000000000..93d3e021fc --- /dev/null +++ b/src/openrct2/actions/ChangeMapSizeAction.h @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../world/Map.h" +#include "GameAction.h" + +DEFINE_GAME_ACTION(ChangeMapSizeAction, GameCommand::ChangeMapSize, GameActions::Result) +{ +public: + ChangeMapSizeAction() = default; + ChangeMapSizeAction(const int32_t targetSize); + + void AcceptParameters(GameActionParameterVisitor & visitor) override; + uint16_t GetActionFlags() const override; + + void Serialise(DataSerialiser & stream) override; + GameActions::Result::Ptr Query() const override; + GameActions::Result::Ptr Execute() const override; + +private: + int32_t _targetSize; +}; diff --git a/src/openrct2/actions/GameActionRegistration.cpp b/src/openrct2/actions/GameActionRegistration.cpp index 872883540c..e48bfa8d73 100644 --- a/src/openrct2/actions/GameActionRegistration.cpp +++ b/src/openrct2/actions/GameActionRegistration.cpp @@ -13,6 +13,7 @@ #include "BannerSetColourAction.h" #include "BannerSetNameAction.h" #include "BannerSetStyleAction.h" +#include "ChangeMapSizeAction.h" #include "ClearAction.h" #include "ClimateSetAction.h" #include "CustomAction.h" @@ -172,6 +173,7 @@ namespace GameActions Register(); Register(); Register(); + Register(); #ifdef ENABLE_SCRIPTING Register(); #endif diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 128fabe6d8..94467bebb8 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -58,6 +58,7 @@ + @@ -505,6 +506,7 @@ + diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index 99e6e8c2c2..005de69e7c 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -200,6 +200,7 @@ const std::array(NetworkPermission::Count)> N GameCommand::PlaceParkEntrance, GameCommand::RemoveParkEntrance, GameCommand::PlacePeepSpawn, + GameCommand::ChangeMapSize, }, }, NetworkAction{ diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index ee2555fdc6..5ecd915704 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "10" +#define NETWORK_STREAM_VERSION "11" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7f9be950eb..eb3ddb0e4c 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1752,7 +1752,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) break; } auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseZ() }); - auto result = GameActions::Execute(&parkEntranceRemoveAction); + auto result = GameActions::ExecuteNested(&parkEntranceRemoveAction); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result->Error != GameActions::Status::Ok) { @@ -1764,7 +1764,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) { CoordsXYZD wallLocation = { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); - auto result = GameActions::Execute(&wallRemoveAction); + auto result = GameActions::ExecuteNested(&wallRemoveAction); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result->Error != GameActions::Status::Ok) { @@ -1776,7 +1776,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) { auto removeSceneryAction = LargeSceneryRemoveAction( { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }, element->AsLargeScenery()->GetSequenceIndex()); - auto result = GameActions::Execute(&removeSceneryAction); + auto result = GameActions::ExecuteNested(&removeSceneryAction); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result->Error != GameActions::Status::Ok) { @@ -1788,7 +1788,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) { auto bannerRemoveAction = BannerRemoveAction( { loc.x, loc.y, element->GetBaseZ(), element->AsBanner()->GetPosition() }); - auto result = GameActions::Execute(&bannerRemoveAction); + auto result = GameActions::ExecuteNested(&bannerRemoveAction); // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result->Error != GameActions::Status::Ok) { From 9216786efc4d968d70f16e796facb998a08bb32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 29 Sep 2021 09:19:47 -0700 Subject: [PATCH 455/681] Refactor GetSpatialIndexOffset (#15479) --- src/openrct2/world/Sprite.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 2af9e1e6fe..4f273df207 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -46,21 +46,19 @@ static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex static void FreeEntity(EntityBase& entity); -constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) +static constexpr size_t GetSpatialIndexOffset(const CoordsXY& loc) { - if (x == LOCATION_NULL) + if (loc.IsNull()) return SPATIAL_INDEX_LOCATION_NULL; - const auto tileX = std::clamp(x / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); - const auto tileY = std::clamp(y / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); - const auto index = tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; + // NOTE: The input coordinate is rotated and can have negative components. + const auto tileX = std::abs(loc.x) / COORDS_XY_STEP; + const auto tileY = std::abs(loc.y) / COORDS_XY_STEP; - if (index >= std::size(gSpriteSpatialIndex)) - { + if (tileX >= MAXIMUM_MAP_SIZE_TECHNICAL || tileY >= MAXIMUM_MAP_SIZE_TECHNICAL) return SPATIAL_INDEX_LOCATION_NULL; - } - return index; + return tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; } // Required for GetEntity to return a default @@ -155,7 +153,7 @@ EntityBase* get_sprite(size_t spriteIndex) const std::vector& GetEntityTileList(const CoordsXY& spritePos) { - return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos.x, spritePos.y)]; + return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos)]; } void EntityBase::Invalidate() @@ -463,7 +461,7 @@ void sprite_misc_update_all() // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) { - size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y); + size_t newIndex = GetSpatialIndexOffset(newLoc); auto& spatialVector = gSpriteSpatialIndex[newIndex]; auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); spatialVector.insert(index, sprite->sprite_index); @@ -471,7 +469,7 @@ static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) static void SpriteSpatialRemove(EntityBase* sprite) { - size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y); + size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); auto& spatialVector = gSpriteSpatialIndex[currentIndex]; auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); if (index != std::end(spatialVector) && *index == sprite->sprite_index) @@ -487,8 +485,8 @@ static void SpriteSpatialRemove(EntityBase* sprite) static void SpriteSpatialMove(EntityBase* sprite, const CoordsXY& newLoc) { - size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y); - size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y); + size_t newIndex = GetSpatialIndexOffset(newLoc); + size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); if (newIndex == currentIndex) return; From cce3bb1845581182c6ad22b171d83006261a62a4 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 29 Sep 2021 17:48:50 +0100 Subject: [PATCH 456/681] Fix #15136: Exported SV6 hangs/crashes vanilla RCT2 --- distribution/changelog.txt | 1 + src/openrct2/rct2/S6Exporter.cpp | 39 +++++++++++++++++++++----------- src/openrct2/rct2/S6Exporter.h | 1 + 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 160dcffa53..e8ac49de2f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -16,6 +16,7 @@ - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. +- Fix: [#15136] Exported SV6 files cause vanilla RCT2 to hang. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Fix: [#15170] Plugin: incorrect label text alignment. diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 7015d66994..f4ea1932d8 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1090,6 +1090,23 @@ void S6Exporter::ExportMarketingCampaigns() } } +void S6Exporter::RebuildEntitySpatialLocation(const TileCoordsXY& loc) +{ + uint16_t previous = SPRITE_INDEX_NULL; + for (auto* entity : EntityTileList(loc.ToCoordsXY())) + { + if (previous != SPRITE_INDEX_NULL) + { + _s6.sprites[previous].unknown.next_in_quadrant = entity->sprite_index; + } + previous = entity->sprite_index; + } + if (previous != SPRITE_INDEX_NULL) + { + _s6.sprites[previous].unknown.next_in_quadrant = SPRITE_INDEX_NULL; + } +} + void S6Exporter::RebuildEntityLinks() { // Rebuild next/previous linked list entity indexs @@ -1098,6 +1115,9 @@ void S6Exporter::RebuildEntityLinks() RCT12EntityLinkListOffset::Peep, RCT12EntityLinkListOffset::TrainHead, RCT12EntityLinkListOffset::Vehicle }) { uint16_t previous = SPRITE_INDEX_NULL; + // Intialise Head to NULL for situations where there are no entities of this type. + _s6.sprite_lists_head[EnumValue(list) >> 1] = SPRITE_INDEX_NULL; + for (auto& entity : _s6.sprites) { if (entity.unknown.linked_list_type_offset == list) @@ -1119,25 +1139,18 @@ void S6Exporter::RebuildEntityLinks() } // Rebuild next_in_quadrant linked list entity indexs + // This in theory is not required but to be on the safe side we are rebuilding it. for (auto x = 0; x < 255; ++x) { for (auto y = 0; y < 255; ++y) { - uint16_t previous = SPRITE_INDEX_NULL; - for (auto* entity : EntityTileList(TileCoordsXY{ x, y }.ToCoordsXY())) - { - if (previous != SPRITE_INDEX_NULL) - { - _s6.sprites[previous].unknown.next_in_quadrant = entity->sprite_index; - } - previous = entity->sprite_index; - } - if (previous != SPRITE_INDEX_NULL) - { - _s6.sprites[previous].unknown.next_in_quadrant = SPRITE_INDEX_NULL; - } + RebuildEntitySpatialLocation(TileCoordsXY{ x, y }); } } + // Rebuild next_in_quadrant linked list for LOCATION_NULL + TileCoordsXY invalid; + invalid.SetNull(); + RebuildEntitySpatialLocation(invalid); } constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const EntityBase* src) diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index b5a69db52d..42cc586019 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -79,4 +79,5 @@ private: std::optional AllocateUserString(std::string_view value); void ExportUserStrings(); void RebuildEntityLinks(); + void RebuildEntitySpatialLocation(const TileCoordsXY& loc); }; From 3a5452f0c906df9fdc6f43fbf5d417550e61fb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 28 Sep 2021 03:21:35 +0300 Subject: [PATCH 457/681] Update entities xyz to int32_t --- src/openrct2/rct2/S6Exporter.cpp | 6 +++--- src/openrct2/world/EntityBase.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index f4ea1932d8..47ee85946f 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1235,9 +1235,9 @@ void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const Entity dst->sprite_height_negative = src->sprite_height_negative; dst->sprite_index = src->sprite_index; dst->flags = 0; - dst->x = src->x; - dst->y = src->y; - dst->z = src->z; + dst->x = static_cast(src->x); + dst->y = static_cast(src->y); + dst->z = static_cast(src->z); dst->sprite_width = src->sprite_width; dst->sprite_height_positive = src->sprite_height_positive; dst->sprite_left = src->SpriteRect.GetLeft(); diff --git a/src/openrct2/world/EntityBase.h b/src/openrct2/world/EntityBase.h index 3824a59955..125193fef1 100644 --- a/src/openrct2/world/EntityBase.h +++ b/src/openrct2/world/EntityBase.h @@ -26,9 +26,9 @@ struct EntityBase { EntityType Type; uint16_t sprite_index; - int16_t x; - int16_t y; - int16_t z; + int32_t x; + int32_t y; + int32_t z; // Width from centre of sprite to edge uint8_t sprite_width; // Height from centre of sprite to bottom From afd5e8668f1123b87726ddde448702892d806fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 28 Sep 2021 17:32:44 +0300 Subject: [PATCH 458/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12ed42f22d..e07d4510cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.53") +set(REPLAYS_VERSION "0.0.54") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "8DDA5F2CC0B101D477396A3B016FF5F3EDFD074F") +set(REPLAYS_SHA1 "FF54C3699C3A0DF02269C5EB4C4A9C8E6D5C4EB4") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index 8e90ba9d3b..f46863f90e 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.53/replays.zip - 8DDA5F2CC0B101D477396A3B016FF5F3EDFD074F + https://github.com/OpenRCT2/replays/releases/download/v0.0.54/replays.zip + FF54C3699C3A0DF02269C5EB4C4A9C8E6D5C4EB4 From c1cde60e7f717da20de06b725a31e9da748dfd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 29 Sep 2021 19:49:42 +0300 Subject: [PATCH 459/681] Bump up network version --- 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 5ecd915704..f045992fc0 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "11" +#define NETWORK_STREAM_VERSION "12" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 8c6f10797b509e15866eac561d9d0f2e7bc63bd6 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 29 Sep 2021 18:20:43 +0100 Subject: [PATCH 460/681] Prevent wasting paint time on unviewable entities --- src/openrct2/paint/sprite/Paint.Sprite.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 83863d4c0a..803f297a83 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -34,6 +34,10 @@ */ void sprite_paint_setup(paint_session* session, const CoordsXY& pos) { + if (!map_is_location_valid(pos)) + { + return; + } if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) { return; From 82f0da24b1743d34ce4d98d86708a4e40ce2e8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 29 Sep 2021 20:40:57 +0300 Subject: [PATCH 461/681] Use int32_t for iterating tiles Co-authored-by: Ted John --- src/openrct2/ride/Ride.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 63eaebdb7f..df1247b4f8 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5548,9 +5548,9 @@ void determine_ride_entrance_and_exit_locations() // Search the map to find it. Skip the outer ring of invisible tiles. bool alreadyFoundEntrance = false; bool alreadyFoundExit = false; - for (uint8_t x = 1; x < MAXIMUM_MAP_SIZE_TECHNICAL - 1; x++) + for (int32_t x = 1; x < MAXIMUM_MAP_SIZE_TECHNICAL - 1; x++) { - for (uint8_t y = 1; y < MAXIMUM_MAP_SIZE_TECHNICAL - 1; y++) + for (int32_t y = 1; y < MAXIMUM_MAP_SIZE_TECHNICAL - 1; y++) { TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); From 98625e1aaaa011f3924588368b3b3f7d883e09aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 29 Sep 2021 22:04:44 +0300 Subject: [PATCH 462/681] Fix #14798: Overflow on sound position --- src/openrct2/ride/Vehicle.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 014527677b..36b236a7f4 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -973,10 +973,11 @@ bool Vehicle::SoundCanPlay() const if (g_music_tracking_viewport == nullptr) return false; - int16_t left = g_music_tracking_viewport->viewPos.x; - int16_t bottom = g_music_tracking_viewport->viewPos.y; - int16_t quarter_w = g_music_tracking_viewport->view_width / 4; - int16_t quarter_h = g_music_tracking_viewport->view_height / 4; + 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 (window_get_classification(gWindowAudioExclusive) == WC_MAIN_WINDOW) { @@ -987,8 +988,8 @@ bool Vehicle::SoundCanPlay() const if (left >= SpriteRect.GetRight() || bottom >= SpriteRect.GetBottom()) return false; - int16_t right = g_music_tracking_viewport->view_width + left; - int16_t top = g_music_tracking_viewport->view_height + bottom; + auto right = g_music_tracking_viewport->view_width + left; + auto top = g_music_tracking_viewport->view_height + bottom; if (window_get_classification(gWindowAudioExclusive) == WC_MAIN_WINDOW) { From ba74393a43fb96258418d3b59f295cc7e32cbe53 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 27 Sep 2021 17:28:43 +0200 Subject: [PATCH 463/681] Remove pointless return statement --- src/openrct2/drawing/Drawing.Sprite.BMP.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp index 3a2925f09c..de822f9d83 100644 --- a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp @@ -101,7 +101,6 @@ void FASTCALL gfx_bmp_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteA // Image is only a transparency mask. Just colour the pixels using the palette map. // Used for glass. DrawBMPSprite(dpi, args); - return; } else if (!(args.SourceImage.flags & G1_FLAG_BMP)) { From ce1d3e9c832c84920d6ff764f20a108c9c891de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 29 Sep 2021 23:06:46 +0200 Subject: [PATCH 464/681] Minor fixes (#15491) --- src/openrct2-ui/scripting/CustomWindow.cpp | 1 + src/openrct2/core/Crypt.OpenRCT2.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index d522e0b35e..d8803a3ed0 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -28,6 +28,7 @@ # include # include # include +# include # include using namespace OpenRCT2; diff --git a/src/openrct2/core/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp index f3ad2d17d5..ba48bd5d15 100644 --- a/src/openrct2/core/Crypt.OpenRCT2.cpp +++ b/src/openrct2/core/Crypt.OpenRCT2.cpp @@ -17,7 +17,7 @@ using namespace Crypt; -class OpenRCT2FNV1aAlgorithm : public FNV1aAlgorithm +class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm { private: static constexpr uint64_t Offset = 0xCBF29CE484222325ULL; From bfe7caacd7385e48e656445b7cc9505a453d4038 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 30 Sep 2021 08:40:58 +0200 Subject: [PATCH 465/681] Fix #15487: map animations do not work correctly in vanilla RCT2 (#15492) Co-authored-by: duncanspumpkin Co-authored-by: duncanspumpkin --- distribution/changelog.txt | 1 + src/openrct2/rct2/S6Exporter.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ceee8213e9..14ded1411b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -27,6 +27,7 @@ - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. +- Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 47ee85946f..620277ab85 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1761,9 +1761,10 @@ void S6Exporter::ExportMapAnimations() auto& dst = _s6.map_animations[i]; dst.type = src.type; + // In RCT12MapAnimation, the x and y coordinates use big coords, while the z coordinate uses small coords. dst.x = src.location.x; dst.y = src.location.y; - dst.baseZ = src.location.z; + dst.baseZ = src.location.z / COORDS_Z_STEP; } } From 94144bcd89a2c5f3f4b73e0a46a68aed5f9fca0a Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 24 Sep 2021 23:21:35 +0200 Subject: [PATCH 466/681] Remove some dead code Reported by clang clang-analyzer-deadcode.DeadStores --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/interface/Widget.cpp | 12 +++++------- src/openrct2-ui/windows/Options.cpp | 3 --- src/openrct2-ui/windows/RideConstruction.cpp | 1 - src/openrct2-ui/windows/ViewClipping.cpp | 2 -- src/openrct2/Game.cpp | 5 +---- src/openrct2/actions/LandSmoothAction.cpp | 12 ++---------- src/openrct2/drawing/Drawing.String.cpp | 1 - src/openrct2/interface/Viewport.cpp | 2 -- .../paint/tile_element/Paint.TileElement.cpp | 2 -- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/ride/Ride.cpp | 1 - src/openrct2/ride/TrackDesign.cpp | 1 - .../scripting/bindings/world/ScTileElement.cpp | 18 ++++++++---------- src/openrct2/util/Util.cpp | 3 +-- 15 files changed, 19 insertions(+), 48 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 813806aa18..fdc312becc 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -342,7 +342,7 @@ public: { window_close_construction_windows(); _currentRideIndex = static_cast(rideIndex); - w = OpenWindow(WC_RIDE_CONSTRUCTION); + OpenWindow(WC_RIDE_CONSTRUCTION); } else { diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 4c883a04c7..db8904b694 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -465,11 +465,9 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget rct_widget* widget = &w->widgets[widgetIndex]; // Resolve the absolute ltrb - int32_t l = w->windowPos.x + widget->left + 5; - int32_t t = w->windowPos.y + widget->top; - int32_t r = w->windowPos.x + widget->right; - int32_t b = w->windowPos.y + widget->bottom; - int32_t textRight = l; + auto l = w->windowPos.x + widget->left + 5; + auto t = w->windowPos.y + widget->top; + auto textRight = l; // Text auto [stringId, formatArgs] = widget_get_stringid_and_args(widget); @@ -491,8 +489,8 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget // Resolve the absolute ltrb l = w->windowPos.x + widget->left; t = w->windowPos.y + widget->top + 4; - r = w->windowPos.x + widget->right; - b = w->windowPos.y + widget->bottom; + const auto r = w->windowPos.x + widget->right; + const auto b = w->windowPos.y + widget->bottom; // Get the colour uint8_t colour = w->colours[widget->colour] & 0x7F; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 58ddd2034b..51f7972ff2 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1005,8 +1005,6 @@ static void window_options_rendering_mouseup(rct_window* w, rct_widgetindex widg static void window_options_rendering_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { - widget = &w->widgets[widgetIndex - 1]; - switch (widgetIndex) { case WIDX_VIRTUAL_FLOOR_DROPDOWN: @@ -1258,7 +1256,6 @@ static void window_options_culture_dropdown(rct_window* w, rct_widgetindex widge } // report error to console regardless log_error("Failed to open language file."); - dropdownIndex = fallbackLanguage - 1; } else { diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f23755bae5..15de24f541 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -3521,7 +3521,6 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); _currentTrackPrice = place_provisional_track_piece( rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); - z = trackPos.z; if (_currentTrackPrice != MONEY32_UNDEFINED) break; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 59a42072c4..e4c897d335 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -250,14 +250,12 @@ static void window_view_clipping_mousedown(rct_window* w, rct_widgetindex widget case WIDX_CLIP_HEIGHT_INCREASE: if (gClipHeight < 255) window_view_clipping_set_clipheight(w, gClipHeight + 1); - mainWindow = window_get_main(); if (mainWindow != nullptr) mainWindow->Invalidate(); break; case WIDX_CLIP_HEIGHT_DECREASE: if (gClipHeight > 0) window_view_clipping_set_clipheight(w, gClipHeight - 1); - mainWindow = window_get_main(); if (mainWindow != nullptr) mainWindow->Invalidate(); break; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 50c8afb43f..4ee5331374 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -519,8 +519,6 @@ void game_fix_save_vars() void game_load_init() { - rct_window* mainWindow; - IGameStateSnapshots* snapshots = GetContext()->GetGameStateSnapshots(); snapshots->Reset(); @@ -530,11 +528,10 @@ void game_load_init() { viewport_init_all(); game_create_windows(); - mainWindow = window_get_main(); } else { - mainWindow = window_get_main(); + const auto mainWindow = window_get_main(); window_unfollow_sprite(mainWindow); } diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 656949a681..0bee3b6253 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -542,17 +542,9 @@ GameActions::Result::Ptr LandSmoothAction::SmoothLand(bool isExecuting) const break; uint8_t newBaseZ = surfaceElement->base_height; uint8_t oldSlope = surfaceElement->GetSlope(); - uint8_t newSlope = oldSlope; int32_t rowIndex = selectionType - (MAP_SELECT_TYPE_EDGE_0 - MAP_SELECT_TYPE_FULL - 1); - - if (raiseLand) - { - newSlope = tile_element_raise_styles[rowIndex][oldSlope]; - } - else - { - newSlope = tile_element_lower_styles[rowIndex][oldSlope]; - } + uint8_t newSlope = raiseLand ? tile_element_raise_styles[rowIndex][oldSlope] + : tile_element_lower_styles[rowIndex][oldSlope]; const bool changeBaseHeight = newSlope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT; if (changeBaseHeight) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 421485132d..e6f1df2dde 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -958,7 +958,6 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info) info->palette[2] = (eax >> 8) & 0xFF; info->palette[3] = (eax >> 16) & 0xFF; info->palette[4] = (eax >> 24) & 0xFF; - eax = 0; } } } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index a3d53b70d7..d301420a88 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -958,8 +958,6 @@ void viewport_paint( height &= bitmask; left &= bitmask; top &= bitmask; - right = left + width; - bottom = top + height; auto x = left - static_cast(viewport->viewPos.x & bitmask); x = x / viewport->zoom; diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index c6fa7c74e9..19c93a786c 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -211,8 +211,6 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) #endif // __TESTPAINT__ dx -= max_height + 32; - - element = tile_element; // pop tile_element dx -= dpi->height; if (dx >= dpi->y) return; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 33cea3719d..f37e29329d 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -4731,7 +4731,7 @@ void Guest::UpdateRideLeaveSpiralSlide() SetDestination(targetLoc); return; } - waypoint = 3; + // Actually force the final waypoint Var37 |= 3; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index df1247b4f8..691bdf8e88 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3416,7 +3416,6 @@ bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying) trackElement = map_get_track_element_at(vehiclePos); vehiclePos.z = trackElement->GetBaseZ(); - direction = trackElement->GetDirection(); } if (!vehicle_create_trains(id, vehiclePos, trackElement)) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 1dca09c289..4af87d4f7c 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -247,7 +247,6 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride) } trackElement.x = newCoords->x; trackElement.y = newCoords->y; - z = newCoords->z; if (track_elements.size() > TD6MaxTrackElements) { diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 18f644c1f9..c582c6dd81 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -63,23 +63,22 @@ namespace OpenRCT2::Scripting void ScTileElement::type_set(std::string value) { - auto type = _element->type; if (value == "surface") - type = TILE_ELEMENT_TYPE_SURFACE; + _element->type = TILE_ELEMENT_TYPE_SURFACE; else if (value == "footpath") - type = TILE_ELEMENT_TYPE_PATH; + _element->type = TILE_ELEMENT_TYPE_PATH; else if (value == "track") - type = TILE_ELEMENT_TYPE_TRACK; + _element->type = TILE_ELEMENT_TYPE_TRACK; else if (value == "small_scenery") - type = TILE_ELEMENT_TYPE_SMALL_SCENERY; + _element->type = TILE_ELEMENT_TYPE_SMALL_SCENERY; else if (value == "entrance") - type = TILE_ELEMENT_TYPE_ENTRANCE; + _element->type = TILE_ELEMENT_TYPE_ENTRANCE; else if (value == "wall") - type = TILE_ELEMENT_TYPE_WALL; + _element->type = TILE_ELEMENT_TYPE_WALL; else if (value == "large_scenery") - type = TILE_ELEMENT_TYPE_LARGE_SCENERY; + _element->type = TILE_ELEMENT_TYPE_LARGE_SCENERY; else if (value == "banner") - type = TILE_ELEMENT_TYPE_BANNER; + _element->type = TILE_ELEMENT_TYPE_BANNER; else { if (value == "openrct2_corrupt_deprecated") @@ -88,7 +87,6 @@ namespace OpenRCT2::Scripting return; } - _element->type = type; Invalidate(); } diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 67e08c80d7..387e890d04 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -387,8 +387,7 @@ utf8* safe_strtrunc(utf8* text, size_t size) const char* sourceLimit = text + size - 1; char* ch = text; char* last = text; - uint32_t codepoint; - while ((codepoint = utf8_get_next(ch, const_cast(&ch))) != 0) + while (utf8_get_next(ch, const_cast(&ch)) != 0) { if (ch <= sourceLimit) { From bb5d09982fbb1adc64e7b65f5a6c0abbf4f107ed Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 29 Sep 2021 23:50:23 +0200 Subject: [PATCH 467/681] Properly name argument --- src/openrct2/world/TileInspector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/TileInspector.h b/src/openrct2/world/TileInspector.h index 212320fa4c..0f204f8bf5 100644 --- a/src/openrct2/world/TileInspector.h +++ b/src/openrct2/world/TileInspector.h @@ -31,7 +31,7 @@ namespace OpenRCT2::TileInspector GameActionResultPtr PasteElementAt(const CoordsXY& loc, TileElement element, bool isExecuting); GameActionResultPtr SortElementsAt(const CoordsXY& loc, bool isExecuting); GameActionResultPtr AnyBaseHeightOffset(const CoordsXY& loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting); - GameActionResultPtr SurfaceShowParkFences(const CoordsXY& loc, bool enabled, bool isExecuting); + GameActionResultPtr SurfaceShowParkFences(const CoordsXY& loc, bool showFences, bool isExecuting); GameActionResultPtr SurfaceToggleCorner(const CoordsXY& loc, int32_t cornerIndex, bool isExecuting); GameActionResultPtr SurfaceToggleDiagonal(const CoordsXY& loc, bool isExecuting); GameActionResultPtr PathSetSloped(const CoordsXY& loc, int32_t elementIndex, bool sloped, bool isExecuting); From e01c9a3afa2196c650da9fd6aaea3da8a55512ed Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 30 Sep 2021 13:02:54 +0100 Subject: [PATCH 468/681] Stream changes from NSF (#15446) * Bring over NSF changes to stream classes * Add orca stream to project files * Bring over util changes as well. * Add const to util and fix util ungzip * Add const and apply review comments * Apply review comments --- OpenRCT2.xcodeproj/project.pbxproj | 5 +- src/openrct2/core/FileStream.cpp | 6 + src/openrct2/core/FileStream.h | 1 + src/openrct2/core/IStream.cpp | 11 + src/openrct2/core/IStream.hpp | 2 + src/openrct2/core/MemoryStream.cpp | 6 + src/openrct2/core/MemoryStream.h | 2 + src/openrct2/core/OrcaStream.hpp | 679 +++++++++++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 1 + src/openrct2/util/Util.cpp | 96 ++++ src/openrct2/util/Util.h | 2 + 11 files changed, 810 insertions(+), 1 deletion(-) create mode 100644 src/openrct2/core/OrcaStream.hpp diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 2277e03052..db876478bd 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -805,6 +805,7 @@ 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */; }; 4653963391E945D397BCCA0C /* ChangeMapSizeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */; }; F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */; }; + B769EFE0AA1149AE93C15DED /* OrcaStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F9061C16C67A45D7915FA229 /* OrcaStream.hpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1913,6 +1914,7 @@ 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Crypt.OpenRCT2.cpp; path = src/openrct2/core/Crypt.OpenRCT2.cpp; sourceTree = SOURCE_ROOT; }; 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChangeMapSizeAction.cpp; path = src/openrct2/actions/ChangeMapSizeAction.cpp; sourceTree = SOURCE_ROOT; }; C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChangeMapSizeAction.h; path = src/openrct2/actions/ChangeMapSizeAction.h; sourceTree = SOURCE_ROOT; }; + F9061C16C67A45D7915FA229 /* OrcaStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = OrcaStream.hpp; path = src/openrct2/core/OrcaStream.hpp; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2567,7 +2569,6 @@ F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */, F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */, 2ADE2F24224418B2002598AF /* Meta.hpp */, - F76C838E1EC4E7CC00FA49E2 /* Nullable.hpp */, 2ADE2F23224418B1002598AF /* Numerics.hpp */, F76C838F1EC4E7CC00FA49E2 /* Path.cpp */, F76C83901EC4E7CC00FA49E2 /* Path.hpp */, @@ -2587,6 +2588,7 @@ F4D523B8782E4C458AF1490D /* GroupVector.hpp */, F28A181D311D4E078FDB090C /* ZipStream.hpp */, 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */, + F9061C16C67A45D7915FA229 /* OrcaStream.hpp */, ); path = core; sourceTree = ""; @@ -3672,6 +3674,7 @@ C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */, B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */, F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */, + B769EFE0AA1149AE93C15DED /* OrcaStream.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/openrct2/core/FileStream.cpp b/src/openrct2/core/FileStream.cpp index 68c0b52692..b95b220fe5 100644 --- a/src/openrct2/core/FileStream.cpp +++ b/src/openrct2/core/FileStream.cpp @@ -13,6 +13,7 @@ #include "String.hpp" #include +#include #ifndef _WIN32 # include @@ -42,6 +43,11 @@ namespace OpenRCT2 { } + FileStream::FileStream(std::string_view path, int32_t fileMode) + : FileStream(std::string(path), fileMode) + { + } + FileStream::FileStream(const utf8* path, int32_t fileMode) { const char* mode; diff --git a/src/openrct2/core/FileStream.h b/src/openrct2/core/FileStream.h index d9fdcffd3d..572bd80c55 100644 --- a/src/openrct2/core/FileStream.h +++ b/src/openrct2/core/FileStream.h @@ -38,6 +38,7 @@ namespace OpenRCT2 public: FileStream(const fs::path& path, int32_t fileMode); FileStream(const std::string& path, int32_t fileMode); + FileStream(std::string_view path, int32_t fileMode); FileStream(const utf8* path, int32_t fileMode); ~FileStream() override; diff --git a/src/openrct2/core/IStream.cpp b/src/openrct2/core/IStream.cpp index 88bf74d02e..995b79feda 100644 --- a/src/openrct2/core/IStream.cpp +++ b/src/openrct2/core/IStream.cpp @@ -57,6 +57,17 @@ namespace OpenRCT2 } } + void IStream::WriteString(const std::string_view str) + { + for (const auto c : str) + { + if (c == '\0') + break; + WriteValue(c); + } + WriteValue(0); + } + void IStream::WriteString(const std::string& str) { WriteString(str.c_str()); diff --git a/src/openrct2/core/IStream.hpp b/src/openrct2/core/IStream.hpp index 815990d8dc..58449729c2 100644 --- a/src/openrct2/core/IStream.hpp +++ b/src/openrct2/core/IStream.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #ifdef __WARN_SUGGEST_FINAL_METHODS__ @@ -207,6 +208,7 @@ namespace OpenRCT2 utf8* ReadString(); std::string ReadStdString(); void WriteString(const utf8* str); + void WriteString(const std::string_view string); void WriteString(const std::string& string); }; diff --git a/src/openrct2/core/MemoryStream.cpp b/src/openrct2/core/MemoryStream.cpp index 79329aaf7b..ea898fcc75 100644 --- a/src/openrct2/core/MemoryStream.cpp +++ b/src/openrct2/core/MemoryStream.cpp @@ -262,6 +262,12 @@ namespace OpenRCT2 Write<16>(buffer); } + void MemoryStream::Clear() + { + _dataSize = 0; + SetPosition(0); + } + void MemoryStream::EnsureCapacity(size_t capacity) { if (_dataCapacity < capacity) diff --git a/src/openrct2/core/MemoryStream.h b/src/openrct2/core/MemoryStream.h index 918d0a6f6d..f3dba1d69d 100644 --- a/src/openrct2/core/MemoryStream.h +++ b/src/openrct2/core/MemoryStream.h @@ -112,6 +112,8 @@ namespace OpenRCT2 uint64_t TryRead(void* buffer, uint64_t length) override; + void Clear(); + private: void EnsureCapacity(size_t capacity); }; diff --git a/src/openrct2/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp new file mode 100644 index 0000000000..30f25ba4ba --- /dev/null +++ b/src/openrct2/core/OrcaStream.hpp @@ -0,0 +1,679 @@ +/***************************************************************************** + * Copyright (c) 2014-2019 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 "../world/Location.hpp" +#include "Crypt.h" +#include "FileStream.h" +#include "MemoryStream.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace OpenRCT2 +{ + class OrcaStream + { + public: + enum class Mode + { + READING, + WRITING, + }; + + static constexpr uint32_t COMPRESSION_NONE = 0; + static constexpr uint32_t COMPRESSION_GZIP = 1; + + private: +#pragma pack(push, 1) + struct Header + { + uint32_t Magic{}; + uint32_t TargetVersion{}; + uint32_t MinVersion{}; + uint32_t NumChunks{}; + uint64_t UncompressedSize{}; + uint32_t Compression{}; + uint64_t CompressedSize{}; + std::array FNV1a{}; + uint8_t padding[20]; + }; + static_assert(sizeof(Header) == 64, "Header should be 64 bytes"); + + struct ChunkEntry + { + uint32_t Id{}; + uint64_t Offset{}; + uint64_t Length{}; + }; +#pragma pack(pop) + + IStream* _stream; + Mode _mode; + Header _header; + std::vector _chunks; + MemoryStream _buffer; + ChunkEntry _currentChunk; + + public: + OrcaStream(IStream& stream, const Mode mode) + { + _stream = &stream; + _mode = mode; + if (mode == Mode::READING) + { + _header = _stream->ReadValue
(); + + _chunks.clear(); + for (uint32_t i = 0; i < _header.NumChunks; i++) + { + auto entry = _stream->ReadValue(); + _chunks.push_back(entry); + } + + // Read compressed data into buffer (read in blocks) + _buffer = MemoryStream{}; + uint8_t temp[2048]; + uint64_t bytesLeft = _header.CompressedSize; + do + { + auto readLen = std::min(size_t(bytesLeft), sizeof(temp)); + _stream->Read(temp, readLen); + _buffer.Write(temp, readLen); + bytesLeft -= readLen; + } while (bytesLeft > 0); + + // Uncompress + if (_header.Compression == COMPRESSION_GZIP) + { + auto uncompressedData = Ungzip(_buffer.GetData(), _buffer.GetLength()); + if (_header.UncompressedSize != uncompressedData.size()) + { + // Warning? + } + _buffer.Clear(); + _buffer.Write(uncompressedData.data(), uncompressedData.size()); + } + } + else + { + _header = {}; + _header.Compression = COMPRESSION_GZIP; + + _buffer = MemoryStream{}; + } + } + + OrcaStream(const OrcaStream&) = delete; + + ~OrcaStream() + { + if (_mode == Mode::WRITING) + { + const void* uncompressedData = _buffer.GetData(); + const uint64_t uncompressedSize = _buffer.GetLength(); + + _header.NumChunks = static_cast(_chunks.size()); + _header.UncompressedSize = uncompressedSize; + _header.CompressedSize = uncompressedSize; + _header.FNV1a = Crypt::FNV1a(uncompressedData, uncompressedSize); + + // Compress data + std::optional> compressedBytes; + if (_header.Compression == COMPRESSION_GZIP) + { + compressedBytes = Gzip(uncompressedData, uncompressedSize); + if (compressedBytes) + { + _header.CompressedSize = compressedBytes->size(); + } + else + { + // Compression failed + _header.Compression = COMPRESSION_NONE; + } + } + + // Write header and chunk table + _stream->WriteValue(_header); + for (const auto& chunk : _chunks) + { + _stream->WriteValue(chunk); + } + + // Write chunk data + if (compressedBytes) + { + _stream->Write(compressedBytes->data(), compressedBytes->size()); + } + else + { + _stream->Write(uncompressedData, uncompressedSize); + } + } + } + + Mode GetMode() const + { + return _mode; + } + + Header& GetHeader() + { + return _header; + } + + const Header& GetHeader() const + { + return _header; + } + + template bool ReadWriteChunk(const uint32_t chunkId, TFunc f) + { + if (_mode == Mode::READING) + { + if (SeekChunk(chunkId)) + { + ChunkStream stream(_buffer, _mode); + f(stream); + return true; + } + + return false; + } + + _currentChunk.Id = chunkId; + _currentChunk.Offset = _buffer.GetPosition(); + _currentChunk.Length = 0; + ChunkStream stream(_buffer, _mode); + f(stream); + _currentChunk.Length = static_cast(_buffer.GetPosition()) - _currentChunk.Offset; + _chunks.push_back(_currentChunk); + return true; + } + + private: + bool SeekChunk(const uint32_t id) + { + const auto result = std::find_if(_chunks.begin(), _chunks.end(), [id](const ChunkEntry& e) { return e.Id == id; }); + if (result != _chunks.end()) + { + const auto offset = result->Offset; + _buffer.SetPosition(offset); + return true; + } + return false; + } + + public: + class ChunkStream + { + private: + struct ArrayState + { + std::streampos StartPos{}; + std::streampos LastPos{}; + size_t Count{}; + size_t ElementSize{}; + }; + + MemoryStream& _buffer; + Mode _mode; + std::stack _arrayStack; + + public: + ChunkStream(MemoryStream& buffer, const Mode mode) + : _buffer(buffer) + , _mode(mode) + { + } + + Mode GetMode() const + { + return _mode; + } + + MemoryStream& GetStream() + { + return _buffer; + } + + void ReadWrite(void* addr, const size_t len) + { + if (_mode == Mode::READING) + { + ReadBuffer(addr, len); + } + else + { + WriteBuffer(addr, len); + } + } + + void Read(void* addr, const size_t len) + { + if (_mode == Mode::READING) + { + ReadBuffer(addr, len); + } + else + { + throw std::runtime_error("Incorrect mode"); + } + } + + void Write(const void* addr, const size_t len) + { + if (_mode == Mode::READING) + { + throw std::runtime_error("Incorrect mode"); + } + else + { + WriteBuffer(addr, len); + } + } + + template::value, bool> = true> void ReadWrite(T& v) + { + if (_mode == Mode::READING) + { + v = ReadInteger(); + } + else + { + WriteInteger(v); + } + } + + template::value, bool> = true> void ReadWrite(T& v) + { + using underlying = typename std::underlying_type::type; + if (_mode == Mode::READING) + { + v = static_cast(ReadInteger()); + } + else + { + WriteInteger(static_cast(v)); + } + } + + void ReadWrite(bool& value) + { + uint8_t value8 = value ? 1 : 0; + ReadWrite(&value8, sizeof(value8)); + value = value8 != 0; + } + + void ReadWrite(CoordsXY& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + } + + void ReadWrite(CoordsXYZ& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + ReadWrite(coords.z); + } + + void ReadWrite(CoordsXYZD& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + ReadWrite(coords.z); + ReadWrite(coords.direction); + } + + void ReadWrite(TileCoordsXY& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + } + + void ReadWrite(TileCoordsXYZ& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + ReadWrite(coords.z); + } + + void ReadWrite(TileCoordsXYZD& coords) + { + ReadWrite(coords.x); + ReadWrite(coords.y); + ReadWrite(coords.z); + ReadWrite(coords.direction); + } + + template::value>> T Read() + { + T v{}; + ReadWrite(v); + return v; + } + + void ReadWrite(std::string& v) + { + if (_mode == Mode::READING) + { + v = ReadString(); + } + else + { + WriteString(v); + } + } + + template::value>> void Write(T v) + { + if (_mode == Mode::READING) + { + T temp{}; + ReadWrite(temp); + } + else + { + ReadWrite(v); + } + } + + void Write(const char* v) + { + std::string_view sv; + if (v != nullptr) + sv = v; + Write(sv); + } + + void Write(const std::string_view v) + { + if (_mode == Mode::READING) + { + std::string temp; + ReadWrite(temp); + } + else + { + WriteString(v); + } + } + + void Write(const std::string& v) + { + Write(std::string_view(v)); + } + + template void ReadWriteVector(TVec& vec, TFunc f) + { + if (_mode == Mode::READING) + { + const auto count = BeginArray(); + vec.clear(); + for (size_t i = 0; i < count; i++) + { + auto& el = vec.emplace_back(); + f(el); + NextArrayElement(); + } + EndArray(); + } + else + { + BeginArray(); + for (auto& el : vec) + { + f(el); + NextArrayElement(); + } + EndArray(); + } + } + + template void ReadWriteArray(TArr (&arr)[TArrSize], TFunc f) + { + auto& arr2 = *(reinterpret_cast*>(arr)); + ReadWriteArray(arr2, f); + } + + template + void ReadWriteArray(std::array& arr, TFunc f) + { + if (_mode == Mode::READING) + { + const auto count = BeginArray(); + for (auto& el : arr) + { + el = {}; + } + for (size_t i = 0; i < count; i++) + { + if (i < TArrSize) + { + f(arr[i]); + } + NextArrayElement(); + } + EndArray(); + } + else + { + BeginArray(); + for (auto& el : arr) + { + if (f(el)) + { + NextArrayElement(); + } + } + EndArray(); + } + } + + template void Ignore() + { + T value{}; + ReadWrite(value); + } + + private: + void ReadBuffer(void* dst, const size_t len) + { + _buffer.Read(dst, len); + } + + void WriteBuffer(const void* buffer, const size_t len) + { + _buffer.Write(buffer, len); + } + + template::value>> T ReadInteger() + { + if constexpr (sizeof(T) > 4) + { + if constexpr (std::is_signed()) + { + int64_t raw{}; + Read(&raw, sizeof(raw)); + return static_cast(raw); + } + + uint64_t raw{}; + Read(&raw, sizeof(raw)); + return static_cast(raw); + } + else + { + if constexpr (std::is_signed()) + { + int32_t raw{}; + Read(&raw, sizeof(raw)); + if (raw < std::numeric_limits::min() || raw > std::numeric_limits::max()) + { + throw std::runtime_error("Value is incompatible with internal type."); + } + return static_cast(raw); + } + else + { + uint32_t raw{}; + Read(&raw, sizeof(raw)); + if (raw > std::numeric_limits::max()) + { + throw std::runtime_error("Value is incompatible with internal type."); + } + return static_cast(raw); + } + } + } + + template::value>> void WriteInteger(const T value) + { + if constexpr (sizeof(T) > 4) + { + if constexpr (std::is_signed()) + { + auto raw = static_cast(value); + Write(&raw, sizeof(raw)); + } + else + { + auto raw = static_cast(value); + Write(&raw, sizeof(raw)); + } + } + else + { + if constexpr (std::is_signed()) + { + auto raw = static_cast(value); + Write(&raw, sizeof(raw)); + } + else + { + auto raw = static_cast(value); + Write(&raw, sizeof(raw)); + } + } + } + + std::string ReadString() + { + std::string buffer; + buffer.reserve(64); + while (true) + { + char c{}; + ReadBuffer(&c, sizeof(c)); + if (c == '\0') + { + break; + } + buffer.push_back(c); + } + buffer.shrink_to_fit(); + return buffer; + } + + void WriteString(const std::string_view s) + { + const char nullt = '\0'; + auto len = s.find('\0'); + if (len == std::string_view::npos) + { + len = s.size(); + } + _buffer.Write(s.data(), len); + _buffer.Write(&nullt, sizeof(nullt)); + } + + size_t BeginArray() + { + auto& arrayState = _arrayStack.emplace(); + if (_mode == Mode::READING) + { + arrayState.Count = Read(); + arrayState.ElementSize = Read(); + arrayState.LastPos = _buffer.GetPosition(); + return arrayState.Count; + } + + arrayState.Count = 0; + arrayState.ElementSize = 0; + arrayState.StartPos = _buffer.GetPosition(); + Write(0); + Write(0); + arrayState.LastPos = _buffer.GetPosition(); + return 0; + } + + bool NextArrayElement() + { + auto& arrayState = _arrayStack.top(); + if (_mode == Mode::READING) + { + if (arrayState.Count == 0) + { + return false; + } + if (arrayState.ElementSize != 0) + { + arrayState.LastPos += arrayState.ElementSize; + _buffer.SetPosition(arrayState.LastPos); + } + arrayState.Count--; + return arrayState.Count == 0; + } + + const auto lastElSize = static_cast(_buffer.GetPosition()) - arrayState.LastPos; + if (arrayState.Count == 0) + { + // Set array element size based on first element size + arrayState.ElementSize = lastElSize; + } + else if (arrayState.ElementSize != lastElSize) + { + // Array element size was different from first element so reset it + // to dynamic + arrayState.ElementSize = 0; + } + arrayState.Count++; + arrayState.LastPos = _buffer.GetPosition(); + return true; + } + + void EndArray() + { + auto& arrayState = _arrayStack.top(); + if (_mode == Mode::WRITING) + { + const size_t backupPos = _buffer.GetPosition(); + if (backupPos != static_cast(arrayState.StartPos) + 8 && arrayState.Count == 0) + { + throw std::runtime_error("Array data was written but no elements were added."); + } + _buffer.SetPosition(arrayState.StartPos); + Write(static_cast(arrayState.Count)); + Write(static_cast(arrayState.ElementSize)); + _buffer.SetPosition(backupPos); + } + _arrayStack.pop(); + } + }; + }; +} // namespace OpenRCT2 diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 94467bebb8..2e110ea5d6 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -177,6 +177,7 @@ + diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 67e08c80d7..1894dd4472 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -693,6 +693,102 @@ bool util_gzip_compress(FILE* source, FILE* dest) return true; } +std::vector Gzip(const void* data, const size_t dataLen) +{ + assert(data != nullptr); + + std::vector output; + z_stream strm{}; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + + { + const auto ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 | 16, 8, Z_DEFAULT_STRATEGY); + if (ret != Z_OK) + { + throw std::runtime_error("deflateInit2 failed with error " + std::to_string(ret)); + } + } + + int flush = 0; + const auto* src = static_cast(data); + size_t srcRemaining = dataLen; + do + { + const auto nextBlockSize = std::min(srcRemaining, CHUNK); + srcRemaining -= nextBlockSize; + + flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; + strm.avail_in = static_cast(nextBlockSize); + strm.next_in = const_cast(src); + do + { + output.resize(output.size() + nextBlockSize); + strm.avail_out = static_cast(nextBlockSize); + strm.next_out = &output[output.size() - nextBlockSize]; + const auto ret = deflate(&strm, flush); + if (ret == Z_STREAM_ERROR) + { + throw std::runtime_error("deflate failed with error " + std::to_string(ret)); + } + output.resize(output.size() - strm.avail_out); + } while (strm.avail_out == 0); + + src += nextBlockSize; + } while (flush != Z_FINISH); + deflateEnd(&strm); + return output; +} + +std::vector Ungzip(const void* data, const size_t dataLen) +{ + assert(data != nullptr); + + std::vector output; + z_stream strm{}; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + + { + const auto ret = inflateInit2(&strm, 15 | 16); + if (ret != Z_OK) + { + throw std::runtime_error("inflateInit2 failed with error " + std::to_string(ret)); + } + } + + int flush = 0; + const auto* src = static_cast(data); + size_t srcRemaining = dataLen; + do + { + const auto nextBlockSize = std::min(srcRemaining, CHUNK); + srcRemaining -= nextBlockSize; + + flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; + strm.avail_in = static_cast(nextBlockSize); + strm.next_in = const_cast(src); + do + { + output.resize(output.size() + nextBlockSize); + strm.avail_out = static_cast(nextBlockSize); + strm.next_out = &output[output.size() - nextBlockSize]; + const auto ret = inflate(&strm, flush); + if (ret == Z_STREAM_ERROR) + { + throw std::runtime_error("deflate failed with error " + std::to_string(ret)); + } + output.resize(output.size() - strm.avail_out); + } while (strm.avail_out == 0); + + src += nextBlockSize; + } while (flush != Z_FINISH); + inflateEnd(&strm); + return output; +} + // Type-independent code left as macro to reduce duplicate code. #define add_clamp_body(value, value_to_add, min_cap, max_cap) \ if ((value_to_add > 0) && (value > (max_cap - (value_to_add)))) \ diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 678da94245..5acfa086fd 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -58,6 +58,8 @@ uint32_t util_rand(); std::optional> util_zlib_deflate(const uint8_t* data, size_t data_in_size); uint8_t* util_zlib_inflate(const uint8_t* data, size_t data_in_size, size_t* data_out_size); bool util_gzip_compress(FILE* source, FILE* dest); +std::vector Gzip(const void* data, const size_t dataLen); +std::vector Ungzip(const void* data, const size_t dataLen); int8_t add_clamp_int8_t(int8_t value, int8_t value_to_add); int16_t add_clamp_int16_t(int16_t value, int16_t value_to_add); From c492362e454170d2c3e494b1efc2cc5e58e51a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 30 Sep 2021 15:34:22 +0300 Subject: [PATCH 469/681] Fix mistake and cleanup --- src/openrct2/peep/Guest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 3a09bc14cd..12e87098b9 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -5028,12 +5028,12 @@ void Guest::UpdateRideShopLeave() if (auto loc = UpdateAction(); loc.has_value()) { const auto curLoc = GetLocation(); - MoveTo({ loc.value(), curLoc.z }); - if ((curLoc.x & 0xFFE0) != NextLoc.x) + const auto newLoc = GetLocation().ToTileStart(); + if (newLoc.x != NextLoc.x) return; - if ((curLoc.y & 0xFFE0) != NextLoc.y) + if (newLoc.y != NextLoc.y) return; } From 429e34d7f3b521c1d321d5fcfe8acfa615b77617 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 30 Sep 2021 14:34:07 +0200 Subject: [PATCH 470/681] Make uses of window_get_main use (const) auto* --- src/openrct2/Game.cpp | 2 +- src/openrct2/drawing/Weather.cpp | 2 +- src/openrct2/interface/Window.cpp | 12 ++++++------ src/openrct2/ride/Ride.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 4ee5331374..71af68a684 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -531,7 +531,7 @@ void game_load_init() } else { - const auto mainWindow = window_get_main(); + auto* mainWindow = window_get_main(); window_unfollow_sprite(mainWindow); } diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index c8fdb13670..ae9a116ef3 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -53,7 +53,7 @@ void DrawWeather(rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer) { uint32_t viewFlags = 0; - rct_viewport* viewport = window_get_viewport(window_get_main()); + const auto* viewport = window_get_viewport(window_get_main()); if (viewport != nullptr) viewFlags = viewport->flags; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 5bd3668607..9f9ab78880 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1086,7 +1086,7 @@ void main_window_zoom(bool zoomIn, bool atCursor) { if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { - rct_window* mainWindow = window_get_main(); + auto* mainWindow = window_get_main(); if (mainWindow != nullptr) window_zoom_set(mainWindow, mainWindow->viewport->zoom + (zoomIn ? -1 : 1), atCursor); } @@ -1706,7 +1706,7 @@ void window_resize_gui(int32_t width, int32_t height) */ void window_resize_gui_scenario_editor(int32_t width, int32_t height) { - rct_window* mainWind = window_get_main(); + auto* mainWind = window_get_main(); if (mainWind != nullptr) { rct_viewport* viewport = mainWind->viewport; @@ -1797,7 +1797,7 @@ void window_update_viewport_ride_music() static void window_snap_left(rct_window* w, int32_t proximity) { - auto mainWindow = window_get_main(); + const auto* mainWindow = window_get_main(); auto wBottom = w->windowPos.y + w->height; auto wLeftProximity = w->windowPos.x - (proximity * 2); auto wRightProximity = w->windowPos.x + (proximity * 2); @@ -1827,7 +1827,7 @@ static void window_snap_left(rct_window* w, int32_t proximity) static void window_snap_top(rct_window* w, int32_t proximity) { - auto mainWindow = window_get_main(); + const auto* mainWindow = window_get_main(); auto wRight = w->windowPos.x + w->width; auto wTopProximity = w->windowPos.y - (proximity * 2); auto wBottomProximity = w->windowPos.y + (proximity * 2); @@ -1857,7 +1857,7 @@ static void window_snap_top(rct_window* w, int32_t proximity) static void window_snap_right(rct_window* w, int32_t proximity) { - auto mainWindow = window_get_main(); + const auto* mainWindow = window_get_main(); auto wRight = w->windowPos.x + w->width; auto wBottom = w->windowPos.y + w->height; auto wLeftProximity = wRight - (proximity * 2); @@ -1887,7 +1887,7 @@ static void window_snap_right(rct_window* w, int32_t proximity) static void window_snap_bottom(rct_window* w, int32_t proximity) { - auto mainWindow = window_get_main(); + const auto* mainWindow = window_get_main(); auto wRight = w->windowPos.x + w->width; auto wBottom = w->windowPos.y + w->height; auto wTopProximity = wBottom - (proximity * 2); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 691bdf8e88..d90387ee35 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3704,7 +3704,7 @@ static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying) */ void Ride::ConstructMissingEntranceOrExit() const { - rct_window* w = window_get_main(); + auto* w = window_get_main(); if (w == nullptr) return; @@ -3757,7 +3757,7 @@ void Ride::ConstructMissingEntranceOrExit() const */ static void ride_scroll_to_track_error(CoordsXYE* trackElement) { - rct_window* w = window_get_main(); + auto* w = window_get_main(); if (w != nullptr) { window_scroll_to_location(w, { *trackElement, trackElement->element->GetBaseZ() }); From 456e54b022d147230c2925cf52e873ca99c94d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 30 Sep 2021 05:37:23 -0700 Subject: [PATCH 471/681] Remove useless comment Co-authored-by: Michael Steenbeek --- src/openrct2/peep/Peep.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 832070280d..b764fa4fbf 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -473,7 +473,6 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_2; - // Create sick at location const auto curLoc = GetLocation(); Litter::Create({ curLoc, sprite_direction }, (sprite_index & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); From c74984740b3c87d8bf08f75049e97978690e80b1 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 1 Oct 2021 13:48:27 +0200 Subject: [PATCH 472/681] Pass ride ref to paint_swinging_inverter_ship_structure() --- .../ride/thrill/SwingingInverterShip.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index faca18d95b..31eccf4b27 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -49,19 +49,19 @@ static constexpr const uint32_t swinging_inverter_ship_frame_sprites[] = { SPR_S SPR_SWINGING_INVERTER_SHIP_FRAME_3 }; static void paint_swinging_inverter_ship_structure( - paint_session* session, const Ride* ride, uint8_t direction, int8_t axisOffset, uint16_t height) + paint_session* session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) { const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); - rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); + rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); Vehicle* vehicle = nullptr; int8_t xOffset = !(direction & 1) ? axisOffset : 0; int8_t yOffset = (direction & 1) ? axisOffset : 0; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride->vehicles[0] != SPRITE_INDEX_NULL) + if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride.vehicles[0] != SPRITE_INDEX_NULL) { - vehicle = GetEntity(ride->vehicles[0]); + vehicle = GetEntity(ride.vehicles[0]); session->InteractionType = ViewportInteractionItem::Entity; session->CurrentlyDrawnItem = vehicle; @@ -92,7 +92,7 @@ static void paint_swinging_inverter_ship_structure( uint32_t colourFlags = session->TrackColours[SCHEME_MISC]; if (colourFlags == IMAGE_TYPE_REMAP) { - colourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim); + colourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); } swinging_inverter_ship_bound_box boundBox = swinging_inverter_ship_bounds[direction]; @@ -179,16 +179,16 @@ static void paint_swinging_inverter_ship( switch (relativeTrackSequence) { case 1: - paint_swinging_inverter_ship_structure(session, ride, direction, 48, height + 7); + paint_swinging_inverter_ship_structure(session, *ride, direction, 48, height + 7); break; case 2: - paint_swinging_inverter_ship_structure(session, ride, direction, 16, height + 7); + paint_swinging_inverter_ship_structure(session, *ride, direction, 16, height + 7); break; case 0: - paint_swinging_inverter_ship_structure(session, ride, direction, -16, height + 7); + paint_swinging_inverter_ship_structure(session, *ride, direction, -16, height + 7); break; case 3: - paint_swinging_inverter_ship_structure(session, ride, direction, -48, height + 7); + paint_swinging_inverter_ship_structure(session, *ride, direction, -48, height + 7); break; } } From d3cfa07a2af20e1fb85993f0ae849f62f3a600e3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 1 Oct 2021 13:50:04 +0200 Subject: [PATCH 473/681] Fix #15496: crash in paint_swinging_inverter_ship_structure() --- distribution/changelog.txt | 1 + src/openrct2/ride/thrill/SwingingInverterShip.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 14ded1411b..5b1ac91904 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. +- Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 31eccf4b27..eac661e59e 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -54,6 +54,9 @@ static void paint_swinging_inverter_ship_structure( const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); + if (rideEntry == nullptr) + return; + Vehicle* vehicle = nullptr; int8_t xOffset = !(direction & 1) ? axisOffset : 0; From 6de1868ad8cd0ec879c38327f08a7a53cc09c121 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 1 Oct 2021 01:15:07 +0200 Subject: [PATCH 474/681] Use (const) references to widgets where possible Note: The change from `w->widgets[WIDX_ENTRY_PRICE]` to `entryPriceWidget` is intended. --- src/openrct2-ui/input/MouseInput.cpp | 50 ++-- src/openrct2-ui/interface/Widget.cpp | 233 +++++++++--------- src/openrct2-ui/interface/Window.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 73 +++--- .../windows/EditorScenarioOptions.cpp | 100 ++++---- src/openrct2-ui/windows/Guest.cpp | 58 ++--- src/openrct2-ui/windows/NewsOptions.cpp | 13 +- src/openrct2-ui/windows/Ride.cpp | 56 ++--- src/openrct2-ui/windows/ScenarioSelect.cpp | 14 +- src/openrct2-ui/windows/ServerList.cpp | 20 +- src/openrct2-ui/windows/Staff.cpp | 34 ++- src/openrct2-ui/windows/TopToolbar.cpp | 8 +- src/openrct2/interface/Widget.h | 2 +- src/openrct2/interface/Window.cpp | 43 ++-- 14 files changed, 353 insertions(+), 355 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index d03500d4b5..25ab4a76ca 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -194,14 +194,14 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind rct_widgetindex widgetIndex = _dragWidget.widget_index; uint8_t scrollIndex = _dragScrollIndex; - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; rct_scroll* scroll = &w->scrolls[scrollIndex]; ScreenCoordsXY differentialCoords = screenCoords - gInputDragLast; if (scroll->flags & HSCROLLBAR_VISIBLE) { - int16_t size = widget->width() - 1; + int16_t size = widget.width() - 1; if (scroll->flags & VSCROLLBAR_VISIBLE) size -= 11; size = std::max(0, scroll->h_right - size); @@ -210,7 +210,7 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind if (scroll->flags & VSCROLLBAR_VISIBLE) { - int16_t size = widget->height() - 1; + int16_t size = widget.height() - 1; if (scroll->flags & HSCROLLBAR_VISIBLE) size -= 11; size = std::max(0, scroll->v_bottom - size); @@ -604,9 +604,7 @@ static void InputViewportDragEnd() static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { - rct_widget* widget; - - widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; _inputState = InputState::ScrollLeft; gPressedWidget.window_classification = w->classification; @@ -617,7 +615,7 @@ static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const S int32_t scroll_area, scroll_id; ScreenCoordsXY scrollCoords; scroll_id = 0; // safety - WidgetScrollGetPart(w, widget, screenCoords, scrollCoords, &scroll_area, &scroll_id); + WidgetScrollGetPart(w, &widget, screenCoords, scrollCoords, &scroll_area, &scroll_id); _currentScrollArea = scroll_area; _currentScrollIndex = scroll_id; @@ -628,15 +626,15 @@ static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const S return; } - rct_widget* widg = &w->widgets[widgetIndex]; + const auto& widg = w->widgets[widgetIndex]; rct_scroll* scroll = &w->scrolls[scroll_id]; - int32_t widget_width = widg->width() - 1; + int32_t widget_width = widg.width() - 1; if (scroll->flags & VSCROLLBAR_VISIBLE) widget_width -= SCROLLBAR_WIDTH + 1; int32_t widget_content_width = std::max(scroll->h_right - widget_width, 0); - int32_t widget_height = widg->bottom - widg->top - 1; + int32_t widget_height = widg.bottom - widg.top - 1; if (scroll->flags & HSCROLLBAR_VISIBLE) widget_height -= SCROLLBAR_WIDTH + 1; int32_t widget_content_height = std::max(scroll->v_bottom - widget_height, 0); @@ -676,12 +674,11 @@ static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const S static void InputScrollContinue(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { - rct_widget* widget; int32_t scroll_part, scroll_id; assert(w != nullptr); - widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (w->classification != gPressedWidget.window_classification || w->number != gPressedWidget.window_number || widgetIndex != gPressedWidget.widget_index) { @@ -690,7 +687,7 @@ static void InputScrollContinue(rct_window* w, rct_widgetindex widgetIndex, cons } ScreenCoordsXY newScreenCoords; - WidgetScrollGetPart(w, widget, screenCoords, newScreenCoords, &scroll_part, &scroll_id); + WidgetScrollGetPart(w, &widget, screenCoords, newScreenCoords, &scroll_part, &scroll_id); if (_currentScrollArea == SCROLL_PART_HSCROLLBAR_THUMB) { @@ -746,14 +743,14 @@ static void InputScrollEnd() */ static void InputScrollPartUpdateHThumb(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t scroll_id) { - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newLeft; newLeft = w->scrolls[scroll_id].h_right; newLeft *= x; - x = widget->width() - 21; + x = widget.width() - 21; if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) x -= SCROLLBAR_WIDTH + 1; newLeft /= x; @@ -763,7 +760,7 @@ static void InputScrollPartUpdateHThumb(rct_window* w, rct_widgetindex widgetInd newLeft += x; if (newLeft < 0) newLeft = 0; - x = widget->width() - 1; + x = widget.width() - 1; if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) x -= SCROLLBAR_WIDTH + 1; x *= -1; @@ -785,14 +782,14 @@ static void InputScrollPartUpdateHThumb(rct_window* w, rct_widgetindex widgetInd static void InputScrollPartUpdateVThumb(rct_window* w, rct_widgetindex widgetIndex, int32_t y, int32_t scroll_id) { assert(w != nullptr); - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newTop; newTop = w->scrolls[scroll_id].v_bottom; newTop *= y; - y = widget->height() - 21; + y = widget.height() - 21; if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) y -= SCROLLBAR_WIDTH + 1; newTop /= y; @@ -802,7 +799,7 @@ static void InputScrollPartUpdateVThumb(rct_window* w, rct_widgetindex widgetInd newTop += y; if (newTop < 0) newTop = 0; - y = widget->height() - 1; + y = widget.height() - 1; if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) y -= SCROLLBAR_WIDTH + 1; y *= -1; @@ -841,12 +838,12 @@ static void InputScrollPartUpdateHLeft(rct_window* w, rct_widgetindex widgetInde static void InputScrollPartUpdateHRight(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id) { assert(w != nullptr); - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= HSCROLLBAR_RIGHT_PRESSED; w->scrolls[scroll_id].h_left += 3; - int32_t newLeft = widget->width() - 1; + int32_t newLeft = widget.width() - 1; if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) newLeft -= SCROLLBAR_WIDTH + 1; newLeft *= -1; @@ -884,12 +881,12 @@ static void InputScrollPartUpdateVTop(rct_window* w, rct_widgetindex widgetIndex static void InputScrollPartUpdateVBottom(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id) { assert(w != nullptr); - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { w->scrolls[scroll_id].flags |= VSCROLLBAR_DOWN_PRESSED; w->scrolls[scroll_id].v_top += 3; - int32_t newTop = widget->height() - 1; + int32_t newTop = widget.height() - 1; if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) newTop -= SCROLLBAR_WIDTH + 1; newTop *= -1; @@ -1000,7 +997,6 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, r { rct_windowclass windowClass = WC_NULL; rct_windownumber windowNumber = 0; - rct_widget* widget; if (w != nullptr) { @@ -1026,9 +1022,9 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, r window_cancel_textbox(); } - widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; - switch (widget->type) + switch (widget.type) { case WindowWidgetType::Frame: case WindowWidgetType::Resize: @@ -1060,7 +1056,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, r default: if (WidgetIsEnabled(w, widgetIndex) && !WidgetIsDisabled(w, widgetIndex)) { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + widget->midX()); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + widget.midX()); // Set new cursor down widget gPressedWidget.window_classification = windowClass; diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index db8904b694..4748f30afa 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -47,7 +47,8 @@ static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind */ void WidgetDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { - switch (w->widgets[widgetIndex].type) + const auto& widget = w->widgets[widgetIndex]; + switch (widget.type) { case WindowWidgetType::Frame: WidgetFrameDraw(dpi, w, widgetIndex); @@ -111,18 +112,18 @@ void WidgetDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetInd static void WidgetFrameDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - auto leftTop = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - int32_t r = w->windowPos.x + widget->right; - int32_t b = w->windowPos.y + widget->bottom; + auto leftTop = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; + int32_t r = w->windowPos.x + widget.right; + int32_t b = w->windowPos.y + widget.bottom; // uint8_t press = ((w->flags & WF_10) ? INSET_RECT_FLAG_FILL_MID_LIGHT : 0); // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Draw the frame gfx_fill_rect_inset(dpi, { leftTop, { r, b } }, colour, press); @@ -134,7 +135,7 @@ static void WidgetFrameDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind return; // Draw the resize sprite at the bottom right corner - leftTop = w->windowPos + ScreenCoordsXY{ widget->right - 18, widget->bottom - 18 }; + leftTop = w->windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 }; gfx_draw_sprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop); } @@ -145,15 +146,15 @@ static void WidgetFrameDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind static void WidgetResizeDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - auto leftTop = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - int32_t r = w->windowPos.x + widget->right; - int32_t b = w->windowPos.y + widget->bottom; + auto leftTop = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; + int32_t r = w->windowPos.x + widget.right; + int32_t b = w->windowPos.y + widget.bottom; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Draw the panel gfx_fill_rect_inset(dpi, { leftTop, { r, b } }, colour, 0); @@ -165,7 +166,7 @@ static void WidgetResizeDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin return; // Draw the resize sprite at the bottom right corner - leftTop = w->windowPos + ScreenCoordsXY{ widget->right - 18, widget->bottom - 18 }; + leftTop = w->windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 }; gfx_draw_sprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop); } @@ -176,19 +177,19 @@ static void WidgetResizeDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin static void WidgetButtonDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, - w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom } }; + ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget.left, widget.top }, + w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Check if the button is pressed down uint8_t press = WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; - if (static_cast(widget->image) == -2) + if (static_cast(widget.image) == -2) { // Draw border with no fill gfx_fill_rect_inset(dpi, rect, colour, press | INSET_RECT_FLAG_FILL_NONE); @@ -208,20 +209,20 @@ static void WidgetButtonDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin static void WidgetTabDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + auto& widget = w->widgets[widgetIndex]; - if (widget->type != WindowWidgetType::Tab && static_cast(widget->image) == -1) + if (widget.type != WindowWidgetType::Tab && static_cast(widget.image) == -1) return; - if (widget->type == WindowWidgetType::Tab) + if (widget.type == WindowWidgetType::Tab) { if (WidgetIsDisabled(w, widgetIndex)) return; - if (widget->image == static_cast(SPR_NONE)) + if (widget.image == static_cast(SPR_NONE)) { // Set standard tab sprite to use. - widget->image = IMAGE_TYPE_REMAP | SPR_TAB; + widget.image = IMAGE_TYPE_REMAP | SPR_TAB; } } @@ -232,18 +233,18 @@ static void WidgetTabDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex return; } - if (widget->type != WindowWidgetType::TrnBtn) + if (widget.type != WindowWidgetType::TrnBtn) { WidgetDrawImage(dpi, w, widgetIndex); return; } // Resolve the absolute ltrb - auto leftTop = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto leftTop = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; // Get the colour and disabled image - uint8_t colour = w->colours[widget->colour] & 0x7F; - uint32_t image = widget->image + 2; + uint8_t colour = w->colours[widget.colour] & 0x7F; + uint32_t image = widget.image + 2; // Draw disabled image gfx_draw_sprite(dpi, ImageId(image, colour), leftTop); @@ -262,19 +263,19 @@ static void WidgetFlatButtonDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widg } // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, - w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom } }; + ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget.left, widget.top }, + w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Check if the button is pressed down if (WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex)) { - if (static_cast(widget->image) == -2) + if (static_cast(widget.image) == -2) { // Draw border with no fill gfx_fill_rect_inset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE); @@ -296,21 +297,21 @@ static void WidgetFlatButtonDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widg static void WidgetTextButton(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, - w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom } }; + ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget.left, widget.top }, + w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Border uint8_t press = WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, rect, colour, press); // Button caption - if (widget->type != WindowWidgetType::TableHeader) + if (widget.type != WindowWidgetType::TableHeader) { WidgetTextCentred(dpi, w, widgetIndex); } @@ -327,42 +328,42 @@ static void WidgetTextButton(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin static void WidgetTextCentred(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; - if (widget->text == STR_NONE) + if (widget.text == STR_NONE) return; // Get the colour - colour_t colour = w->colours[widget->colour]; + colour_t colour = w->colours[widget.colour]; colour &= ~(COLOUR_FLAG_TRANSLUCENT); if (WidgetIsDisabled(w, widgetIndex)) colour |= COLOUR_FLAG_INSET; // Resolve the absolute ltrb - auto topLeft = w->windowPos + ScreenCoordsXY{ widget->left, 0 }; - int32_t r = w->windowPos.x + widget->right; + auto topLeft = w->windowPos + ScreenCoordsXY{ widget.left, 0 }; + int32_t r = w->windowPos.x + widget.right; - if (widget->type == WindowWidgetType::Button || widget->type == WindowWidgetType::TableHeader) - topLeft.y += widget->textTop(); + if (widget.type == WindowWidgetType::Button || widget.type == WindowWidgetType::TableHeader) + topLeft.y += widget.textTop(); else - topLeft.y += widget->top; + topLeft.y += widget.top; - auto stringId = widget->text; + auto stringId = widget.text; auto ft = Formatter::Common(); - if (widget->flags & WIDGET_FLAGS::TEXT_IS_STRING) + if (widget.flags & WIDGET_FLAGS::TEXT_IS_STRING) { stringId = STR_STRING; - ft.Add(widget->string); + ft.Add(widget.string); } ScreenCoordsXY coords = { (topLeft.x + r + 1) / 2 - 1, topLeft.y }; - if (widget->type == WindowWidgetType::LabelCentred) + if (widget.type == WindowWidgetType::LabelCentred) { - DrawTextWrapped(dpi, coords, widget->width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextWrapped(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); } else { - DrawTextEllipsised(dpi, coords, widget->width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); } } @@ -373,39 +374,39 @@ static void WidgetTextCentred(rct_drawpixelinfo* dpi, rct_window* w, rct_widgeti static void WidgetText(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; - if (widget->text == STR_NONE || widget->text == STR_VIEWPORT) + if (widget.text == STR_NONE || widget.text == STR_VIEWPORT) return; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; if (WidgetIsDisabled(w, widgetIndex)) colour |= COLOUR_FLAG_INSET; // Resolve the absolute ltrb - int32_t l = w->windowPos.x + widget->left; - int32_t r = w->windowPos.x + widget->right; + int32_t l = w->windowPos.x + widget.left; + int32_t r = w->windowPos.x + widget.right; int32_t t; - if (widget->type == WindowWidgetType::Button || widget->type == WindowWidgetType::DropdownMenu - || widget->type == WindowWidgetType::Spinner || widget->type == WindowWidgetType::TableHeader) + if (widget.type == WindowWidgetType::Button || widget.type == WindowWidgetType::DropdownMenu + || widget.type == WindowWidgetType::Spinner || widget.type == WindowWidgetType::TableHeader) { - t = w->windowPos.y + widget->textTop(); + t = w->windowPos.y + widget.textTop(); } else - t = w->windowPos.y + widget->top; + t = w->windowPos.y + widget.top; - auto stringId = widget->text; + auto stringId = widget.text; auto ft = Formatter::Common(); - if (widget->flags & WIDGET_FLAGS::TEXT_IS_STRING) + if (widget.flags & WIDGET_FLAGS::TEXT_IS_STRING) { stringId = STR_STRING; - ft.Add(widget->string); + ft.Add(widget.string); } ScreenCoordsXY coords = { l + 1, t }; - if (widget->type == WindowWidgetType::LabelCentred) + if (widget.type == WindowWidgetType::LabelCentred) { DrawTextWrapped(dpi, coords, r - l, stringId, ft, { colour, TextAlignment::CENTRE }); } @@ -422,26 +423,26 @@ static void WidgetText(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex wi static void WidgetTextInset(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, - w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom } }; + ScreenRect rect{ w->windowPos + ScreenCoordsXY{ widget.left, widget.top }, + w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; gfx_fill_rect_inset(dpi, rect, colour, INSET_RECT_F_60); WidgetText(dpi, w, widgetIndex); } -static std::pair widget_get_stringid_and_args(const rct_widget* widget) +static std::pair widget_get_stringid_and_args(const rct_widget& widget) { - auto stringId = widget->text; + auto stringId = widget.text; void* formatArgs = gCommonFormatArgs; - if (widget->flags & WIDGET_FLAGS::TEXT_IS_STRING) + if (widget.flags & WIDGET_FLAGS::TEXT_IS_STRING) { - if (widget->string == nullptr || widget->string[0] == '\0') + if (widget.string == nullptr || widget.string[0] == '\0') { stringId = STR_NONE; formatArgs = nullptr; @@ -449,7 +450,7 @@ static std::pair widget_get_stringid_and_args(const rct_wi else { stringId = STR_STRING; - formatArgs = const_cast(reinterpret_cast(&widget->string)); + formatArgs = const_cast(reinterpret_cast(&widget.string)); } } return std::make_pair(stringId, formatArgs); @@ -462,18 +463,18 @@ static std::pair widget_get_stringid_and_args(const rct_wi static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - auto l = w->windowPos.x + widget->left + 5; - auto t = w->windowPos.y + widget->top; + auto l = w->windowPos.x + widget.left + 5; + auto t = w->windowPos.y + widget.top; auto textRight = l; // Text auto [stringId, formatArgs] = widget_get_stringid_and_args(widget); if (stringId != STR_NONE) { - uint8_t colour = w->colours[widget->colour] & 0x7F; + uint8_t colour = w->colours[widget.colour] & 0x7F; if (WidgetIsDisabled(w, widgetIndex)) colour |= COLOUR_FLAG_INSET; @@ -487,13 +488,13 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget // Border // Resolve the absolute ltrb - l = w->windowPos.x + widget->left; - t = w->windowPos.y + widget->top + 4; - const auto r = w->windowPos.x + widget->right; - const auto b = w->windowPos.y + widget->bottom; + l = w->windowPos.x + widget.left; + t = w->windowPos.y + widget.top + 4; + const auto r = w->windowPos.x + widget.right; + const auto b = w->windowPos.y + widget.bottom; // Get the colour - uint8_t colour = w->colours[widget->colour] & 0x7F; + uint8_t colour = w->colours[widget.colour] & 0x7F; // Border left of text gfx_fill_rect(dpi, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark); @@ -523,7 +524,7 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget static void WidgetCaptionDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto* widget = &w->widgets[widgetIndex]; // Resolve the absolute ltrb auto topLeft = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; @@ -571,11 +572,11 @@ static void WidgetCaptionDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgeti static void WidgetCloseboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - auto topLeft = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - auto bottomRight = w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom }; + auto topLeft = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; + auto bottomRight = w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom }; // Check if the button is pressed down uint8_t press = 0; @@ -585,20 +586,20 @@ static void WidgetCloseboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget press |= INSET_RECT_FLAG_BORDER_INSET; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Draw the button gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, press); - if (widget->text == STR_NONE) + if (widget.text == STR_NONE) return; - topLeft = w->windowPos + ScreenCoordsXY{ widget->midX() - 1, std::max(widget->top, widget->midY() - 5) }; + topLeft = w->windowPos + ScreenCoordsXY{ widget.midX() - 1, std::max(widget.top, widget.midY() - 5) }; if (WidgetIsDisabled(w, widgetIndex)) colour |= COLOUR_FLAG_INSET; - DrawTextEllipsised(dpi, topLeft, widget->width() - 2, widget->text, Formatter::Common(), { colour, TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, topLeft, widget.width() - 2, widget.text, Formatter::Common(), { colour, TextAlignment::CENTRE }); } /** @@ -608,15 +609,15 @@ static void WidgetCloseboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltb - ScreenCoordsXY topLeft = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - ScreenCoordsXY bottomRight = w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom }; + ScreenCoordsXY topLeft = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; + ScreenCoordsXY bottomRight = w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom }; ScreenCoordsXY midLeft = { topLeft.x, (topLeft.y + bottomRight.y) / 2 }; // Get the colour - colour_t colour = w->colours[widget->colour]; + colour_t colour = w->colours[widget.colour]; // checkbox gfx_fill_rect_inset(dpi, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60); @@ -635,7 +636,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget } // draw the text - if (widget->text == STR_NONE) + if (widget.text == STR_NONE) return; auto [stringId, formatArgs] = widget_get_stringid_and_args(widget); @@ -650,15 +651,15 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin { // Get the widget int32_t scrollIndex = window_get_scroll_data_index(w, widgetIndex); - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; rct_scroll* scroll = &w->scrolls[scrollIndex]; // Resolve the absolute ltrb - ScreenCoordsXY topLeft = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - ScreenCoordsXY bottomRight = w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom }; + ScreenCoordsXY topLeft = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; + ScreenCoordsXY bottomRight = w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom }; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; // Draw the border gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60); @@ -791,33 +792,33 @@ static void WidgetVScrollbarDraw( static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex) { // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Get the image - int32_t image = widget->image; + int32_t image = widget.image; if (image == SPR_NONE) return; // Resolve the absolute ltrb - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; // Get the colour - uint8_t colour = NOT_TRANSLUCENT(w->colours[widget->colour]); + uint8_t colour = NOT_TRANSLUCENT(w->colours[widget.colour]); - if (widget->type == WindowWidgetType::ColourBtn || widget->type == WindowWidgetType::TrnBtn - || widget->type == WindowWidgetType::Tab) + if (widget.type == WindowWidgetType::ColourBtn || widget.type == WindowWidgetType::TrnBtn + || widget.type == WindowWidgetType::Tab) if (WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex)) image++; if (WidgetIsDisabled(w, widgetIndex)) { // Draw greyed out (light border bottom right shadow) - colour = w->colours[widget->colour]; + colour = w->colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter; gfx_draw_sprite_solid(dpi, image, screenCoords + ScreenCoordsXY{ 1, 1 }, colour); // Draw greyed out (dark) - colour = w->colours[widget->colour]; + colour = w->colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light; gfx_draw_sprite_solid(dpi, image, screenCoords, colour); } @@ -916,7 +917,7 @@ bool WidgetIsActiveTool(rct_window* w, rct_widgetindex widgetIndex) * edi: widget */ void WidgetScrollGetPart( - rct_window* w, rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, + rct_window* w, const rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, int32_t* output_scroll_area, int32_t* scroll_id) { *scroll_id = 0; @@ -1086,14 +1087,14 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgeti char wrapped_string[TEXT_INPUT_SIZE]; // Get the widget - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; // Resolve the absolute ltrb - ScreenCoordsXY topLeft{ w->windowPos + ScreenCoordsXY{ widget->left, widget->top } }; - ScreenCoordsXY bottomRight{ w->windowPos + ScreenCoordsXY{ widget->right, widget->bottom } }; + ScreenCoordsXY topLeft{ w->windowPos + ScreenCoordsXY{ widget.left, widget.top } }; + ScreenCoordsXY bottomRight{ w->windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; // Get the colour - uint8_t colour = w->colours[widget->colour]; + uint8_t colour = w->colours[widget.colour]; bool active = w->classification == gCurrentTextBox.window.classification && w->number == gCurrentTextBox.window.number && widgetIndex == gCurrentTextBox.widget_index; @@ -1102,13 +1103,13 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgeti gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60); // Figure out where the text should be positioned vertically. - topLeft.y = w->windowPos.y + widget->textTop(); + topLeft.y = w->windowPos.y + widget.textTop(); if (!active || gTextInput == nullptr) { - if (w->widgets[widgetIndex].text != 0) + if (widget.text != 0) { - safe_strcpy(wrapped_string, w->widgets[widgetIndex].string, 512); + safe_strcpy(wrapped_string, widget.string, 512); gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5, FontSpriteBase::MEDIUM, &no_lines); gfx_draw_string_no_formatting( dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w->colours[1], FontSpriteBase::MEDIUM }); @@ -1144,7 +1145,7 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgeti if (gTextBoxFrameNo <= 15) { colour = ColourMapA[w->colours[1]].mid_light; - auto y = topLeft.y + (widget->height() - 1); + auto y = topLeft.y + (widget.height() - 1); gfx_fill_rect(dpi, { { cur_x, y }, { cur_x + width, y } }, colour + 5); } } diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 7ffc99deb4..b04e89feec 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -538,8 +538,8 @@ void WindowAllWheelInput() rct_widgetindex widgetIndex = window_find_widget_from_point(w, cursorState->position); if (widgetIndex != -1) { - rct_widget* widget = &w->widgets[widgetIndex]; - if (widget->type == WindowWidgetType::Scroll) + const auto& widget = w->widgets[widgetIndex]; + if (widget.type == WindowWidgetType::Scroll) { int32_t scrollIndex = WindowGetScrollIndex(w, widgetIndex); rct_scroll* scroll = &w->scrolls[scrollIndex]; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 574ae7f761..14222f5dc3 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -826,20 +826,22 @@ static void window_editor_object_selection_invalidate(rct_window* w) // Set window title and buttons auto ft = Formatter::Common(); ft.Add(ObjectSelectionPages[w->selected_tab].Caption); + auto& titleWidget = w->widgets[WIDX_TITLE]; + auto& installTrackWidget = w->widgets[WIDX_INSTALL_TRACK]; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - w->widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS_MANAGER_SELECT_RIDE_TYPE; - w->widgets[WIDX_INSTALL_TRACK].type = WindowWidgetType::Button; + titleWidget.text = STR_TRACK_DESIGNS_MANAGER_SELECT_RIDE_TYPE; + installTrackWidget.type = WindowWidgetType::Button; } else if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) { - w->widgets[WIDX_TITLE].text = STR_ROLLER_COASTER_DESIGNER_SELECT_RIDE_TYPES_VEHICLES; - w->widgets[WIDX_INSTALL_TRACK].type = WindowWidgetType::Empty; + titleWidget.text = STR_ROLLER_COASTER_DESIGNER_SELECT_RIDE_TYPES_VEHICLES; + installTrackWidget.type = WindowWidgetType::Empty; } else { - w->widgets[WIDX_TITLE].text = STR_OBJECT_SELECTION; - w->widgets[WIDX_INSTALL_TRACK].type = WindowWidgetType::Empty; + titleWidget.text = STR_OBJECT_SELECTION; + installTrackWidget.type = WindowWidgetType::Empty; } // Align tabs, hide advanced ones @@ -847,16 +849,16 @@ static void window_editor_object_selection_invalidate(rct_window* w) int32_t x = 3; for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) { - auto widget = &w->widgets[WIDX_TAB_1 + i]; + auto& widget = w->widgets[WIDX_TAB_1 + i]; if (!advancedMode && ObjectSelectionPages[i].IsAdvanced) { - widget->type = WindowWidgetType::Empty; + widget.type = WindowWidgetType::Empty; } else { - widget->type = WindowWidgetType::Tab; - widget->left = x; - widget->right = x + 30; + widget.type = WindowWidgetType::Tab; + widget.left = x; + widget.right = x + 30; x += 31; } } @@ -950,8 +952,8 @@ static void window_editor_object_selection_invalidate(rct_window* w) static void window_editor_object_selection_paint_descriptions(rct_window* w, rct_drawpixelinfo* dpi) { - auto widget = &w->widgets[WIDX_PREVIEW]; - auto screenPos = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LIST].right + 4, widget->bottom + 23 }; + const auto& widget = w->widgets[WIDX_PREVIEW]; + auto screenPos = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LIST].right + 4, widget.bottom + 23 }; auto width = w->windowPos.x + w->width - screenPos.x - 4; auto description = object_get_description(_loadedObject.get()); @@ -1069,18 +1071,17 @@ static void window_editor_object_selection_paint_debug_data(rct_window* w, rct_d static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinfo* dpi) { int32_t width; - rct_widget* widget; WindowDrawWidgets(w, dpi); // Draw tabs for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) { - widget = &w->widgets[WIDX_TAB_1 + i]; - if (widget->type != WindowWidgetType::Empty) + const auto& widget = w->widgets[WIDX_TAB_1 + i]; + if (widget.type != WindowWidgetType::Empty) { auto image = ImageId(ObjectSelectionPages[i].Image); - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto screenPos = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; gfx_draw_sprite(dpi, image, screenPos); } } @@ -1096,8 +1097,8 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf { for (int32_t i = 0; i < 7; i++) { - widget = &w->widgets[WIDX_FILTER_RIDE_TAB_ALL + i]; - if (widget->type == WindowWidgetType::Empty) + const auto& widget = w->widgets[WIDX_FILTER_RIDE_TAB_ALL + i]; + if (widget.type == WindowWidgetType::Empty) continue; int32_t spriteIndex = ride_tabs[i]; @@ -1108,17 +1109,17 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf } spriteIndex += (i == 4 ? ThrillRidesTabAnimationSequence[frame] : frame); - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto screenPos = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; gfx_draw_sprite(dpi, ImageId(spriteIndex, w->colours[1]), screenPos); } } // Preview background - widget = &w->widgets[WIDX_PREVIEW]; + const auto& previewWidget = w->widgets[WIDX_PREVIEW]; gfx_fill_rect( dpi, - { w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }, - w->windowPos + ScreenCoordsXY{ widget->right - 1, widget->bottom - 1 } }, + { w->windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }, + w->windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } }, ColourMapA[w->colours[1]].darkest); // Draw number of selected items @@ -1136,25 +1137,25 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf } // Draw sort button text - widget = &w->widgets[WIDX_LIST_SORT_TYPE]; - if (widget->type != WindowWidgetType::Empty) + const auto& listSortTypeWidget = w->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 = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - DrawTextEllipsised(dpi, screenPos, widget->width(), STR_OBJECTS_SORT_TYPE, ft, { w->colours[1] }); + auto screenPos = w->windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 }; + DrawTextEllipsised(dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { w->colours[1] }); } - widget = &w->widgets[WIDX_LIST_SORT_RIDE]; - if (widget->type != WindowWidgetType::Empty) + const auto& listSortRideWidget = w->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 = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - DrawTextEllipsised(dpi, screenPos, widget->width(), STR_OBJECTS_SORT_RIDE, ft, { w->colours[1] }); + auto screenPos = w->windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 }; + DrawTextEllipsised(dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { w->colours[1] }); } if (w->selected_list_item == -1 || _loadedObject == nullptr) @@ -1163,12 +1164,11 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf list_item* listItem = &_listItems[w->selected_list_item]; // Draw preview - widget = &w->widgets[WIDX_PREVIEW]; { rct_drawpixelinfo clipDPI; - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - width = widget->width() - 1; - int32_t height = widget->height() - 1; + auto screenPos = w->windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }; + width = previewWidget.width() - 1; + int32_t height = previewWidget.height() - 1; if (clip_drawpixelinfo(&clipDPI, dpi, screenPos, width, height)) { _loadedObject->DrawPreview(&clipDPI, width, height); @@ -1177,7 +1177,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf // Draw name of object { - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->midX() + 1, widget->bottom + 3 }; + auto screenPos = w->windowPos + ScreenCoordsXY{ previewWidget.midX() + 1, previewWidget.bottom + 3 }; width = w->width - w->widgets[WIDX_LIST].right - 6; auto ft = Formatter(); ft.Add(STR_STRING); @@ -1188,6 +1188,7 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf window_editor_object_selection_paint_descriptions(w, dpi); window_editor_object_selection_paint_debug_data(w, dpi); } + /** * * rct2: 0x006AADA3 diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 5e59ff842a..a17aaf1bb2 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -474,9 +474,8 @@ static void window_editor_scenario_options_financial_resize(rct_window* w) static void window_editor_scenario_options_show_climate_dropdown(rct_window* w) { int32_t i; - rct_widget* dropdownWidget; - dropdownWidget = &w->widgets[WIDX_CLIMATE]; + const auto& dropdownWidget = w->widgets[WIDX_CLIMATE]; for (i = 0; i < static_cast(ClimateType::Count); i++) { @@ -484,8 +483,8 @@ static void window_editor_scenario_options_show_climate_dropdown(rct_window* w) gDropdownItemsArgs[i] = ClimateNames[i]; } WindowDropdownShowTextCustomWidth( - { w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - w->colours[1], 0, Dropdown::Flag::StayOpen, static_cast(ClimateType::Count), dropdownWidget->width() - 3); + { w->windowPos.x + dropdownWidget.left, w->windowPos.y + dropdownWidget.top }, dropdownWidget.height() + 1, + w->colours[1], 0, Dropdown::Flag::StayOpen, static_cast(ClimateType::Count), dropdownWidget.width() - 3); Dropdown::SetChecked(static_cast(gClimate), true); } @@ -683,49 +682,49 @@ static void window_editor_scenario_options_financial_paint(rct_window* w, rct_dr WindowDrawWidgets(w, dpi); window_editor_scenario_options_draw_tab_images(w, dpi); - if (w->widgets[WIDX_INITIAL_CASH].type != WindowWidgetType::Empty) + const auto& initialCashWidget = w->widgets[WIDX_INITIAL_CASH]; + if (initialCashWidget.type != WindowWidgetType::Empty) { - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_INITIAL_CASH].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, initialCashWidget.top }; DrawTextBasic(dpi, screenCoords, STR_INIT_CASH_LABEL); - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_CASH].left + 1, w->widgets[WIDX_INITIAL_CASH].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top }; auto ft = Formatter(); ft.Add(gInitialCash); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - if (w->widgets[WIDX_INITIAL_LOAN].type != WindowWidgetType::Empty) + const auto& initialLoanWidget = w->widgets[WIDX_INITIAL_LOAN]; + if (initialLoanWidget.type != WindowWidgetType::Empty) { - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_INITIAL_LOAN].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, initialLoanWidget.top }; DrawTextBasic(dpi, screenCoords, STR_INIT_LOAN_LABEL); - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_INITIAL_LOAN].left + 1, w->widgets[WIDX_INITIAL_LOAN].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top }; auto ft = Formatter(); ft.Add(gBankLoan); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - if (w->widgets[WIDX_MAXIMUM_LOAN].type != WindowWidgetType::Empty) + const auto& maximumLoanWidget = w->widgets[WIDX_MAXIMUM_LOAN]; + if (maximumLoanWidget.type != WindowWidgetType::Empty) { - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_MAXIMUM_LOAN].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, maximumLoanWidget.top }; DrawTextBasic(dpi, screenCoords, STR_MAX_LOAN_LABEL); - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_MAXIMUM_LOAN].left + 1, w->widgets[WIDX_MAXIMUM_LOAN].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top }; auto ft = Formatter(); ft.Add(gMaxBankLoan); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - if (w->widgets[WIDX_INTEREST_RATE].type != WindowWidgetType::Empty) + const auto& interestRateWidget = w->widgets[WIDX_INTEREST_RATE]; + if (interestRateWidget.type != WindowWidgetType::Empty) { - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_INTEREST_RATE].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, interestRateWidget.top }; DrawTextBasic(dpi, screenCoords, STR_INTEREST_RATE_LABEL); - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_INTEREST_RATE].left + 1, w->widgets[WIDX_INTEREST_RATE].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ interestRateWidget.left + 1, interestRateWidget.top }; auto ft = Formatter(); ft.Add(std::clamp(static_cast(gBankLoanInterestRate), INT16_MIN, INT16_MAX)); @@ -967,49 +966,49 @@ static void window_editor_scenario_options_guests_paint(rct_window* w, rct_drawp WindowDrawWidgets(w, dpi); window_editor_scenario_options_draw_tab_images(w, dpi); - if (w->widgets[WIDX_CASH_PER_GUEST].type != WindowWidgetType::Empty) + const auto& cashPerGuestWidget = w->widgets[WIDX_CASH_PER_GUEST]; + if (cashPerGuestWidget.type != WindowWidgetType::Empty) { // Cash per guest label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CASH_PER_GUEST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, cashPerGuestWidget.top }; DrawTextBasic(dpi, screenCoords, STR_CASH_PER_GUEST_LABEL); // Cash per guest value - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_CASH_PER_GUEST].left + 1, w->widgets[WIDX_CASH_PER_GUEST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top }; auto ft = Formatter(); ft.Add(gGuestInitialCash); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Guest initial happiness label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top }; + const auto& initialHappinessWidget = w->widgets[WIDX_GUEST_INITIAL_HAPPINESS]; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, initialHappinessWidget.top }; DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HAPPINESS); // Guest initial happiness value - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].left + 1, w->widgets[WIDX_GUEST_INITIAL_HAPPINESS].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top }; auto ft = Formatter(); ft.Add((gGuestInitialHappiness * 100) / 255); DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial hunger label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; + const auto& initialHungerWidget = w->widgets[WIDX_GUEST_INITIAL_HUNGER]; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, initialHungerWidget.top }; DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HUNGER); // Guest initial hunger value - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1, w->widgets[WIDX_GUEST_INITIAL_HUNGER].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top }; ft = Formatter(); ft.Add(((255 - gGuestInitialHunger) * 100) / 255); DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial thirst label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; + const auto& initialThirstWidget = w->widgets[WIDX_GUEST_INITIAL_THIRST]; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, initialThirstWidget.top }; DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_THIRST); // Guest initial thirst value - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_GUEST_INITIAL_THIRST].left + 1, w->widgets[WIDX_GUEST_INITIAL_THIRST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top }; ft = Formatter(); ft.Add(((255 - gGuestInitialThirst) * 100) / 255); DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); @@ -1331,39 +1330,39 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix WindowDrawWidgets(w, dpi); window_editor_scenario_options_draw_tab_images(w, dpi); - if (w->widgets[WIDX_LAND_COST].type != WindowWidgetType::Empty) + const auto& landCostWidget = w->widgets[WIDX_LAND_COST]; + if (landCostWidget.type != WindowWidgetType::Empty) { // Cost to buy land label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_LAND_COST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, landCostWidget.top }; DrawTextBasic(dpi, screenCoords, STR_LAND_COST_LABEL); // Cost to buy land value - screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_LAND_COST].left + 1, w->widgets[WIDX_LAND_COST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top }; auto ft = Formatter(); ft.Add(gLandPrice); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - if (w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type != WindowWidgetType::Empty) + const auto& constructionRightsCostWidget = w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST]; + if (constructionRightsCostWidget.type != WindowWidgetType::Empty) { // Cost to buy construction rights label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, constructionRightsCostWidget.top }; DrawTextBasic(dpi, screenCoords, STR_RIGHTS_COST_LABEL); // Cost to buy construction rights value - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].left + 1, - w->widgets[WIDX_CONSTRUCTION_RIGHTS_COST].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top }; auto ft = Formatter(); ft.Add(gConstructionRightsPrice); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - if (w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type != WindowWidgetType::Empty) + const auto& payForParkOrRidesWidget = w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES]; + if (payForParkOrRidesWidget.type != WindowWidgetType::Empty) { // Pay for park or rides label - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].left + 1, w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.left + 1, payForParkOrRidesWidget.top }; auto ft = Formatter(); // Pay for park and/or rides value @@ -1377,26 +1376,27 @@ static void window_editor_scenario_options_park_paint(rct_window* w, rct_drawpix DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } - if (w->widgets[WIDX_ENTRY_PRICE].type != WindowWidgetType::Empty) + const auto& entryPriceWidget = w->widgets[WIDX_ENTRY_PRICE]; + if (entryPriceWidget.type != WindowWidgetType::Empty) { // Entry price label - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_PAY_FOR_PARK_OR_RIDES].right + 8, w->widgets[WIDX_ENTRY_PRICE].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ entryPriceWidget.right + 8, entryPriceWidget.top }; DrawTextBasic(dpi, screenCoords, STR_ENTRY_PRICE_LABEL); // Entry price value - screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_ENTRY_PRICE].left + 1, w->widgets[WIDX_ENTRY_PRICE].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top }; auto ft = Formatter(); ft.Add(gParkEntranceFee); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Climate label - screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CLIMATE].top }; + const auto& climateWidget = w->widgets[WIDX_CLIMATE]; + screenCoords = w->windowPos + ScreenCoordsXY{ 8, climateWidget.top }; DrawTextBasic(dpi, screenCoords, STR_CLIMATE_LABEL); // Climate value - screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CLIMATE].left + 1, w->widgets[WIDX_CLIMATE].top }; + screenCoords = w->windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); ft.Add(ClimateNames[static_cast(gClimate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 3f198ca9d6..c57d0331f0 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -745,10 +745,10 @@ void window_guest_viewport_init(rct_window* w) if (peep->State != PeepState::Picked && w->viewport == nullptr) { - auto view_widget = &w->widgets[WIDX_VIEWPORT]; - auto screenPos = ScreenCoordsXY{ view_widget->left + 1 + w->windowPos.x, view_widget->top + 1 + w->windowPos.y }; - int32_t width = view_widget->width() - 1; - int32_t height = view_widget->height() - 1; + const auto& view_widget = w->widgets[WIDX_VIEWPORT]; + auto screenPos = ScreenCoordsXY{ view_widget.left + 1 + w->windowPos.x, view_widget.top + 1 + w->windowPos.y }; + int32_t width = view_widget.width() - 1; + int32_t height = view_widget.height() - 1; viewport_create(w, screenPos, width, height, w->focus.value()); if (w->viewport != nullptr && reCreateViewport) @@ -771,10 +771,10 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp if (w->disabled_widgets & (1ULL << WIDX_TAB_1)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_1]; - int32_t width = widget->width() - 1; - int32_t height = widget->height() - 1; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; + const auto& widget = w->widgets[WIDX_TAB_1]; + int32_t width = widget.width() - 1; + int32_t height = widget.height() - 1; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; if (w->page == WINDOW_GUEST_OVERVIEW) height++; @@ -843,8 +843,8 @@ static void window_guest_stats_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_2)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_2]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_2]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; const auto peep = GetGuest(w); if (peep == nullptr) @@ -881,8 +881,8 @@ static void window_guest_rides_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_3)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_3]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_3]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; int32_t image_id = SPR_TAB_RIDE_0; @@ -903,8 +903,8 @@ static void window_guest_finance_tab_paint(rct_window* w, rct_drawpixelinfo* dpi if (w->disabled_widgets & (1ULL << WIDX_TAB_4)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_4]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_4]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; int32_t image_id = SPR_TAB_FINANCES_SUMMARY_0; @@ -925,8 +925,8 @@ static void window_guest_thoughts_tab_paint(rct_window* w, rct_drawpixelinfo* dp if (w->disabled_widgets & (1ULL << WIDX_TAB_5)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_5]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_5]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; int32_t image_id = SPR_TAB_THOUGHTS_0; @@ -947,8 +947,8 @@ static void window_guest_inventory_tab_paint(rct_window* w, rct_drawpixelinfo* d if (w->disabled_widgets & (1ULL << WIDX_TAB_6)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_6]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_6]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; gfx_draw_sprite(dpi, ImageId(SPR_TAB_GUEST_INVENTORY), screenCoords); } @@ -958,8 +958,8 @@ static void window_guest_debug_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_7)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_7]; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_7]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; int32_t image_id = SPR_TAB_GEARS_0; if (w->page == WINDOW_GUEST_DEBUG) @@ -1003,22 +1003,22 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) return; } - rct_widget* widget = &w->widgets[WIDX_ACTION_LBL]; - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->top - 1 }; + const auto& actionLabelWidget = w->widgets[WIDX_ACTION_LBL]; + auto screenPos = w->windowPos + ScreenCoordsXY{ actionLabelWidget.midX(), actionLabelWidget.top - 1 }; { auto ft = Formatter(); peep->FormatActionTo(ft); - int32_t width = widget->width(); + int32_t width = actionLabelWidget.width(); DrawTextEllipsised(dpi, screenPos, width, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } // Draw the marquee thought - widget = &w->widgets[WIDX_MARQUEE]; - auto width = widget->width() - 3; - int32_t left = widget->left + 2 + w->windowPos.x; - int32_t top = widget->top + w->windowPos.y; - int32_t height = widget->height(); + const auto& marqueeWidget = w->widgets[WIDX_MARQUEE]; + auto width = marqueeWidget.width() - 3; + int32_t left = marqueeWidget.left + 2 + w->windowPos.x; + int32_t top = marqueeWidget.top + w->windowPos.y; + int32_t height = marqueeWidget.height(); rct_drawpixelinfo dpi_marquee; if (!clip_drawpixelinfo(&dpi_marquee, dpi, { left, top }, width, height)) { @@ -1044,7 +1044,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) return; } - screenPos.x = widget->width() - w->list_information_type; + screenPos.x = marqueeWidget.width() - w->list_information_type; { auto ft = Formatter(); peep_thought_set_format_args(&peep->Thoughts[i], ft); diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 3473c720be..8d9acc372e 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -180,8 +180,8 @@ static void window_news_options_invalidate(rct_window* w) w->pressed_widgets |= (1ULL << (WIDX_TAB_PARK + w->page)); // Set checkboxes - rct_widget* baseCheckBox = &w->widgets[WIDX_CHECKBOX_0]; - int32_t y = baseCheckBox->top; + const auto& baseCheckBox = w->widgets[WIDX_CHECKBOX_0]; + int32_t y = baseCheckBox.top; int32_t checkboxWidgetIndex = WIDX_CHECKBOX_0; rct_widget* checkboxWidget = &w->widgets[checkboxWidgetIndex]; @@ -194,8 +194,8 @@ static void window_news_options_invalidate(rct_window* w) w->enabled_widgets |= (1ULL << checkboxWidgetIndex); checkboxWidget->type = WindowWidgetType::Checkbox; - checkboxWidget->left = baseCheckBox->left; - checkboxWidget->right = baseCheckBox->right; + checkboxWidget->left = baseCheckBox.left; + checkboxWidget->right = baseCheckBox.right; checkboxWidget->top = y; checkboxWidget->bottom = checkboxWidget->top + LIST_ROW_HEIGHT + 3; checkboxWidget->text = ndef->caption; @@ -266,9 +266,8 @@ static void window_news_options_draw_tab_image(rct_window* w, rct_drawpixelinfo* } } - gfx_draw_sprite( - dpi, ImageId(spriteIndex), - w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top }); + const auto& widget = w->widgets[widgetIndex]; + gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top }); } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index f9b5ae7485..5170e4bbad 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -944,9 +944,8 @@ static void window_ride_draw_tab_image(rct_drawpixelinfo* dpi, rct_window* w, in spriteIndex += (frame % window_ride_tab_animation_frames[w->page]); } - gfx_draw_sprite( - dpi, ImageId(spriteIndex), - w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top }); + const auto& widget = w->widgets[widgetIndex]; + gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top }); } } @@ -981,9 +980,9 @@ static void window_ride_draw_tab_main(rct_drawpixelinfo* dpi, rct_window* w) spriteIndex += (w->frame_no / 4) % 8; break; } - gfx_draw_sprite( - dpi, ImageId(spriteIndex), - w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top }); + + const auto& widget = w->widgets[widgetIndex]; + gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top }); } } } @@ -995,13 +994,13 @@ static void window_ride_draw_tab_main(rct_drawpixelinfo* dpi, rct_window* w) static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w) { rct_widgetindex widgetIndex = WIDX_TAB_1 + WINDOW_RIDE_PAGE_VEHICLE; - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; if (!(w->disabled_widgets & (1LL << widgetIndex))) { - auto screenCoords = ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - int32_t width = widget->right - screenCoords.x; - int32_t height = widget->bottom - 3 - screenCoords.y; + auto screenCoords = ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; + int32_t width = widget.right - screenCoords.x; + int32_t height = widget.bottom - 3 - screenCoords.y; if (w->page == WINDOW_RIDE_PAGE_VEHICLE) height += 4; @@ -1013,7 +1012,7 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w) return; } - screenCoords = ScreenCoordsXY{ widget->width() / 2, widget->height() - 12 }; + screenCoords = ScreenCoordsXY{ widget.width() / 2, widget.height() - 12 }; auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -1070,7 +1069,7 @@ static void window_ride_draw_tab_customer(rct_drawpixelinfo* dpi, rct_window* w) if (!(w->disabled_widgets & (1LL << widgetIndex))) { - rct_widget* widget = &w->widgets[widgetIndex]; + const auto& widget = w->widgets[widgetIndex]; int32_t spriteIndex = 0; if (w->page == WINDOW_RIDE_PAGE_CUSTOMER) spriteIndex = w->picked_peep_frame & ~3; @@ -1080,7 +1079,7 @@ static void window_ride_draw_tab_customer(rct_drawpixelinfo* dpi, rct_window* w) spriteIndex |= 0xA9E00000; gfx_draw_sprite( - dpi, ImageId::FromUInt32(spriteIndex), w->windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 6 }); + dpi, ImageId::FromUInt32(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 }); } } @@ -1656,11 +1655,11 @@ static void window_ride_init_viewport(rct_window* w) // rct2: 0x006aec9c only used here so brought it into the function if (w->viewport == nullptr && !ride->overall_view.IsNull()) { - rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT]; + const auto& view_widget = w->widgets[WIDX_VIEWPORT]; - auto screenPos = w->windowPos + ScreenCoordsXY{ view_widget->left + 1, view_widget->top + 1 }; - int32_t width = view_widget->width() - 1; - int32_t height = view_widget->height() - 1; + auto screenPos = w->windowPos + ScreenCoordsXY{ view_widget.left + 1, view_widget.top + 1 }; + int32_t width = view_widget.width() - 1; + int32_t height = view_widget.height() - 1; viewport_create(w, screenPos, width, height, w->focus.value()); @@ -4807,7 +4806,6 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) { // TODO: This should use lists and identified sprites rct_drawpixelinfo clippedDpi; - rct_widget* widget; auto ride = get_ride(w->rideId); if (ride == nullptr) @@ -4817,12 +4815,12 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) window_ride_draw_tab_images(dpi, w); // Track / shop item preview - widget = &window_ride_colour_widgets[WIDX_TRACK_PREVIEW]; - if (widget->type != WindowWidgetType::Empty) + const auto& trackPreviewWidget = window_ride_colour_widgets[WIDX_TRACK_PREVIEW]; + if (trackPreviewWidget.type != WindowWidgetType::Empty) gfx_fill_rect( dpi, - { { w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 } }, - { w->windowPos + ScreenCoordsXY{ widget->right - 1, widget->bottom - 1 } } }, + { { w->windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } }, + { w->windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } }, PALETTE_INDEX_12); auto trackColour = ride_get_track_colour(ride, w->ride_colour); @@ -4831,7 +4829,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) auto rideEntry = ride->GetRideEntry(); if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::None) { - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto screenCoords = w->windowPos + ScreenCoordsXY{ trackPreviewWidget.left, trackPreviewWidget.top }; // Track if (ride->type == RIDE_TYPE_MAZE) @@ -4858,7 +4856,8 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) else { auto screenCoords = w->windowPos - + ScreenCoordsXY{ (widget->left + widget->right) / 2 - 8, (widget->bottom + widget->top) / 2 - 6 }; + + 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]; gfx_draw_sprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords); @@ -4866,12 +4865,13 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi) // Entrance preview trackColour = ride_get_track_colour(ride, 0); - widget = &w->widgets[WIDX_ENTRANCE_PREVIEW]; - if (widget->type != WindowWidgetType::Empty) + const auto& entrancePreviewWidget = w->widgets[WIDX_ENTRANCE_PREVIEW]; + if (entrancePreviewWidget.type != WindowWidgetType::Empty) { if (clip_drawpixelinfo( - &clippedDpi, dpi, w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }, widget->width(), - widget->height())) + &clippedDpi, dpi, + w->windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 }, + entrancePreviewWidget.width(), entrancePreviewWidget.height())) { gfx_clear(&clippedDpi, PALETTE_INDEX_12); diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 6bdd3285a0..fe9d8b8812 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -245,16 +245,16 @@ static void window_scenarioselect_init_tabs(rct_window* w) int32_t x = 3; for (int32_t i = 0; i < NumTabs; i++) { - rct_widget* widget = &w->widgets[i + WIDX_TAB1]; + auto& widget = w->widgets[i + WIDX_TAB1]; if (!(showPages & (1 << i))) { - widget->type = WindowWidgetType::Empty; + widget.type = WindowWidgetType::Empty; continue; } - widget->type = WindowWidgetType::Tab; - widget->left = x; - widget->right = x + 90; + widget.type = WindowWidgetType::Tab; + widget.left = x; + widget.right = x + 90; x += 91; } } @@ -563,8 +563,8 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo* rct_string_id highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; rct_string_id unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; - rct_widget* listWidget = &w->widgets[WIDX_SCENARIOLIST]; - int32_t listWidth = listWidget->width() - 12; + const auto& listWidget = w->widgets[WIDX_SCENARIOLIST]; + int32_t listWidth = listWidget.width() - 12; const int32_t scenarioItemHeight = get_scenario_list_item_size(); diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 77ae121f0b..11a364eec5 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -260,7 +260,7 @@ static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollInd { const auto& server = _serverList.GetServer(serverIndex); - auto listWidget = &w->widgets[WIDX_LIST]; + const auto& listWidget = w->widgets[WIDX_LIST]; gDropdownItemsFormat[0] = STR_JOIN_GAME; if (server.Favourite) @@ -271,8 +271,8 @@ static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollInd { gDropdownItemsFormat[1] = STR_ADD_TO_FAVOURITES; } - auto dropdownPos = ScreenCoordsXY{ w->windowPos.x + listWidget->left + screenCoords.x + 2 - w->scrolls[0].h_left, - w->windowPos.y + listWidget->top + screenCoords.y + 2 - w->scrolls[0].v_top }; + auto dropdownPos = ScreenCoordsXY{ w->windowPos.x + listWidget.left + screenCoords.x + 2 - w->scrolls[0].h_left, + w->windowPos.y + listWidget.top + screenCoords.y + 2 - w->scrolls[0].v_top }; WindowDropdownShowText(dropdownPos, 0, COLOUR_GREY, 0, 2); } } @@ -287,9 +287,10 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd } int32_t hoverButtonIndex = -1; + auto& listWidget = w->widgets[WIDX_LIST]; if (index != -1) { - int32_t width = w->widgets[WIDX_LIST].width(); + int32_t width = listWidget.width(); int32_t sy = index * ITEM_HEIGHT; for (int32_t i = 0; i < 2; i++) { @@ -304,11 +305,11 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd } } - int32_t width = w->widgets[WIDX_LIST].width(); + int32_t width = listWidget.width(); int32_t right = width - 3 - 14 - 10; if (screenCoords.x < right) { - w->widgets[WIDX_LIST].tooltip = STR_NONE; + listWidget.tooltip = STR_NONE; window_tooltip_close(); } @@ -421,11 +422,12 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light; gfx_clear(dpi, paletteIndex); - int32_t width = w->widgets[WIDX_LIST].width(); + auto& listWidget = w->widgets[WIDX_LIST]; + int32_t width = listWidget.width(); ScreenCoordsXY screenCoords; screenCoords.y = 0; - w->widgets[WIDX_LIST].tooltip = STR_NONE; + listWidget.tooltip = STR_NONE; for (int32_t i = 0; i < w->no_list_items; i++) { if (screenCoords.y >= dpi->y + dpi->height) @@ -439,7 +441,7 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi { gfx_filter_rect(dpi, 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT, FilterPaletteID::PaletteDarken1); _version = serverDetails.Version; - w->widgets[WIDX_LIST].tooltip = STR_NETWORK_VERSION_TIP; + listWidget.tooltip = STR_NETWORK_VERSION_TIP; } colour_t colour = w->colours[1]; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 97cb92f94d..422dd64116 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -967,9 +967,9 @@ void window_staff_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) } auto ft = Formatter(); peep->FormatActionTo(ft); - rct_widget* widget = &w->widgets[WIDX_BTM_LABEL]; - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->top }; - int32_t width = widget->width(); + const auto& widget = w->widgets[WIDX_BTM_LABEL]; + auto screenPos = w->windowPos + ScreenCoordsXY{ widget.midX(), widget.top }; + int32_t width = widget.width(); DrawTextEllipsised(dpi, screenPos, width, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } @@ -982,16 +982,14 @@ void window_staff_options_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_2)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_2]; - int32_t image_id = SPR_TAB_STAFF_OPTIONS_0; - if (w->page == WINDOW_STAFF_OPTIONS) { image_id += (w->frame_no / 2) % 7; } - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_2]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; gfx_draw_sprite(dpi, ImageId(image_id), screenCoords); } @@ -1004,16 +1002,14 @@ void window_staff_stats_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_3)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_3]; - int32_t image_id = SPR_TAB_STATS_0; - if (w->page == WINDOW_STAFF_STATISTICS) { image_id += (w->frame_no / 4) % 7; } - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + const auto& widget = w->widgets[WIDX_TAB_3]; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; gfx_draw_sprite(dpi, ImageId(image_id), screenCoords); } @@ -1025,10 +1021,10 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) if (w->disabled_widgets & (1ULL << WIDX_TAB_1)) return; - rct_widget* widget = &w->widgets[WIDX_TAB_1]; - int32_t width = widget->width() - 1; - int32_t height = widget->height() - 1; - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; + const auto& widget = w->widgets[WIDX_TAB_1]; + int32_t width = widget.width() - 1; + int32_t height = widget.height() - 1; + auto screenCoords = w->windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; if (w->page == WINDOW_STAFF_OVERVIEW) height++; @@ -1379,11 +1375,11 @@ void window_staff_viewport_init(rct_window* w) { if (w->viewport == nullptr) { - rct_widget* view_widget = &w->widgets[WIDX_VIEWPORT]; + const auto& view_widget = w->widgets[WIDX_VIEWPORT]; - auto screenPos = ScreenCoordsXY{ view_widget->left + 1 + w->windowPos.x, view_widget->top + 1 + w->windowPos.y }; - int32_t width = view_widget->width() - 1; - int32_t height = view_widget->height() - 1; + auto screenPos = ScreenCoordsXY{ view_widget.left + 1 + w->windowPos.x, view_widget.top + 1 + w->windowPos.y }; + int32_t width = view_widget.width() - 1; + int32_t height = view_widget.height() - 1; viewport_create(w, screenPos, width, height, focus.value()); w->flags |= WF_NO_SCROLLING; diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index eb694a4a76..e0d04abee6 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -3063,8 +3063,8 @@ static void window_top_toolbar_land_tool_drag(const ScreenCoordsXY& screenPos) rct_widgetindex widget_index = window_find_widget_from_point(window, screenPos); if (widget_index == -1) return; - rct_widget* widget = &window->widgets[widget_index]; - if (widget->type != WindowWidgetType::Viewport) + const auto& widget = window->widgets[widget_index]; + if (widget.type != WindowWidgetType::Viewport) return; rct_viewport* viewport = window->viewport; if (viewport == nullptr) @@ -3106,8 +3106,8 @@ static void window_top_toolbar_water_tool_drag(const ScreenCoordsXY& screenPos) rct_widgetindex widget_index = window_find_widget_from_point(window, screenPos); if (widget_index == -1) return; - rct_widget* widget = &window->widgets[widget_index]; - if (widget->type != WindowWidgetType::Viewport) + const auto& widget = window->widgets[widget_index]; + if (widget.type != WindowWidgetType::Viewport) return; rct_viewport* viewport = window->viewport; if (viewport == nullptr) diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index b7c4510784..f8734ee889 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -143,7 +143,7 @@ bool WidgetIsPressed(rct_window* w, rct_widgetindex widgetIndex); bool WidgetIsHighlighted(rct_window* w, rct_widgetindex widgetIndex); bool WidgetIsActiveTool(rct_window* w, rct_widgetindex widgetIndex); void WidgetScrollGetPart( - rct_window* w, rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, + rct_window* w, const rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, int32_t* output_scroll_area, int32_t* scroll_id); void WidgetSetEnabled(rct_window* w, rct_widgetindex widgetIndex, bool enabled); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 9f9ab78880..2c28d5fecf 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -427,16 +427,16 @@ rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsX rct_widgetindex widget_index = -1; for (int32_t i = 0;; i++) { - rct_widget* widget = &w->widgets[i]; - if (widget->type == WindowWidgetType::Last) + const auto& widget = w->widgets[i]; + if (widget.type == WindowWidgetType::Last) { break; } - if (widget->type != WindowWidgetType::Empty && widget->IsVisible()) + if (widget.type != WindowWidgetType::Empty && widget.IsVisible()) { - if (screenCoords.x >= w->windowPos.x + widget->left && screenCoords.x <= w->windowPos.x + widget->right - && screenCoords.y >= w->windowPos.y + widget->top && screenCoords.y <= w->windowPos.y + widget->bottom) + if (screenCoords.x >= w->windowPos.x + widget.left && screenCoords.x <= w->windowPos.x + widget.right + && screenCoords.y >= w->windowPos.y + widget.top && screenCoords.y <= w->windowPos.y + widget.bottom) { widget_index = i; } @@ -445,8 +445,11 @@ rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsX // Return next widget if a dropdown if (widget_index != -1) - if (w->widgets[widget_index].type == WindowWidgetType::DropdownMenu) + { + const auto& widget = w->widgets[widget_index]; + if (widget.type == WindowWidgetType::DropdownMenu) widget_index++; + } // Return the widget index return widget_index; @@ -502,8 +505,6 @@ void window_invalidate_all() */ void widget_invalidate(rct_window* w, rct_widgetindex widgetIndex) { - rct_widget* widget; - assert(w != nullptr); #ifdef DEBUG for (int32_t i = 0; i <= widgetIndex; i++) @@ -512,12 +513,12 @@ void widget_invalidate(rct_window* w, rct_widgetindex widgetIndex) } #endif - widget = &w->widgets[widgetIndex]; - if (widget->left == -2) + const auto& widget = w->widgets[widgetIndex]; + if (widget.left == -2) return; - gfx_set_dirty_blocks({ { w->windowPos + ScreenCoordsXY{ widget->left, widget->top } }, - { w->windowPos + ScreenCoordsXY{ widget->right + 1, widget->bottom + 1 } } }); + gfx_set_dirty_blocks({ { w->windowPos + ScreenCoordsXY{ widget.left, widget.top } }, + { w->windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } }); } template static void widget_invalidate_by_condition(_TPred pred) @@ -623,7 +624,8 @@ int32_t window_get_scroll_data_index(rct_window* w, rct_widgetindex widget_index assert(w != nullptr); for (i = 0; i < widget_index; i++) { - if (w->widgets[i].type == WindowWidgetType::Scroll) + const auto& widget = w->widgets[i]; + if (widget.type == WindowWidgetType::Scroll) result++; } return result; @@ -1747,8 +1749,9 @@ void window_align_tabs(rct_window* w, rct_widgetindex start_tab_id, rct_widgetin { if (!(w->disabled_widgets & (1LL << i))) { - w->widgets[i].left = x; - w->widgets[i].right = x + tab_width; + auto& widget = w->widgets[i]; + widget.left = x; + widget.right = x + tab_width; x += tab_width + 1; } } @@ -2179,12 +2182,12 @@ rct_windowclass window_get_classification(rct_window* window) */ void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) { - rct_widget* widget = &w->widgets[widget_index]; + const auto& widget = w->widgets[widget_index]; rct_scroll* scroll = &w->scrolls[window_get_scroll_data_index(w, widget_index)]; if (scroll->flags & HSCROLLBAR_VISIBLE) { - int32_t view_size = widget->width() - 21; + int32_t view_size = widget.width() - 21; if (scroll->flags & VSCROLLBAR_VISIBLE) view_size -= 11; int32_t x = scroll->h_left * view_size; @@ -2192,7 +2195,7 @@ void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) x /= scroll->h_right; scroll->h_thumb_left = x + 11; - x = widget->width() - 2; + x = widget.width() - 2; if (scroll->flags & VSCROLLBAR_VISIBLE) x -= 11; x += scroll->h_left; @@ -2213,7 +2216,7 @@ void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) if (scroll->flags & VSCROLLBAR_VISIBLE) { - int32_t view_size = widget->height() - 21; + int32_t view_size = widget.height() - 21; if (scroll->flags & HSCROLLBAR_VISIBLE) view_size -= 11; int32_t y = scroll->v_top * view_size; @@ -2221,7 +2224,7 @@ void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) y /= scroll->v_bottom; scroll->v_thumb_top = y + 11; - y = widget->height() - 2; + y = widget.height() - 2; if (scroll->flags & HSCROLLBAR_VISIBLE) y -= 11; y += scroll->v_top; From 5b9b52c02876ec7bfea9ac6c7f79a349db2b9ee7 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 1 Oct 2021 15:16:17 +0200 Subject: [PATCH 475/681] Use (const) references to scrolls where possible --- src/openrct2-ui/input/MouseInput.cpp | 114 ++++++++++++++------------- src/openrct2-ui/interface/Widget.cpp | 70 ++++++++-------- src/openrct2-ui/interface/Window.cpp | 41 +++++----- src/openrct2-ui/windows/Options.cpp | 31 ++++---- src/openrct2/interface/Window.cpp | 82 +++++++++---------- 5 files changed, 171 insertions(+), 167 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 25ab4a76ca..0b1f85a17f 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -195,26 +195,26 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind uint8_t scrollIndex = _dragScrollIndex; const auto& widget = w->widgets[widgetIndex]; - rct_scroll* scroll = &w->scrolls[scrollIndex]; + auto& scroll = w->scrolls[scrollIndex]; ScreenCoordsXY differentialCoords = screenCoords - gInputDragLast; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) { int16_t size = widget.width() - 1; - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) size -= 11; - size = std::max(0, scroll->h_right - size); - scroll->h_left = std::min(std::max(0, scroll->h_left + differentialCoords.x), size); + size = std::max(0, scroll.h_right - size); + scroll.h_left = std::min(std::max(0, scroll.h_left + differentialCoords.x), size); } - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) { int16_t size = widget.height() - 1; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) size -= 11; - size = std::max(0, scroll->v_bottom - size); - scroll->v_top = std::min(std::max(0, scroll->v_top + differentialCoords.y), size); + size = std::max(0, scroll.v_bottom - size); + scroll.v_top = std::min(std::max(0, scroll.v_top + differentialCoords.y), size); } WidgetScrollUpdateThumbs(w, widgetIndex); @@ -627,43 +627,43 @@ static void InputScrollBegin(rct_window* w, rct_widgetindex widgetIndex, const S } const auto& widg = w->widgets[widgetIndex]; - rct_scroll* scroll = &w->scrolls[scroll_id]; + auto& scroll = w->scrolls[scroll_id]; int32_t widget_width = widg.width() - 1; - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) widget_width -= SCROLLBAR_WIDTH + 1; - int32_t widget_content_width = std::max(scroll->h_right - widget_width, 0); + 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) + if (scroll.flags & HSCROLLBAR_VISIBLE) widget_height -= SCROLLBAR_WIDTH + 1; - int32_t widget_content_height = std::max(scroll->v_bottom - widget_height, 0); + int32_t widget_content_height = std::max(scroll.v_bottom - widget_height, 0); switch (scroll_area) { case SCROLL_PART_HSCROLLBAR_LEFT: - scroll->h_left = std::max(scroll->h_left - 3, 0); + scroll.h_left = std::max(scroll.h_left - 3, 0); break; case SCROLL_PART_HSCROLLBAR_RIGHT: - scroll->h_left = std::min(scroll->h_left + 3, widget_content_width); + scroll.h_left = std::min(scroll.h_left + 3, widget_content_width); break; case SCROLL_PART_HSCROLLBAR_LEFT_TROUGH: - scroll->h_left = std::max(scroll->h_left - widget_width, 0); + scroll.h_left = std::max(scroll.h_left - widget_width, 0); break; case SCROLL_PART_HSCROLLBAR_RIGHT_TROUGH: - scroll->h_left = std::min(scroll->h_left + widget_width, widget_content_width); + scroll.h_left = std::min(scroll.h_left + widget_width, widget_content_width); break; case SCROLL_PART_VSCROLLBAR_TOP: - scroll->v_top = std::max(scroll->v_top - 3, 0); + scroll.v_top = std::max(scroll.v_top - 3, 0); break; case SCROLL_PART_VSCROLLBAR_BOTTOM: - scroll->v_top = std::min(scroll->v_top + 3, widget_content_height); + scroll.v_top = std::min(scroll.v_top + 3, widget_content_height); break; case SCROLL_PART_VSCROLLBAR_TOP_TROUGH: - scroll->v_top = std::max(scroll->v_top - widget_height, 0); + scroll.v_top = std::max(scroll.v_top - widget_height, 0); break; case SCROLL_PART_VSCROLLBAR_BOTTOM_TROUGH: - scroll->v_top = std::min(scroll->v_top + widget_height, widget_content_height); + scroll.v_top = std::min(scroll.v_top + widget_height, widget_content_height); break; default: break; @@ -744,32 +744,33 @@ static void InputScrollEnd() static void InputScrollPartUpdateHThumb(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t scroll_id) { const auto& widget = w->widgets[widgetIndex]; + auto& scroll = w->scrolls[scroll_id]; if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newLeft; - newLeft = w->scrolls[scroll_id].h_right; + newLeft = scroll.h_right; newLeft *= x; x = widget.width() - 21; - if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) x -= SCROLLBAR_WIDTH + 1; newLeft /= x; x = newLeft; - w->scrolls[scroll_id].flags |= HSCROLLBAR_THUMB_PRESSED; - newLeft = w->scrolls[scroll_id].h_left; + scroll.flags |= HSCROLLBAR_THUMB_PRESSED; + newLeft = scroll.h_left; newLeft += x; if (newLeft < 0) newLeft = 0; x = widget.width() - 1; - if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) x -= SCROLLBAR_WIDTH + 1; x *= -1; - x += w->scrolls[scroll_id].h_right; + x += scroll.h_right; if (x < 0) x = 0; if (newLeft > x) newLeft = x; - w->scrolls[scroll_id].h_left = newLeft; + scroll.h_left = newLeft; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } @@ -783,32 +784,33 @@ static void InputScrollPartUpdateVThumb(rct_window* w, rct_widgetindex widgetInd { assert(w != nullptr); const auto& widget = w->widgets[widgetIndex]; + auto& scroll = w->scrolls[scroll_id]; if (window_find_by_number(w->classification, w->number) != nullptr) { int32_t newTop; - newTop = w->scrolls[scroll_id].v_bottom; + newTop = scroll.v_bottom; newTop *= y; y = widget.height() - 21; - if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) y -= SCROLLBAR_WIDTH + 1; newTop /= y; y = newTop; - w->scrolls[scroll_id].flags |= VSCROLLBAR_THUMB_PRESSED; - newTop = w->scrolls[scroll_id].v_top; + scroll.flags |= VSCROLLBAR_THUMB_PRESSED; + newTop = scroll.v_top; newTop += y; if (newTop < 0) newTop = 0; y = widget.height() - 1; - if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) y -= SCROLLBAR_WIDTH + 1; y *= -1; - y += w->scrolls[scroll_id].v_bottom; + y += scroll.v_bottom; if (y < 0) y = 0; if (newTop > y) newTop = y; - w->scrolls[scroll_id].v_top = newTop; + scroll.v_top = newTop; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } @@ -823,9 +825,10 @@ static void InputScrollPartUpdateHLeft(rct_window* w, rct_widgetindex widgetInde assert(w != nullptr); if (window_find_by_number(w->classification, w->number) != nullptr) { - w->scrolls[scroll_id].flags |= HSCROLLBAR_LEFT_PRESSED; - if (w->scrolls[scroll_id].h_left >= 3) - w->scrolls[scroll_id].h_left -= 3; + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= HSCROLLBAR_LEFT_PRESSED; + if (scroll.h_left >= 3) + scroll.h_left -= 3; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } @@ -841,17 +844,18 @@ static void InputScrollPartUpdateHRight(rct_window* w, rct_widgetindex widgetInd const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { - w->scrolls[scroll_id].flags |= HSCROLLBAR_RIGHT_PRESSED; - w->scrolls[scroll_id].h_left += 3; + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= HSCROLLBAR_RIGHT_PRESSED; + scroll.h_left += 3; int32_t newLeft = widget.width() - 1; - if (w->scrolls[scroll_id].flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) newLeft -= SCROLLBAR_WIDTH + 1; newLeft *= -1; - newLeft += w->scrolls[scroll_id].h_right; + newLeft += scroll.h_right; if (newLeft < 0) newLeft = 0; - if (w->scrolls[scroll_id].h_left > newLeft) - w->scrolls[scroll_id].h_left = newLeft; + if (scroll.h_left > newLeft) + scroll.h_left = newLeft; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } @@ -866,9 +870,10 @@ static void InputScrollPartUpdateVTop(rct_window* w, rct_widgetindex widgetIndex assert(w != nullptr); if (window_find_by_number(w->classification, w->number) != nullptr) { - w->scrolls[scroll_id].flags |= VSCROLLBAR_UP_PRESSED; - if (w->scrolls[scroll_id].v_top >= 3) - w->scrolls[scroll_id].v_top -= 3; + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= VSCROLLBAR_UP_PRESSED; + if (scroll.v_top >= 3) + scroll.v_top -= 3; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } @@ -884,17 +889,18 @@ static void InputScrollPartUpdateVBottom(rct_window* w, rct_widgetindex widgetIn const auto& widget = w->widgets[widgetIndex]; if (window_find_by_number(w->classification, w->number) != nullptr) { - w->scrolls[scroll_id].flags |= VSCROLLBAR_DOWN_PRESSED; - w->scrolls[scroll_id].v_top += 3; + auto& scroll = w->scrolls[scroll_id]; + scroll.flags |= VSCROLLBAR_DOWN_PRESSED; + scroll.v_top += 3; int32_t newTop = widget.height() - 1; - if (w->scrolls[scroll_id].flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) newTop -= SCROLLBAR_WIDTH + 1; newTop *= -1; - newTop += w->scrolls[scroll_id].v_bottom; + newTop += scroll.v_bottom; if (newTop < 0) newTop = 0; - if (w->scrolls[scroll_id].v_top > newTop) - w->scrolls[scroll_id].v_top = newTop; + if (scroll.v_top > newTop) + scroll.v_top = newTop; WidgetScrollUpdateThumbs(w, widgetIndex); widget_invalidate_by_number(w->classification, w->number, widgetIndex); } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 4748f30afa..6bcdaa0925 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -36,9 +36,9 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget static void WidgetCloseboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex); static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex); static void WidgetHScrollbarDraw( - rct_drawpixelinfo* dpi, rct_scroll* scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour); + rct_drawpixelinfo* dpi, const rct_scroll& scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour); static void WidgetVScrollbarDraw( - rct_drawpixelinfo* dpi, rct_scroll* scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour); + rct_drawpixelinfo* dpi, const rct_scroll& scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour); static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex widgetIndex); /** @@ -652,7 +652,7 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin // Get the widget int32_t scrollIndex = window_get_scroll_data_index(w, widgetIndex); const auto& widget = w->widgets[widgetIndex]; - rct_scroll* scroll = &w->scrolls[scrollIndex]; + const auto& scroll = w->scrolls[scrollIndex]; // Resolve the absolute ltrb ScreenCoordsXY topLeft = w->windowPos + ScreenCoordsXY{ widget.left, widget.top }; @@ -671,22 +671,22 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin bottomRight.y--; // Horizontal scrollbar - if (scroll->flags & HSCROLLBAR_VISIBLE) + 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, + ((scroll.flags & VSCROLLBAR_VISIBLE) ? bottomRight.x - (SCROLLBAR_WIDTH + 1) : bottomRight.x), bottomRight.y, colour); // Vertical scrollbar - if (scroll->flags & VSCROLLBAR_VISIBLE) + 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); + ((scroll.flags & HSCROLLBAR_VISIBLE) ? bottomRight.y - (SCROLLBAR_WIDTH + 1) : bottomRight.y), colour); // Contents - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) bottomRight.y -= (SCROLLBAR_WIDTH + 1); - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) bottomRight.x -= (SCROLLBAR_WIDTH + 1); bottomRight.y++; @@ -702,8 +702,8 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin int32_t cb = std::min(dpi->y + dpi->height, bottomRight.y); // Set the respective dpi attributes - scroll_dpi.x = cl - topLeft.x + scroll->h_left; - scroll_dpi.y = ct - topLeft.y + scroll->v_top; + scroll_dpi.x = cl - topLeft.x + scroll.h_left; + scroll_dpi.y = ct - topLeft.y + scroll.v_top; scroll_dpi.width = cr - cl; scroll_dpi.height = cb - ct; scroll_dpi.bits += cl - dpi->x; @@ -716,7 +716,7 @@ static void WidgetScrollDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetin } static void WidgetHScrollbarDraw( - rct_drawpixelinfo* dpi, rct_scroll* scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour) + rct_drawpixelinfo* dpi, const rct_scroll& scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour) { colour &= 0x7F; // Trough @@ -729,7 +729,7 @@ static void WidgetHScrollbarDraw( // Left button { - uint8_t flags = (scroll->flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags); gfx_draw_string(dpi, { l + 1, t }, static_cast(BlackLeftArrowString), {}); @@ -737,16 +737,16 @@ static void WidgetHScrollbarDraw( // 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); - uint8_t flags = (scroll->flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + 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); + uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, { { left, t }, { right, b } }, colour, flags); } // Right button { - uint8_t flags = (scroll->flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; + uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags); gfx_draw_string(dpi, { r - 6, t }, static_cast(BlackRightArrowString), {}); @@ -754,7 +754,7 @@ static void WidgetHScrollbarDraw( } static void WidgetVScrollbarDraw( - rct_drawpixelinfo* dpi, rct_scroll* scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour) + rct_drawpixelinfo* dpi, const rct_scroll& scroll, int32_t l, int32_t t, int32_t r, int32_t b, int32_t colour) { colour &= 0x7F; // Trough @@ -768,20 +768,20 @@ static void WidgetVScrollbarDraw( // Up button gfx_fill_rect_inset( dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour, - ((scroll->flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + ((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); gfx_draw_string(dpi, { l + 1, t - 1 }, static_cast(BlackUpArrowString), {}); // Thumb gfx_fill_rect_inset( 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) } }, - colour, ((scroll->flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + { { l, std::max(t + SCROLLBAR_WIDTH, t + scroll.v_thumb_top - 1) }, + { r, std::min(b - SCROLLBAR_WIDTH, t + scroll.v_thumb_bottom - 1) } }, + colour, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); // Down button gfx_fill_rect_inset( dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour, - ((scroll->flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); + ((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); gfx_draw_string(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast(BlackDownArrowString), {}); } @@ -929,14 +929,14 @@ void WidgetScrollGetPart( } } - if ((w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE) - && screenCoords.y >= (w->windowPos.y + widget->bottom - (SCROLLBAR_WIDTH + 1))) + const auto& scroll = w->scrolls[*scroll_id]; + if ((scroll.flags & HSCROLLBAR_VISIBLE) && screenCoords.y >= (w->windowPos.y + widget->bottom - (SCROLLBAR_WIDTH + 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; - if (!(w->scrolls[*scroll_id].flags & VSCROLLBAR_VISIBLE)) + if (!(scroll.flags & VSCROLLBAR_VISIBLE)) { rightOffset = SCROLLBAR_WIDTH + 1; } @@ -953,11 +953,11 @@ void WidgetScrollGetPart( { *output_scroll_area = SCROLL_PART_HSCROLLBAR_RIGHT; } - else if (screenCoords.x < (widget->left + w->windowPos.x + w->scrolls[*scroll_id].h_thumb_left)) + else if (screenCoords.x < (widget->left + w->windowPos.x + scroll.h_thumb_left)) { *output_scroll_area = SCROLL_PART_HSCROLLBAR_LEFT_TROUGH; } - else if (screenCoords.x > (widget->left + w->windowPos.x + w->scrolls[*scroll_id].h_thumb_right)) + else if (screenCoords.x > (widget->left + w->windowPos.x + scroll.h_thumb_right)) { *output_scroll_area = SCROLL_PART_HSCROLLBAR_RIGHT_TROUGH; } @@ -966,15 +966,13 @@ void WidgetScrollGetPart( *output_scroll_area = SCROLL_PART_HSCROLLBAR_THUMB; } } - else if ( - (w->scrolls[*scroll_id].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 - (SCROLLBAR_WIDTH + 1))) { // vertical scrollbar int32_t bottomOffset = 0; int32_t iteratorTop = widget->top + w->windowPos.y + SCROLLBAR_WIDTH; int32_t iteratorBottom = widget->bottom + w->windowPos.y; - if (w->scrolls[*scroll_id].flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) { bottomOffset = (SCROLLBAR_WIDTH + 1); } @@ -991,11 +989,11 @@ void WidgetScrollGetPart( { *output_scroll_area = SCROLL_PART_VSCROLLBAR_BOTTOM; } - else if (screenCoords.y < (widget->top + w->windowPos.y + w->scrolls[*scroll_id].v_thumb_top)) + else if (screenCoords.y < (widget->top + w->windowPos.y + scroll.v_thumb_top)) { *output_scroll_area = SCROLL_PART_VSCROLLBAR_TOP_TROUGH; } - else if (screenCoords.y > (widget->top + w->windowPos.y + w->scrolls[*scroll_id].v_thumb_bottom)) + else if (screenCoords.y > (widget->top + w->windowPos.y + scroll.v_thumb_bottom)) { *output_scroll_area = SCROLL_PART_VSCROLLBAR_BOTTOM_TROUGH; } @@ -1017,8 +1015,8 @@ void WidgetScrollGetPart( } else { - retScreenCoords.x += w->scrolls[*scroll_id].h_left - 1; - retScreenCoords.y += w->scrolls[*scroll_id].v_top - 1; + retScreenCoords.x += scroll.h_left - 1; + retScreenCoords.y += scroll.v_top - 1; } } } diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index b04e89feec..94ac25450c 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -356,25 +356,25 @@ static rct_widget* WindowGetScrollWidget(rct_window* w, int32_t scrollIndex) */ static void WindowScrollWheelInput(rct_window* w, int32_t scrollIndex, int32_t wheel) { - rct_scroll* scroll = &w->scrolls[scrollIndex]; + auto& scroll = w->scrolls[scrollIndex]; rct_widget* widget = WindowGetScrollWidget(w, scrollIndex); rct_widgetindex widgetIndex = WindowGetWidgetIndex(w, widget); - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) { int32_t size = widget->height() - 1; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) size -= 11; - size = std::max(0, scroll->v_bottom - size); - scroll->v_top = std::min(std::max(0, scroll->v_top + wheel), size); + size = std::max(0, scroll.v_bottom - size); + scroll.v_top = std::min(std::max(0, scroll.v_top + wheel), size); } else { int32_t size = widget->width() - 1; - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) size -= 11; - size = std::max(0, scroll->h_right - size); - scroll->h_left = std::min(std::max(0, scroll->h_left + wheel), size); + size = std::max(0, scroll.h_right - size); + scroll.h_left = std::min(std::max(0, scroll.h_left + wheel), size); } WidgetScrollUpdateThumbs(w, widgetIndex); @@ -394,8 +394,8 @@ static int32_t WindowWheelInput(rct_window* w, int32_t wheel) continue; // Originally always checked first scroll view, bug maybe? - rct_scroll* scroll = &w->scrolls[i]; - if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) + const auto& scroll = w->scrolls[i]; + if (scroll.flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) { WindowScrollWheelInput(w, i, wheel); return 1; @@ -542,8 +542,8 @@ void WindowAllWheelInput() if (widget.type == WindowWidgetType::Scroll) { int32_t scrollIndex = WindowGetScrollIndex(w, widgetIndex); - rct_scroll* scroll = &w->scrolls[scrollIndex]; - if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) + const auto& scroll = w->scrolls[scrollIndex]; + if (scroll.flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) { WindowScrollWheelInput(w, WindowGetScrollIndex(w, widgetIndex), pixel_scroll); return; @@ -577,7 +577,6 @@ void ApplyScreenSaverLockSetting() void WindowInitScrollWidgets(rct_window* w) { rct_widget* widget; - rct_scroll* scroll; int32_t widget_index, scroll_index; int32_t width, height; @@ -591,20 +590,20 @@ void WindowInitScrollWidgets(rct_window* w) continue; } - scroll = &w->scrolls[scroll_index]; - scroll->flags = 0; + auto& scroll = w->scrolls[scroll_index]; + scroll.flags = 0; width = 0; height = 0; window_get_scroll_size(w, scroll_index, &width, &height); - scroll->h_left = 0; - scroll->h_right = width + 1; - scroll->v_top = 0; - scroll->v_bottom = height + 1; + scroll.h_left = 0; + scroll.h_right = width + 1; + scroll.v_top = 0; + scroll.v_bottom = height + 1; if (widget->content & SCROLL_HORIZONTAL) - scroll->flags |= HSCROLLBAR_VISIBLE; + scroll.flags |= HSCROLLBAR_VISIBLE; if (widget->content & SCROLL_VERTICAL) - scroll->flags |= VSCROLLBAR_VISIBLE; + scroll.flags |= VSCROLLBAR_VISIBLE; WidgetScrollUpdateThumbs(w, widget_index); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 51f7972ff2..469e01bfeb 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1474,10 +1474,10 @@ static void window_options_audio_dropdown(rct_window* w, rct_widgetindex widgetI } } -static uint8_t get_scroll_percentage(rct_widget* widget, rct_scroll* scroll) +static uint8_t get_scroll_percentage(const rct_widget& widget, const rct_scroll& scroll) { - uint8_t width = widget->width() - 1; - return static_cast(scroll->h_left) / (scroll->h_right - width) * 100; + uint8_t width = widget.width() - 1; + return static_cast(scroll.h_left) / (scroll.h_right - width) * 100; } static void window_options_audio_update(rct_window* w) @@ -1486,10 +1486,9 @@ static void window_options_audio_update(rct_window* w) if (w->page == WINDOW_OPTIONS_PAGE_AUDIO) { - rct_widget* widget; - - widget = &window_options_audio_widgets[WIDX_MASTER_VOLUME]; - uint8_t master_volume = get_scroll_percentage(widget, &w->scrolls[0]); + const auto& masterVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; + const auto& masterVolumeScroll = w->scrolls[0]; + uint8_t master_volume = get_scroll_percentage(masterVolumeWidget, masterVolumeScroll); if (master_volume != gConfigSound.master_volume) { gConfigSound.master_volume = master_volume; @@ -1497,8 +1496,9 @@ static void window_options_audio_update(rct_window* w) widget_invalidate(w, WIDX_MASTER_VOLUME); } - widget = &window_options_audio_widgets[WIDX_SOUND_VOLUME]; - uint8_t sound_volume = get_scroll_percentage(widget, &w->scrolls[1]); + const auto& soundVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; + const auto& soundVolumeScroll = w->scrolls[1]; + uint8_t sound_volume = get_scroll_percentage(soundVolumeWidget, soundVolumeScroll); if (sound_volume != gConfigSound.sound_volume) { gConfigSound.sound_volume = sound_volume; @@ -1506,8 +1506,9 @@ static void window_options_audio_update(rct_window* w) widget_invalidate(w, WIDX_SOUND_VOLUME); } - widget = &window_options_audio_widgets[WIDX_MUSIC_VOLUME]; - uint8_t ride_music_volume = get_scroll_percentage(widget, &w->scrolls[2]); + const auto& musicVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; + const auto& musicVolumeScroll = w->scrolls[2]; + uint8_t ride_music_volume = get_scroll_percentage(musicVolumeWidget, musicVolumeScroll); if (ride_music_volume != gConfigSound.ride_music_volume) { gConfigSound.ride_music_volume = ride_music_volume; @@ -1524,11 +1525,11 @@ static void window_options_audio_scrollgetsize(rct_window* w, int32_t scrollInde static void initialize_scroll_position(rct_window* w, rct_widgetindex widget_index, int32_t scroll_id, uint8_t volume) { - rct_widget* widget = &window_options_audio_widgets[widget_index]; - rct_scroll* scroll = &w->scrolls[scroll_id]; + const auto& widget = window_options_audio_widgets[widget_index]; + auto& scroll = w->scrolls[scroll_id]; - int widget_size = scroll->h_right - (widget->width() - 1); - scroll->h_left = ceil(volume / 100.0f * widget_size); + int32_t widget_size = scroll.h_right - (widget.width() - 1); + scroll.h_left = ceil(volume / 100.0f * widget_size); WidgetScrollUpdateThumbs(w, widget_index); } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 2c28d5fecf..68276a7d51 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -568,7 +568,6 @@ void window_update_scroll_widgets(rct_window* w) { int32_t scrollIndex, width, height, scrollPositionChanged; rct_widgetindex widgetIndex; - rct_scroll* scroll; rct_widget* widget; widgetIndex = 0; @@ -579,32 +578,32 @@ void window_update_scroll_widgets(rct_window* w) if (widget->type != WindowWidgetType::Scroll) continue; - scroll = &w->scrolls[scrollIndex]; + auto& scroll = w->scrolls[scrollIndex]; width = 0; height = 0; window_get_scroll_size(w, scrollIndex, &width, &height); if (height == 0) { - scroll->v_top = 0; + scroll.v_top = 0; } else if (width == 0) { - scroll->h_left = 0; + scroll.h_left = 0; } width++; height++; scrollPositionChanged = 0; - if ((widget->content & SCROLL_HORIZONTAL) && width != scroll->h_right) + if ((widget->content & SCROLL_HORIZONTAL) && width != scroll.h_right) { scrollPositionChanged = 1; - scroll->h_right = width; + scroll.h_right = width; } - if ((widget->content & SCROLL_VERTICAL) && height != scroll->v_bottom) + if ((widget->content & SCROLL_VERTICAL) && height != scroll.v_bottom) { scrollPositionChanged = 1; - scroll->v_bottom = height; + scroll.v_bottom = height; } if (scrollPositionChanged) @@ -1292,8 +1291,9 @@ void window_resize(rct_window* w, int32_t dw, int32_t dh) // Update scroll widgets for (int32_t i = 0; i < 3; i++) { - w->scrolls[i].h_right = WINDOW_SCROLL_UNDEFINED; - w->scrolls[i].v_bottom = WINDOW_SCROLL_UNDEFINED; + auto& scroll = w->scrolls[i]; + scroll.h_right = WINDOW_SCROLL_UNDEFINED; + scroll.v_bottom = WINDOW_SCROLL_UNDEFINED; } window_update_scroll_widgets(w); @@ -2183,63 +2183,63 @@ rct_windowclass window_get_classification(rct_window* window) void WidgetScrollUpdateThumbs(rct_window* w, rct_widgetindex widget_index) { const auto& widget = w->widgets[widget_index]; - rct_scroll* scroll = &w->scrolls[window_get_scroll_data_index(w, widget_index)]; + auto& scroll = w->scrolls[window_get_scroll_data_index(w, widget_index)]; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) { int32_t view_size = widget.width() - 21; - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) view_size -= 11; - int32_t x = scroll->h_left * view_size; - if (scroll->h_right != 0) - x /= scroll->h_right; - scroll->h_thumb_left = x + 11; + int32_t x = scroll.h_left * view_size; + if (scroll.h_right != 0) + x /= scroll.h_right; + scroll.h_thumb_left = x + 11; x = widget.width() - 2; - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) x -= 11; - x += scroll->h_left; - if (scroll->h_right != 0) - x = (x * view_size) / scroll->h_right; + x += scroll.h_left; + if (scroll.h_right != 0) + x = (x * view_size) / scroll.h_right; x += 11; view_size += 10; - scroll->h_thumb_right = std::min(x, view_size); + scroll.h_thumb_right = std::min(x, view_size); - if (scroll->h_thumb_right - scroll->h_thumb_left < 20) + if (scroll.h_thumb_right - scroll.h_thumb_left < 20) { - double barPosition = (scroll->h_thumb_right * 1.0) / view_size; + double barPosition = (scroll.h_thumb_right * 1.0) / view_size; - scroll->h_thumb_left = static_cast(std::lround(scroll->h_thumb_left - (20 * barPosition))); - scroll->h_thumb_right = static_cast(std::lround(scroll->h_thumb_right + (20 * (1 - barPosition)))); + scroll.h_thumb_left = static_cast(std::lround(scroll.h_thumb_left - (20 * barPosition))); + scroll.h_thumb_right = static_cast(std::lround(scroll.h_thumb_right + (20 * (1 - barPosition)))); } } - if (scroll->flags & VSCROLLBAR_VISIBLE) + if (scroll.flags & VSCROLLBAR_VISIBLE) { int32_t view_size = widget.height() - 21; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) view_size -= 11; - int32_t y = scroll->v_top * view_size; - if (scroll->v_bottom != 0) - y /= scroll->v_bottom; - scroll->v_thumb_top = y + 11; + int32_t y = scroll.v_top * view_size; + if (scroll.v_bottom != 0) + y /= scroll.v_bottom; + scroll.v_thumb_top = y + 11; y = widget.height() - 2; - if (scroll->flags & HSCROLLBAR_VISIBLE) + if (scroll.flags & HSCROLLBAR_VISIBLE) y -= 11; - y += scroll->v_top; - if (scroll->v_bottom != 0) - y = (y * view_size) / scroll->v_bottom; + y += scroll.v_top; + if (scroll.v_bottom != 0) + y = (y * view_size) / scroll.v_bottom; y += 11; view_size += 10; - scroll->v_thumb_bottom = std::min(y, view_size); + scroll.v_thumb_bottom = std::min(y, view_size); - if (scroll->v_thumb_bottom - scroll->v_thumb_top < 20) + if (scroll.v_thumb_bottom - scroll.v_thumb_top < 20) { - double barPosition = (scroll->v_thumb_bottom * 1.0) / view_size; + double barPosition = (scroll.v_thumb_bottom * 1.0) / view_size; - scroll->v_thumb_top = static_cast(std::lround(scroll->v_thumb_top - (20 * barPosition))); - scroll->v_thumb_bottom = static_cast(std::lround(scroll->v_thumb_bottom + (20 * (1 - barPosition)))); + scroll.v_thumb_top = static_cast(std::lround(scroll.v_thumb_top - (20 * barPosition))); + scroll.v_thumb_bottom = static_cast(std::lround(scroll.v_thumb_bottom + (20 * (1 - barPosition)))); } } } From 06dc75845a3a9896d03a9e6b67eac49a79e655f1 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 1 Oct 2021 18:10:25 +0200 Subject: [PATCH 476/681] Fix #15476: Crash in map_place_clear_func() --- distribution/changelog.txt | 1 + src/openrct2/world/SmallScenery.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 5b1ac91904..c32fc53503 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -27,6 +27,7 @@ - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. +- Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Improved: [#3417] Crash dumps are now placed in their own folder. diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index c71fc753f4..14ee1b3509 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -37,11 +37,11 @@ static int32_t map_place_clear_func( if (gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) { - if (scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_IS_TREE)) + if (scenery != nullptr && scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_IS_TREE)) return 1; } - if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) + if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && scenery != nullptr) *price += scenery->removal_price * 10; if (flags & GAME_COMMAND_FLAG_GHOST) From 1d62a902e707124c1e0d8c737549ae754eee734d Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 1 Oct 2021 21:50:05 +0200 Subject: [PATCH 477/681] Make scenery_small_entry_has_flag a member function (#15509) --- src/openrct2-ui/windows/Scenery.cpp | 19 +++--- src/openrct2-ui/windows/TileInspector.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 17 +++--- src/openrct2/actions/LandSetHeightAction.cpp | 2 +- .../actions/SmallSceneryPlaceAction.cpp | 54 ++++++++--------- .../actions/SmallSceneryRemoveAction.cpp | 2 +- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/object/SmallSceneryObject.cpp | 19 +++--- .../paint/tile_element/Paint.SmallScenery.cpp | 60 +++++++++---------- src/openrct2/peep/Staff.cpp | 4 +- src/openrct2/ride/TrackDesign.cpp | 10 ++-- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/world/Map.cpp | 2 +- src/openrct2/world/MapAnimation.cpp | 9 ++- src/openrct2/world/Scenery.cpp | 7 +-- src/openrct2/world/Scenery.h | 5 ++ src/openrct2/world/SmallScenery.cpp | 9 +-- src/openrct2/world/SmallScenery.h | 3 +- 18 files changed, 107 insertions(+), 121 deletions(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 014cba9029..d32e3b3679 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -989,7 +989,7 @@ void window_scenery_invalidate(rct_window* w) } auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ROTATABLE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; } @@ -1060,12 +1060,11 @@ void window_scenery_invalidate(rct_window* w) { auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); - if (scenery_small_entry_has_flag( - sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) { window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } } @@ -1313,11 +1312,11 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s auto* sceneryEntry = get_small_scenery_entry(currentSceneryGlobal.EntryIndex); uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; } @@ -1325,15 +1324,15 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s uint16_t spriteTop = (sceneryEntry->height / 4) + 0x2B; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) - && scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) + && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { spriteTop -= 0x0C; } gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) { imageId = ((sceneryEntry->image + gWindowSceneryRotation) + 0x40000004) + (EnumValue(GlassPaletteIds[gWindowSceneryPrimaryColour]) << 19); @@ -1341,7 +1340,7 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ANIMATED_FG)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) { imageId = (sceneryEntry->image + gWindowSceneryRotation) + 4; gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 09fbcbceb6..2eda35345c 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -2010,7 +2010,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) // Quadrant value const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - if (sceneryEntry != nullptr && !(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE))) + if (sceneryEntry != nullptr && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) { int16_t quadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); static rct_string_id quadrant_string_idx[] = { STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW, diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index eb694a4a76..65aaad579c 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1006,8 +1006,7 @@ static void repaint_scenery_tool_down(const ScreenCoordsXY& windowPos, rct_widge auto* sceneryEntry = info.Element->AsSmallScenery()->GetEntry(); // If can't repaint - if (!scenery_small_entry_has_flag( - sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) return; uint8_t quadrant = info.Element->AsSmallScenery()->GetSceneryQuadrant(); @@ -1251,7 +1250,7 @@ static void sub_6E1F34_small_scenery( auto* sceneryEntry = get_small_scenery_entry(sceneryIndex); maxPossibleHeight -= sceneryEntry->height; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_STACKABLE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) { can_raise_item = true; } @@ -1259,7 +1258,7 @@ static void sub_6E1F34_small_scenery( sub_6E1F34_update_screen_coords_and_buttons_pressed(can_raise_item, screenPos); // Small scenery - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { uint8_t quadrant = 0; @@ -1323,7 +1322,7 @@ static void sub_6E1F34_small_scenery( uint8_t rotation = gWindowSceneryRotation; - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ROTATABLE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { rotation = util_rand() & 0xFF; } @@ -1407,7 +1406,7 @@ static void sub_6E1F34_small_scenery( gridPos = gridPos.ToTileStart(); uint8_t rotation = gWindowSceneryRotation; - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ROTATABLE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { rotation = util_rand() & 0xFF; } @@ -1766,7 +1765,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos if (isCluster) { - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { quadrant = util_rand() & 3; } @@ -1781,7 +1780,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos cur_grid_x += grid_x_offset * COORDS_XY_STEP; cur_grid_y += grid_y_offset * COORDS_XY_STEP; - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ROTATABLE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { gSceneryPlaceRotation = (gSceneryPlaceRotation + 1) & 3; } @@ -2661,7 +2660,7 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) auto* sceneryEntry = get_small_scenery_entry(selection.EntryIndex); gMapSelectType = MAP_SELECT_TYPE_FULL; - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) { gMapSelectType = MAP_SELECT_TYPE_QUARTER_0 + (quadrant ^ 2); } diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index c636a7cf81..e4cbc8ccbb 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -222,7 +222,7 @@ TileElement* LandSetHeightAction::CheckTreeObstructions() const continue; auto* sceneryEntry = sceneryElement->GetEntry(); - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_TREE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) continue; return sceneryElement->as(); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 5a4ed72cd3..210a9c6ad7 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -133,11 +133,10 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const } auto quadrant = _quadrant; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) - || !scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) || !sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) { - if (scenery_small_entry_has_flag( - sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) + if (sceneryEntry->HasFlag( + SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) { quadrant = 0; } @@ -145,7 +144,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const // Check if sub tile height is any different compared to actual surface tile height auto loc2 = _loc; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { loc2 = loc2.ToTileCentre(); } @@ -192,7 +191,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const } } - if (!gCheatsDisableClearanceChecks && !(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_STACKABLE))) + if (!gCheatsDisableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))) { if (isOnWater) { @@ -210,15 +209,13 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const } } - if (!gCheatsDisableClearanceChecks && (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) - && !supportsRequired && !isOnWater && surfaceElement != nullptr - && (surfaceElement->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)) + if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) && !supportsRequired + && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)) { return std::make_unique(GameActions::Status::Disallowed, STR_LEVEL_LAND_REQUIRED); } - if (!gCheatsDisableSupportLimits && !(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_STACKABLE)) - && supportsRequired) + if (!gCheatsDisableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) && supportsRequired) { if (!isOnWater) { @@ -242,17 +239,16 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const int32_t zHigh = zLow + ceil2(sceneryEntry->height, COORDS_Z_STEP); uint8_t collisionQuadrants = 0b1111; auto quadRotation{ 0 }; - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) { quadRotation = (quadrant ^ 2); collisionQuadrants = 0b0001; } - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HALF_SPACE))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HALF_SPACE))) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL) - && scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_THREE_QUARTERS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_THREE_QUARTERS)) { quadRotation = ((quadrant ^ 2) + _loc.direction) & 3; collisionQuadrants = 0b1011; @@ -276,7 +272,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const } QuarterTile quarterTile = QuarterTile{ collisionQuadrants, supports }.Rotate(quadRotation); - const auto isTree = scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_TREE); + const auto isTree = sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE); auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), CREATE_CROSSING_MODE_NONE, isTree); if (canBuild->Error != GameActions::Status::Ok) @@ -327,11 +323,10 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const } auto quadrant = _quadrant; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) - || !scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) || !sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) { - if (scenery_small_entry_has_flag( - sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) + if (sceneryEntry->HasFlag( + SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) { quadrant = 0; } @@ -340,7 +335,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const // Check if sub tile height is any different compared to actual surface tile height int32_t x2 = _loc.x; int32_t y2 = _loc.y; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { x2 += 16; y2 += 16; @@ -369,7 +364,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { footpath_remove_litter({ _loc, targetHeight }); - if (!gCheatsDisableClearanceChecks && (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_WALLS))) + if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))) { wall_remove_at({ _loc, targetHeight, targetHeight + sceneryEntry->height }); } @@ -379,17 +374,16 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const int32_t zHigh = zLow + ceil2(sceneryEntry->height, 8); uint8_t collisionQuadrants = 0b1111; auto quadRotation{ 0 }; - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) { quadRotation = (quadrant ^ 2); collisionQuadrants = 0b0001; } - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HALF_SPACE))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HALF_SPACE))) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL) - && scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_THREE_QUARTERS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_THREE_QUARTERS)) { quadRotation = ((quadrant ^ 2) + _loc.direction) & 3; collisionQuadrants = 0b1011; @@ -413,7 +407,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const } QuarterTile quarterTile = QuarterTile{ collisionQuadrants, supports }.Rotate(quadRotation); - const auto isTree = scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_TREE); + const auto isTree = sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE); auto canBuild = MapCanConstructWithClearAt( { _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, CREATE_CROSSING_MODE_NONE, isTree); @@ -448,7 +442,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const res->tileElement = sceneryElement->as(); map_invalidate_tile_full(_loc); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ANIMATED)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) { map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseZ() }); } diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index e7fcb83290..007737dacf 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -76,7 +76,7 @@ GameActions::Result::Ptr SmallSceneryRemoveAction::Query() const // Check if allowed to remove item if (gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) { - if (scenery_small_entry_has_flag(entry, SMALL_SCENERY_FLAG_IS_TREE)) + if (entry->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) { res->Error = GameActions::Status::NoClearance; res->ErrorTitle = STR_CANT_REMOVE_THIS; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 17bd70d98f..5c988aa902 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -566,7 +566,7 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( case TILE_ELEMENT_TYPE_SMALL_SCENERY: { auto sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_WALLS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) { map_obstruction_set_error_text(tileElement, *res); return res; diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 17cb16a03b..a52b14a9e0 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -42,7 +42,7 @@ void SmallSceneryObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStre rct_object_entry sgEntry = stream->ReadValue(); SetPrimarySceneryGroup(ObjectEntryDescriptor(sgEntry)); - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { _frameOffsets = ReadFrameOffsets(stream); } @@ -78,7 +78,7 @@ void SmallSceneryObject::Load() _legacyType.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL; - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { _legacyType.frame_offsets = _frameOffsets.data(); } @@ -98,10 +98,10 @@ void SmallSceneryObject::Unload() void SmallSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const { uint32_t imageId = _legacyType.image; - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { imageId |= 0x20D00000; - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { imageId |= 0x92000000; } @@ -110,28 +110,27 @@ void SmallSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3 auto screenCoords = ScreenCoordsXY{ width / 2, (height / 2) + (_legacyType.height / 2) }; screenCoords.y = std::min(screenCoords.y, height - 16); - if ((scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_FULL_TILE)) - && (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_VOFFSET_CENTRE))) + if ((_legacyType.HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) && (_legacyType.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE))) { screenCoords.y -= 12; } gfx_draw_sprite(dpi, imageId, screenCoords, 0); - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_GLASS)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) { imageId = _legacyType.image + 0x44500004; - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { imageId |= 0x92000000; } gfx_draw_sprite(dpi, imageId, screenCoords, 0); } - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_ANIMATED_FG)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) { imageId = _legacyType.image + 4; - if (scenery_small_entry_has_flag(&_legacyType, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { imageId |= 0x92000000; } diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index c8cfb5e302..79dc4ede3f 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -75,9 +75,9 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height boxlength.y = 2; int8_t x_offset = 0; int8_t y_offset = 0; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HALF_SPACE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HALF_SPACE)) { // 6DFFE3: static constexpr const CoordsXY scenery_half_tile_offsets[] = { @@ -97,13 +97,13 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { x_offset = 15; y_offset = 15; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { x_offset = 3; y_offset = 3; boxlength.x = 26; boxlength.y = 26; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_WALLS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) { x_offset = 1; y_offset = 1; @@ -130,7 +130,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { boxlength.z = 128; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_WITHER)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_WITHER)) { if (sceneryElement.GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_1) { @@ -141,9 +141,9 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height baseImageid += 4; } } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { baseImageid |= SPRITE_ID_PALETTE_COLOUR_2(sceneryElement.GetPrimaryColour(), sceneryElement.GetSecondaryColour()); } @@ -156,13 +156,13 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { baseImageid = (baseImageid & 0x7FFFF) | marker; } - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED))) { PaintAddImageAsParent( session, baseImageid, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, boxoffset); } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_GLASS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) { if (marker == 0) { @@ -176,13 +176,13 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height } } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ANIMATED)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) { rct_drawpixelinfo* dpi = &session->DPI; - if ((scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) || (dpi->zoom_level <= 1)) + if ((sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) || (dpi->zoom_level <= 1)) { // 6E01A9: - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1)) { // 6E0512: int32_t image_id = ((gCurrentTicks / 2) & 0xF) + sceneryEntry->image + 4; @@ -194,7 +194,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, boxoffset.y, boxoffset.z); } - else if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4)) + else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4)) { // 6E043B: int32_t image_id = ((gCurrentTicks / 2) & 0xF) + sceneryEntry->image + 8; @@ -224,7 +224,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, boxoffset.y, boxoffset.z); } - else if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_CLOCK)) + else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_CLOCK)) { // 6E035C: int32_t minuteImageOffset = ((gRealTimeOfDay.minute + 6) * 17) / 256; @@ -267,7 +267,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, boxoffset.y, boxoffset.z); } - else if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_SWAMP_GOO)) + else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_SWAMP_GOO)) { // 6E02F6: int32_t image_id = gCurrentTicks; @@ -283,10 +283,10 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height session, image_id, x_offset, y_offset, boxlength.x, boxlength.y, boxlength.z - 1, height, boxoffset.x, boxoffset.y, boxoffset.z); } - else if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) + else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { int32_t frame = gCurrentTicks; - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_COG))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_COG))) { // 6E01F8: frame += ((session->SpritePosition.x / 4) + (session->SpritePosition.y / 4)); @@ -302,13 +302,13 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height image_id = sceneryEntry->frame_offsets[frame]; } image_id = (image_id * 4) + direction + sceneryEntry->image; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED | SMALL_SCENERY_FLAG17)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED | SMALL_SCENERY_FLAG17)) { image_id += 4; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) { image_id |= SPRITE_ID_PALETTE_COLOUR_2( sceneryElement.GetPrimaryColour(), sceneryElement.GetSecondaryColour()); @@ -322,7 +322,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height { image_id = (image_id & 0x7FFFF) | marker; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VISIBLE_WHEN_ZOOMED)) { PaintAddImageAsParent( session, image_id, { x_offset, y_offset, height }, { boxlength.x, boxlength.y, boxlength.z - 1 }, @@ -340,7 +340,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height // 6E0556: Draw supports: if (sceneryElement.NeedsSupports()) { - if (!(scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_NO_SUPPORTS))) + if (!(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_SUPPORTS))) { int32_t ax = 0; int32_t supportHeight = height; @@ -350,7 +350,7 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height ax = 49; } uint32_t supportImageColourFlags = IMAGE_TYPE_REMAP; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_PAINT_SUPPORTS)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_PAINT_SUPPORTS)) { supportImageColourFlags = SPRITE_ID_PALETTE_COLOUR_1(sceneryElement.GetPrimaryColour()); } @@ -373,19 +373,19 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height paint_util_set_general_support_height(session, ceil2(height, 8), 0x20); // 6E05FF: - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP)) { - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { // 6E0825: paint_util_set_segment_support_height(session, SEGMENT_C4, height, 0x20); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, height, 0x20); } return; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { // 6E075C: direction = (sceneryElement.GetSceneryQuadrant() + rotation) % 4; @@ -395,16 +395,16 @@ void PaintSmallScenery(paint_session* session, uint8_t direction, int32_t height } return; } - if (scenery_small_entry_has_flag(sceneryEntry, (SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE))) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE)) { paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); } return; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { direction = (sceneryElement.GetSceneryQuadrant() + rotation) % 4; paint_util_set_segment_support_height( diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 3b13a52fb7..41e1829500 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1258,7 +1258,7 @@ void Staff::UpdateWatering() auto* sceneryEntry = tile_element->AsSmallScenery()->GetEntry(); - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_BE_WATERED)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED)) continue; tile_element->AsSmallScenery()->SetAge(0); @@ -1645,7 +1645,7 @@ bool Staff::UpdatePatrollingFindWatering() auto* sceneryEntry = tile_element->AsSmallScenery()->GetEntry(); - if (sceneryEntry == nullptr || !scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_BE_WATERED)) + if (sceneryEntry == nullptr || !sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED)) { continue; } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 4af87d4f7c..b8fbd9f1e6 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -726,10 +726,10 @@ static void track_design_mirror_scenery(TrackDesign* td6) auto* sceneryEntry = static_cast(object_entry_get_chunk(entry_type, entryIndex)); scenery.y = -scenery.y; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) { scenery.flags ^= (1 << 0); - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { scenery.flags ^= (1 << 2); } @@ -935,10 +935,8 @@ static bool TrackDesignPlaceSceneryElementRemoveGhost( quadrant &= 3; auto* sceneryEntry = get_small_scenery_entry(entry_index); - if (!(!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE) - && scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_DIAGONAL)) - && scenery_small_entry_has_flag( - sceneryEntry, + if (!(!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) + && sceneryEntry->HasFlag( SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) { quadrant = 0; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index cda6650c8b..8044cdcd9a 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1928,7 +1928,7 @@ void Vehicle::UpdateMeasurements() if (sceneryEntry == nullptr) continue; - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { coverFound = true; break; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index eb3ddb0e4c..8b90b8d3e0 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -2182,7 +2182,7 @@ bool map_surface_is_blocked(const CoordsXY& mapCoords) { return false; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_FULL_TILE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) return true; } return false; diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index e5f75f9a4d..a2b253eec5 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -177,16 +177,15 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) if (sceneryEntry == nullptr) continue; - if (scenery_small_entry_has_flag( - sceneryEntry, + if (sceneryEntry->HasFlag( SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1 | SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4 | SMALL_SCENERY_FLAG_SWAMP_GOO - | SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) + | SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() }); return false; } - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_CLOCK)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_CLOCK)) { // Peep, looking at scenery if (!(gCurrentTicks & 0x3FF) && game_is_not_paused()) @@ -638,7 +637,7 @@ void AutoCreateMapAnimations() { auto sceneryEl = el->AsSmallScenery(); auto* sceneryEntry = sceneryEl->GetEntry(); - if (sceneryEntry != nullptr && scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_ANIMATED)) + if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) { map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, loc); } diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index ba8e2b4982..1f61117c87 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -109,13 +109,12 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) return; } - if (gCheatsDisablePlantAging && (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_BE_WATERED))) + if (gCheatsDisablePlantAging && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED)) { return; } - if (!scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_BE_WATERED) || WeatherIsDry(gClimateCurrent.Weather) - || GetAge() < 5) + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED) || WeatherIsDry(gClimateCurrent.Weather) || GetAge() < 5) { IncreaseAge(sceneryPos); return; @@ -143,7 +142,7 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) return; case TILE_ELEMENT_TYPE_SMALL_SCENERY: sceneryEntry = tileElementAbove->AsSmallScenery()->GetEntry(); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { IncreaseAge(sceneryPos); return; diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index d5948ab0f7..03e1aca011 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -131,6 +131,11 @@ struct SmallSceneryEntry : SceneryEntryBase uint16_t animation_mask; uint16_t num_frames; ObjectEntryIndex scenery_tab_id; + + constexpr bool HasFlag(const uint32_t _flags) const + { + return (flags & _flags) != 0; + } }; struct WallSceneryEntry : SceneryEntryBase diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 14ee1b3509..8e01331916 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -37,7 +37,7 @@ static int32_t map_place_clear_func( if (gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) { - if (scenery != nullptr && scenery_small_entry_has_flag(scenery, SMALL_SCENERY_FLAG_IS_TREE)) + if (scenery != nullptr && scenery->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) return 1; } @@ -76,11 +76,6 @@ int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const Coord return map_place_clear_func(tile_element, coords, flags, price, /*is_scenery=*/false); } -bool scenery_small_entry_has_flag(const SmallSceneryEntry* sceneryEntry, uint32_t flags) -{ - return static_cast(sceneryEntry->flags & flags); -} - uint8_t SmallSceneryElement::GetSceneryQuadrant() const { return (this->type & TILE_ELEMENT_QUADRANT_MASK) >> 6; @@ -126,7 +121,7 @@ void SmallSceneryElement::IncreaseAge(const CoordsXY& sceneryPos) { auto* sceneryEntry = GetEntry(); - if (scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_CAN_WITHER)) + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_WITHER)) { map_invalidate_tile_zoom1({ sceneryPos, GetBaseZ(), GetClearanceZ() }); } diff --git a/src/openrct2/world/SmallScenery.h b/src/openrct2/world/SmallScenery.h index 5094dcf8b8..8a8ded3aeb 100644 --- a/src/openrct2/world/SmallScenery.h +++ b/src/openrct2/world/SmallScenery.h @@ -13,7 +13,7 @@ #include "Map.h" #include "Scenery.h" -enum SMALL_SCENERY_FLAGS +enum SMALL_SCENERY_FLAGS : uint32_t { SMALL_SCENERY_FLAG_FULL_TILE = (1 << 0), // 0x1 SMALL_SCENERY_FLAG_VOFFSET_CENTRE = (1 << 1), // 0x2 @@ -53,5 +53,4 @@ enum MAP_ELEM_SMALL_SCENERY_COLOUR_FLAG_NEEDS_SUPPORTS = (1 << 5), }; -bool scenery_small_entry_has_flag(const SmallSceneryEntry* sceneryEntry, uint32_t flags); SmallSceneryEntry* get_small_scenery_entry(ObjectEntryIndex entryIndex); From 2597c04eb4348f80549e898c3a2351f500598e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Oct 2021 00:19:39 +0300 Subject: [PATCH 478/681] Refactor RideCreateAction result data passing --- src/openrct2/actions/GameActionCompat.cpp | 6 ++-- src/openrct2/actions/RideCreateAction.cpp | 34 ++++++++-------------- src/openrct2/actions/RideCreateAction.h | 11 +------ src/openrct2/actions/TrackDesignAction.cpp | 6 ++-- src/openrct2/ride/TrackDesign.cpp | 5 ++-- src/openrct2/scripting/ScriptEngine.cpp | 6 ++-- 6 files changed, 23 insertions(+), 45 deletions(-) diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 9af73acc63..d33c82df83 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -67,11 +67,11 @@ void ride_construct_new(RideSelection listItem) auto gameAction = RideCreateAction(listItem.Type, listItem.EntryIndex, colour1, colour2); - gameAction.SetCallback([](const GameAction* ga, const RideCreateGameActionResult* result) { + gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - - auto ride = get_ride(result->rideIndex); + const auto rideIndex = result->GetData(); + auto ride = get_ride(rideIndex); ride_construct(ride); }); diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index bf09c66fe9..36e0341c11 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -27,16 +27,6 @@ #include -RideCreateGameActionResult::RideCreateGameActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_NONE) -{ -} - -RideCreateGameActionResult::RideCreateGameActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, message) -{ -} - RideCreateAction::RideCreateAction(int32_t rideType, ObjectEntryIndex subType, int32_t colour1, int32_t colour2) : _rideType(rideType) , _subType(subType) @@ -81,39 +71,42 @@ GameActions::Result::Ptr RideCreateAction::Query() const if (rideIndex == RIDE_ID_NULL) { // No more free slots available. - return MakeResult(GameActions::Status::NoFreeElements, STR_TOO_MANY_RIDES); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_TOO_MANY_RIDES); } if (_rideType >= RIDE_TYPE_COUNT) { - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_RIDE_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } int32_t rideEntryIndex = ride_get_entry_index(_rideType, _subType); if (rideEntryIndex >= MAX_RIDE_OBJECTS) { - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_RIDE_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets; if (_colour1 >= colourPresets.count) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(rideEntryIndex); if (rideEntry == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } vehicle_colour_preset_list* presetList = rideEntry->vehicle_preset_list; if ((presetList->count > 0 && presetList->count != 255) && _colour2 >= presetList->count) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } - return MakeResult(); + auto res = MakeResult(); + res->SetData(ride_id_t{ rideIndex }); + + return res; } GameActions::Result::Ptr RideCreateAction::Execute() const @@ -124,16 +117,12 @@ GameActions::Result::Ptr RideCreateAction::Execute() const int32_t rideEntryIndex = ride_get_entry_index(_rideType, _subType); auto rideIndex = GetNextFreeRideId(); - res->rideIndex = rideIndex; - auto ride = GetOrAllocateRide(rideIndex); rideEntry = get_ride_entry(rideEntryIndex); if (rideEntry == nullptr) { log_warning("Invalid request for ride %u", rideIndex); - res->Error = GameActions::Status::Unknown; - res->ErrorMessage = STR_UNKNOWN_OBJECT_TYPE; - return res; + return MakeResult(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } ride->id = rideIndex; @@ -309,6 +298,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const window_invalidate_by_class(WC_RIDE_LIST); res->Expenditure = ExpenditureType::RideConstruction; + res->SetData(ride_id_t{ rideIndex }); return res; } diff --git a/src/openrct2/actions/RideCreateAction.h b/src/openrct2/actions/RideCreateAction.h index 098a749bf4..8f3f30a116 100644 --- a/src/openrct2/actions/RideCreateAction.h +++ b/src/openrct2/actions/RideCreateAction.h @@ -11,16 +11,7 @@ #include "GameAction.h" -class RideCreateGameActionResult final : public GameActions::Result -{ -public: - RideCreateGameActionResult(); - RideCreateGameActionResult(GameActions::Status error, rct_string_id message); - - ride_id_t rideIndex = RIDE_ID_NULL; -}; - -DEFINE_GAME_ACTION(RideCreateAction, GameCommand::CreateRide, RideCreateGameActionResult) +DEFINE_GAME_ACTION(RideCreateAction, GameCommand::CreateRide, GameActions::Result) { private: ObjectEntryIndex _rideType{ OBJECT_ENTRY_INDEX_NULL }; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 8b34c92053..75e2637809 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -102,13 +102,12 @@ GameActions::Result::Ptr TrackDesignAction::Query() const auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0); rideCreateAction.SetFlags(GetFlags()); auto r = GameActions::ExecuteNested(&rideCreateAction); - auto rideIndex = static_cast(r.get())->rideIndex; - if (r->Error != GameActions::Status::Ok) { return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } + const auto rideIndex = r->GetData(); auto ride = get_ride(rideIndex); if (ride == nullptr) { @@ -163,13 +162,12 @@ GameActions::Result::Ptr TrackDesignAction::Execute() const auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0); rideCreateAction.SetFlags(GetFlags()); auto r = GameActions::ExecuteNested(&rideCreateAction); - auto rideIndex = static_cast(r.get())->rideIndex; - if (r->Error != GameActions::Status::Ok) { return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } + const auto rideIndex = r->GetData(); auto ride = get_ride(rideIndex); if (ride == nullptr) { diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 4af87d4f7c..9da0a967f2 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1866,8 +1866,7 @@ static money32 track_design_ride_create_command(int32_t type, int32_t subType, i auto gameAction = RideCreateAction(type, subType, 0, 0); gameAction.SetFlags(flags); - auto r = GameActions::ExecuteNested(&gameAction); - const RideCreateGameActionResult* res = static_cast(r.get()); + auto res = GameActions::ExecuteNested(&gameAction); // Callee's of this function expect MONEY32_UNDEFINED in case of failure. if (res->Error != GameActions::Status::Ok) @@ -1875,7 +1874,7 @@ static money32 track_design_ride_create_command(int32_t type, int32_t subType, i return MONEY32_UNDEFINED; } - *outRideIndex = res->rideIndex; + *outRideIndex = res->GetData(); return res->Cost; } diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index c38ae2f90d..1208beeb0c 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -884,10 +884,10 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std if (action.GetType() == GameCommand::CreateRide) { - auto& rideCreateResult = static_cast(*result.get()); - if (rideCreateResult.rideIndex != RIDE_ID_NULL) + if (result->Error == GameActions::Status::Ok) { - obj.Set("ride", EnumValue(rideCreateResult.rideIndex)); + const auto rideIndex = result->GetData(); + obj.Set("ride", EnumValue(rideIndex)); } } else if (action.GetType() == GameCommand::HireNewStaffMember) From 76c2f9db851afb6c0c6caebcf470efb8a8d91591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Oct 2021 00:00:29 +0300 Subject: [PATCH 479/681] Refactor LargeSceneryPlaceAction result data passing --- src/openrct2-ui/windows/TopToolbar.cpp | 9 +-- .../actions/LargeSceneryPlaceAction.cpp | 71 ++++++++----------- .../actions/LargeSceneryPlaceAction.h | 10 +-- 3 files changed, 36 insertions(+), 54 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index eb694a4a76..a275c67dc7 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -2547,14 +2547,15 @@ static money64 try_place_ghost_large_scenery( auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, entryIndex, primaryColour, secondaryColour); sceneryPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); auto res = GameActions::Execute(&sceneryPlaceAction); - auto lspar = dynamic_cast(res.get()); - if (lspar == nullptr || res->Error != GameActions::Status::Ok) + if (res->Error != GameActions::Status::Ok) return MONEY64_UNDEFINED; + const auto placementData = res->GetData(); + gSceneryPlaceRotation = loc.direction; - gSceneryGhostPosition = { loc, lspar->firstTileHeight }; - if (lspar->GroundFlags & ELEMENT_IS_UNDERGROUND) + gSceneryGhostPosition = { loc, placementData.firstTileHeight }; + if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) { // Set underground on viewport_set_visibility(4); diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index ba4e3b5a3b..51b3801cec 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -17,26 +17,6 @@ #include "../world/MapAnimation.h" #include "../world/Surface.h" -LargeSceneryPlaceActionResult::LargeSceneryPlaceActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_CANT_POSITION_THIS_HERE) -{ -} - -LargeSceneryPlaceActionResult::LargeSceneryPlaceActionResult(GameActions::Status error) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE) -{ -} - -LargeSceneryPlaceActionResult::LargeSceneryPlaceActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE, message) -{ -} - -LargeSceneryPlaceActionResult::LargeSceneryPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE, message, args) -{ -} - LargeSceneryPlaceAction::LargeSceneryPlaceAction( const CoordsXYZD& loc, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour) : _loc(loc) @@ -68,14 +48,15 @@ void LargeSceneryPlaceAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const { - auto res = std::make_unique(); + auto res = MakeResult(); res->ErrorTitle = STR_CANT_POSITION_THIS_HERE; res->Expenditure = ExpenditureType::Landscaping; int16_t surfaceHeight = tile_element_height(_loc); res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = surfaceHeight; - res->GroundFlags = 0; + + auto resultData = LargeSceneryPlaceActionResult{}; money32 supportsCost = 0; @@ -84,20 +65,20 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const log_error( "Invalid game command for scenery placement, primaryColour = %u, secondaryColour = %u", _primaryColour, _secondaryColour); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(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); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto* sceneryEntry = get_large_scenery_entry(_sceneryType); if (sceneryEntry == nullptr) { log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } uint32_t totalNumTiles = GetTotalNumTiles(sceneryEntry->tiles); @@ -148,45 +129,47 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const { if ((canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) || (canBuild->GroundFlags & ELEMENT_IS_UNDERGROUND)) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_UNDERWATER); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - if (res->GroundFlags && !(res->GroundFlags & tempSceneryGroundFlags)) + if (resultData.GroundFlags && !(resultData.GroundFlags & tempSceneryGroundFlags)) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, + STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } } - res->GroundFlags = tempSceneryGroundFlags; + resultData.GroundFlags = tempSceneryGroundFlags; if (!LocationValid(curTile) || map_is_edge(curTile)) { - return std::make_unique(GameActions::Status::Disallowed, STR_OFF_EDGE_OF_MAP); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned({ curTile, zLow }) && !gCheatsSandboxMode) { - return std::make_unique(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } if (!CheckMapCapacity(sceneryEntry->tiles, totalNumTiles)) { log_error("No free map elements available"); - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } // Force ride construction to recheck area _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; res->Cost = (sceneryEntry->price * 10) + supportsCost; + res->SetData(std::move(resultData)); + return res; } GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const { - auto res = std::make_unique(); + auto res = MakeResult(); res->ErrorTitle = STR_CANT_POSITION_THIS_HERE; res->Expenditure = ExpenditureType::Landscaping; @@ -194,7 +177,8 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const res->Position.x = _loc.x + 16; res->Position.y = _loc.y + 16; res->Position.z = surfaceHeight; - res->GroundFlags = 0; + + auto resultData = LargeSceneryPlaceActionResult{}; money32 supportsCost = 0; @@ -202,13 +186,13 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const if (sceneryEntry == nullptr) { log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } if (sceneryEntry->tiles == nullptr) { log_error("Invalid large scenery object, sceneryType = %u", _sceneryType); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } int16_t maxHeight = GetMaxSurfaceHeight(sceneryEntry->tiles); @@ -228,7 +212,8 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const if (banner == nullptr) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult( + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -245,7 +230,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; } - res->bannerId = banner->id; + resultData.bannerId = banner->id; } uint8_t tileNum = 0; @@ -275,7 +260,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const } supportsCost += canBuild->Cost; - res->GroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + resultData.GroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { @@ -302,7 +287,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const if (tileNum == 0) { - res->firstTileHeight = zLow; + resultData.firstTileHeight = zLow; } } @@ -310,6 +295,8 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; res->Cost = (sceneryEntry->price * 10) + supportsCost; + res->SetData(std::move(resultData)); + return res; } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.h b/src/openrct2/actions/LargeSceneryPlaceAction.h index dfba4eb416..2925be57f5 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.h +++ b/src/openrct2/actions/LargeSceneryPlaceAction.h @@ -13,20 +13,14 @@ #include "../world/Scenery.h" #include "GameAction.h" -class LargeSceneryPlaceActionResult final : public GameActions::Result +struct LargeSceneryPlaceActionResult { -public: - LargeSceneryPlaceActionResult(); - LargeSceneryPlaceActionResult(GameActions::Status error); - LargeSceneryPlaceActionResult(GameActions::Status error, rct_string_id message); - LargeSceneryPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args); - uint8_t GroundFlags{ 0 }; int32_t firstTileHeight{ 0 }; BannerIndex bannerId = BANNER_INDEX_NULL; }; -DEFINE_GAME_ACTION(LargeSceneryPlaceAction, GameCommand::PlaceLargeScenery, LargeSceneryPlaceActionResult) +DEFINE_GAME_ACTION(LargeSceneryPlaceAction, GameCommand::PlaceLargeScenery, GameActions::Result) { private: CoordsXYZD _loc; From b7bda6e9382e5648fbd13b0a77728eed981c466e Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 2 Oct 2021 04:08:15 +0000 Subject: [PATCH 480/681] Merge Localisation/master into OpenRCT2/develop --- data/language/de-DE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index fbfe49efbf..88c94be1fb 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -3651,6 +3651,8 @@ STR_6453 :Versionsinfo kopieren STR_6454 :Kann Banner nicht umbenennen … STR_6455 :Kann Schild nicht umbenennen … STR_6456 :Riesiger Screenshot +STR_6457 :Einen Fehler auf GitHub melden +STR_6458 :Dies in Hauptansicht folgen ############# # Scenarios # From b246a4919d601642e7fd1c53eb95519b430da9f1 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 3 Oct 2021 15:20:45 +0200 Subject: [PATCH 481/681] =?UTF-8?q?Fix=20#15514:=20Two=20=E2=80=9Cquit=20t?= =?UTF-8?q?o=20menu=E2=80=9D=20menu=20items=20available=20in=20track=20des?= =?UTF-8?q?igner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TopToolbar.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c32fc53503..ad73c74f33 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -30,6 +30,7 @@ - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). +- Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 65aaad579c..101fe435a1 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -441,11 +441,12 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; gDropdownItemsFormat[numItems++] = STR_EMPTY; - gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; - gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) gDropdownItemsFormat[numItems++] = STR_QUIT_ROLLERCOASTER_DESIGNER; + else + gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; + + gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { From cf7b4ded0808fdc92e41a172db1d198d4e366967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Oct 2021 21:13:04 +0300 Subject: [PATCH 482/681] Move static declaration into cpp file --- src/openrct2/actions/StaffHireNewAction.cpp | 8 ++++++++ src/openrct2/actions/StaffHireNewAction.h | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 7c5ba2507b..de91f58366 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -26,6 +26,14 @@ #include "../world/Park.h" #include "../world/Sprite.h" +/* rct2: 0x009929FC */ +static constexpr const PeepSpriteType spriteTypes[] = { + PeepSpriteType::Handyman, + PeepSpriteType::Mechanic, + PeepSpriteType::Security, + PeepSpriteType::EntertainerPanda, +}; + StaffHireNewActionResult::StaffHireNewActionResult() : GameActions::Result(GameActions::Status::Ok, STR_CANT_HIRE_NEW_STAFF) { diff --git a/src/openrct2/actions/StaffHireNewAction.h b/src/openrct2/actions/StaffHireNewAction.h index 47c9d6bb4c..bd4d94dc65 100644 --- a/src/openrct2/actions/StaffHireNewAction.h +++ b/src/openrct2/actions/StaffHireNewAction.h @@ -12,14 +12,6 @@ #include "../peep/Staff.h" #include "GameAction.h" -/* rct2: 0x009929FC */ -static constexpr const PeepSpriteType spriteTypes[] = { - PeepSpriteType::Handyman, - PeepSpriteType::Mechanic, - PeepSpriteType::Security, - PeepSpriteType::EntertainerPanda, -}; - class StaffHireNewActionResult final : public GameActions::Result { public: From 445fb747bf537f9e3842a6fb27ce042c2b9bc5b7 Mon Sep 17 00:00:00 2001 From: Silent Date: Sun, 3 Oct 2021 20:57:17 +0200 Subject: [PATCH 483/681] Fix Scenario description missing when loading a park from a save file Saved games do not have a valid info chunk, so scenario names/descriptions did not load. --- src/openrct2/rct2/S6Importer.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index e26b9aa513..9795f4a7ae 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -212,15 +212,20 @@ public: gScenarioCategory = static_cast(_s6.info.category); // Some scenarios have their scenario details in UTF-8, due to earlier bugs in OpenRCT2. - if (!IsLikelyUTF8(_s6.info.name) && !IsLikelyUTF8(_s6.info.details)) + auto loadMaybeUTF8 = [](std::string_view str) -> std::string { + return !IsLikelyUTF8(str) ? rct2_to_utf8(str, RCT2LanguageId::EnglishUK) : std::string(str); + }; + + if (_s6.header.type == S6_TYPE_SCENARIO) { - gScenarioName = rct2_to_utf8(_s6.info.name, RCT2LanguageId::EnglishUK); - gScenarioDetails = rct2_to_utf8(_s6.info.details, RCT2LanguageId::EnglishUK); + gScenarioName = loadMaybeUTF8(_s6.info.name); + gScenarioDetails = loadMaybeUTF8(_s6.info.details); } else { - gScenarioName = _s6.info.name; - gScenarioDetails = _s6.info.details; + // Saved games do not have an info chunk + gScenarioName = loadMaybeUTF8(_s6.scenario_name); + gScenarioDetails = loadMaybeUTF8(_s6.scenario_description); } gDateMonthsElapsed = static_cast(_s6.elapsed_months); From 233b1e99b46b6eabc62f1f48b587054f4cba8ba5 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 3 Oct 2021 22:41:55 +0200 Subject: [PATCH 484/681] Fix Windows compilation of OrcaStream --- src/openrct2/core/OrcaStream.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openrct2/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp index 30f25ba4ba..fbc330ae51 100644 --- a/src/openrct2/core/OrcaStream.hpp +++ b/src/openrct2/core/OrcaStream.hpp @@ -512,10 +512,12 @@ namespace OpenRCT2 Read(&raw, sizeof(raw)); return static_cast(raw); } - - uint64_t raw{}; - Read(&raw, sizeof(raw)); - return static_cast(raw); + else + { + uint64_t raw{}; + Read(&raw, sizeof(raw)); + return static_cast(raw); + } } else { From 8effeb26b0479d285892a46a9cb74a6648d5610d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 4 Oct 2021 16:57:39 +0300 Subject: [PATCH 485/681] Refactor action result passing for StaffHireNewAction --- src/openrct2/actions/StaffHireNewAction.cpp | 29 +++++++-------------- src/openrct2/actions/StaffHireNewAction.h | 10 +++---- src/openrct2/peep/Staff.cpp | 5 ++-- src/openrct2/scripting/ScriptEngine.cpp | 9 ++++--- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index de91f58366..5615118635 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -34,16 +34,6 @@ static constexpr const PeepSpriteType spriteTypes[] = { PeepSpriteType::EntertainerPanda, }; -StaffHireNewActionResult::StaffHireNewActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_CANT_HIRE_NEW_STAFF) -{ -} - -StaffHireNewActionResult::StaffHireNewActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_CANT_HIRE_NEW_STAFF, message) -{ -} - StaffHireNewAction::StaffHireNewAction( bool autoPosition, StaffType staffType, EntertainerCostume entertainerType, uint32_t staffOrders) : _autoPosition(autoPosition) @@ -85,8 +75,7 @@ GameActions::Result::Ptr StaffHireNewAction::Execute() const GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const { - auto res = std::make_unique(); - + auto res = MakeResult(); res->Expenditure = ExpenditureType::Wages; if (_staffType >= static_cast(StaffType::Count)) @@ -94,12 +83,12 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const // Invalid staff type. log_error("Tried to use invalid staff type: %u", static_cast(_staffType)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } if (GetNumFreeEntities() < 400) { - return MakeResult(GameActions::Status::NoFreeElements, STR_TOO_MANY_PEOPLE_IN_GAME); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } if (_staffType == static_cast(StaffType::Entertainer)) @@ -109,7 +98,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const // Invalid entertainer costume log_error("Tried to use invalid entertainer type: %u", static_cast(_entertainerType)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } uint32_t availableCostumes = staff_get_available_entertainer_costumes(); @@ -118,7 +107,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const // Entertainer costume unavailable log_error("Tried to use unavailable entertainer type: %u", static_cast(_entertainerType)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } } @@ -133,20 +122,22 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const if (staffIndex == STAFF_MAX_COUNT) { // Too many staff members exist already. - return MakeResult(GameActions::Status::NoFreeElements, STR_TOO_MANY_STAFF_IN_GAME); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_STAFF_IN_GAME); } Staff* newPeep = CreateEntity(); if (newPeep == nullptr) { // Too many peeps exist already. - return MakeResult(GameActions::Status::NoFreeElements, STR_TOO_MANY_PEOPLE_IN_GAME); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_PEOPLE_IN_GAME); } if (execute == false) { // In query we just want to see if we can obtain a sprite slot. sprite_remove(newPeep); + + res->SetData(StaffHireNewActionResult{ SPRITE_INDEX_NULL }); } else { @@ -240,7 +231,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const gStaffPatrolAreas[staffIndex * STAFF_PATROL_AREA_SIZE + i] = 0; } - res->peepSriteIndex = newPeep->sprite_index; + res->SetData(StaffHireNewActionResult{ newPeep->sprite_index }); } return res; diff --git a/src/openrct2/actions/StaffHireNewAction.h b/src/openrct2/actions/StaffHireNewAction.h index bd4d94dc65..5b06979fa6 100644 --- a/src/openrct2/actions/StaffHireNewAction.h +++ b/src/openrct2/actions/StaffHireNewAction.h @@ -12,16 +12,12 @@ #include "../peep/Staff.h" #include "GameAction.h" -class StaffHireNewActionResult final : public GameActions::Result +struct StaffHireNewActionResult { -public: - StaffHireNewActionResult(); - StaffHireNewActionResult(GameActions::Status error, rct_string_id message); - - uint32_t peepSriteIndex = SPRITE_INDEX_NULL; + uint16_t StaffEntityId = SPRITE_INDEX_NULL; }; -DEFINE_GAME_ACTION(StaffHireNewAction, GameCommand::HireNewStaffMember, StaffHireNewActionResult) +DEFINE_GAME_ACTION(StaffHireNewAction, GameCommand::HireNewStaffMember, GameActions::Result) { private: bool _autoPosition{}; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 41e1829500..7b927b487d 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -120,12 +120,13 @@ bool staff_hire_new_member(StaffType staffType, EntertainerCostume entertainerTy } auto hireStaffAction = StaffHireNewAction(autoPosition, staffType, entertainerType, staffOrders); - hireStaffAction.SetCallback([=](const GameAction*, const StaffHireNewActionResult* res) -> void { + hireStaffAction.SetCallback([=](const GameAction*, const GameActions::Result* res) -> void { if (res->Error != GameActions::Status::Ok) return; + auto actionResult = res->GetData(); // Open window for new staff. - auto* staff = GetEntity(res->peepSriteIndex); + auto* staff = GetEntity(actionResult.StaffEntityId); auto intent = Intent(WC_PEEP); intent.putExtra(INTENT_EXTRA_PEEP, staff); context_open_intent(&intent); diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 1208beeb0c..c90c4583e7 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -892,10 +892,13 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std } else if (action.GetType() == GameCommand::HireNewStaffMember) { - auto& staffHireResult = static_cast(*result.get()); - if (staffHireResult.peepSriteIndex != SPRITE_INDEX_NULL) + if (result->Error == GameActions::Status::Ok) { - obj.Set("peep", staffHireResult.peepSriteIndex); + const auto actionResult = result->GetData(); + if (actionResult.StaffEntityId != SPRITE_INDEX_NULL) + { + obj.Set("peep", actionResult.StaffEntityId); + } } } From 36a0a28e3f182f7ab1d9b60f255d0344370b0fd5 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 5 Oct 2021 04:08:34 +0000 Subject: [PATCH 486/681] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 3b59e1fbd1..c6866627d6 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3610,6 +3610,9 @@ STR_6406 :Instalador de GOG RollerCoaster Tycoon 2 STR_6407 :Puede tardar unos minutos. STR_6408 :Please install “innoextract” to extract GOG Installer, then restart OpenRCT2. Instale "innoextract" para extraer el Instalador de GOG y luego reinicie OpenRCT2. STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. +STR_6454 :No se puede cambiar el nombre del banner… +STR_6455 :No se puede cambiar el nombre del señal… + ############## # Escenarios # ############## From 419201f4767e517c40d94aa627a03c1f84425781 Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Tue, 28 Sep 2021 21:02:30 +0200 Subject: [PATCH 487/681] Work on refactoring ViewClipping.cpp to the new window framework. --- src/openrct2-ui/windows/ViewClipping.cpp | 350 ++++++++++++++++++++++- 1 file changed, 341 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index e4c897d335..ef0d668230 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -65,17 +65,17 @@ static rct_widget window_view_clipping_widgets[] = { #pragma endregion #pragma region Members - +/* static CoordsXY _selectionStart; static CoordsXY _previousClipSelectionA; static CoordsXY _previousClipSelectionB; static bool _toolActive; static bool _dragging; - +*/ #pragma endregion #pragma region Events - +/* static void window_view_clipping_close_button(rct_window* w); static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIndex); static void window_view_clipping_mousedown(rct_window*w, rct_widgetindex widgetIndex, rct_widget *widget); @@ -103,20 +103,327 @@ static rct_window_event_list window_view_clipping_events([](auto& events) events.invalidate = &window_view_clipping_invalidate; events.paint = &window_view_clipping_paint; }); +*/ // clang-format on #pragma endregion -static void window_view_clipping_set_clipheight(rct_window* w, const uint8_t clipheight) +class ViewClippingWindow final : public Window { - gClipHeight = clipheight; - rct_widget* widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; - const float clip_height_ratio = static_cast(gClipHeight) / 255; - w->scrolls[0].h_left = static_cast(std::ceil(clip_height_ratio * (w->scrolls[0].h_right - (widget->width() - 1)))); -} +private: + + CoordsXY _selectionStart; + CoordsXY _previousClipSelectionA; + CoordsXY _previousClipSelectionB; + bool _toolActive; + bool _dragging; +public: + void OnCloseButton() + { + OnClose(); + } + + void OnMouseUp(rct_widgetindex widgetIndex) override + { + rct_window* mainWindow; + + // mouseup appears to be used for buttons, checkboxes + switch (widgetIndex) + { + case WIDX_CLOSE: + window_close(this); // Unsure about this. ~hjort96 + break; + case WIDX_CLIP_CHECKBOX_ENABLE: + // Toggle height clipping. + mainWindow = window_get_main(); + 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 (gClipHeightDisplayType == DISPLAY_TYPE::DISPLAY_RAW) + { + gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; + } + else + { + gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_RAW; + } + this->Invalidate(); + break; + case WIDX_CLIP_SELECTOR: + // Activate the selection tool + tool_set(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 }; + gfx_invalidate_screen(); + break; + case WIDX_CLIP_CLEAR: + if (IsActive()) + { + _toolActive = false; + tool_cancel(); + } + gClipSelectionA = { 0, 0 }; + gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; + gfx_invalidate_screen(); + break; + } + } + + void OnMouseDown(rct_widgetindex widgetIndex) override + { + + rct_window* mainWindow; + + switch (widgetIndex) + { + case WIDX_CLIP_HEIGHT_INCREASE: + if (gClipHeight < 255) + SetClipHeight(gClipHeight + 1); + mainWindow = window_get_main(); + if (mainWindow != nullptr) + mainWindow->Invalidate(); + break; + case WIDX_CLIP_HEIGHT_DECREASE: + if (gClipHeight > 0) + SetClipHeight(gClipHeight - 1); + mainWindow = window_get_main(); + if (mainWindow != nullptr) + mainWindow->Invalidate(); + break; + } + } + + void OnUpdate() override + { + const rct_widget* const widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const rct_scroll* 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. + rct_window* mainWindow = window_get_main(); + if (mainWindow != nullptr) + { + mainWindow->Invalidate(); + } + } + + // Restore previous selection if the tool has been interrupted + if (_toolActive && !IsActive()) + { + _toolActive = false; + gClipSelectionA = _previousClipSelectionA; + gClipSelectionB = _previousClipSelectionB; + } + + widget_invalidate(this, WIDX_CLIP_HEIGHT_SLIDER); + } + + void OnToolUpdate(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (_dragging) + { + return; + } + + int32_t direction; + auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); + if (mapCoords.has_value()) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + map_invalidate_tile_full(gMapSelectPositionA); + gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); + map_invalidate_tile_full(mapCoords.value()); + gMapSelectType = MAP_SELECT_TYPE_FULL; + } + } + + void OnToolDown(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t direction; + auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); + if (mapCoords.has_value()) + { + _dragging = true; + _selectionStart = mapCoords.value(); + } + } + + void OnToolDrag(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (!_dragging) + { + return; + } + + int32_t direction; + auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); + if (mapCoords) + { + map_invalidate_selection_rect(); + 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; + map_invalidate_selection_rect(); + } + } + + void OnToolUp(rct_widgetindex, const ScreenCoordsXY&) + { + gClipSelectionA = gMapSelectPositionA; + gClipSelectionB = gMapSelectPositionB; + _toolActive = false; + tool_cancel(); + gfx_invalidate_screen(); + } + + void OnInvalidate() + { + WidgetScrollUpdateThumbs(this, WIDX_CLIP_HEIGHT_SLIDER); + + rct_window* mainWindow = window_get_main(); + 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 OnPaint(rct_drawpixelinfo* dpi) + { + + 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 (gClipHeightDisplayType) + { + case DISPLAY_TYPE::DISPLAY_RAW: + default: + { + auto ft = Formatter(); + ft.Add(static_cast(gClipHeight)); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); // Printing the raw value. + break; + } + case DISPLAY_TYPE::DISPLAY_UNITS: + { + // Print the value in the configured height label type: + if (gConfigGeneral.show_height_as_units == 1) + { + // 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.measurement_format) + { + 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 //void OnScrollGetSize(int scrollIndex, int* width, int* height) + { + return { 1000, 0 }; + } + +private: + void OnClose() override + { + // Turn off view clipping when the window is closed. + rct_window* mainWindow = window_get_main(); + if (mainWindow != nullptr) + { + mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; + mainWindow->Invalidate(); + } + } + + void SetClipHeight(const uint8_t clipheight) + { + gClipHeight = clipheight; + rct_widget* widget = &window_view_clipping_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 (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WC_VIEW_CLIPPING) + return false; + return _toolActive; + } + +}; rct_window* window_view_clipping_open() { + auto* window = window_bring_to_front_by_class(WC_VIEW_CLIPPING); + if (window == nullptr) + { + window = WindowCreate(WC_VIEW_CLIPPING, ScreenCoordsXY(32, 32), WW, WH); + } + return window; + /* rct_window* window; // Get the main viewport to set the view clipping flag. @@ -155,8 +462,19 @@ rct_window* window_view_clipping_open() _dragging = false; return window; + */ +} +/* +// Done +static void window_view_clipping_set_clipheight(rct_window* w, const uint8_t clipheight) +{ + gClipHeight = clipheight; + rct_widget* widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const float clip_height_ratio = static_cast(gClipHeight) / 255; + w->scrolls[0].h_left = static_cast(std::ceil(clip_height_ratio * (w->scrolls[0].h_right - (widget->width() - 1)))); } +// Done static void window_view_clipping_close() { // Turn off view clipping when the window is closed. @@ -168,11 +486,13 @@ static void window_view_clipping_close() } } +// Done static void window_view_clipping_close_button(rct_window* w) { window_view_clipping_close(); } +// Done // Returns true when the tool is active static bool window_view_clipping_tool_is_active() { @@ -183,6 +503,7 @@ static bool window_view_clipping_tool_is_active() return _toolActive; } +// Done static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIndex) { rct_window* mainWindow; @@ -241,6 +562,7 @@ static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIn } } +// Done static void window_view_clipping_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { rct_window* mainWindow = window_get_main(); @@ -262,6 +584,7 @@ static void window_view_clipping_mousedown(rct_window* w, rct_widgetindex widget } } +// Done static void window_view_clipping_update(rct_window* w) { const rct_widget* const widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; @@ -292,6 +615,7 @@ static void window_view_clipping_update(rct_window* w) widget_invalidate(w, WIDX_CLIP_HEIGHT_SLIDER); } +// Done static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { if (_dragging) @@ -311,6 +635,7 @@ static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widg } } +// Done static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { int32_t direction; @@ -322,6 +647,7 @@ static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widget } } +// Done static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { if (!_dragging) @@ -344,6 +670,7 @@ static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widget } } +// Done static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&) { gClipSelectionA = gMapSelectPositionA; @@ -353,6 +680,7 @@ static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, co gfx_invalidate_screen(); } +// Done static void window_view_clipping_invalidate(rct_window* w) { WidgetScrollUpdateThumbs(w, WIDX_CLIP_HEIGHT_SLIDER); @@ -373,6 +701,7 @@ static void window_view_clipping_invalidate(rct_window* w) } } +// Done static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); @@ -430,7 +759,10 @@ static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi) } } +// Done static void window_view_clipping_scrollgetsize(rct_window* w, int scrollIndex, int* width, int* height) { *width = 1000; } +*/ + From 762005f25a2381474af140c8226a747da8755f5f Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Tue, 28 Sep 2021 21:25:07 +0200 Subject: [PATCH 488/681] Fixed crash caused by window not being properly initialized --- src/openrct2-ui/windows/ViewClipping.cpp | 61 +++++++++--------------- 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index ef0d668230..c3d9aacfe2 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -115,8 +115,9 @@ private: CoordsXY _selectionStart; CoordsXY _previousClipSelectionA; CoordsXY _previousClipSelectionB; - bool _toolActive; - bool _dragging; + bool _toolActive{ false }; + bool _dragging{ false }; + public: void OnCloseButton() { @@ -384,6 +385,14 @@ public: return { 1000, 0 }; } + void SetClipHeight(const uint8_t clipheight) + { + gClipHeight = clipheight; + rct_widget* widget = &window_view_clipping_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)))); + } + private: void OnClose() override { @@ -396,14 +405,6 @@ private: } } - void SetClipHeight(const uint8_t clipheight) - { - gClipHeight = clipheight; - rct_widget* widget = &window_view_clipping_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 (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) @@ -421,36 +422,22 @@ rct_window* window_view_clipping_open() if (window == nullptr) { window = WindowCreate(WC_VIEW_CLIPPING, ScreenCoordsXY(32, 32), WW, WH); + window->widgets = window_view_clipping_widgets; + window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CLIP_CHECKBOX_ENABLE) | (1ULL << WIDX_CLIP_HEIGHT_VALUE) + | (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1ULL << WIDX_CLIP_HEIGHT_DECREASE) | (1ULL << WIDX_CLIP_HEIGHT_SLIDER) + | (1ULL << WIDX_CLIP_SELECTOR) | (1ULL << WIDX_CLIP_CLEAR); + window->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); + WindowInitScrollWidgets(window); } - return window; - /* - rct_window* window; + + // Initialise the clip height slider from the current clip height value. + dynamic_cast(window)->SetClipHeight(gClipHeight); + + window_push_others_below(window); // Get the main viewport to set the view clipping flag. rct_window* mainWindow = window_get_main(); - // Check if window is already open - window = window_find_by_class(WC_VIEW_CLIPPING); - if (window != nullptr) - { - return window; - } - - // Window is not open - create it. - window = WindowCreate(ScreenCoordsXY(32, 32), WW, WH, &window_view_clipping_events, WC_VIEW_CLIPPING, 0); - window->widgets = window_view_clipping_widgets; - window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CLIP_CHECKBOX_ENABLE) | (1ULL << WIDX_CLIP_HEIGHT_VALUE) - | (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1ULL << WIDX_CLIP_HEIGHT_DECREASE) | (1ULL << WIDX_CLIP_HEIGHT_SLIDER) - | (1ULL << WIDX_CLIP_SELECTOR) | (1ULL << WIDX_CLIP_CLEAR); - window->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); - - WindowInitScrollWidgets(window); - - // Initialise the clip height slider from the current clip height value. - window_view_clipping_set_clipheight(window, gClipHeight); - - window_push_others_below(window); - // Turn on view clipping when the window is opened. if (mainWindow != nullptr) { @@ -458,11 +445,7 @@ rct_window* window_view_clipping_open() mainWindow->Invalidate(); } - _toolActive = false; - _dragging = false; - return window; - */ } /* // Done From dbe07554c9ba4b501514caace07901ecb22eeca6 Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Sun, 3 Oct 2021 14:11:53 +0200 Subject: [PATCH 489/681] Added OnOpen() to ViewClippingWindow --- src/openrct2-ui/windows/ViewClipping.cpp | 58 +++++++++++++----------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index c3d9aacfe2..4d60925b7e 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -385,12 +385,30 @@ public: return { 1000, 0 }; } - void SetClipHeight(const uint8_t clipheight) + void OnOpen() override { - gClipHeight = clipheight; - rct_widget* widget = &window_view_clipping_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)))); + this->widgets = window_view_clipping_widgets; + this->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CLIP_CHECKBOX_ENABLE) | (1ULL << WIDX_CLIP_HEIGHT_VALUE) + | (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1ULL << WIDX_CLIP_HEIGHT_DECREASE) | (1ULL << WIDX_CLIP_HEIGHT_SLIDER) + | (1ULL << WIDX_CLIP_SELECTOR) | (1ULL << WIDX_CLIP_CLEAR); + this->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); + WindowInitScrollWidgets(this); + + // Initialise the clip height slider from the current clip height value. + this->SetClipHeight(gClipHeight); + + window_push_others_below(this); + + // Get the main viewport to set the view clipping flag. + rct_window* mainWindow = window_get_main(); + + // Turn on view clipping when the window is opened. + if (mainWindow != nullptr) + { + mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; + mainWindow->Invalidate(); + } + } private: @@ -405,6 +423,14 @@ private: } } + void SetClipHeight(const uint8_t clipheight) + { + gClipHeight = clipheight; + rct_widget* widget = &window_view_clipping_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 (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) @@ -422,29 +448,7 @@ rct_window* window_view_clipping_open() if (window == nullptr) { window = WindowCreate(WC_VIEW_CLIPPING, ScreenCoordsXY(32, 32), WW, WH); - window->widgets = window_view_clipping_widgets; - window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_CLIP_CHECKBOX_ENABLE) | (1ULL << WIDX_CLIP_HEIGHT_VALUE) - | (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1ULL << WIDX_CLIP_HEIGHT_DECREASE) | (1ULL << WIDX_CLIP_HEIGHT_SLIDER) - | (1ULL << WIDX_CLIP_SELECTOR) | (1ULL << WIDX_CLIP_CLEAR); - window->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); - WindowInitScrollWidgets(window); } - - // Initialise the clip height slider from the current clip height value. - dynamic_cast(window)->SetClipHeight(gClipHeight); - - window_push_others_below(window); - - // Get the main viewport to set the view clipping flag. - rct_window* mainWindow = window_get_main(); - - // Turn on view clipping when the window is opened. - if (mainWindow != nullptr) - { - mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); - } - return window; } /* From 0a392841c208e2a7acdec6613507434a449b89b9 Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Sun, 3 Oct 2021 23:05:48 +0200 Subject: [PATCH 490/681] Added functions OnToolUpdate, OnToolDrag, OnToolUp to rct_window --- src/openrct2/interface/Window_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 56dab05199..5a4568ce27 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -176,9 +176,18 @@ struct rct_window virtual void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) { } + virtual void OnToolUpdate(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + { + } virtual void OnToolDown(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { } + virtual void OnToolDrag(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + { + } + virtual void OnToolUp(rct_widgetindex, const ScreenCoordsXY&) + { + } virtual void OnToolAbort(rct_widgetindex widgetIndex) { } From 4fe21e3274d2b8b2c22d84056f18a4f9710e50cd Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Sun, 3 Oct 2021 23:07:03 +0200 Subject: [PATCH 491/681] OnToolUpdate, OnToolDrag, OnToolUp now being used --- src/openrct2/interface/Window.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 68276a7d51..94cc1dbeb5 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1462,9 +1462,10 @@ void window_event_unknown_08_call(rct_window* w) void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { - if (w->event_handlers != nullptr) - if (w->event_handlers->tool_update != nullptr) - w->event_handlers->tool_update(w, widgetIndex, screenCoords); + if (w->event_handlers == nullptr) + w->OnToolUpdate(widgetIndex, screenCoords); + else if (w->event_handlers->tool_update != nullptr) + w->event_handlers->tool_update(w, widgetIndex, screenCoords); } void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) @@ -1477,16 +1478,18 @@ void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, con void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { - if (w->event_handlers != nullptr) - if (w->event_handlers->tool_drag != nullptr) - w->event_handlers->tool_drag(w, widgetIndex, screenCoords); + if (w->event_handlers == nullptr) + w->OnToolDrag(widgetIndex, screenCoords); + else if (w->event_handlers->tool_drag != nullptr) + w->event_handlers->tool_drag(w, widgetIndex, screenCoords); } void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { - if (w->event_handlers != nullptr) - if (w->event_handlers->tool_up != nullptr) - w->event_handlers->tool_up(w, widgetIndex, screenCoords); + if (w->event_handlers == nullptr) + w->OnToolUp(widgetIndex, screenCoords); + else if (w->event_handlers->tool_up != nullptr) + w->event_handlers->tool_up(w, widgetIndex, screenCoords); } void window_event_tool_abort_call(rct_window* w, rct_widgetindex widgetIndex) From 0195ce45a2a6acb1e609260c8b63735b2501e779 Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Sun, 3 Oct 2021 23:08:52 +0200 Subject: [PATCH 492/681] Added OnToolUpdate, OnToolDrag, OnToolUp, OnPrepareDraw to new window --- src/openrct2-ui/windows/ViewClipping.cpp | 369 +---------------------- 1 file changed, 12 insertions(+), 357 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 4d60925b7e..efc6cb535b 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -64,50 +64,7 @@ static rct_widget window_view_clipping_widgets[] = { #pragma endregion -#pragma region Members -/* -static CoordsXY _selectionStart; -static CoordsXY _previousClipSelectionA; -static CoordsXY _previousClipSelectionB; -static bool _toolActive; -static bool _dragging; -*/ -#pragma endregion - -#pragma region Events -/* -static void window_view_clipping_close_button(rct_window* w); -static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIndex); -static void window_view_clipping_mousedown(rct_window*w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_view_clipping_update(rct_window* w); -static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_view_clipping_tool_up(rct_window* w, rct_widgetindex, const ScreenCoordsXY&); -static void window_view_clipping_invalidate(rct_window* w); -static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_view_clipping_scrollgetsize(rct_window* w, int scrollIndex, int* width, int* height); -static void window_view_clipping_close(); - -static rct_window_event_list window_view_clipping_events([](auto& events) -{ - events.close = &window_view_clipping_close_button; - events.mouse_up = &window_view_clipping_mouseup; - events.mouse_down = &window_view_clipping_mousedown; - events.update = &window_view_clipping_update; - events.tool_update = &window_view_clipping_tool_update; - events.tool_down = &window_view_clipping_tool_down; - events.tool_drag = &window_view_clipping_tool_drag; - events.tool_up = &window_view_clipping_tool_up; - events.get_scroll_size = &window_view_clipping_scrollgetsize; - events.invalidate = &window_view_clipping_invalidate; - events.paint = &window_view_clipping_paint; -}); -*/ // clang-format on - -#pragma endregion - class ViewClippingWindow final : public Window { private: @@ -132,7 +89,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(this); // Unsure about this. ~hjort96 + window_close(this); break; case WIDX_CLIP_CHECKBOX_ENABLE: // Toggle height clipping. @@ -236,7 +193,7 @@ public: widget_invalidate(this, WIDX_CLIP_HEIGHT_SLIDER); } - void OnToolUpdate(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + void OnToolUpdate(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override { if (_dragging) { @@ -266,7 +223,7 @@ public: } } - void OnToolDrag(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) + void OnToolDrag(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override { if (!_dragging) { @@ -288,7 +245,7 @@ public: } } - void OnToolUp(rct_widgetindex, const ScreenCoordsXY&) + void OnToolUp(rct_widgetindex, const ScreenCoordsXY&) override { gClipSelectionA = gMapSelectPositionA; gClipSelectionB = gMapSelectPositionB; @@ -297,7 +254,7 @@ public: gfx_invalidate_screen(); } - void OnInvalidate() + void OnPrepareDraw() override { WidgetScrollUpdateThumbs(this, WIDX_CLIP_HEIGHT_SLIDER); @@ -317,14 +274,14 @@ public: } } - void OnPaint(rct_drawpixelinfo* dpi) + void OnDraw(rct_drawpixelinfo& dpi) override { - WindowDrawWidgets(this, dpi); + 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] }); + 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 }; @@ -336,7 +293,7 @@ public: { auto ft = Formatter(); ft.Add(static_cast(gClipHeight)); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); // Printing the raw value. + DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); // Printing the raw value. break; } case DISPLAY_TYPE::DISPLAY_UNITS: @@ -348,7 +305,7 @@ public: auto ft = Formatter(); ft.Add(static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0))); DrawTextBasic( - dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, + &dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, { this->colours[0] }); // Printing the value in Height Units. } else @@ -363,7 +320,7 @@ public: 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] }); + DrawTextBasic(&dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); break; } case MeasurementFormat::Imperial: @@ -371,7 +328,7 @@ public: 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] }); + DrawTextBasic(&dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] }); break; } } @@ -451,305 +408,3 @@ rct_window* window_view_clipping_open() } return window; } -/* -// Done -static void window_view_clipping_set_clipheight(rct_window* w, const uint8_t clipheight) -{ - gClipHeight = clipheight; - rct_widget* widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; - const float clip_height_ratio = static_cast(gClipHeight) / 255; - w->scrolls[0].h_left = static_cast(std::ceil(clip_height_ratio * (w->scrolls[0].h_right - (widget->width() - 1)))); -} - -// Done -static void window_view_clipping_close() -{ - // Turn off view clipping when the window is closed. - rct_window* mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); - } -} - -// Done -static void window_view_clipping_close_button(rct_window* w) -{ - window_view_clipping_close(); -} - -// Done -// Returns true when the tool is active -static bool window_view_clipping_tool_is_active() -{ - if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WC_VIEW_CLIPPING) - return false; - return _toolActive; -} - -// Done -static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - rct_window* mainWindow; - - // mouseup appears to be used for buttons, checkboxes - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_CLIP_CHECKBOX_ENABLE: - // Toggle height clipping. - mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); - } - w->Invalidate(); - break; - case WIDX_CLIP_HEIGHT_VALUE: - // Toggle display of the cut height value in RAW vs UNITS - if (gClipHeightDisplayType == DISPLAY_TYPE::DISPLAY_RAW) - { - gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; - } - else - { - gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_RAW; - } - w->Invalidate(); - break; - case WIDX_CLIP_SELECTOR: - // Activate the selection tool - tool_set(w, 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 }; - gfx_invalidate_screen(); - break; - case WIDX_CLIP_CLEAR: - if (window_view_clipping_tool_is_active()) - { - _toolActive = false; - tool_cancel(); - } - gClipSelectionA = { 0, 0 }; - gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; - gfx_invalidate_screen(); - break; - } -} - -// Done -static void window_view_clipping_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - rct_window* mainWindow = window_get_main(); - - switch (widgetIndex) - { - case WIDX_CLIP_HEIGHT_INCREASE: - if (gClipHeight < 255) - window_view_clipping_set_clipheight(w, gClipHeight + 1); - if (mainWindow != nullptr) - mainWindow->Invalidate(); - break; - case WIDX_CLIP_HEIGHT_DECREASE: - if (gClipHeight > 0) - window_view_clipping_set_clipheight(w, gClipHeight - 1); - if (mainWindow != nullptr) - mainWindow->Invalidate(); - break; - } -} - -// Done -static void window_view_clipping_update(rct_window* w) -{ - const rct_widget* const widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; - const rct_scroll* const scroll = &w->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. - rct_window* mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - mainWindow->Invalidate(); - } - } - - // Restore previous selection if the tool has been interrupted - if (_toolActive && !window_view_clipping_tool_is_active()) - { - _toolActive = false; - gClipSelectionA = _previousClipSelectionA; - gClipSelectionB = _previousClipSelectionB; - } - - widget_invalidate(w, WIDX_CLIP_HEIGHT_SLIDER); -} - -// Done -static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (_dragging) - { - return; - } - - int32_t direction; - auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords.has_value()) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - map_invalidate_tile_full(gMapSelectPositionA); - gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); - map_invalidate_tile_full(mapCoords.value()); - gMapSelectType = MAP_SELECT_TYPE_FULL; - } -} - -// Done -static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - int32_t direction; - auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords.has_value()) - { - _dragging = true; - _selectionStart = mapCoords.value(); - } -} - -// Done -static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (!_dragging) - { - return; - } - - int32_t direction; - auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); - if (mapCoords) - { - map_invalidate_selection_rect(); - 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; - map_invalidate_selection_rect(); - } -} - -// Done -static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&) -{ - gClipSelectionA = gMapSelectPositionA; - gClipSelectionB = gMapSelectPositionB; - _toolActive = false; - tool_cancel(); - gfx_invalidate_screen(); -} - -// Done -static void window_view_clipping_invalidate(rct_window* w) -{ - WidgetScrollUpdateThumbs(w, WIDX_CLIP_HEIGHT_SLIDER); - - rct_window* mainWindow = window_get_main(); - if (mainWindow != nullptr) - { - WidgetSetCheckboxValue(w, WIDX_CLIP_CHECKBOX_ENABLE, mainWindow->viewport->flags & VIEWPORT_FLAG_CLIP_VIEW); - } - - if (window_view_clipping_tool_is_active()) - { - w->pressed_widgets |= 1ULL << WIDX_CLIP_SELECTOR; - } - else - { - w->pressed_widgets &= ~(1ULL << WIDX_CLIP_SELECTOR); - } -} - -// Done -static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - - // Clip height value - auto screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - DrawTextBasic(dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { w->colours[0] }); - - screenCoords = w->windowPos - + ScreenCoordsXY{ w->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, w->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - - switch (gClipHeightDisplayType) - { - case DISPLAY_TYPE::DISPLAY_RAW: - default: - { - auto ft = Formatter(); - ft.Add(static_cast(gClipHeight)); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { w->colours[0] }); // Printing the raw value. - break; - } - case DISPLAY_TYPE::DISPLAY_UNITS: - // Print the value in the configured height label type: - if (gConfigGeneral.show_height_as_units == 1) - { - // 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, { w->colours[0] }); // Printing the value in Height Units. - } - else - { - // Height label is Real Values. - // Print the value in the configured measurement units. - switch (gConfigGeneral.measurement_format) - { - 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, { w->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, { w->colours[0] }); - break; - } - } - } - } -} - -// Done -static void window_view_clipping_scrollgetsize(rct_window* w, int scrollIndex, int* width, int* height) -{ - *width = 1000; -} -*/ - From 9a2a12af98bc7459fc4dfad5666f346f6b775395 Mon Sep 17 00:00:00 2001 From: Jonathan Hjorth Date: Tue, 5 Oct 2021 11:09:37 +0200 Subject: [PATCH 493/681] Cleaning code --- src/openrct2-ui/windows/ViewClipping.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index efc6cb535b..abcd833148 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -141,7 +141,6 @@ public: void OnMouseDown(rct_widgetindex widgetIndex) override { - rct_window* mainWindow; switch (widgetIndex) @@ -276,7 +275,6 @@ public: void OnDraw(rct_drawpixelinfo& dpi) override { - WindowDrawWidgets(this, &dpi); // Clip height value @@ -293,7 +291,9 @@ public: { auto ft = Formatter(); ft.Add(static_cast(gClipHeight)); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); // Printing the raw value. + + // Printing the raw value. + DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); break; } case DISPLAY_TYPE::DISPLAY_UNITS: @@ -337,7 +337,7 @@ public: } } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override //void OnScrollGetSize(int scrollIndex, int* width, int* height) + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { return { 1000, 0 }; } @@ -365,7 +365,6 @@ public: mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; mainWindow->Invalidate(); } - } private: @@ -385,7 +384,8 @@ private: gClipHeight = clipheight; rct_widget* widget = &window_view_clipping_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)))); + this->scrolls[0].h_left = + static_cast(std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget->width() - 1)))); } bool IsActive() From 4d27417fd28c9fd7eceea6ac21d534da733c2b2e Mon Sep 17 00:00:00 2001 From: Soham Roy <72430659+sohamroy19@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:28:50 +0530 Subject: [PATCH 494/681] Fix #11354: Coding style causes undefined behaviour An underscore followed by a capital letter used as a prefix might cause undefined behaviour --- contributors.md | 1 + src/openrct2/core/CircularBuffer.h | 14 ++++---- src/openrct2/core/Meta.hpp | 8 ++--- src/openrct2/core/Random.hpp | 52 ++++++++++++++--------------- src/openrct2/drawing/Font.h | 4 +-- src/openrct2/drawing/TTFSDLPort.cpp | 2 +- src/openrct2/interface/Window.cpp | 6 ++-- src/openrct2/paint/Paint.cpp | 4 +-- 8 files changed, 46 insertions(+), 45 deletions(-) diff --git a/contributors.md b/contributors.md index 302be0ee29..25c4082a91 100644 --- a/contributors.md +++ b/contributors.md @@ -177,6 +177,7 @@ The following people are not part of the development team, but have been contrib * Saad Rehman (SaadRehmanCS) * (ocalhoun6) * Sean Payne (seanmajorpayne) +* Soham Roy (sohamroy19) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2/core/CircularBuffer.h b/src/openrct2/core/CircularBuffer.h index f8d74fbc79..782e8af68f 100644 --- a/src/openrct2/core/CircularBuffer.h +++ b/src/openrct2/core/CircularBuffer.h @@ -12,14 +12,14 @@ #include #include -template class CircularBuffer +template class CircularBuffer { public: - using value_type = _TType; - using pointer = _TType*; - using const_pointer = const _TType*; - using reference = _TType&; - using const_reference = const _TType&; + using value_type = TType; + using pointer = TType*; + using const_pointer = const TType*; + using reference = TType&; + using const_reference = const TType&; using size_type = size_t; using difference_type = ptrdiff_t; @@ -137,5 +137,5 @@ private: size_t _head = 0; size_t _tail = 0; size_t _size = 0; - std::array<_TType, _TMax> _elements; + std::array _elements; }; diff --git a/src/openrct2/core/Meta.hpp b/src/openrct2/core/Meta.hpp index c1a81ff1f9..8bd635d44b 100644 --- a/src/openrct2/core/Meta.hpp +++ b/src/openrct2/core/Meta.hpp @@ -16,15 +16,15 @@ namespace Meta /** * Meta function for checking that all Conditions are true types. */ - template struct all : std::true_type + template struct all : std::true_type { }; - template - struct all<_TCondition, _TConditions...> : std::conditional<_TCondition::value, all<_TConditions...>, std::false_type>::type + template + struct all : std::conditional, std::false_type>::type { }; - template using all_convertible = all...>; + template using all_convertible = all...>; } // namespace Meta diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index c023fbf4b0..b5f8128988 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -27,12 +27,12 @@ namespace Random /** * FixedSeedSequence adheres to the _Named Requirement_ `SeedSequence`. */ - template class FixedSeedSequence + template class FixedSeedSequence { public: using result_type = uint32_t; - static constexpr size_t N = _TNum; + static constexpr size_t N = TNum; static constexpr result_type default_seed = 0x1234567F; explicit FixedSeedSequence() @@ -41,26 +41,26 @@ namespace Random } template< - typename... _TTypes, typename std::enable_if::type = 0, - typename std::enable_if::value, int>::type = 0> - explicit FixedSeedSequence(_TTypes... s) + typename... TTypes, typename std::enable_if::type = 0, + typename std::enable_if::value, int>::type = 0> + explicit FixedSeedSequence(TTypes... s) : v{ static_cast(s)... } { } - template(), ++std::declval<_TIt&>(), void())> - explicit FixedSeedSequence(_TIt begin, _TIt end) + template(), ++std::declval(), void())> + explicit FixedSeedSequence(TIt begin, TIt end) { std::copy(begin, end, v.begin()); } - template - explicit FixedSeedSequence(std::initializer_list<_TType> il) + template + explicit FixedSeedSequence(std::initializer_list il) : FixedSeedSequence(il.begin(), il.end()) { } - template void generate(_TIt begin, _TIt end) const + template void generate(TIt begin, TIt end) const { std::copy_n(v.begin(), std::min(static_cast(end - begin), N), begin); } @@ -70,7 +70,7 @@ namespace Random return N; } - template constexpr void param(_TIt ob) const + template constexpr void param(TIt ob) const { std::copy(v.begin(), v.end(), ob); } @@ -79,9 +79,9 @@ namespace Random std::array v; }; - template struct RotateEngineState + template struct RotateEngineState { - using value_type = _TUIntType; + using value_type = TUIntType; value_type s0; value_type s1; @@ -91,21 +91,21 @@ namespace Random * RotateEngine adheres to the _Named Requirement_ `RandomNumberEngine` * https://en.cppreference.com/w/cpp/named_req/RandomNumberEngine */ - template - class RotateEngine : protected RotateEngineState<_TUIntType> + template + class RotateEngine : protected RotateEngineState { - static_assert(std::is_unsigned<_TUIntType>::value, "Type must be unsigned integral."); + static_assert(std::is_unsigned::value, "Type must be unsigned integral."); - using RotateEngineState<_TUIntType>::s0; - using RotateEngineState<_TUIntType>::s1; + using RotateEngineState::s0; + using RotateEngineState::s1; public: - using result_type = _TUIntType; - using state_type = RotateEngineState<_TUIntType>; + using result_type = TUIntType; + using state_type = RotateEngineState; - static constexpr result_type x = _TX; - static constexpr size_t r1 = _TR1; - static constexpr size_t r2 = _TR2; + static constexpr result_type x = TX; + static constexpr size_t r1 = TR1; + static constexpr size_t r2 = TR2; static constexpr result_type default_seed = 1; static constexpr result_type min() @@ -129,8 +129,8 @@ namespace Random s1 = r.s1; } - template::value>::type> - explicit RotateEngine(_TSseq& seed_seq) + template::value>::type> + explicit RotateEngine(TSseq& seed_seq) { seed(seed_seq); } @@ -141,7 +141,7 @@ namespace Random s1 = s; } - template typename std::enable_if::value, void>::type seed(_TSseq& seed_seq) + template typename std::enable_if::value, void>::type seed(TSseq& seed_seq) { std::array s; seed_seq.generate(s.begin(), s.end()); diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index 0f870d241e..0681240867 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -33,8 +33,8 @@ enum class FontSpriteBase : int16_t #ifndef NO_TTF -struct _TTF_Font; -using TTF_Font = _TTF_Font; +struct InternalTTFFont; +using TTF_Font = InternalTTFFont; struct TTFFontDescriptor { const utf8* filename; diff --git a/src/openrct2/drawing/TTFSDLPort.cpp b/src/openrct2/drawing/TTFSDLPort.cpp index 0df6e8697c..f75557ea8c 100644 --- a/src/openrct2/drawing/TTFSDLPort.cpp +++ b/src/openrct2/drawing/TTFSDLPort.cpp @@ -103,7 +103,7 @@ struct c_glyph }; /* The structure used to hold internal font information */ -struct _TTF_Font +struct InternalTTFFont { /* Freetype2 maintains all sorts of useful info itself */ FT_Face face; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 68276a7d51..2b6543ccc9 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -228,7 +228,7 @@ void window_close(rct_window* w) g_window_list.erase(itWindow); } -template static void window_close_by_condition(_TPred pred, uint32_t flags = WindowCloseFlags::None) +template static void window_close_by_condition(TPred pred, uint32_t flags = WindowCloseFlags::None) { bool listUpdated; do @@ -461,7 +461,7 @@ rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsX * * @param window The window to invalidate (esi). */ -template static void window_invalidate_by_condition(_TPred pred) +template static void window_invalidate_by_condition(TPred pred) { window_visit_each([pred](rct_window* w) { if (pred(w)) @@ -521,7 +521,7 @@ void widget_invalidate(rct_window* w, rct_widgetindex widgetIndex) { w->windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } }); } -template static void widget_invalidate_by_condition(_TPred pred) +template static void widget_invalidate_by_condition(TPred pred) { window_visit_each([pred](rct_window* w) { if (pred(w)) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index be5c3420da..2cf3886736 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -312,7 +312,7 @@ namespace PaintSortFlags static constexpr uint8_t OutsideQuadrant = (1U << 7); } // namespace PaintSortFlags -template +template static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, uint16_t quadrantIndex, uint8_t flag) { paint_struct* ps; @@ -403,7 +403,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui const paint_struct_bound_box& currentBBox = ps_next->bounds; - const bool compareResult = CheckBoundingBox<_TRotation>(initialBBox, currentBBox); + const bool compareResult = CheckBoundingBox(initialBBox, currentBBox); if (compareResult) { From 5fcbc3a53d560495e31c2b18fdada226ee85ba36 Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 5 Oct 2021 18:23:06 +0200 Subject: [PATCH 495/681] Fix #15299: Breakpad crash dumps are created in game directory --- src/openrct2/platform/Crash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 69076260b0..1781a4bccc 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -324,9 +324,9 @@ static bool OnCrash( static std::wstring GetDumpDirectory() { auto env = GetContext()->GetPlatformEnvironment(); - auto crashPath = env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::CRASH); + auto crashPath = env->GetDirectoryPath(DIRBASE::USER, DIRID::CRASH); - auto result = String::ToWideChar(crashPath.c_str()); + auto result = String::ToWideChar(crashPath); return result; } From 763c31ce5bcab3c5a37fae60cac66c8937deada3 Mon Sep 17 00:00:00 2001 From: hjort96 Date: Tue, 5 Oct 2021 20:06:17 +0200 Subject: [PATCH 496/681] Fix clang-format --- src/openrct2-ui/windows/ViewClipping.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index abcd833148..0f73b567c7 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -68,7 +68,6 @@ static rct_widget window_view_clipping_widgets[] = { class ViewClippingWindow final : public Window { private: - CoordsXY _selectionStart; CoordsXY _previousClipSelectionA; CoordsXY _previousClipSelectionB; @@ -89,7 +88,7 @@ public: switch (widgetIndex) { case WIDX_CLOSE: - window_close(this); + window_close(this); break; case WIDX_CLIP_CHECKBOX_ENABLE: // Toggle height clipping. @@ -293,7 +292,7 @@ public: ft.Add(static_cast(gClipHeight)); // Printing the raw value. - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); + DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); break; } case DISPLAY_TYPE::DISPLAY_UNITS: @@ -384,8 +383,8 @@ private: gClipHeight = clipheight; rct_widget* widget = &window_view_clipping_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)))); + this->scrolls[0].h_left = static_cast( + std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget->width() - 1)))); } bool IsActive() @@ -396,7 +395,6 @@ private: return false; return _toolActive; } - }; rct_window* window_view_clipping_open() From 6cac66844732783456c86585bd93dbdee6f6394c Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 6 Oct 2021 12:32:17 +0100 Subject: [PATCH 497/681] Fix incorrect staff costumes being available (#15499) Noticed this when trying to fix an NSF scenery window issue. The previous code meant that if any single scenery item in a set was researched then the costume was available but I'm pretty sure its meant to be tied to if the whole scenery set is invented. --- src/openrct2/management/Research.cpp | 31 +++++++++++----------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 456667b110..79d68be515 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -591,28 +591,21 @@ void scenery_set_not_invented(const ScenerySelection& sceneryItem) bool scenery_group_is_invented(int32_t sgIndex) { - auto invented = false; const auto sgEntry = get_scenery_group_entry(sgIndex); - if (sgEntry != nullptr && sgEntry->entry_count > 0) + if (sgEntry == nullptr || sgEntry->entry_count == 0) { - if (gCheatsIgnoreResearchStatus) - { - invented = true; - } - else - { - for (auto i = 0; i < sgEntry->entry_count; i++) - { - auto sceneryEntry = sgEntry->scenery_entries[i]; - if (scenery_is_invented(sceneryEntry)) - { - invented = true; - break; - } - } - } + return false; } - return invented; + + if (gCheatsIgnoreResearchStatus) + { + return true; + } + + return std::none_of( + std::begin(gResearchItemsUninvented), std::end(gResearchItemsUninvented), [sgIndex](const ResearchItem& item) { + return item.type == Research::EntryType::Scenery && item.entryIndex == sgIndex; + }); } void scenery_group_set_invented(int32_t sgIndex) From 782220b42b84aa3f8b690f42e98321f84df42d59 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 6 Oct 2021 15:02:35 +0200 Subject: [PATCH 498/681] Show "Update available" in all game-options dropdowns Co-authored-by: Michael Steenbeek --- src/openrct2-ui/windows/TopToolbar.cpp | 36 +++++++++++++++++--------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index f837b0695f..22c9adc76a 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -122,11 +122,10 @@ enum FILE_MENU_DDIDX { DDIDX_GIANT_SCREENSHOT = 8, // separator DDIDX_FILE_BUG_ON_GITHUB = 10, + DDIDX_UPDATE_AVAILABLE = 11, // separator - DDIDX_QUIT_TO_MENU = 12, - DDIDX_EXIT_OPENRCT2 = 13, - // separator - DDIDX_UPDATE_AVAILABLE = 15, + DDIDX_QUIT_TO_MENU = 13, + DDIDX_EXIT_OPENRCT2 = 14, }; enum TOP_TOOLBAR_VIEW_MENU_DDIDX { @@ -440,7 +439,12 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; + gDropdownItemsFormat[numItems++] = STR_EMPTY; + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) gDropdownItemsFormat[numItems++] = STR_QUIT_ROLLERCOASTER_DESIGNER; else @@ -459,6 +463,10 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_SCENARIO_EDITOR; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; @@ -476,15 +484,15 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_TO_MENU; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; - if (OpenRCT2::GetContext()->HasNewVersionInfo()) - { - gDropdownItemsFormat[numItems++] = STR_EMPTY; - gDropdownItemsFormat[numItems++] = STR_UPDATE_AVAILABLE; - } } + WindowDropdownShowText( { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[0] | 0x80, Dropdown::Flag::StayOpen, numItems); @@ -543,6 +551,10 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) dropdownIndex += DDIDX_ABOUT; + // The "Update available" menu item is only available when there is one + if (dropdownIndex >= DDIDX_UPDATE_AVAILABLE && !OpenRCT2::GetContext()->HasNewVersionInfo()) + dropdownIndex += 1; + switch (dropdownIndex) { case DDIDX_NEW_GAME: @@ -597,6 +609,9 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd OpenRCT2::GetContext()->GetUiContext()->OpenURL(url); } break; + case DDIDX_UPDATE_AVAILABLE: + context_open_window_view(WV_NEW_VERSION_INFO); + break; case DDIDX_QUIT_TO_MENU: { window_close_by_class(WC_MANAGE_TRACK_DESIGN); @@ -608,9 +623,6 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd case DDIDX_EXIT_OPENRCT2: context_quit(); break; - case DDIDX_UPDATE_AVAILABLE: - context_open_window_view(WV_NEW_VERSION_INFO); - break; } break; case WIDX_CHEATS: From 9cb26f7b0226542f433705aa2433700f9e2c24c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 4 Oct 2021 17:25:53 +0300 Subject: [PATCH 499/681] Refactor action result passing for SmallSceneryPlaceAction --- src/openrct2-ui/windows/TopToolbar.cpp | 12 ++-- .../actions/SmallSceneryPlaceAction.cpp | 68 +++++++------------ .../actions/SmallSceneryPlaceAction.h | 15 ++-- 3 files changed, 35 insertions(+), 60 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index f837b0695f..974ba8532d 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -2464,18 +2464,18 @@ static money64 try_place_ghost_small_scenery( auto smallSceneryPlaceAction = SmallSceneryPlaceAction(loc, quadrant, entryIndex, primaryColour, secondaryColour); smallSceneryPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); auto res = GameActions::Execute(&smallSceneryPlaceAction); - auto sspar = dynamic_cast(res.get()); - if (sspar == nullptr || res->Error != GameActions::Status::Ok) + if (res->Error != GameActions::Status::Ok) return MONEY64_UNDEFINED; + const auto placementData = res->GetData(); + gSceneryPlaceRotation = loc.direction; gSceneryPlaceObject.SceneryType = SCENERY_TYPE_SMALL; gSceneryPlaceObject.EntryIndex = entryIndex; - TileElement* tileElement = sspar->tileElement; - gSceneryGhostPosition = { loc, tileElement->GetBaseZ() }; - gSceneryQuadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); - if (sspar->GroundFlags & ELEMENT_IS_UNDERGROUND) + gSceneryGhostPosition = { loc, placementData.BaseHeight }; + gSceneryQuadrant = placementData.SceneryQuadrant; + if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) { // Set underground on viewport_set_visibility(4); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 210a9c6ad7..e6e536d19b 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -27,26 +27,6 @@ #include "GameAction.h" #include "SmallSceneryRemoveAction.h" -SmallSceneryPlaceActionResult::SmallSceneryPlaceActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_CANT_POSITION_THIS_HERE) -{ -} - -SmallSceneryPlaceActionResult::SmallSceneryPlaceActionResult(GameActions::Status error) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE) -{ -} - -SmallSceneryPlaceActionResult::SmallSceneryPlaceActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE, message) -{ -} - -SmallSceneryPlaceActionResult::SmallSceneryPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args) - : GameActions::Result(error, STR_CANT_POSITION_THIS_HERE, message, args) -{ -} - SmallSceneryPlaceAction::SmallSceneryPlaceAction( const CoordsXYZD& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour) : _loc(loc) @@ -100,7 +80,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const { surfaceHeight = waterHeight; } - auto res = std::make_unique(); + auto res = MakeResult(); auto centre = _loc.ToTileCentre(); res->Position.x = centre.x; res->Position.y = centre.y; @@ -113,23 +93,23 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } if (!MapCheckCapacityAndReorganise(_loc)) { - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())) { - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto* sceneryEntry = get_small_scenery_entry(_sceneryType); if (sceneryEntry == nullptr) { - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto quadrant = _quadrant; @@ -176,7 +156,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !map_is_location_owned({ _loc.x, _loc.y, targetHeight })) { - return std::make_unique(GameActions::Status::NotOwned, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } auto* surfaceElement = map_get_surface_element_at(_loc); @@ -186,8 +166,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const int32_t water_height = surfaceElement->GetWaterHeight() - 1; if (water_height > targetHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_UNDERWATER); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } @@ -195,16 +174,15 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const { if (isOnWater) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } if (surfaceElement != nullptr && surfaceElement->GetWaterHeight() > 0) { if (surfaceElement->GetWaterHeight() > targetHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } } } @@ -212,7 +190,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) && !supportsRequired && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)) { - return std::make_unique(GameActions::Status::Disallowed, STR_LEVEL_LAND_REQUIRED); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); } if (!gCheatsDisableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) && supportsRequired) @@ -223,15 +201,13 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const { if (surfaceElement->GetWaterHeight() > 0 || (surfaceElement->GetBaseZ()) != targetHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_LEVEL_LAND_REQUIRED); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); } } } else { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_LAND); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ON_LAND); } } @@ -281,7 +257,8 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const return canBuild; } - res->GroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const uint8_t groundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + res->SetData(SmallSceneryPlaceActionResult{ groundFlags, 0, 0 }); res->Expenditure = ExpenditureType::Landscaping; res->Cost = (sceneryEntry->price * 10) + canBuild->Cost; @@ -305,7 +282,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const { surfaceHeight = waterHeight; } - auto res = std::make_unique(); + auto res = MakeResult(); auto centre = _loc.ToTileCentre(); res->Position.x = centre.x; res->Position.y = centre.y; @@ -319,7 +296,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const auto* sceneryEntry = get_small_scenery_entry(_sceneryType); if (sceneryEntry == nullptr) { - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto quadrant = _quadrant; @@ -417,14 +394,15 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const return canBuild; } - res->GroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); - res->Expenditure = ExpenditureType::Landscaping; res->Cost = (sceneryEntry->price * 10) + canBuild->Cost; auto* sceneryElement = TileElementInsert( CoordsXYZ{ _loc, zLow }, quarterTile.GetBaseQuarterOccupied()); - Guard::Assert(sceneryElement != nullptr); + if (sceneryElement == nullptr) + { + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + } sceneryElement->SetDirection(_loc.direction); sceneryElement->SetSceneryQuadrant(quadrant); @@ -439,7 +417,9 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const sceneryElement->SetNeedsSupports(); } - res->tileElement = sceneryElement->as(); + const uint8_t groundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + res->SetData( + SmallSceneryPlaceActionResult{ groundFlags, sceneryElement->GetBaseZ(), sceneryElement->GetSceneryQuadrant() }); map_invalidate_tile_full(_loc); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.h b/src/openrct2/actions/SmallSceneryPlaceAction.h index dba1923cdb..7807c8f5f5 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.h +++ b/src/openrct2/actions/SmallSceneryPlaceAction.h @@ -12,19 +12,14 @@ #include "../world/TileElement.h" #include "GameAction.h" -class SmallSceneryPlaceActionResult final : public GameActions::Result +struct SmallSceneryPlaceActionResult { -public: - SmallSceneryPlaceActionResult(); - SmallSceneryPlaceActionResult(GameActions::Status error); - SmallSceneryPlaceActionResult(GameActions::Status error, rct_string_id message); - SmallSceneryPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args); - - uint8_t GroundFlags{ 0 }; - TileElement* tileElement = nullptr; + uint8_t GroundFlags{}; + int32_t BaseHeight{}; + uint8_t SceneryQuadrant{}; }; -DEFINE_GAME_ACTION(SmallSceneryPlaceAction, GameCommand::PlaceScenery, SmallSceneryPlaceActionResult) +DEFINE_GAME_ACTION(SmallSceneryPlaceAction, GameCommand::PlaceScenery, GameActions::Result) { private: CoordsXYZD _loc; From 6ad41500855206b7056cc2b29654f2e19e664102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:15:40 +0300 Subject: [PATCH 500/681] Introduce rendering engine flag for parallel drawing --- src/openrct2/drawing/IDrawingEngine.h | 5 +++++ src/openrct2/drawing/X8DrawingEngine.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/openrct2/drawing/IDrawingEngine.h b/src/openrct2/drawing/IDrawingEngine.h index 41c3adb383..92e5e8b783 100644 --- a/src/openrct2/drawing/IDrawingEngine.h +++ b/src/openrct2/drawing/IDrawingEngine.h @@ -32,6 +32,11 @@ enum DRAWING_ENGINE_FLAGS * Whether or not the engine will only draw changed blocks of the screen each frame. */ DEF_DIRTY_OPTIMISATIONS = 1 << 0, + + /** + * The drawing engine is capable of processing the drawing in parallel. + */ + DEF_PARALLEL_DRAWING = 1 << 1, }; struct rct_drawpixelinfo; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 9cbbcdcf77..ddaa2d381f 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -284,7 +284,7 @@ rct_drawpixelinfo* X8DrawingEngine::GetDrawingPixelInfo() DRAWING_ENGINE_FLAGS X8DrawingEngine::GetFlags() { - return DEF_DIRTY_OPTIMISATIONS; + return static_cast(DEF_DIRTY_OPTIMISATIONS | DEF_PARALLEL_DRAWING); } void X8DrawingEngine::InvalidateImage([[maybe_unused]] uint32_t image) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 53200d366d..c16ddeb253 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -996,6 +996,12 @@ void viewport_paint( _paintJobs.reset(); } + bool useParallelDrawing = false; + if (useMultithreading && (dpi->DrawingEngine->GetFlags() & DEF_PARALLEL_DRAWING)) + { + useParallelDrawing = true; + } + // Create space to record sessions and keep track which index is being drawn size_t index = 0; if (recorded_sessions != nullptr) From fa340cb5a1ff5045e2115859b3533e25f1195b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:24:39 +0300 Subject: [PATCH 501/681] Add parallel drawing if engine allows it --- src/openrct2/interface/Viewport.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index c16ddeb253..73450b4978 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -931,8 +931,6 @@ static void viewport_paint_column(paint_session* session) { PaintDrawMoneyStructs(&session->DPI, session->PSStringHead); } - - PaintSessionFree(session); } /** @@ -1011,7 +1009,7 @@ void viewport_paint( recorded_sessions->resize(columnCount); } - // Splits the area into 32 pixel columns and renders them + // Generate and sort columns. for (x = alignedX; x < rightBorder; x += 32, index++) { paint_session* session = PaintSessionAlloc(&dpi1, viewFlags); @@ -1052,9 +1050,27 @@ void viewport_paint( _paintJobs->Join(); } - for (auto column : _paintColumns) + // Paint columns. + for (auto* session : _paintColumns) { - viewport_paint_column(column); + if (useParallelDrawing) + { + _paintJobs->AddTask([session]() -> void { viewport_paint_column(session); }); + } + else + { + viewport_paint_column(session); + } + } + if (useParallelDrawing) + { + _paintJobs->Join(); + } + + // Release resources. + for (auto* session : _paintColumns) + { + PaintSessionFree(session); } } From 911f168f8f20bcfb8b971e4f9580f0c0ca77700b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:28:37 +0300 Subject: [PATCH 502/681] Mark two palettes thread_local for parallel drawing support --- src/openrct2/drawing/Drawing.cpp | 4 ++-- src/openrct2/drawing/Drawing.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 520bb6ddb6..c4c9d2f466 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -94,7 +94,7 @@ int32_t gPickupPeepY; * rct2: 0x0009ABE0C */ // clang-format off -uint8_t gPeepPalette[256] = { +thread_local uint8_t gPeepPalette[256] = { 0x00, 0xF3, 0xF4, 0xF5, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -114,7 +114,7 @@ uint8_t gPeepPalette[256] = { }; /** rct2: 0x009ABF0C */ -uint8_t gOtherPalette[256] = { +thread_local uint8_t gOtherPalette[256] = { 0x00, 0xF3, 0xF4, 0xF5, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 47cb785d20..2e66236126 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -657,8 +657,8 @@ extern GamePalette gPalette; extern uint8_t gGamePalette[256 * 4]; extern uint32_t gPaletteEffectFrame; extern const FilterPaletteID GlassPaletteIds[COLOUR_COUNT]; -extern uint8_t gPeepPalette[256]; -extern uint8_t gOtherPalette[256]; +extern thread_local uint8_t gPeepPalette[256]; +extern thread_local uint8_t gOtherPalette[256]; extern uint8_t text_palette[]; extern const translucent_window_palette TranslucentWindowPalettes[COLOUR_COUNT]; From d2ffeaa7b0aea8ac7c14279291612ecdc2ca217e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 4 Oct 2021 17:51:25 +0300 Subject: [PATCH 503/681] Refactor action result passing for WallPlaceAction --- src/openrct2-ui/windows/TopToolbar.cpp | 5 +- src/openrct2/actions/WallPlaceAction.cpp | 90 ++++++++++-------------- src/openrct2/actions/WallPlaceAction.h | 14 ++-- 3 files changed, 46 insertions(+), 63 deletions(-) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index f837b0695f..269adcdd64 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -2521,11 +2521,12 @@ static money64 try_place_ghost_wall( // 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 WallPlaceActionResult* result) { + wallPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; - gSceneryGhostPosition = { loc, result->tileElement->GetBaseZ() }; + const auto placementData = result->GetData(); + gSceneryGhostPosition = { loc, placementData.BaseHeight }; gSceneryGhostWallRotation = edge; gSceneryGhostType |= SCENERY_GHOST_FLAG_2; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 5c988aa902..64074863ab 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -21,25 +21,6 @@ #include "../world/Wall.h" using namespace OpenRCT2::TrackMetaData; -WallPlaceActionResult::WallPlaceActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_CANT_BUILD_THIS_HERE) -{ -} - -WallPlaceActionResult::WallPlaceActionResult(GameActions::Status err) - : GameActions::Result(err, STR_CANT_BUILD_THIS_HERE) -{ -} - -WallPlaceActionResult::WallPlaceActionResult(GameActions::Status err, rct_string_id msg) - : GameActions::Result(err, STR_CANT_BUILD_THIS_HERE, msg) -{ -} - -WallPlaceActionResult::WallPlaceActionResult(GameActions::Status error, rct_string_id msg, uint8_t* args) - : GameActions::Result(error, STR_CANT_BUILD_THIS_HERE, msg, args) -{ -} WallPlaceAction::WallPlaceAction( ObjectEntryIndex wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour, @@ -78,7 +59,7 @@ void WallPlaceAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr WallPlaceAction::Query() const { - auto res = std::make_unique(); + auto res = MakeResult(); res->ErrorTitle = STR_CANT_BUILD_THIS_HERE; res->Position = _loc; @@ -93,7 +74,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::NotOwned); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_PATH_SCENERY) && !gCheatsSandboxMode) @@ -102,23 +83,23 @@ GameActions::Result::Ptr WallPlaceAction::Query() const { if (!map_is_location_in_park(_loc)) { - return std::make_unique(GameActions::Status::NotOwned); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE); } } else if (!map_is_location_owned(_loc)) { - return std::make_unique(GameActions::Status::NotOwned); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE); } } else if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())) { log_error("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } if (_edge > 3) { - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } uint8_t edgeSlope = 0; @@ -129,7 +110,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } targetHeight = surfaceElement->GetBaseZ(); @@ -146,7 +127,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } if (surfaceElement->GetWaterHeight() > 0) @@ -155,13 +136,13 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (targetHeight < waterHeight && !gCheatsDisableClearanceChecks) { - return std::make_unique(GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_UNDERWATER); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } if (targetHeight < surfaceElement->GetBaseZ() && !gCheatsDisableClearanceChecks) { - return std::make_unique(GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (!(edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS))) @@ -173,8 +154,8 @@ GameActions::Result::Ptr WallPlaceAction::Query() const { if (targetHeight / 8 < newBaseHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) @@ -189,8 +170,9 @@ GameActions::Result::Ptr WallPlaceAction::Query() const newBaseHeight += 2; if (targetHeight / 8 < newBaseHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } newBaseHeight -= 2; } @@ -203,8 +185,8 @@ GameActions::Result::Ptr WallPlaceAction::Query() const { if (targetHeight / 8 < newBaseHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) @@ -219,8 +201,9 @@ GameActions::Result::Ptr WallPlaceAction::Query() const newBaseHeight += 2; if (targetHeight / 8 < newBaseHeight) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } } } @@ -233,7 +216,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (wallEntry == nullptr) { log_error("Wall Type not found %d", _wallType); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } if (wallEntry->scrolling_mode != SCROLLING_MODE_NONE) @@ -241,7 +224,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (HasReachedBannerLimit()) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } @@ -250,8 +233,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const { if (wallEntry->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE) { - return std::make_unique( - GameActions::Status::Disallowed, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_ERR_UNABLE_TO_BUILD_THIS_ON_SLOPE); } clearanceHeight += 2; } @@ -269,16 +251,19 @@ GameActions::Result::Ptr WallPlaceAction::Query() const if (!MapCheckCapacityAndReorganise(_loc)) { - return MakeResult(GameActions::Status::NoFreeElements, STR_TILE_ELEMENT_LIMIT_REACHED); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_BUILD_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } res->Cost = wallEntry->price; + + res->SetData(WallPlaceActionResult{}); + return res; } GameActions::Result::Ptr WallPlaceAction::Execute() const { - auto res = std::make_unique(); + auto res = MakeResult(); res->ErrorTitle = STR_CANT_BUILD_THIS_HERE; res->Position = _loc; @@ -299,7 +284,7 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } targetHeight = surfaceElement->GetBaseZ(); @@ -318,7 +303,7 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const if (wallEntry == nullptr) { log_error("Wall Type not found %d", _wallType); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); } uint8_t clearanceHeight = targetHeight / COORDS_Z_STEP; @@ -345,7 +330,7 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const if (banner == nullptr) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->text = {}; @@ -361,12 +346,13 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const banner->ride_index = rideIndex; banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; } - - res->bannerId = banner->id; } auto* wallElement = TileElementInsert(targetLoc, 0b0000); - Guard::Assert(wallElement != nullptr); + if (wallElement == nullptr) + { + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); + } wallElement->clearance_height = clearanceHeight; wallElement->SetDirection(_edge); @@ -386,12 +372,14 @@ GameActions::Result::Ptr WallPlaceAction::Execute() const wallElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); - res->tileElement = wallElement->as(); - map_animation_create(MAP_ANIMATION_TYPE_WALL, targetLoc); map_invalidate_tile_zoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); res->Cost = wallEntry->price; + + const auto bannerId = banner != nullptr ? banner->id : BANNER_INDEX_NULL; + res->SetData(WallPlaceActionResult{ wallElement->GetBaseZ(), bannerId }); + return res; } diff --git a/src/openrct2/actions/WallPlaceAction.h b/src/openrct2/actions/WallPlaceAction.h index 7608a0ce7d..9699eeaebf 100644 --- a/src/openrct2/actions/WallPlaceAction.h +++ b/src/openrct2/actions/WallPlaceAction.h @@ -15,19 +15,13 @@ #include "../world/Scenery.h" #include "GameAction.h" -class WallPlaceActionResult final : public GameActions::Result +struct WallPlaceActionResult { -public: - WallPlaceActionResult(); - WallPlaceActionResult(GameActions::Status err); - WallPlaceActionResult(GameActions::Status err, rct_string_id msg); - WallPlaceActionResult(GameActions::Status error, rct_string_id msg, uint8_t* args); - - TileElement* tileElement = nullptr; - BannerIndex bannerId = BANNER_INDEX_NULL; + int32_t BaseHeight{}; + BannerIndex BannerId = BANNER_INDEX_NULL; }; -DEFINE_GAME_ACTION(WallPlaceAction, GameCommand::PlaceWall, WallPlaceActionResult) +DEFINE_GAME_ACTION(WallPlaceAction, GameCommand::PlaceWall, GameActions::Result) { private: ObjectEntryIndex _wallType{ OBJECT_ENTRY_INDEX_NULL }; From fea69cc86c431497fb62c1eb1de4f6a5669b5e06 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 30 Sep 2021 17:47:49 +0100 Subject: [PATCH 504/681] Backport scenery window from NSF Co-authored-by: IntelOrca Co-authored-by: Gymnasiast --- src/openrct2-ui/windows/Scenery.cpp | 1263 +++++++++++----------- src/openrct2-ui/windows/TopToolbar.cpp | 16 +- src/openrct2-ui/windows/Window.h | 4 +- src/openrct2/interface/Window.h | 12 +- src/openrct2/interface/Window_internal.h | 1 - src/openrct2/world/Scenery.cpp | 111 ++ src/openrct2/world/Scenery.h | 7 + src/openrct2/world/ScenerySelection.h | 18 +- 8 files changed, 769 insertions(+), 663 deletions(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index d32e3b3679..26a447d234 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -31,42 +31,8 @@ constexpr int32_t WINDOW_SCENERY_WIDTH = 634; constexpr int32_t WINDOW_SCENERY_HEIGHT = 180; constexpr int32_t SCENERY_BUTTON_WIDTH = 66; constexpr int32_t SCENERY_BUTTON_HEIGHT = 80; -constexpr int32_t SCENERY_WINDOW_TABS = MAX_SCENERY_GROUP_OBJECTS + 1; // The + 1 is for the 'Miscellaneous' tab -constexpr uint16_t SCENERY_ENTRIES_PER_TAB = 1024; // clang-format off -enum { - WINDOW_SCENERY_TAB_1, - WINDOW_SCENERY_TAB_2, - WINDOW_SCENERY_TAB_3, - WINDOW_SCENERY_TAB_4, - WINDOW_SCENERY_TAB_5, - WINDOW_SCENERY_TAB_6, - WINDOW_SCENERY_TAB_7, - WINDOW_SCENERY_TAB_8, - WINDOW_SCENERY_TAB_9, - WINDOW_SCENERY_TAB_10, - WINDOW_SCENERY_TAB_11, - WINDOW_SCENERY_TAB_12, - WINDOW_SCENERY_TAB_13, - WINDOW_SCENERY_TAB_14, - WINDOW_SCENERY_TAB_15, - WINDOW_SCENERY_TAB_16, - WINDOW_SCENERY_TAB_17, - WINDOW_SCENERY_TAB_18, - WINDOW_SCENERY_TAB_19, - WINDOW_SCENERY_TAB_20 -}; - -ScenerySelection gWindowSceneryTabSelections[SCENERY_WINDOW_TABS]; -uint8_t gWindowSceneryActiveTabIndex; -uint8_t gWindowSceneryPaintEnabled; -uint8_t gWindowSceneryRotation; -colour_t gWindowSceneryPrimaryColour; -colour_t gWindowScenerySecondaryColour; -colour_t gWindowSceneryTertiaryColour; -bool gWindowSceneryEyedropperEnabled = false; - static void window_scenery_close(rct_window *w); static void window_scenery_mouseup(rct_window *w, rct_widgetindex widgetIndex); static void window_scenery_resize(rct_window *w); @@ -102,38 +68,19 @@ static rct_window_event_list window_scenery_events([](auto& events) enum WINDOW_SCENERY_LIST_WIDGET_IDX { - WIDX_SCENERY_BACKGROUND, // 1 - WIDX_SCENERY_TITLE, // 2 - WIDX_SCENERY_CLOSE, // 4 - WIDX_SCENERY_TAB_CONTENT_PANEL, // 8 - WIDX_SCENERY_TAB_1, // 10 - WIDX_SCENERY_TAB_2, // 20 - WIDX_SCENERY_TAB_3, // 40 - WIDX_SCENERY_TAB_4, // 80 - WIDX_SCENERY_TAB_5, // 100 - WIDX_SCENERY_TAB_6, // 200 - WIDX_SCENERY_TAB_7, // 400 - WIDX_SCENERY_TAB_8, // 800 - WIDX_SCENERY_TAB_9, // 1000 - WIDX_SCENERY_TAB_10, // 2000 - WIDX_SCENERY_TAB_11, // 4000 - WIDX_SCENERY_TAB_12, // 8000 - WIDX_SCENERY_TAB_13, // 10000 - WIDX_SCENERY_TAB_14, // 20000 - WIDX_SCENERY_TAB_15, // 40000 - WIDX_SCENERY_TAB_16, // 80000 - WIDX_SCENERY_TAB_17, // 100000 - WIDX_SCENERY_TAB_18, // 200000 - WIDX_SCENERY_TAB_19, // 400000 - WIDX_SCENERY_TAB_20, // 800000 - WIDX_SCENERY_LIST, // 1000000 - WIDX_SCENERY_ROTATE_OBJECTS_BUTTON, // 2000000 - WIDX_SCENERY_REPAINT_SCENERY_BUTTON, // 4000000 - WIDX_SCENERY_PRIMARY_COLOUR_BUTTON, // 8000000 - WIDX_SCENERY_SECONDARY_COLOUR_BUTTON, // 10000000 - WIDX_SCENERY_TERTIARY_COLOUR_BUTTON, // 20000000 - WIDX_SCENERY_EYEDROPPER_BUTTON, // 40000000 - WIDX_SCENERY_BUILD_CLUSTER_BUTTON, // 80000000 + 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_SCENERY_TAB_1, }; validate_global_widx(WC_SCENERY, WIDX_SCENERY_TAB_1); @@ -143,26 +90,6 @@ validate_global_widx(WC_SCENERY, WIDX_SCENERY_EYEDROPPER_BUTTON); static rct_widget window_scenery_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WINDOW_SCENERY_WIDTH, WINDOW_SCENERY_HEIGHT), MakeWidget ({ 0, 43}, {634, 99}, WindowWidgetType::Resize, WindowColour::Secondary ), // 8 0x009DE2C8 - MakeTab ({ 3, 17}, STR_STRING_DEFINED_TOOLTIP ), // 10 0x009DE2D8 - MakeTab ({ 34, 17}, STR_STRING_DEFINED_TOOLTIP ), // 20 0x009DE2E8 - MakeTab ({ 65, 17}, STR_STRING_DEFINED_TOOLTIP ), // 40 0x009DE2F8 - MakeTab ({ 96, 17}, STR_STRING_DEFINED_TOOLTIP ), // 80 0x009DE308 - MakeTab ({127, 17}, STR_STRING_DEFINED_TOOLTIP ), // 100 0x009DE318 - MakeTab ({158, 17}, STR_STRING_DEFINED_TOOLTIP ), // 200 0x009DE328 - MakeTab ({189, 17}, STR_STRING_DEFINED_TOOLTIP ), // 400 0x009DE338 - MakeTab ({220, 17}, STR_STRING_DEFINED_TOOLTIP ), // 800 0x009DE348 - MakeTab ({251, 17}, STR_STRING_DEFINED_TOOLTIP ), // 1000 0x009DE358 - MakeTab ({282, 17}, STR_STRING_DEFINED_TOOLTIP ), // 2000 0x009DE368 - MakeTab ({313, 17}, STR_STRING_DEFINED_TOOLTIP ), // 4000 0x009DE378 - MakeTab ({344, 17}, STR_STRING_DEFINED_TOOLTIP ), // 8000 0x009DE388 - MakeTab ({375, 17}, STR_STRING_DEFINED_TOOLTIP ), // 10000 0x009DE398 - MakeTab ({406, 17}, STR_STRING_DEFINED_TOOLTIP ), // 20000 0x009DE3A8 - MakeTab ({437, 17}, STR_STRING_DEFINED_TOOLTIP ), // 40000 0x009DE3B8 - MakeTab ({468, 17}, STR_STRING_DEFINED_TOOLTIP ), // 80000 0x009DE3C8 - MakeTab ({468, 17}, STR_STRING_DEFINED_TOOLTIP ), // 100000 0x009DE3D8 - MakeTab ({468, 17}, STR_STRING_DEFINED_TOOLTIP ), // 200000 0x009DE3E8 - MakeTab ({468, 17}, STR_STRING_DEFINED_TOOLTIP ), // 400000 0x009DE3F8 - MakeRemapWidget({468, 17}, { 31, 27}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB_QUESTION, STR_STRING_DEFINED_TOOLTIP ), // 800000 0x009DE408 MakeWidget ({ 2, 47}, {607, 80}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // 1000000 0x009DE418 MakeWidget ({609, 44}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_ROTATE_ARROW, STR_ROTATE_OBJECTS_90 ), // 2000000 0x009DE428 MakeWidget ({609, 68}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_PAINTBRUSH, STR_SCENERY_PAINTBRUSH_TIP ), // 4000000 0x009DE438 @@ -177,55 +104,195 @@ static rct_widget window_scenery_widgets[] = { void window_scenery_update_scroll(rct_window* w); -// rct2: 0x00F64F2C -static ScenerySelection window_scenery_tab_entries[SCENERY_WINDOW_TABS][SCENERY_ENTRIES_PER_TAB + 1]; - -/** - * Was part of 0x006DFA00 - * The same code repeated five times for every scenery entry type - */ -static void init_scenery_entry(const ScenerySelection& selection, ObjectEntryIndex sceneryTabId) +struct SceneryTabInfo { - Guard::ArgumentInRange(selection.EntryIndex, 0, WINDOW_SCENERY_TAB_SELECTION_UNDEFINED); - if (scenery_is_invented(selection) || gCheatsIgnoreResearchStatus) + ObjectEntryIndex SceneryGroupIndex = OBJECT_ENTRY_INDEX_NULL; + std::vector Entries; + + bool IsMisc() const { - if (sceneryTabId < SCENERY_WINDOW_TABS) + return SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL; + } + + bool Contains(ScenerySelection entry) const + { + auto it = std::find(Entries.begin(), Entries.end(), entry); + return it != Entries.end(); + } + + void AddEntry(ScenerySelection entry) + { + if (!Contains(entry)) { - for (int32_t i = 0; i < SCENERY_ENTRIES_PER_TAB; i++) + Entries.push_back(entry); + } + } + + const rct_scenery_group_entry* GetSceneryGroupEntry() const + { + return get_scenery_group_entry(SceneryGroupIndex); + } +}; + +std::vector gWindowSceneryTabSelections; +size_t gWindowSceneryActiveTabIndex; +uint8_t gWindowSceneryPaintEnabled; +uint8_t gWindowSceneryRotation; +colour_t gWindowSceneryPrimaryColour; +colour_t gWindowScenerySecondaryColour; +colour_t gWindowSceneryTertiaryColour; +bool gWindowSceneryEyedropperEnabled; + +static std::vector _tabEntries; +static std::vector _widgets; +static ScenerySelection _selectedScenery; +static int16_t _hoverCounter; + +static ScenerySelection GetSelectedScenery(size_t tabIndex) +{ + if (gWindowSceneryTabSelections.size() > tabIndex) + { + return gWindowSceneryTabSelections[tabIndex]; + } + return {}; +} + +static void SetSelectedScenery(size_t tabIndex, ScenerySelection value) +{ + if (gWindowSceneryTabSelections.size() <= tabIndex) + { + gWindowSceneryTabSelections.resize(tabIndex + 1); + } + gWindowSceneryTabSelections[tabIndex] = value; +} + +static SceneryTabInfo* GetSceneryTabInfoForGroup(ObjectEntryIndex sceneryGroupIndex) +{ + if (sceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) + { + return &_tabEntries[_tabEntries.size() - 1]; + } + + for (auto& tabEntry : _tabEntries) + { + if (tabEntry.SceneryGroupIndex == sceneryGroupIndex) + return &tabEntry; + } + + return nullptr; +} + +static std::optional window_scenery_find_tab_with_scenery(const ScenerySelection& scenery) +{ + for (size_t i = 0; i < _tabEntries.size(); i++) + { + const auto& tabInfo = _tabEntries[i]; + for (const auto& entry : tabInfo.Entries) + { + if (entry == scenery) { - if (window_scenery_tab_entries[sceneryTabId][i].IsUndefined()) - { - window_scenery_tab_entries[sceneryTabId][i] = selection; - window_scenery_tab_entries[sceneryTabId][i + 1].SetUndefined(); - return; - } + return i; + } + } + } + return {}; +} + +static void init_scenery_entry(const ScenerySelection& selection, ObjectEntryIndex sceneryGroupIndex) +{ + Guard::ArgumentInRange(selection.EntryIndex, 0, OBJECT_ENTRY_INDEX_NULL); + + if (IsSceneryAvailableToBuild(selection)) + { + // Get current tab + auto tabIndex = window_scenery_find_tab_with_scenery(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->AddEntry(selection); + return; } } - for (int32_t i = 0; i < SCENERY_WINDOW_TABS - 1; i++) + // If scenery is no tab, add it to misc + if (!tabIndex) { - int32_t counter = 0; - - while (!window_scenery_tab_entries[i][counter].IsUndefined()) + auto tabInfo = GetSceneryTabInfoForGroup(OBJECT_ENTRY_INDEX_NULL); + if (tabInfo != nullptr) { - if (window_scenery_tab_entries[i][counter] == selection) - { - return; - } + tabInfo->AddEntry(selection); + } + } + } +} - counter++; +static void window_scenery_sort_tabs() +{ + 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; + + auto entryA = a.GetSceneryGroupEntry(); + auto entryB = b.GetSceneryGroupEntry(); + return entryA->priority < entryB->priority; + }); +} + +static void window_scenery_prepare_widgets(rct_window* w) +{ + _widgets.clear(); + for (const auto& widget : window_scenery_widgets) + { + _widgets.push_back(widget); + } + + // Remove WWT_LAST + auto lastWidget = _widgets.back(); + _widgets.pop_back(); + + // Add tabs + ScreenCoordsXY pos = { 3, 17 }; + for (const auto& tabInfo : _tabEntries) + { + auto widget = MakeTab(pos, STR_STRING_DEFINED_TOOLTIP); + pos.x += 31; + + if (tabInfo.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) + { + widget.image = SPR_TAB_QUESTION | IMAGE_TYPE_REMAP; + } + else + { + auto sceneryGroupEntry = get_scenery_group_entry(tabInfo.SceneryGroupIndex); + if (sceneryGroupEntry != nullptr) + { + widget.image = sceneryGroupEntry->image | IMAGE_TYPE_REMAP; } } - for (int32_t i = 0; i < SCENERY_ENTRIES_PER_TAB; i++) - { - if (window_scenery_tab_entries[SCENERY_WINDOW_TABS - 1][i].IsUndefined()) - { - window_scenery_tab_entries[SCENERY_WINDOW_TABS - 1][i] = selection; - window_scenery_tab_entries[SCENERY_WINDOW_TABS - 1][i + 1].SetUndefined(); - break; - } - } + _widgets.push_back(widget); + } + + _widgets.push_back(lastWidget); + + w->widgets = _widgets.data(); + + w->enabled_widgets = (1 << WIDX_SCENERY_CLOSE) | (1 << WIDX_SCENERY_ROTATE_OBJECTS_BUTTON) + | (1 << WIDX_SCENERY_PRIMARY_COLOUR_BUTTON) | (1 << WIDX_SCENERY_SECONDARY_COLOUR_BUTTON) + | (1 << WIDX_SCENERY_REPAINT_SCENERY_BUTTON) | (1 << WIDX_SCENERY_TERTIARY_COLOUR_BUTTON) + | (1 << WIDX_SCENERY_EYEDROPPER_BUTTON) | (1ULL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); + for (size_t i = 0; i < _tabEntries.size(); i++) + { + w->enabled_widgets |= (1ULL << (WIDX_SCENERY_TAB_1 + i)); } } @@ -233,158 +300,106 @@ static void init_scenery_entry(const ScenerySelection& selection, ObjectEntryInd * * rct2: 0x006DFA00 */ -void window_scenery_init() +static void window_scenery_init(rct_window* w) { - bool enabledScenerySets[SCENERY_WINDOW_TABS] = { false }; + _tabEntries.clear(); - for (int32_t scenerySetIndex = 0; scenerySetIndex < SCENERY_WINDOW_TABS; scenerySetIndex++) + auto maxTabs = 32; + for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < maxTabs - 1; scenerySetIndex++) { - window_scenery_tab_entries[scenerySetIndex][0].SetUndefined(); - if (scenerySetIndex == MAX_SCENERY_GROUP_OBJECTS) - continue; - - rct_scenery_group_entry* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); - if (sceneryGroupEntry == nullptr) - continue; - - int32_t sceneryTabEntryCount = 0; - for (int32_t i = 0; i < sceneryGroupEntry->entry_count; i++) + const auto* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); + if (sceneryGroupEntry != nullptr) { - auto sceneryEntry = sceneryGroupEntry->scenery_entries[i]; - if (scenery_is_invented(sceneryEntry) || gCheatsIgnoreResearchStatus) + SceneryTabInfo tabInfo; + tabInfo.SceneryGroupIndex = scenerySetIndex; + for (size_t i = 0; i < sceneryGroupEntry->entry_count; i++) { - window_scenery_tab_entries[scenerySetIndex][sceneryTabEntryCount] = sceneryEntry; - window_scenery_tab_entries[scenerySetIndex][++sceneryTabEntryCount].SetUndefined(); + auto sceneryEntry = sceneryGroupEntry->scenery_entries[i]; + if (IsSceneryAvailableToBuild(sceneryEntry)) + { + tabInfo.Entries.push_back(sceneryEntry); + } } - else + if (tabInfo.Entries.size() > 0) { - enabledScenerySets[scenerySetIndex] = true; + _tabEntries.push_back(std::move(tabInfo)); } } } + // Add misc tab + _tabEntries.emplace_back(); + // small scenery for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++) { - auto* sceneryEntry = get_small_scenery_entry(sceneryId); - if (sceneryEntry == nullptr) - continue; - - init_scenery_entry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); + const auto* sceneryEntry = get_small_scenery_entry(sceneryId); + if (sceneryEntry != nullptr) + { + init_scenery_entry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); + } } // large scenery for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++) { - auto* sceneryEntry = get_large_scenery_entry(sceneryId); - if (sceneryEntry == nullptr) - continue; - - init_scenery_entry({ SCENERY_TYPE_LARGE, sceneryId }, sceneryEntry->scenery_tab_id); + const auto* sceneryEntry = get_large_scenery_entry(sceneryId); + if (sceneryEntry != nullptr) + { + init_scenery_entry({ SCENERY_TYPE_LARGE, sceneryId }, sceneryEntry->scenery_tab_id); + } } // walls for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++) { - auto* sceneryEntry = get_wall_entry(sceneryId); - if (sceneryEntry == nullptr) - continue; - - init_scenery_entry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); + const auto* sceneryEntry = get_wall_entry(sceneryId); + if (sceneryEntry != nullptr) + { + init_scenery_entry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); + } } // banners for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++) { - auto* bannerEntry = get_banner_entry(sceneryId); - if (bannerEntry == nullptr) - continue; - - init_scenery_entry({ SCENERY_TYPE_BANNER, sceneryId }, bannerEntry->scenery_tab_id); + const auto* sceneryEntry = get_banner_entry(sceneryId); + if (sceneryEntry != nullptr) + { + init_scenery_entry({ SCENERY_TYPE_BANNER, sceneryId }, sceneryEntry->scenery_tab_id); + } } // path bits for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++) { - auto* pathBitEntry = get_footpath_item_entry(sceneryId); - if (pathBitEntry == nullptr) - continue; - - init_scenery_entry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, pathBitEntry->scenery_tab_id); - } - - for (rct_widgetindex widgetIndex = WIDX_SCENERY_TAB_1; widgetIndex < WIDX_SCENERY_LIST; widgetIndex++) - window_scenery_widgets[widgetIndex].type = WindowWidgetType::Empty; - - uint8_t tabIndexes[SCENERY_WINDOW_TABS]; - uint8_t order[SCENERY_WINDOW_TABS]; - int32_t usedValues = 0; - - for (int32_t scenerySetId = 0; scenerySetId < MAX_SCENERY_GROUP_OBJECTS; scenerySetId++) - { - rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(scenerySetId); - if (sceneryEntry == nullptr) - continue; - - tabIndexes[usedValues] = scenerySetId; - order[usedValues] = sceneryEntry->priority; - - usedValues++; - } - - while (true) - { - bool finished = true; - for (int32_t i = 1; i < usedValues; i++) + const auto* sceneryEntry = get_footpath_item_entry(sceneryId); + if (sceneryEntry != nullptr) { - if (order[i - 1] > order[i]) - { - uint8_t tmp = tabIndexes[i - 1]; - tabIndexes[i - 1] = tabIndexes[i]; - tabIndexes[i] = tmp; - tmp = order[i - 1]; - order[i - 1] = order[i]; - order[i] = tmp; - finished = false; - } + init_scenery_entry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, sceneryEntry->scenery_tab_id); } - - if (finished) - break; } - tabIndexes[usedValues] = SCENERY_WINDOW_TABS - 1; - usedValues++; - - uint16_t left = 3; - for (int32_t i = 0; i < usedValues; i++) + // Remove misc tab if empty + if (_tabEntries.back().Entries.size() == 0) { - uint32_t tabIndex = tabIndexes[i]; - rct_widget* tabWidget = &window_scenery_widgets[tabIndex + WIDX_SCENERY_TAB_1]; - - if (left != 3 || tabIndex != SCENERY_WINDOW_TABS - 1) - { - if (window_scenery_tab_entries[tabIndex][0].IsUndefined()) - continue; - - if (enabledScenerySets[tabIndex]) - continue; - } - - tabWidget->type = WindowWidgetType::Tab; - tabWidget->left = left; - tabWidget->right = left + 0x1E; - left += 0x1F; - - if (tabIndex >= SCENERY_WINDOW_TABS - 1) - continue; - - tabWidget->image = get_scenery_group_entry(tabIndex)->image | IMAGE_TYPE_REMAP; + _tabEntries.pop_back(); } + window_scenery_sort_tabs(); + window_scenery_prepare_widgets(w); window_invalidate_by_class(WC_SCENERY); } +void window_scenery_init() +{ + auto w = window_find_by_class(WC_SCENERY); + if (w != nullptr) + { + window_scenery_init(w); + } +} + /** * * rct2: 0x006DFEE4 @@ -395,29 +410,11 @@ void window_scenery_set_default_placement_configuration() gWindowSceneryPrimaryColour = COLOUR_BORDEAUX_RED; gWindowScenerySecondaryColour = COLOUR_YELLOW; gWindowSceneryTertiaryColour = COLOUR_DARK_BROWN; + window_scenery_init(); - for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++) - gWindowSceneryTabSelections[i] = ScenerySelection::CreateUndefined(); - - for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++) - { - if (!window_scenery_tab_entries[i][0].IsUndefined()) - { - gWindowSceneryActiveTabIndex = i; - return; - } - } - - for (int32_t i = 0; i < 16; i++) - { - rct_widget* tabWidget = &window_scenery_widgets[WIDX_SCENERY_TAB_1 + i]; - if (tabWidget->type != WindowWidgetType::Empty) - { - gWindowSceneryActiveTabIndex = i; - return; - } - } + gWindowSceneryTabSelections.clear(); + gWindowSceneryActiveTabIndex = 0; } /** @@ -426,31 +423,16 @@ void window_scenery_set_default_placement_configuration() */ rct_window* window_scenery_open() { - rct_window* window; - // Check if window is already open - window = window_bring_to_front_by_class(WC_SCENERY); + auto window = window_bring_to_front_by_class(WC_SCENERY); if (window != nullptr) return window; - window_scenery_init(); - window = WindowCreate( ScreenCoordsXY(context_get_width() - WINDOW_SCENERY_WIDTH, 0x1D), WINDOW_SCENERY_WIDTH, WINDOW_SCENERY_HEIGHT, &window_scenery_events, WC_SCENERY, WF_NO_SCROLLING); - window->widgets = window_scenery_widgets; - window->enabled_widgets = (1ULL << WIDX_SCENERY_CLOSE) | (1ULL << WIDX_SCENERY_ROTATE_OBJECTS_BUTTON) - | (1ULL << WIDX_SCENERY_TAB_1) | (1ULL << WIDX_SCENERY_TAB_2) | (1ULL << WIDX_SCENERY_TAB_3) - | (1ULL << WIDX_SCENERY_TAB_4) | (1ULL << WIDX_SCENERY_TAB_5) | (1ULL << WIDX_SCENERY_TAB_6) - | (1ULL << WIDX_SCENERY_TAB_7) | (1ULL << WIDX_SCENERY_TAB_8) | (1ULL << WIDX_SCENERY_TAB_9) - | (1ULL << WIDX_SCENERY_TAB_10) | (1ULL << WIDX_SCENERY_TAB_11) | (1ULL << WIDX_SCENERY_TAB_12) - | (1ULL << WIDX_SCENERY_TAB_13) | (1ULL << WIDX_SCENERY_TAB_14) | (1ULL << WIDX_SCENERY_TAB_15) - | (1ULL << WIDX_SCENERY_TAB_16) | (1ULL << WIDX_SCENERY_TAB_17) | (1ULL << WIDX_SCENERY_TAB_18) - | (1ULL << WIDX_SCENERY_TAB_19) | (1ULL << WIDX_SCENERY_TAB_20) | (1ULL << WIDX_SCENERY_PRIMARY_COLOUR_BUTTON) - | (1ULL << WIDX_SCENERY_SECONDARY_COLOUR_BUTTON) | (1ULL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON) - | (1ULL << WIDX_SCENERY_TERTIARY_COLOUR_BUTTON) | (1ULL << WIDX_SCENERY_EYEDROPPER_BUTTON) - | (1ULL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); + window_scenery_init(window); WindowInitScrollWidgets(window); window_scenery_update_scroll(window); @@ -458,8 +440,8 @@ rct_window* window_scenery_open() gWindowSceneryRotation = 3; gSceneryCtrlPressed = false; gSceneryShiftPressed = false; - window->scenery.SelectedScenery = ScenerySelection::CreateUndefined(); - window->scenery.hover_counter = 0; + _selectedScenery = {}; + _hoverCounter = 0; window_push_others_below(window); gSceneryGhostType = 0; gSceneryPlaceCost = MONEY32_UNDEFINED; @@ -475,7 +457,14 @@ rct_window* window_scenery_open() return window; } -/** +static int32_t window_scenery_get_num_columns(rct_window* w) +{ + const auto* listWidget = &w->widgets[WIDX_SCENERY_LIST]; + auto contentWidth = listWidget->width() - SCROLLBAR_WIDTH; + return contentWidth / SCENERY_BUTTON_WIDTH; +} + +/* * * rct2: 0x006E1A73 */ @@ -492,10 +481,23 @@ void window_scenery_close(rct_window* w) tool_cancel(); } -static int32_t count_rows(int32_t items) +template constexpr static T window_scenery_count_rows(rct_window* w, T items) { - int32_t rows = items / 9; + auto rows = items / window_scenery_get_num_columns(w); + return rows; +} +static size_t window_scenery_count_rows(rct_window* w) +{ + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return 0; + } + + auto totalItems = _tabEntries[tabIndex].Entries.size(); + auto numColumns = window_scenery_get_num_columns(w); + auto rows = window_scenery_count_rows(w, totalItems + numColumns - 1); return rows; } @@ -506,46 +508,27 @@ struct scenery_item ScenerySelection scenerySelection; }; -static scenery_item window_scenery_count_rows_with_selected_item(int32_t tabIndex) +static scenery_item window_scenery_count_rows_with_selected_item(rct_window* w, size_t tabIndex) { - scenery_item sceneryItem = { 0, 0, ScenerySelection::CreateUndefined() }; - int32_t totalItems = 0; - ScenerySelection currentEntry = { 0, 0 }; - ScenerySelection scenerySelection = gWindowSceneryTabSelections[tabIndex]; - - for (totalItems = 0; totalItems < SCENERY_ENTRIES_PER_TAB + 1; ++totalItems) + scenery_item sceneryItem = { 0, 0, ScenerySelection() }; + const auto& scenerySelection = GetSelectedScenery(tabIndex); + const auto& tabInfo = _tabEntries[tabIndex]; + for (size_t i = 0; i < tabInfo.Entries.size(); i++) { - currentEntry = window_scenery_tab_entries[tabIndex][totalItems]; - if (currentEntry.IsUndefined()) - break; - + const auto& currentEntry = tabInfo.Entries[i]; if (currentEntry == scenerySelection) { - sceneryItem.selected_item = totalItems; + sceneryItem.selected_item = static_cast(i); sceneryItem.scenerySelection = scenerySelection; } } - sceneryItem.allRows = count_rows(totalItems + 8); + sceneryItem.allRows = static_cast(window_scenery_count_rows(w, tabInfo.Entries.size() + 8)); return sceneryItem; } -static int32_t window_scenery_count_rows() +static int32_t window_scenery_rows_height(size_t rows) { - int32_t tabIndex = gWindowSceneryActiveTabIndex; - int32_t totalItems = 0; - - while (!window_scenery_tab_entries[tabIndex][totalItems].IsUndefined()) - { - totalItems++; - } - - int32_t rows = count_rows(totalItems + 8); - return rows; -} - -static int32_t window_scenery_rows_height(int32_t rows) -{ - return rows * SCENERY_BUTTON_HEIGHT; + return static_cast(rows * SCENERY_BUTTON_HEIGHT); } /** @@ -608,20 +591,27 @@ static void window_scenery_mouseup(rct_window* w, rct_widgetindex widgetIndex) */ void window_scenery_update_scroll(rct_window* w) { - int32_t tabIndex = gWindowSceneryActiveTabIndex; - int32_t listHeight = w->height - 14 - window_scenery_widgets[WIDX_SCENERY_LIST].top - 1; + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return; + } - scenery_item sceneryItem = window_scenery_count_rows_with_selected_item(tabIndex); + int32_t listHeight = w->height - 14 - w->widgets[WIDX_SCENERY_LIST].top - 1; + + scenery_item sceneryItem = window_scenery_count_rows_with_selected_item(w, tabIndex); w->scrolls[0].v_bottom = window_scenery_rows_height(sceneryItem.allRows) + 1; int32_t maxTop = std::max(0, w->scrolls[0].v_bottom - listHeight); - int32_t rowSelected = count_rows(sceneryItem.selected_item); + auto rowSelected = window_scenery_count_rows(w, sceneryItem.selected_item); if (sceneryItem.scenerySelection.IsUndefined()) { rowSelected = 0; - ScenerySelection scenery = window_scenery_tab_entries[tabIndex][0]; + auto& scenery = _tabEntries[tabIndex].Entries[0]; if (!scenery.IsUndefined()) - gWindowSceneryTabSelections[tabIndex] = scenery; + { + SetSelectedScenery(tabIndex, scenery); + } } w->scrolls[0].v_top = window_scenery_rows_height(rowSelected); @@ -690,7 +680,7 @@ static void window_scenery_mousedown(rct_window* w, rct_widgetindex widgetIndex, break; } - if (widgetIndex >= WIDX_SCENERY_TAB_1 && widgetIndex <= WIDX_SCENERY_TAB_20) + if (widgetIndex >= WIDX_SCENERY_TAB_1) { gWindowSceneryActiveTabIndex = widgetIndex - WIDX_SCENERY_TAB_1; w->Invalidate(); @@ -731,9 +721,9 @@ static void window_scenery_dropdown(rct_window* w, rct_widgetindex widgetIndex, */ static void window_scenery_periodic_update(rct_window* w) { - if (!w->scenery.SelectedScenery.IsUndefined()) + if (!_selectedScenery.IsUndefined()) { - w->scenery.SelectedScenery = ScenerySelection::CreateUndefined(); + _selectedScenery = {}; } } @@ -754,8 +744,8 @@ static void window_scenery_update(rct_window* w) rct_widgetindex widgetIndex = window_find_widget_from_point(w, state->position); if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL) { - w->scenery.hover_counter++; - if (w->scenery.hover_counter < 8) + _hoverCounter++; + if (_hoverCounter < 8) { if (input_get_state() != InputState::ScrollLeft) { @@ -767,10 +757,13 @@ static void window_scenery_update(rct_window* w) } else { - int32_t windowHeight = std::min(463, w->scrolls[0].v_bottom + 62); - if (context_get_height() < 600) - windowHeight = std::min(374, windowHeight); - windowHeight = std::max(WINDOW_SCENERY_HEIGHT, windowHeight); + const auto& listWidget = w->widgets[WIDX_SCENERY_LIST]; + auto nonListHeight = w->height - listWidget.height() + 2; + + auto numRows = static_cast(window_scenery_count_rows(w)); + auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; + auto maxWindowHeight = maxContentHeight + nonListHeight; + auto windowHeight = std::clamp(maxWindowHeight, WINDOW_SCENERY_HEIGHT, 463); w->min_width = WINDOW_SCENERY_WIDTH; w->max_width = WINDOW_SCENERY_WIDTH; @@ -782,7 +775,7 @@ static void window_scenery_update(rct_window* w) } else { - w->scenery.hover_counter = 0; + _hoverCounter = 0; if (input_get_state() != InputState::ScrollLeft) { w->min_width = WINDOW_SCENERY_WIDTH; @@ -810,9 +803,8 @@ static void window_scenery_update(rct_window* w) } else { - uint16_t tabIndex = gWindowSceneryActiveTabIndex; - ScenerySelection tabSelectedScenery = gWindowSceneryTabSelections[tabIndex]; - + auto tabIndex = gWindowSceneryActiveTabIndex; + auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) @@ -845,26 +837,30 @@ static void window_scenery_update(rct_window* w) */ void window_scenery_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) { - int32_t rows = window_scenery_count_rows(); + auto rows = window_scenery_count_rows(w); *height = window_scenery_rows_height(rows); } -static ScenerySelection get_scenery_id_by_cursor_pos(const ScreenCoordsXY& screenCoords) +static ScenerySelection get_scenery_id_by_cursor_pos(rct_window* w, const ScreenCoordsXY& screenCoords) { - int32_t tabSceneryIndex = screenCoords.x / SCENERY_BUTTON_WIDTH + (screenCoords.y / SCENERY_BUTTON_HEIGHT) * 9; - uint8_t tabIndex = gWindowSceneryActiveTabIndex; + ScenerySelection scenery{}; - int32_t itemCounter = 0; - ScenerySelection scenery = ScenerySelection::CreateUndefined(); - while (itemCounter <= tabSceneryIndex) + auto numColumns = window_scenery_get_num_columns(w); + auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH; + auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT; + if (colIndex >= 0 && colIndex < numColumns && rowIndex >= 0) { - scenery = window_scenery_tab_entries[tabIndex][itemCounter]; - if (scenery.IsUndefined()) - return ScenerySelection::CreateUndefined(); - - itemCounter++; + auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex < _tabEntries.size()) + { + auto& tabInfo = _tabEntries[tabIndex]; + if (tabSceneryIndex < tabInfo.Entries.size()) + { + return tabInfo.Entries[tabSceneryIndex]; + } + } } - return scenery; } @@ -874,17 +870,16 @@ static ScenerySelection get_scenery_id_by_cursor_pos(const ScreenCoordsXY& scree */ void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - ScenerySelection scenery = get_scenery_id_by_cursor_pos(screenCoords); + ScenerySelection scenery = get_scenery_id_by_cursor_pos(w, screenCoords); if (scenery.IsUndefined()) return; - uint8_t tabIndex = gWindowSceneryActiveTabIndex; - gWindowSceneryTabSelections[tabIndex] = scenery; + SetSelectedScenery(gWindowSceneryActiveTabIndex, scenery); gWindowSceneryPaintEnabled &= 0xFE; gWindowSceneryEyedropperEnabled = false; OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); - w->scenery.hover_counter = -16; + _hoverCounter = -16; gSceneryPlaceCost = MONEY32_UNDEFINED; w->Invalidate(); } @@ -895,10 +890,10 @@ void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, const Sc */ void window_scenery_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - ScenerySelection scenery = get_scenery_id_by_cursor_pos(screenCoords); + ScenerySelection scenery = get_scenery_id_by_cursor_pos(w, screenCoords); if (!scenery.IsUndefined()) { - w->scenery.SelectedScenery = scenery; + _selectedScenery = scenery; w->Invalidate(); } } @@ -909,36 +904,29 @@ void window_scenery_scrollmouseover(rct_window* w, int32_t scrollIndex, const Sc */ OpenRCT2String window_scenery_tooltip(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback) { - auto ft = Formatter(); - - switch (widgetIndex) + if (widgetIndex >= WIDX_SCENERY_TAB_1) { - case WIDX_SCENERY_TAB_1: - case WIDX_SCENERY_TAB_2: - case WIDX_SCENERY_TAB_3: - case WIDX_SCENERY_TAB_4: - case WIDX_SCENERY_TAB_5: - case WIDX_SCENERY_TAB_6: - case WIDX_SCENERY_TAB_7: - case WIDX_SCENERY_TAB_8: - case WIDX_SCENERY_TAB_9: - case WIDX_SCENERY_TAB_10: - case WIDX_SCENERY_TAB_11: - case WIDX_SCENERY_TAB_12: - case WIDX_SCENERY_TAB_13: - case WIDX_SCENERY_TAB_14: - case WIDX_SCENERY_TAB_15: - case WIDX_SCENERY_TAB_16: - case WIDX_SCENERY_TAB_17: - case WIDX_SCENERY_TAB_18: - case WIDX_SCENERY_TAB_19: - ft.Add(get_scenery_group_entry(widgetIndex - WIDX_SCENERY_TAB_1)->name); - break; - case WIDX_SCENERY_TAB_20: - ft.Add(STR_MISCELLANEOUS); - break; + 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 }; + } + + auto sceneryEntry = tabInfo.GetSceneryGroupEntry(); + if (sceneryEntry != nullptr) + { + auto ft = Formatter(); + ft.Add(sceneryEntry->name); + return { fallback, ft }; + } + } } - return { fallback, ft }; + return { STR_NONE, Formatter() }; } /** @@ -947,18 +935,19 @@ OpenRCT2String window_scenery_tooltip(rct_window* w, const rct_widgetindex widge */ void window_scenery_invalidate(rct_window* w) { - uint16_t tabIndex = gWindowSceneryActiveTabIndex; - uint32_t titleStringId = STR_MISCELLANEOUS; - if (tabIndex < SCENERY_WINDOW_TABS - 1) + // Set the window title + rct_string_id titleStringId = STR_MISCELLANEOUS; + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex < _tabEntries.size()) { - rct_scenery_group_entry* sgEntry = get_scenery_group_entry(tabIndex); + const auto& tabInfo = _tabEntries[tabIndex]; + const auto* sgEntry = tabInfo.GetSceneryGroupEntry(); if (sgEntry != nullptr) { titleStringId = sgEntry->name; } } - - window_scenery_widgets[WIDX_SCENERY_TITLE].text = titleStringId; + w->widgets[WIDX_SCENERY_TITLE].text = titleStringId; w->pressed_widgets = 0; w->pressed_widgets |= 1ULL << (tabIndex + WIDX_SCENERY_TAB_1); @@ -969,55 +958,54 @@ void window_scenery_invalidate(rct_window* w) if (gWindowSceneryScatterEnabled) w->pressed_widgets |= (1ULL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; - window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; - window_scenery_widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::Empty; if (!(gWindowSceneryPaintEnabled & 1)) { - window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; + w->widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; } - ScenerySelection tabSelectedScenery = gWindowSceneryTabSelections[tabIndex]; + auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) { if (!(gWindowSceneryPaintEnabled & 1)) { - window_scenery_widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; + w->widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; } auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; } } else if (tabSelectedScenery.SceneryType >= SCENERY_TYPE_LARGE) { - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; } } - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryPrimaryColour) + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryPrimaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1( - gWindowScenerySecondaryColour) + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowScenerySecondaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryTertiaryColour) + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryTertiaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; if (gWindowSceneryPaintEnabled & 1) { // repaint coloured scenery tool is on - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; } else if (!tabSelectedScenery.IsUndefined()) { @@ -1026,7 +1014,7 @@ void window_scenery_invalidate(rct_window* w) auto* bannerEntry = get_banner_entry(tabSelectedScenery.EntryIndex); if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) @@ -1034,25 +1022,25 @@ void window_scenery_invalidate(rct_window* w) auto* sceneryEntry = get_large_scenery_entry(tabSelectedScenery.EntryIndex); if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR) - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) { auto* wallEntry = get_wall_entry(tabSelectedScenery.EntryIndex); if (wallEntry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS)) { - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) { - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; if (wallEntry->flags2 & WALL_SCENERY_2_NO_SELECT_PRIMARY_COLOUR) - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } } } @@ -1062,39 +1050,116 @@ void window_scenery_invalidate(rct_window* w) if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) { - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } } } - window_scenery_widgets[WIDX_SCENERY_BACKGROUND].right = w->width - 1; - window_scenery_widgets[WIDX_SCENERY_BACKGROUND].bottom = w->height - 1; - window_scenery_widgets[WIDX_SCENERY_TAB_CONTENT_PANEL].right = w->width - 1; - window_scenery_widgets[WIDX_SCENERY_TAB_CONTENT_PANEL].bottom = w->height - 1; - window_scenery_widgets[WIDX_SCENERY_TITLE].right = w->width - 2; - window_scenery_widgets[WIDX_SCENERY_CLOSE].left = w->width - 13; - window_scenery_widgets[WIDX_SCENERY_CLOSE].right = window_scenery_widgets[WIDX_SCENERY_CLOSE].left + 10; - window_scenery_widgets[WIDX_SCENERY_LIST].right = w->width - 26; - window_scenery_widgets[WIDX_SCENERY_LIST].bottom = w->height - 14; + auto windowWidth = w->width; + if (_tabEntries.size() > 0) + { + auto lastTabIndex = _tabEntries.size() - 1; + const auto lastTabWidget = &w->widgets[WIDX_SCENERY_TAB_1 + lastTabIndex]; + windowWidth = std::max(windowWidth, lastTabWidget->right + 3); + } + w->min_width = windowWidth; + w->max_width = windowWidth; - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].left = w->width - 25; - window_scenery_widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].left = w->width - 25; - window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].left = w->width - 25; - window_scenery_widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].left = w->width - 25; - window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].right = w->width - 2; - window_scenery_widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].right = w->width - 2; - window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].right = w->width - 2; - window_scenery_widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].right = w->width - 2; + w->widgets[WIDX_SCENERY_BACKGROUND].right = windowWidth - 1; + w->widgets[WIDX_SCENERY_BACKGROUND].bottom = w->height - 1; + w->widgets[WIDX_SCENERY_TAB_CONTENT_PANEL].right = windowWidth - 1; + w->widgets[WIDX_SCENERY_TAB_CONTENT_PANEL].bottom = w->height - 1; + w->widgets[WIDX_SCENERY_TITLE].right = windowWidth - 2; + w->widgets[WIDX_SCENERY_CLOSE].left = windowWidth - 13; + w->widgets[WIDX_SCENERY_CLOSE].right = w->widgets[WIDX_SCENERY_CLOSE].left + 10; + w->widgets[WIDX_SCENERY_LIST].right = windowWidth - 26; + w->widgets[WIDX_SCENERY_LIST].bottom = w->height - 14; - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].left = w->width - 19; - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].left = w->width - 19; - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].left = w->width - 19; - window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].right = w->width - 8; - window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].right = w->width - 8; - window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].right = w->width - 8; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].left = windowWidth - 25; + w->widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].left = windowWidth - 25; + w->widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].left = windowWidth - 25; + w->widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].left = windowWidth - 25; + w->widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].right = windowWidth - 2; + w->widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].right = windowWidth - 2; + w->widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].right = windowWidth - 2; + w->widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].right = windowWidth - 2; + + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].left = windowWidth - 19; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].left = windowWidth - 19; + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].left = windowWidth - 19; + w->widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].right = windowWidth - 8; + w->widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].right = windowWidth - 8; + w->widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].right = windowWidth - 8; +} + +static std::pair window_scenery_get_name_and_price(ScenerySelection selectedScenery) +{ + rct_string_id name = STR_UNKNOWN_OBJECT_TYPE; + money32 price = MONEY32_UNDEFINED; + if (selectedScenery.IsUndefined() && gSceneryPlaceCost != MONEY32_UNDEFINED) + { + price = gSceneryPlaceCost; + } + else + { + switch (selectedScenery.SceneryType) + { + case SCENERY_TYPE_SMALL: + { + auto* sceneryEntry = get_small_scenery_entry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price * 10; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_PATH_ITEM: + { + auto* sceneryEntry = get_footpath_item_entry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_WALL: + { + auto* sceneryEntry = get_wall_entry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_LARGE: + { + auto* sceneryEntry = get_large_scenery_entry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price * 10; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_BANNER: + { + auto* sceneryEntry = get_banner_entry(selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + } + } + return { name, price }; } /** @@ -1105,17 +1170,18 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - uint16_t tabIndex = gWindowSceneryActiveTabIndex; - uint16_t selectedWidgetId = tabIndex + 4; - uint32_t imageId = ((w->colours[1] << 19) | window_scenery_widgets[selectedWidgetId].image) + 1ul; + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex < _tabEntries.size()) + { + auto selectedWidgetId = static_cast(WIDX_SCENERY_TAB_1 + tabIndex); + uint32_t imageId = ((w->colours[1] << 19) | w->widgets[selectedWidgetId].image) + 1ul; - gfx_draw_sprite( - dpi, imageId, - w->windowPos - + ScreenCoordsXY{ window_scenery_widgets[selectedWidgetId].left, window_scenery_widgets[selectedWidgetId].top }, - selectedWidgetId); + gfx_draw_sprite( + dpi, imageId, w->windowPos + ScreenCoordsXY{ w->widgets[selectedWidgetId].left, w->widgets[selectedWidgetId].top }, + selectedWidgetId); + } - ScenerySelection selectedSceneryEntry = w->scenery.SelectedScenery; + auto selectedSceneryEntry = _selectedScenery; if (selectedSceneryEntry.IsUndefined()) { if (gWindowSceneryPaintEnabled & 1) // repaint coloured scenery tool is on @@ -1123,62 +1189,16 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) if (gWindowSceneryEyedropperEnabled) return; - selectedSceneryEntry = gWindowSceneryTabSelections[tabIndex]; - + selectedSceneryEntry = GetSelectedScenery(tabIndex); if (selectedSceneryEntry.IsUndefined()) return; } - uint32_t price = 0; - rct_string_id name = STR_UNKNOWN_OBJECT_TYPE; - switch (selectedSceneryEntry.SceneryType) - { - case SCENERY_TYPE_SMALL: - { - auto* sceneryEntry = get_small_scenery_entry(selectedSceneryEntry.EntryIndex); - price = sceneryEntry->price * 10; - name = sceneryEntry->name; - break; - } - case SCENERY_TYPE_PATH_ITEM: - { - auto* pathBitEntry = get_footpath_item_entry(selectedSceneryEntry.EntryIndex); - price = pathBitEntry->price; - name = pathBitEntry->name; - break; - } - case SCENERY_TYPE_WALL: - { - auto* wallEntry = get_wall_entry(selectedSceneryEntry.EntryIndex); - price = wallEntry->price; - name = wallEntry->name; - break; - } - case SCENERY_TYPE_LARGE: - { - auto* sceneryEntry = get_large_scenery_entry(selectedSceneryEntry.EntryIndex); - price = sceneryEntry->price * 10; - name = sceneryEntry->name; - break; - } - case SCENERY_TYPE_BANNER: - { - auto* bannerEntry = get_banner_entry(selectedSceneryEntry.EntryIndex); - price = bannerEntry->price; - name = bannerEntry->name; - break; - } - } - - if (w->scenery.SelectedScenery.IsUndefined() && gSceneryPlaceCost != MONEY32_UNDEFINED) - { - price = gSceneryPlaceCost; - } - - if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) + auto [name, price] = window_scenery_get_name_and_price(selectedSceneryEntry); + if (price != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { auto ft = Formatter(); - ft.Add(price); + ft.Add(price); // -14 DrawTextBasic( @@ -1191,29 +1211,136 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextEllipsised(dpi, { w->windowPos.x + 3, w->windowPos.y + w->height - 13 }, w->width - 19, STR_BLACK_STRING, ft); } -/** - * - * rct2: 0x006E15ED - */ +static void window_scenery_scrollpaint_item(rct_window* w, rct_drawpixelinfo* dpi, ScenerySelection scenerySelection) +{ + if (scenerySelection.SceneryType == SCENERY_TYPE_BANNER) + { + auto bannerEntry = get_banner_entry(scenerySelection.EntryIndex); + uint32_t imageId = bannerEntry->image + gWindowSceneryRotation * 2; + imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; + + gfx_draw_sprite(dpi, imageId, { 0x21, 0x28 }, w->colours[1]); + gfx_draw_sprite(dpi, imageId + 1, { 0x21, 0x28 }, w->colours[1]); + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_LARGE) + { + auto sceneryEntry = get_large_scenery_entry(scenerySelection.EntryIndex); + uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation; + imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; + imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; + + gfx_draw_sprite(dpi, imageId, { 0x21, 0 }, w->colours[1]); + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL) + { + auto wallEntry = get_wall_entry(scenerySelection.EntryIndex); + uint32_t imageId = wallEntry->image; + uint8_t tertiaryColour = w->colours[1]; + uint16_t spriteTop = (wallEntry->height * 2) + 0x32; + + if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) + { + imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; + + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; + } + gfx_draw_sprite(dpi, imageId, { 0x2F, spriteTop }, tertiaryColour); + + imageId = (wallEntry->image + 0x40000006) | (EnumValue(GlassPaletteIds[gWindowSceneryPrimaryColour]) << 19); + gfx_draw_sprite(dpi, imageId, { 0x2F, spriteTop }, tertiaryColour); + } + else + { + imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; + + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; + + if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) + { + imageId &= 0xDFFFFFFF; + tertiaryColour = gWindowSceneryTertiaryColour; + } + } + gfx_draw_sprite(dpi, imageId, { 0x2F, spriteTop }, tertiaryColour); + + if (wallEntry->flags & WALL_SCENERY_IS_DOOR) + { + gfx_draw_sprite(dpi, imageId + 1, { 0x2F, spriteTop }, tertiaryColour); + } + } + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_PATH_ITEM) + { + auto* pathBitEntry = get_footpath_item_entry(scenerySelection.EntryIndex); + uint32_t imageId = pathBitEntry->image; + + gfx_draw_sprite(dpi, imageId, { 0x0B, 0x10 }, w->colours[1]); + } + else + { + auto sceneryEntry = get_small_scenery_entry(scenerySelection.EntryIndex); + uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation; + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + { + imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + { + imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; + } + } + + uint16_t spriteTop = (sceneryEntry->height / 4) + 0x2B; + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + { + spriteTop -= 0x0C; + } + + gfx_draw_sprite(dpi, imageId, { 0x20, spriteTop }, w->colours[1]); + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) + { + imageId = ((sceneryEntry->image + gWindowSceneryRotation) + 0x40000004) + + (EnumValue(GlassPaletteIds[gWindowSceneryPrimaryColour]) << 19); + + gfx_draw_sprite(dpi, imageId, { 0x20, spriteTop }, w->colours[1]); + } + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) + { + imageId = (sceneryEntry->image + gWindowSceneryRotation) + 4; + gfx_draw_sprite(dpi, imageId, { 0x20, spriteTop }, w->colours[1]); + } + } +} + void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) { gfx_clear(dpi, ColourMapA[w->colours[1]].mid_light); - uint8_t tabIndex = gWindowSceneryActiveTabIndex; + auto numColumns = window_scenery_get_num_columns(w); + auto tabIndex = gWindowSceneryActiveTabIndex; + if (tabIndex > _tabEntries.size()) + { + return; + } ScreenCoordsXY topLeft{ 0, 0 }; - for (int32_t sceneryTabItemIndex = 0; sceneryTabItemIndex < SCENERY_ENTRIES_PER_TAB + 1; ++sceneryTabItemIndex) + const auto& tabInfo = _tabEntries[tabIndex]; + for (size_t sceneryTabItemIndex = 0; sceneryTabItemIndex < tabInfo.Entries.size(); sceneryTabItemIndex++) { - ScenerySelection currentSceneryGlobal = window_scenery_tab_entries[tabIndex][sceneryTabItemIndex]; - if (currentSceneryGlobal.IsUndefined()) - break; - - ScenerySelection tabSelectedScenery = gWindowSceneryTabSelections[tabIndex]; - + const auto& currentSceneryGlobal = tabInfo.Entries[sceneryTabItemIndex]; + auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (gWindowSceneryPaintEnabled == 1 || gWindowSceneryEyedropperEnabled) { - if (w->scenery.SelectedScenery == currentSceneryGlobal) + if (_selectedScenery == currentSceneryGlobal) { gfx_fill_rect_inset( dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, @@ -1228,7 +1355,7 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, w->colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT)); } - else if (w->scenery.SelectedScenery == currentSceneryGlobal) + else if (_selectedScenery == currentSceneryGlobal) { gfx_fill_rect_inset( dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, @@ -1240,116 +1367,11 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s if (clip_drawpixelinfo( &clipdpi, dpi, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2)) { - if (currentSceneryGlobal.SceneryType == SCENERY_TYPE_BANNER) - { - auto* bannerEntry = get_banner_entry(currentSceneryGlobal.EntryIndex); - uint32_t imageId = bannerEntry->image + gWindowSceneryRotation * 2; - imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - - gfx_draw_sprite(&clipdpi, imageId, { 0x21, 0x28 }, w->colours[1]); - gfx_draw_sprite(&clipdpi, imageId + 1, { 0x21, 0x28 }, w->colours[1]); - } - else if (currentSceneryGlobal.SceneryType == SCENERY_TYPE_LARGE) - { - auto* sceneryEntry = get_large_scenery_entry(currentSceneryGlobal.EntryIndex); - uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation; - imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; - - gfx_draw_sprite(&clipdpi, imageId, { 0x21, 0 }, w->colours[1]); - } - else if (currentSceneryGlobal.SceneryType == SCENERY_TYPE_WALL) - { - auto* wallEntry = get_wall_entry(currentSceneryGlobal.EntryIndex); - uint32_t imageId = wallEntry->image; - uint8_t tertiaryColour = w->colours[1]; - uint16_t spriteTop = (wallEntry->height * 2) + 0x32; - - if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) - { - imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) - { - imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; - } - gfx_draw_sprite(&clipdpi, imageId, { 0x2F, spriteTop }, tertiaryColour); - - imageId = (wallEntry->image + 0x40000006) | (EnumValue(GlassPaletteIds[gWindowSceneryPrimaryColour]) << 19); - gfx_draw_sprite(&clipdpi, imageId, { 0x2F, spriteTop }, tertiaryColour); - } - else - { - imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) - { - imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; - - if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) - { - imageId &= 0xDFFFFFFF; - tertiaryColour = gWindowSceneryTertiaryColour; - } - } - gfx_draw_sprite(&clipdpi, imageId, { 0x2F, spriteTop }, tertiaryColour); - - if (wallEntry->flags & WALL_SCENERY_IS_DOOR) - { - gfx_draw_sprite(&clipdpi, imageId + 1, { 0x2F, spriteTop }, tertiaryColour); - } - } - } - else if (currentSceneryGlobal.SceneryType == SCENERY_TYPE_PATH_ITEM) - { - auto* pathBitEntry = get_footpath_item_entry(currentSceneryGlobal.EntryIndex); - uint32_t imageId = pathBitEntry->image; - - gfx_draw_sprite(&clipdpi, imageId, { 0x0B, 0x10 }, w->colours[1]); - } - else - { - auto* sceneryEntry = get_small_scenery_entry(currentSceneryGlobal.EntryIndex); - uint32_t imageId = sceneryEntry->image + gWindowSceneryRotation; - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) - { - imageId |= (gWindowSceneryPrimaryColour << 19) | IMAGE_TYPE_REMAP; - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) - { - imageId |= (gWindowScenerySecondaryColour << 24) | IMAGE_TYPE_REMAP_2_PLUS; - } - } - - uint16_t spriteTop = (sceneryEntry->height / 4) + 0x2B; - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) - && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) - { - spriteTop -= 0x0C; - } - - gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) - { - imageId = ((sceneryEntry->image + gWindowSceneryRotation) + 0x40000004) - + (EnumValue(GlassPaletteIds[gWindowSceneryPrimaryColour]) << 19); - - gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); - } - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) - { - imageId = (sceneryEntry->image + gWindowSceneryRotation) + 4; - gfx_draw_sprite(&clipdpi, imageId, { 0x20, spriteTop }, w->colours[1]); - } - } + window_scenery_scrollpaint_item(w, &clipdpi, currentSceneryGlobal); } topLeft.x += SCENERY_BUTTON_WIDTH; - if (topLeft.x >= 594) + if (topLeft.x >= numColumns * SCENERY_BUTTON_WIDTH) { topLeft.y += SCENERY_BUTTON_HEIGHT; topLeft.x = 0; @@ -1357,36 +1379,20 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s } } -static int32_t window_scenery_find_tab_with_scenery(const ScenerySelection& scenery) -{ - for (int32_t i = 0; i < SCENERY_WINDOW_TABS; i++) - { - for (int32_t j = 0; j < SCENERY_ENTRIES_PER_TAB; j++) - { - ScenerySelection entry = window_scenery_tab_entries[i][j]; - if (entry.IsUndefined()) - break; - if (entry == scenery) - return i; - } - } - return -1; -} - bool window_scenery_set_selected_item(const ScenerySelection& scenery) { bool result = false; rct_window* w = window_bring_to_front_by_class(WC_SCENERY); if (w != nullptr) { - int32_t tabIndex = window_scenery_find_tab_with_scenery(scenery); - if (tabIndex != -1) + auto tabIndex = window_scenery_find_tab_with_scenery(scenery); + if (tabIndex) { - gWindowSceneryActiveTabIndex = tabIndex; - gWindowSceneryTabSelections[tabIndex] = scenery; + gWindowSceneryActiveTabIndex = *tabIndex; + SetSelectedScenery(*tabIndex, scenery); OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, context_get_width() / 2); - w->scenery.hover_counter = -16; + _hoverCounter = -16; gSceneryPlaceCost = MONEY32_UNDEFINED; w->Invalidate(); result = true; @@ -1398,8 +1404,5 @@ bool window_scenery_set_selected_item(const ScenerySelection& scenery) // Used after removing objects, in order to avoid crashes. void window_scenery_reset_selected_scenery_items() { - for (size_t i = 0; i < SCENERY_WINDOW_TABS; i++) - { - gWindowSceneryTabSelections[i].SetUndefined(); - } + gWindowSceneryTabSelections.clear(); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 01e01ecda7..2bb0b19327 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1725,13 +1725,11 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos return; } - ScenerySelection selectedTab = gWindowSceneryTabSelections[gWindowSceneryActiveTabIndex]; + auto selectedTab = gWindowSceneryTabSelections.size() > gWindowSceneryActiveTabIndex + ? gWindowSceneryTabSelections[gWindowSceneryActiveTabIndex] + : ScenerySelection{}; uint8_t sceneryType = selectedTab.SceneryType; uint16_t selectedScenery = selectedTab.EntryIndex; - - if (selectedTab.IsUndefined()) - return; - CoordsXY gridPos; switch (sceneryType) @@ -2623,8 +2621,12 @@ static void top_toolbar_tool_update_scenery(const ScreenCoordsXY& screenPos) if (gWindowSceneryEyedropperEnabled) return; - ScenerySelection selection = gWindowSceneryTabSelections[gWindowSceneryActiveTabIndex]; - + if (gWindowSceneryActiveTabIndex >= gWindowSceneryTabSelections.size()) + { + scenery_remove_ghost_tool_placement(); + return; + } + const auto& selection = gWindowSceneryTabSelections[gWindowSceneryActiveTabIndex]; if (selection.IsUndefined()) { scenery_remove_ghost_tool_placement(); diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 408e5bda6c..b0fbad775e 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -23,8 +23,8 @@ struct Vehicle; enum class GuestListFilterType : int32_t; enum class ScatterToolDensity : uint8_t; -extern ScenerySelection gWindowSceneryTabSelections[]; -extern uint8_t gWindowSceneryActiveTabIndex; +extern std::vector gWindowSceneryTabSelections; +extern size_t gWindowSceneryActiveTabIndex; extern bool gWindowSceneryScatterEnabled; extern uint16_t gWindowSceneryScatterSize; extern ScatterToolDensity gWindowSceneryScatterDensity; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index f6fbbba70c..ec92b3e0e3 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -309,12 +309,6 @@ struct ride_variables int32_t var_486; }; -struct scenery_variables -{ - ScenerySelection SelectedScenery; - int16_t hover_counter; -}; - struct track_list_variables { bool track_list_being_updated; @@ -525,9 +519,9 @@ enum #define WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE 29 #define WC_RIDE_CONSTRUCTION__WIDX_EXIT 30 #define WC_RIDE_CONSTRUCTION__WIDX_ROTATE 32 -#define WC_SCENERY__WIDX_SCENERY_TAB_1 4 -#define WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON 25 -#define WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON 30 +#define WC_SCENERY__WIDX_SCENERY_TAB_1 12 +#define WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON 5 +#define WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON 10 #define WC_PEEP__WIDX_PATROL 10 #define WC_PEEP__WIDX_ACTION_LBL 13 #define WC_PEEP__WIDX_PICKUP 14 diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 56dab05199..3392bd0bda 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -63,7 +63,6 @@ struct rct_window news_variables news; map_variables map; ride_variables ride; - scenery_variables scenery; track_list_variables track_list; error_variables error; void* custom_info; diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 1f61117c87..451398b638 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -26,6 +26,7 @@ #include "Climate.h" #include "Footpath.h" #include "Fountain.h" +#include "LargeScenery.h" #include "Map.h" #include "Park.h" #include "SmallScenery.h" @@ -52,6 +53,8 @@ int16_t gSceneryCtrlPressZ; money64 gClearSceneryCost; +static std::vector _restrictedScenery; + // rct2: 0x009A3E74 const CoordsXY SceneryQuadrantOffsets[] = { { 7, 7 }, { 7, 23 }, { 23, 23 }, { 23, 7 } }; @@ -280,3 +283,111 @@ int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry) { return (wallEntry->flags2 & WALL_SCENERY_2_DOOR_SOUND_MASK) >> WALL_SCENERY_2_DOOR_SOUND_SHIFT; } + +bool IsSceneryAvailableToBuild(ScenerySelection item) +{ + if (!gCheatsIgnoreResearchStatus) + { + if (!scenery_is_invented(item)) + { + return false; + } + } + + if (!gCheatsSandboxMode) + { + if (IsSceneryItemRestricted(item)) + { + return false; + } + } + + return true; +} + +static size_t GetMaxObjectsForSceneryType(uint8_t sceneryType) +{ + switch (sceneryType) + { + case SCENERY_TYPE_SMALL: + return MAX_SMALL_SCENERY_OBJECTS; + case SCENERY_TYPE_PATH_ITEM: + return MAX_PATH_ADDITION_OBJECTS; + case SCENERY_TYPE_WALL: + return MAX_WALL_SCENERY_OBJECTS; + case SCENERY_TYPE_LARGE: + return MAX_LARGE_SCENERY_OBJECTS; + case SCENERY_TYPE_BANNER: + return MAX_BANNER_OBJECTS; + default: + return 0; + } +} + +static SceneryEntryBase* GetSceneryEntry(ScenerySelection item) +{ + switch (item.SceneryType) + { + case SCENERY_TYPE_SMALL: + return get_small_scenery_entry(item.EntryIndex); + case SCENERY_TYPE_PATH_ITEM: + return get_footpath_item_entry(item.EntryIndex); + case SCENERY_TYPE_WALL: + return get_wall_entry(item.EntryIndex); + case SCENERY_TYPE_LARGE: + return get_large_scenery_entry(item.EntryIndex); + case SCENERY_TYPE_BANNER: + return get_banner_entry(item.EntryIndex); + default: + return nullptr; + } +} + +bool IsSceneryItemRestricted(ScenerySelection item) +{ + auto it = std::find(_restrictedScenery.begin(), _restrictedScenery.end(), item); + return it != _restrictedScenery.end(); +} + +void ClearRestrictedScenery() +{ + _restrictedScenery.clear(); +} + +std::vector& GetRestrictedScenery() +{ + return _restrictedScenery; +} + +void RestrictAllMiscScenery() +{ + std::vector nonMiscScenery; + for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) + { + auto sgEntry = get_scenery_group_entry(i); + if (sgEntry != nullptr) + { + for (size_t j = 0; j < sgEntry->entry_count; j++) + { + nonMiscScenery.push_back(sgEntry->scenery_entries[j]); + } + } + } + for (uint8_t sceneryType = SCENERY_TYPE_SMALL; sceneryType < SCENERY_TYPE_COUNT; sceneryType++) + { + auto maxObjects = GetMaxObjectsForSceneryType(sceneryType); + for (ObjectEntryIndex i = 0; i < maxObjects; i++) + { + ScenerySelection sceneryItem = { sceneryType, i }; + auto sceneryEntry = GetSceneryEntry(sceneryItem); + if (sceneryEntry != nullptr) + { + auto it = std::find(nonMiscScenery.begin(), nonMiscScenery.end(), sceneryItem); + if (it == nonMiscScenery.end()) + { + _restrictedScenery.push_back(sceneryItem); + } + } + } + } +} diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index 03e1aca011..93ebebb187 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -294,3 +294,10 @@ PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex); rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); + +bool IsSceneryAvailableToBuild(ScenerySelection item); + +bool IsSceneryItemRestricted(ScenerySelection item); +void ClearRestrictedScenery(); +void RestrictAllMiscScenery(); +std::vector& GetRestrictedScenery(); diff --git a/src/openrct2/world/ScenerySelection.h b/src/openrct2/world/ScenerySelection.h index 7c3a7a83b2..716298b596 100644 --- a/src/openrct2/world/ScenerySelection.h +++ b/src/openrct2/world/ScenerySelection.h @@ -18,26 +18,16 @@ constexpr auto WINDOW_SCENERY_TAB_SELECTION_UNDEFINED = std::numeric_limits Date: Fri, 1 Oct 2021 11:52:16 +0100 Subject: [PATCH 505/681] Add const where possible --- src/openrct2-ui/windows/Scenery.cpp | 123 ++++++++++++++-------------- src/openrct2/world/Scenery.cpp | 22 +++-- src/openrct2/world/Scenery.h | 4 +- 3 files changed, 72 insertions(+), 77 deletions(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 26a447d234..66294115f8 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -87,7 +87,7 @@ 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); -static rct_widget window_scenery_widgets[] = { +static rct_widget WindowSceneryBaseWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WINDOW_SCENERY_WIDTH, WINDOW_SCENERY_HEIGHT), MakeWidget ({ 0, 43}, {634, 99}, WindowWidgetType::Resize, WindowColour::Secondary ), // 8 0x009DE2C8 MakeWidget ({ 2, 47}, {607, 80}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // 1000000 0x009DE418 @@ -114,13 +114,12 @@ struct SceneryTabInfo return SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL; } - bool Contains(ScenerySelection entry) const + bool Contains(const ScenerySelection& entry) const { - auto it = std::find(Entries.begin(), Entries.end(), entry); - return it != Entries.end(); + return std::find(std::begin(Entries), std::end(Entries), entry) != std::end(Entries); } - void AddEntry(ScenerySelection entry) + void AddEntry(const ScenerySelection& entry) { if (!Contains(entry)) { @@ -148,7 +147,7 @@ static std::vector _widgets; static ScenerySelection _selectedScenery; static int16_t _hoverCounter; -static ScenerySelection GetSelectedScenery(size_t tabIndex) +static const ScenerySelection GetSelectedScenery(const size_t tabIndex) { if (gWindowSceneryTabSelections.size() > tabIndex) { @@ -157,7 +156,7 @@ static ScenerySelection GetSelectedScenery(size_t tabIndex) return {}; } -static void SetSelectedScenery(size_t tabIndex, ScenerySelection value) +static void SetSelectedScenery(const size_t tabIndex, const ScenerySelection& value) { if (gWindowSceneryTabSelections.size() <= tabIndex) { @@ -166,7 +165,7 @@ static void SetSelectedScenery(size_t tabIndex, ScenerySelection value) gWindowSceneryTabSelections[tabIndex] = value; } -static SceneryTabInfo* GetSceneryTabInfoForGroup(ObjectEntryIndex sceneryGroupIndex) +static SceneryTabInfo* GetSceneryTabInfoForGroup(const ObjectEntryIndex sceneryGroupIndex) { if (sceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) { @@ -187,30 +186,27 @@ static std::optional window_scenery_find_tab_with_scenery(const SceneryS for (size_t i = 0; i < _tabEntries.size(); i++) { const auto& tabInfo = _tabEntries[i]; - for (const auto& entry : tabInfo.Entries) + if (tabInfo.Contains(scenery)) { - if (entry == scenery) - { - return i; - } + return i; } } - return {}; + return std::nullopt; } -static void init_scenery_entry(const ScenerySelection& selection, ObjectEntryIndex sceneryGroupIndex) +static void init_scenery_entry(const ScenerySelection& selection, const ObjectEntryIndex sceneryGroupIndex) { Guard::ArgumentInRange(selection.EntryIndex, 0, OBJECT_ENTRY_INDEX_NULL); if (IsSceneryAvailableToBuild(selection)) { // Get current tab - auto tabIndex = window_scenery_find_tab_with_scenery(selection); + const auto tabIndex = window_scenery_find_tab_with_scenery(selection); // Add scenery to primary group (usually trees or path additions) if (sceneryGroupIndex != OBJECT_ENTRY_INDEX_NULL) { - auto tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); + auto* tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); if (tabInfo != nullptr) { tabInfo->AddEntry(selection); @@ -219,9 +215,9 @@ static void init_scenery_entry(const ScenerySelection& selection, ObjectEntryInd } // If scenery is no tab, add it to misc - if (!tabIndex) + if (!tabIndex.has_value()) { - auto tabInfo = GetSceneryTabInfoForGroup(OBJECT_ENTRY_INDEX_NULL); + auto* tabInfo = GetSceneryTabInfoForGroup(OBJECT_ENTRY_INDEX_NULL); if (tabInfo != nullptr) { tabInfo->AddEntry(selection); @@ -241,16 +237,17 @@ static void window_scenery_sort_tabs() if (b.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) return true; - auto entryA = a.GetSceneryGroupEntry(); - auto entryB = b.GetSceneryGroupEntry(); + const auto* entryA = a.GetSceneryGroupEntry(); + const auto* entryB = b.GetSceneryGroupEntry(); return entryA->priority < entryB->priority; }); } static void window_scenery_prepare_widgets(rct_window* w) { + // Add the base widgets _widgets.clear(); - for (const auto& widget : window_scenery_widgets) + for (const auto& widget : WindowSceneryBaseWidgets) { _widgets.push_back(widget); } @@ -272,7 +269,7 @@ static void window_scenery_prepare_widgets(rct_window* w) } else { - auto sceneryGroupEntry = get_scenery_group_entry(tabInfo.SceneryGroupIndex); + const auto* sceneryGroupEntry = get_scenery_group_entry(tabInfo.SceneryGroupIndex); if (sceneryGroupEntry != nullptr) { widget.image = sceneryGroupEntry->image | IMAGE_TYPE_REMAP; @@ -314,7 +311,7 @@ static void window_scenery_init(rct_window* w) tabInfo.SceneryGroupIndex = scenerySetIndex; for (size_t i = 0; i < sceneryGroupEntry->entry_count; i++) { - auto sceneryEntry = sceneryGroupEntry->scenery_entries[i]; + const auto& sceneryEntry = sceneryGroupEntry->scenery_entries[i]; if (IsSceneryAvailableToBuild(sceneryEntry)) { tabInfo.Entries.push_back(sceneryEntry); @@ -393,7 +390,7 @@ static void window_scenery_init(rct_window* w) void window_scenery_init() { - auto w = window_find_by_class(WC_SCENERY); + auto* w = window_find_by_class(WC_SCENERY); if (w != nullptr) { window_scenery_init(w); @@ -424,7 +421,7 @@ void window_scenery_set_default_placement_configuration() rct_window* window_scenery_open() { // Check if window is already open - auto window = window_bring_to_front_by_class(WC_SCENERY); + auto* window = window_bring_to_front_by_class(WC_SCENERY); if (window != nullptr) return window; @@ -457,10 +454,10 @@ rct_window* window_scenery_open() return window; } -static int32_t window_scenery_get_num_columns(rct_window* w) +static int32_t window_scenery_get_num_columns(const rct_window* w) { const auto* listWidget = &w->widgets[WIDX_SCENERY_LIST]; - auto contentWidth = listWidget->width() - SCROLLBAR_WIDTH; + const auto contentWidth = listWidget->width() - SCROLLBAR_WIDTH; return contentWidth / SCENERY_BUTTON_WIDTH; } @@ -481,23 +478,23 @@ void window_scenery_close(rct_window* w) tool_cancel(); } -template constexpr static T window_scenery_count_rows(rct_window* w, T items) +template constexpr static T window_scenery_count_rows(const rct_window* w, T items) { - auto rows = items / window_scenery_get_num_columns(w); + const auto rows = items / window_scenery_get_num_columns(w); return rows; } -static size_t window_scenery_count_rows(rct_window* w) +static size_t window_scenery_count_rows(const rct_window* w) { - auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabIndex = gWindowSceneryActiveTabIndex; if (tabIndex >= _tabEntries.size()) { return 0; } - auto totalItems = _tabEntries[tabIndex].Entries.size(); - auto numColumns = window_scenery_get_num_columns(w); - auto rows = window_scenery_count_rows(w, totalItems + numColumns - 1); + const auto totalItems = _tabEntries[tabIndex].Entries.size(); + const auto numColumns = window_scenery_get_num_columns(w); + const auto rows = window_scenery_count_rows(w, totalItems + numColumns - 1); return rows; } @@ -508,10 +505,10 @@ struct scenery_item ScenerySelection scenerySelection; }; -static scenery_item window_scenery_count_rows_with_selected_item(rct_window* w, size_t tabIndex) +static scenery_item window_scenery_count_rows_with_selected_item(rct_window* w, const size_t tabIndex) { scenery_item sceneryItem = { 0, 0, ScenerySelection() }; - const auto& scenerySelection = GetSelectedScenery(tabIndex); + const auto scenerySelection = GetSelectedScenery(tabIndex); const auto& tabInfo = _tabEntries[tabIndex]; for (size_t i = 0; i < tabInfo.Entries.size(); i++) { @@ -526,7 +523,7 @@ static scenery_item window_scenery_count_rows_with_selected_item(rct_window* w, return sceneryItem; } -static int32_t window_scenery_rows_height(size_t rows) +static int32_t window_scenery_rows_height(const size_t rows) { return static_cast(rows * SCENERY_BUTTON_HEIGHT); } @@ -591,23 +588,23 @@ static void window_scenery_mouseup(rct_window* w, rct_widgetindex widgetIndex) */ void window_scenery_update_scroll(rct_window* w) { - auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabIndex = gWindowSceneryActiveTabIndex; if (tabIndex >= _tabEntries.size()) { return; } - int32_t listHeight = w->height - 14 - w->widgets[WIDX_SCENERY_LIST].top - 1; + const int32_t listHeight = w->height - 14 - w->widgets[WIDX_SCENERY_LIST].top - 1; - scenery_item sceneryItem = window_scenery_count_rows_with_selected_item(w, tabIndex); + const auto sceneryItem = window_scenery_count_rows_with_selected_item(w, tabIndex); w->scrolls[0].v_bottom = window_scenery_rows_height(sceneryItem.allRows) + 1; - int32_t maxTop = std::max(0, w->scrolls[0].v_bottom - listHeight); + const int32_t maxTop = std::max(0, w->scrolls[0].v_bottom - listHeight); auto rowSelected = window_scenery_count_rows(w, sceneryItem.selected_item); if (sceneryItem.scenerySelection.IsUndefined()) { rowSelected = 0; - auto& scenery = _tabEntries[tabIndex].Entries[0]; + const auto& scenery = _tabEntries[tabIndex].Entries[0]; if (!scenery.IsUndefined()) { SetSelectedScenery(tabIndex, scenery); @@ -758,12 +755,12 @@ static void window_scenery_update(rct_window* w) else { const auto& listWidget = w->widgets[WIDX_SCENERY_LIST]; - auto nonListHeight = w->height - listWidget.height() + 2; + const auto nonListHeight = w->height - listWidget.height() + 2; - auto numRows = static_cast(window_scenery_count_rows(w)); - auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; - auto maxWindowHeight = maxContentHeight + nonListHeight; - auto windowHeight = std::clamp(maxWindowHeight, WINDOW_SCENERY_HEIGHT, 463); + const auto numRows = static_cast(window_scenery_count_rows(w)); + const auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; + const auto maxWindowHeight = maxContentHeight + nonListHeight; + const auto windowHeight = std::clamp(maxWindowHeight, WINDOW_SCENERY_HEIGHT, 463); w->min_width = WINDOW_SCENERY_WIDTH; w->max_width = WINDOW_SCENERY_WIDTH; @@ -803,8 +800,8 @@ static void window_scenery_update(rct_window* w) } else { - auto tabIndex = gWindowSceneryActiveTabIndex; - auto tabSelectedScenery = GetSelectedScenery(tabIndex); + const auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) @@ -845,13 +842,13 @@ static ScenerySelection get_scenery_id_by_cursor_pos(rct_window* w, const Screen { ScenerySelection scenery{}; - auto numColumns = window_scenery_get_num_columns(w); - auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH; - auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT; + const auto numColumns = window_scenery_get_num_columns(w); + const auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH; + const auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT; if (colIndex >= 0 && colIndex < numColumns && rowIndex >= 0) { - auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); - auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); + const auto tabIndex = gWindowSceneryActiveTabIndex; if (tabIndex < _tabEntries.size()) { auto& tabInfo = _tabEntries[tabIndex]; @@ -870,7 +867,7 @@ static ScenerySelection get_scenery_id_by_cursor_pos(rct_window* w, const Screen */ void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - ScenerySelection scenery = get_scenery_id_by_cursor_pos(w, screenCoords); + const auto scenery = get_scenery_id_by_cursor_pos(w, screenCoords); if (scenery.IsUndefined()) return; @@ -906,7 +903,7 @@ OpenRCT2String window_scenery_tooltip(rct_window* w, const rct_widgetindex widge { if (widgetIndex >= WIDX_SCENERY_TAB_1) { - auto tabIndex = static_cast(widgetIndex - WIDX_SCENERY_TAB_1); + const auto tabIndex = static_cast(widgetIndex - WIDX_SCENERY_TAB_1); if (_tabEntries.size() > tabIndex) { const auto& tabInfo = _tabEntries[tabIndex]; @@ -917,7 +914,7 @@ OpenRCT2String window_scenery_tooltip(rct_window* w, const rct_widgetindex widge return { fallback, ft }; } - auto sceneryEntry = tabInfo.GetSceneryGroupEntry(); + const auto* sceneryEntry = tabInfo.GetSceneryGroupEntry(); if (sceneryEntry != nullptr) { auto ft = Formatter(); @@ -937,7 +934,7 @@ void window_scenery_invalidate(rct_window* w) { // Set the window title rct_string_id titleStringId = STR_MISCELLANEOUS; - auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabIndex = gWindowSceneryActiveTabIndex; if (tabIndex < _tabEntries.size()) { const auto& tabInfo = _tabEntries[tabIndex]; @@ -967,7 +964,7 @@ void window_scenery_invalidate(rct_window* w) w->widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; } - auto tabSelectedScenery = GetSelectedScenery(tabIndex); + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) @@ -1061,7 +1058,7 @@ void window_scenery_invalidate(rct_window* w) auto windowWidth = w->width; if (_tabEntries.size() > 0) { - auto lastTabIndex = _tabEntries.size() - 1; + const auto lastTabIndex = _tabEntries.size() - 1; const auto lastTabWidget = &w->widgets[WIDX_SCENERY_TAB_1 + lastTabIndex]; windowWidth = std::max(windowWidth, lastTabWidget->right + 3); } @@ -1170,7 +1167,7 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) { WindowDrawWidgets(w, dpi); - auto tabIndex = gWindowSceneryActiveTabIndex; + const auto tabIndex = gWindowSceneryActiveTabIndex; if (tabIndex < _tabEntries.size()) { auto selectedWidgetId = static_cast(WIDX_SCENERY_TAB_1 + tabIndex); @@ -1337,7 +1334,7 @@ void window_scenery_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t s for (size_t sceneryTabItemIndex = 0; sceneryTabItemIndex < tabInfo.Entries.size(); sceneryTabItemIndex++) { const auto& currentSceneryGlobal = tabInfo.Entries[sceneryTabItemIndex]; - auto tabSelectedScenery = GetSelectedScenery(tabIndex); + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (gWindowSceneryPaintEnabled == 1 || gWindowSceneryEyedropperEnabled) { if (_selectedScenery == currentSceneryGlobal) diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 451398b638..79a1428531 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -284,7 +284,7 @@ int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry) return (wallEntry->flags2 & WALL_SCENERY_2_DOOR_SOUND_MASK) >> WALL_SCENERY_2_DOOR_SOUND_SHIFT; } -bool IsSceneryAvailableToBuild(ScenerySelection item) +bool IsSceneryAvailableToBuild(const ScenerySelection& item) { if (!gCheatsIgnoreResearchStatus) { @@ -305,7 +305,7 @@ bool IsSceneryAvailableToBuild(ScenerySelection item) return true; } -static size_t GetMaxObjectsForSceneryType(uint8_t sceneryType) +static size_t GetMaxObjectsForSceneryType(const uint8_t sceneryType) { switch (sceneryType) { @@ -324,7 +324,7 @@ static size_t GetMaxObjectsForSceneryType(uint8_t sceneryType) } } -static SceneryEntryBase* GetSceneryEntry(ScenerySelection item) +static SceneryEntryBase* GetSceneryEntry(const ScenerySelection& item) { switch (item.SceneryType) { @@ -343,10 +343,9 @@ static SceneryEntryBase* GetSceneryEntry(ScenerySelection item) } } -bool IsSceneryItemRestricted(ScenerySelection item) +bool IsSceneryItemRestricted(const ScenerySelection& item) { - auto it = std::find(_restrictedScenery.begin(), _restrictedScenery.end(), item); - return it != _restrictedScenery.end(); + return std::find(std::begin(_restrictedScenery), std::end(_restrictedScenery), item) != std::end(_restrictedScenery); } void ClearRestrictedScenery() @@ -364,7 +363,7 @@ void RestrictAllMiscScenery() std::vector nonMiscScenery; for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - auto sgEntry = get_scenery_group_entry(i); + const auto* sgEntry = get_scenery_group_entry(i); if (sgEntry != nullptr) { for (size_t j = 0; j < sgEntry->entry_count; j++) @@ -375,15 +374,14 @@ void RestrictAllMiscScenery() } for (uint8_t sceneryType = SCENERY_TYPE_SMALL; sceneryType < SCENERY_TYPE_COUNT; sceneryType++) { - auto maxObjects = GetMaxObjectsForSceneryType(sceneryType); + const auto maxObjects = GetMaxObjectsForSceneryType(sceneryType); for (ObjectEntryIndex i = 0; i < maxObjects; i++) { - ScenerySelection sceneryItem = { sceneryType, i }; - auto sceneryEntry = GetSceneryEntry(sceneryItem); + const ScenerySelection sceneryItem = { sceneryType, i }; + const auto* sceneryEntry = GetSceneryEntry(sceneryItem); if (sceneryEntry != nullptr) { - auto it = std::find(nonMiscScenery.begin(), nonMiscScenery.end(), sceneryItem); - if (it == nonMiscScenery.end()) + if (std::find(std::begin(nonMiscScenery), std::end(nonMiscScenery), sceneryItem) == std::end(nonMiscScenery)) { _restrictedScenery.push_back(sceneryItem); } diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index 93ebebb187..6b678e6ad1 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -295,9 +295,9 @@ rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); -bool IsSceneryAvailableToBuild(ScenerySelection item); +bool IsSceneryAvailableToBuild(const ScenerySelection& item); -bool IsSceneryItemRestricted(ScenerySelection item); +bool IsSceneryItemRestricted(const ScenerySelection& item); void ClearRestrictedScenery(); void RestrictAllMiscScenery(); std::vector& GetRestrictedScenery(); From c44d1151c24830dbcf465cab4235c81084811bd9 Mon Sep 17 00:00:00 2001 From: Bepso <84444906+Bepso@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:46:01 +0200 Subject: [PATCH 506/681] Close #13766 : Refactor Clear Scenery to class (#15481) * Add CleanScenery class --- src/openrct2-ui/interface/Window.cpp | 8 + src/openrct2-ui/interface/Window.h | 3 + src/openrct2-ui/windows/ClearScenery.cpp | 359 +++++++++++------------ 3 files changed, 175 insertions(+), 195 deletions(-) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 94ac25450c..b3134b0ea0 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -750,3 +751,10 @@ void Window::Close() { window_close(this); } + +void Window::TextInputOpen( + rct_widgetindex callWidget, rct_string_id title, rct_string_id description, const Formatter& descriptionArgs, + rct_string_id existingText, uintptr_t existingArgs, int32_t maxLength) +{ + window_text_input_open(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength); +} diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index 19b0bacc0a..d0c08351d4 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -26,6 +26,9 @@ struct Window : rct_window void SetCheckboxValue(rct_widgetindex widgetIndex, bool value); void DrawWidgets(rct_drawpixelinfo& dpi); void Close(); + void TextInputOpen( + rct_widgetindex callWidget, rct_string_id title, rct_string_id description, const Formatter& descriptionArgs, + rct_string_id existingText, uintptr_t existingArgs, int32_t maxLength); }; void WindowAllWheelInput(); diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index f870705565..35f75c7a88 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -16,8 +16,8 @@ #include #include -// clang-format off -enum WINDOW_CLEAR_SCENERY_WIDGET_IDX { +enum WINDOW_CLEAR_SCENERY_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -28,213 +28,182 @@ enum WINDOW_CLEAR_SCENERY_WIDGET_IDX { WIDX_LARGE_SCENERY, WIDX_FOOTPATH }; - +// clang-format on static constexpr const rct_string_id WINDOW_TITLE = STR_CLEAR_SCENERY; static constexpr const int32_t WW = 98; static constexpr const int32_t WH = 94; +static constexpr ScreenSize CLEAR_SCENERY_BUTTON = { 24, 24 }; + static rct_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}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_TREES, STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery - MakeRemapWidget({37, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_LARGE_SCENERY, STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery - MakeRemapWidget({67, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP), // footpaths + 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 WIDGETS_END, }; -static void window_clear_scenery_close(rct_window *w); -static void window_clear_scenery_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_clear_scenery_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_clear_scenery_update(rct_window *w); -static void window_clear_scenery_invalidate(rct_window *w); -static void window_clear_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_clear_scenery_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_clear_scenery_inputsize(rct_window *w); - -static rct_window_event_list window_clear_scenery_events([](auto& events) +class CleanSceneryWindow final : public Window { - events.close = &window_clear_scenery_close; - events.mouse_up = &window_clear_scenery_mouseup; - events.mouse_down = &window_clear_scenery_mousedown; - events.update = &window_clear_scenery_update; - events.text_input = &window_clear_scenery_textinput; - events.invalidate = &window_clear_scenery_invalidate; - events.paint = &window_clear_scenery_paint; -}); -// clang-format on +public: + void OnOpen() override + { + widgets = window_clear_scenery_widgets; + enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT) | (1ULL << WIDX_PREVIEW) + | (1ULL << WIDX_SMALL_SCENERY) | (1ULL << WIDX_LARGE_SCENERY) | (1ULL << WIDX_FOOTPATH); + hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + WindowInitScrollWidgets(this); + window_push_others_below(this); + + gLandToolSize = 2; + gClearSceneryCost = MONEY64_UNDEFINED; + + gClearSmallScenery = true; + gClearLargeScenery = false; + gClearFootpath = false; + } + + void OnClose() override + { + if (clear_scenery_tool_is_active()) + tool_cancel(); + } + + void OnMouseUp(const rct_widgetindex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PREVIEW: + { + Formatter ft; + ft.Add(MINIMUM_TOOL_SIZE); + ft.Add(MAXIMUM_TOOL_SIZE); + 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 OnMouseDown(const rct_widgetindex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_DECREMENT: + // Decrement land tool size, if it stays within the limit + gLandToolSize = std::max(MINIMUM_TOOL_SIZE, gLandToolSize - 1); + + // Invalidate the window + Invalidate(); + break; + case WIDX_INCREMENT: + // Increment land tool size, if it stays within the limit + gLandToolSize = std::min(MAXIMUM_TOOL_SIZE, gLandToolSize + 1); + + // Invalidate the window + Invalidate(); + break; + } + } + + void OnTextInput(const rct_widgetindex widgetIndex, const std::string_view text) override + { + if (widgetIndex != WIDX_PREVIEW || text.empty()) + return; + + char* end; + int32_t size = strtol(std::string(text).c_str(), &end, 10); + if (*end == '\0') + { + size = std::clamp(size, MINIMUM_TOOL_SIZE, MAXIMUM_TOOL_SIZE); + gLandToolSize = size; + Invalidate(); + } + } + + void OnUpdate() override + { + frame_no++; + // Close window if another tool is open + if (!clear_scenery_tool_is_active()) + 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 = LandTool::SizeToSpriteIndex(gLandToolSize); + } + + void OnDraw(rct_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 > MAX_TOOL_SIZE_WITH_SPRITE) + { + 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 != MONEY64_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & 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 }); + } + } +}; -/** - * - * rct2: 0x0068E0A7 - */ rct_window* window_clear_scenery_open() { - rct_window* window; + auto* w = static_cast(window_bring_to_front_by_class(WC_CLEAR_SCENERY)); - // Check if window is already open - window = window_find_by_class(WC_CLEAR_SCENERY); - if (window != nullptr) - return window; + if (w != nullptr) + return w; - window = WindowCreate( - ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, &window_clear_scenery_events, WC_CLEAR_SCENERY, 0); - window->widgets = window_clear_scenery_widgets; - window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT) - | (1ULL << WIDX_PREVIEW) | (1ULL << WIDX_SMALL_SCENERY) | (1ULL << WIDX_LARGE_SCENERY) | (1ULL << WIDX_FOOTPATH); - window->hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); - WindowInitScrollWidgets(window); - window_push_others_below(window); + w = WindowCreate(WC_CLEAR_SCENERY, WW, WH, 0); - gLandToolSize = 2; - gClearSceneryCost = MONEY64_UNDEFINED; + if (w != nullptr) + return w; - gClearSmallScenery = true; - gClearLargeScenery = false; - gClearFootpath = false; - - return window; -} - -/** - * - * rct2: 0x006E6B65 - */ -static void window_clear_scenery_close([[maybe_unused]] rct_window* w) -{ - // If the tool wasn't changed, turn tool off - if (clear_scenery_tool_is_active()) - tool_cancel(); -} - -/** - * - * rct2: 0x0068E185 - */ -static void window_clear_scenery_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_PREVIEW: - window_clear_scenery_inputsize(w); - break; - case WIDX_SMALL_SCENERY: - gClearSmallScenery ^= 1; - w->Invalidate(); - break; - case WIDX_LARGE_SCENERY: - gClearLargeScenery ^= 1; - w->Invalidate(); - break; - case WIDX_FOOTPATH: - gClearFootpath ^= 1; - w->Invalidate(); - break; - } -} - -static void window_clear_scenery_mousedown(rct_window* w, rct_widgetindex widgetIndex, [[maybe_unused]] rct_widget* widget) -{ - switch (widgetIndex) - { - case WIDX_DECREMENT: - // Decrement land tool size, if it stays within the limit - gLandToolSize = std::max(MINIMUM_TOOL_SIZE, gLandToolSize - 1); - - // Invalidate the window - w->Invalidate(); - break; - case WIDX_INCREMENT: - // Increment land tool size, if it stays within the limit - gLandToolSize = std::min(MAXIMUM_TOOL_SIZE, gLandToolSize + 1); - - // Invalidate the window - w->Invalidate(); - break; - } -} - -static void window_clear_scenery_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text) -{ - int32_t size; - char* end; - - if (widgetIndex != WIDX_PREVIEW || text == nullptr) - return; - - size = strtol(text, &end, 10); - if (*end == '\0') - { - size = std::max(MINIMUM_TOOL_SIZE, size); - size = std::min(MAXIMUM_TOOL_SIZE, size); - gLandToolSize = size; - w->Invalidate(); - } -} - -static void window_clear_scenery_inputsize(rct_window* w) -{ - Formatter ft; - ft.Add(MINIMUM_TOOL_SIZE); - ft.Add(MAXIMUM_TOOL_SIZE); - window_text_input_open(w, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); -} - -/** - * - * rct2: 0x0068E205 - */ -static void window_clear_scenery_update(rct_window* w) -{ - w->frame_no++; - // Close window if another tool is open - if (!clear_scenery_tool_is_active()) - window_close(w); -} - -/** - * - * rct2: 0x0068E115 - */ -static void window_clear_scenery_invalidate(rct_window* w) -{ - // Set the preview image button to be pressed down - w->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 = LandTool::SizeToSpriteIndex(gLandToolSize); -} - -/** - * - * rct2: 0x0068E130 - */ -static void window_clear_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - - // Draw number for tool sizes bigger than 7 - ScreenCoordsXY screenCoords = { w->windowPos.x + window_clear_scenery_widgets[WIDX_PREVIEW].midX(), - w->windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() }; - if (gLandToolSize > MAX_TOOL_SIZE_WITH_SPRITE) - { - 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 != MONEY64_UNDEFINED && gClearSceneryCost != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(gClearSceneryCost); - screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + w->windowPos.x; - screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + w->windowPos.y + 5 + 27; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); - } + return nullptr; } From d7053784f29bf8d92372b193b971ebb25835bda8 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Wed, 6 Oct 2021 13:02:19 +0100 Subject: [PATCH 507/681] Fix unresearched scenery groups showing --- src/openrct2-ui/windows/Scenery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 66294115f8..ef44da5f7a 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -305,7 +305,7 @@ static void window_scenery_init(rct_window* w) for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < maxTabs - 1; scenerySetIndex++) { const auto* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); - if (sceneryGroupEntry != nullptr) + if (sceneryGroupEntry != nullptr && scenery_group_is_invented(scenerySetIndex)) { SceneryTabInfo tabInfo; tabInfo.SceneryGroupIndex = scenerySetIndex; From a0e7752f260fdc4caff1183189df31f7a0658163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 6 Oct 2021 23:37:02 +0300 Subject: [PATCH 508/681] Pass rct_drawpixelinfo explicit to avoid races --- src/openrct2-ui/UiContext.cpp | 24 +-- .../engines/opengl/OpenGLDrawingEngine.cpp | 165 ++++++++++-------- src/openrct2/drawing/Drawing.String.cpp | 4 +- src/openrct2/drawing/IDrawingContext.h | 24 ++- src/openrct2/drawing/IDrawingEngine.h | 8 +- src/openrct2/drawing/NewDrawing.cpp | 36 ++-- src/openrct2/drawing/Weather.cpp | 48 ++--- src/openrct2/drawing/X8DrawingEngine.cpp | 66 +++---- src/openrct2/drawing/X8DrawingEngine.h | 34 ++-- src/openrct2/ui/UiContext.h | 3 +- 10 files changed, 214 insertions(+), 198 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 9031f447a1..b327da2183 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -296,7 +296,7 @@ public: for (auto& w : g_window_list) { - DrawWeatherWindow(weatherDrawer, w.get(), left, right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, w.get(), left, right, top, bottom, drawFunc); } } @@ -860,8 +860,8 @@ private: } static void DrawWeatherWindow( - IWeatherDrawer* weatherDrawer, rct_window* original_w, int16_t left, int16_t right, int16_t top, int16_t bottom, - DrawWeatherFunc drawFunc) + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, rct_window* original_w, int16_t left, int16_t right, int16_t top, + int16_t bottom, DrawWeatherFunc drawFunc) { rct_window* w{}; auto itStart = window_get_iterator(original_w); @@ -881,7 +881,7 @@ private: { auto width = right - left; auto height = bottom - top; - drawFunc(weatherDrawer, left, top, width, height); + drawFunc(dpi, weatherDrawer, left, top, width, height); } } return; @@ -903,39 +903,39 @@ private: break; } - DrawWeatherWindow(weatherDrawer, original_w, left, w->windowPos.x, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, w->windowPos.x, top, bottom, drawFunc); left = w->windowPos.x; - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, bottom, drawFunc); return; } int16_t w_right = RCT_WINDOW_RIGHT(w); if (right > w_right) { - DrawWeatherWindow(weatherDrawer, original_w, left, w_right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, w_right, top, bottom, drawFunc); left = w_right; - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, bottom, drawFunc); return; } if (top < w->windowPos.y) { - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, w->windowPos.y, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, w->windowPos.y, drawFunc); top = w->windowPos.y; - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, bottom, drawFunc); return; } int16_t w_bottom = RCT_WINDOW_BOTTOM(w); if (bottom > w_bottom) { - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, w_bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, w_bottom, drawFunc); top = w_bottom; - DrawWeatherWindow(weatherDrawer, original_w, left, right, top, bottom, drawFunc); + DrawWeatherWindow(dpi, weatherDrawer, original_w, left, right, top, bottom, drawFunc); return; } } diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index ad808f966f..9216d261d8 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -57,7 +57,6 @@ class OpenGLDrawingContext final : public IDrawingContext { private: OpenGLDrawingEngine* _engine = nullptr; - rct_drawpixelinfo* _dpi = nullptr; ApplyTransparencyShader* _applyTransparencyShader = nullptr; DrawLineShader* _drawLineShader = nullptr; DrawRectShader* _drawRectShader = nullptr; @@ -101,27 +100,25 @@ public: void ResetPalette(); void StartNewDraw(); - void Clear(uint8_t paletteIndex) override; - void FillRect(uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; - void FilterRect(FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; - void DrawLine(uint32_t colour, const ScreenLine& line) override; - void DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) override; - void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; - void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) override; - void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) override; - void DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) override; + void Clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) override; + void FillRect(rct_drawpixelinfo* dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; + void FilterRect( + rct_drawpixelinfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; + void DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line) override; + void DrawSprite(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) override; + void DrawSpriteRawMasked(rct_drawpixelinfo* dpi, int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; + void DrawSpriteSolid(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint8_t colour) override; + void DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) override; + void DrawBitmap( + rct_drawpixelinfo* dpi, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, + int32_t y) override; void FlushCommandBuffers(); void FlushLines(); void FlushRectangles(); void HandleTransparency(); - - void SetDPI(rct_drawpixelinfo* dpi); - rct_drawpixelinfo* GetDPI() const - { - return _dpi; - } + void CalculcateClipping(rct_drawpixelinfo* dpi); }; class OpenGLWeatherDrawer final : public IWeatherDrawer @@ -135,7 +132,7 @@ public: } virtual void Draw( - int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, + rct_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 { const uint8_t* pattern = weatherpattern; @@ -145,8 +142,6 @@ public: uint8_t patternStartXOffset = xStart % patternXSpace; uint8_t patternStartYOffset = yStart % patternYSpace; - const auto* dpi = _drawingContext->GetDPI(); - uint32_t pixelOffset = (dpi->pitch + dpi->width) * y + x; uint8_t patternYPos = patternStartYOffset % patternYSpace; @@ -166,7 +161,7 @@ public: int32_t pixelX = xPixelOffset % dpi->width; int32_t pixelY = (xPixelOffset / dpi->width) % dpi->height; - _drawingContext->DrawLine(patternPixel, { { pixelX, pixelY }, { pixelX + 1, pixelY + 1 } }); + _drawingContext->DrawLine(dpi, patternPixel, { { pixelX, pixelY }, { pixelX + 1, pixelY + 1 } }); } } @@ -298,6 +293,7 @@ public: assert(_screenFramebuffer != nullptr); _drawingContext->StartNewDraw(); + _drawingContext->CalculcateClipping(&_bitsDPI); } void EndDraw() override @@ -335,13 +331,16 @@ public: void PaintWindows() override { + _drawingContext->CalculcateClipping(&_bitsDPI); + window_update_all_viewports(); window_draw_all(&_bitsDPI, 0, 0, _width, _height); } void PaintWeather() override { - _drawingContext->SetDPI(&_bitsDPI); + _drawingContext->CalculcateClipping(&_bitsDPI); + DrawWeather(&_bitsDPI, &_weatherDrawer); } @@ -359,9 +358,8 @@ public: // Not applicable for this engine } - IDrawingContext* GetDrawingContext(rct_drawpixelinfo* dpi) override + IDrawingContext* GetDrawingContext() override { - _drawingContext->SetDPI(dpi); return _drawingContext; } @@ -541,13 +539,18 @@ void OpenGLDrawingContext::StartNewDraw() _swapFramebuffer->Clear(); } -void OpenGLDrawingContext::Clear(uint8_t paletteIndex) +void OpenGLDrawingContext::Clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) { - FillRect(paletteIndex, _clipLeft - _offsetX, _clipTop - _offsetY, _clipRight - _offsetX, _clipBottom - _offsetY); + CalculcateClipping(dpi); + + FillRect(dpi, paletteIndex, _clipLeft - _offsetX, _clipTop - _offsetY, _clipRight - _offsetX, _clipBottom - _offsetY); } -void OpenGLDrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) +void OpenGLDrawingContext::FillRect( + rct_drawpixelinfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) { + CalculcateClipping(dpi); + left += _offsetX; top += _offsetY; right += _offsetX; @@ -578,8 +581,11 @@ void OpenGLDrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, } } -void OpenGLDrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) +void OpenGLDrawingContext::FilterRect( + rct_drawpixelinfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) { + CalculcateClipping(dpi); + left += _offsetX; top += _offsetY; right += _offsetX; @@ -599,8 +605,10 @@ void OpenGLDrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawLine(uint32_t colour, const ScreenLine& line) +void OpenGLDrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line) { + CalculcateClipping(dpi); + DrawLineCommand& command = _commandBuffers.lines.allocate(); command.clip = { _clipLeft, _clipTop, _clipRight, _clipBottom }; @@ -609,8 +617,10 @@ void OpenGLDrawingContext::DrawLine(uint32_t colour, const ScreenLine& line) command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) +void OpenGLDrawingContext::DrawSprite(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) { + CalculcateClipping(dpi); + int32_t g1Id = image & 0x7FFFF; auto g1Element = gfx_get_g1_element(g1Id); if (g1Element == nullptr) @@ -618,20 +628,19 @@ void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint return; } - if (_dpi->zoom_level > 0) + if (dpi->zoom_level > 0) { if (g1Element->flags & G1_FLAG_HAS_ZOOM_SPRITE) { rct_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; - SetDPI(&zoomedDPI); - DrawSprite((image & 0xFFF80000) | (g1Id - g1Element->zoomed_offset), x >> 1, y >> 1, tertiaryColour); + 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, (image & 0xFFF80000) | (g1Id - g1Element->zoomed_offset), x >> 1, y >> 1, tertiaryColour); return; } if (g1Element->flags & G1_FLAG_NO_ZOOM_DRAW) @@ -644,11 +653,11 @@ void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint int32_t top = y + g1Element->y_offset; int32_t zoom_mask; - if (_dpi->zoom_level >= 0) - zoom_mask = 0xFFFFFFFF * _dpi->zoom_level; + if (dpi->zoom_level >= 0) + zoom_mask = 0xFFFFFFFF * dpi->zoom_level; else zoom_mask = 0xFFFFFFFF; - if (_dpi->zoom_level != 0 && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) + if (dpi->zoom_level != 0 && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) { top -= ~zoom_mask; } @@ -664,7 +673,7 @@ void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint int32_t right = left + g1Element->width; int32_t bottom = top + g1Element->height; - if (_dpi->zoom_level != 0 && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) + if (dpi->zoom_level != 0 && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) { bottom += top & ~zoom_mask; } @@ -678,15 +687,15 @@ void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint 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 = left / _dpi->zoom_level; - top = top / _dpi->zoom_level; - right = right / _dpi->zoom_level; - bottom = bottom / _dpi->zoom_level; + left = left / dpi->zoom_level; + top = top / dpi->zoom_level; + right = right / dpi->zoom_level; + bottom = bottom / dpi->zoom_level; left += _spriteOffset.x; top += _spriteOffset.y; @@ -759,8 +768,11 @@ void OpenGLDrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint } } -void OpenGLDrawingContext::DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) +void OpenGLDrawingContext::DrawSpriteRawMasked( + rct_drawpixelinfo* dpi, int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) { + CalculcateClipping(dpi); + auto g1ElementMask = gfx_get_g1_element(maskImage & 0x7FFFF); auto g1ElementColour = gfx_get_g1_element(colourImage & 0x7FFFF); if (g1ElementMask == nullptr || g1ElementColour == nullptr) @@ -790,15 +802,15 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t ma 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 = left / _dpi->zoom_level; - top = top / _dpi->zoom_level; - right = right / _dpi->zoom_level; - bottom = bottom / _dpi->zoom_level; + left = left / dpi->zoom_level; + top = top / dpi->zoom_level; + right = right / dpi->zoom_level; + bottom = bottom / dpi->zoom_level; left += _spriteOffset.x; top += _spriteOffset.y; @@ -819,8 +831,10 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t ma command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) +void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint8_t colour) { + CalculcateClipping(dpi); + assert((colour & 0xFF) > 0u); int32_t g1Id = image & 0x7FFFF; @@ -870,8 +884,10 @@ void OpenGLDrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) +void OpenGLDrawingContext::DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) { + CalculcateClipping(dpi); + auto g1Element = gfx_get_g1_element(image & 0x7FFFF); if (g1Element == nullptr) { @@ -894,15 +910,15 @@ void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const 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 = left / _dpi->zoom_level; - top = top / _dpi->zoom_level; - right = right / _dpi->zoom_level; - bottom = bottom / _dpi->zoom_level; + left = left / dpi->zoom_level; + top = top / dpi->zoom_level; + right = right / dpi->zoom_level; + bottom = bottom / dpi->zoom_level; left += _spriteOffset.x; top += _spriteOffset.y; @@ -923,8 +939,11 @@ void OpenGLDrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) +void OpenGLDrawingContext::DrawBitmap( + rct_drawpixelinfo* dpi, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) { + CalculcateClipping(dpi); + const auto texture = _textureCache->GetOrLoadBitmapTexture(image, pixels, width, height); int32_t drawOffsetX = 0; @@ -1041,7 +1060,7 @@ void OpenGLDrawingContext::HandleTransparency() _commandBuffers.transparent.clear(); } -void OpenGLDrawingContext::SetDPI(rct_drawpixelinfo* dpi) +void OpenGLDrawingContext::CalculcateClipping(rct_drawpixelinfo* dpi) { auto screenDPI = _engine->GetDPI(); auto bytesPerRow = screenDPI->GetBytesPerRow(); @@ -1059,8 +1078,6 @@ void OpenGLDrawingContext::SetDPI(rct_drawpixelinfo* dpi) _offsetY = _clipTop - dpi->y; _spriteOffset.x = _clipLeft - dpi->remX; _spriteOffset.y = _clipTop - dpi->remY; - - _dpi = dpi; } #endif /* DISABLE_OPENGL */ diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index e6f1df2dde..4450706156 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -578,9 +578,9 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex auto baseId = uint32_t(0x7FFFF) - 1024; auto imageId = baseId + _ttfGlId; auto drawingEngine = dpi->DrawingEngine; - auto drawingContext = drawingEngine->GetDrawingContext(dpi); + auto drawingContext = drawingEngine->GetDrawingContext(); drawingEngine->InvalidateImage(imageId); - drawingContext->DrawBitmap(imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); + drawingContext->DrawBitmap(dpi, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); _ttfGlId++; if (_ttfGlId >= 1023) diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index e8fbadc702..adff81a6d6 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -21,15 +21,21 @@ namespace OpenRCT2::Drawing virtual ~IDrawingContext() = default; virtual OpenRCT2::Drawing::IDrawingEngine* GetEngine() abstract; - virtual void Clear(uint8_t paletteIndex) abstract; - virtual void FillRect(uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; - virtual void FilterRect(FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; - virtual void DrawLine(uint32_t colour, const ScreenLine& line) abstract; - virtual void DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) abstract; - virtual void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) abstract; - virtual void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) abstract; - virtual void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) abstract; + virtual void Clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) abstract; + virtual void FillRect( + rct_drawpixelinfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; + virtual void FilterRect( + rct_drawpixelinfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; + virtual void DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line) abstract; + virtual void DrawSprite(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) abstract; + virtual void DrawSpriteRawMasked( + rct_drawpixelinfo* dpi, int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) abstract; + virtual void DrawSpriteSolid(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint8_t colour) abstract; + virtual void DrawGlyph( + rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) abstract; virtual void DrawBitmap( - uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) abstract; + rct_drawpixelinfo* dpi, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, + int32_t y) abstract; }; + } // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/IDrawingEngine.h b/src/openrct2/drawing/IDrawingEngine.h index 92e5e8b783..76552da80b 100644 --- a/src/openrct2/drawing/IDrawingEngine.h +++ b/src/openrct2/drawing/IDrawingEngine.h @@ -71,7 +71,7 @@ namespace OpenRCT2::Drawing virtual void CopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy) abstract; virtual std::string Screenshot() abstract; - virtual IDrawingContext* GetDrawingContext(rct_drawpixelinfo* dpi) abstract; + virtual IDrawingContext* GetDrawingContext() abstract; virtual rct_drawpixelinfo* GetDrawingPixelInfo() abstract; virtual DRAWING_ENGINE_FLAGS GetFlags() abstract; @@ -90,11 +90,9 @@ namespace OpenRCT2::Drawing struct IWeatherDrawer { - virtual ~IWeatherDrawer() - { - } + virtual ~IWeatherDrawer() = default; virtual void Draw( - int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, + rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, const uint8_t* weatherpattern) abstract; }; } // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index c1eb196933..ed5f8c4aee 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -165,8 +165,8 @@ void gfx_clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->Clear(paletteIndex); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->Clear(dpi, paletteIndex); } } @@ -175,8 +175,8 @@ void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colou auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->FillRect(colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->FillRect(dpi, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); } } @@ -190,8 +190,8 @@ void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPalet auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->FilterRect(palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->FilterRect(dpi, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); } } @@ -200,8 +200,8 @@ void gfx_draw_line(rct_drawpixelinfo* dpi, const ScreenLine& line, int32_t colou auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->DrawLine(colour, line); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawLine(dpi, colour, line); } } @@ -227,13 +227,13 @@ void gfx_draw_dashed_line( const int32_t lineYDist = std::abs(screenLine.GetY2() - screenLine.GetY1()); const int32_t dxPrecise = precisionFactor * lineXDist / lineSegmentCount / 2; const int32_t dyPrecise = precisionFactor * lineYDist / lineSegmentCount / 2; - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); for (int32_t i = 0, x, y; i < lineSegmentCount; ++i) { x = screenLine.GetX1() + dxPrecise * i * 2 / precisionFactor; y = screenLine.GetY1() + dyPrecise * i * 2 / precisionFactor; - dc->DrawLine(color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } }); + dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } }); } } } @@ -248,8 +248,8 @@ void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, int32_t image, const Scree auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->DrawSprite(image, coords.x, coords.y, tertiary_colour); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawSprite(dpi, image, coords.x, coords.y, tertiary_colour); } } @@ -258,8 +258,8 @@ void FASTCALL gfx_draw_glyph(rct_drawpixelinfo* dpi, int32_t image, const Screen auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->DrawGlyph(image, coords.x, coords.y, paletteMap); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawGlyph(dpi, image, coords.x, coords.y, paletteMap); } } @@ -269,8 +269,8 @@ void FASTCALL auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->DrawSpriteRawMasked(coords.x, coords.y, maskImage, colourImage); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawSpriteRawMasked(dpi, coords.x, coords.y, maskImage, colourImage); } } @@ -279,8 +279,8 @@ void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, int32_t image, const auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) { - IDrawingContext* dc = drawingEngine->GetDrawingContext(dpi); - dc->DrawSpriteSolid(image, coords.x, coords.y, colour); + IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawSpriteSolid(dpi, image, coords.x, coords.y, colour); } } diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index ae9a116ef3..c47794ef00 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -22,10 +22,14 @@ using namespace OpenRCT2; using namespace OpenRCT2::Drawing; -static void DrawLightRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); -static void DrawHeavyRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); -static void DrawLightSnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); -static void DrawHeavySnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); +static void DrawLightRain( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); +static void DrawHeavyRain( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); +static void DrawLightSnow( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); +static void DrawHeavySnow( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); /** * @@ -76,59 +80,62 @@ void DrawWeather(rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer) * * rct2: 0x00684114 */ -static void DrawLightRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) +static void DrawLightRain( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { int32_t x_start = -static_cast(gCurrentTicks) + 8; int32_t y_start = (gCurrentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); x_start = -static_cast(gCurrentTicks) + 0x18; y_start = (gCurrentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); } /** * * rct2: 0x0068416D */ -static void DrawHeavyRain(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) +static void DrawHeavyRain( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { int32_t x_start = -static_cast(gCurrentTicks); int32_t y_start = gCurrentTicks * 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); x_start = -static_cast(gCurrentTicks) + 0x10; y_start = (gCurrentTicks * 6) + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); x_start = -static_cast(gCurrentTicks) + 8; y_start = (gCurrentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); x_start = -static_cast(gCurrentTicks) + 0x18; y_start = (gCurrentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); } -static void DrawLightSnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) +static void DrawLightSnow( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { const uint32_t t = gCurrentTicks / 2; const int32_t negT = -static_cast(t); @@ -139,43 +146,44 @@ static void DrawLightSnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t t y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); x_start = negT + 16 + (cos(cosTick) * 6); y_start = t + 16; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); } -static void DrawHeavySnow(IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) +static void DrawHeavySnow( + rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height) { int32_t x_start = -static_cast(gCurrentTicks * 3) + 1; int32_t y_start = gCurrentTicks + 23; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); x_start = -static_cast(gCurrentTicks * 4) + 6; y_start = gCurrentTicks + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); x_start = -static_cast(gCurrentTicks * 2) + 11; y_start = gCurrentTicks + 18; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); x_start = -static_cast(gCurrentTicks * 3) + 17; y_start = gCurrentTicks + 11; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); } diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index ddaa2d381f..cb6581836f 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -43,13 +43,9 @@ X8WeatherDrawer::~X8WeatherDrawer() delete[] _weatherPixels; } -void X8WeatherDrawer::SetDPI(rct_drawpixelinfo* dpi) -{ - _screenDPI = dpi; -} - void X8WeatherDrawer::Draw( - int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, const uint8_t* weatherpattern) + rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, + const uint8_t* weatherpattern) { const uint8_t* pattern = weatherpattern; auto patternXSpace = *pattern++; @@ -58,10 +54,10 @@ void X8WeatherDrawer::Draw( uint8_t patternStartXOffset = xStart % patternXSpace; uint8_t patternStartYOffset = yStart % patternYSpace; - uint32_t pixelOffset = (_screenDPI->pitch + _screenDPI->width) * y + x; + uint32_t pixelOffset = (dpi->pitch + dpi->width) * y + x; uint8_t patternYPos = patternStartYOffset % patternYSpace; - uint8_t* screenBits = _screenDPI->bits; + uint8_t* screenBits = dpi->bits; // Stores the colours of changed pixels WeatherPixel* newPixels = &_weatherPixels[_weatherPixelsCount]; @@ -90,18 +86,18 @@ void X8WeatherDrawer::Draw( } } - pixelOffset += _screenDPI->pitch + _screenDPI->width; + pixelOffset += dpi->pitch + dpi->width; patternYPos++; patternYPos %= patternYSpace; } } -void X8WeatherDrawer::Restore() +void X8WeatherDrawer::Restore(rct_drawpixelinfo* dpi) { if (_weatherPixelsCount > 0) { - uint32_t numPixels = (_screenDPI->width + _screenDPI->pitch) * _screenDPI->height; - uint8_t* bits = _screenDPI->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]; @@ -201,8 +197,7 @@ void X8DrawingEngine::BeginDraw() Resize(_width, _height); } #endif - _weatherDrawer.SetDPI(&_bitsDPI); - _weatherDrawer.Restore(); + _weatherDrawer.Restore(&_bitsDPI); } } @@ -271,9 +266,8 @@ std::string X8DrawingEngine::Screenshot() return screenshot_dump_png(&_bitsDPI); } -IDrawingContext* X8DrawingEngine::GetDrawingContext(rct_drawpixelinfo* dpi) +IDrawingContext* X8DrawingEngine::GetDrawingContext() { - _drawingContext->SetDPI(dpi); return _drawingContext; } @@ -466,10 +460,8 @@ IDrawingEngine* X8DrawingContext::GetEngine() return _engine; } -void X8DrawingContext::Clear(uint8_t paletteIndex) +void X8DrawingContext::Clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) { - rct_drawpixelinfo* dpi = _dpi; - int32_t w = dpi->width / dpi->zoom_level; int32_t h = dpi->height / dpi->zoom_level; uint8_t* ptr = dpi->bits; @@ -529,10 +521,9 @@ static constexpr const uint16_t * Patterns[] = { }; // clang-format on -void X8DrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) +void X8DrawingContext::FillRect( + rct_drawpixelinfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) { - rct_drawpixelinfo* dpi = _dpi; - if (left > right) return; if (top > bottom) @@ -650,10 +641,9 @@ void X8DrawingContext::FillRect(uint32_t colour, int32_t left, int32_t top, int3 } } -void X8DrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) +void X8DrawingContext::FilterRect( + rct_drawpixelinfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) { - rct_drawpixelinfo* dpi = _dpi; - if (left > right) return; if (top > bottom) @@ -723,22 +713,23 @@ void X8DrawingContext::FilterRect(FilterPaletteID palette, int32_t left, int32_t } } -void X8DrawingContext::DrawLine(uint32_t colour, const ScreenLine& line) +void X8DrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line) { - gfx_draw_line_software(_dpi, line, colour); + gfx_draw_line_software(dpi, line, colour); } -void X8DrawingContext::DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) +void X8DrawingContext::DrawSprite(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) { - gfx_draw_sprite_software(_dpi, ImageId::FromUInt32(image, tertiaryColour), { x, y }); + gfx_draw_sprite_software(dpi, ImageId::FromUInt32(image, tertiaryColour), { x, y }); } -void X8DrawingContext::DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) +void X8DrawingContext::DrawSpriteRawMasked( + rct_drawpixelinfo* dpi, int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) { - gfx_draw_sprite_raw_masked_software(_dpi, { x, y }, maskImage, colourImage); + gfx_draw_sprite_raw_masked_software(dpi, { x, y }, maskImage, colourImage); } -void X8DrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) +void X8DrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint8_t colour) { uint8_t palette[256]; std::fill_n(palette, sizeof(palette), colour); @@ -746,15 +737,10 @@ void X8DrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uin const auto spriteCoords = ScreenCoordsXY{ x, y }; gfx_draw_sprite_palette_set_software( - _dpi, ImageId::FromUInt32((image & 0x7FFFF) | IMAGE_TYPE_REMAP), spriteCoords, PaletteMap(palette)); + dpi, ImageId::FromUInt32((image & 0x7FFFF) | IMAGE_TYPE_REMAP), spriteCoords, PaletteMap(palette)); } -void X8DrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& paletteMap) +void X8DrawingContext::DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& paletteMap) { - gfx_draw_sprite_palette_set_software(_dpi, ImageId::FromUInt32(image), { x, y }, paletteMap); -} - -void X8DrawingContext::SetDPI(rct_drawpixelinfo* dpi) -{ - _dpi = dpi; + gfx_draw_sprite_palette_set_software(dpi, ImageId::FromUInt32(image), { x, y }, paletteMap); } diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index b655cac749..d97f1a34ec 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -49,16 +49,14 @@ namespace OpenRCT2 size_t _weatherPixelsCapacity = MaxWeatherPixels; uint32_t _weatherPixelsCount = 0; WeatherPixel* _weatherPixels = nullptr; - rct_drawpixelinfo* _screenDPI = nullptr; public: X8WeatherDrawer(); ~X8WeatherDrawer(); - void SetDPI(rct_drawpixelinfo* dpi); void Draw( - int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, + rct_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(); + void Restore(rct_drawpixelinfo* dpi); }; #ifdef __WARN_SUGGEST_FINAL_TYPES__ @@ -109,7 +107,7 @@ namespace OpenRCT2 void PaintWeather() override; void CopyRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy) override; std::string Screenshot() override; - IDrawingContext* GetDrawingContext(rct_drawpixelinfo* dpi) override; + IDrawingContext* GetDrawingContext() override; rct_drawpixelinfo* GetDrawingPixelInfo() override; DRAWING_ENGINE_FLAGS GetFlags() override; void InvalidateImage(uint32_t image) override; @@ -135,26 +133,28 @@ namespace OpenRCT2 { private: X8DrawingEngine* _engine = nullptr; - rct_drawpixelinfo* _dpi = nullptr; public: explicit X8DrawingContext(X8DrawingEngine* engine); IDrawingEngine* GetEngine() override; - void Clear(uint8_t paletteIndex) override; - void FillRect(uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; - void FilterRect(FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; - void DrawLine(uint32_t colour, const ScreenLine& line) override; - void DrawSprite(uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) override; - void DrawSpriteRawMasked(int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; - void DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uint8_t colour) override; - void DrawGlyph(uint32_t image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; - void DrawBitmap(uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) override + void Clear(rct_drawpixelinfo* dpi, uint8_t paletteIndex) override; + void FillRect(rct_drawpixelinfo* dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; + void FilterRect( + rct_drawpixelinfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, + int32_t bottom) override; + void DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const ScreenLine& line) override; + void DrawSprite(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint32_t tertiaryColour) override; + void DrawSpriteRawMasked( + rct_drawpixelinfo* dpi, int32_t x, int32_t y, uint32_t maskImage, uint32_t colourImage) override; + void DrawSpriteSolid(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, uint8_t colour) override; + void DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; + void DrawBitmap( + rct_drawpixelinfo* dpi, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, + int32_t y) override { } - - void SetDPI(rct_drawpixelinfo* dpi); }; } // namespace Drawing } // namespace OpenRCT2 diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index c2f38d56ac..8135b209aa 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -29,7 +29,8 @@ namespace OpenRCT2 struct IDrawingEngineFactory; struct IWeatherDrawer; using DrawWeatherFunc = void (*)( - OpenRCT2::Drawing::IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, int32_t height); + rct_drawpixelinfo* dpi, OpenRCT2::Drawing::IWeatherDrawer* weatherDrawer, int32_t left, int32_t top, int32_t width, + int32_t height); } // namespace Drawing namespace Ui From 5563139ed12904e6a65c1236db209399eef0daf5 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 6 Oct 2021 23:00:06 +0200 Subject: [PATCH 509/681] Fix #15503: Freeze when doing specific merges --- distribution/changelog.txt | 1 + src/openrct2/ride/Ride.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ad73c74f33..9138486a7d 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -30,6 +30,7 @@ - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). +- Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index d90387ee35..1eabd0f6cf 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3492,8 +3492,16 @@ void Ride::MoveTrainsToBlockBrakes(TrackElement* firstBlock) continue; } + size_t numIterations = 0; do { + // Fixes both freezing issues in #15503. + // TODO: refactor the code so a tortoise-and-hare algorithm can be used. + if (numIterations++ > 1000000) + { + break; + } + firstBlock->SetBlockBrakeClosed(true); for (Vehicle* car = train; car != nullptr; car = GetEntity(car->next_vehicle_on_train)) { From 9d57e93df99a626a25272cc5698ace7492130461 Mon Sep 17 00:00:00 2001 From: hjort96 Date: Thu, 7 Oct 2021 16:21:19 +0200 Subject: [PATCH 510/681] Add suggestions from review. --- src/openrct2-ui/windows/ViewClipping.cpp | 33 +++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 0f73b567c7..dab9964aca 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -41,7 +41,7 @@ enum class DISPLAY_TYPE { DISPLAY_UNITS }; -static DISPLAY_TYPE gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; +// static DISPLAY_TYPE gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; #pragma region Widgets @@ -73,6 +73,7 @@ private: CoordsXY _previousClipSelectionB; bool _toolActive{ false }; bool _dragging{ false }; + static inline DISPLAY_TYPE _clipHeightDisplayType; public: void OnCloseButton() @@ -82,8 +83,6 @@ public: void OnMouseUp(rct_widgetindex widgetIndex) override { - rct_window* mainWindow; - // mouseup appears to be used for buttons, checkboxes switch (widgetIndex) { @@ -91,8 +90,9 @@ public: window_close(this); break; case WIDX_CLIP_CHECKBOX_ENABLE: + { // Toggle height clipping. - mainWindow = window_get_main(); + rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) { mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; @@ -100,15 +100,16 @@ public: } this->Invalidate(); break; + } case WIDX_CLIP_HEIGHT_VALUE: // Toggle display of the cut height value in RAW vs UNITS - if (gClipHeightDisplayType == DISPLAY_TYPE::DISPLAY_RAW) + if (_clipHeightDisplayType == DISPLAY_TYPE::DISPLAY_RAW) { - gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; + _clipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; } else { - gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_RAW; + _clipHeightDisplayType = DISPLAY_TYPE::DISPLAY_RAW; } this->Invalidate(); break; @@ -163,9 +164,9 @@ public: void OnUpdate() override { - const rct_widget* const widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; const rct_scroll* const scroll = &this->scrolls[0]; - const int16_t scroll_width = widget->width() - 1; + 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) @@ -283,7 +284,7 @@ public: screenCoords = this->windowPos + ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - switch (gClipHeightDisplayType) + switch (_clipHeightDisplayType) { case DISPLAY_TYPE::DISPLAY_RAW: default: @@ -298,7 +299,7 @@ public: case DISPLAY_TYPE::DISPLAY_UNITS: { // Print the value in the configured height label type: - if (gConfigGeneral.show_height_as_units == 1) + if (gConfigGeneral.show_height_as_units) { // Height label is Units. auto ft = Formatter(); @@ -350,6 +351,8 @@ public: this->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); WindowInitScrollWidgets(this); + _clipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; + // Initialise the clip height slider from the current clip height value. this->SetClipHeight(gClipHeight); @@ -378,13 +381,13 @@ private: } } - void SetClipHeight(const uint8_t clipheight) + void SetClipHeight(const uint8_t clipHeight) { - gClipHeight = clipheight; - rct_widget* widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER]; + 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)))); + std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget.width() - 1)))); } bool IsActive() From fd18ac7f855276a67ed4341e9aad87c2a9541630 Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 7 Oct 2021 18:02:24 +0100 Subject: [PATCH 511/681] Modify StaffSetPatrolAreaAction to have three modes (#15494) * Modify StaffSetPatrolAreaAction to have three modes * Actually serialise mode * Apply review comments * Increment network version * Apply review comment * Update replay --- CMakeLists.txt | 4 +- openrct2.proj | 4 +- src/openrct2-ui/windows/Staff.cpp | 15 +++-- .../actions/StaffSetPatrolAreaAction.cpp | 60 +++++++++++++------ .../actions/StaffSetPatrolAreaAction.h | 10 +++- src/openrct2/network/NetworkBase.cpp | 2 +- 6 files changed, 66 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e07d4510cd..90b62508cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.54") +set(REPLAYS_VERSION "0.0.55") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "FF54C3699C3A0DF02269C5EB4C4A9C8E6D5C4EB4") +set(REPLAYS_SHA1 "70B4B7CB26A428801676BCC615F3881E72A45406") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index f46863f90e..d8fcfb7bc1 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.54/replays.zip - FF54C3699C3A0DF02269C5EB4C4A9C8E6D5C4EB4 + https://github.com/OpenRCT2/replays/releases/download/v0.0.55/replays.zip + 70B4B7CB26A428801676BCC615F3881E72A45406 diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 422dd64116..9e208678c5 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -567,11 +567,10 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, { return; } - // TODO: THIS SHOULD BE NETWORKED - peep->ClearPatrolArea(); - gfx_invalidate_screen(); - staff_update_greyed_patrol_areas(); + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( + peep->sprite_index, {}, StaffSetPatrolAreaMode::ClearAll); + GameActions::Execute(&staffSetPatrolAreaAction); } else { @@ -1241,7 +1240,9 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, { _staffPatrolAreaPaintValue = PatrolAreaValue::SET; } - auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(w->number, destCoords); + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( + w->number, destCoords, + _staffPatrolAreaPaintValue == PatrolAreaValue::SET ? StaffSetPatrolAreaMode::Set : StaffSetPatrolAreaMode::Unset); GameActions::Execute(&staffSetPatrolAreaAction); } } @@ -1275,7 +1276,9 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, if (_staffPatrolAreaPaintValue == PatrolAreaValue::UNSET && !patrolAreaValue) return; // Since area is already the value we want, skip... - auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(w->number, destCoords); + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( + w->number, destCoords, + _staffPatrolAreaPaintValue == PatrolAreaValue::SET ? StaffSetPatrolAreaMode::Set : StaffSetPatrolAreaMode::Unset); GameActions::Execute(&staffSetPatrolAreaAction); } diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index fce035a3b2..bee0769e31 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -14,9 +14,10 @@ #include "../peep/Staff.h" #include "../world/Entity.h" -StaffSetPatrolAreaAction::StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc) +StaffSetPatrolAreaAction::StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc, const StaffSetPatrolAreaMode mode) : _spriteId(spriteId) , _loc(loc) + , _mode(mode) { } @@ -28,7 +29,7 @@ uint16_t StaffSetPatrolAreaAction::GetActionFlags() const void StaffSetPatrolAreaAction::Serialise(DataSerialiser& stream) { GameAction::Serialise(stream); - stream << DS_TAG(_spriteId) << DS_TAG(_loc); + stream << DS_TAG(_spriteId) << DS_TAG(_loc) << DS_TAG(_mode); } GameActions::Result::Ptr StaffSetPatrolAreaAction::Query() const @@ -54,19 +55,10 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Query() const return MakeResult(); } -GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const +static void UpdateStaffMode(const Staff& staff) { - auto staff = TryGetEntity(_spriteId); - if (staff == nullptr) - { - log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); - } - - staff->TogglePatrolArea(_loc); - bool isPatrolling = false; - const auto peepOffset = staff->StaffId * STAFF_PATROL_AREA_SIZE; + const auto peepOffset = staff.StaffId * STAFF_PATROL_AREA_SIZE; for (size_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) { if (gStaffPatrolAreas[i] != 0) @@ -78,20 +70,54 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const if (isPatrolling) { - gStaffModes[staff->StaffId] = StaffMode::Patrol; + gStaffModes[staff.StaffId] = StaffMode::Patrol; } - else if (gStaffModes[staff->StaffId] == StaffMode::Patrol) + else if (gStaffModes[staff.StaffId] == StaffMode::Patrol) { - gStaffModes[staff->StaffId] = StaffMode::Walk; + gStaffModes[staff.StaffId] = StaffMode::Walk; } +} +static void InvalidatePatrolTile(const CoordsXY& loc) +{ + // Align the location to the top left of the patrol square + const auto alignedLoc = CoordsXY{ loc.x & 0x1F80, loc.y & 0x1F80 }; for (int32_t y = 0; y < 4 * COORDS_XY_STEP; y += COORDS_XY_STEP) { for (int32_t x = 0; x < 4 * COORDS_XY_STEP; x += COORDS_XY_STEP) { - map_invalidate_tile_full({ (_loc.x & 0x1F80) + x, (_loc.y & 0x1F80) + y }); + map_invalidate_tile_full(alignedLoc + CoordsXY{ x, y }); } } +} + +GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const +{ + auto staff = TryGetEntity(_spriteId); + if (staff == nullptr) + { + log_error("Invalid spriteId. spriteId = %u", _spriteId); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + } + + switch (_mode) + { + case StaffSetPatrolAreaMode::Set: + staff->SetPatrolArea(_loc, true); + UpdateStaffMode(*staff); + InvalidatePatrolTile(_loc); + break; + case StaffSetPatrolAreaMode::Unset: + staff->SetPatrolArea(_loc, false); + UpdateStaffMode(*staff); + InvalidatePatrolTile(_loc); + break; + case StaffSetPatrolAreaMode::ClearAll: + staff->ClearPatrolArea(); + gfx_invalidate_screen(); + break; + } + staff_update_greyed_patrol_areas(); return MakeResult(); diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.h b/src/openrct2/actions/StaffSetPatrolAreaAction.h index 7d43239aa7..d6b31ce52a 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.h +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.h @@ -11,15 +11,23 @@ #include "GameAction.h" +enum class StaffSetPatrolAreaMode : uint8_t +{ + Set, + Unset, + ClearAll +}; + DEFINE_GAME_ACTION(StaffSetPatrolAreaAction, GameCommand::SetStaffPatrol, GameActions::Result) { private: uint16_t _spriteId{ SPRITE_INDEX_NULL }; CoordsXY _loc; + StaffSetPatrolAreaMode _mode; public: StaffSetPatrolAreaAction() = default; - StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc); + StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc, const StaffSetPatrolAreaMode mode); uint16_t GetActionFlags() const override; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index f045992fc0..6e7564d2a1 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "12" +#define NETWORK_STREAM_VERSION "13" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From dba34d2c17fb69013921a01644ce3e47745616fb Mon Sep 17 00:00:00 2001 From: hjort96 Date: Thu, 7 Oct 2021 22:38:12 +0200 Subject: [PATCH 512/681] Removed a line --- src/openrct2-ui/windows/ViewClipping.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index dab9964aca..296dc786ac 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -41,8 +41,6 @@ enum class DISPLAY_TYPE { DISPLAY_UNITS }; -// static DISPLAY_TYPE gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; - #pragma region Widgets static constexpr const rct_string_id WINDOW_TITLE = STR_VIEW_CLIPPING_TITLE; From 5f874f15c758d96d6bacd8a099b3ce20b81e2a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 8 Oct 2021 01:02:45 +0300 Subject: [PATCH 513/681] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ad73c74f33..affec10920 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -32,6 +32,7 @@ - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Improved: [#3417] Crash dumps are now placed in their own folder. +- Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. From 25419bb4e3e46f7d7db45684b821f6bdefba3cfc Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Fri, 8 Oct 2021 07:13:04 +0900 Subject: [PATCH 514/681] Fix #15197: Cannot place flat ride after removing it in construction Demolishing a flat ride (using the bulldozer icon in the construction menu) will now reopen the construction window to it's default state. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9138486a7d..432cd2d76f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15170] Plugin: incorrect label text alignment. - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. +- Fix: [#15197] Cannot place flat ride after removing it in construction window. - Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15213] Freeze when hovering over Reverse Freefall Coaster in Russian. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 15de24f541..ca9ea239bd 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1931,6 +1931,14 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) const rct_preview_track* trackBlock = ted.Block; newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; gGotoStartPlacementMode = true; + + // When flat rides are deleted, the window should be reset so the ride can be placed again. + const auto rideId = w->rideId; + auto ride = get_ride(rideId); + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + { + ride_initialise_construction_window(ride); + } } auto trackRemoveAction = TrackRemoveAction( From 7787bb46e0561dff2aa9ae7b248ffaef81088d8c Mon Sep 17 00:00:00 2001 From: Gaven Rendell Date: Fri, 2 Apr 2021 13:40:01 -0400 Subject: [PATCH 515/681] Handle mod key edge-cases in tiling WMs This commit ignores keypresses when the mod key is held. The reasoning is that an odd interaction happens between SDL applications and tiling window managers. Tiling window managers like Xmonad and i3 usually use the mod ("windows") key and a number to change workspaces. When changing workspaces, however, the WMs still send the number key through instead of "eating" it. It's not clear why, exactly, but it seems universal. Mod+1 -> Goes to workspace #1 Mod+2 -> Goes to workspace #2 ... Mod+9 -> Goes to workspace #9 Most applications don't even see the number key being sent, so if you move to workspace 1, Firefox won't type "1" into the browser bar, Vim won't type "1" into your file, etc. But SDL applications, for whatever reason, DO see this keydown. Of course, they'll handle it like a regular key press. So if you move to workspace 1, which contains OpenRCT, it inadvertently toggles x-ray mode. I first found this bug in another SDL game, The Powder Toy. After some discussion with the devs, they fixed it like this, by ignoring keydown events when the mod key is pressed, since the mod key is reserved for the window manager anyway. It works well and should be in the next release. https://github.com/The-Powder-Toy/The-Powder-Toy/compare/c7619387ace6a24c4bd31e6899073ef3a91bcf7a...93b920a57f4d3843a8e6234e360fcf5e919181a6 I did the same thing here. --- contributors.md | 1 + src/openrct2-ui/UiContext.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/contributors.md b/contributors.md index 25c4082a91..34c3d18bde 100644 --- a/contributors.md +++ b/contributors.md @@ -178,6 +178,7 @@ The following people are not part of the development team, but have been contrib * (ocalhoun6) * Sean Payne (seanmajorpayne) * Soham Roy (sohamroy19) +* Gaven Rendell (Rendello) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 9031f447a1..12faf27b7a 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -523,6 +523,12 @@ public: #endif case SDL_KEYDOWN: { + // Ignore keydowns when mod is held. Handles edge cases + // where window managers don't eat the keypresses. + if (SDL_GetModState() & KMOD_GUI) + { + break; + } _textComposition.HandleMessage(&e); auto ie = GetInputEventFromSDLEvent(e); ie.State = InputEventState::Down; From 33fa31e6d0b2fd2f4ff899851eca143e5a2358a5 Mon Sep 17 00:00:00 2001 From: Gaven Rendell Date: Fri, 2 Apr 2021 20:14:56 -0400 Subject: [PATCH 516/681] Exclude Win/Mac from ignoring mod key --- src/openrct2-ui/UiContext.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 12faf27b7a..8ef79e62a5 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -523,12 +523,15 @@ public: #endif case SDL_KEYDOWN: { - // Ignore keydowns when mod is held. Handles edge cases - // where window managers don't eat the keypresses. +#if !(defined(__MACOSX__) || defined(__WINDOWS__)) + // Ignore winkey keydowns. Handles edge case where *NIX + // tiling window managers don't eat the keypresses when + // changing workspaces. if (SDL_GetModState() & KMOD_GUI) { break; } +#endif _textComposition.HandleMessage(&e); auto ie = GetInputEventFromSDLEvent(e); ie.State = InputEventState::Down; From 86cf0dc916d0d6430c0a6e6e9be12bd92255b9d3 Mon Sep 17 00:00:00 2001 From: Gaven Rendell Date: Sun, 4 Apr 2021 13:00:18 -0400 Subject: [PATCH 517/681] Remove Windows check --- src/openrct2-ui/UiContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 8ef79e62a5..b5510dec5e 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -523,10 +523,10 @@ public: #endif case SDL_KEYDOWN: { -#if !(defined(__MACOSX__) || defined(__WINDOWS__)) - // Ignore winkey keydowns. Handles edge case where *NIX - // tiling window managers don't eat the keypresses when - // changing workspaces. +#ifndef __MACOSX__ + // Ignore winkey keydowns. Handles edge case where tiling + // window managers don't eat the keypresses when changing + // workspaces. if (SDL_GetModState() & KMOD_GUI) { break; From e8b6e244982e464060072d738db98edc2970feda Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Sat, 9 Oct 2021 19:49:26 +0900 Subject: [PATCH 518/681] Fix #15451: Guest List name filter remains after group selection --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/GuestList.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 432cd2d76f..7bf4bb26a2 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. +- Fix: [#15451] Guest list name filter remains after group selection. - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 9909718c7a..e70c7c4f83 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -321,8 +321,13 @@ public: _selectedPage = 0; _numPages = 1; widgets[WIDX_TRACKING].type = WindowWidgetType::Empty; - widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::Empty; - if (_selectedTab == TabId::Individual) + 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; @@ -576,6 +581,7 @@ public: _selectedTab = TabId::Individual; widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; Invalidate(); + widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; scrolls[0].v_top = 0; RefreshList(); } From b8c751e3006c44618b6c0bd8fcdd8301ee76770a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 9 Oct 2021 21:29:51 +0200 Subject: [PATCH 519/681] Drop some unnecessary includes --- src/openrct2/actions/GameAction.h | 2 -- src/openrct2/core/MemoryStream.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 03ee95fe5f..8a567dfd23 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -12,9 +12,7 @@ #include "../Game.h" #include "../common.h" #include "../core/DataSerialiser.h" -#include "../core/IStream.hpp" #include "../localisation/StringIds.h" -#include "../world/Map.h" #include #include diff --git a/src/openrct2/core/MemoryStream.h b/src/openrct2/core/MemoryStream.h index f3dba1d69d..ff47441046 100644 --- a/src/openrct2/core/MemoryStream.h +++ b/src/openrct2/core/MemoryStream.h @@ -12,7 +12,6 @@ #include "../common.h" #include "IStream.hpp" -#include #include namespace OpenRCT2 From 1b4875e528f221cf75cdfecc0434396edf5c22a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 9 Oct 2021 21:43:06 +0200 Subject: [PATCH 520/681] Extract math-related functions from common.h to Math.hpp Saves wide inclusion of header, which pulls in --- src/openrct2-ui/windows/GuestList.cpp | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 1 + src/openrct2-ui/windows/TopToolbar.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/TrackPlaceAction.cpp | 2 +- src/openrct2/common.h | 25 ------------- src/openrct2/interface/Cursors.h | 2 + src/openrct2/interface/Viewport.cpp | 1 + .../localisation/Localisation.Date.cpp | 1 + src/openrct2/paint/Paint.cpp | 1 + src/openrct2/paint/Supports.cpp | 1 + src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/util/Math.hpp | 37 +++++++++++++++++++ src/openrct2/windows/_legacy.cpp | 1 + src/openrct2/world/Location.hpp | 1 + 15 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 src/openrct2/util/Math.hpp diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index e70c7c4f83..f514c424cc 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index ca9ea239bd..95028f8525 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 433fc10250..3fb9c53b5e 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index ab0d0203f4..e977285795 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -18,7 +18,7 @@ #include "../localisation/StringIds.h" #include "../management/Finance.h" #include "../ride/RideData.h" -#include "../util/Util.h" +#include "../util/Math.hpp" #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 39b508c804..c1287a714b 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -15,7 +15,7 @@ #include "../ride/Track.h" #include "../ride/TrackData.h" #include "../ride/TrackDesign.h" -#include "../util/Util.h" +#include "../util/Math.hpp" #include "../world/MapAnimation.h" #include "../world/Surface.h" #include "RideSetSettingAction.h" diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 5a5cae5ade..12c6552dce 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -23,7 +23,6 @@ #include #include #include -#include using utf8 = char; using utf8string = utf8*; @@ -38,30 +37,6 @@ using const_utf8string = const utf8*; using codepoint_t = uint32_t; using colour_t = uint8_t; -namespace -{ - [[maybe_unused]] constexpr bool is_power_of_2(int v) - { - return v && ((v & (v - 1)) == 0); - } - - // Rounds an integer down to the given power of 2. y must be a power of 2. - [[maybe_unused]] constexpr int floor2(const int x, const int y) - { - if (!is_power_of_2(y)) - throw std::logic_error("floor2 should only operate on power of 2"); - return x & ~(y - 1); - } - - // Rounds an integer up to the given power of 2. y must be a power of 2. - [[maybe_unused]] constexpr int ceil2(const int x, const int y) - { - if (!is_power_of_2(y)) - throw std::logic_error("ceil2 should only operate on power of 2"); - return (x + y - 1) & ~(y - 1); - } -} // namespace - // Gets the name of a symbol as a C string #define nameof(symbol) #symbol diff --git a/src/openrct2/interface/Cursors.h b/src/openrct2/interface/Cursors.h index f485b27e40..2eca575a86 100644 --- a/src/openrct2/interface/Cursors.h +++ b/src/openrct2/interface/Cursors.h @@ -11,6 +11,8 @@ #include "../common.h" +#include + enum class CursorID : uint8_t { Arrow, diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 73450b4978..17b610dcba 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -25,6 +25,7 @@ #include "../ride/Vehicle.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" +#include "../util/Math.hpp" #include "../world/Climate.h" #include "../world/EntityList.h" #include "../world/Map.h" diff --git a/src/openrct2/localisation/Localisation.Date.cpp b/src/openrct2/localisation/Localisation.Date.cpp index ce4330600b..7e1a415a4a 100644 --- a/src/openrct2/localisation/Localisation.Date.cpp +++ b/src/openrct2/localisation/Localisation.Date.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "../Game.h" +#include "../util/Math.hpp" #include "Date.h" #include "StringIds.h" diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 2cf3886736..c688b2524c 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -17,6 +17,7 @@ #include "../localisation/Localisation.h" #include "../localisation/LocalisationService.h" #include "../paint/Painter.h" +#include "../util/Math.hpp" #include "sprite/Paint.Sprite.h" #include "tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index c60a18ad63..9ae4a481c5 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -12,6 +12,7 @@ #include "../interface/Viewport.h" #include "../object/FootpathRailingsObject.h" #include "../sprites.h" +#include "../util/Math.hpp" #include "../world/Surface.h" #include "Paint.h" #include "tile_element/Paint.TileElement.h" diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 03a3f66302..7a5fb800aa 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -30,7 +30,7 @@ #include "../scenario/Scenario.h" #include "../scripting/HookEngine.h" #include "../scripting/ScriptEngine.h" -#include "../util/Util.h" +#include "../util/Math.hpp" #include "../windows/Intent.h" #include "../world/Balloon.h" #include "../world/Climate.h" diff --git a/src/openrct2/util/Math.hpp b/src/openrct2/util/Math.hpp new file mode 100644 index 0000000000..e43ead1e23 --- /dev/null +++ b/src/openrct2/util/Math.hpp @@ -0,0 +1,37 @@ + +/***************************************************************************** + * Copyright (c) 2014-2021 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 + +namespace +{ + [[maybe_unused]] constexpr bool is_power_of_2(int v) + { + return v && ((v & (v - 1)) == 0); + } + + // Rounds an integer down to the given power of 2. y must be a power of 2. + [[maybe_unused]] constexpr int floor2(const int x, const int y) + { + if (!is_power_of_2(y)) + throw std::logic_error("floor2 should only operate on power of 2"); + return x & ~(y - 1); + } + + // Rounds an integer up to the given power of 2. y must be a power of 2. + [[maybe_unused]] constexpr int ceil2(const int x, const int y) + { + if (!is_power_of_2(y)) + throw std::logic_error("ceil2 should only operate on power of 2"); + return (x + y - 1) & ~(y - 1); + } +} // namespace diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 1d6947d88b..96f0a9e519 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -20,6 +20,7 @@ #include "../ride/RideData.h" #include "../ride/Track.h" #include "../ride/TrackData.h" +#include "../util/Math.hpp" #include "../world/Banner.h" #include "../world/Scenery.h" #include "Intent.h" diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 42e2915565..6dba7e7ab6 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -10,6 +10,7 @@ #pragma once #include "../common.h" +#include "../util/Math.hpp" #include From 3e64a227e5392ec5752ab7f0471d7c054da742c1 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 9 Oct 2021 21:48:43 +0200 Subject: [PATCH 521/681] Fix Object Selection not freeing the object when unhovering Fixes a double-free on previews. --- src/openrct2-ui/windows/EditorObjectSelection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 14222f5dc3..81957c73f9 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -757,7 +757,10 @@ static void window_editor_object_selection_scroll_mouseover( w->selected_list_item = selectedObject; if (_loadedObject != nullptr) + { _loadedObject->Unload(); + _loadedObject = nullptr; + } if (selectedObject == -1) { From 6067048fd5bb622466fd0d6b301b9c61c13b522b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 9 Oct 2021 22:12:18 +0200 Subject: [PATCH 522/681] Reduce inclusion of NewsItem.h --- src/openrct2/Game.cpp | 1 - src/openrct2/rct1/RCT1.h | 1 - src/openrct2/rct1/S4Importer.cpp | 1 + src/openrct2/world/Park.cpp | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 33b6df220b..0f215b5515 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -32,7 +32,6 @@ #include "localisation/Localisation.h" #include "management/Finance.h" #include "management/Marketing.h" -#include "management/NewsItem.h" #include "management/Research.h" #include "network/network.h" #include "object/Object.h" diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index e081a55d58..3fdf059ee0 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -10,7 +10,6 @@ #pragma once #include "../management/Award.h" -#include "../management/NewsItem.h" #include "../management/Research.h" #include "../rct12/RCT12.h" #include "../ride/Ride.h" diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1f90849add..6377f48799 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -28,6 +28,7 @@ #include "../localisation/Localisation.h" #include "../management/Finance.h" #include "../management/Marketing.h" +#include "../management/NewsItem.h" #include "../object/Object.h" #include "../object/ObjectList.h" #include "../object/ObjectManager.h" diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 22e1301ad3..c8ff39b4bd 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -25,7 +25,6 @@ #include "../management/Award.h" #include "../management/Finance.h" #include "../management/Marketing.h" -#include "../management/NewsItem.h" #include "../management/Research.h" #include "../network/network.h" #include "../peep/Peep.h" From 3efae5bff73be9dfc75c3bcd5c98ea26408f1b97 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Sun, 12 Sep 2021 17:33:01 -0600 Subject: [PATCH 523/681] minor changes and point at alpha dependencies --- CMakeLists.txt | 56 +++++++++++++++++++++++++--------- src/openrct2-ui/CMakeLists.txt | 14 +++++++-- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90b62508cc..ee40b371fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,12 +20,27 @@ if (CCache_FOUND) endif (CCache_FOUND) if (APPLE) - set(CMAKE_OSX_ARCHITECTURES "x86_64") - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") -endif () + execute_process(COMMAND /usr/bin/uname -m OUTPUT_VARIABLE SYSTEM_MACOS_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + if (NOT DEFINED ARCH) + set(ARCH "${SYSTEM_MACOS_ARCH}") + endif () + set(CMAKE_OSX_ARCHITECTURES "${ARCH}" CACHE STRING "") + + if("${ARCH}" MATCHES "^x86_64") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "") + elseif("${ARCH}" MATCHES "^arm64") + set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "") + else() + message("Unknown macOS architecture: ${ARCH}. Behavior may be unexpected.") + endif() +endif () project(openrct2 CXX) +if (APPLE) + set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}" CACHE STRING "") +endif () + include(cmake/platform.cmake) include(CMakeDependentOption) @@ -110,11 +125,16 @@ if (MACOS_USE_DEPENDENCIES) # if we're building on macOS, then we need the dependencies include(cmake/download.cmake) - set(MACOS_DYLIBS_VERSION "28") - set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-x64-macos-dylibs.zip") - set(MACOS_DYLIBS_SHA1 "29e5480376cf4ac5943f114387e32685204c8b78") + # TODO - change back before merging + # set(MACOS_DYLIBS_VERSION "28") + # set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-x64-macos-dylibs.zip") + # set(MACOS_DYLIBS_SHA1 "29e5480376cf4ac5943f114387e32685204c8b78") + set(MACOS_DYLIBS_VERSION "29-alpha2") + set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-universal-macos-dylibs.zip") + set(MACOS_DYLIBS_SHA1 "bb8899c4120f1add232af7f9ac774ea622e01ad3") set(MACOS_DYLIBS_DIR "${ROOT_DIR}/lib/macos") - set(MACOS_DYLIBS_URL "https://github.com/OpenRCT2/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") + # set(MACOS_DYLIBS_URL "https://github.com/OpenRCT2/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") + set(MACOS_DYLIBS_URL "https://github.com/adam-bloom/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") download_openrct2_zip( ZIP_VERSION ${MACOS_DYLIBS_VERSION} @@ -209,6 +229,10 @@ if (NOT DISABLE_DISCORD_RPC) endif() endif() +# ensure X86 and X86_64 are always initialized +# may be overwritten below +set(X86 0) +set(X86_64 0) # Copied from https://github.com/opencv/opencv/blob/dcdd6af5a856826fe62c95322145731e702e54c5/cmake/OpenCVDetectCXXCompiler.cmake#L63-L70 if(MSVC64 OR MINGW64) set(X86_64 1) @@ -368,14 +392,16 @@ endif () # g2 -add_custom_command( - OUTPUT g2.dat - COMMAND ./openrct2-cli sprite build \"${CMAKE_BINARY_DIR}/g2.dat\" \"${ROOT_DIR}/resources/g2/sprites.json\" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) -add_custom_target(g2 DEPENDS ${PROJECT_NAME} g2.dat) - -project(openrct2 CXX) +if (NOT (MACOS_BUNDLE AND (NOT CMAKE_OSX_ARCHITECTURES MATCHES "${SYSTEM_MACOS_ARCH}"))) + add_custom_command( + OUTPUT g2.dat + COMMAND ./openrct2-cli sprite build \"${CMAKE_BINARY_DIR}/g2.dat\" \"${ROOT_DIR}/resources/g2/sprites.json\" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_custom_target(g2 DEPENDS ${PROJECT_NAME} g2.dat) +else () + message("Skipping g2.dat generation in macOS cross-compile") +endif () # Include tests if (WITH_TESTS) diff --git a/src/openrct2-ui/CMakeLists.txt b/src/openrct2-ui/CMakeLists.txt index ce14758338..953652bb98 100644 --- a/src/openrct2-ui/CMakeLists.txt +++ b/src/openrct2-ui/CMakeLists.txt @@ -35,6 +35,11 @@ file(GLOB_RECURSE OPENRCT2_UI_HEADERS if (APPLE) file(GLOB_RECURSE OPENRCT2_UI_MM_SOURCES "${CMAKE_CURRENT_LIST_DIR}/*.mm") set_source_files_properties(${OPENRCT2_UI_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c++ -fmodules") + if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64") + # cross-compilation workaround for SDL2 + set(SDL_DISABLE_IMMINTRIN_H "-DSDL_DISABLE_IMMINTRIN_H") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SDL_DISABLE_IMMINTRIN_H}") + endif () endif () # Outputs @@ -141,7 +146,6 @@ if(MACOS_BUNDLE) target_sources(${PROJECT_NAME} PUBLIC ${ROOT_DIR}/distribution/readme.txt PUBLIC ${ROOT_DIR}/distribution/changelog.txt - PUBLIC ${CMAKE_BINARY_DIR}/g2.dat PUBLIC ${ROOT_DIR}/resources/mac/openrct2.icns ) @@ -149,10 +153,16 @@ if(MACOS_BUNDLE) set(BUNDLE_RESOURCES ${ROOT_DIR}/distribution/readme.txt ${ROOT_DIR}/distribution/changelog.txt - ${CMAKE_BINARY_DIR}/g2.dat ${ROOT_DIR}/resources/mac/openrct2.icns ) + if (CMAKE_OSX_ARCHITECTURES MATCHES "${SYSTEM_MACOS_ARCH}") + target_sources(${PROJECT_NAME} + PUBLIC ${CMAKE_BINARY_DIR}/g2.dat + ) + list(APPEND BUNDLE_RESOURCES ${CMAKE_BINARY_DIR}/g2.dat) + endif() + if(${OPENRCT2_BRANCH} EQUAL master) set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${OPENRCT2_VERSION_TAG}") From cac7438b041af479784c7b8d7bfed3f27334c9df Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Sun, 12 Sep 2021 17:33:34 -0600 Subject: [PATCH 524/681] build arm/x64 macOS app bundles, make universal bundle --- .github/workflows/ci.yml | 60 +++++++++++++++++++++++++++++++--- scripts/create-macos-universal | 28 ++++++++++++++++ 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100755 scripts/create-macos-universal diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14fac2badb..d9f1d29f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,21 +146,35 @@ jobs: echo 'Not going to push build' fi macos-cmake: - name: macOS (x64) using CMake + name: macOS using CMake runs-on: macos-latest needs: check-code-formatting + strategy: + fail-fast: false + matrix: + arch: [x86_64, arm64] + include: + - arch: x86_64 + cache_key: macos-x64 + build_flags: -DARCH="x86_64" -DWITH_TESTS=on + run_tests: true + - arch: arm64 + cache_key: macos-arm64 + build_flags: -DARCH="arm64" + run_tests: false steps: - name: Checkout uses: actions/checkout@v2 - name: ccache uses: hendrikmuhs/ccache-action@v1 with: - key: macos + key: ${{ matrix.cache_key }} - name: Build OpenRCT2 run: | HOMEBREW_NO_ANALYTICS=1 brew install ninja - . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=on + . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=on ${{ matrix.build_flags }} - name: Run Tests + if: ${{matrix.run_tests}} run: . scripts/setenv -q && run-tests - name: Build artifacts run: | @@ -173,7 +187,45 @@ jobs: - name: Upload artifacts (CI) uses: actions/upload-artifact@v2 with: - name: OpenRCT2-${{ runner.os }}-cmake + name: OpenRCT2-${{ runner.os }}-${{ matrix.arch }}-cmake + path: artifacts/openrct2-macos.zip + if-no-files-found: error + macos-universal: + name: macOS universal app bundle + runs-on: macos-latest + needs: macos-cmake + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: download x64 app bundle + uses: actions/download-artifact@v2 + with: + name: OpenRCT2-${{ runner.os }}-x86_64-cmake + path: macos_universal/x64 + - name: download arm64 app bundle + uses: actions/download-artifact@v2 + with: + name: OpenRCT2-${{ runner.os }}-arm64-cmake + path: macos_universal/arm64 + - name: Make Universal app bundle + run: | + . scripts/setenv + cd macos_universal + unzip x64/openrct2-macos.zip -d x64 + unzip arm64/openrct2-macos.zip -d arm64 + create-macos-universal + - name: Create artifact + run: | + . scripts/setenv + mkdir -p artifacts + mv macos_universal/OpenRCT2-universal.app artifacts/OpenRCT2.app + echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m" + cd artifacts + zip -rqy openrct2-macos.zip OpenRCT2.app + - name: Upload artifacts (CI) + uses: actions/upload-artifact@v2 + with: + name: OpenRCT2-${{ runner.os }}-universal path: artifacts/openrct2-macos.zip if-no-files-found: error linux-portable: diff --git a/scripts/create-macos-universal b/scripts/create-macos-universal new file mode 100755 index 0000000000..2b8f94a412 --- /dev/null +++ b/scripts/create-macos-universal @@ -0,0 +1,28 @@ +#!/bin/bash -e + +echo "Creating macOS universal app bundle" +# create app skeleton +mkdir OpenRCT2-universal.app +mkdir OpenRCT2-universal.app/Contents + +# copy all resources (most will overwrite) +mkdir OpenRCT2-universal.app/Contents/Resources +# Note: g2.dat is expected to only be in one (matching OS of build machine) +rsync -ah x64/OpenRCT2.app/Contents/Resources/* OpenRCT2-universal.app/Contents/Resources/ +rsync -ah arm64/OpenRCT2.app/Contents/Resources/* OpenRCT2-universal.app/Contents/Resources/ + +# create a universal binary +mkdir OpenRCT2-universal.app/Contents/MacOS +lipo -create x64/OpenRCT2.app/Contents/MacOS/OpenRCT2 arm64/OpenRCT2.app/Contents/MacOS/OpenRCT2 -output OpenRCT2-universal.app/Contents/MacOS/OpenRCT2 + +# copy frameworks +mkdir OpenRCT2-universal.app/Contents/Frameworks +# with the exception of libopenrct2.dylib, the Frameworks are identical and are already universal dylibs +rsync -ah --exclude 'libopenrct2.dylib' x64/OpenRCT2.app/Contents/Frameworks/* OpenRCT2-universal.app/Contents/Frameworks +lipo -create x64/OpenRCT2.app/Contents/Frameworks/libopenrct2.dylib arm64/OpenRCT2.app/Contents/Frameworks/libopenrct2.dylib -output OpenRCT2-universal.app/Contents/Frameworks/libopenrct2.dylib + +# handle Info.plist +defaults import $PWD/OpenRCT2-universal.app/Contents/Info $PWD/x64/OpenRCT2.app/Contents/Info.plist $PWD/arm64/OpenRCT2.app/Contents/Info.plist +arm64_min_ver=$(defaults read $PWD/arm64/OpenRCT2.app/Contents/Info LSMinimumSystemVersion) +x64_min_ver=$(defaults read $PWD/x64/OpenRCT2.app/Contents/Info LSMinimumSystemVersion) +defaults write $PWD/OpenRCT2-universal.app/Contents/Info LSMinimumSystemVersionByArchitecture -dict x86_64 ${x64_min_ver} arm64 ${arm64_min_ver} From 3f7a69e1f76e37d3d6b05d80bf9624726c36f3b3 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Wed, 15 Sep 2021 20:33:14 -0600 Subject: [PATCH 525/681] rename CI job to match original naming convention --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f1d29f97..1f132cb78c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,16 +146,18 @@ jobs: echo 'Not going to push build' fi macos-cmake: - name: macOS using CMake + name: macOS (${{ matrix.arch }}) using CMake runs-on: macos-latest needs: check-code-formatting strategy: fail-fast: false matrix: - arch: [x86_64, arm64] + arch: [x64, arm64] include: - - arch: x86_64 + - arch: x64 cache_key: macos-x64 + # Note: only build/run tests on the native architecture of the CI agent + # Github macos-latest agents are currently all Intel build_flags: -DARCH="x86_64" -DWITH_TESTS=on run_tests: true - arch: arm64 @@ -200,7 +202,7 @@ jobs: - name: download x64 app bundle uses: actions/download-artifact@v2 with: - name: OpenRCT2-${{ runner.os }}-x86_64-cmake + name: OpenRCT2-${{ runner.os }}-x64-cmake path: macos_universal/x64 - name: download arm64 app bundle uses: actions/download-artifact@v2 From 9dc065c2a70c7276826db2cfc7ba09e54a1a3667 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Wed, 15 Sep 2021 20:34:26 -0600 Subject: [PATCH 526/681] edit contributors --- contributors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.md b/contributors.md index 34c3d18bde..2562ce29e3 100644 --- a/contributors.md +++ b/contributors.md @@ -189,6 +189,7 @@ The following people are not part of the development team, but have been contrib * Michał Janiszewski (janisozaur) - Linux, Travis CI * Lewis Fox (LRFLEW) - macOS * Andrew Rimpici (Andy608) - macOS +* Adam Bloom (adam-bloom) - macOS, CI ## Documentation * (honzi) From ab1b0449257384984de2cfd40cc73ebd6f11b334 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Wed, 15 Sep 2021 20:35:59 -0600 Subject: [PATCH 527/681] Fix #13524: add changelog entry --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 744d2249c1..d1fb7b809e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -35,6 +35,7 @@ - Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Improved: [#3417] Crash dumps are now placed in their own folder. +- Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. From 793eba68d1bb9c1a114fd49ef98c69b5eeeaed44 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Sat, 25 Sep 2021 14:31:35 -0600 Subject: [PATCH 528/681] add additional comments on SDL resolution --- src/openrct2-ui/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2-ui/CMakeLists.txt b/src/openrct2-ui/CMakeLists.txt index 953652bb98..e1545cbd4b 100644 --- a/src/openrct2-ui/CMakeLists.txt +++ b/src/openrct2-ui/CMakeLists.txt @@ -37,6 +37,12 @@ if (APPLE) set_source_files_properties(${OPENRCT2_UI_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c++ -fmodules") if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64") # cross-compilation workaround for SDL2 + # This has been addressed upstream in https://github.com/libsdl-org/SDL/commit/bf1d7a3a15a6c090188974bec8ca84eb1903d4f7 + # Remove this workaround after: + # 1) a new SDL release is made containing that fix + # 2) The vcpkg port is updated to use that release + # 3) A new Dependencies release is made with that latest vcpkg version + # 4) That new release is used in this build set(SDL_DISABLE_IMMINTRIN_H "-DSDL_DISABLE_IMMINTRIN_H") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SDL_DISABLE_IMMINTRIN_H}") endif () From bd99738e3c697241a0b860ea874f0fafca5f2010 Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Fri, 8 Oct 2021 16:09:25 -0600 Subject: [PATCH 529/681] use new v29 release --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee40b371fc..b422d41619 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,16 +125,11 @@ if (MACOS_USE_DEPENDENCIES) # if we're building on macOS, then we need the dependencies include(cmake/download.cmake) - # TODO - change back before merging - # set(MACOS_DYLIBS_VERSION "28") - # set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-x64-macos-dylibs.zip") - # set(MACOS_DYLIBS_SHA1 "29e5480376cf4ac5943f114387e32685204c8b78") - set(MACOS_DYLIBS_VERSION "29-alpha2") + set(MACOS_DYLIBS_VERSION "29") set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-universal-macos-dylibs.zip") - set(MACOS_DYLIBS_SHA1 "bb8899c4120f1add232af7f9ac774ea622e01ad3") + set(MACOS_DYLIBS_SHA1 "86cf2db4d87173112a00042418d0d18cae360e41") set(MACOS_DYLIBS_DIR "${ROOT_DIR}/lib/macos") - # set(MACOS_DYLIBS_URL "https://github.com/OpenRCT2/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") - set(MACOS_DYLIBS_URL "https://github.com/adam-bloom/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") + set(MACOS_DYLIBS_URL "https://github.com/OpenRCT2/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}") download_openrct2_zip( ZIP_VERSION ${MACOS_DYLIBS_VERSION} From daef940bc8a42adb621c870a2e6997b38e3ac67e Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 9 Oct 2021 21:49:40 +0200 Subject: [PATCH 530/681] Fix LargeSceneryObject and WaterObject not tearing down the image ID --- distribution/changelog.txt | 1 + src/openrct2/object/LargeSceneryObject.cpp | 2 +- src/openrct2/object/WaterObject.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 744d2249c1..dbfb60cc17 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -25,6 +25,7 @@ - Fix: [#15197] Cannot place flat ride after removing it in construction window. - Fix: [#15199] Construction window is not closed when a ride gets demolished. - Fix: [#15213] Freeze when hovering over Reverse Freefall Coaster in Russian. +- Fix: [#15227] Crash on exit after hovering over water types in the Object Selection window. - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. diff --git a/src/openrct2/object/LargeSceneryObject.cpp b/src/openrct2/object/LargeSceneryObject.cpp index fa96ac5535..1ca0146744 100644 --- a/src/openrct2/object/LargeSceneryObject.cpp +++ b/src/openrct2/object/LargeSceneryObject.cpp @@ -98,7 +98,7 @@ void LargeSceneryObject::Unload() gfx_object_free_images(_baseImageId, GetImageTable().GetCount()); _legacyType.name = 0; - _legacyType.image = 0; + _baseImageId = _legacyType.image = 0; } void LargeSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index 0ea6ff11a8..3fd438619e 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -46,6 +46,7 @@ void WaterObject::Unload() language_free_object_string(_legacyType.string_idx); _legacyType.string_idx = 0; + _legacyType.image_id = 0; } void WaterObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const From ece6df313ed7661f4ae25eb2eace102fba211947 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 9 Oct 2021 23:25:36 -0600 Subject: [PATCH 531/681] remove Xcode project, update CI, update readme (#15553) --- .github/workflows/ci.yml | 38 +- OpenRCT2.xcodeproj/project.pbxproj | 4963 ----------------- .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/OpenRCT2.xcscmblueprint | 16 - .../xcshareddata/xcschemes/OpenRCT2.xcscheme | 91 - .../xcshareddata/xcschemes/PaintTest.xcscheme | 91 - readme.md | 20 +- 8 files changed, 20 insertions(+), 5214 deletions(-) delete mode 100644 OpenRCT2.xcodeproj/project.pbxproj delete mode 100644 OpenRCT2.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/OpenRCT2.xcscmblueprint delete mode 100644 OpenRCT2.xcodeproj/xcshareddata/xcschemes/OpenRCT2.xcscheme delete mode 100644 OpenRCT2.xcodeproj/xcshareddata/xcschemes/PaintTest.xcscheme diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f132cb78c..82e3b10e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,36 +115,6 @@ jobs: name: OpenRCT2-${{ matrix.platform }} path: bin/openrct2.exe if-no-files-found: error - macos-xcode: - name: macOS (x64) using Xcode - runs-on: macos-latest - needs: check-code-formatting - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Build OpenRCT2 - run: | - . scripts/setenv - xcodebuild -configuration Release - mkdir -p artifacts - mv build/Release/OpenRCT2.app artifacts - echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m" - cd artifacts - zip -rq openrct2-macos.zip OpenRCT2.app - - name: Upload artifacts (CI) - uses: actions/upload-artifact@v2 - with: - name: OpenRCT2-${{ runner.os }}-xcode - path: artifacts/openrct2-macos.zip - if-no-files-found: error - - name: Upload artifacts (openrct2.org) - run: | - . scripts/setenv - if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/openrct2-macos.zip macos $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - else - echo 'Not going to push build' - fi macos-cmake: name: macOS (${{ matrix.arch }}) using CMake runs-on: macos-latest @@ -230,6 +200,14 @@ jobs: name: OpenRCT2-${{ runner.os }}-universal path: artifacts/openrct2-macos.zip if-no-files-found: error + - name: Upload artifacts (openrct2.org) + run: | + . scripts/setenv + if [[ "$OPENRCT2_PUSH" == "true" ]]; then + upload-build artifacts/openrct2-macos.zip macos $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + else + echo 'Not going to push build' + fi linux-portable: name: Linux (${{ matrix.platform }}, portable) runs-on: ubuntu-latest diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj deleted file mode 100644 index db876478bd..0000000000 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ /dev/null @@ -1,4963 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXAggregateTarget section */ - C68B2D431EC790690020651C /* Download Libraries */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C68B2D461EC790690020651C /* Build configuration list for PBXAggregateTarget "Download Libraries" */; - buildPhases = ( - C68B2D471EC790710020651C /* Download Libraries */, - ); - dependencies = ( - ); - name = "Download Libraries"; - productName = "Download Libraries"; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 01C6F0C222FD519E0057E2F7 /* TrackImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01C6F0C022FD519E0057E2F7 /* TrackImporter.cpp */; }; - 01C6F0C422FD51B70057E2F7 /* T4Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01C6F0C322FD51B70057E2F7 /* T4Importer.cpp */; }; - 01C6F0C822FD51FC0057E2F7 /* T6Exporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01C6F0C522FD51FC0057E2F7 /* T6Exporter.cpp */; }; - 01C6F0C922FD51FC0057E2F7 /* T6Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01C6F0C622FD51FC0057E2F7 /* T6Importer.cpp */; }; - 01DDFE6522FD608500221318 /* Window_internal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01DDFE6422FD608500221318 /* Window_internal.cpp */; }; - 20DE495F25DA8C6B00F2DF6D /* TileElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20DE495E25DA8C6B00F2DF6D /* TileElementBase.cpp */; }; - 2A1F4FE1221FF4B0003CA045 /* Audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83571EC4E7CC00FA49E2 /* Audio.cpp */; }; - 2A1F4FE2221FF4B0003CA045 /* macos.mm in Sources */ = {isa = PBXBuildFile; fileRef = F76C845D1EC4E7CC00FA49E2 /* macos.mm */; }; - 2ADE2F27224418B2002598AF /* Random.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F21224418B1002598AF /* Random.hpp */; }; - 2ADE2F28224418B2002598AF /* DataSerialiserTag.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F22224418B1002598AF /* DataSerialiserTag.h */; }; - 2ADE2F29224418B2002598AF /* Numerics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F23224418B1002598AF /* Numerics.hpp */; }; - 2ADE2F2A224418B2002598AF /* Meta.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F24224418B2002598AF /* Meta.hpp */; }; - 2ADE2F2C224418B2002598AF /* FileIndex.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F26224418B2002598AF /* FileIndex.hpp */; }; - 2ADE2F2E224418E7002598AF /* ConversionTables.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F2D224418E7002598AF /* ConversionTables.h */; }; - 2ADE2F3122441905002598AF /* DiscordService.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F2F22441905002598AF /* DiscordService.h */; }; - 2ADE2F3222441905002598AF /* DiscordService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ADE2F3022441905002598AF /* DiscordService.cpp */; }; - 2ADE2F342244191E002598AF /* VirtualFloor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F332244191E002598AF /* VirtualFloor.h */; }; - 2ADE2F3622441960002598AF /* RideTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F352244195F002598AF /* RideTypes.h */; }; - 2ADE2F382244198B002598AF /* SpriteBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ADE2F372244198A002598AF /* SpriteBase.h */; }; - 304FE95023A2996600470197 /* SceneryScatter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 304FE94F23A2996600470197 /* SceneryScatter.cpp */; }; - 4C1EE63D24AB4A2700D7177F /* HybridCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C1EE63C24AB4A2700D7177F /* HybridCoaster.cpp */; }; - 4C255958244A328B00CE7E45 /* CustomMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C25594F244A328A00CE7E45 /* CustomMenu.cpp */; }; - 4C255959244A328B00CE7E45 /* UiExtensions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C255954244A328A00CE7E45 /* UiExtensions.cpp */; }; - 4C25595A244A328B00CE7E45 /* CustomWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C255957244A328B00CE7E45 /* CustomWindow.cpp */; }; - 4C29DEB3218C6AE500E8707F /* RCT12.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C29DEB2218C6AE500E8707F /* RCT12.cpp */; }; - 4C2BF6C4258FF2FB005CD9A0 /* SingleRailRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C2BF6C3258FF2FB005CD9A0 /* SingleRailRollerCoaster.cpp */; }; - 4C358E5221C445F700ADE6BC /* ReplayManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C358E5021C445F700ADE6BC /* ReplayManager.cpp */; }; - 4C3B4236205914F7000C5BB7 /* InGameConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C3B4234205914F7000C5BB7 /* InGameConsole.cpp */; }; - 4C724B2221F0AD790012ADD0 /* BenchSpriteSort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C724B2121F0AD790012ADD0 /* BenchSpriteSort.cpp */; }; - 4C81F7E124672C4D000E61BF /* CustomListView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C81F7DF24672C4D000E61BF /* CustomListView.cpp */; }; - 4C882FBA25FEA80E0039D1C4 /* TrainManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C882FB825FEA80D0039D1C4 /* TrainManager.cpp */; }; - 4C8A6FF323EB5326001A8255 /* Http.cURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8A6FF223EB5326001A8255 /* Http.cURL.cpp */; }; - 4C8BB67925533D4C005C8830 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB67825533D4C005C8830 /* FileStream.cpp */; }; - 4C8BB67C25533D59005C8830 /* JobPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB67B25533D59005C8830 /* JobPool.cpp */; }; - 4C8BB68125533D65005C8830 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB67D25533D64005C8830 /* StringBuilder.cpp */; }; - 4C8BB68225533D65005C8830 /* StringReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB67E25533D64005C8830 /* StringReader.cpp */; }; - 4C8BB68525533DB9005C8830 /* ZoomLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8BB68425533DB9005C8830 /* ZoomLevel.cpp */; }; - 4C91FD5F25AE476700CA5DA4 /* MusicObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C91FD5D25AE476700CA5DA4 /* MusicObject.cpp */; }; - 4C91FD6225AE483700CA5DA4 /* RideAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C91FD6025AE483600CA5DA4 /* RideAudio.cpp */; }; - 4C976BC5263976F0002DEBD5 /* FootpathSurfaceObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */; }; - 4C976BC6263976F0002DEBD5 /* FootpathRailingsObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */; }; - 4CA23D64263C91D800077AA1 /* ChecksumStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23D62263C91D700077AA1 /* ChecksumStream.cpp */; }; - 4CA23DB2263C920900077AA1 /* Entity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23DB1263C920900077AA1 /* Entity.cpp */; }; - 4CA39E512513F8A00094066B /* RTL.ICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA39E4E2513F8A00094066B /* RTL.ICU.cpp */; }; - 4CA39E522513F8A00094066B /* RTL.FriBidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA39E502513F8A00094066B /* RTL.FriBidi.cpp */; }; - 4CB1375621C2E9F80029FCDA /* SimulateCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB1375521C2E9F80029FCDA /* SimulateCommands.cpp */; }; - 4CB2716A24195B45000CF9EE /* VehicleSubpositionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB2716824195B45000CF9EE /* VehicleSubpositionData.cpp */; }; - 4CB30179249E382B0034A7F6 /* RCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB30178249E382B0034A7F6 /* RCT2.cpp */; }; - 4CB991C525CEE53B00C692B4 /* InputManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB991C425CEE53A00C692B4 /* InputManager.cpp */; }; - 4CB991CB25CEE54500C692B4 /* ShortcutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB991C625CEE54400C692B4 /* ShortcutManager.cpp */; }; - 4CB991CC25CEE54500C692B4 /* Shortcuts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB991C725CEE54500C692B4 /* Shortcuts.cpp */; }; - 4CB991CD25CEE54500C692B4 /* ShortcutInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB991C925CEE54500C692B4 /* ShortcutInput.cpp */; }; - 4CC5258223A19C2900D4366D /* TrackDesignAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC5258123A19C2800D4366D /* TrackDesignAction.cpp */; }; - 4CF67197206B7E720034ADDD /* object in Resources */ = {isa = PBXBuildFile; fileRef = 4CF67196206B7E720034ADDD /* object */; }; - 631D7A3625F590A100EA2B45 /* openrct2.icns in Resources */ = {isa = PBXBuildFile; fileRef = 631D7A3525F590A100EA2B45 /* openrct2.icns */; }; - 6341F4E12400AA0F0052902B /* Drawing.Sprite.RLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6341F4DF2400AA0E0052902B /* Drawing.Sprite.RLE.cpp */; }; - 6341F4E22400AA0F0052902B /* Drawing.Sprite.BMP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6341F4E02400AA0F0052902B /* Drawing.Sprite.BMP.cpp */; }; - 6691257925FD2C4900B038E1 /* libbrotlicommon.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254625FD2C1300B038E1 /* libbrotlicommon.1.dylib */; }; - 6691257A25FD2C4900B038E1 /* libbrotlidec.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254125FD2C1300B038E1 /* libbrotlidec.1.dylib */; }; - 6691257B25FD2C4900B038E1 /* libbrotlienc.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254825FD2C1300B038E1 /* libbrotlienc.1.dylib */; }; - 6691257C25FD2C4900B038E1 /* libbz2.1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254525FD2C1300B038E1 /* libbz2.1.0.dylib */; }; - 6691257E25FD2C4900B038E1 /* libdiscord-rpc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */; }; - 6691257F25FD2C4900B038E1 /* libduktape.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254225FD2C1300B038E1 /* libduktape.2.dylib */; }; - 6691258025FD2C4900B038E1 /* libfreetype.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */; }; - 6691258125FD2C4900B038E1 /* libicudata.67.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254725FD2C1300B038E1 /* libicudata.67.dylib */; }; - 6691258225FD2C4900B038E1 /* libicui18n.67.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254425FD2C1300B038E1 /* libicui18n.67.dylib */; }; - 6691258325FD2C4900B038E1 /* libicuio.67.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254A25FD2C1300B038E1 /* libicuio.67.dylib */; }; - 6691258425FD2C4900B038E1 /* libicutu.67.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255125FD2C1400B038E1 /* libicutu.67.dylib */; }; - 6691258525FD2C4900B038E1 /* libicuuc.67.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254025FD2C1300B038E1 /* libicuuc.67.dylib */; }; - 6691258625FD2C4900B038E1 /* libpng16.16.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */; }; - 6691258825FD2C4900B038E1 /* libspeexdsp.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */; }; - 6691258925FD2C4900B038E1 /* libssl.1.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254E25FD2C1400B038E1 /* libssl.1.1.dylib */; }; - 6691258A25FD2C4900B038E1 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255025FD2C1400B038E1 /* libz.1.dylib */; }; - 6691258B25FD2C4900B038E1 /* libzip.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255225FD2C1400B038E1 /* libzip.5.dylib */; }; - 6691258C25FD2C5200B038E1 /* libbrotlicommon.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254625FD2C1300B038E1 /* libbrotlicommon.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691258D25FD2C5200B038E1 /* libbrotlidec.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254125FD2C1300B038E1 /* libbrotlidec.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691258E25FD2C5200B038E1 /* libbrotlienc.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254825FD2C1300B038E1 /* libbrotlienc.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691258F25FD2C5200B038E1 /* libbz2.1.0.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254525FD2C1300B038E1 /* libbz2.1.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259125FD2C5200B038E1 /* libdiscord-rpc.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259225FD2C5200B038E1 /* libduktape.2.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254225FD2C1300B038E1 /* libduktape.2.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259325FD2C5200B038E1 /* libfreetype.6.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259425FD2C5200B038E1 /* libicudata.67.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254725FD2C1300B038E1 /* libicudata.67.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259525FD2C5200B038E1 /* libicui18n.67.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254425FD2C1300B038E1 /* libicui18n.67.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259625FD2C5200B038E1 /* libicuio.67.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254A25FD2C1300B038E1 /* libicuio.67.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259725FD2C5200B038E1 /* libicutu.67.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255125FD2C1400B038E1 /* libicutu.67.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259825FD2C5200B038E1 /* libicuuc.67.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254025FD2C1300B038E1 /* libicuuc.67.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259925FD2C5200B038E1 /* libpng16.16.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259B25FD2C5200B038E1 /* libspeexdsp.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259C25FD2C5200B038E1 /* libssl.1.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254E25FD2C1400B038E1 /* libssl.1.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259D25FD2C5200B038E1 /* libz.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255025FD2C1400B038E1 /* libz.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 6691259E25FD2C5200B038E1 /* libzip.5.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255225FD2C1400B038E1 /* libzip.5.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125A225FD2C7C00B038E1 /* libcrypto.1.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */; }; - 669125A325FD2C9100B038E1 /* libcrypto.1.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125A725FD2CBF00B038E1 /* libSDL2-2.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A625FD2CBF00B038E1 /* libSDL2-2.0.dylib */; }; - 669125A825FD2CD200B038E1 /* libSDL2-2.0.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A625FD2CBF00B038E1 /* libSDL2-2.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125AB25FD2DF400B038E1 /* libdiscord-rpc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */; }; - 669125AC25FD2DFD00B038E1 /* libcrypto.1.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */; }; - 669125AD25FD2E0400B038E1 /* libfreetype.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */; }; - 669125AE25FD2E0800B038E1 /* libpng16.16.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */; }; - 669125AF25FD2E1000B038E1 /* libspeexdsp.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */; }; - 669125B025FD2E1500B038E1 /* libzip.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255225FD2C1400B038E1 /* libzip.5.dylib */; }; - 669125B125FD2E4200B038E1 /* libcrypto.1.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125B225FD2E4200B038E1 /* libdiscord-rpc.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125B325FD2E4200B038E1 /* libfreetype.6.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125B425FD2E4200B038E1 /* libpng16.16.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125B525FD2E4200B038E1 /* libspeexdsp.1.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 669125B625FD2E4200B038E1 /* libzip.5.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6691255225FD2C1400B038E1 /* libzip.5.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 66A10EA2257F1DE100DD651A /* BalloonPressAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EA0257F1DE000DD651A /* BalloonPressAction.cpp */; }; - 66A10EA3257F1DE100DD651A /* BalloonPressAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EA1257F1DE000DD651A /* BalloonPressAction.h */; }; - 66A10EC0257F1DF800DD651A /* BannerPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EA6257F1DF600DD651A /* BannerPlaceAction.cpp */; }; - 66A10EC1257F1DF800DD651A /* FootpathAdditionRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EA7257F1DF600DD651A /* FootpathAdditionRemoveAction.h */; }; - 66A10EC2257F1DF800DD651A /* FootpathRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EA8257F1DF600DD651A /* FootpathRemoveAction.h */; }; - 66A10EC3257F1DF800DD651A /* FootpathPlaceFromTrackAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EA9257F1DF600DD651A /* FootpathPlaceFromTrackAction.cpp */; }; - 66A10EC4257F1DF800DD651A /* FootpathAdditionPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EAA257F1DF600DD651A /* FootpathAdditionPlaceAction.cpp */; }; - 66A10EC5257F1DF800DD651A /* BannerSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EAB257F1DF600DD651A /* BannerSetNameAction.cpp */; }; - 66A10EC6257F1DF800DD651A /* FootpathPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EAC257F1DF600DD651A /* FootpathPlaceAction.h */; }; - 66A10EC7257F1DF800DD651A /* FootpathRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EAD257F1DF700DD651A /* FootpathRemoveAction.cpp */; }; - 66A10EC8257F1DF800DD651A /* BannerPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EAE257F1DF700DD651A /* BannerPlaceAction.h */; }; - 66A10EC9257F1DF800DD651A /* CustomAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EAF257F1DF700DD651A /* CustomAction.h */; }; - 66A10ECA257F1DF800DD651A /* ClimateSetAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EB0257F1DF700DD651A /* ClimateSetAction.h */; }; - 66A10ECB257F1DF800DD651A /* BannerSetStyleAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB1257F1DF700DD651A /* BannerSetStyleAction.cpp */; }; - 66A10ECC257F1DF800DD651A /* ClearAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB2257F1DF700DD651A /* ClearAction.cpp */; }; - 66A10ECD257F1DF800DD651A /* BannerRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB3257F1DF700DD651A /* BannerRemoveAction.cpp */; }; - 66A10ECE257F1DF800DD651A /* BannerSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EB4257F1DF700DD651A /* BannerSetNameAction.h */; }; - 66A10ECF257F1DF800DD651A /* ClimateSetAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB5257F1DF700DD651A /* ClimateSetAction.cpp */; }; - 66A10ED0257F1DF800DD651A /* BannerSetColourAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EB6257F1DF700DD651A /* BannerSetColourAction.h */; }; - 66A10ED1257F1DF800DD651A /* CustomAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB7257F1DF700DD651A /* CustomAction.cpp */; }; - 66A10ED2257F1DF800DD651A /* FootpathAdditionRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EB8257F1DF700DD651A /* FootpathAdditionRemoveAction.cpp */; }; - 66A10ED3257F1DF800DD651A /* BannerRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EB9257F1DF700DD651A /* BannerRemoveAction.h */; }; - 66A10ED4257F1DF800DD651A /* ClearAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EBA257F1DF700DD651A /* ClearAction.h */; }; - 66A10ED5257F1DF800DD651A /* BannerSetStyleAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EBB257F1DF700DD651A /* BannerSetStyleAction.h */; }; - 66A10ED6257F1DF800DD651A /* FootpathPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EBC257F1DF800DD651A /* FootpathPlaceAction.cpp */; }; - 66A10ED7257F1DF800DD651A /* FootpathPlaceFromTrackAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EBD257F1DF800DD651A /* FootpathPlaceFromTrackAction.h */; }; - 66A10ED8257F1DF800DD651A /* BannerSetColourAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EBE257F1DF800DD651A /* BannerSetColourAction.cpp */; }; - 66A10ED9257F1DF800DD651A /* FootpathAdditionPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EBF257F1DF800DD651A /* FootpathAdditionPlaceAction.h */; }; - 66A10F4C257F1E1700DD651A /* PlaceParkEntranceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EDC257F1E1000DD651A /* PlaceParkEntranceAction.h */; }; - 66A10F4D257F1E1700DD651A /* StaffSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EDD257F1E1000DD651A /* StaffSetNameAction.h */; }; - 66A10F4E257F1E1700DD651A /* PauseToggleAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EDE257F1E1000DD651A /* PauseToggleAction.h */; }; - 66A10F4F257F1E1700DD651A /* ParkSetDateAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EDF257F1E1000DD651A /* ParkSetDateAction.h */; }; - 66A10F50257F1E1700DD651A /* ParkEntranceRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EE0257F1E1000DD651A /* ParkEntranceRemoveAction.h */; }; - 66A10F51257F1E1700DD651A /* RideDemolishAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EE1257F1E1100DD651A /* RideDemolishAction.h */; }; - 66A10F52257F1E1700DD651A /* StaffSetCostumeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EE2257F1E1100DD651A /* StaffSetCostumeAction.cpp */; }; - 66A10F53257F1E1700DD651A /* LandLowerAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EE3257F1E1100DD651A /* LandLowerAction.h */; }; - 66A10F54257F1E1700DD651A /* RideSetAppearanceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EE4257F1E1100DD651A /* RideSetAppearanceAction.h */; }; - 66A10F55257F1E1700DD651A /* SurfaceSetStyleAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EE5257F1E1100DD651A /* SurfaceSetStyleAction.cpp */; }; - 66A10F56257F1E1700DD651A /* SmallSceneryRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EE6257F1E1100DD651A /* SmallSceneryRemoveAction.h */; }; - 66A10F57257F1E1700DD651A /* RideSetAppearanceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EE7257F1E1100DD651A /* RideSetAppearanceAction.cpp */; }; - 66A10F58257F1E1700DD651A /* StaffSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EE8257F1E1100DD651A /* StaffSetNameAction.cpp */; }; - 66A10F59257F1E1700DD651A /* SetCheatAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EE9257F1E1100DD651A /* SetCheatAction.cpp */; }; - 66A10F5A257F1E1700DD651A /* GuestSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EEA257F1E1100DD651A /* GuestSetNameAction.h */; }; - 66A10F5B257F1E1700DD651A /* GuestSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EEB257F1E1100DD651A /* GuestSetNameAction.cpp */; }; - 66A10F5C257F1E1700DD651A /* SetParkEntranceFeeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EEC257F1E1100DD651A /* SetParkEntranceFeeAction.h */; }; - 66A10F5D257F1E1700DD651A /* RideSetStatusAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EED257F1E1100DD651A /* RideSetStatusAction.h */; }; - 66A10F5E257F1E1700DD651A /* LargeSceneryRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EEE257F1E1100DD651A /* LargeSceneryRemoveAction.h */; }; - 66A10F5F257F1E1700DD651A /* SmallScenerySetColourAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EEF257F1E1200DD651A /* SmallScenerySetColourAction.h */; }; - 66A10F60257F1E1700DD651A /* ParkEntranceRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EF0257F1E1200DD651A /* ParkEntranceRemoveAction.cpp */; }; - 66A10F61257F1E1700DD651A /* PlaceParkEntranceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EF1257F1E1200DD651A /* PlaceParkEntranceAction.cpp */; }; - 66A10F62257F1E1700DD651A /* SurfaceSetStyleAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF2257F1E1200DD651A /* SurfaceSetStyleAction.h */; }; - 66A10F63257F1E1700DD651A /* PlayerKickAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF3257F1E1200DD651A /* PlayerKickAction.h */; }; - 66A10F64257F1E1700DD651A /* LandRaiseAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EF4257F1E1200DD651A /* LandRaiseAction.cpp */; }; - 66A10F65257F1E1700DD651A /* TileModifyAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF5257F1E1200DD651A /* TileModifyAction.h */; }; - 66A10F66257F1E1700DD651A /* RideSetVehicleAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EF6257F1E1200DD651A /* RideSetVehicleAction.cpp */; }; - 66A10F67257F1E1700DD651A /* RideEntranceExitPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF7257F1E1200DD651A /* RideEntranceExitPlaceAction.h */; }; - 66A10F68257F1E1800DD651A /* NetworkModifyGroupAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF8257F1E1200DD651A /* NetworkModifyGroupAction.h */; }; - 66A10F69257F1E1800DD651A /* ParkSetLoanAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EF9257F1E1200DD651A /* ParkSetLoanAction.h */; }; - 66A10F6A257F1E1800DD651A /* LargeScenerySetColourAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EFA257F1E1200DD651A /* LargeScenerySetColourAction.cpp */; }; - 66A10F6B257F1E1800DD651A /* ParkSetLoanAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EFB257F1E1200DD651A /* ParkSetLoanAction.cpp */; }; - 66A10F6C257F1E1800DD651A /* LoadOrQuitAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EFC257F1E1200DD651A /* LoadOrQuitAction.cpp */; }; - 66A10F6D257F1E1800DD651A /* ParkSetParameterAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EFD257F1E1200DD651A /* ParkSetParameterAction.cpp */; }; - 66A10F6E257F1E1800DD651A /* LandRaiseAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10EFE257F1E1200DD651A /* LandRaiseAction.h */; }; - 66A10F6F257F1E1800DD651A /* RideEntranceExitPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10EFF257F1E1200DD651A /* RideEntranceExitPlaceAction.cpp */; }; - 66A10F70257F1E1800DD651A /* ParkSetDateAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F00257F1E1300DD651A /* ParkSetDateAction.cpp */; }; - 66A10F71257F1E1800DD651A /* StaffSetColourAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F01257F1E1300DD651A /* StaffSetColourAction.cpp */; }; - 66A10F72257F1E1800DD651A /* PlacePeepSpawnAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F02257F1E1300DD651A /* PlacePeepSpawnAction.h */; }; - 66A10F73257F1E1800DD651A /* LandSetHeightAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F03257F1E1300DD651A /* LandSetHeightAction.h */; }; - 66A10F74257F1E1800DD651A /* RideEntranceExitRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F04257F1E1300DD651A /* RideEntranceExitRemoveAction.h */; }; - 66A10F75257F1E1800DD651A /* RideSetPriceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F05257F1E1300DD651A /* RideSetPriceAction.cpp */; }; - 66A10F76257F1E1800DD651A /* SmallSceneryRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F06257F1E1300DD651A /* SmallSceneryRemoveAction.cpp */; }; - 66A10F77257F1E1800DD651A /* StaffSetOrdersAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F07257F1E1300DD651A /* StaffSetOrdersAction.h */; }; - 66A10F78257F1E1800DD651A /* StaffSetColourAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F08257F1E1300DD651A /* StaffSetColourAction.h */; }; - 66A10F79257F1E1800DD651A /* RideCreateAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F09257F1E1300DD651A /* RideCreateAction.cpp */; }; - 66A10F7A257F1E1800DD651A /* RideSetSettingAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F0A257F1E1300DD651A /* RideSetSettingAction.cpp */; }; - 66A10F7B257F1E1800DD651A /* MazeSetTrackAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F0B257F1E1300DD651A /* MazeSetTrackAction.h */; }; - 66A10F7C257F1E1800DD651A /* StaffHireNewAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F0C257F1E1300DD651A /* StaffHireNewAction.cpp */; }; - 66A10F7D257F1E1800DD651A /* ParkSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F0D257F1E1300DD651A /* ParkSetNameAction.cpp */; }; - 66A10F7E257F1E1800DD651A /* RideSetColourSchemeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F0E257F1E1300DD651A /* RideSetColourSchemeAction.cpp */; }; - 66A10F7F257F1E1800DD651A /* MazePlaceTrackAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F0F257F1E1300DD651A /* MazePlaceTrackAction.cpp */; }; - 66A10F80257F1E1800DD651A /* NetworkModifyGroupAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F10257F1E1400DD651A /* NetworkModifyGroupAction.cpp */; }; - 66A10F81257F1E1800DD651A /* RideSetVehicleAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F11257F1E1400DD651A /* RideSetVehicleAction.h */; }; - 66A10F82257F1E1800DD651A /* PlayerSetGroupAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F12257F1E1400DD651A /* PlayerSetGroupAction.cpp */; }; - 66A10F83257F1E1800DD651A /* PlayerSetGroupAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F13257F1E1400DD651A /* PlayerSetGroupAction.h */; }; - 66A10F84257F1E1800DD651A /* StaffSetPatrolAreaAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F14257F1E1400DD651A /* StaffSetPatrolAreaAction.h */; }; - 66A10F85257F1E1800DD651A /* LandSetHeightAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F15257F1E1400DD651A /* LandSetHeightAction.cpp */; }; - 66A10F86257F1E1800DD651A /* LoadOrQuitAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F16257F1E1400DD651A /* LoadOrQuitAction.h */; }; - 66A10F87257F1E1800DD651A /* SmallSceneryPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F17257F1E1400DD651A /* SmallSceneryPlaceAction.h */; }; - 66A10F88257F1E1800DD651A /* SignSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F18257F1E1400DD651A /* SignSetNameAction.h */; }; - 66A10F89257F1E1800DD651A /* PauseToggleAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F19257F1E1400DD651A /* PauseToggleAction.cpp */; }; - 66A10F8A257F1E1800DD651A /* ParkSetResearchFundingAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1A257F1E1400DD651A /* ParkSetResearchFundingAction.h */; }; - 66A10F8B257F1E1800DD651A /* LandSmoothAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1B257F1E1400DD651A /* LandSmoothAction.h */; }; - 66A10F8C257F1E1800DD651A /* RideCreateAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1C257F1E1400DD651A /* RideCreateAction.h */; }; - 66A10F8D257F1E1800DD651A /* GuestSetFlagsAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1D257F1E1400DD651A /* GuestSetFlagsAction.h */; }; - 66A10F8E257F1E1800DD651A /* LandSetRightsAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1E257F1E1400DD651A /* LandSetRightsAction.h */; }; - 66A10F8F257F1E1800DD651A /* StaffSetCostumeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F1F257F1E1500DD651A /* StaffSetCostumeAction.h */; }; - 66A10F90257F1E1800DD651A /* MazePlaceTrackAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F20257F1E1500DD651A /* MazePlaceTrackAction.h */; }; - 66A10F91257F1E1800DD651A /* StaffHireNewAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F21257F1E1500DD651A /* StaffHireNewAction.h */; }; - 66A10F92257F1E1800DD651A /* ParkSetParameterAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F22257F1E1500DD651A /* ParkSetParameterAction.h */; }; - 66A10F93257F1E1800DD651A /* LandSmoothAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F23257F1E1500DD651A /* LandSmoothAction.cpp */; }; - 66A10F94257F1E1800DD651A /* StaffSetOrdersAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F24257F1E1500DD651A /* StaffSetOrdersAction.cpp */; }; - 66A10F95257F1E1800DD651A /* GuestSetFlagsAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F25257F1E1500DD651A /* GuestSetFlagsAction.cpp */; }; - 66A10F96257F1E1800DD651A /* SignSetStyleAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F26257F1E1500DD651A /* SignSetStyleAction.h */; }; - 66A10F97257F1E1800DD651A /* SetCheatAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F27257F1E1500DD651A /* SetCheatAction.h */; }; - 66A10F98257F1E1800DD651A /* PlacePeepSpawnAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F28257F1E1500DD651A /* PlacePeepSpawnAction.cpp */; }; - 66A10F99257F1E1800DD651A /* LargeScenerySetColourAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F29257F1E1500DD651A /* LargeScenerySetColourAction.h */; }; - 66A10F9A257F1E1800DD651A /* StaffFireAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F2A257F1E1500DD651A /* StaffFireAction.h */; }; - 66A10F9B257F1E1800DD651A /* ParkSetResearchFundingAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F2B257F1E1500DD651A /* ParkSetResearchFundingAction.cpp */; }; - 66A10F9C257F1E1800DD651A /* PeepPickupAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F2C257F1E1500DD651A /* PeepPickupAction.cpp */; }; - 66A10F9D257F1E1800DD651A /* StaffFireAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F2D257F1E1500DD651A /* StaffFireAction.cpp */; }; - 66A10F9E257F1E1800DD651A /* ParkMarketingAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F2E257F1E1600DD651A /* ParkMarketingAction.cpp */; }; - 66A10F9F257F1E1800DD651A /* LandBuyRightsAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F2F257F1E1600DD651A /* LandBuyRightsAction.h */; }; - 66A10FA0257F1E1800DD651A /* StaffSetPatrolAreaAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F30257F1E1600DD651A /* StaffSetPatrolAreaAction.cpp */; }; - 66A10FA1257F1E1800DD651A /* SmallScenerySetColourAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F31257F1E1600DD651A /* SmallScenerySetColourAction.cpp */; }; - 66A10FA2257F1E1800DD651A /* LargeSceneryPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F32257F1E1600DD651A /* LargeSceneryPlaceAction.h */; }; - 66A10FA3257F1E1800DD651A /* LandLowerAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F33257F1E1600DD651A /* LandLowerAction.cpp */; }; - 66A10FA4257F1E1800DD651A /* RideSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F34257F1E1600DD651A /* RideSetNameAction.cpp */; }; - 66A10FA5257F1E1800DD651A /* RideSetPriceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F35257F1E1600DD651A /* RideSetPriceAction.h */; }; - 66A10FA6257F1E1800DD651A /* ParkMarketingAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F36257F1E1600DD651A /* ParkMarketingAction.h */; }; - 66A10FA7257F1E1800DD651A /* PeepPickupAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F37257F1E1600DD651A /* PeepPickupAction.h */; }; - 66A10FA8257F1E1800DD651A /* RideEntranceExitRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F38257F1E1600DD651A /* RideEntranceExitRemoveAction.cpp */; }; - 66A10FA9257F1E1800DD651A /* ParkSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F39257F1E1600DD651A /* ParkSetNameAction.h */; }; - 66A10FAA257F1E1800DD651A /* SetParkEntranceFeeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F3A257F1E1600DD651A /* SetParkEntranceFeeAction.cpp */; }; - 66A10FAB257F1E1800DD651A /* LandSetRightsAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F3B257F1E1600DD651A /* LandSetRightsAction.cpp */; }; - 66A10FAC257F1E1800DD651A /* RideSetSettingAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F3C257F1E1600DD651A /* RideSetSettingAction.h */; }; - 66A10FAD257F1E1800DD651A /* TileModifyAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F3D257F1E1700DD651A /* TileModifyAction.cpp */; }; - 66A10FAE257F1E1800DD651A /* SmallSceneryPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F3E257F1E1700DD651A /* SmallSceneryPlaceAction.cpp */; }; - 66A10FAF257F1E1800DD651A /* RideSetNameAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F3F257F1E1700DD651A /* RideSetNameAction.h */; }; - 66A10FB0257F1E1800DD651A /* SignSetStyleAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F40257F1E1700DD651A /* SignSetStyleAction.cpp */; }; - 66A10FB1257F1E1800DD651A /* RideDemolishAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F41257F1E1700DD651A /* RideDemolishAction.cpp */; }; - 66A10FB2257F1E1800DD651A /* LargeSceneryRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F42257F1E1700DD651A /* LargeSceneryRemoveAction.cpp */; }; - 66A10FB3257F1E1800DD651A /* MazeSetTrackAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F43257F1E1700DD651A /* MazeSetTrackAction.cpp */; }; - 66A10FB4257F1E1800DD651A /* ScenarioSetSettingAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F44257F1E1700DD651A /* ScenarioSetSettingAction.cpp */; }; - 66A10FB5257F1E1800DD651A /* SignSetNameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F45257F1E1700DD651A /* SignSetNameAction.cpp */; }; - 66A10FB6257F1E1800DD651A /* RideSetColourSchemeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F46257F1E1700DD651A /* RideSetColourSchemeAction.h */; }; - 66A10FB7257F1E1800DD651A /* LandBuyRightsAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F47257F1E1700DD651A /* LandBuyRightsAction.cpp */; }; - 66A10FB8257F1E1800DD651A /* ScenarioSetSettingAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10F48257F1E1700DD651A /* ScenarioSetSettingAction.h */; }; - 66A10FB9257F1E1800DD651A /* RideSetStatusAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F49257F1E1700DD651A /* RideSetStatusAction.cpp */; }; - 66A10FBA257F1E1800DD651A /* PlayerKickAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F4A257F1E1700DD651A /* PlayerKickAction.cpp */; }; - 66A10FBB257F1E1800DD651A /* LargeSceneryPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10F4B257F1E1700DD651A /* LargeSceneryPlaceAction.cpp */; }; - 66A10FD0257F1E3000DD651A /* TrackPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FBE257F1E2D00DD651A /* TrackPlaceAction.h */; }; - 66A10FD1257F1E3000DD651A /* WaterRaiseAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FBF257F1E2D00DD651A /* WaterRaiseAction.cpp */; }; - 66A10FD2257F1E3000DD651A /* WallPlaceAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC0257F1E2D00DD651A /* WallPlaceAction.h */; }; - 66A10FD3257F1E3000DD651A /* TrackRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC1257F1E2D00DD651A /* TrackRemoveAction.h */; }; - 66A10FD4257F1E3000DD651A /* TrackSetBrakeSpeedAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FC2257F1E2E00DD651A /* TrackSetBrakeSpeedAction.cpp */; }; - 66A10FD5257F1E3000DD651A /* WaterRaiseAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC3257F1E2E00DD651A /* WaterRaiseAction.h */; }; - 66A10FD6257F1E3000DD651A /* WallRemoveAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC4257F1E2E00DD651A /* WallRemoveAction.h */; }; - 66A10FD7257F1E3000DD651A /* WaterLowerAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC5257F1E2E00DD651A /* WaterLowerAction.h */; }; - 66A10FD8257F1E3000DD651A /* TrackRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FC6257F1E2E00DD651A /* TrackRemoveAction.cpp */; }; - 66A10FD9257F1E3000DD651A /* WaterSetHeightAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FC7257F1E2E00DD651A /* WaterSetHeightAction.cpp */; }; - 66A10FDA257F1E3000DD651A /* WaterSetHeightAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FC8257F1E2F00DD651A /* WaterSetHeightAction.h */; }; - 66A10FDB257F1E3000DD651A /* WallPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FC9257F1E2F00DD651A /* WallPlaceAction.cpp */; }; - 66A10FDC257F1E3000DD651A /* TrackPlaceAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FCA257F1E2F00DD651A /* TrackPlaceAction.cpp */; }; - 66A10FDD257F1E3000DD651A /* WallSetColourAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FCB257F1E2F00DD651A /* WallSetColourAction.h */; }; - 66A10FDE257F1E3000DD651A /* WaterLowerAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FCC257F1E2F00DD651A /* WaterLowerAction.cpp */; }; - 66A10FDF257F1E3000DD651A /* TrackSetBrakeSpeedAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A10FCD257F1E2F00DD651A /* TrackSetBrakeSpeedAction.h */; }; - 66A10FE0257F1E3000DD651A /* WallRemoveAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FCE257F1E2F00DD651A /* WallRemoveAction.cpp */; }; - 66A10FE1257F1E3000DD651A /* WallSetColourAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66A10FCF257F1E3000DD651A /* WallSetColourAction.cpp */; }; - 9308D9FE209908090079EE96 /* TileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FA209908080079EE96 /* TileElement.cpp */; }; - 9308D9FF209908090079EE96 /* TileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FA209908080079EE96 /* TileElement.cpp */; }; - 9308DA00209908090079EE96 /* TileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FA209908080079EE96 /* TileElement.cpp */; }; - 9308DA01209908090079EE96 /* Surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FB209908080079EE96 /* Surface.cpp */; }; - 9308DA02209908090079EE96 /* Surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FB209908080079EE96 /* Surface.cpp */; }; - 9308DA03209908090079EE96 /* Surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9308D9FB209908080079EE96 /* Surface.cpp */; }; - 9308DA04209908090079EE96 /* TileElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9308D9FC209908080079EE96 /* TileElement.h */; }; - 9308DA05209908090079EE96 /* Surface.h in Headers */ = {isa = PBXBuildFile; fileRef = 9308D9FD209908090079EE96 /* Surface.h */; }; - 930EEA6A24FC00950070314E /* ScenarioSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930EEA6924FC00940070314E /* ScenarioSelect.cpp */; }; - 9329D520240C17C60054301C /* BenchUpdate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9329D51F240C17C60054301C /* BenchUpdate.cpp */; }; - 932A211E22D73CFA00C57EDB /* GameActionCompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20CF22D73CEE00C57EDB /* GameActionCompat.cpp */; }; - 932A211F22D73CFA00C57EDB /* GameActionRegistration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20D322D73CEF00C57EDB /* GameActionRegistration.cpp */; }; - 932A212022D73CFA00C57EDB /* GameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A211C22D73CFA00C57EDB /* GameAction.cpp */; }; - 93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93378D00252B4F550077D2D8 /* JsonFwd.hpp */; }; - 933C55B524B858490057E64B /* SeaDecrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933C55B424B858490057E64B /* SeaDecrypt.cpp */; }; - 933CBDB520CB1ACD00134678 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB120CB1ACC00134678 /* Widget.cpp */; }; - 933CBDB620CB1ACD00134678 /* Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB220CB1ACD00134678 /* Theme.cpp */; }; - 933CBDBB20CB1B3F00134678 /* TitleSequencePlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB920CB1B3F00134678 /* TitleSequencePlayer.cpp */; }; - 933CBDBD20CB1BA900134678 /* ViewportInteraction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDBC20CB1BA900134678 /* ViewportInteraction.cpp */; }; - 933CBDBF20CB1BCA00134678 /* Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDBE20CB1BCA00134678 /* Window.cpp */; }; - 933F2CB720935653001B33FD /* LocalisationService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933F2CB620935653001B33FD /* LocalisationService.cpp */; }; - 933F2CB820935653001B33FD /* LocalisationService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933F2CB620935653001B33FD /* LocalisationService.cpp */; }; - 933F2CB920935653001B33FD /* LocalisationService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933F2CB620935653001B33FD /* LocalisationService.cpp */; }; - 933F2CBB20935668001B33FD /* LocalisationService.h in Headers */ = {isa = PBXBuildFile; fileRef = 933F2CBA20935668001B33FD /* LocalisationService.h */; }; - 9344BEF920C1E6180047D165 /* Crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 9344BEF720C1E6180047D165 /* Crypt.h */; }; - 9344BEFA20C1E6180047D165 /* Crypt.OpenSSL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9344BEF820C1E6180047D165 /* Crypt.OpenSSL.cpp */; }; - 9346F9D8208A191900C77D91 /* Guest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D6208A191900C77D91 /* Guest.cpp */; }; - 9346F9D9208A191900C77D91 /* Guest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D6208A191900C77D91 /* Guest.cpp */; }; - 9346F9DA208A191900C77D91 /* Guest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D6208A191900C77D91 /* Guest.cpp */; }; - 9346F9DB208A191900C77D91 /* GuestPathfinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D7208A191900C77D91 /* GuestPathfinding.cpp */; }; - 9346F9DC208A191900C77D91 /* GuestPathfinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D7208A191900C77D91 /* GuestPathfinding.cpp */; }; - 9346F9DD208A191900C77D91 /* GuestPathfinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9346F9D7208A191900C77D91 /* GuestPathfinding.cpp */; }; - 936F412824CE030F00E07BCF /* NetworkClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 936F412424CE030E00E07BCF /* NetworkClient.h */; }; - 936F412924CE030F00E07BCF /* NetworkBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 936F412524CE030F00E07BCF /* NetworkBase.cpp */; }; - 936F412A24CE030F00E07BCF /* NetworkClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 936F412624CE030F00E07BCF /* NetworkClient.cpp */; }; - 936F412B24CE030F00E07BCF /* NetworkBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 936F412724CE030F00E07BCF /* NetworkBase.h */; }; - 939A359A20C12FC800630B3F /* Paint.Litter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939A359720C12FC700630B3F /* Paint.Litter.cpp */; }; - 939A359B20C12FC800630B3F /* Paint.Misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939A359820C12FC700630B3F /* Paint.Misc.cpp */; }; - 939A359C20C12FC800630B3F /* Paint.Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 939A359920C12FC700630B3F /* Paint.Sprite.h */; }; - 939A359F20C12FDE00630B3F /* Paint.Surface.h in Headers */ = {isa = PBXBuildFile; fileRef = 939A359D20C12FDD00630B3F /* Paint.Surface.h */; }; - 939A35A020C12FDE00630B3F /* Paint.TileElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 939A359E20C12FDE00630B3F /* Paint.TileElement.h */; }; - 939A35A220C12FFD00630B3F /* InteractiveConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 939A35A120C12FFD00630B3F /* InteractiveConsole.h */; }; - 93AE2389252F948A00CD03C3 /* Formatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AE2387252F948A00CD03C3 /* Formatter.h */; }; - 93AE238A252F948A00CD03C3 /* Formatter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AE2388252F948A00CD03C3 /* Formatter.cpp */; }; - 93B4DC1525487CDF008D63FF /* Formatting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B4DC1325487CDE008D63FF /* Formatting.cpp */; }; - 93B4DC1625487CDF008D63FF /* Formatting.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B4DC1425487CDE008D63FF /* Formatting.h */; }; - 93CBA4C020A74FF200867D56 /* BitmapReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4BF20A74FF200867D56 /* BitmapReader.cpp */; }; - 93CBA4C320A7502E00867D56 /* Imaging.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CBA4C120A7502D00867D56 /* Imaging.h */; }; - 93CBA4C420A7502E00867D56 /* Imaging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C220A7502E00867D56 /* Imaging.cpp */; }; - 93CBA4C520A7502E00867D56 /* Imaging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C220A7502E00867D56 /* Imaging.cpp */; }; - 93CBA4C620A7502E00867D56 /* Imaging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C220A7502E00867D56 /* Imaging.cpp */; }; - 93CBA4C920A7504500867D56 /* ImageImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C720A7504400867D56 /* ImageImporter.cpp */; }; - 93CBA4CA20A7504500867D56 /* ImageImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C720A7504400867D56 /* ImageImporter.cpp */; }; - 93CBA4CB20A7504500867D56 /* ImageImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CBA4C720A7504400867D56 /* ImageImporter.cpp */; }; - 93CBA4CC20A7504500867D56 /* ImageImporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CBA4C820A7504500867D56 /* ImageImporter.h */; }; - 93DE9751209C3C1000FB1CC8 /* GameState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DE974E209C3C0F00FB1CC8 /* GameState.cpp */; }; - 93DE9753209C3C1000FB1CC8 /* GameState.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DE974F209C3C0F00FB1CC8 /* GameState.h */; }; - 93DFD02E24521BA0001FCBAF /* FileWatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD02C24521B9F001FCBAF /* FileWatcher.h */; }; - 93DFD02F24521BA0001FCBAF /* FileWatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD02D24521BA0001FCBAF /* FileWatcher.cpp */; }; - 93DFD04424521C1A001FCBAF /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03124521C19001FCBAF /* Plugin.h */; }; - 93DFD04624521C1A001FCBAF /* HookEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03324521C19001FCBAF /* HookEngine.h */; }; - 93DFD04824521C1A001FCBAF /* HookEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03524521C19001FCBAF /* HookEngine.cpp */; }; - 93DFD04B24521C1A001FCBAF /* ScriptEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */; }; - 93DFD04E24521C1A001FCBAF /* Duktape.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD03B24521C19001FCBAF /* Duktape.hpp */; }; - 93DFD05224521C1A001FCBAF /* Plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93DFD03F24521C19001FCBAF /* Plugin.cpp */; }; - 93DFD05624521C1A001FCBAF /* ScriptEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DFD04324521C19001FCBAF /* ScriptEngine.h */; }; - 93F6004C213DD7DD00EEB83E /* TerrainSurfaceObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F60049213DD7DC00EEB83E /* TerrainSurfaceObject.cpp */; }; - 93F6004D213DD7DD00EEB83E /* TerrainEdgeObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F6004A213DD7DC00EEB83E /* TerrainEdgeObject.cpp */; }; - 93F60050213DD7E400EEB83E /* StationObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F6004F213DD7E300EEB83E /* StationObject.cpp */; }; - 93F76EED20BFF6F900D4512C /* Drawing.Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EEB20BFF6F900D4512C /* Drawing.Sprite.cpp */; }; - 93F76EEE20BFF6F900D4512C /* Drawing.String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EEC20BFF6F900D4512C /* Drawing.String.cpp */; }; - 93F76EF020BFF71700D4512C /* InteractiveConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EEF20BFF71700D4512C /* InteractiveConsole.cpp */; }; - 93F76EF220BFF74200D4512C /* Localisation.Date.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF120BFF74200D4512C /* Localisation.Date.cpp */; }; - 93F76EF520BFF76E00D4512C /* Paint.Peep.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF320BFF76D00D4512C /* Paint.Peep.cpp */; }; - 93F76EF620BFF76E00D4512C /* Paint.Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF420BFF76D00D4512C /* Paint.Sprite.cpp */; }; - 93F76EFF20BFF77B00D4512C /* Paint.Wall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF720BFF77900D4512C /* Paint.Wall.cpp */; }; - 93F76F0020BFF77B00D4512C /* Paint.Path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF820BFF77900D4512C /* Paint.Path.cpp */; }; - 93F76F0120BFF77B00D4512C /* Paint.LargeScenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EF920BFF77900D4512C /* Paint.LargeScenery.cpp */; }; - 93F76F0220BFF77B00D4512C /* Paint.Surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EFA20BFF77900D4512C /* Paint.Surface.cpp */; }; - 93F76F0320BFF77B00D4512C /* Paint.SmallScenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EFB20BFF77A00D4512C /* Paint.SmallScenery.cpp */; }; - 93F76F0420BFF77B00D4512C /* Paint.Banner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EFC20BFF77A00D4512C /* Paint.Banner.cpp */; }; - 93F76F0520BFF77B00D4512C /* Paint.TileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EFD20BFF77A00D4512C /* Paint.TileElement.cpp */; }; - 93F76F0620BFF77B00D4512C /* Paint.Entrance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F76EFE20BFF77A00D4512C /* Paint.Entrance.cpp */; }; - 93F9DA3820B46F9D00D1BE92 /* ShopItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CDCB0BC20A9902E00321367 /* ShopItem.cpp */; }; - 93F9DA3A20B46FCA00D1BE92 /* SceneryObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C1A53EC205FD19F000F8EF5 /* SceneryObject.cpp */; }; - 93F9DA3B20B4701100D1BE92 /* StdInOutConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C3B423720591513000C5BB7 /* StdInOutConsole.cpp */; }; - 93FB272124ED3601008241C9 /* Cursors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FB272024ED3601008241C9 /* Cursors.cpp */; }; - C61ADB1F1FB6A0A70024F2EF /* TopToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB1E1FB6A0A60024F2EF /* TopToolbar.cpp */; }; - C61ADB211FB7DC060024F2EF /* Scenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB201FB7DC060024F2EF /* Scenery.cpp */; }; - C61ADB231FBBCB8B0024F2EF /* GameBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */; }; - C61FB2721FA3E25D0095FB9D /* ObjectLoadError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB2701FA3E25C0095FB9D /* ObjectLoadError.cpp */; }; - C61FB2731FA3E25D0095FB9D /* TextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB2711FA3E25C0095FB9D /* TextInput.cpp */; }; - C62D83871FCC7D1A008C04F1 /* EditorObjectSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C62D83861FCC7D19008C04F1 /* EditorObjectSelection.cpp */; }; - C62D838A1FD36D6F008C04F1 /* EditorObjectSelectionSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C62D83881FD36D6E008C04F1 /* EditorObjectSelectionSession.cpp */; }; - C62D838B1FD36D6F008C04F1 /* EditorObjectSelectionSession.h in Headers */ = {isa = PBXBuildFile; fileRef = C62D83891FD36D6F008C04F1 /* EditorObjectSelectionSession.h */; }; - C632C81F1F8A445700781F6D /* RideList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C632C81E1F8A445700781F6D /* RideList.cpp */; }; - C6352B841F477022006CCEE3 /* DataSerialiser.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B811F477022006CCEE3 /* DataSerialiser.h */; }; - C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B821F477022006CCEE3 /* DataSerialiserTraits.h */; }; - C6352B861F477022006CCEE3 /* Endianness.h in Headers */ = {isa = PBXBuildFile; fileRef = C6352B831F477022006CCEE3 /* Endianness.h */; }; - C64644F81F3FA4120026AC2D /* ClearScenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644EE1F3FA4120026AC2D /* ClearScenery.cpp */; }; - C64644F91F3FA4120026AC2D /* EditorInventionsList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644EF1F3FA4120026AC2D /* EditorInventionsList.cpp */; }; - C64644FA1F3FA4120026AC2D /* EditorObjectiveOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F01F3FA4120026AC2D /* EditorObjectiveOptions.cpp */; }; - C64644FB1F3FA4120026AC2D /* EditorScenarioOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F11F3FA4120026AC2D /* EditorScenarioOptions.cpp */; }; - C64644FC1F3FA4120026AC2D /* Footpath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F21F3FA4120026AC2D /* Footpath.cpp */; }; - C64644FD1F3FA4120026AC2D /* Land.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F31F3FA4120026AC2D /* Land.cpp */; }; - C64644FE1F3FA4120026AC2D /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F41F3FA4120026AC2D /* Main.cpp */; }; - C64644FF1F3FA4120026AC2D /* StaffList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F51F3FA4120026AC2D /* StaffList.cpp */; }; - C64645001F3FA4120026AC2D /* ViewClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F61F3FA4120026AC2D /* ViewClipping.cpp */; }; - C64645011F3FA4120026AC2D /* Water.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64644F71F3FA4120026AC2D /* Water.cpp */; }; - C654DF2D1F69C0430040F43D /* Banner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF1C1F69C0430040F43D /* Banner.cpp */; }; - C654DF2E1F69C0430040F43D /* DemolishRidePrompt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF1D1F69C0430040F43D /* DemolishRidePrompt.cpp */; }; - C654DF2F1F69C0430040F43D /* Error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF1E1F69C0430040F43D /* Error.cpp */; }; - C654DF301F69C0430040F43D /* Finances.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF1F1F69C0430040F43D /* Finances.cpp */; }; - C654DF311F69C0430040F43D /* GuestList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF201F69C0430040F43D /* GuestList.cpp */; }; - C654DF321F69C0430040F43D /* InstallTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF211F69C0430040F43D /* InstallTrack.cpp */; }; - C654DF331F69C0430040F43D /* LoadSave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF221F69C0430040F43D /* LoadSave.cpp */; }; - C654DF341F69C0430040F43D /* NewCampaign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF231F69C0430040F43D /* NewCampaign.cpp */; }; - C654DF351F69C0430040F43D /* Park.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF241F69C0430040F43D /* Park.cpp */; }; - C654DF361F69C0430040F43D /* Player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF251F69C0430040F43D /* Player.cpp */; }; - C654DF371F69C0430040F43D /* Sign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF261F69C0430040F43D /* Sign.cpp */; }; - C654DF381F69C0430040F43D /* StaffFirePrompt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF271F69C0430040F43D /* StaffFirePrompt.cpp */; }; - C654DF391F69C0430040F43D /* TitleCommandEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF281F69C0430040F43D /* TitleCommandEditor.cpp */; }; - C654DF3A1F69C0430040F43D /* TitleEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF291F69C0430040F43D /* TitleEditor.cpp */; }; - C654DF3C1F69C0430040F43D /* TrackDesignManage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF2B1F69C0430040F43D /* TrackDesignManage.cpp */; }; - C654DF3D1F69C0430040F43D /* TrackDesignPlace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF2C1F69C0430040F43D /* TrackDesignPlace.cpp */; }; - C6607F481FE2B97E00D3FC0D /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC4B8E81FE00C5D00660D62 /* Input.cpp */; }; - C666ED771F33DBB20061AA04 /* ShortcutKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED751F33DBB20061AA04 /* ShortcutKeys.cpp */; }; - C666EE6B1F37ACB10061AA04 /* About.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE551F37ACB10061AA04 /* About.cpp */; }; - C666EE6C1F37ACB10061AA04 /* Changelog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE561F37ACB10061AA04 /* Changelog.cpp */; }; - C666EE6D1F37ACB10061AA04 /* Cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE571F37ACB10061AA04 /* Cheats.cpp */; }; - C666EE6E1F37ACB10061AA04 /* CustomCurrency.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE581F37ACB10061AA04 /* CustomCurrency.cpp */; }; - C666EE6F1F37ACB10061AA04 /* DebugPaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE591F37ACB10061AA04 /* DebugPaint.cpp */; }; - C666EE701F37ACB10061AA04 /* LandRights.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5A1F37ACB10061AA04 /* LandRights.cpp */; }; - C666EE711F37ACB10061AA04 /* MapGen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5B1F37ACB10061AA04 /* MapGen.cpp */; }; - C666EE721F37ACB10061AA04 /* Multiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */; }; - C666EE741F37ACB10061AA04 /* News.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5E1F37ACB10061AA04 /* News.cpp */; }; - C666EE751F37ACB10061AA04 /* NewsOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE5F1F37ACB10061AA04 /* NewsOptions.cpp */; }; - C666EE761F37ACB10061AA04 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE601F37ACB10061AA04 /* Options.cpp */; }; - C666EE771F37ACB10061AA04 /* SavePrompt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE611F37ACB10061AA04 /* SavePrompt.cpp */; }; - C666EE781F37ACB10061AA04 /* ServerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE621F37ACB10061AA04 /* ServerList.cpp */; }; - C666EE791F37ACB10061AA04 /* ServerStart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE631F37ACB10061AA04 /* ServerStart.cpp */; }; - C666EE7A1F37ACB10061AA04 /* Themes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE641F37ACB10061AA04 /* Themes.cpp */; }; - C666EE7B1F37ACB10061AA04 /* TitleExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE651F37ACB10061AA04 /* TitleExit.cpp */; }; - C666EE7C1F37ACB10061AA04 /* TitleLogo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE661F37ACB10061AA04 /* TitleLogo.cpp */; }; - C666EE7D1F37ACB10061AA04 /* TitleMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE671F37ACB10061AA04 /* TitleMenu.cpp */; }; - C666EE7E1F37ACB10061AA04 /* TitleOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE681F37ACB10061AA04 /* TitleOptions.cpp */; }; - C666EE7F1F37ACB10061AA04 /* Viewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE691F37ACB10061AA04 /* Viewport.cpp */; }; - C67B28152002D67A00109C93 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28122002D67900109C93 /* Widget.h */; }; - C67B28162002D67A00109C93 /* Window.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28132002D67900109C93 /* Window.h */; }; - C67B28172002D67A00109C93 /* Viewport.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28142002D67900109C93 /* Viewport.h */; }; - C67B28192002D7F200109C93 /* Window_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28182002D7F200109C93 /* Window_internal.h */; }; - C67CCD661FBBCFDB004FAE4C /* EditorBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C67CCD651FBBCFDB004FAE4C /* EditorBottomToolbar.cpp */; }; - C67CCD681FBBD138004FAE4C /* EditorMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C67CCD671FBBD137004FAE4C /* EditorMain.cpp */; }; - C68313C81FDB4ED4006DB3D8 /* MouseInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313C71FDB4ED4006DB3D8 /* MouseInput.cpp */; }; - C68313CB1FDB4EEC006DB3D8 /* Tooltip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313C91FDB4EEC006DB3D8 /* Tooltip.cpp */; }; - C68313CC1FDB4EEC006DB3D8 /* Dropdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313CA1FDB4EEC006DB3D8 /* Dropdown.cpp */; }; - C68313D51FDB4F4C006DB3D8 /* Graph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313D11FDB4F4C006DB3D8 /* Graph.cpp */; }; - C68313D61FDB4F4C006DB3D8 /* LandTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313D31FDB4F4C006DB3D8 /* LandTool.cpp */; }; - C685E5191F8907850090598F /* NewRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C685E5141F8907840090598F /* NewRide.cpp */; }; - C685E51A1F8907850090598F /* Staff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C685E5151F8907840090598F /* Staff.cpp */; }; - C685E51B1F8907850090598F /* Guest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C685E5161F8907840090598F /* Guest.cpp */; }; - C685E51C1F8907850090598F /* Map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C685E5171F8907840090598F /* Map.cpp */; }; - C685E51D1F8907850090598F /* Research.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C685E5181F8907840090598F /* Research.cpp */; }; - C6887846202897B30084B384 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C688783D202893590084B384 /* Foundation.framework */; }; - C6887847202897B70084B384 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C688783F202893600084B384 /* Cocoa.framework */; }; - C6887848202897D10084B384 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C688783D202893590084B384 /* Foundation.framework */; }; - C68878492028982B0084B384 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C688783F202893600084B384 /* Cocoa.framework */; }; - C688784A202899B40084B384 /* input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313C51FDB4EBA006DB3D8 /* input.cpp */; }; - C688784B202899B90084B384 /* Intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC4B8EA1FE00C5D00660D62 /* Intro.cpp */; }; - C688784C202899BE0084B384 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4623F1FD0710E0001CD98 /* Game.cpp */; }; - C688784D202899C40084B384 /* Diagnostic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC4B8E51FE00C4E00660D62 /* Diagnostic.cpp */; }; - C688784E202899CB0084B384 /* Date.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C5DFF401FAC69D200CB093A /* Date.cpp */; }; - C688784F202899D00084B384 /* CmdlineSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC4B8E21FE00C4100660D62 /* CmdlineSprite.cpp */; }; - C6887850202899D40084B384 /* Cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66901FE14C9500694CB6 /* Cheats.cpp */; }; - C6887851202899EA0084B384 /* Wall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54402007646A00A52E21 /* Wall.cpp */; }; - C6887852202899ED0084B384 /* TileInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B543E2007646A00A52E21 /* TileInspector.cpp */; }; - C6887853202899F00084B384 /* Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B543C2007646A00A52E21 /* Sprite.cpp */; }; - C6887854202899F30084B384 /* SmallScenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B543A2007646A00A52E21 /* SmallScenery.cpp */; }; - C6887855202899F60084B384 /* Particle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54372007646A00A52E21 /* Particle.cpp */; }; - C6887856202899FA0084B384 /* Scenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54382007646A00A52E21 /* Scenery.cpp */; }; - C6887857202899FD0084B384 /* Park.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54352007646A00A52E21 /* Park.cpp */; }; - C688785820289A0A0084B384 /* Balloon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B541D2007646A00A52E21 /* Balloon.cpp */; }; - C688785920289A0A0084B384 /* Banner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B541E2007646A00A52E21 /* Banner.cpp */; }; - C688785A20289A0A0084B384 /* Climate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54202007646A00A52E21 /* Climate.cpp */; }; - C688785B20289A0A0084B384 /* Duck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54222007646A00A52E21 /* Duck.cpp */; }; - C688785C20289A0A0084B384 /* Entrance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54232007646A00A52E21 /* Entrance.cpp */; }; - C688785D20289A0A0084B384 /* Footpath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54252007646A00A52E21 /* Footpath.cpp */; }; - C688785E20289A0A0084B384 /* Fountain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54272007646A00A52E21 /* Fountain.cpp */; }; - C688785F20289A0A0084B384 /* LargeScenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54292007646A00A52E21 /* LargeScenery.cpp */; }; - C688786020289A0A0084B384 /* Map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B542C2007646A00A52E21 /* Map.cpp */; }; - C688786120289A0A0084B384 /* MapAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B542E2007646A00A52E21 /* MapAnimation.cpp */; }; - C688786220289A0A0084B384 /* MapGen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54302007646A00A52E21 /* MapGen.cpp */; }; - C688786320289A0A0084B384 /* MapHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54322007646A00A52E21 /* MapHelpers.cpp */; }; - C688786420289A0A0084B384 /* MoneyEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54342007646A00A52E21 /* MoneyEffect.cpp */; }; - C688786520289A400084B384 /* _legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7B2048E2024E8B30000AD7E /* _legacy.cpp */; }; - C688786620289A430084B384 /* Intent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C654DF3E1F69C18C0040F43D /* Intent.cpp */; }; - C688786720289A4A0084B384 /* SawyerCoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A668A1FE14C3A00694CB6 /* SawyerCoding.cpp */; }; - C688786820289A4A0084B384 /* Util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A668C1FE14C3A00694CB6 /* Util.cpp */; }; - C688786920289A660084B384 /* CableLift.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6AC2101F9E1CB3004324AA /* CableLift.cpp */; }; - C688786C20289A6F0084B384 /* TrackDesign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C4C1E971F58226500560300 /* TrackDesign.cpp */; }; - C688786D20289A6F0084B384 /* TrackPaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B540B20060D8100A52E21 /* TrackPaint.cpp */; }; - C688786E20289A6F0084B384 /* Vehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E831F90AF41005243C2 /* Vehicle.cpp */; }; - C688786F20289A6F0084B384 /* VehicleData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54052005735F00A52E21 /* VehicleData.cpp */; }; - C688787020289A6F0084B384 /* VehiclePaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54072005736700A52E21 /* VehiclePaint.cpp */; }; - C688787120289A780084B384 /* Ride.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66BF1FF9322A00694CB6 /* Ride.cpp */; }; - C688787320289A780084B384 /* RideRatings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73E320B2011589E00C4D975 /* RideRatings.cpp */; }; - C688787420289A780084B384 /* TrackDesignSave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73E320E2011589F00C4D975 /* TrackDesignSave.cpp */; }; - C688787520289A780084B384 /* RideData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B541420060D8E00A52E21 /* RideData.cpp */; }; - C688787720289A780084B384 /* Station.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6AC20D1F9E1693004324AA /* Station.cpp */; }; - C688787820289A780084B384 /* Track.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E8E1F9625B0005243C2 /* Track.cpp */; }; - C688787920289A780084B384 /* TrackData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E861F950164005243C2 /* TrackData.cpp */; }; - C688787E20289ADE0084B384 /* Drawing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53D520002CA400A52E21 /* Drawing.cpp */; }; - C688787F20289ADE0084B384 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53D620002CA400A52E21 /* Font.cpp */; }; - C688788020289ADE0084B384 /* LightFX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53D720002CA400A52E21 /* LightFX.cpp */; }; - C688788120289ADE0084B384 /* Line.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53CD200029CE00A52E21 /* Line.cpp */; }; - C688788220289ADE0084B384 /* Rect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53CF200029D900A52E21 /* Rect.cpp */; }; - C688788320289ADE0084B384 /* ScrollingText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53D0200029D900A52E21 /* ScrollingText.cpp */; }; - C688788520289ADE0084B384 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C651A8D71F30204300443BCA /* Text.cpp */; }; - C688788620289ADE0084B384 /* TTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53D820002CA400A52E21 /* TTF.cpp */; }; - C688788720289ADE0084B384 /* TTFSDLPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54682007BF2E00A52E21 /* TTFSDLPort.cpp */; }; - C688788820289ADE0084B384 /* X8DrawingEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8B426E1EEB1ABD00F015CA /* X8DrawingEngine.cpp */; }; - C688788E20289AE70084B384 /* SSE41Drawing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66BB1FED04EE00694CB6 /* SSE41Drawing.cpp */; settings = {COMPILER_FLAGS = "-msse4.1"; }; }; - C688788F20289B140084B384 /* Chat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53DD200143C200A52E21 /* Chat.cpp */; }; - C688789020289B140084B384 /* Colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53DF200143C200A52E21 /* Colour.cpp */; }; - C688789220289B140084B384 /* FontFamilies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53E4200143C200A52E21 /* FontFamilies.cpp */; }; - C688789320289B140084B384 /* Fonts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53E6200143C200A52E21 /* Fonts.cpp */; }; - C688789420289B140084B384 /* Screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53E8200143C200A52E21 /* Screenshot.cpp */; }; - C688789620289B140084B384 /* Viewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53EC200143C200A52E21 /* Viewport.cpp */; }; - C688789920289B140084B384 /* Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53F1200143C200A52E21 /* Window.cpp */; }; - C688789A20289B200084B384 /* ConversionTables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53C61FFF94F900A52E21 /* ConversionTables.cpp */; }; - C688789B20289B200084B384 /* Convert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53AA1FFF935B00A52E21 /* Convert.cpp */; }; - C688789C20289B200084B384 /* Currency.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53AB1FFF935B00A52E21 /* Currency.cpp */; }; - C688789E20289B200084B384 /* FormatCodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53AF1FFF935B00A52E21 /* FormatCodes.cpp */; }; - C688789F20289B200084B384 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53B11FFF935B00A52E21 /* Language.cpp */; }; - C68878A020289B200084B384 /* LanguagePack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53B31FFF935B00A52E21 /* LanguagePack.cpp */; }; - C68878A120289B200084B384 /* Localisation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53B51FFF935B00A52E21 /* Localisation.cpp */; }; - C68878A220289B200084B384 /* RealNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53B71FFF935B00A52E21 /* RealNames.cpp */; }; - C68878A420289B200084B384 /* UTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53BB1FFF935B00A52E21 /* UTF8.cpp */; }; - C68878A520289B2A0084B384 /* Award.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1B01F8E185600A9330D /* Award.cpp */; }; - C68878A620289B2A0084B384 /* Finance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1B21F8E185600A9330D /* Finance.cpp */; }; - C68878A720289B2A0084B384 /* Marketing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1B41F8E185600A9330D /* Marketing.cpp */; }; - C68878A820289B2A0084B384 /* NewsItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1B61F8E185600A9330D /* NewsItem.cpp */; }; - C68878A920289B2A0084B384 /* Research.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1B81F8E185600A9330D /* Research.cpp */; }; - C68878C020289B710084B384 /* ApplyPaletteShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85911EC4E82600FA49E2 /* ApplyPaletteShader.cpp */; }; - C68878C120289B710084B384 /* ApplyTransparencyShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D45E09161F99CF2F00854B2B /* ApplyTransparencyShader.cpp */; }; - C68878C220289B710084B384 /* DrawLineShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85961EC4E82600FA49E2 /* DrawLineShader.cpp */; }; - C68878C320289B710084B384 /* DrawRectShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85941EC4E82600FA49E2 /* DrawRectShader.cpp */; }; - C68878C420289B710084B384 /* OpenGLAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C859B1EC4E82600FA49E2 /* OpenGLAPI.cpp */; }; - C68878C520289B710084B384 /* OpenGLDrawingEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C859D1EC4E82600FA49E2 /* OpenGLDrawingEngine.cpp */; }; - C68878C620289B710084B384 /* OpenGLFramebuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C859E1EC4E82600FA49E2 /* OpenGLFramebuffer.cpp */; }; - C68878C720289B710084B384 /* OpenGLShaderProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85A01EC4E82600FA49E2 /* OpenGLShaderProgram.cpp */; }; - C68878C820289B710084B384 /* SwapFramebuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85A21EC4E82600FA49E2 /* SwapFramebuffer.cpp */; }; - C68878C920289B710084B384 /* TextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85A41EC4E82600FA49E2 /* TextureCache.cpp */; }; - C68878CA20289B710084B384 /* TransparencyDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4974F1A1FA04A1900F7FD7F /* TransparencyDepth.cpp */; }; - C68878CB20289B710084B384 /* HardwareDisplayDrawingEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C8B42711EEB1AE400F015CA /* HardwareDisplayDrawingEngine.cpp */; }; - C68878CC20289B710084B384 /* SoftwareDrawingEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85A61EC4E82600FA49E2 /* SoftwareDrawingEngine.cpp */; }; - C68878CD20289B9B0084B384 /* DefaultObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7B2048B2024E7800000AD7E /* DefaultObjects.cpp */; }; - C68878CE20289B9B0084B384 /* ObjectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B53A31FFC180400A52E21 /* ObjectList.cpp */; }; - C68878DB20289B9B0084B384 /* Paint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66AE1FE278C900694CB6 /* Paint.cpp */; }; - C68878DC20289B9B0084B384 /* Painter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66B01FE278C900694CB6 /* Painter.cpp */; }; - C68878DD20289B9B0084B384 /* PaintHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66B21FE278C900694CB6 /* PaintHelpers.cpp */; }; - C68878DE20289B9B0084B384 /* Supports.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6A66B31FE278C900694CB6 /* Supports.cpp */; }; - C68878DF20289B9B0084B384 /* VirtualFloor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B540020015AC600A52E21 /* VirtualFloor.cpp */; }; - C68878E020289B9B0084B384 /* Peep.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E7B1F90A3F1005243C2 /* Peep.cpp */; }; - C68878E120289B9B0084B384 /* PeepData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E7D1F90A3F1005243C2 /* PeepData.cpp */; }; - C68878E220289B9B0084B384 /* Staff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE4E7E1F90A3F1005243C2 /* Staff.cpp */; }; - C68878E320289B9B0084B384 /* Android.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54742010DF3C00A52E21 /* Android.cpp */; }; - C68878E420289B9B0084B384 /* Linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54762010DF4300A52E21 /* Linux.cpp */; }; - C68878E520289B9B0084B384 /* Platform.Android.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE462441FD161360001CD98 /* Platform.Android.cpp */; }; - C68878E620289B9B0084B384 /* Platform.Linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE462461FD1613D0001CD98 /* Platform.Linux.cpp */; }; - C68878E720289B9B0084B384 /* Platform.Posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE462481FD1613D0001CD98 /* Platform.Posix.cpp */; }; - C68878E820289B9B0084B384 /* Platform.Win32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE462491FD1613D0001CD98 /* Platform.Win32.cpp */; }; - C68878E920289B9B0084B384 /* Posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54782010DF4C00A52E21 /* Posix.cpp */; }; - C68878EA20289B9B0084B384 /* Shared.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B54792010DF4C00A52E21 /* Shared.cpp */; }; - C68878EB20289B9B0084B384 /* Windows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7B547A2010DF4C00A52E21 /* Windows.cpp */; }; - C68878EC20289B9B0084B384 /* AirPoweredVerticalCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1181F8B744400A9330D /* AirPoweredVerticalCoaster.cpp */; }; - C68878ED20289B9B0084B384 /* BobsleighCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1191F8B744400A9330D /* BobsleighCoaster.cpp */; }; - C68878EE20289B9B0084B384 /* BolligerMabillardTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F11B1F8B744400A9330D /* BolligerMabillardTrack.cpp */; }; - C68878EF20289B9B0084B384 /* CompactInvertedCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F11C1F8B744400A9330D /* CompactInvertedCoaster.cpp */; }; - C68878F020289B9B0084B384 /* CorkscrewRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F11D1F8B744400A9330D /* CorkscrewRollerCoaster.cpp */; }; - C68878F120289B9B0084B384 /* FlyingRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F11E1F8B744400A9330D /* FlyingRollerCoaster.cpp */; }; - C68878F220289B9B0084B384 /* GigaCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F11F1F8B744400A9330D /* GigaCoaster.cpp */; }; - C68878F320289B9B0084B384 /* HeartlineTwisterCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1201F8B744400A9330D /* HeartlineTwisterCoaster.cpp */; }; - C68878F420289B9B0084B384 /* InvertedHairpinCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1211F8B744400A9330D /* InvertedHairpinCoaster.cpp */; }; - C68878F520289B9B0084B384 /* InvertedImpulseCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1221F8B744400A9330D /* InvertedImpulseCoaster.cpp */; }; - C68878F620289B9B0084B384 /* InvertedRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1231F8B744400A9330D /* InvertedRollerCoaster.cpp */; }; - C68878F720289B9B0084B384 /* JuniorRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1251F8B744400A9330D /* JuniorRollerCoaster.cpp */; }; - C68878F820289B9B0084B384 /* LayDownRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1261F8B744400A9330D /* LayDownRollerCoaster.cpp */; }; - C68878F920289B9B0084B384 /* LimLaunchedRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1271F8B744400A9330D /* LimLaunchedRollerCoaster.cpp */; }; - C68878FA20289B9B0084B384 /* LoopingRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1281F8B744400A9330D /* LoopingRollerCoaster.cpp */; }; - C68878FB20289B9B0084B384 /* MineRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1291F8B744400A9330D /* MineRide.cpp */; }; - C68878FC20289B9B0084B384 /* MineTrainCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12A1F8B744400A9330D /* MineTrainCoaster.cpp */; }; - C68878FD20289B9B0084B384 /* MiniRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12B1F8B744400A9330D /* MiniRollerCoaster.cpp */; }; - C68878FE20289B9B0084B384 /* MiniSuspendedCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12C1F8B744400A9330D /* MiniSuspendedCoaster.cpp */; }; - C68878FF20289B9B0084B384 /* MultiDimensionRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12D1F8B744400A9330D /* MultiDimensionRollerCoaster.cpp */; }; - C688790020289B9B0084B384 /* ReverseFreefallCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12E1F8B744400A9330D /* ReverseFreefallCoaster.cpp */; }; - C688790120289B9B0084B384 /* ReverserRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F12F1F8B744400A9330D /* ReverserRollerCoaster.cpp */; }; - C688790220289B9B0084B384 /* SideFrictionRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1301F8B744400A9330D /* SideFrictionRollerCoaster.cpp */; }; - C688790320289B9B0084B384 /* StandUpRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1311F8B744400A9330D /* StandUpRollerCoaster.cpp */; }; - C688790420289B9B0084B384 /* Steeplechase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1321F8B744400A9330D /* Steeplechase.cpp */; }; - C688790520289B9B0084B384 /* SuspendedSwingingCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1331F8B744400A9330D /* SuspendedSwingingCoaster.cpp */; }; - C688790620289B9B0084B384 /* TwisterRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1341F8B744400A9330D /* TwisterRollerCoaster.cpp */; }; - C688790720289B9B0084B384 /* VerticalDropRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1351F8B744400A9330D /* VerticalDropRollerCoaster.cpp */; }; - C688790820289B9B0084B384 /* VirginiaReel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1361F8B744400A9330D /* VirginiaReel.cpp */; }; - C688790920289B9B0084B384 /* WildMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1371F8B744400A9330D /* WildMouse.cpp */; }; - C688790A20289B9B0084B384 /* WoodenRollerCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1381F8B744400A9330D /* WoodenRollerCoaster.cpp */; }; - C688790B20289B9B0084B384 /* WoodenWildMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1391F8B744400A9330D /* WoodenWildMouse.cpp */; }; - C688790C20289B9B0084B384 /* CarRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15A1F8B745700A9330D /* CarRide.cpp */; }; - C688790D20289B9B0084B384 /* Circus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15B1F8B745700A9330D /* Circus.cpp */; }; - C688790E20289B9B0084B384 /* CrookedHouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15C1F8B745700A9330D /* CrookedHouse.cpp */; }; - C688790F20289B9B0084B384 /* Dodgems.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15D1F8B745700A9330D /* Dodgems.cpp */; }; - C688791020289B9B0084B384 /* FerrisWheel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15E1F8B745700A9330D /* FerrisWheel.cpp */; }; - C688791120289B9B0084B384 /* FlyingSaucers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F15F1F8B745700A9330D /* FlyingSaucers.cpp */; }; - C688791220289B9B0084B384 /* GhostTrain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1601F8B745700A9330D /* GhostTrain.cpp */; }; - C688791320289B9B0084B384 /* HauntedHouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1611F8B745700A9330D /* HauntedHouse.cpp */; }; - C688791420289B9B0084B384 /* Maze.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1621F8B745700A9330D /* Maze.cpp */; }; - C688791520289B9B0084B384 /* MerryGoRound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1631F8B745700A9330D /* MerryGoRound.cpp */; }; - C688791620289B9B0084B384 /* MiniGolf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1641F8B745700A9330D /* MiniGolf.cpp */; }; - C688791720289B9B0084B384 /* MiniHelicopters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1651F8B745700A9330D /* MiniHelicopters.cpp */; }; - C688791820289B9B0084B384 /* MonorailCycles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1661F8B745700A9330D /* MonorailCycles.cpp */; }; - C688791920289B9B0084B384 /* ObservationTower.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1671F8B745700A9330D /* ObservationTower.cpp */; }; - C688791A20289B9B0084B384 /* SpaceRings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1681F8B745700A9330D /* SpaceRings.cpp */; }; - C688791B20289B9B0084B384 /* SpiralSlide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1691F8B745700A9330D /* SpiralSlide.cpp */; }; - C688791C20289B9B0084B384 /* Facility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F17A1F8B747300A9330D /* Facility.cpp */; }; - C688791D20289B9B0084B384 /* Shop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F17B1F8B747300A9330D /* Shop.cpp */; }; - C688791E20289B9B0084B384 /* 3dCinema.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F17E1F8B747A00A9330D /* 3dCinema.cpp */; }; - C688791F20289B9B0084B384 /* Enterprise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F17F1F8B747A00A9330D /* Enterprise.cpp */; }; - C688792020289B9B0084B384 /* GoKarts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1801F8B747A00A9330D /* GoKarts.cpp */; }; - C688792120289B9B0084B384 /* LaunchedFreefall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1811F8B747A00A9330D /* LaunchedFreefall.cpp */; }; - C688792220289B9B0084B384 /* MagicCarpet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1821F8B747A00A9330D /* MagicCarpet.cpp */; }; - C688792320289B9B0084B384 /* MotionSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1831F8B747A00A9330D /* MotionSimulator.cpp */; }; - C688792420289B9B0084B384 /* SwingingShip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1841F8B747A00A9330D /* SwingingShip.cpp */; }; - C688792520289B9B0084B384 /* RotoDrop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1851F8B747A00A9330D /* RotoDrop.cpp */; }; - C688792620289B9B0084B384 /* SwingingInverterShip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1861F8B747A00A9330D /* SwingingInverterShip.cpp */; }; - C688792720289B9B0084B384 /* TopSpin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1871F8B747A00A9330D /* TopSpin.cpp */; }; - C688792820289B9B0084B384 /* Twist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1881F8B747A00A9330D /* Twist.cpp */; }; - C688792920289B9B0084B384 /* Chairlift.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1941F8B748200A9330D /* Chairlift.cpp */; }; - C688792A20289B9B0084B384 /* Lift.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1951F8B748200A9330D /* Lift.cpp */; }; - C688792B20289B9B0084B384 /* MiniatureRailway.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1961F8B748200A9330D /* MiniatureRailway.cpp */; }; - C688792C20289B9B0084B384 /* Monorail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1971F8B748200A9330D /* Monorail.cpp */; }; - C688792D20289B9B0084B384 /* SuspendedMonorail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1981F8B748200A9330D /* SuspendedMonorail.cpp */; }; - C688792E20289B9B0084B384 /* BoatHire.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F19E1F8B748900A9330D /* BoatHire.cpp */; }; - C688792F20289B9B0084B384 /* DingySlide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F19F1F8B748900A9330D /* DingySlide.cpp */; }; - C688793020289B9B0084B384 /* LogFlume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1A01F8B748900A9330D /* LogFlume.cpp */; }; - C688793120289B9B0084B384 /* RiverRapids.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1A11F8B748900A9330D /* RiverRapids.cpp */; }; - C688793220289B9B0084B384 /* SplashBoats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1A21F8B748900A9330D /* SplashBoats.cpp */; }; - C688793320289B9B0084B384 /* SubmarineRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1A31F8B748900A9330D /* SubmarineRide.cpp */; }; - C688793420289B9B0084B384 /* WaterCoaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C93F1A41F8B748900A9330D /* WaterCoaster.cpp */; }; - C68879A420289C060084B384 /* Platform.macOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7B20489201E91BF0000AD7E /* Platform.macOS.mm */; }; - C68D98BC1FC6B8AB008E8378 /* TileInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68D98BB1FC6B8AB008E8378 /* TileInspector.cpp */; }; - C6D2BEE21F9BAA6C008B557C /* Ride.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D2BEE11F9BAA6C008B557C /* Ride.cpp */; }; - C6D2BEE61F9BAACE008B557C /* TrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D2BEE31F9BAACC008B557C /* TrackList.cpp */; }; - C6D2BEE71F9BAACE008B557C /* MapTooltip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D2BEE41F9BAACD008B557C /* MapTooltip.cpp */; }; - C6D2BEE81F9BAACE008B557C /* MazeConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D2BEE51F9BAACD008B557C /* MazeConstruction.cpp */; }; - C6D2BEEA1F9BB83C008B557C /* NetworkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D2BEE91F9BB83B008B557C /* NetworkStatus.cpp */; }; - C6E415511FAFD6DC00D4A52A /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6E415501FAFD6DB00D4A52A /* RideConstruction.cpp */; }; - C9C630B62235A22D009AD16E /* GameStateSnapshots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9C630B52235A22C009AD16E /* GameStateSnapshots.cpp */; }; - D41B73EF1C2101890080A7B9 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B73EE1C2101890080A7B9 /* libcurl.tbd */; }; - D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B741C1C210A7A0080A7B9 /* libiconv.tbd */; }; - D43407E21D0E14CE00C2B3D4 /* shaders in Resources */ = {isa = PBXBuildFile; fileRef = D43407E11D0E14CE00C2B3D4 /* shaders */; }; - D47304D51C4FF8250015C0EA /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D47304D41C4FF8250015C0EA /* libz.tbd */; }; - D48AFDB71EF78DBF0081C644 /* BenchGfxCommmands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D48AFDB61EF78DBF0081C644 /* BenchGfxCommmands.cpp */; }; - D4EC48E61C2637710024B507 /* g2.dat in Resources */ = {isa = PBXBuildFile; fileRef = D4EC48E31C2637710024B507 /* g2.dat */; }; - D4EC48E71C2637710024B507 /* language in Resources */ = {isa = PBXBuildFile; fileRef = D4EC48E41C2637710024B507 /* language */; }; - D4EC48E81C2637710024B507 /* sequence in Resources */ = {isa = PBXBuildFile; fileRef = D4EC48E51C2637710024B507 /* sequence */; }; - F70839931FFC0B61002DCEFA /* Scenario.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F70839911FFC0AFF002DCEFA /* Scenario.cpp */; }; - F76C85B41EC4E88300FA49E2 /* AudioMixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C835B1EC4E7CC00FA49E2 /* AudioMixer.cpp */; }; - F76C85B71EC4E88300FA49E2 /* NullAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C835E1EC4E7CC00FA49E2 /* NullAudioSource.cpp */; }; - F76C85BA1EC4E88300FA49E2 /* CommandLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83631EC4E7CC00FA49E2 /* CommandLine.cpp */; }; - F76C85BC1EC4E88300FA49E2 /* ConvertCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83651EC4E7CC00FA49E2 /* ConvertCommand.cpp */; }; - F76C85BD1EC4E88300FA49E2 /* RootCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83661EC4E7CC00FA49E2 /* RootCommands.cpp */; }; - F76C85BE1EC4E88300FA49E2 /* ScreenshotCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83671EC4E7CC00FA49E2 /* ScreenshotCommands.cpp */; }; - F76C85BF1EC4E88300FA49E2 /* SpriteCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83681EC4E7CC00FA49E2 /* SpriteCommands.cpp */; }; - F76C85C01EC4E88300FA49E2 /* UriHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83691EC4E7CC00FA49E2 /* UriHandler.cpp */; }; - F76C85C41EC4E88300FA49E2 /* Config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C836E1EC4E7CC00FA49E2 /* Config.cpp */; }; - F76C85C71EC4E88300FA49E2 /* IniReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83711EC4E7CC00FA49E2 /* IniReader.cpp */; }; - F76C85C91EC4E88300FA49E2 /* IniWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83731EC4E7CC00FA49E2 /* IniWriter.cpp */; }; - F76C85CC1EC4E88300FA49E2 /* Context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83761EC4E7CC00FA49E2 /* Context.cpp */; }; - F76C85CF1EC4E88300FA49E2 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C837A1EC4E7CC00FA49E2 /* Console.cpp */; }; - F76C85D11EC4E88300FA49E2 /* Diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C837C1EC4E7CC00FA49E2 /* Diagnostics.cpp */; }; - F76C85D41EC4E88300FA49E2 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C837F1EC4E7CC00FA49E2 /* File.cpp */; }; - F76C85D61EC4E88300FA49E2 /* FileScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83811EC4E7CC00FA49E2 /* FileScanner.cpp */; }; - F76C85D91EC4E88300FA49E2 /* Guard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83841EC4E7CC00FA49E2 /* Guard.cpp */; }; - F76C85DB1EC4E88300FA49E2 /* IStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83861EC4E7CC00FA49E2 /* IStream.cpp */; }; - F76C85DD1EC4E88300FA49E2 /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83881EC4E7CC00FA49E2 /* Json.cpp */; }; - F76C85E11EC4E88300FA49E2 /* MemoryStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */; }; - F76C85E41EC4E88300FA49E2 /* Path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C838F1EC4E7CC00FA49E2 /* Path.cpp */; }; - F76C85E71EC4E88300FA49E2 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83921EC4E7CC00FA49E2 /* String.cpp */; }; - F76C85EE1EC4E88300FA49E2 /* Zip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83991EC4E7CC00FA49E2 /* Zip.cpp */; }; - F76C85F91EC4E88300FA49E2 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83A51EC4E7CC00FA49E2 /* Image.cpp */; }; - F76C85FD1EC4E88300FA49E2 /* NewDrawing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83A91EC4E7CC00FA49E2 /* NewDrawing.cpp */; }; - F76C85FF1EC4E88300FA49E2 /* Weather.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83AB1EC4E7CC00FA49E2 /* Weather.cpp */; }; - F76C86051EC4E88300FA49E2 /* Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83B11EC4E7CC00FA49E2 /* Editor.cpp */; }; - F76C86071EC4E88300FA49E2 /* FileClassifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83B31EC4E7CC00FA49E2 /* FileClassifier.cpp */; }; - F76C86491EC4E88300FA49E2 /* NetworkAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83FA1EC4E7CC00FA49E2 /* NetworkAction.cpp */; }; - F76C864B1EC4E88300FA49E2 /* NetworkConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83FC1EC4E7CC00FA49E2 /* NetworkConnection.cpp */; }; - F76C864D1EC4E88300FA49E2 /* NetworkGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C83FE1EC4E7CC00FA49E2 /* NetworkGroup.cpp */; }; - F76C864F1EC4E88300FA49E2 /* NetworkKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84001EC4E7CC00FA49E2 /* NetworkKey.cpp */; }; - F76C86511EC4E88300FA49E2 /* NetworkPacket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84021EC4E7CC00FA49E2 /* NetworkPacket.cpp */; }; - F76C86531EC4E88300FA49E2 /* NetworkPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84041EC4E7CC00FA49E2 /* NetworkPlayer.cpp */; }; - F76C86551EC4E88300FA49E2 /* NetworkServerAdvertiser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84061EC4E7CC00FA49E2 /* NetworkServerAdvertiser.cpp */; }; - F76C86581EC4E88300FA49E2 /* NetworkUser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84091EC4E7CC00FA49E2 /* NetworkUser.cpp */; }; - F76C865A1EC4E88300FA49E2 /* ServerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C840B1EC4E7CC00FA49E2 /* ServerList.cpp */; }; - F76C865C1EC4E88300FA49E2 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C840D1EC4E7CC00FA49E2 /* Socket.cpp */; }; - F76C86601EC4E88300FA49E2 /* BannerObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84121EC4E7CC00FA49E2 /* BannerObject.cpp */; }; - F76C86621EC4E88300FA49E2 /* EntranceObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84141EC4E7CC00FA49E2 /* EntranceObject.cpp */; }; - F76C86641EC4E88300FA49E2 /* FootpathItemObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84161EC4E7CC00FA49E2 /* FootpathItemObject.cpp */; }; - F76C86661EC4E88300FA49E2 /* FootpathObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84181EC4E7CC00FA49E2 /* FootpathObject.cpp */; }; - F76C86681EC4E88300FA49E2 /* ImageTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C841A1EC4E7CC00FA49E2 /* ImageTable.cpp */; }; - F76C866A1EC4E88300FA49E2 /* LargeSceneryObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C841C1EC4E7CC00FA49E2 /* LargeSceneryObject.cpp */; }; - F76C866C1EC4E88400FA49E2 /* Object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C841E1EC4E7CC00FA49E2 /* Object.cpp */; }; - F76C866E1EC4E88400FA49E2 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84201EC4E7CC00FA49E2 /* ObjectFactory.cpp */; }; - F76C86701EC4E88400FA49E2 /* ObjectManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84221EC4E7CC00FA49E2 /* ObjectManager.cpp */; }; - F76C86721EC4E88400FA49E2 /* ObjectRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84241EC4E7CC00FA49E2 /* ObjectRepository.cpp */; }; - F76C86741EC4E88400FA49E2 /* RideObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84261EC4E7CC00FA49E2 /* RideObject.cpp */; }; - F76C86761EC4E88400FA49E2 /* SceneryGroupObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84281EC4E7CC00FA49E2 /* SceneryGroupObject.cpp */; }; - F76C86791EC4E88400FA49E2 /* SmallSceneryObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C842B1EC4E7CC00FA49E2 /* SmallSceneryObject.cpp */; }; - F76C867D1EC4E88400FA49E2 /* StringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C842F1EC4E7CC00FA49E2 /* StringTable.cpp */; }; - F76C867F1EC4E88400FA49E2 /* WallObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84311EC4E7CC00FA49E2 /* WallObject.cpp */; }; - F76C86811EC4E88400FA49E2 /* WaterObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84331EC4E7CC00FA49E2 /* WaterObject.cpp */; }; - F76C86861EC4E88400FA49E2 /* OpenRCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84381EC4E7CC00FA49E2 /* OpenRCT2.cpp */; }; - F76C869C1EC4E88400FA49E2 /* ParkImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84511EC4E7CC00FA49E2 /* ParkImporter.cpp */; }; - F76C86A31EC4E88400FA49E2 /* Crash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C845A1EC4E7CC00FA49E2 /* Crash.cpp */; }; - F76C86AD1EC4E88400FA49E2 /* PlatformEnvironment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84641EC4E7CC00FA49E2 /* PlatformEnvironment.cpp */; }; - F76C86AF1EC4E88400FA49E2 /* S4Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84671EC4E7CC00FA49E2 /* S4Importer.cpp */; }; - F76C86B01EC4E88400FA49E2 /* Tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84681EC4E7CC00FA49E2 /* Tables.cpp */; }; - F76C86B41EC4E88400FA49E2 /* SawyerChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C846D1EC4E7CC00FA49E2 /* SawyerChunk.cpp */; }; - F76C86B61EC4E88400FA49E2 /* SawyerChunkReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C846F1EC4E7CC00FA49E2 /* SawyerChunkReader.cpp */; }; - F76C86B81EC4E88400FA49E2 /* SawyerChunkWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84711EC4E7CC00FA49E2 /* SawyerChunkWriter.cpp */; }; - F76C86BA1EC4E88400FA49E2 /* SawyerEncoding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84731EC4E7CC00FA49E2 /* SawyerEncoding.cpp */; }; - F76C86C31EC4E88400FA49E2 /* S6Exporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C847D1EC4E7CC00FA49E2 /* S6Exporter.cpp */; }; - F76C86C51EC4E88400FA49E2 /* S6Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C847F1EC4E7CC00FA49E2 /* S6Importer.cpp */; }; - F76C871C1EC4E88400FA49E2 /* TrackDesignRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84DC1EC4E7CD00FA49E2 /* TrackDesignRepository.cpp */; }; - F76C87331EC4E88400FA49E2 /* ScenarioRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84F61EC4E7CD00FA49E2 /* ScenarioRepository.cpp */; }; - F76C87351EC4E88400FA49E2 /* ScenarioSources.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84F81EC4E7CD00FA49E2 /* ScenarioSources.cpp */; }; - F76C87381EC4E88400FA49E2 /* TitleScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84FC1EC4E7CD00FA49E2 /* TitleScreen.cpp */; }; - F76C873A1EC4E88400FA49E2 /* TitleSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C84FE1EC4E7CD00FA49E2 /* TitleSequence.cpp */; }; - F76C873C1EC4E88400FA49E2 /* TitleSequenceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85001EC4E7CD00FA49E2 /* TitleSequenceManager.cpp */; }; - F76C87451EC4E88400FA49E2 /* Version.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C850B1EC4E7CD00FA49E2 /* Version.cpp */; }; - F76C88781EC5324E00FA49E2 /* AudioChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85821EC4E82600FA49E2 /* AudioChannel.cpp */; }; - F76C88791EC5324E00FA49E2 /* AudioContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85831EC4E82600FA49E2 /* AudioContext.cpp */; }; - F76C887A1EC5324E00FA49E2 /* AudioMixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85861EC4E82600FA49E2 /* AudioMixer.cpp */; }; - F76C887B1EC5324E00FA49E2 /* FileAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85871EC4E82600FA49E2 /* FileAudioSource.cpp */; }; - F76C887C1EC5324E00FA49E2 /* MemoryAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85881EC4E82600FA49E2 /* MemoryAudioSource.cpp */; }; - F76C887D1EC5324E00FA49E2 /* CursorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C858A1EC4E82600FA49E2 /* CursorData.cpp */; }; - F76C887E1EC5324E00FA49E2 /* CursorRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C858B1EC4E82600FA49E2 /* CursorRepository.cpp */; }; - F76C888A1EC5324E00FA49E2 /* TextComposition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85A91EC4E82600FA49E2 /* TextComposition.cpp */; }; - F76C888B1EC5324E00FA49E2 /* Ui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85AB1EC4E82600FA49E2 /* Ui.cpp */; }; - F76C888C1EC5324E00FA49E2 /* UiContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85AC1EC4E82600FA49E2 /* UiContext.cpp */; }; - F76C888D1EC5324E00FA49E2 /* UiContext.Linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85AE1EC4E82600FA49E2 /* UiContext.Linux.cpp */; }; - F76C888E1EC5324E00FA49E2 /* UiContext.Win32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C85AF1EC4E82600FA49E2 /* UiContext.Win32.cpp */; }; - F76C88921EC539A300FA49E2 /* libopenrct2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F76C809A1EC4D9FA00FA49E2 /* libopenrct2.a */; }; - F775F5351EE35A89001F00E7 /* DummyUiContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F775F5331EE35A6B001F00E7 /* DummyUiContext.cpp */; }; - F775F5381EE3725C001F00E7 /* DummyAudioContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F775F5361EE3724F001F00E7 /* DummyAudioContext.cpp */; }; - F79F428F1F3260F1009E42F8 /* changelog.txt in Resources */ = {isa = PBXBuildFile; fileRef = F79F428E1F3260F1009E42F8 /* changelog.txt */; }; - F7C44AF82030E8D3007E099F /* AVX2Drawing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7C44AF62030E74B007E099F /* AVX2Drawing.cpp */; settings = {COMPILER_FLAGS = "-mavx2"; }; }; - F7CB863F1EEDA0B50030C877 /* WindowManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7CB863D1EEDA0B50030C877 /* WindowManager.cpp */; }; - F7CB864E1EEDA2050030C877 /* DummyWindowManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7CB864B1EEDA1A80030C877 /* DummyWindowManager.cpp */; }; - F7D7747F1EC61E5100BE6EBC /* UiContext.macOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7D7747E1EC61E5100BE6EBC /* UiContext.macOS.mm */; }; - F7D7748D1EC66F8600BE6EBC /* libopenrct2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F76C809A1EC4D9FA00FA49E2 /* libopenrct2.a */; }; - F7D7748E1EC66FA000BE6EBC /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B741C1C210A7A0080A7B9 /* libiconv.tbd */; }; - F7D7748F1EC66FA900BE6EBC /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B73EE1C2101890080A7B9 /* libcurl.tbd */; }; - F7D774901EC66FB000BE6EBC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D47304D41C4FF8250015C0EA /* libz.tbd */; }; - F7D7749E1EC6713200BE6EBC /* Cli.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C857D1EC4E80E00FA49E2 /* Cli.cpp */; }; - F7D774AC1EC6741D00BE6EBC /* language in CopyFiles */ = {isa = PBXBuildFile; fileRef = D4EC48E41C2637710024B507 /* language */; }; - F7D774AD1EC6741D00BE6EBC /* shaders in CopyFiles */ = {isa = PBXBuildFile; fileRef = D43407E11D0E14CE00C2B3D4 /* shaders */; }; - F7D774AE1EC6741D00BE6EBC /* sequence in CopyFiles */ = {isa = PBXBuildFile; fileRef = D4EC48E51C2637710024B507 /* sequence */; }; - E73A781EBC3C440A99D59821 /* EntityTweener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0EB0D1DF6CC74E4190301D84 /* EntityTweener.cpp */; }; - F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */ = {isa = PBXBuildFile; fileRef = 091352A950004312BAB18717 /* EntityTweener.h */; }; - 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9D3DD6CD73F5421880280D9D /* Litter.cpp */; }; - B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */; }; - 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */; }; - 8C801369C7E44292A5348DFB /* ScEntity.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6DF61461D47C40CF92019B24 /* ScEntity.hpp */; }; - BCCE3EDC711F4F0587F1C359 /* ScCheats.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */; }; - F396A397541149D6ACA290D2 /* ScConfiguration.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */; }; - 2EEDD899BAF94706ACED5F6D /* ScConsole.hpp in Headers */ = {isa = PBXBuildFile; fileRef = E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */; }; - 74E3377F2FC04316959F1AED /* ScContext.hpp in Headers */ = {isa = PBXBuildFile; fileRef = DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */; }; - A10C0EE3C2614B53AFB6ED35 /* ScDisposable.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */; }; - 05F6EF4AAFEC4BA4A454046B /* ScNetwork.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */; }; - AC4C9184C93A4113A6BEEC60 /* ScSocket.hpp in Headers */ = {isa = PBXBuildFile; fileRef = D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */; }; - A962C2EF5FA6429C92318441 /* ScObject.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 24F9DF02868247738D05CC40 /* ScObject.hpp */; }; - E09450B2440E465CBCE62DEB /* ScRide.hpp in Headers */ = {isa = PBXBuildFile; fileRef = AD97B712FDF7454CADC7A328 /* ScRide.hpp */; }; - A2EC8BBCB8AD49ECB1C22F9D /* ScClimate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */; }; - 2AE59B9E2E4D496286970915 /* ScDate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */; }; - 7930E9462549403181C5D164 /* ScMap.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 74CDED6B7EF041458032681A /* ScMap.hpp */; }; - 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 9AB8D336AB654D0280549A89 /* ScPark.hpp */; }; - 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A9F55F2291284217BA0E4E51 /* ScScenario.hpp */; }; - F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 22D7DD798F054A068273739B /* ScTile.hpp */; }; - 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */; }; - D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */; }; - BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */; }; - 428B1DADD66C4829894AD0A1 /* ScGuest.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */; }; - D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */; }; - 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */; }; - 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30AB6C640464647ABE90EC4 /* ScStaff.hpp */; }; - 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */; }; - 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C30388F4F6D34DF59EF7072C /* ScLitter.hpp */; }; - 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */; }; - 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */; }; - E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */; }; - 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 7A08C451885D4D419FB4820D /* ScPlayer.hpp */; }; - F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */; }; - CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */; }; - 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */; }; - 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3B00C9900ED42AFA72764ED /* ScRide.cpp */; }; - 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BE60702D7549488A32CC0B /* ScMap.cpp */; }; - BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */; }; - AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */; }; - 887B0043454440BAB322A9E8 /* ScPark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E9C4DE37309A4B5F965D7718 /* ScPark.cpp */; }; - 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43D18154E96444749737E3F6 /* ScTileElement.cpp */; }; - DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */; }; - 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B67E36A8620400CA70FBA49 /* ScTile.cpp */; }; - 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */; }; - E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA720D496604387806AC168 /* RideUseSystem.h */; }; - C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F4D523B8782E4C458AF1490D /* GroupVector.hpp */; }; - B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F28A181D311D4E078FDB090C /* ZipStream.hpp */; }; - 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */; }; - 4653963391E945D397BCCA0C /* ChangeMapSizeAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */; }; - F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */; }; - B769EFE0AA1149AE93C15DED /* OrcaStream.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F9061C16C67A45D7915FA229 /* OrcaStream.hpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - C68B2D481EC790970020651C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D497D0701C20FD52002BF46A /* Project object */; - proxyType = 1; - remoteGlobalIDString = C68B2D431EC790690020651C; - remoteInfo = "Download Libraries"; - }; - C68B2D4A1EC7909B0020651C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D497D0701C20FD52002BF46A /* Project object */; - proxyType = 1; - remoteGlobalIDString = C68B2D431EC790690020651C; - remoteInfo = "Download Libraries"; - }; - C68B2D4C1EC7909E0020651C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D497D0701C20FD52002BF46A /* Project object */; - proxyType = 1; - remoteGlobalIDString = F76C80991EC4D9FA00FA49E2; - remoteInfo = libopenrct2; - }; - F76C888F1EC5325700FA49E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D497D0701C20FD52002BF46A /* Project object */; - proxyType = 1; - remoteGlobalIDString = F76C80991EC4D9FA00FA49E2; - remoteInfo = libopenrct2; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - D41B74201C210B190080A7B9 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 669125A825FD2CD200B038E1 /* libSDL2-2.0.dylib in Embed Frameworks */, - 669125A325FD2C9100B038E1 /* libcrypto.1.1.dylib in Embed Frameworks */, - 6691258C25FD2C5200B038E1 /* libbrotlicommon.1.dylib in Embed Frameworks */, - 6691258D25FD2C5200B038E1 /* libbrotlidec.1.dylib in Embed Frameworks */, - 6691258E25FD2C5200B038E1 /* libbrotlienc.1.dylib in Embed Frameworks */, - 6691258F25FD2C5200B038E1 /* libbz2.1.0.dylib in Embed Frameworks */, - 6691259125FD2C5200B038E1 /* libdiscord-rpc.dylib in Embed Frameworks */, - 6691259225FD2C5200B038E1 /* libduktape.2.dylib in Embed Frameworks */, - 6691259325FD2C5200B038E1 /* libfreetype.6.dylib in Embed Frameworks */, - 6691259425FD2C5200B038E1 /* libicudata.67.dylib in Embed Frameworks */, - 6691259525FD2C5200B038E1 /* libicui18n.67.dylib in Embed Frameworks */, - 6691259625FD2C5200B038E1 /* libicuio.67.dylib in Embed Frameworks */, - 6691259725FD2C5200B038E1 /* libicutu.67.dylib in Embed Frameworks */, - 6691259825FD2C5200B038E1 /* libicuuc.67.dylib in Embed Frameworks */, - 6691259925FD2C5200B038E1 /* libpng16.16.dylib in Embed Frameworks */, - 6691259B25FD2C5200B038E1 /* libspeexdsp.1.dylib in Embed Frameworks */, - 6691259C25FD2C5200B038E1 /* libssl.1.1.dylib in Embed Frameworks */, - 6691259D25FD2C5200B038E1 /* libz.1.dylib in Embed Frameworks */, - 6691259E25FD2C5200B038E1 /* libzip.5.dylib in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - F7D774821EC66CD700BE6EBC /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 669125B125FD2E4200B038E1 /* libcrypto.1.1.dylib in Embed Frameworks */, - 669125B225FD2E4200B038E1 /* libdiscord-rpc.dylib in Embed Frameworks */, - 669125B325FD2E4200B038E1 /* libfreetype.6.dylib in Embed Frameworks */, - 669125B425FD2E4200B038E1 /* libpng16.16.dylib in Embed Frameworks */, - 669125B525FD2E4200B038E1 /* libspeexdsp.1.dylib in Embed Frameworks */, - 669125B625FD2E4200B038E1 /* libzip.5.dylib in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - F7D774AA1EC6740D00BE6EBC /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - F7D774AC1EC6741D00BE6EBC /* language in CopyFiles */, - F7D774AD1EC6741D00BE6EBC /* shaders in CopyFiles */, - F7D774AE1EC6741D00BE6EBC /* sequence in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 01C6F0C022FD519E0057E2F7 /* TrackImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackImporter.cpp; sourceTree = ""; }; - 01C6F0C122FD519E0057E2F7 /* TrackImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackImporter.h; sourceTree = ""; }; - 01C6F0C322FD51B70057E2F7 /* T4Importer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = T4Importer.cpp; sourceTree = ""; }; - 01C6F0C522FD51FC0057E2F7 /* T6Exporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = T6Exporter.cpp; sourceTree = ""; }; - 01C6F0C622FD51FC0057E2F7 /* T6Importer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = T6Importer.cpp; sourceTree = ""; }; - 01C6F0C722FD51FC0057E2F7 /* T6Exporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = T6Exporter.h; sourceTree = ""; }; - 01DDFE6422FD608500221318 /* Window_internal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window_internal.cpp; sourceTree = ""; }; - 20DE495E25DA8C6B00F2DF6D /* TileElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileElementBase.cpp; sourceTree = ""; }; - 2A5354EA22099C7200A5440F /* CircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircularBuffer.h; sourceTree = ""; }; - 2ADE2F21224418B1002598AF /* Random.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Random.hpp; sourceTree = ""; }; - 2ADE2F22224418B1002598AF /* DataSerialiserTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSerialiserTag.h; sourceTree = ""; }; - 2ADE2F23224418B1002598AF /* Numerics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Numerics.hpp; sourceTree = ""; }; - 2ADE2F24224418B2002598AF /* Meta.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Meta.hpp; sourceTree = ""; }; - 2ADE2F26224418B2002598AF /* FileIndex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = FileIndex.hpp; sourceTree = ""; }; - 2ADE2F2D224418E7002598AF /* ConversionTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionTables.h; sourceTree = ""; }; - 2ADE2F2F22441905002598AF /* DiscordService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscordService.h; sourceTree = ""; }; - 2ADE2F3022441905002598AF /* DiscordService.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiscordService.cpp; sourceTree = ""; }; - 2ADE2F332244191E002598AF /* VirtualFloor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualFloor.h; sourceTree = ""; }; - 2ADE2F352244195F002598AF /* RideTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideTypes.h; sourceTree = ""; }; - 2ADE2F372244198A002598AF /* SpriteBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteBase.h; sourceTree = ""; }; - 304FE94F23A2996600470197 /* SceneryScatter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneryScatter.cpp; sourceTree = ""; }; - 4C1A53EC205FD19F000F8EF5 /* SceneryObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneryObject.cpp; sourceTree = ""; }; - 4C1EE63C24AB4A2700D7177F /* HybridCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridCoaster.cpp; sourceTree = ""; }; - 4C25594E244A328A00CE7E45 /* CustomWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomWindow.h; path = scripting/CustomWindow.h; sourceTree = ""; }; - 4C25594F244A328A00CE7E45 /* CustomMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomMenu.cpp; path = scripting/CustomMenu.cpp; sourceTree = ""; }; - 4C255950244A328A00CE7E45 /* ScUi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScUi.hpp; path = scripting/ScUi.hpp; sourceTree = ""; }; - 4C255951244A328A00CE7E45 /* ScWidget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScWidget.hpp; path = scripting/ScWidget.hpp; sourceTree = ""; }; - 4C255952244A328A00CE7E45 /* ScWindow.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScWindow.hpp; path = scripting/ScWindow.hpp; sourceTree = ""; }; - 4C255953244A328A00CE7E45 /* CustomMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomMenu.h; path = scripting/CustomMenu.h; sourceTree = ""; }; - 4C255954244A328A00CE7E45 /* UiExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UiExtensions.cpp; path = scripting/UiExtensions.cpp; sourceTree = ""; }; - 4C255955244A328A00CE7E45 /* ScViewport.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScViewport.hpp; path = scripting/ScViewport.hpp; sourceTree = ""; }; - 4C255956244A328B00CE7E45 /* UiExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UiExtensions.h; path = scripting/UiExtensions.h; sourceTree = ""; }; - 4C255957244A328B00CE7E45 /* CustomWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomWindow.cpp; path = scripting/CustomWindow.cpp; sourceTree = ""; }; - 4C25595C244A32E400CE7E45 /* filesystem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = filesystem.hpp; path = src/thirdparty/filesystem.hpp; sourceTree = SOURCE_ROOT; }; - 4C25595D244A32E400CE7E45 /* linenoise.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = linenoise.hpp; path = src/thirdparty/linenoise.hpp; sourceTree = SOURCE_ROOT; }; - 4C25595F244A330700CE7E45 /* detail_stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_stack.h; path = src/thirdparty/dukglue/detail_stack.h; sourceTree = SOURCE_ROOT; }; - 4C255960244A330700CE7E45 /* register_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = register_class.h; path = src/thirdparty/dukglue/register_class.h; sourceTree = SOURCE_ROOT; }; - 4C255961244A330700CE7E45 /* dukvalue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dukvalue.h; path = src/thirdparty/dukglue/dukvalue.h; sourceTree = SOURCE_ROOT; }; - 4C255962244A330700CE7E45 /* detail_primitive_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_primitive_types.h; path = src/thirdparty/dukglue/detail_primitive_types.h; sourceTree = SOURCE_ROOT; }; - 4C255963244A330700CE7E45 /* dukglue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dukglue.h; path = src/thirdparty/dukglue/dukglue.h; sourceTree = SOURCE_ROOT; }; - 4C255964244A330700CE7E45 /* detail_class_proto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_class_proto.h; path = src/thirdparty/dukglue/detail_class_proto.h; sourceTree = SOURCE_ROOT; }; - 4C255965244A330700CE7E45 /* detail_traits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_traits.h; path = src/thirdparty/dukglue/detail_traits.h; sourceTree = SOURCE_ROOT; }; - 4C255966244A330700CE7E45 /* register_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = register_function.h; path = src/thirdparty/dukglue/register_function.h; sourceTree = SOURCE_ROOT; }; - 4C255967244A330700CE7E45 /* detail_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_function.h; path = src/thirdparty/dukglue/detail_function.h; sourceTree = SOURCE_ROOT; }; - 4C255968244A330700CE7E45 /* detail_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_types.h; path = src/thirdparty/dukglue/detail_types.h; sourceTree = SOURCE_ROOT; }; - 4C255969244A330800CE7E45 /* detail_constructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_constructor.h; path = src/thirdparty/dukglue/detail_constructor.h; sourceTree = SOURCE_ROOT; }; - 4C25596A244A330800CE7E45 /* public_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = public_util.h; path = src/thirdparty/dukglue/public_util.h; sourceTree = SOURCE_ROOT; }; - 4C25596B244A330800CE7E45 /* detail_refs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_refs.h; path = src/thirdparty/dukglue/detail_refs.h; sourceTree = SOURCE_ROOT; }; - 4C25596C244A330800CE7E45 /* register_property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = register_property.h; path = src/thirdparty/dukglue/register_property.h; sourceTree = SOURCE_ROOT; }; - 4C25596D244A330800CE7E45 /* detail_method.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_method.h; path = src/thirdparty/dukglue/detail_method.h; sourceTree = SOURCE_ROOT; }; - 4C25596E244A330800CE7E45 /* dukexception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dukexception.h; path = src/thirdparty/dukglue/dukexception.h; sourceTree = SOURCE_ROOT; }; - 4C25596F244A330800CE7E45 /* detail_typeinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detail_typeinfo.h; path = src/thirdparty/dukglue/detail_typeinfo.h; sourceTree = SOURCE_ROOT; }; - 4C29DEB2218C6AE500E8707F /* RCT12.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RCT12.cpp; sourceTree = ""; }; - 4C2BF6C3258FF2FB005CD9A0 /* SingleRailRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SingleRailRollerCoaster.cpp; sourceTree = ""; }; - 4C358E5021C445F700ADE6BC /* ReplayManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplayManager.cpp; sourceTree = ""; }; - 4C358E5121C445F700ADE6BC /* ReplayManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayManager.h; sourceTree = ""; }; - 4C3B4234205914F7000C5BB7 /* InGameConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InGameConsole.cpp; sourceTree = ""; }; - 4C3B4235205914F7000C5BB7 /* InGameConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InGameConsole.h; sourceTree = ""; }; - 4C3B423720591513000C5BB7 /* StdInOutConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StdInOutConsole.cpp; sourceTree = ""; }; - 4C4C1E971F58226500560300 /* TrackDesign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesign.cpp; sourceTree = ""; }; - 4C4C1E991F5832AA00560300 /* TrackDesign.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackDesign.h; sourceTree = ""; }; - 4C5DFF401FAC69D200CB093A /* Date.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Date.cpp; sourceTree = ""; }; - 4C5DFF411FAC69D200CB093A /* Date.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Date.h; sourceTree = ""; }; - 4C6A668A1FE14C3A00694CB6 /* SawyerCoding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SawyerCoding.cpp; sourceTree = ""; }; - 4C6A668B1FE14C3A00694CB6 /* SawyerCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SawyerCoding.h; sourceTree = ""; }; - 4C6A668C1FE14C3A00694CB6 /* Util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Util.cpp; sourceTree = ""; }; - 4C6A668D1FE14C3A00694CB6 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; - 4C6A66901FE14C9500694CB6 /* Cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cheats.cpp; sourceTree = ""; }; - 4C6A66911FE14C9500694CB6 /* Cheats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cheats.h; sourceTree = ""; }; - 4C6A66AE1FE278C900694CB6 /* Paint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.cpp; sourceTree = ""; }; - 4C6A66AF1FE278C900694CB6 /* Paint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Paint.h; sourceTree = ""; }; - 4C6A66B01FE278C900694CB6 /* Painter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Painter.cpp; sourceTree = ""; }; - 4C6A66B11FE278C900694CB6 /* Painter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Painter.h; sourceTree = ""; }; - 4C6A66B21FE278C900694CB6 /* PaintHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PaintHelpers.cpp; sourceTree = ""; }; - 4C6A66B31FE278C900694CB6 /* Supports.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Supports.cpp; sourceTree = ""; }; - 4C6A66B41FE278C900694CB6 /* Supports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Supports.h; sourceTree = ""; }; - 4C6A66BB1FED04EE00694CB6 /* SSE41Drawing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SSE41Drawing.cpp; sourceTree = ""; }; - 4C6A66BF1FF9322A00694CB6 /* Ride.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ride.cpp; sourceTree = ""; }; - 4C6A66C01FF9322A00694CB6 /* Ride.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ride.h; sourceTree = ""; }; - 4C6AC20D1F9E1693004324AA /* Station.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Station.cpp; sourceTree = ""; }; - 4C6AC20E1F9E1693004324AA /* Station.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Station.h; sourceTree = ""; }; - 4C6AC2101F9E1CB3004324AA /* CableLift.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CableLift.cpp; sourceTree = ""; }; - 4C6AC2111F9E1CB3004324AA /* CableLift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CableLift.h; sourceTree = ""; }; - 4C724B2121F0AD790012ADD0 /* BenchSpriteSort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BenchSpriteSort.cpp; sourceTree = ""; }; - 4C7B53A21FFC15ED00A52E21 /* ObjectLimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectLimits.h; sourceTree = ""; }; - 4C7B53A31FFC180400A52E21 /* ObjectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectList.cpp; sourceTree = ""; }; - 4C7B53A41FFC180400A52E21 /* ObjectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectList.h; sourceTree = ""; }; - 4C7B53AA1FFF935B00A52E21 /* Convert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Convert.cpp; sourceTree = ""; }; - 4C7B53AB1FFF935B00A52E21 /* Currency.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Currency.cpp; sourceTree = ""; }; - 4C7B53AC1FFF935B00A52E21 /* Currency.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Currency.h; sourceTree = ""; }; - 4C7B53AE1FFF935B00A52E21 /* Date.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Date.h; sourceTree = ""; }; - 4C7B53AF1FFF935B00A52E21 /* FormatCodes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormatCodes.cpp; sourceTree = ""; }; - 4C7B53B01FFF935B00A52E21 /* FormatCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormatCodes.h; sourceTree = ""; }; - 4C7B53B11FFF935B00A52E21 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Language.cpp; sourceTree = ""; }; - 4C7B53B31FFF935B00A52E21 /* LanguagePack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguagePack.cpp; sourceTree = ""; }; - 4C7B53B41FFF935B00A52E21 /* LanguagePack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguagePack.h; sourceTree = ""; }; - 4C7B53B51FFF935B00A52E21 /* Localisation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Localisation.cpp; sourceTree = ""; }; - 4C7B53B61FFF935B00A52E21 /* Localisation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Localisation.h; sourceTree = ""; }; - 4C7B53B71FFF935B00A52E21 /* RealNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RealNames.cpp; sourceTree = ""; }; - 4C7B53B81FFF935B00A52E21 /* StringIds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringIds.h; sourceTree = ""; }; - 4C7B53BB1FFF935B00A52E21 /* UTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTF8.cpp; sourceTree = ""; }; - 4C7B53C61FFF94F900A52E21 /* ConversionTables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConversionTables.cpp; sourceTree = ""; }; - 4C7B53C91FFF991000A52E21 /* Language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Language.h; sourceTree = ""; }; - 4C7B53CB1FFF995100A52E21 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = ""; }; - 4C7B53CD200029CE00A52E21 /* Line.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Line.cpp; sourceTree = ""; }; - 4C7B53CF200029D900A52E21 /* Rect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Rect.cpp; sourceTree = ""; }; - 4C7B53D0200029D900A52E21 /* ScrollingText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingText.cpp; sourceTree = ""; }; - 4C7B53D520002CA400A52E21 /* Drawing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Drawing.cpp; sourceTree = ""; }; - 4C7B53D620002CA400A52E21 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = ""; }; - 4C7B53D720002CA400A52E21 /* LightFX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LightFX.cpp; sourceTree = ""; }; - 4C7B53D820002CA400A52E21 /* TTF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TTF.cpp; sourceTree = ""; }; - 4C7B53DD200143C200A52E21 /* Chat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Chat.cpp; sourceTree = ""; }; - 4C7B53DE200143C200A52E21 /* Chat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chat.h; sourceTree = ""; }; - 4C7B53DF200143C200A52E21 /* Colour.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Colour.cpp; sourceTree = ""; }; - 4C7B53E0200143C200A52E21 /* Colour.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Colour.h; sourceTree = ""; }; - 4C7B53E3200143C200A52E21 /* Cursors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cursors.h; sourceTree = ""; }; - 4C7B53E4200143C200A52E21 /* FontFamilies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFamilies.cpp; sourceTree = ""; }; - 4C7B53E5200143C200A52E21 /* FontFamilies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFamilies.h; sourceTree = ""; }; - 4C7B53E6200143C200A52E21 /* Fonts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Fonts.cpp; sourceTree = ""; }; - 4C7B53E7200143C200A52E21 /* Fonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fonts.h; sourceTree = ""; }; - 4C7B53E8200143C200A52E21 /* Screenshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Screenshot.cpp; sourceTree = ""; }; - 4C7B53E9200143C200A52E21 /* Screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Screenshot.h; sourceTree = ""; }; - 4C7B53EC200143C200A52E21 /* Viewport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Viewport.cpp; sourceTree = ""; }; - 4C7B53ED200143C200A52E21 /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = ""; }; - 4C7B53F0200143C200A52E21 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = ""; }; - 4C7B53F1200143C200A52E21 /* Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window.cpp; sourceTree = ""; }; - 4C7B53F2200143C200A52E21 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = ""; }; - 4C7B540020015AC600A52E21 /* VirtualFloor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VirtualFloor.cpp; sourceTree = ""; }; - 4C7B54022004C57400A52E21 /* RCT1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCT1.h; sourceTree = ""; }; - 4C7B54032004C57B00A52E21 /* RCT12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCT12.h; sourceTree = ""; }; - 4C7B54042004C58200A52E21 /* RCT2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCT2.h; sourceTree = ""; }; - 4C7B54052005735F00A52E21 /* VehicleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VehicleData.cpp; sourceTree = ""; }; - 4C7B54072005736700A52E21 /* VehiclePaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VehiclePaint.cpp; sourceTree = ""; }; - 4C7B540920060D7000A52E21 /* VehicleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VehicleData.h; sourceTree = ""; }; - 4C7B540A20060D7900A52E21 /* VehiclePaint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VehiclePaint.h; sourceTree = ""; }; - 4C7B540B20060D8100A52E21 /* TrackPaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackPaint.cpp; sourceTree = ""; }; - 4C7B540C20060D8100A52E21 /* TrackPaint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPaint.h; sourceTree = ""; }; - 4C7B541420060D8E00A52E21 /* RideData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideData.cpp; sourceTree = ""; }; - 4C7B541520060D8E00A52E21 /* RideData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideData.h; sourceTree = ""; }; - 4C7B541D2007646A00A52E21 /* Balloon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Balloon.cpp; sourceTree = ""; }; - 4C7B541E2007646A00A52E21 /* Banner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Banner.cpp; sourceTree = ""; }; - 4C7B541F2007646A00A52E21 /* Banner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Banner.h; sourceTree = ""; }; - 4C7B54202007646A00A52E21 /* Climate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Climate.cpp; sourceTree = ""; }; - 4C7B54212007646A00A52E21 /* Climate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Climate.h; sourceTree = ""; }; - 4C7B54222007646A00A52E21 /* Duck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Duck.cpp; sourceTree = ""; }; - 4C7B54232007646A00A52E21 /* Entrance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Entrance.cpp; sourceTree = ""; }; - 4C7B54242007646A00A52E21 /* Entrance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Entrance.h; sourceTree = ""; }; - 4C7B54252007646A00A52E21 /* Footpath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Footpath.cpp; sourceTree = ""; }; - 4C7B54262007646A00A52E21 /* Footpath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Footpath.h; sourceTree = ""; }; - 4C7B54272007646A00A52E21 /* Fountain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Fountain.cpp; sourceTree = ""; }; - 4C7B54282007646A00A52E21 /* Fountain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fountain.h; sourceTree = ""; }; - 4C7B54292007646A00A52E21 /* LargeScenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LargeScenery.cpp; sourceTree = ""; }; - 4C7B542A2007646A00A52E21 /* LargeScenery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeScenery.h; sourceTree = ""; }; - 4C7B542C2007646A00A52E21 /* Map.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Map.cpp; sourceTree = ""; }; - 4C7B542D2007646A00A52E21 /* Map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Map.h; sourceTree = ""; }; - 4C7B542E2007646A00A52E21 /* MapAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapAnimation.cpp; sourceTree = ""; }; - 4C7B542F2007646A00A52E21 /* MapAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapAnimation.h; sourceTree = ""; }; - 4C7B54302007646A00A52E21 /* MapGen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapGen.cpp; sourceTree = ""; }; - 4C7B54312007646A00A52E21 /* MapGen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapGen.h; sourceTree = ""; }; - 4C7B54322007646A00A52E21 /* MapHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapHelpers.cpp; sourceTree = ""; }; - 4C7B54332007646A00A52E21 /* MapHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapHelpers.h; sourceTree = ""; }; - 4C7B54342007646A00A52E21 /* MoneyEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MoneyEffect.cpp; sourceTree = ""; }; - 4C7B54352007646A00A52E21 /* Park.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Park.cpp; sourceTree = ""; }; - 4C7B54362007646A00A52E21 /* Park.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Park.h; sourceTree = ""; }; - 4C7B54372007646A00A52E21 /* Particle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Particle.cpp; sourceTree = ""; }; - 4C7B54382007646A00A52E21 /* Scenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scenery.cpp; sourceTree = ""; }; - 4C7B54392007646A00A52E21 /* Scenery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scenery.h; sourceTree = ""; }; - 4C7B543A2007646A00A52E21 /* SmallScenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmallScenery.cpp; sourceTree = ""; }; - 4C7B543B2007646A00A52E21 /* SmallScenery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallScenery.h; sourceTree = ""; }; - 4C7B543C2007646A00A52E21 /* Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Sprite.cpp; sourceTree = ""; }; - 4C7B543D2007646A00A52E21 /* Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sprite.h; sourceTree = ""; }; - 4C7B543E2007646A00A52E21 /* TileInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileInspector.cpp; sourceTree = ""; }; - 4C7B543F2007646A00A52E21 /* TileInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TileInspector.h; sourceTree = ""; }; - 4C7B54402007646A00A52E21 /* Wall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Wall.cpp; sourceTree = ""; }; - 4C7B54412007646A00A52E21 /* Wall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Wall.h; sourceTree = ""; }; - 4C7B54422007646A00A52E21 /* Water.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Water.h; sourceTree = ""; }; - 4C7B54682007BF2E00A52E21 /* TTFSDLPort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TTFSDLPort.cpp; sourceTree = ""; }; - 4C7B54742010DF3C00A52E21 /* Android.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Android.cpp; sourceTree = ""; }; - 4C7B54762010DF4300A52E21 /* Linux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Linux.cpp; sourceTree = ""; }; - 4C7B54782010DF4C00A52E21 /* Posix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Posix.cpp; sourceTree = ""; }; - 4C7B54792010DF4C00A52E21 /* Shared.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shared.cpp; sourceTree = ""; }; - 4C7B547A2010DF4C00A52E21 /* Windows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Windows.cpp; sourceTree = ""; }; - 4C7B547E2010DFF700A52E21 /* Crash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crash.h; sourceTree = ""; }; - 4C81F7DF24672C4D000E61BF /* CustomListView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomListView.cpp; path = scripting/CustomListView.cpp; sourceTree = ""; }; - 4C81F7E024672C4D000E61BF /* CustomListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomListView.h; path = scripting/CustomListView.h; sourceTree = ""; }; - 4C81F7E224672C58000E61BF /* ScTileSelection.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTileSelection.hpp; path = scripting/ScTileSelection.hpp; sourceTree = ""; }; - 4C882FB825FEA80D0039D1C4 /* TrainManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrainManager.cpp; sourceTree = ""; }; - 4C882FB925FEA80E0039D1C4 /* TrainManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrainManager.h; sourceTree = ""; }; - 4C882FBB25FEA8260039D1C4 /* VehicleColour.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VehicleColour.h; sourceTree = ""; }; - 4C882FBC25FEA8270039D1C4 /* VehicleEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VehicleEntry.h; sourceTree = ""; }; - 4C8A6FF123EB5325001A8255 /* Http.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Http.h; sourceTree = ""; }; - 4C8A6FF223EB5326001A8255 /* Http.cURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Http.cURL.cpp; sourceTree = ""; }; - 4C8B426E1EEB1ABD00F015CA /* X8DrawingEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = X8DrawingEngine.cpp; sourceTree = ""; }; - 4C8B426F1EEB1ABD00F015CA /* X8DrawingEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X8DrawingEngine.h; sourceTree = ""; }; - 4C8B42711EEB1AE400F015CA /* HardwareDisplayDrawingEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HardwareDisplayDrawingEngine.cpp; sourceTree = ""; }; - 4C8BB67625533D4B005C8830 /* FileSystem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = FileSystem.hpp; sourceTree = ""; }; - 4C8BB67725533D4B005C8830 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = ""; }; - 4C8BB67825533D4C005C8830 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = ""; }; - 4C8BB67A25533D58005C8830 /* JobPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JobPool.h; sourceTree = ""; }; - 4C8BB67B25533D59005C8830 /* JobPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JobPool.cpp; sourceTree = ""; }; - 4C8BB67D25533D64005C8830 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = ""; }; - 4C8BB67E25533D64005C8830 /* StringReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringReader.cpp; sourceTree = ""; }; - 4C8BB67F25533D64005C8830 /* StringReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringReader.h; sourceTree = ""; }; - 4C8BB68025533D64005C8830 /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = ""; }; - 4C8BB68325533DB9005C8830 /* ZoomLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZoomLevel.h; sourceTree = ""; }; - 4C8BB68425533DB9005C8830 /* ZoomLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZoomLevel.cpp; sourceTree = ""; }; - 4C9196ED204FF3E000869A24 /* Location.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Location.hpp; sourceTree = ""; }; - 4C91FD5D25AE476700CA5DA4 /* MusicObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicObject.cpp; sourceTree = ""; }; - 4C91FD5E25AE476700CA5DA4 /* MusicObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicObject.h; sourceTree = ""; }; - 4C91FD6025AE483600CA5DA4 /* RideAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideAudio.cpp; sourceTree = ""; }; - 4C91FD6125AE483600CA5DA4 /* RideAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideAudio.h; sourceTree = ""; }; - 4C93F1181F8B744400A9330D /* AirPoweredVerticalCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AirPoweredVerticalCoaster.cpp; sourceTree = ""; }; - 4C93F1191F8B744400A9330D /* BobsleighCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BobsleighCoaster.cpp; sourceTree = ""; }; - 4C93F11A1F8B744400A9330D /* BolligerMabillardTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BolligerMabillardTrack.h; sourceTree = ""; }; - 4C93F11B1F8B744400A9330D /* BolligerMabillardTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BolligerMabillardTrack.cpp; sourceTree = ""; }; - 4C93F11C1F8B744400A9330D /* CompactInvertedCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompactInvertedCoaster.cpp; sourceTree = ""; }; - 4C93F11D1F8B744400A9330D /* CorkscrewRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CorkscrewRollerCoaster.cpp; sourceTree = ""; }; - 4C93F11E1F8B744400A9330D /* FlyingRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FlyingRollerCoaster.cpp; sourceTree = ""; }; - 4C93F11F1F8B744400A9330D /* GigaCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GigaCoaster.cpp; sourceTree = ""; }; - 4C93F1201F8B744400A9330D /* HeartlineTwisterCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeartlineTwisterCoaster.cpp; sourceTree = ""; }; - 4C93F1211F8B744400A9330D /* InvertedHairpinCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InvertedHairpinCoaster.cpp; sourceTree = ""; }; - 4C93F1221F8B744400A9330D /* InvertedImpulseCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InvertedImpulseCoaster.cpp; sourceTree = ""; }; - 4C93F1231F8B744400A9330D /* InvertedRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InvertedRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1241F8B744400A9330D /* JuniorRollerCoaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JuniorRollerCoaster.h; sourceTree = ""; }; - 4C93F1251F8B744400A9330D /* JuniorRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JuniorRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1261F8B744400A9330D /* LayDownRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayDownRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1271F8B744400A9330D /* LimLaunchedRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LimLaunchedRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1281F8B744400A9330D /* LoopingRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoopingRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1291F8B744400A9330D /* MineRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MineRide.cpp; sourceTree = ""; }; - 4C93F12A1F8B744400A9330D /* MineTrainCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MineTrainCoaster.cpp; sourceTree = ""; }; - 4C93F12B1F8B744400A9330D /* MiniRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiniRollerCoaster.cpp; sourceTree = ""; }; - 4C93F12C1F8B744400A9330D /* MiniSuspendedCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiniSuspendedCoaster.cpp; sourceTree = ""; }; - 4C93F12D1F8B744400A9330D /* MultiDimensionRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MultiDimensionRollerCoaster.cpp; sourceTree = ""; }; - 4C93F12E1F8B744400A9330D /* ReverseFreefallCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReverseFreefallCoaster.cpp; sourceTree = ""; }; - 4C93F12F1F8B744400A9330D /* ReverserRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReverserRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1301F8B744400A9330D /* SideFrictionRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SideFrictionRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1311F8B744400A9330D /* StandUpRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StandUpRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1321F8B744400A9330D /* Steeplechase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Steeplechase.cpp; sourceTree = ""; }; - 4C93F1331F8B744400A9330D /* SuspendedSwingingCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SuspendedSwingingCoaster.cpp; sourceTree = ""; }; - 4C93F1341F8B744400A9330D /* TwisterRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TwisterRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1351F8B744400A9330D /* VerticalDropRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VerticalDropRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1361F8B744400A9330D /* VirginiaReel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VirginiaReel.cpp; sourceTree = ""; }; - 4C93F1371F8B744400A9330D /* WildMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WildMouse.cpp; sourceTree = ""; }; - 4C93F1381F8B744400A9330D /* WoodenRollerCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WoodenRollerCoaster.cpp; sourceTree = ""; }; - 4C93F1391F8B744400A9330D /* WoodenWildMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WoodenWildMouse.cpp; sourceTree = ""; }; - 4C93F15A1F8B745700A9330D /* CarRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CarRide.cpp; sourceTree = ""; }; - 4C93F15B1F8B745700A9330D /* Circus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Circus.cpp; sourceTree = ""; }; - 4C93F15C1F8B745700A9330D /* CrookedHouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrookedHouse.cpp; sourceTree = ""; }; - 4C93F15D1F8B745700A9330D /* Dodgems.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dodgems.cpp; sourceTree = ""; }; - 4C93F15E1F8B745700A9330D /* FerrisWheel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FerrisWheel.cpp; sourceTree = ""; }; - 4C93F15F1F8B745700A9330D /* FlyingSaucers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FlyingSaucers.cpp; sourceTree = ""; }; - 4C93F1601F8B745700A9330D /* GhostTrain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GhostTrain.cpp; sourceTree = ""; }; - 4C93F1611F8B745700A9330D /* HauntedHouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HauntedHouse.cpp; sourceTree = ""; }; - 4C93F1621F8B745700A9330D /* Maze.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Maze.cpp; sourceTree = ""; }; - 4C93F1631F8B745700A9330D /* MerryGoRound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MerryGoRound.cpp; sourceTree = ""; }; - 4C93F1641F8B745700A9330D /* MiniGolf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiniGolf.cpp; sourceTree = ""; }; - 4C93F1651F8B745700A9330D /* MiniHelicopters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiniHelicopters.cpp; sourceTree = ""; }; - 4C93F1661F8B745700A9330D /* MonorailCycles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MonorailCycles.cpp; sourceTree = ""; }; - 4C93F1671F8B745700A9330D /* ObservationTower.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObservationTower.cpp; sourceTree = ""; }; - 4C93F1681F8B745700A9330D /* SpaceRings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceRings.cpp; sourceTree = ""; }; - 4C93F1691F8B745700A9330D /* SpiralSlide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpiralSlide.cpp; sourceTree = ""; }; - 4C93F17A1F8B747300A9330D /* Facility.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Facility.cpp; sourceTree = ""; }; - 4C93F17B1F8B747300A9330D /* Shop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shop.cpp; sourceTree = ""; }; - 4C93F17E1F8B747A00A9330D /* 3dCinema.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = 3dCinema.cpp; sourceTree = ""; }; - 4C93F17F1F8B747A00A9330D /* Enterprise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Enterprise.cpp; sourceTree = ""; }; - 4C93F1801F8B747A00A9330D /* GoKarts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoKarts.cpp; sourceTree = ""; }; - 4C93F1811F8B747A00A9330D /* LaunchedFreefall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LaunchedFreefall.cpp; sourceTree = ""; }; - 4C93F1821F8B747A00A9330D /* MagicCarpet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MagicCarpet.cpp; sourceTree = ""; }; - 4C93F1831F8B747A00A9330D /* MotionSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MotionSimulator.cpp; sourceTree = ""; }; - 4C93F1841F8B747A00A9330D /* SwingingShip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SwingingShip.cpp; sourceTree = ""; }; - 4C93F1851F8B747A00A9330D /* RotoDrop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RotoDrop.cpp; sourceTree = ""; }; - 4C93F1861F8B747A00A9330D /* SwingingInverterShip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SwingingInverterShip.cpp; sourceTree = ""; }; - 4C93F1871F8B747A00A9330D /* TopSpin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TopSpin.cpp; sourceTree = ""; }; - 4C93F1881F8B747A00A9330D /* Twist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Twist.cpp; sourceTree = ""; }; - 4C93F1941F8B748200A9330D /* Chairlift.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Chairlift.cpp; sourceTree = ""; }; - 4C93F1951F8B748200A9330D /* Lift.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lift.cpp; sourceTree = ""; }; - 4C93F1961F8B748200A9330D /* MiniatureRailway.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MiniatureRailway.cpp; sourceTree = ""; }; - 4C93F1971F8B748200A9330D /* Monorail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Monorail.cpp; sourceTree = ""; }; - 4C93F1981F8B748200A9330D /* SuspendedMonorail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SuspendedMonorail.cpp; sourceTree = ""; }; - 4C93F19E1F8B748900A9330D /* BoatHire.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoatHire.cpp; sourceTree = ""; }; - 4C93F19F1F8B748900A9330D /* DingySlide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DingySlide.cpp; sourceTree = ""; }; - 4C93F1A01F8B748900A9330D /* LogFlume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFlume.cpp; sourceTree = ""; }; - 4C93F1A11F8B748900A9330D /* RiverRapids.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RiverRapids.cpp; sourceTree = ""; }; - 4C93F1A21F8B748900A9330D /* SplashBoats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SplashBoats.cpp; sourceTree = ""; }; - 4C93F1A31F8B748900A9330D /* SubmarineRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubmarineRide.cpp; sourceTree = ""; }; - 4C93F1A41F8B748900A9330D /* WaterCoaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WaterCoaster.cpp; sourceTree = ""; }; - 4C93F1B01F8E185600A9330D /* Award.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Award.cpp; sourceTree = ""; }; - 4C93F1B11F8E185600A9330D /* Award.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Award.h; sourceTree = ""; }; - 4C93F1B21F8E185600A9330D /* Finance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Finance.cpp; sourceTree = ""; }; - 4C93F1B31F8E185600A9330D /* Finance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Finance.h; sourceTree = ""; }; - 4C93F1B41F8E185600A9330D /* Marketing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Marketing.cpp; sourceTree = ""; }; - 4C93F1B51F8E185600A9330D /* Marketing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Marketing.h; sourceTree = ""; }; - 4C93F1B61F8E185600A9330D /* NewsItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewsItem.cpp; sourceTree = ""; }; - 4C93F1B71F8E185600A9330D /* NewsItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewsItem.h; sourceTree = ""; }; - 4C93F1B81F8E185600A9330D /* Research.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Research.cpp; sourceTree = ""; }; - 4C93F1B91F8E185600A9330D /* Research.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Research.h; sourceTree = ""; }; - 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathSurfaceObject.cpp; sourceTree = ""; }; - 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathRailingsObject.cpp; sourceTree = ""; }; - 4C976BC3263976F0002DEBD5 /* FootpathRailingsObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathRailingsObject.h; sourceTree = ""; }; - 4C976BC4263976F0002DEBD5 /* FootpathSurfaceObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathSurfaceObject.h; sourceTree = ""; }; - 4CA23D62263C91D700077AA1 /* ChecksumStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChecksumStream.cpp; sourceTree = ""; }; - 4CA23D63263C91D700077AA1 /* ChecksumStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChecksumStream.h; sourceTree = ""; }; - 4CA23DAF263C920900077AA1 /* Entity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Entity.h; sourceTree = ""; }; - 4CA23DB0263C920900077AA1 /* EntityList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntityList.h; sourceTree = ""; }; - 4CA23DB1263C920900077AA1 /* Entity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Entity.cpp; sourceTree = ""; }; - 4CA39E4E2513F8A00094066B /* RTL.ICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTL.ICU.cpp; sourceTree = ""; }; - 4CA39E4F2513F8A00094066B /* RTL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTL.h; sourceTree = ""; }; - 4CA39E502513F8A00094066B /* RTL.FriBidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTL.FriBidi.cpp; sourceTree = ""; }; - 4CB1375521C2E9F80029FCDA /* SimulateCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulateCommands.cpp; sourceTree = ""; }; - 4CB2716824195B45000CF9EE /* VehicleSubpositionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VehicleSubpositionData.cpp; sourceTree = ""; }; - 4CB2716924195B45000CF9EE /* VehicleSubpositionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VehicleSubpositionData.h; sourceTree = ""; }; - 4CB30178249E382B0034A7F6 /* RCT2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RCT2.cpp; sourceTree = ""; }; - 4CB832AA1EFFB8D100B88761 /* ttf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttf.h; sourceTree = ""; }; - 4CB991C325CEE53A00C692B4 /* InputManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputManager.h; sourceTree = ""; }; - 4CB991C425CEE53A00C692B4 /* InputManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputManager.cpp; sourceTree = ""; }; - 4CB991C625CEE54400C692B4 /* ShortcutManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShortcutManager.cpp; sourceTree = ""; }; - 4CB991C725CEE54500C692B4 /* Shortcuts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shortcuts.cpp; sourceTree = ""; }; - 4CB991C825CEE54500C692B4 /* ShortcutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShortcutManager.h; sourceTree = ""; }; - 4CB991C925CEE54500C692B4 /* ShortcutInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShortcutInput.cpp; sourceTree = ""; }; - 4CB991CA25CEE54500C692B4 /* ShortcutIds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShortcutIds.h; sourceTree = ""; }; - 4CC4B8E21FE00C4100660D62 /* CmdlineSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CmdlineSprite.cpp; sourceTree = ""; }; - 4CC4B8E31FE00C4200660D62 /* CmdlineSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CmdlineSprite.h; sourceTree = ""; }; - 4CC4B8E51FE00C4E00660D62 /* Diagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostic.cpp; sourceTree = ""; }; - 4CC4B8E61FE00C4E00660D62 /* Diagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Diagnostic.h; sourceTree = ""; }; - 4CC4B8E81FE00C5D00660D62 /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Input.cpp; sourceTree = ""; }; - 4CC4B8E91FE00C5D00660D62 /* Input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Input.h; sourceTree = ""; }; - 4CC4B8EA1FE00C5D00660D62 /* Intro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Intro.cpp; sourceTree = ""; }; - 4CC4B8EB1FE00C5D00660D62 /* Intro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Intro.h; sourceTree = ""; }; - 4CC5258123A19C2800D4366D /* TrackDesignAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesignAction.cpp; sourceTree = ""; }; - 4CC5258323A19C2E00D4366D /* TrackDesignAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackDesignAction.h; sourceTree = ""; }; - 4CDCB0BC20A9902E00321367 /* ShopItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShopItem.cpp; sourceTree = ""; }; - 4CDCB0BD20A9902F00321367 /* ShopItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopItem.h; sourceTree = ""; }; - 4CE4623F1FD0710E0001CD98 /* Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Game.cpp; sourceTree = ""; }; - 4CE462401FD0710E0001CD98 /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Game.h; sourceTree = ""; }; - 4CE462441FD161360001CD98 /* Platform.Android.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.Android.cpp; sourceTree = ""; }; - 4CE462461FD1613D0001CD98 /* Platform.Linux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.Linux.cpp; sourceTree = ""; }; - 4CE462481FD1613D0001CD98 /* Platform.Posix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.Posix.cpp; sourceTree = ""; }; - 4CE462491FD1613D0001CD98 /* Platform.Win32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Platform.Win32.cpp; sourceTree = ""; }; - 4CF67196206B7E720034ADDD /* object */ = {isa = PBXFileReference; lastKnownFileType = folder; name = object; path = data/object; sourceTree = ""; }; - 4CFE4E7B1F90A3F1005243C2 /* Peep.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Peep.cpp; sourceTree = ""; }; - 4CFE4E7C1F90A3F1005243C2 /* Peep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Peep.h; sourceTree = ""; }; - 4CFE4E7D1F90A3F1005243C2 /* PeepData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeepData.cpp; sourceTree = ""; }; - 4CFE4E7E1F90A3F1005243C2 /* Staff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Staff.cpp; sourceTree = ""; }; - 4CFE4E7F1F90A3F1005243C2 /* Staff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Staff.h; sourceTree = ""; }; - 4CFE4E831F90AF41005243C2 /* Vehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vehicle.cpp; sourceTree = ""; }; - 4CFE4E841F90AF41005243C2 /* Vehicle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vehicle.h; sourceTree = ""; }; - 4CFE4E861F950164005243C2 /* TrackData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackData.cpp; sourceTree = ""; }; - 4CFE4E871F950164005243C2 /* TrackData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackData.h; sourceTree = ""; }; - 4CFE4E8E1F9625B0005243C2 /* Track.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Track.cpp; sourceTree = ""; }; - 4CFE4E8F1F9625B0005243C2 /* Track.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Track.h; sourceTree = ""; }; - 51160A24250C7A15002029F6 /* GuestPathfinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuestPathfinding.h; sourceTree = ""; }; - 631D7A3525F590A100EA2B45 /* openrct2.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = openrct2.icns; path = resources/mac/openrct2.icns; sourceTree = SOURCE_ROOT; }; - 6341F4DF2400AA0E0052902B /* Drawing.Sprite.RLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Drawing.Sprite.RLE.cpp; sourceTree = ""; }; - 6341F4E02400AA0F0052902B /* Drawing.Sprite.BMP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Drawing.Sprite.BMP.cpp; sourceTree = ""; }; - 666B99B025FD29C70081509F /* speex */ = {isa = PBXFileReference; lastKnownFileType = folder; path = speex; sourceTree = ""; }; - 666B99B125FD29C70081509F /* unicode */ = {isa = PBXFileReference; lastKnownFileType = folder; path = unicode; sourceTree = ""; }; - 666B99B225FD29C70081509F /* ft2build.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ft2build.h; sourceTree = ""; }; - 666B99B325FD29C70081509F /* zconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zconf.h; sourceTree = ""; }; - 666B99B425FD29C70081509F /* openssl */ = {isa = PBXFileReference; lastKnownFileType = folder; path = openssl; sourceTree = ""; }; - 666B99B525FD29C70081509F /* pnglibconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pnglibconf.h; sourceTree = ""; }; - 666B99B625FD29C70081509F /* zlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zlib.h; sourceTree = ""; }; - 666B99B725FD29C70081509F /* zip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = ""; }; - 666B99B825FD29C70081509F /* discord_rpc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = discord_rpc.h; sourceTree = ""; }; - 666B99B925FD29C70081509F /* duktape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = duktape.h; sourceTree = ""; }; - 666B99BA25FD29C70081509F /* discord_register.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = discord_register.h; sourceTree = ""; }; - 666B99BB25FD29C70081509F /* rapidjson */ = {isa = PBXFileReference; lastKnownFileType = folder; path = rapidjson; sourceTree = ""; }; - 666B99BC25FD29C80081509F /* bzlib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bzlib.h; sourceTree = ""; }; - 666B99BD25FD29C80081509F /* libpng16 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = libpng16; sourceTree = ""; }; - 666B99BE25FD29C80081509F /* duk_config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = duk_config.h; sourceTree = ""; }; - 666B99BF25FD29C80081509F /* zipconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zipconf.h; sourceTree = ""; }; - 666B99C025FD29C80081509F /* pngconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pngconf.h; sourceTree = ""; }; - 666B99C125FD29C80081509F /* freetype */ = {isa = PBXFileReference; lastKnownFileType = folder; path = freetype; sourceTree = ""; }; - 666B99C225FD29C80081509F /* png.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = png.h; sourceTree = ""; }; - 666B99C325FD29C80081509F /* SDL2 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = SDL2; sourceTree = ""; }; - 666B99C425FD29C80081509F /* brotli */ = {isa = PBXFileReference; lastKnownFileType = folder; path = brotli; sourceTree = ""; }; - 666B99C525FD29C80081509F /* nlohmann */ = {isa = PBXFileReference; lastKnownFileType = folder; path = nlohmann; sourceTree = ""; }; - 6691254025FD2C1300B038E1 /* libicuuc.67.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicuuc.67.dylib; path = libxc/lib/libicuuc.67.dylib; sourceTree = ""; }; - 6691254125FD2C1300B038E1 /* libbrotlidec.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbrotlidec.1.dylib; path = libxc/lib/libbrotlidec.1.dylib; sourceTree = ""; }; - 6691254225FD2C1300B038E1 /* libduktape.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libduktape.2.dylib; path = libxc/lib/libduktape.2.dylib; sourceTree = ""; }; - 6691254425FD2C1300B038E1 /* libicui18n.67.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicui18n.67.dylib; path = libxc/lib/libicui18n.67.dylib; sourceTree = ""; }; - 6691254525FD2C1300B038E1 /* libbz2.1.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.1.0.dylib; path = libxc/lib/libbz2.1.0.dylib; sourceTree = ""; }; - 6691254625FD2C1300B038E1 /* libbrotlicommon.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbrotlicommon.1.dylib; path = libxc/lib/libbrotlicommon.1.dylib; sourceTree = ""; }; - 6691254725FD2C1300B038E1 /* libicudata.67.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicudata.67.dylib; path = libxc/lib/libicudata.67.dylib; sourceTree = ""; }; - 6691254825FD2C1300B038E1 /* libbrotlienc.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbrotlienc.1.dylib; path = libxc/lib/libbrotlienc.1.dylib; sourceTree = ""; }; - 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libdiscord-rpc.dylib"; path = "libxc/lib/libdiscord-rpc.dylib"; sourceTree = ""; }; - 6691254A25FD2C1300B038E1 /* libicuio.67.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicuio.67.dylib; path = libxc/lib/libicuio.67.dylib; sourceTree = ""; }; - 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpng16.16.dylib; path = libxc/lib/libpng16.16.dylib; sourceTree = ""; }; - 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libspeexdsp.1.dylib; path = libxc/lib/libspeexdsp.1.dylib; sourceTree = ""; }; - 6691254E25FD2C1400B038E1 /* libssl.1.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.1.1.dylib; path = libxc/lib/libssl.1.1.dylib; sourceTree = ""; }; - 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfreetype.6.dylib; path = libxc/lib/libfreetype.6.dylib; sourceTree = ""; }; - 6691255025FD2C1400B038E1 /* libz.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.dylib; path = libxc/lib/libz.1.dylib; sourceTree = ""; }; - 6691255125FD2C1400B038E1 /* libicutu.67.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicutu.67.dylib; path = libxc/lib/libicutu.67.dylib; sourceTree = ""; }; - 6691255225FD2C1400B038E1 /* libzip.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.dylib; path = libxc/lib/libzip.5.dylib; sourceTree = ""; }; - 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.1.1.dylib; path = libxc/lib/libcrypto.1.1.dylib; sourceTree = ""; }; - 669125A625FD2CBF00B038E1 /* libSDL2-2.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL2-2.0.dylib"; path = "libxc/lib/libSDL2-2.0.dylib"; sourceTree = ""; }; - 66A10EA0257F1DE000DD651A /* BalloonPressAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BalloonPressAction.cpp; sourceTree = ""; }; - 66A10EA1257F1DE000DD651A /* BalloonPressAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BalloonPressAction.h; sourceTree = ""; }; - 66A10EA6257F1DF600DD651A /* BannerPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BannerPlaceAction.cpp; sourceTree = ""; }; - 66A10EA7257F1DF600DD651A /* FootpathAdditionRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathAdditionRemoveAction.h; sourceTree = ""; }; - 66A10EA8257F1DF600DD651A /* FootpathRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathRemoveAction.h; sourceTree = ""; }; - 66A10EA9257F1DF600DD651A /* FootpathPlaceFromTrackAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathPlaceFromTrackAction.cpp; sourceTree = ""; }; - 66A10EAA257F1DF600DD651A /* FootpathAdditionPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathAdditionPlaceAction.cpp; sourceTree = ""; }; - 66A10EAB257F1DF600DD651A /* BannerSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BannerSetNameAction.cpp; sourceTree = ""; }; - 66A10EAC257F1DF600DD651A /* FootpathPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathPlaceAction.h; sourceTree = ""; }; - 66A10EAD257F1DF700DD651A /* FootpathRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathRemoveAction.cpp; sourceTree = ""; }; - 66A10EAE257F1DF700DD651A /* BannerPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BannerPlaceAction.h; sourceTree = ""; }; - 66A10EAF257F1DF700DD651A /* CustomAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomAction.h; sourceTree = ""; }; - 66A10EB0257F1DF700DD651A /* ClimateSetAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClimateSetAction.h; sourceTree = ""; }; - 66A10EB1257F1DF700DD651A /* BannerSetStyleAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BannerSetStyleAction.cpp; sourceTree = ""; }; - 66A10EB2257F1DF700DD651A /* ClearAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClearAction.cpp; sourceTree = ""; }; - 66A10EB3257F1DF700DD651A /* BannerRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BannerRemoveAction.cpp; sourceTree = ""; }; - 66A10EB4257F1DF700DD651A /* BannerSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BannerSetNameAction.h; sourceTree = ""; }; - 66A10EB5257F1DF700DD651A /* ClimateSetAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClimateSetAction.cpp; sourceTree = ""; }; - 66A10EB6257F1DF700DD651A /* BannerSetColourAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BannerSetColourAction.h; sourceTree = ""; }; - 66A10EB7257F1DF700DD651A /* CustomAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomAction.cpp; sourceTree = ""; }; - 66A10EB8257F1DF700DD651A /* FootpathAdditionRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathAdditionRemoveAction.cpp; sourceTree = ""; }; - 66A10EB9257F1DF700DD651A /* BannerRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BannerRemoveAction.h; sourceTree = ""; }; - 66A10EBA257F1DF700DD651A /* ClearAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClearAction.h; sourceTree = ""; }; - 66A10EBB257F1DF700DD651A /* BannerSetStyleAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BannerSetStyleAction.h; sourceTree = ""; }; - 66A10EBC257F1DF800DD651A /* FootpathPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathPlaceAction.cpp; sourceTree = ""; }; - 66A10EBD257F1DF800DD651A /* FootpathPlaceFromTrackAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathPlaceFromTrackAction.h; sourceTree = ""; }; - 66A10EBE257F1DF800DD651A /* BannerSetColourAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BannerSetColourAction.cpp; sourceTree = ""; }; - 66A10EBF257F1DF800DD651A /* FootpathAdditionPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootpathAdditionPlaceAction.h; sourceTree = ""; }; - 66A10EDC257F1E1000DD651A /* PlaceParkEntranceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceParkEntranceAction.h; sourceTree = ""; }; - 66A10EDD257F1E1000DD651A /* StaffSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffSetNameAction.h; sourceTree = ""; }; - 66A10EDE257F1E1000DD651A /* PauseToggleAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PauseToggleAction.h; sourceTree = ""; }; - 66A10EDF257F1E1000DD651A /* ParkSetDateAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkSetDateAction.h; sourceTree = ""; }; - 66A10EE0257F1E1000DD651A /* ParkEntranceRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkEntranceRemoveAction.h; sourceTree = ""; }; - 66A10EE1257F1E1100DD651A /* RideDemolishAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideDemolishAction.h; sourceTree = ""; }; - 66A10EE2257F1E1100DD651A /* StaffSetCostumeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffSetCostumeAction.cpp; sourceTree = ""; }; - 66A10EE3257F1E1100DD651A /* LandLowerAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandLowerAction.h; sourceTree = ""; }; - 66A10EE4257F1E1100DD651A /* RideSetAppearanceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetAppearanceAction.h; sourceTree = ""; }; - 66A10EE5257F1E1100DD651A /* SurfaceSetStyleAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurfaceSetStyleAction.cpp; sourceTree = ""; }; - 66A10EE6257F1E1100DD651A /* SmallSceneryRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallSceneryRemoveAction.h; sourceTree = ""; }; - 66A10EE7257F1E1100DD651A /* RideSetAppearanceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetAppearanceAction.cpp; sourceTree = ""; }; - 66A10EE8257F1E1100DD651A /* StaffSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffSetNameAction.cpp; sourceTree = ""; }; - 66A10EE9257F1E1100DD651A /* SetCheatAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SetCheatAction.cpp; sourceTree = ""; }; - 66A10EEA257F1E1100DD651A /* GuestSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuestSetNameAction.h; sourceTree = ""; }; - 66A10EEB257F1E1100DD651A /* GuestSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GuestSetNameAction.cpp; sourceTree = ""; }; - 66A10EEC257F1E1100DD651A /* SetParkEntranceFeeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetParkEntranceFeeAction.h; sourceTree = ""; }; - 66A10EED257F1E1100DD651A /* RideSetStatusAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetStatusAction.h; sourceTree = ""; }; - 66A10EEE257F1E1100DD651A /* LargeSceneryRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeSceneryRemoveAction.h; sourceTree = ""; }; - 66A10EEF257F1E1200DD651A /* SmallScenerySetColourAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallScenerySetColourAction.h; sourceTree = ""; }; - 66A10EF0257F1E1200DD651A /* ParkEntranceRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkEntranceRemoveAction.cpp; sourceTree = ""; }; - 66A10EF1257F1E1200DD651A /* PlaceParkEntranceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlaceParkEntranceAction.cpp; sourceTree = ""; }; - 66A10EF2257F1E1200DD651A /* SurfaceSetStyleAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceSetStyleAction.h; sourceTree = ""; }; - 66A10EF3257F1E1200DD651A /* PlayerKickAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerKickAction.h; sourceTree = ""; }; - 66A10EF4257F1E1200DD651A /* LandRaiseAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandRaiseAction.cpp; sourceTree = ""; }; - 66A10EF5257F1E1200DD651A /* TileModifyAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TileModifyAction.h; sourceTree = ""; }; - 66A10EF6257F1E1200DD651A /* RideSetVehicleAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetVehicleAction.cpp; sourceTree = ""; }; - 66A10EF7257F1E1200DD651A /* RideEntranceExitPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideEntranceExitPlaceAction.h; sourceTree = ""; }; - 66A10EF8257F1E1200DD651A /* NetworkModifyGroupAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkModifyGroupAction.h; sourceTree = ""; }; - 66A10EF9257F1E1200DD651A /* ParkSetLoanAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkSetLoanAction.h; sourceTree = ""; }; - 66A10EFA257F1E1200DD651A /* LargeScenerySetColourAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LargeScenerySetColourAction.cpp; sourceTree = ""; }; - 66A10EFB257F1E1200DD651A /* ParkSetLoanAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkSetLoanAction.cpp; sourceTree = ""; }; - 66A10EFC257F1E1200DD651A /* LoadOrQuitAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadOrQuitAction.cpp; sourceTree = ""; }; - 66A10EFD257F1E1200DD651A /* ParkSetParameterAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkSetParameterAction.cpp; sourceTree = ""; }; - 66A10EFE257F1E1200DD651A /* LandRaiseAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandRaiseAction.h; sourceTree = ""; }; - 66A10EFF257F1E1200DD651A /* RideEntranceExitPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideEntranceExitPlaceAction.cpp; sourceTree = ""; }; - 66A10F00257F1E1300DD651A /* ParkSetDateAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkSetDateAction.cpp; sourceTree = ""; }; - 66A10F01257F1E1300DD651A /* StaffSetColourAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffSetColourAction.cpp; sourceTree = ""; }; - 66A10F02257F1E1300DD651A /* PlacePeepSpawnAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlacePeepSpawnAction.h; sourceTree = ""; }; - 66A10F03257F1E1300DD651A /* LandSetHeightAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandSetHeightAction.h; sourceTree = ""; }; - 66A10F04257F1E1300DD651A /* RideEntranceExitRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideEntranceExitRemoveAction.h; sourceTree = ""; }; - 66A10F05257F1E1300DD651A /* RideSetPriceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetPriceAction.cpp; sourceTree = ""; }; - 66A10F06257F1E1300DD651A /* SmallSceneryRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmallSceneryRemoveAction.cpp; sourceTree = ""; }; - 66A10F07257F1E1300DD651A /* StaffSetOrdersAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffSetOrdersAction.h; sourceTree = ""; }; - 66A10F08257F1E1300DD651A /* StaffSetColourAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffSetColourAction.h; sourceTree = ""; }; - 66A10F09257F1E1300DD651A /* RideCreateAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideCreateAction.cpp; sourceTree = ""; }; - 66A10F0A257F1E1300DD651A /* RideSetSettingAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetSettingAction.cpp; sourceTree = ""; }; - 66A10F0B257F1E1300DD651A /* MazeSetTrackAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MazeSetTrackAction.h; sourceTree = ""; }; - 66A10F0C257F1E1300DD651A /* StaffHireNewAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffHireNewAction.cpp; sourceTree = ""; }; - 66A10F0D257F1E1300DD651A /* ParkSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkSetNameAction.cpp; sourceTree = ""; }; - 66A10F0E257F1E1300DD651A /* RideSetColourSchemeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetColourSchemeAction.cpp; sourceTree = ""; }; - 66A10F0F257F1E1300DD651A /* MazePlaceTrackAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MazePlaceTrackAction.cpp; sourceTree = ""; }; - 66A10F10257F1E1400DD651A /* NetworkModifyGroupAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkModifyGroupAction.cpp; sourceTree = ""; }; - 66A10F11257F1E1400DD651A /* RideSetVehicleAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetVehicleAction.h; sourceTree = ""; }; - 66A10F12257F1E1400DD651A /* PlayerSetGroupAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayerSetGroupAction.cpp; sourceTree = ""; }; - 66A10F13257F1E1400DD651A /* PlayerSetGroupAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerSetGroupAction.h; sourceTree = ""; }; - 66A10F14257F1E1400DD651A /* StaffSetPatrolAreaAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffSetPatrolAreaAction.h; sourceTree = ""; }; - 66A10F15257F1E1400DD651A /* LandSetHeightAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandSetHeightAction.cpp; sourceTree = ""; }; - 66A10F16257F1E1400DD651A /* LoadOrQuitAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadOrQuitAction.h; sourceTree = ""; }; - 66A10F17257F1E1400DD651A /* SmallSceneryPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallSceneryPlaceAction.h; sourceTree = ""; }; - 66A10F18257F1E1400DD651A /* SignSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignSetNameAction.h; sourceTree = ""; }; - 66A10F19257F1E1400DD651A /* PauseToggleAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PauseToggleAction.cpp; sourceTree = ""; }; - 66A10F1A257F1E1400DD651A /* ParkSetResearchFundingAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkSetResearchFundingAction.h; sourceTree = ""; }; - 66A10F1B257F1E1400DD651A /* LandSmoothAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandSmoothAction.h; sourceTree = ""; }; - 66A10F1C257F1E1400DD651A /* RideCreateAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideCreateAction.h; sourceTree = ""; }; - 66A10F1D257F1E1400DD651A /* GuestSetFlagsAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuestSetFlagsAction.h; sourceTree = ""; }; - 66A10F1E257F1E1400DD651A /* LandSetRightsAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandSetRightsAction.h; sourceTree = ""; }; - 66A10F1F257F1E1500DD651A /* StaffSetCostumeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffSetCostumeAction.h; sourceTree = ""; }; - 66A10F20257F1E1500DD651A /* MazePlaceTrackAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MazePlaceTrackAction.h; sourceTree = ""; }; - 66A10F21257F1E1500DD651A /* StaffHireNewAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffHireNewAction.h; sourceTree = ""; }; - 66A10F22257F1E1500DD651A /* ParkSetParameterAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkSetParameterAction.h; sourceTree = ""; }; - 66A10F23257F1E1500DD651A /* LandSmoothAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandSmoothAction.cpp; sourceTree = ""; }; - 66A10F24257F1E1500DD651A /* StaffSetOrdersAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffSetOrdersAction.cpp; sourceTree = ""; }; - 66A10F25257F1E1500DD651A /* GuestSetFlagsAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GuestSetFlagsAction.cpp; sourceTree = ""; }; - 66A10F26257F1E1500DD651A /* SignSetStyleAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignSetStyleAction.h; sourceTree = ""; }; - 66A10F27257F1E1500DD651A /* SetCheatAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetCheatAction.h; sourceTree = ""; }; - 66A10F28257F1E1500DD651A /* PlacePeepSpawnAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlacePeepSpawnAction.cpp; sourceTree = ""; }; - 66A10F29257F1E1500DD651A /* LargeScenerySetColourAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeScenerySetColourAction.h; sourceTree = ""; }; - 66A10F2A257F1E1500DD651A /* StaffFireAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaffFireAction.h; sourceTree = ""; }; - 66A10F2B257F1E1500DD651A /* ParkSetResearchFundingAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkSetResearchFundingAction.cpp; sourceTree = ""; }; - 66A10F2C257F1E1500DD651A /* PeepPickupAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeepPickupAction.cpp; sourceTree = ""; }; - 66A10F2D257F1E1500DD651A /* StaffFireAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffFireAction.cpp; sourceTree = ""; }; - 66A10F2E257F1E1600DD651A /* ParkMarketingAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParkMarketingAction.cpp; sourceTree = ""; }; - 66A10F2F257F1E1600DD651A /* LandBuyRightsAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandBuyRightsAction.h; sourceTree = ""; }; - 66A10F30257F1E1600DD651A /* StaffSetPatrolAreaAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffSetPatrolAreaAction.cpp; sourceTree = ""; }; - 66A10F31257F1E1600DD651A /* SmallScenerySetColourAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmallScenerySetColourAction.cpp; sourceTree = ""; }; - 66A10F32257F1E1600DD651A /* LargeSceneryPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeSceneryPlaceAction.h; sourceTree = ""; }; - 66A10F33257F1E1600DD651A /* LandLowerAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandLowerAction.cpp; sourceTree = ""; }; - 66A10F34257F1E1600DD651A /* RideSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetNameAction.cpp; sourceTree = ""; }; - 66A10F35257F1E1600DD651A /* RideSetPriceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetPriceAction.h; sourceTree = ""; }; - 66A10F36257F1E1600DD651A /* ParkMarketingAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkMarketingAction.h; sourceTree = ""; }; - 66A10F37257F1E1600DD651A /* PeepPickupAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeepPickupAction.h; sourceTree = ""; }; - 66A10F38257F1E1600DD651A /* RideEntranceExitRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideEntranceExitRemoveAction.cpp; sourceTree = ""; }; - 66A10F39257F1E1600DD651A /* ParkSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParkSetNameAction.h; sourceTree = ""; }; - 66A10F3A257F1E1600DD651A /* SetParkEntranceFeeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SetParkEntranceFeeAction.cpp; sourceTree = ""; }; - 66A10F3B257F1E1600DD651A /* LandSetRightsAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandSetRightsAction.cpp; sourceTree = ""; }; - 66A10F3C257F1E1600DD651A /* RideSetSettingAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetSettingAction.h; sourceTree = ""; }; - 66A10F3D257F1E1700DD651A /* TileModifyAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileModifyAction.cpp; sourceTree = ""; }; - 66A10F3E257F1E1700DD651A /* SmallSceneryPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmallSceneryPlaceAction.cpp; sourceTree = ""; }; - 66A10F3F257F1E1700DD651A /* RideSetNameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetNameAction.h; sourceTree = ""; }; - 66A10F40257F1E1700DD651A /* SignSetStyleAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SignSetStyleAction.cpp; sourceTree = ""; }; - 66A10F41257F1E1700DD651A /* RideDemolishAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideDemolishAction.cpp; sourceTree = ""; }; - 66A10F42257F1E1700DD651A /* LargeSceneryRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LargeSceneryRemoveAction.cpp; sourceTree = ""; }; - 66A10F43257F1E1700DD651A /* MazeSetTrackAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MazeSetTrackAction.cpp; sourceTree = ""; }; - 66A10F44257F1E1700DD651A /* ScenarioSetSettingAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScenarioSetSettingAction.cpp; sourceTree = ""; }; - 66A10F45257F1E1700DD651A /* SignSetNameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SignSetNameAction.cpp; sourceTree = ""; }; - 66A10F46257F1E1700DD651A /* RideSetColourSchemeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideSetColourSchemeAction.h; sourceTree = ""; }; - 66A10F47257F1E1700DD651A /* LandBuyRightsAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandBuyRightsAction.cpp; sourceTree = ""; }; - 66A10F48257F1E1700DD651A /* ScenarioSetSettingAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScenarioSetSettingAction.h; sourceTree = ""; }; - 66A10F49257F1E1700DD651A /* RideSetStatusAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideSetStatusAction.cpp; sourceTree = ""; }; - 66A10F4A257F1E1700DD651A /* PlayerKickAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayerKickAction.cpp; sourceTree = ""; }; - 66A10F4B257F1E1700DD651A /* LargeSceneryPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LargeSceneryPlaceAction.cpp; sourceTree = ""; }; - 66A10FBE257F1E2D00DD651A /* TrackPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPlaceAction.h; sourceTree = ""; }; - 66A10FBF257F1E2D00DD651A /* WaterRaiseAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WaterRaiseAction.cpp; sourceTree = ""; }; - 66A10FC0257F1E2D00DD651A /* WallPlaceAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WallPlaceAction.h; sourceTree = ""; }; - 66A10FC1257F1E2D00DD651A /* TrackRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackRemoveAction.h; sourceTree = ""; }; - 66A10FC2257F1E2E00DD651A /* TrackSetBrakeSpeedAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackSetBrakeSpeedAction.cpp; sourceTree = ""; }; - 66A10FC3257F1E2E00DD651A /* WaterRaiseAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaterRaiseAction.h; sourceTree = ""; }; - 66A10FC4257F1E2E00DD651A /* WallRemoveAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WallRemoveAction.h; sourceTree = ""; }; - 66A10FC5257F1E2E00DD651A /* WaterLowerAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaterLowerAction.h; sourceTree = ""; }; - 66A10FC6257F1E2E00DD651A /* TrackRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackRemoveAction.cpp; sourceTree = ""; }; - 66A10FC7257F1E2E00DD651A /* WaterSetHeightAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WaterSetHeightAction.cpp; sourceTree = ""; }; - 66A10FC8257F1E2F00DD651A /* WaterSetHeightAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaterSetHeightAction.h; sourceTree = ""; }; - 66A10FC9257F1E2F00DD651A /* WallPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WallPlaceAction.cpp; sourceTree = ""; }; - 66A10FCA257F1E2F00DD651A /* TrackPlaceAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackPlaceAction.cpp; sourceTree = ""; }; - 66A10FCB257F1E2F00DD651A /* WallSetColourAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WallSetColourAction.h; sourceTree = ""; }; - 66A10FCC257F1E2F00DD651A /* WaterLowerAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WaterLowerAction.cpp; sourceTree = ""; }; - 66A10FCD257F1E2F00DD651A /* TrackSetBrakeSpeedAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackSetBrakeSpeedAction.h; sourceTree = ""; }; - 66A10FCE257F1E2F00DD651A /* WallRemoveAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WallRemoveAction.cpp; sourceTree = ""; }; - 66A10FCF257F1E3000DD651A /* WallSetColourAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WallSetColourAction.cpp; sourceTree = ""; }; - 9308D9FA209908080079EE96 /* TileElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileElement.cpp; sourceTree = ""; }; - 9308D9FB209908080079EE96 /* Surface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Surface.cpp; sourceTree = ""; }; - 9308D9FC209908080079EE96 /* TileElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TileElement.h; sourceTree = ""; }; - 9308D9FD209908090079EE96 /* Surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Surface.h; sourceTree = ""; }; - 930EEA6924FC00940070314E /* ScenarioSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScenarioSelect.cpp; sourceTree = ""; }; - 9329D51F240C17C60054301C /* BenchUpdate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BenchUpdate.cpp; sourceTree = ""; }; - 932A20CF22D73CEE00C57EDB /* GameActionCompat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameActionCompat.cpp; sourceTree = ""; }; - 932A20D322D73CEF00C57EDB /* GameActionRegistration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameActionRegistration.cpp; sourceTree = ""; }; - 932A20F522D73CF300C57EDB /* GameAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameAction.h; sourceTree = ""; }; - 932A211C22D73CFA00C57EDB /* GameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameAction.cpp; sourceTree = ""; }; - 93378D00252B4F550077D2D8 /* JsonFwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JsonFwd.hpp; sourceTree = ""; }; - 933C55B424B858490057E64B /* SeaDecrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SeaDecrypt.cpp; sourceTree = ""; }; - 933CBDB120CB1ACC00134678 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = ""; }; - 933CBDB220CB1ACD00134678 /* Theme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Theme.cpp; sourceTree = ""; }; - 933CBDB320CB1ACD00134678 /* Theme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Theme.h; sourceTree = ""; }; - 933CBDB920CB1B3F00134678 /* TitleSequencePlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleSequencePlayer.cpp; sourceTree = ""; }; - 933CBDBA20CB1B3F00134678 /* TitleSequencePlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TitleSequencePlayer.h; sourceTree = ""; }; - 933CBDBC20CB1BA900134678 /* ViewportInteraction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportInteraction.cpp; sourceTree = ""; }; - 933CBDBE20CB1BCA00134678 /* Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Window.cpp; sourceTree = ""; }; - 933F2CB620935653001B33FD /* LocalisationService.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalisationService.cpp; sourceTree = ""; }; - 933F2CBA20935668001B33FD /* LocalisationService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalisationService.h; sourceTree = ""; }; - 9344BEF720C1E6180047D165 /* Crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crypt.h; sourceTree = ""; }; - 9344BEF820C1E6180047D165 /* Crypt.OpenSSL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Crypt.OpenSSL.cpp; sourceTree = ""; }; - 9346F9D6208A191900C77D91 /* Guest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Guest.cpp; sourceTree = ""; }; - 9346F9D7208A191900C77D91 /* GuestPathfinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GuestPathfinding.cpp; sourceTree = ""; }; - 936F412424CE030E00E07BCF /* NetworkClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkClient.h; sourceTree = ""; }; - 936F412524CE030F00E07BCF /* NetworkBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkBase.cpp; sourceTree = ""; }; - 936F412624CE030F00E07BCF /* NetworkClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkClient.cpp; sourceTree = ""; }; - 936F412724CE030F00E07BCF /* NetworkBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkBase.h; sourceTree = ""; }; - 9391535A22D74359008E0780 /* OpenRCT2.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OpenRCT2.entitlements; sourceTree = ""; }; - 939A359720C12FC700630B3F /* Paint.Litter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Litter.cpp; sourceTree = ""; }; - 939A359820C12FC700630B3F /* Paint.Misc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Misc.cpp; sourceTree = ""; }; - 939A359920C12FC700630B3F /* Paint.Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Paint.Sprite.h; sourceTree = ""; }; - 939A359D20C12FDD00630B3F /* Paint.Surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Paint.Surface.h; sourceTree = ""; }; - 939A359E20C12FDE00630B3F /* Paint.TileElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Paint.TileElement.h; sourceTree = ""; }; - 939A35A120C12FFD00630B3F /* InteractiveConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InteractiveConsole.h; sourceTree = ""; }; - 93AE2387252F948A00CD03C3 /* Formatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Formatter.h; sourceTree = ""; }; - 93AE2388252F948A00CD03C3 /* Formatter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Formatter.cpp; sourceTree = ""; }; - 93B4DC1325487CDE008D63FF /* Formatting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Formatting.cpp; sourceTree = ""; }; - 93B4DC1425487CDE008D63FF /* Formatting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Formatting.h; sourceTree = ""; }; - 93CBA4BE20A74FF200867D56 /* BitmapReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapReader.h; sourceTree = ""; }; - 93CBA4BF20A74FF200867D56 /* BitmapReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapReader.cpp; sourceTree = ""; }; - 93CBA4C120A7502D00867D56 /* Imaging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Imaging.h; sourceTree = ""; }; - 93CBA4C220A7502E00867D56 /* Imaging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Imaging.cpp; sourceTree = ""; }; - 93CBA4C720A7504400867D56 /* ImageImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageImporter.cpp; sourceTree = ""; }; - 93CBA4C820A7504500867D56 /* ImageImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageImporter.h; sourceTree = ""; }; - 93DE974E209C3C0F00FB1CC8 /* GameState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameState.cpp; sourceTree = ""; }; - 93DE974F209C3C0F00FB1CC8 /* GameState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameState.h; sourceTree = ""; }; - 93DFD02C24521B9F001FCBAF /* FileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileWatcher.h; sourceTree = ""; }; - 93DFD02D24521BA0001FCBAF /* FileWatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileWatcher.cpp; sourceTree = ""; }; - 93DFD03124521C19001FCBAF /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = ""; }; - 93DFD03324521C19001FCBAF /* HookEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HookEngine.h; sourceTree = ""; }; - 93DFD03524521C19001FCBAF /* HookEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HookEngine.cpp; sourceTree = ""; }; - 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptEngine.cpp; sourceTree = ""; }; - 93DFD03B24521C19001FCBAF /* Duktape.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Duktape.hpp; sourceTree = ""; }; - 93DFD03F24521C19001FCBAF /* Plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Plugin.cpp; sourceTree = ""; }; - 93DFD04324521C19001FCBAF /* ScriptEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptEngine.h; sourceTree = ""; }; - 93F60048213DD7DC00EEB83E /* TerrainSurfaceObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TerrainSurfaceObject.h; sourceTree = ""; }; - 93F60049213DD7DC00EEB83E /* TerrainSurfaceObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TerrainSurfaceObject.cpp; sourceTree = ""; }; - 93F6004A213DD7DC00EEB83E /* TerrainEdgeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TerrainEdgeObject.cpp; sourceTree = ""; }; - 93F6004B213DD7DD00EEB83E /* TerrainEdgeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TerrainEdgeObject.h; sourceTree = ""; }; - 93F6004E213DD7E300EEB83E /* StationObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StationObject.h; sourceTree = ""; }; - 93F6004F213DD7E300EEB83E /* StationObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StationObject.cpp; sourceTree = ""; }; - 93F76EEB20BFF6F900D4512C /* Drawing.Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Drawing.Sprite.cpp; sourceTree = ""; }; - 93F76EEC20BFF6F900D4512C /* Drawing.String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Drawing.String.cpp; sourceTree = ""; }; - 93F76EEF20BFF71700D4512C /* InteractiveConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InteractiveConsole.cpp; sourceTree = ""; }; - 93F76EF120BFF74200D4512C /* Localisation.Date.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Localisation.Date.cpp; sourceTree = ""; }; - 93F76EF320BFF76D00D4512C /* Paint.Peep.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Peep.cpp; sourceTree = ""; }; - 93F76EF420BFF76D00D4512C /* Paint.Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Sprite.cpp; sourceTree = ""; }; - 93F76EF720BFF77900D4512C /* Paint.Wall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Wall.cpp; sourceTree = ""; }; - 93F76EF820BFF77900D4512C /* Paint.Path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Path.cpp; sourceTree = ""; }; - 93F76EF920BFF77900D4512C /* Paint.LargeScenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.LargeScenery.cpp; sourceTree = ""; }; - 93F76EFA20BFF77900D4512C /* Paint.Surface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Surface.cpp; sourceTree = ""; }; - 93F76EFB20BFF77A00D4512C /* Paint.SmallScenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.SmallScenery.cpp; sourceTree = ""; }; - 93F76EFC20BFF77A00D4512C /* Paint.Banner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Banner.cpp; sourceTree = ""; }; - 93F76EFD20BFF77A00D4512C /* Paint.TileElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.TileElement.cpp; sourceTree = ""; }; - 93F76EFE20BFF77A00D4512C /* Paint.Entrance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paint.Entrance.cpp; sourceTree = ""; }; - 93FB272024ED3601008241C9 /* Cursors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cursors.cpp; sourceTree = ""; }; - C61ADB1E1FB6A0A60024F2EF /* TopToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TopToolbar.cpp; sourceTree = ""; }; - C61ADB201FB7DC060024F2EF /* Scenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scenery.cpp; sourceTree = ""; }; - C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameBottomToolbar.cpp; sourceTree = ""; }; - C61FB2701FA3E25C0095FB9D /* ObjectLoadError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectLoadError.cpp; sourceTree = ""; }; - C61FB2711FA3E25C0095FB9D /* TextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInput.cpp; sourceTree = ""; }; - C62D83861FCC7D19008C04F1 /* EditorObjectSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorObjectSelection.cpp; sourceTree = ""; }; - C62D83881FD36D6E008C04F1 /* EditorObjectSelectionSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorObjectSelectionSession.cpp; sourceTree = ""; }; - C62D83891FD36D6F008C04F1 /* EditorObjectSelectionSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditorObjectSelectionSession.h; sourceTree = ""; }; - C632C81E1F8A445700781F6D /* RideList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RideList.cpp; sourceTree = ""; }; - C6352B811F477022006CCEE3 /* DataSerialiser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSerialiser.h; sourceTree = ""; }; - C6352B821F477022006CCEE3 /* DataSerialiserTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSerialiserTraits.h; sourceTree = ""; }; - C6352B831F477022006CCEE3 /* Endianness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Endianness.h; sourceTree = ""; }; - C64644EE1F3FA4120026AC2D /* ClearScenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClearScenery.cpp; sourceTree = ""; }; - C64644EF1F3FA4120026AC2D /* EditorInventionsList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorInventionsList.cpp; sourceTree = ""; }; - C64644F01F3FA4120026AC2D /* EditorObjectiveOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorObjectiveOptions.cpp; sourceTree = ""; }; - C64644F11F3FA4120026AC2D /* EditorScenarioOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorScenarioOptions.cpp; sourceTree = ""; }; - C64644F21F3FA4120026AC2D /* Footpath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Footpath.cpp; sourceTree = ""; }; - C64644F31F3FA4120026AC2D /* Land.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Land.cpp; sourceTree = ""; }; - C64644F41F3FA4120026AC2D /* Main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Main.cpp; sourceTree = ""; }; - C64644F51F3FA4120026AC2D /* StaffList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffList.cpp; sourceTree = ""; }; - C64644F61F3FA4120026AC2D /* ViewClipping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewClipping.cpp; sourceTree = ""; }; - C64644F71F3FA4120026AC2D /* Water.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Water.cpp; sourceTree = ""; }; - C651A8D71F30204300443BCA /* Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Text.cpp; sourceTree = ""; }; - C651A8D81F30204300443BCA /* Text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Text.h; sourceTree = ""; }; - C654DF1C1F69C0430040F43D /* Banner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Banner.cpp; sourceTree = ""; }; - C654DF1D1F69C0430040F43D /* DemolishRidePrompt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DemolishRidePrompt.cpp; sourceTree = ""; }; - C654DF1E1F69C0430040F43D /* Error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Error.cpp; sourceTree = ""; }; - C654DF1F1F69C0430040F43D /* Finances.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Finances.cpp; sourceTree = ""; }; - C654DF201F69C0430040F43D /* GuestList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GuestList.cpp; sourceTree = ""; }; - C654DF211F69C0430040F43D /* InstallTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InstallTrack.cpp; sourceTree = ""; }; - C654DF221F69C0430040F43D /* LoadSave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadSave.cpp; sourceTree = ""; }; - C654DF231F69C0430040F43D /* NewCampaign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewCampaign.cpp; sourceTree = ""; }; - C654DF241F69C0430040F43D /* Park.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Park.cpp; sourceTree = ""; }; - C654DF251F69C0430040F43D /* Player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Player.cpp; sourceTree = ""; }; - C654DF261F69C0430040F43D /* Sign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Sign.cpp; sourceTree = ""; }; - C654DF271F69C0430040F43D /* StaffFirePrompt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaffFirePrompt.cpp; sourceTree = ""; }; - C654DF281F69C0430040F43D /* TitleCommandEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleCommandEditor.cpp; sourceTree = ""; }; - C654DF291F69C0430040F43D /* TitleEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleEditor.cpp; sourceTree = ""; }; - C654DF2B1F69C0430040F43D /* TrackDesignManage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesignManage.cpp; sourceTree = ""; }; - C654DF2C1F69C0430040F43D /* TrackDesignPlace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesignPlace.cpp; sourceTree = ""; }; - C654DF3E1F69C18C0040F43D /* Intent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Intent.cpp; sourceTree = ""; }; - C654DF3F1F69C18C0040F43D /* Intent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Intent.h; sourceTree = ""; }; - C666ED751F33DBB20061AA04 /* ShortcutKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShortcutKeys.cpp; sourceTree = ""; }; - C666EE551F37ACB10061AA04 /* About.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = About.cpp; sourceTree = ""; }; - C666EE561F37ACB10061AA04 /* Changelog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Changelog.cpp; sourceTree = ""; }; - C666EE571F37ACB10061AA04 /* Cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cheats.cpp; sourceTree = ""; }; - C666EE581F37ACB10061AA04 /* CustomCurrency.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomCurrency.cpp; sourceTree = ""; }; - C666EE591F37ACB10061AA04 /* DebugPaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebugPaint.cpp; sourceTree = ""; }; - C666EE5A1F37ACB10061AA04 /* LandRights.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandRights.cpp; sourceTree = ""; }; - C666EE5B1F37ACB10061AA04 /* MapGen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapGen.cpp; sourceTree = ""; }; - C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Multiplayer.cpp; sourceTree = ""; }; - C666EE5E1F37ACB10061AA04 /* News.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = News.cpp; sourceTree = ""; }; - C666EE5F1F37ACB10061AA04 /* NewsOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewsOptions.cpp; sourceTree = ""; }; - C666EE601F37ACB10061AA04 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = ""; }; - C666EE611F37ACB10061AA04 /* SavePrompt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SavePrompt.cpp; sourceTree = ""; }; - C666EE621F37ACB10061AA04 /* ServerList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerList.cpp; sourceTree = ""; }; - C666EE631F37ACB10061AA04 /* ServerStart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerStart.cpp; sourceTree = ""; }; - C666EE641F37ACB10061AA04 /* Themes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Themes.cpp; sourceTree = ""; }; - C666EE651F37ACB10061AA04 /* TitleExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleExit.cpp; sourceTree = ""; }; - C666EE661F37ACB10061AA04 /* TitleLogo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleLogo.cpp; sourceTree = ""; }; - C666EE671F37ACB10061AA04 /* TitleMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleMenu.cpp; sourceTree = ""; }; - C666EE681F37ACB10061AA04 /* TitleOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TitleOptions.cpp; sourceTree = ""; }; - C666EE691F37ACB10061AA04 /* Viewport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Viewport.cpp; sourceTree = ""; }; - C666EE6A1F37ACB10061AA04 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = ""; }; - C67B28122002D67900109C93 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = ""; }; - C67B28132002D67900109C93 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = ""; }; - C67B28142002D67900109C93 /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = ""; }; - C67B28182002D7F200109C93 /* Window_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window_internal.h; sourceTree = ""; }; - C67CCD651FBBCFDB004FAE4C /* EditorBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorBottomToolbar.cpp; sourceTree = ""; }; - C67CCD671FBBD137004FAE4C /* EditorMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorMain.cpp; sourceTree = ""; }; - C68313C51FDB4EBA006DB3D8 /* input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input.cpp; sourceTree = ""; }; - C68313C71FDB4ED4006DB3D8 /* MouseInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseInput.cpp; sourceTree = ""; }; - C68313C91FDB4EEC006DB3D8 /* Tooltip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tooltip.cpp; sourceTree = ""; }; - C68313CA1FDB4EEC006DB3D8 /* Dropdown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Dropdown.cpp; sourceTree = ""; }; - C68313D01FDB4F4C006DB3D8 /* Dropdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dropdown.h; sourceTree = ""; }; - C68313D11FDB4F4C006DB3D8 /* Graph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Graph.cpp; sourceTree = ""; }; - C68313D21FDB4F4C006DB3D8 /* Graph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Graph.h; sourceTree = ""; }; - C68313D31FDB4F4C006DB3D8 /* LandTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LandTool.cpp; sourceTree = ""; }; - C68313D41FDB4F4C006DB3D8 /* LandTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandTool.h; sourceTree = ""; }; - C685E5141F8907840090598F /* NewRide.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NewRide.cpp; sourceTree = ""; }; - C685E5151F8907840090598F /* Staff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Staff.cpp; sourceTree = ""; }; - C685E5161F8907840090598F /* Guest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Guest.cpp; sourceTree = ""; }; - C685E5171F8907840090598F /* Map.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Map.cpp; sourceTree = ""; }; - C685E5181F8907840090598F /* Research.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Research.cpp; sourceTree = ""; }; - C688783D202893590084B384 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - C688783F202893600084B384 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - C68D98BB1FC6B8AB008E8378 /* TileInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileInspector.cpp; sourceTree = ""; }; - C6D2BEE11F9BAA6C008B557C /* Ride.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ride.cpp; sourceTree = ""; }; - C6D2BEE31F9BAACC008B557C /* TrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackList.cpp; sourceTree = ""; }; - C6D2BEE41F9BAACD008B557C /* MapTooltip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapTooltip.cpp; sourceTree = ""; }; - C6D2BEE51F9BAACD008B557C /* MazeConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MazeConstruction.cpp; sourceTree = ""; }; - C6D2BEE91F9BB83B008B557C /* NetworkStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkStatus.cpp; sourceTree = ""; }; - C6E415501FAFD6DB00D4A52A /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideConstruction.cpp; sourceTree = ""; }; - C9C630B42235A22C009AD16E /* GameStateSnapshots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameStateSnapshots.h; sourceTree = ""; }; - C9C630B52235A22C009AD16E /* GameStateSnapshots.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameStateSnapshots.cpp; sourceTree = ""; }; - D41B73EE1C2101890080A7B9 /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; - D41B741C1C210A7A0080A7B9 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; }; - D43407E11D0E14CE00C2B3D4 /* shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; name = shaders; path = data/shaders; sourceTree = SOURCE_ROOT; }; - D43BAB921F8C2B2B00A9E362 /* OpenGLAPIProc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGLAPIProc.h; sourceTree = ""; }; - D45E09151F99CF2F00854B2B /* ApplyTransparencyShader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplyTransparencyShader.h; sourceTree = ""; }; - D45E09161F99CF2F00854B2B /* ApplyTransparencyShader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyTransparencyShader.cpp; sourceTree = ""; }; - D47304D41C4FF8250015C0EA /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - D4895D321C23EFDD000CD788 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = distribution/macos/Info.plist; sourceTree = SOURCE_ROOT; }; - D48AFDB61EF78DBF0081C644 /* BenchGfxCommmands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BenchGfxCommmands.cpp; sourceTree = ""; }; - D4974F1A1FA04A1900F7FD7F /* TransparencyDepth.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TransparencyDepth.cpp; sourceTree = ""; }; - D4974F1B1FA04A1900F7FD7F /* TransparencyDepth.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TransparencyDepth.h; sourceTree = ""; }; - D497D0781C20FD52002BF46A /* OpenRCT2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRCT2.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D4EC48E31C2637710024B507 /* g2.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = g2.dat; path = data/g2.dat; sourceTree = SOURCE_ROOT; }; - D4EC48E41C2637710024B507 /* language */ = {isa = PBXFileReference; lastKnownFileType = folder; name = language; path = data/language; sourceTree = SOURCE_ROOT; }; - D4EC48E51C2637710024B507 /* sequence */ = {isa = PBXFileReference; lastKnownFileType = folder; name = sequence; path = data/sequence; sourceTree = SOURCE_ROOT; }; - F70839911FFC0AFF002DCEFA /* Scenario.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scenario.cpp; sourceTree = ""; }; - F73E320B2011589E00C4D975 /* RideRatings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideRatings.cpp; sourceTree = ""; }; - F73E320C2011589F00C4D975 /* RideRatings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RideRatings.h; sourceTree = ""; }; - F73E320E2011589F00C4D975 /* TrackDesignSave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesignSave.cpp; sourceTree = ""; }; - F76C809A1EC4D9FA00FA49E2 /* libopenrct2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libopenrct2.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F76C83571EC4E7CC00FA49E2 /* Audio.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Audio.cpp; sourceTree = ""; }; - F76C83581EC4E7CC00FA49E2 /* audio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = audio.h; sourceTree = ""; }; - F76C83591EC4E7CC00FA49E2 /* AudioChannel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioChannel.h; sourceTree = ""; }; - F76C835A1EC4E7CC00FA49E2 /* AudioContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioContext.h; sourceTree = ""; }; - F76C835B1EC4E7CC00FA49E2 /* AudioMixer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AudioMixer.cpp; sourceTree = ""; }; - F76C835C1EC4E7CC00FA49E2 /* AudioMixer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioMixer.h; sourceTree = ""; }; - F76C835D1EC4E7CC00FA49E2 /* AudioSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSource.h; sourceTree = ""; }; - F76C835E1EC4E7CC00FA49E2 /* NullAudioSource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NullAudioSource.cpp; sourceTree = ""; }; - F76C83631EC4E7CC00FA49E2 /* CommandLine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLine.cpp; sourceTree = ""; }; - F76C83641EC4E7CC00FA49E2 /* CommandLine.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = CommandLine.hpp; sourceTree = ""; }; - F76C83651EC4E7CC00FA49E2 /* ConvertCommand.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertCommand.cpp; sourceTree = ""; }; - F76C83661EC4E7CC00FA49E2 /* RootCommands.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RootCommands.cpp; sourceTree = ""; }; - F76C83671EC4E7CC00FA49E2 /* ScreenshotCommands.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScreenshotCommands.cpp; sourceTree = ""; }; - F76C83681EC4E7CC00FA49E2 /* SpriteCommands.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SpriteCommands.cpp; sourceTree = ""; }; - F76C83691EC4E7CC00FA49E2 /* UriHandler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UriHandler.cpp; sourceTree = ""; }; - F76C836C1EC4E7CC00FA49E2 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; - F76C836E1EC4E7CC00FA49E2 /* Config.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Config.cpp; sourceTree = ""; }; - F76C836F1EC4E7CC00FA49E2 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = ""; }; - F76C83701EC4E7CC00FA49E2 /* ConfigEnum.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ConfigEnum.hpp; sourceTree = ""; }; - F76C83711EC4E7CC00FA49E2 /* IniReader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IniReader.cpp; sourceTree = ""; }; - F76C83721EC4E7CC00FA49E2 /* IniReader.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IniReader.hpp; sourceTree = ""; }; - F76C83731EC4E7CC00FA49E2 /* IniWriter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IniWriter.cpp; sourceTree = ""; }; - F76C83741EC4E7CC00FA49E2 /* IniWriter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IniWriter.hpp; sourceTree = ""; }; - F76C83761EC4E7CC00FA49E2 /* Context.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Context.cpp; sourceTree = ""; }; - F76C83771EC4E7CC00FA49E2 /* Context.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Context.h; sourceTree = ""; }; - F76C83791EC4E7CC00FA49E2 /* Collections.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Collections.hpp; sourceTree = ""; }; - F76C837A1EC4E7CC00FA49E2 /* Console.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Console.cpp; sourceTree = ""; }; - F76C837B1EC4E7CC00FA49E2 /* Console.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Console.hpp; sourceTree = ""; }; - F76C837C1EC4E7CC00FA49E2 /* Diagnostics.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostics.cpp; sourceTree = ""; }; - F76C837D1EC4E7CC00FA49E2 /* Diagnostics.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Diagnostics.hpp; sourceTree = ""; }; - F76C837F1EC4E7CC00FA49E2 /* File.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = ""; }; - F76C83801EC4E7CC00FA49E2 /* File.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = ""; }; - F76C83811EC4E7CC00FA49E2 /* FileScanner.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FileScanner.cpp; sourceTree = ""; }; - F76C83821EC4E7CC00FA49E2 /* FileScanner.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileScanner.h; sourceTree = ""; }; - F76C83841EC4E7CC00FA49E2 /* Guard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Guard.cpp; sourceTree = ""; }; - F76C83851EC4E7CC00FA49E2 /* Guard.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Guard.hpp; sourceTree = ""; }; - F76C83861EC4E7CC00FA49E2 /* IStream.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IStream.cpp; sourceTree = ""; }; - F76C83871EC4E7CC00FA49E2 /* IStream.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IStream.hpp; sourceTree = ""; }; - F76C83881EC4E7CC00FA49E2 /* Json.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Json.cpp; sourceTree = ""; }; - F76C83891EC4E7CC00FA49E2 /* Json.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Json.hpp; sourceTree = ""; }; - F76C838B1EC4E7CC00FA49E2 /* Memory.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Memory.hpp; sourceTree = ""; }; - F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryStream.cpp; sourceTree = ""; }; - F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MemoryStream.h; sourceTree = ""; }; - F76C838F1EC4E7CC00FA49E2 /* Path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Path.cpp; sourceTree = ""; }; - F76C83901EC4E7CC00FA49E2 /* Path.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Path.hpp; sourceTree = ""; }; - F76C83921EC4E7CC00FA49E2 /* String.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = ""; }; - F76C83931EC4E7CC00FA49E2 /* String.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = String.hpp; sourceTree = ""; }; - F76C83991EC4E7CC00FA49E2 /* Zip.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Zip.cpp; sourceTree = ""; }; - F76C839A1EC4E7CC00FA49E2 /* Zip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Zip.h; sourceTree = ""; }; - F76C839F1EC4E7CC00FA49E2 /* drawing.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = drawing.h; sourceTree = ""; }; - F76C83A31EC4E7CC00FA49E2 /* IDrawingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDrawingContext.h; sourceTree = ""; }; - F76C83A41EC4E7CC00FA49E2 /* IDrawingEngine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDrawingEngine.h; sourceTree = ""; }; - F76C83A51EC4E7CC00FA49E2 /* Image.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Image.cpp; sourceTree = ""; }; - F76C83A71EC4E7CC00FA49E2 /* lightfx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lightfx.h; sourceTree = ""; }; - F76C83A91EC4E7CC00FA49E2 /* NewDrawing.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NewDrawing.cpp; sourceTree = ""; }; - F76C83AA1EC4E7CC00FA49E2 /* NewDrawing.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NewDrawing.h; sourceTree = ""; }; - F76C83AB1EC4E7CC00FA49E2 /* Weather.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Weather.cpp; sourceTree = ""; }; - F76C83AC1EC4E7CC00FA49E2 /* Weather.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Weather.h; sourceTree = ""; }; - F76C83B11EC4E7CC00FA49E2 /* Editor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; path = Editor.cpp; sourceTree = ""; }; - F76C83B21EC4E7CC00FA49E2 /* Editor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Editor.h; sourceTree = ""; }; - F76C83B31EC4E7CC00FA49E2 /* FileClassifier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FileClassifier.cpp; sourceTree = ""; }; - F76C83B41EC4E7CC00FA49E2 /* FileClassifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileClassifier.h; sourceTree = ""; }; - F76C83BA1EC4E7CC00FA49E2 /* input.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = ""; }; - F76C83F91EC4E7CC00FA49E2 /* network.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = network.h; sourceTree = ""; }; - F76C83FA1EC4E7CC00FA49E2 /* NetworkAction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkAction.cpp; sourceTree = ""; }; - F76C83FB1EC4E7CC00FA49E2 /* NetworkAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkAction.h; sourceTree = ""; }; - F76C83FC1EC4E7CC00FA49E2 /* NetworkConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkConnection.cpp; sourceTree = ""; }; - F76C83FD1EC4E7CC00FA49E2 /* NetworkConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkConnection.h; sourceTree = ""; }; - F76C83FE1EC4E7CC00FA49E2 /* NetworkGroup.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkGroup.cpp; sourceTree = ""; }; - F76C83FF1EC4E7CC00FA49E2 /* NetworkGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkGroup.h; sourceTree = ""; }; - F76C84001EC4E7CC00FA49E2 /* NetworkKey.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkKey.cpp; sourceTree = ""; }; - F76C84011EC4E7CC00FA49E2 /* NetworkKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkKey.h; sourceTree = ""; }; - F76C84021EC4E7CC00FA49E2 /* NetworkPacket.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkPacket.cpp; sourceTree = ""; }; - F76C84031EC4E7CC00FA49E2 /* NetworkPacket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkPacket.h; sourceTree = ""; }; - F76C84041EC4E7CC00FA49E2 /* NetworkPlayer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkPlayer.cpp; sourceTree = ""; }; - F76C84051EC4E7CC00FA49E2 /* NetworkPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkPlayer.h; sourceTree = ""; }; - F76C84061EC4E7CC00FA49E2 /* NetworkServerAdvertiser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkServerAdvertiser.cpp; sourceTree = ""; }; - F76C84071EC4E7CC00FA49E2 /* NetworkServerAdvertiser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkServerAdvertiser.h; sourceTree = ""; }; - F76C84081EC4E7CC00FA49E2 /* NetworkTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkTypes.h; sourceTree = ""; }; - F76C84091EC4E7CC00FA49E2 /* NetworkUser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkUser.cpp; sourceTree = ""; }; - F76C840A1EC4E7CC00FA49E2 /* NetworkUser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NetworkUser.h; sourceTree = ""; }; - F76C840B1EC4E7CC00FA49E2 /* ServerList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ServerList.cpp; sourceTree = ""; }; - F76C840C1EC4E7CC00FA49E2 /* ServerList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ServerList.h; sourceTree = ""; }; - F76C840D1EC4E7CC00FA49E2 /* Socket.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Socket.cpp; sourceTree = ""; }; - F76C840E1EC4E7CC00FA49E2 /* Socket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = ""; }; - F76C84121EC4E7CC00FA49E2 /* BannerObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BannerObject.cpp; sourceTree = ""; }; - F76C84131EC4E7CC00FA49E2 /* BannerObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BannerObject.h; sourceTree = ""; }; - F76C84141EC4E7CC00FA49E2 /* EntranceObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EntranceObject.cpp; sourceTree = ""; }; - F76C84151EC4E7CC00FA49E2 /* EntranceObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EntranceObject.h; sourceTree = ""; }; - F76C84161EC4E7CC00FA49E2 /* FootpathItemObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathItemObject.cpp; sourceTree = ""; }; - F76C84171EC4E7CC00FA49E2 /* FootpathItemObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FootpathItemObject.h; sourceTree = ""; }; - F76C84181EC4E7CC00FA49E2 /* FootpathObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FootpathObject.cpp; sourceTree = ""; }; - F76C84191EC4E7CC00FA49E2 /* FootpathObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FootpathObject.h; sourceTree = ""; }; - F76C841A1EC4E7CC00FA49E2 /* ImageTable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ImageTable.cpp; sourceTree = ""; }; - F76C841B1EC4E7CC00FA49E2 /* ImageTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageTable.h; sourceTree = ""; }; - F76C841C1EC4E7CC00FA49E2 /* LargeSceneryObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LargeSceneryObject.cpp; sourceTree = ""; }; - F76C841D1EC4E7CC00FA49E2 /* LargeSceneryObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LargeSceneryObject.h; sourceTree = ""; }; - F76C841E1EC4E7CC00FA49E2 /* Object.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Object.cpp; sourceTree = ""; }; - F76C841F1EC4E7CC00FA49E2 /* Object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Object.h; sourceTree = ""; }; - F76C84201EC4E7CC00FA49E2 /* ObjectFactory.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFactory.cpp; sourceTree = ""; }; - F76C84211EC4E7CC00FA49E2 /* ObjectFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectFactory.h; sourceTree = ""; }; - F76C84221EC4E7CC00FA49E2 /* ObjectManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectManager.cpp; sourceTree = ""; }; - F76C84231EC4E7CC00FA49E2 /* ObjectManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectManager.h; sourceTree = ""; }; - F76C84241EC4E7CC00FA49E2 /* ObjectRepository.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectRepository.cpp; sourceTree = ""; }; - F76C84251EC4E7CC00FA49E2 /* ObjectRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectRepository.h; sourceTree = ""; }; - F76C84261EC4E7CC00FA49E2 /* RideObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RideObject.cpp; sourceTree = ""; }; - F76C84271EC4E7CC00FA49E2 /* RideObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RideObject.h; sourceTree = ""; }; - F76C84281EC4E7CC00FA49E2 /* SceneryGroupObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SceneryGroupObject.cpp; sourceTree = ""; }; - F76C84291EC4E7CC00FA49E2 /* SceneryGroupObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneryGroupObject.h; sourceTree = ""; }; - F76C842A1EC4E7CC00FA49E2 /* SceneryObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneryObject.h; sourceTree = ""; }; - F76C842B1EC4E7CC00FA49E2 /* SmallSceneryObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SmallSceneryObject.cpp; sourceTree = ""; }; - F76C842C1EC4E7CC00FA49E2 /* SmallSceneryObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SmallSceneryObject.h; sourceTree = ""; }; - F76C842F1EC4E7CC00FA49E2 /* StringTable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StringTable.cpp; sourceTree = ""; }; - F76C84301EC4E7CC00FA49E2 /* StringTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StringTable.h; sourceTree = ""; }; - F76C84311EC4E7CC00FA49E2 /* WallObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WallObject.cpp; sourceTree = ""; }; - F76C84321EC4E7CC00FA49E2 /* WallObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WallObject.h; sourceTree = ""; }; - F76C84331EC4E7CC00FA49E2 /* WaterObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WaterObject.cpp; sourceTree = ""; }; - F76C84341EC4E7CC00FA49E2 /* WaterObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WaterObject.h; sourceTree = ""; }; - F76C84381EC4E7CC00FA49E2 /* OpenRCT2.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OpenRCT2.cpp; sourceTree = ""; }; - F76C84391EC4E7CC00FA49E2 /* OpenRCT2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenRCT2.h; sourceTree = ""; }; - F76C84511EC4E7CC00FA49E2 /* ParkImporter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ParkImporter.cpp; sourceTree = ""; }; - F76C84521EC4E7CC00FA49E2 /* ParkImporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParkImporter.h; sourceTree = ""; }; - F76C845A1EC4E7CC00FA49E2 /* Crash.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Crash.cpp; sourceTree = ""; }; - F76C845D1EC4E7CC00FA49E2 /* macos.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = macos.mm; sourceTree = ""; }; - F76C845E1EC4E7CC00FA49E2 /* platform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; - F76C84601EC4E7CC00FA49E2 /* Platform2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Platform2.h; sourceTree = ""; }; - F76C84641EC4E7CC00FA49E2 /* PlatformEnvironment.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformEnvironment.cpp; sourceTree = ""; }; - F76C84651EC4E7CC00FA49E2 /* PlatformEnvironment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformEnvironment.h; sourceTree = ""; }; - F76C84671EC4E7CC00FA49E2 /* S4Importer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = S4Importer.cpp; sourceTree = ""; }; - F76C84681EC4E7CC00FA49E2 /* Tables.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Tables.cpp; sourceTree = ""; }; - F76C84691EC4E7CC00FA49E2 /* Tables.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Tables.h; sourceTree = ""; }; - F76C846D1EC4E7CC00FA49E2 /* SawyerChunk.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SawyerChunk.cpp; sourceTree = ""; }; - F76C846E1EC4E7CC00FA49E2 /* SawyerChunk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SawyerChunk.h; sourceTree = ""; }; - F76C846F1EC4E7CC00FA49E2 /* SawyerChunkReader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SawyerChunkReader.cpp; sourceTree = ""; }; - F76C84701EC4E7CC00FA49E2 /* SawyerChunkReader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SawyerChunkReader.h; sourceTree = ""; }; - F76C84711EC4E7CC00FA49E2 /* SawyerChunkWriter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SawyerChunkWriter.cpp; sourceTree = ""; }; - F76C84721EC4E7CC00FA49E2 /* SawyerChunkWriter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SawyerChunkWriter.h; sourceTree = ""; }; - F76C84731EC4E7CC00FA49E2 /* SawyerEncoding.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SawyerEncoding.cpp; sourceTree = ""; }; - F76C84741EC4E7CC00FA49E2 /* SawyerEncoding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SawyerEncoding.h; sourceTree = ""; }; - F76C847D1EC4E7CC00FA49E2 /* S6Exporter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = S6Exporter.cpp; sourceTree = ""; }; - F76C847E1EC4E7CC00FA49E2 /* S6Exporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S6Exporter.h; sourceTree = ""; }; - F76C847F1EC4E7CC00FA49E2 /* S6Importer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = S6Importer.cpp; sourceTree = ""; }; - F76C84DC1EC4E7CD00FA49E2 /* TrackDesignRepository.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TrackDesignRepository.cpp; sourceTree = ""; }; - F76C84DD1EC4E7CD00FA49E2 /* TrackDesignRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TrackDesignRepository.h; sourceTree = ""; }; - F76C84F51EC4E7CD00FA49E2 /* scenario.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = scenario.h; sourceTree = ""; }; - F76C84F61EC4E7CD00FA49E2 /* ScenarioRepository.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScenarioRepository.cpp; sourceTree = ""; }; - F76C84F71EC4E7CD00FA49E2 /* ScenarioRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScenarioRepository.h; sourceTree = ""; }; - F76C84F81EC4E7CD00FA49E2 /* ScenarioSources.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScenarioSources.cpp; sourceTree = ""; }; - F76C84F91EC4E7CD00FA49E2 /* ScenarioSources.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScenarioSources.h; sourceTree = ""; }; - F76C84FA1EC4E7CD00FA49E2 /* sprites.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sprites.h; sourceTree = ""; }; - F76C84FC1EC4E7CD00FA49E2 /* TitleScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TitleScreen.cpp; sourceTree = ""; }; - F76C84FD1EC4E7CD00FA49E2 /* TitleScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TitleScreen.h; sourceTree = ""; }; - F76C84FE1EC4E7CD00FA49E2 /* TitleSequence.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TitleSequence.cpp; sourceTree = ""; }; - F76C84FF1EC4E7CD00FA49E2 /* TitleSequence.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TitleSequence.h; sourceTree = ""; }; - F76C85001EC4E7CD00FA49E2 /* TitleSequenceManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TitleSequenceManager.cpp; sourceTree = ""; }; - F76C85011EC4E7CD00FA49E2 /* TitleSequenceManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TitleSequenceManager.h; sourceTree = ""; }; - F76C85031EC4E7CD00FA49E2 /* TitleSequencePlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TitleSequencePlayer.h; sourceTree = ""; }; - F76C85051EC4E7CD00FA49E2 /* UiContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UiContext.h; sourceTree = ""; }; - F76C850B1EC4E7CD00FA49E2 /* Version.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Version.cpp; sourceTree = ""; }; - F76C850C1EC4E7CD00FA49E2 /* Version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Version.h; sourceTree = ""; }; - F76C854A1EC4E7CD00FA49E2 /* tile_inspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tile_inspector.h; sourceTree = ""; }; - F76C857D1EC4E80E00FA49E2 /* Cli.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Cli.cpp; sourceTree = ""; }; - F76C85821EC4E82600FA49E2 /* AudioChannel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AudioChannel.cpp; sourceTree = ""; }; - F76C85831EC4E82600FA49E2 /* AudioContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AudioContext.cpp; sourceTree = ""; }; - F76C85841EC4E82600FA49E2 /* AudioContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioContext.h; sourceTree = ""; }; - F76C85851EC4E82600FA49E2 /* AudioFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioFormat.h; sourceTree = ""; }; - F76C85861EC4E82600FA49E2 /* AudioMixer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AudioMixer.cpp; sourceTree = ""; }; - F76C85871EC4E82600FA49E2 /* FileAudioSource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FileAudioSource.cpp; sourceTree = ""; }; - F76C85881EC4E82600FA49E2 /* MemoryAudioSource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryAudioSource.cpp; sourceTree = ""; }; - F76C858A1EC4E82600FA49E2 /* CursorData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CursorData.cpp; sourceTree = ""; }; - F76C858B1EC4E82600FA49E2 /* CursorRepository.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CursorRepository.cpp; sourceTree = ""; }; - F76C858C1EC4E82600FA49E2 /* CursorRepository.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CursorRepository.h; sourceTree = ""; }; - F76C858F1EC4E82600FA49E2 /* DrawingEngines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DrawingEngines.h; sourceTree = ""; }; - F76C85911EC4E82600FA49E2 /* ApplyPaletteShader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyPaletteShader.cpp; sourceTree = ""; }; - F76C85921EC4E82600FA49E2 /* ApplyPaletteShader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplyPaletteShader.h; sourceTree = ""; }; - F76C85931EC4E82600FA49E2 /* DrawCommands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DrawCommands.h; sourceTree = ""; }; - F76C85941EC4E82600FA49E2 /* DrawRectShader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DrawRectShader.cpp; sourceTree = ""; }; - F76C85951EC4E82600FA49E2 /* DrawRectShader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DrawRectShader.h; sourceTree = ""; }; - F76C85961EC4E82600FA49E2 /* DrawLineShader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DrawLineShader.cpp; sourceTree = ""; }; - F76C85971EC4E82600FA49E2 /* DrawLineShader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DrawLineShader.h; sourceTree = ""; }; - F76C859A1EC4E82600FA49E2 /* GLSLTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLSLTypes.h; sourceTree = ""; }; - F76C859B1EC4E82600FA49E2 /* OpenGLAPI.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OpenGLAPI.cpp; sourceTree = ""; }; - F76C859C1EC4E82600FA49E2 /* OpenGLAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGLAPI.h; sourceTree = ""; }; - F76C859D1EC4E82600FA49E2 /* OpenGLDrawingEngine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OpenGLDrawingEngine.cpp; sourceTree = ""; }; - F76C859E1EC4E82600FA49E2 /* OpenGLFramebuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OpenGLFramebuffer.cpp; sourceTree = ""; }; - F76C859F1EC4E82600FA49E2 /* OpenGLFramebuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGLFramebuffer.h; sourceTree = ""; }; - F76C85A01EC4E82600FA49E2 /* OpenGLShaderProgram.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OpenGLShaderProgram.cpp; sourceTree = ""; }; - F76C85A11EC4E82600FA49E2 /* OpenGLShaderProgram.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGLShaderProgram.h; sourceTree = ""; }; - F76C85A21EC4E82600FA49E2 /* SwapFramebuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SwapFramebuffer.cpp; sourceTree = ""; }; - F76C85A31EC4E82600FA49E2 /* SwapFramebuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwapFramebuffer.h; sourceTree = ""; }; - F76C85A41EC4E82600FA49E2 /* TextureCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TextureCache.cpp; sourceTree = ""; }; - F76C85A51EC4E82600FA49E2 /* TextureCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextureCache.h; sourceTree = ""; }; - F76C85A61EC4E82600FA49E2 /* SoftwareDrawingEngine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SoftwareDrawingEngine.cpp; sourceTree = ""; }; - F76C85A81EC4E82600FA49E2 /* SDLException.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLException.h; sourceTree = ""; }; - F76C85A91EC4E82600FA49E2 /* TextComposition.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TextComposition.cpp; sourceTree = ""; }; - F76C85AA1EC4E82600FA49E2 /* TextComposition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextComposition.h; sourceTree = ""; }; - F76C85AB1EC4E82600FA49E2 /* Ui.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Ui.cpp; sourceTree = ""; }; - F76C85AC1EC4E82600FA49E2 /* UiContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UiContext.cpp; sourceTree = ""; }; - F76C85AD1EC4E82600FA49E2 /* UiContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UiContext.h; sourceTree = ""; }; - F76C85AE1EC4E82600FA49E2 /* UiContext.Linux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UiContext.Linux.cpp; sourceTree = ""; }; - F76C85AF1EC4E82600FA49E2 /* UiContext.Win32.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UiContext.Win32.cpp; sourceTree = ""; }; - F775F5321EE35A48001F00E7 /* Ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ui.h; sourceTree = ""; }; - F775F5331EE35A6B001F00E7 /* DummyUiContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DummyUiContext.cpp; sourceTree = ""; }; - F775F5361EE3724F001F00E7 /* DummyAudioContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DummyAudioContext.cpp; sourceTree = ""; }; - F79F428E1F3260F1009E42F8 /* changelog.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = changelog.txt; path = distribution/changelog.txt; sourceTree = SOURCE_ROOT; }; - F7B20489201E91BF0000AD7E /* Platform.macOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Platform.macOS.mm; sourceTree = ""; }; - F7B2048B2024E7800000AD7E /* DefaultObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultObjects.cpp; sourceTree = ""; }; - F7B2048D2024E8A90000AD7E /* DefaultObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultObjects.h; sourceTree = ""; }; - F7B2048E2024E8B30000AD7E /* _legacy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = _legacy.cpp; sourceTree = ""; }; - F7C44AF62030E74B007E099F /* AVX2Drawing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AVX2Drawing.cpp; sourceTree = ""; }; - F7CB863D1EEDA0B50030C877 /* WindowManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowManager.cpp; sourceTree = ""; }; - F7CB863E1EEDA0B50030C877 /* WindowManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowManager.h; sourceTree = ""; }; - F7CB864B1EEDA1A80030C877 /* DummyWindowManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DummyWindowManager.cpp; sourceTree = ""; }; - F7CB864C1EEDA1A80030C877 /* WindowManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowManager.h; sourceTree = ""; }; - F7D7747E1EC61E5100BE6EBC /* UiContext.macOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UiContext.macOS.mm; sourceTree = ""; usesTabs = 0; }; - F7D774841EC66CD700BE6EBC /* OpenRCT2-cli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "OpenRCT2-cli"; sourceTree = BUILT_PRODUCTS_DIR; }; - 0EB0D1DF6CC74E4190301D84 /* EntityTweener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EntityTweener.cpp; path = src/openrct2/world/EntityTweener.cpp; sourceTree = SOURCE_ROOT; }; - 091352A950004312BAB18717 /* EntityTweener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntityTweener.h; path = src/openrct2/world/EntityTweener.h; sourceTree = SOURCE_ROOT; }; - 9D3DD6CD73F5421880280D9D /* Litter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Litter.cpp; path = src/openrct2/world/Litter.cpp; sourceTree = SOURCE_ROOT; }; - 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideConstruction.cpp; path = src/openrct2/ride/RideConstruction.cpp; sourceTree = SOURCE_ROOT; }; - BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = EnumMap.hpp; path = src/openrct2/core/EnumMap.hpp; sourceTree = SOURCE_ROOT; }; - 6DF61461D47C40CF92019B24 /* ScEntity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScEntity.hpp; path = src/openrct2/scripting/bindings/entity/ScEntity.hpp; sourceTree = SOURCE_ROOT; }; - 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScCheats.hpp; path = src/openrct2/scripting/bindings/game/ScCheats.hpp; sourceTree = SOURCE_ROOT; }; - FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScConfiguration.hpp; path = src/openrct2/scripting/bindings/game/ScConfiguration.hpp; sourceTree = SOURCE_ROOT; }; - E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScConsole.hpp; path = src/openrct2/scripting/bindings/game/ScConsole.hpp; sourceTree = SOURCE_ROOT; }; - DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScContext.hpp; path = src/openrct2/scripting/bindings/game/ScContext.hpp; sourceTree = SOURCE_ROOT; }; - 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScDisposable.hpp; path = src/openrct2/scripting/bindings/game/ScDisposable.hpp; sourceTree = SOURCE_ROOT; }; - BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScNetwork.hpp; path = src/openrct2/scripting/bindings/network/ScNetwork.hpp; sourceTree = SOURCE_ROOT; }; - D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScSocket.hpp; path = src/openrct2/scripting/bindings/network/ScSocket.hpp; sourceTree = SOURCE_ROOT; }; - 24F9DF02868247738D05CC40 /* ScObject.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScObject.hpp; path = src/openrct2/scripting/bindings/object/ScObject.hpp; sourceTree = SOURCE_ROOT; }; - AD97B712FDF7454CADC7A328 /* ScRide.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRide.hpp; path = src/openrct2/scripting/bindings/ride/ScRide.hpp; sourceTree = SOURCE_ROOT; }; - 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScClimate.hpp; path = src/openrct2/scripting/bindings/world/ScClimate.hpp; sourceTree = SOURCE_ROOT; }; - 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScDate.hpp; path = src/openrct2/scripting/bindings/world/ScDate.hpp; sourceTree = SOURCE_ROOT; }; - 74CDED6B7EF041458032681A /* ScMap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScMap.hpp; path = src/openrct2/scripting/bindings/world/ScMap.hpp; sourceTree = SOURCE_ROOT; }; - 9AB8D336AB654D0280549A89 /* ScPark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPark.hpp; path = src/openrct2/scripting/bindings/world/ScPark.hpp; sourceTree = SOURCE_ROOT; }; - A9F55F2291284217BA0E4E51 /* ScScenario.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScScenario.hpp; path = src/openrct2/scripting/bindings/world/ScScenario.hpp; sourceTree = SOURCE_ROOT; }; - 22D7DD798F054A068273739B /* ScTile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTile.hpp; path = src/openrct2/scripting/bindings/world/ScTile.hpp; sourceTree = SOURCE_ROOT; }; - B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScVehicle.cpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.cpp; sourceTree = SOURCE_ROOT; }; - 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScVehicle.hpp; path = src/openrct2/scripting/bindings/entity/ScVehicle.hpp; sourceTree = SOURCE_ROOT; }; - 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScGuest.cpp; path = src/openrct2/scripting/bindings/entity/ScGuest.cpp; sourceTree = SOURCE_ROOT; }; - CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScGuest.hpp; path = src/openrct2/scripting/bindings/entity/ScGuest.hpp; sourceTree = SOURCE_ROOT; }; - 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPeep.hpp; path = src/openrct2/scripting/bindings/entity/ScPeep.hpp; sourceTree = SOURCE_ROOT; }; - 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScStaff.cpp; path = src/openrct2/scripting/bindings/entity/ScStaff.cpp; sourceTree = SOURCE_ROOT; }; - C30AB6C640464647ABE90EC4 /* ScStaff.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScStaff.hpp; path = src/openrct2/scripting/bindings/entity/ScStaff.hpp; sourceTree = SOURCE_ROOT; }; - 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScLitter.cpp; path = src/openrct2/scripting/bindings/entity/ScLitter.cpp; sourceTree = SOURCE_ROOT; }; - C30388F4F6D34DF59EF7072C /* ScLitter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScLitter.hpp; path = src/openrct2/scripting/bindings/entity/ScLitter.hpp; sourceTree = SOURCE_ROOT; }; - DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayerGroup.cpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.cpp; sourceTree = SOURCE_ROOT; }; - 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayerGroup.hpp; path = src/openrct2/scripting/bindings/network/ScPlayerGroup.hpp; sourceTree = SOURCE_ROOT; }; - E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPlayer.cpp; path = src/openrct2/scripting/bindings/network/ScPlayer.cpp; sourceTree = SOURCE_ROOT; }; - 7A08C451885D4D419FB4820D /* ScPlayer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScPlayer.hpp; path = src/openrct2/scripting/bindings/network/ScPlayer.hpp; sourceTree = SOURCE_ROOT; }; - 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScNetwork.cpp; path = src/openrct2/scripting/bindings/network/ScNetwork.cpp; sourceTree = SOURCE_ROOT; }; - 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRideStation.cpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.cpp; sourceTree = SOURCE_ROOT; }; - 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScRideStation.hpp; path = src/openrct2/scripting/bindings/ride/ScRideStation.hpp; sourceTree = SOURCE_ROOT; }; - F3B00C9900ED42AFA72764ED /* ScRide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScRide.cpp; path = src/openrct2/scripting/bindings/ride/ScRide.cpp; sourceTree = SOURCE_ROOT; }; - E4BE60702D7549488A32CC0B /* ScMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScMap.cpp; path = src/openrct2/scripting/bindings/world/ScMap.cpp; sourceTree = SOURCE_ROOT; }; - 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScParkMessage.cpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.cpp; sourceTree = SOURCE_ROOT; }; - 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScParkMessage.hpp; path = src/openrct2/scripting/bindings/world/ScParkMessage.hpp; sourceTree = SOURCE_ROOT; }; - E9C4DE37309A4B5F965D7718 /* ScPark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScPark.cpp; path = src/openrct2/scripting/bindings/world/ScPark.cpp; sourceTree = SOURCE_ROOT; }; - 43D18154E96444749737E3F6 /* ScTileElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTileElement.cpp; path = src/openrct2/scripting/bindings/world/ScTileElement.cpp; sourceTree = SOURCE_ROOT; }; - F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ScTileElement.hpp; path = src/openrct2/scripting/bindings/world/ScTileElement.hpp; sourceTree = SOURCE_ROOT; }; - 5B67E36A8620400CA70FBA49 /* ScTile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScTile.cpp; path = src/openrct2/scripting/bindings/world/ScTile.cpp; sourceTree = SOURCE_ROOT; }; - 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RideUseSystem.cpp; path = src/openrct2/peep/RideUseSystem.cpp; sourceTree = SOURCE_ROOT; }; - 2DA720D496604387806AC168 /* RideUseSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RideUseSystem.h; path = src/openrct2/peep/RideUseSystem.h; sourceTree = SOURCE_ROOT; }; - F4D523B8782E4C458AF1490D /* GroupVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GroupVector.hpp; path = src/openrct2/core/GroupVector.hpp; sourceTree = SOURCE_ROOT; }; - F28A181D311D4E078FDB090C /* ZipStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ZipStream.hpp; path = src/openrct2/core/ZipStream.hpp; sourceTree = SOURCE_ROOT; }; - 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Crypt.OpenRCT2.cpp; path = src/openrct2/core/Crypt.OpenRCT2.cpp; sourceTree = SOURCE_ROOT; }; - 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChangeMapSizeAction.cpp; path = src/openrct2/actions/ChangeMapSizeAction.cpp; sourceTree = SOURCE_ROOT; }; - C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChangeMapSizeAction.h; path = src/openrct2/actions/ChangeMapSizeAction.h; sourceTree = SOURCE_ROOT; }; - F9061C16C67A45D7915FA229 /* OrcaStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = OrcaStream.hpp; path = src/openrct2/core/OrcaStream.hpp; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D497D0751C20FD52002BF46A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C6887847202897B70084B384 /* Cocoa.framework in Frameworks */, - C6887846202897B30084B384 /* Foundation.framework in Frameworks */, - F76C88921EC539A300FA49E2 /* libopenrct2.a in Frameworks */, - D47304D51C4FF8250015C0EA /* libz.tbd in Frameworks */, - D41B73EF1C2101890080A7B9 /* libcurl.tbd in Frameworks */, - D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */, - 669125A725FD2CBF00B038E1 /* libSDL2-2.0.dylib in Frameworks */, - 6691257925FD2C4900B038E1 /* libbrotlicommon.1.dylib in Frameworks */, - 6691257A25FD2C4900B038E1 /* libbrotlidec.1.dylib in Frameworks */, - 6691257B25FD2C4900B038E1 /* libbrotlienc.1.dylib in Frameworks */, - 6691257C25FD2C4900B038E1 /* libbz2.1.0.dylib in Frameworks */, - 6691257E25FD2C4900B038E1 /* libdiscord-rpc.dylib in Frameworks */, - 6691257F25FD2C4900B038E1 /* libduktape.2.dylib in Frameworks */, - 6691258025FD2C4900B038E1 /* libfreetype.6.dylib in Frameworks */, - 669125A225FD2C7C00B038E1 /* libcrypto.1.1.dylib in Frameworks */, - 6691258125FD2C4900B038E1 /* libicudata.67.dylib in Frameworks */, - 6691258225FD2C4900B038E1 /* libicui18n.67.dylib in Frameworks */, - 6691258325FD2C4900B038E1 /* libicuio.67.dylib in Frameworks */, - 6691258425FD2C4900B038E1 /* libicutu.67.dylib in Frameworks */, - 6691258525FD2C4900B038E1 /* libicuuc.67.dylib in Frameworks */, - 6691258625FD2C4900B038E1 /* libpng16.16.dylib in Frameworks */, - 6691258825FD2C4900B038E1 /* libspeexdsp.1.dylib in Frameworks */, - 6691258925FD2C4900B038E1 /* libssl.1.1.dylib in Frameworks */, - 6691258A25FD2C4900B038E1 /* libz.1.dylib in Frameworks */, - 6691258B25FD2C4900B038E1 /* libzip.5.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7D774811EC66CD700BE6EBC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 669125AB25FD2DF400B038E1 /* libdiscord-rpc.dylib in Frameworks */, - 669125B025FD2E1500B038E1 /* libzip.5.dylib in Frameworks */, - C68878492028982B0084B384 /* Cocoa.framework in Frameworks */, - C6887848202897D10084B384 /* Foundation.framework in Frameworks */, - 669125AD25FD2E0400B038E1 /* libfreetype.6.dylib in Frameworks */, - 669125AC25FD2DFD00B038E1 /* libcrypto.1.1.dylib in Frameworks */, - 669125AE25FD2E0800B038E1 /* libpng16.16.dylib in Frameworks */, - F7D7748D1EC66F8600BE6EBC /* libopenrct2.a in Frameworks */, - 669125AF25FD2E1000B038E1 /* libspeexdsp.1.dylib in Frameworks */, - F7D774901EC66FB000BE6EBC /* libz.tbd in Frameworks */, - F7D7748F1EC66FA900BE6EBC /* libcurl.tbd in Frameworks */, - F7D7748E1EC66FA000BE6EBC /* libiconv.tbd in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4C25594D244A326100CE7E45 /* scripting */ = { - isa = PBXGroup; - children = ( - 4C81F7DF24672C4D000E61BF /* CustomListView.cpp */, - 4C81F7E024672C4D000E61BF /* CustomListView.h */, - 4C25594F244A328A00CE7E45 /* CustomMenu.cpp */, - 4C255953244A328A00CE7E45 /* CustomMenu.h */, - 4C255957244A328B00CE7E45 /* CustomWindow.cpp */, - 4C25594E244A328A00CE7E45 /* CustomWindow.h */, - 4C81F7E224672C58000E61BF /* ScTileSelection.hpp */, - 4C255950244A328A00CE7E45 /* ScUi.hpp */, - 4C255955244A328A00CE7E45 /* ScViewport.hpp */, - 4C255951244A328A00CE7E45 /* ScWidget.hpp */, - 4C255952244A328A00CE7E45 /* ScWindow.hpp */, - 4C255954244A328A00CE7E45 /* UiExtensions.cpp */, - 4C255956244A328B00CE7E45 /* UiExtensions.h */, - ); - name = scripting; - sourceTree = ""; - }; - 4C25595B244A32A800CE7E45 /* thirdparty */ = { - isa = PBXGroup; - children = ( - 4C25595E244A32EA00CE7E45 /* dukglue */, - 4C25595C244A32E400CE7E45 /* filesystem.hpp */, - 4C25595D244A32E400CE7E45 /* linenoise.hpp */, - ); - name = thirdparty; - path = ../thirdparty; - sourceTree = ""; - }; - 4C25595E244A32EA00CE7E45 /* dukglue */ = { - isa = PBXGroup; - children = ( - 4C255964244A330700CE7E45 /* detail_class_proto.h */, - 4C255969244A330800CE7E45 /* detail_constructor.h */, - 4C255967244A330700CE7E45 /* detail_function.h */, - 4C25596D244A330800CE7E45 /* detail_method.h */, - 4C255962244A330700CE7E45 /* detail_primitive_types.h */, - 4C25596B244A330800CE7E45 /* detail_refs.h */, - 4C25595F244A330700CE7E45 /* detail_stack.h */, - 4C255965244A330700CE7E45 /* detail_traits.h */, - 4C25596F244A330800CE7E45 /* detail_typeinfo.h */, - 4C255968244A330700CE7E45 /* detail_types.h */, - 4C25596E244A330800CE7E45 /* dukexception.h */, - 4C255963244A330700CE7E45 /* dukglue.h */, - 4C255961244A330700CE7E45 /* dukvalue.h */, - 4C25596A244A330800CE7E45 /* public_util.h */, - 4C255960244A330700CE7E45 /* register_class.h */, - 4C255966244A330700CE7E45 /* register_function.h */, - 4C25596C244A330800CE7E45 /* register_property.h */, - ); - name = dukglue; - sourceTree = ""; - }; - 933CBDB820CB1B3F00134678 /* title */ = { - isa = PBXGroup; - children = ( - 933CBDB920CB1B3F00134678 /* TitleSequencePlayer.cpp */, - 933CBDBA20CB1B3F00134678 /* TitleSequencePlayer.h */, - ); - name = title; - path = "src/openrct2-ui/title"; - sourceTree = SOURCE_ROOT; - }; - 93DFD03024521C19001FCBAF /* scripting */ = { - isa = PBXGroup; - children = ( - 59B0CA75A27A4C5EB9EF6CA7 /* bindings */, - 93DFD03B24521C19001FCBAF /* Duktape.hpp */, - 93DFD03524521C19001FCBAF /* HookEngine.cpp */, - 93DFD03324521C19001FCBAF /* HookEngine.h */, - 93DFD03F24521C19001FCBAF /* Plugin.cpp */, - 93DFD03124521C19001FCBAF /* Plugin.h */, - 93DFD03724521C19001FCBAF, - 93DFD03C24521C19001FCBAF, - 93DFD03E24521C19001FCBAF, - 93DFD04124521C19001FCBAF, - 93DFD03924521C19001FCBAF, - 93DFD03A24521C19001FCBAF, - 93DFD04224521C19001FCBAF, - 93DFD03424521C19001FCBAF, - 93DFD03224521C19001FCBAF, - 93DFD03D24521C19001FCBAF, - 93DFD04024521C19001FCBAF, - 93DFD03824521C19001FCBAF /* ScriptEngine.cpp */, - 93DFD04324521C19001FCBAF /* ScriptEngine.h */, - 93DFD03624521C19001FCBAF, - ); - path = scripting; - sourceTree = ""; - }; - C6352B871F477032006CCEE3 /* actions */ = { - isa = PBXGroup; - children = ( - 66A10EA0257F1DE000DD651A /* BalloonPressAction.cpp */, - 66A10EA1257F1DE000DD651A /* BalloonPressAction.h */, - 66A10EA6257F1DF600DD651A /* BannerPlaceAction.cpp */, - 66A10EAE257F1DF700DD651A /* BannerPlaceAction.h */, - 66A10EB3257F1DF700DD651A /* BannerRemoveAction.cpp */, - 66A10EB9257F1DF700DD651A /* BannerRemoveAction.h */, - 66A10EBE257F1DF800DD651A /* BannerSetColourAction.cpp */, - 66A10EB6257F1DF700DD651A /* BannerSetColourAction.h */, - 66A10EAB257F1DF600DD651A /* BannerSetNameAction.cpp */, - 66A10EB4257F1DF700DD651A /* BannerSetNameAction.h */, - 66A10EB1257F1DF700DD651A /* BannerSetStyleAction.cpp */, - 66A10EBB257F1DF700DD651A /* BannerSetStyleAction.h */, - 66A10EB2257F1DF700DD651A /* ClearAction.cpp */, - 66A10EBA257F1DF700DD651A /* ClearAction.h */, - 66A10EB5257F1DF700DD651A /* ClimateSetAction.cpp */, - 66A10EB0257F1DF700DD651A /* ClimateSetAction.h */, - 66A10EB7257F1DF700DD651A /* CustomAction.cpp */, - 66A10EAF257F1DF700DD651A /* CustomAction.h */, - 66A10EAA257F1DF600DD651A /* FootpathAdditionPlaceAction.cpp */, - 66A10EBF257F1DF800DD651A /* FootpathAdditionPlaceAction.h */, - 66A10EB8257F1DF700DD651A /* FootpathAdditionRemoveAction.cpp */, - 66A10EA7257F1DF600DD651A /* FootpathAdditionRemoveAction.h */, - 66A10EBC257F1DF800DD651A /* FootpathPlaceAction.cpp */, - 66A10EAC257F1DF600DD651A /* FootpathPlaceAction.h */, - 66A10EA9257F1DF600DD651A /* FootpathPlaceFromTrackAction.cpp */, - 66A10EBD257F1DF800DD651A /* FootpathPlaceFromTrackAction.h */, - 66A10EAD257F1DF700DD651A /* FootpathRemoveAction.cpp */, - 66A10EA8257F1DF600DD651A /* FootpathRemoveAction.h */, - 932A211C22D73CFA00C57EDB /* GameAction.cpp */, - 932A20F522D73CF300C57EDB /* GameAction.h */, - 932A20CF22D73CEE00C57EDB /* GameActionCompat.cpp */, - 932A20D322D73CEF00C57EDB /* GameActionRegistration.cpp */, - 66A10F25257F1E1500DD651A /* GuestSetFlagsAction.cpp */, - 66A10F1D257F1E1400DD651A /* GuestSetFlagsAction.h */, - 66A10EEB257F1E1100DD651A /* GuestSetNameAction.cpp */, - 66A10EEA257F1E1100DD651A /* GuestSetNameAction.h */, - 66A10F47257F1E1700DD651A /* LandBuyRightsAction.cpp */, - 66A10F2F257F1E1600DD651A /* LandBuyRightsAction.h */, - 66A10F33257F1E1600DD651A /* LandLowerAction.cpp */, - 66A10EE3257F1E1100DD651A /* LandLowerAction.h */, - 66A10EF4257F1E1200DD651A /* LandRaiseAction.cpp */, - 66A10EFE257F1E1200DD651A /* LandRaiseAction.h */, - 66A10F15257F1E1400DD651A /* LandSetHeightAction.cpp */, - 66A10F03257F1E1300DD651A /* LandSetHeightAction.h */, - 66A10F3B257F1E1600DD651A /* LandSetRightsAction.cpp */, - 66A10F1E257F1E1400DD651A /* LandSetRightsAction.h */, - 66A10F23257F1E1500DD651A /* LandSmoothAction.cpp */, - 66A10F1B257F1E1400DD651A /* LandSmoothAction.h */, - 66A10F4B257F1E1700DD651A /* LargeSceneryPlaceAction.cpp */, - 66A10F32257F1E1600DD651A /* LargeSceneryPlaceAction.h */, - 66A10F42257F1E1700DD651A /* LargeSceneryRemoveAction.cpp */, - 66A10EEE257F1E1100DD651A /* LargeSceneryRemoveAction.h */, - 66A10EFA257F1E1200DD651A /* LargeScenerySetColourAction.cpp */, - 66A10F29257F1E1500DD651A /* LargeScenerySetColourAction.h */, - 66A10EFC257F1E1200DD651A /* LoadOrQuitAction.cpp */, - 66A10F16257F1E1400DD651A /* LoadOrQuitAction.h */, - 66A10F0F257F1E1300DD651A /* MazePlaceTrackAction.cpp */, - 66A10F20257F1E1500DD651A /* MazePlaceTrackAction.h */, - 66A10F43257F1E1700DD651A /* MazeSetTrackAction.cpp */, - 66A10F0B257F1E1300DD651A /* MazeSetTrackAction.h */, - 66A10F10257F1E1400DD651A /* NetworkModifyGroupAction.cpp */, - 66A10EF8257F1E1200DD651A /* NetworkModifyGroupAction.h */, - 66A10EF0257F1E1200DD651A /* ParkEntranceRemoveAction.cpp */, - 66A10EE0257F1E1000DD651A /* ParkEntranceRemoveAction.h */, - 66A10F2E257F1E1600DD651A /* ParkMarketingAction.cpp */, - 66A10F36257F1E1600DD651A /* ParkMarketingAction.h */, - 66A10F00257F1E1300DD651A /* ParkSetDateAction.cpp */, - 66A10EDF257F1E1000DD651A /* ParkSetDateAction.h */, - 66A10EFB257F1E1200DD651A /* ParkSetLoanAction.cpp */, - 66A10EF9257F1E1200DD651A /* ParkSetLoanAction.h */, - 66A10F0D257F1E1300DD651A /* ParkSetNameAction.cpp */, - 66A10F39257F1E1600DD651A /* ParkSetNameAction.h */, - 66A10EFD257F1E1200DD651A /* ParkSetParameterAction.cpp */, - 66A10F22257F1E1500DD651A /* ParkSetParameterAction.h */, - 66A10F2B257F1E1500DD651A /* ParkSetResearchFundingAction.cpp */, - 66A10F1A257F1E1400DD651A /* ParkSetResearchFundingAction.h */, - 66A10F19257F1E1400DD651A /* PauseToggleAction.cpp */, - 66A10EDE257F1E1000DD651A /* PauseToggleAction.h */, - 66A10F2C257F1E1500DD651A /* PeepPickupAction.cpp */, - 66A10F37257F1E1600DD651A /* PeepPickupAction.h */, - 66A10EF1257F1E1200DD651A /* PlaceParkEntranceAction.cpp */, - 66A10EDC257F1E1000DD651A /* PlaceParkEntranceAction.h */, - 66A10F28257F1E1500DD651A /* PlacePeepSpawnAction.cpp */, - 66A10F02257F1E1300DD651A /* PlacePeepSpawnAction.h */, - 66A10F4A257F1E1700DD651A /* PlayerKickAction.cpp */, - 66A10EF3257F1E1200DD651A /* PlayerKickAction.h */, - 66A10F12257F1E1400DD651A /* PlayerSetGroupAction.cpp */, - 66A10F13257F1E1400DD651A /* PlayerSetGroupAction.h */, - 66A10F09257F1E1300DD651A /* RideCreateAction.cpp */, - 66A10F1C257F1E1400DD651A /* RideCreateAction.h */, - 66A10F41257F1E1700DD651A /* RideDemolishAction.cpp */, - 66A10EE1257F1E1100DD651A /* RideDemolishAction.h */, - 66A10EFF257F1E1200DD651A /* RideEntranceExitPlaceAction.cpp */, - 66A10EF7257F1E1200DD651A /* RideEntranceExitPlaceAction.h */, - 66A10F38257F1E1600DD651A /* RideEntranceExitRemoveAction.cpp */, - 66A10F04257F1E1300DD651A /* RideEntranceExitRemoveAction.h */, - 66A10EE7257F1E1100DD651A /* RideSetAppearanceAction.cpp */, - 66A10EE4257F1E1100DD651A /* RideSetAppearanceAction.h */, - 66A10F0E257F1E1300DD651A /* RideSetColourSchemeAction.cpp */, - 66A10F46257F1E1700DD651A /* RideSetColourSchemeAction.h */, - 66A10F34257F1E1600DD651A /* RideSetNameAction.cpp */, - 66A10F3F257F1E1700DD651A /* RideSetNameAction.h */, - 66A10F05257F1E1300DD651A /* RideSetPriceAction.cpp */, - 66A10F35257F1E1600DD651A /* RideSetPriceAction.h */, - 66A10F0A257F1E1300DD651A /* RideSetSettingAction.cpp */, - 66A10F3C257F1E1600DD651A /* RideSetSettingAction.h */, - 66A10F49257F1E1700DD651A /* RideSetStatusAction.cpp */, - 66A10EED257F1E1100DD651A /* RideSetStatusAction.h */, - 66A10EF6257F1E1200DD651A /* RideSetVehicleAction.cpp */, - 66A10F11257F1E1400DD651A /* RideSetVehicleAction.h */, - 66A10F44257F1E1700DD651A /* ScenarioSetSettingAction.cpp */, - 66A10F48257F1E1700DD651A /* ScenarioSetSettingAction.h */, - 66A10EE9257F1E1100DD651A /* SetCheatAction.cpp */, - 66A10F27257F1E1500DD651A /* SetCheatAction.h */, - 66A10F3A257F1E1600DD651A /* SetParkEntranceFeeAction.cpp */, - 66A10EEC257F1E1100DD651A /* SetParkEntranceFeeAction.h */, - 66A10F45257F1E1700DD651A /* SignSetNameAction.cpp */, - 66A10F18257F1E1400DD651A /* SignSetNameAction.h */, - 66A10F40257F1E1700DD651A /* SignSetStyleAction.cpp */, - 66A10F26257F1E1500DD651A /* SignSetStyleAction.h */, - 66A10F3E257F1E1700DD651A /* SmallSceneryPlaceAction.cpp */, - 66A10F17257F1E1400DD651A /* SmallSceneryPlaceAction.h */, - 66A10F06257F1E1300DD651A /* SmallSceneryRemoveAction.cpp */, - 66A10EE6257F1E1100DD651A /* SmallSceneryRemoveAction.h */, - 66A10F31257F1E1600DD651A /* SmallScenerySetColourAction.cpp */, - 66A10EEF257F1E1200DD651A /* SmallScenerySetColourAction.h */, - 66A10F2D257F1E1500DD651A /* StaffFireAction.cpp */, - 66A10F2A257F1E1500DD651A /* StaffFireAction.h */, - 66A10F0C257F1E1300DD651A /* StaffHireNewAction.cpp */, - 66A10F21257F1E1500DD651A /* StaffHireNewAction.h */, - 66A10F01257F1E1300DD651A /* StaffSetColourAction.cpp */, - 66A10F08257F1E1300DD651A /* StaffSetColourAction.h */, - 66A10EE2257F1E1100DD651A /* StaffSetCostumeAction.cpp */, - 66A10F1F257F1E1500DD651A /* StaffSetCostumeAction.h */, - 66A10EE8257F1E1100DD651A /* StaffSetNameAction.cpp */, - 66A10EDD257F1E1000DD651A /* StaffSetNameAction.h */, - 66A10F24257F1E1500DD651A /* StaffSetOrdersAction.cpp */, - 66A10F07257F1E1300DD651A /* StaffSetOrdersAction.h */, - 66A10F30257F1E1600DD651A /* StaffSetPatrolAreaAction.cpp */, - 66A10F14257F1E1400DD651A /* StaffSetPatrolAreaAction.h */, - 66A10EE5257F1E1100DD651A /* SurfaceSetStyleAction.cpp */, - 66A10EF2257F1E1200DD651A /* SurfaceSetStyleAction.h */, - 66A10F3D257F1E1700DD651A /* TileModifyAction.cpp */, - 66A10EF5257F1E1200DD651A /* TileModifyAction.h */, - 4CC5258123A19C2800D4366D /* TrackDesignAction.cpp */, - 4CC5258323A19C2E00D4366D /* TrackDesignAction.h */, - 66A10FCA257F1E2F00DD651A /* TrackPlaceAction.cpp */, - 66A10FBE257F1E2D00DD651A /* TrackPlaceAction.h */, - 66A10FC6257F1E2E00DD651A /* TrackRemoveAction.cpp */, - 66A10FC1257F1E2D00DD651A /* TrackRemoveAction.h */, - 66A10FC2257F1E2E00DD651A /* TrackSetBrakeSpeedAction.cpp */, - 66A10FCD257F1E2F00DD651A /* TrackSetBrakeSpeedAction.h */, - 66A10FC9257F1E2F00DD651A /* WallPlaceAction.cpp */, - 66A10FC0257F1E2D00DD651A /* WallPlaceAction.h */, - 66A10FCE257F1E2F00DD651A /* WallRemoveAction.cpp */, - 66A10FC4257F1E2E00DD651A /* WallRemoveAction.h */, - 66A10FCF257F1E3000DD651A /* WallSetColourAction.cpp */, - 66A10FCB257F1E2F00DD651A /* WallSetColourAction.h */, - 66A10FCC257F1E2F00DD651A /* WaterLowerAction.cpp */, - 66A10FC5257F1E2E00DD651A /* WaterLowerAction.h */, - 66A10FBF257F1E2D00DD651A /* WaterRaiseAction.cpp */, - 66A10FC3257F1E2E00DD651A /* WaterRaiseAction.h */, - 66A10FC7257F1E2E00DD651A /* WaterSetHeightAction.cpp */, - 66A10FC8257F1E2F00DD651A /* WaterSetHeightAction.h */, - 76CE81CEAF7F4538976F7C4C /* ChangeMapSizeAction.cpp */, - C49050C073DB4CB980E1EC5A /* ChangeMapSizeAction.h */, - ); - path = actions; - sourceTree = ""; - }; - C68313CF1FDB4F4C006DB3D8 /* interface */ = { - isa = PBXGroup; - children = ( - C68313D01FDB4F4C006DB3D8 /* Dropdown.h */, - C68313D11FDB4F4C006DB3D8 /* Graph.cpp */, - C68313D21FDB4F4C006DB3D8 /* Graph.h */, - 4C3B4234205914F7000C5BB7 /* InGameConsole.cpp */, - 4C3B4235205914F7000C5BB7 /* InGameConsole.h */, - C68313D31FDB4F4C006DB3D8 /* LandTool.cpp */, - C68313D41FDB4F4C006DB3D8 /* LandTool.h */, - 933CBDB220CB1ACD00134678 /* Theme.cpp */, - 933CBDB320CB1ACD00134678 /* Theme.h */, - C67B28142002D67900109C93 /* Viewport.h */, - 933CBDBC20CB1BA900134678 /* ViewportInteraction.cpp */, - 933CBDB120CB1ACC00134678 /* Widget.cpp */, - C67B28122002D67900109C93 /* Widget.h */, - 933CBDBE20CB1BCA00134678 /* Window.cpp */, - C67B28132002D67900109C93 /* Window.h */, - ); - path = interface; - sourceTree = ""; - }; - C688783C202893590084B384 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C688783F202893600084B384 /* Cocoa.framework */, - C688783D202893590084B384 /* Foundation.framework */, - 6691254625FD2C1300B038E1 /* libbrotlicommon.1.dylib */, - 6691254125FD2C1300B038E1 /* libbrotlidec.1.dylib */, - 6691254825FD2C1300B038E1 /* libbrotlienc.1.dylib */, - 6691254525FD2C1300B038E1 /* libbz2.1.0.dylib */, - 669125A125FD2C7C00B038E1 /* libcrypto.1.1.dylib */, - 6691254925FD2C1300B038E1 /* libdiscord-rpc.dylib */, - 6691254225FD2C1300B038E1 /* libduktape.2.dylib */, - 6691254F25FD2C1400B038E1 /* libfreetype.6.dylib */, - 6691254725FD2C1300B038E1 /* libicudata.67.dylib */, - 6691254425FD2C1300B038E1 /* libicui18n.67.dylib */, - 6691254A25FD2C1300B038E1 /* libicuio.67.dylib */, - 6691255125FD2C1400B038E1 /* libicutu.67.dylib */, - 6691254025FD2C1300B038E1 /* libicuuc.67.dylib */, - 6691254B25FD2C1400B038E1 /* libpng16.16.dylib */, - 669125A625FD2CBF00B038E1 /* libSDL2-2.0.dylib */, - 6691254D25FD2C1400B038E1 /* libspeexdsp.1.dylib */, - 6691254E25FD2C1400B038E1 /* libssl.1.1.dylib */, - 6691255025FD2C1400B038E1 /* libz.1.dylib */, - 6691255225FD2C1400B038E1 /* libzip.5.dylib */, - ); - name = Frameworks; - sourceTree = ""; - }; - D41B72431C21015A0080A7B9 /* Sources */ = { - isa = PBXGroup; - children = ( - 4C25595B244A32A800CE7E45 /* thirdparty */, - F76C85801EC4E82600FA49E2 /* openrct2-ui */, - F76C857C1EC4E80E00FA49E2 /* openrct2-cli */, - F76C83551EC4E7CC00FA49E2 /* libopenrct2 */, - ); - name = Sources; - path = src/openrct2; - sourceTree = ""; - }; - D41B73ED1C21017D0080A7B9 /* Libraries */ = { - isa = PBXGroup; - children = ( - D4EC48811C2634870024B507 /* include */, - D4EC48C31C2634870024B507 /* lib */, - D4EC48CE1C26348E0024B507 /* system */, - ); - name = Libraries; - path = libxc; - sourceTree = ""; - }; - D497D06F1C20FD52002BF46A = { - isa = PBXGroup; - children = ( - 9391535A22D74359008E0780 /* OpenRCT2.entitlements */, - 4CF67196206B7E720034ADDD /* object */, - D41B72431C21015A0080A7B9 /* Sources */, - D497D07A1C20FD52002BF46A /* Resources */, - D41B73ED1C21017D0080A7B9 /* Libraries */, - D497D0791C20FD52002BF46A /* Products */, - C688783C202893590084B384 /* Frameworks */, - ); - sourceTree = ""; - usesTabs = 0; - }; - D497D0791C20FD52002BF46A /* Products */ = { - isa = PBXGroup; - children = ( - D497D0781C20FD52002BF46A /* OpenRCT2.app */, - F76C809A1EC4D9FA00FA49E2 /* libopenrct2.a */, - F7D774841EC66CD700BE6EBC /* OpenRCT2-cli */, - ); - name = Products; - sourceTree = ""; - }; - D497D07A1C20FD52002BF46A /* Resources */ = { - isa = PBXGroup; - children = ( - 631D7A3525F590A100EA2B45 /* openrct2.icns */, - F79F428E1F3260F1009E42F8 /* changelog.txt */, - D4895D321C23EFDD000CD788 /* Info.plist */, - D4C1EDD01C266A0B00F71B63 /* data */, - ); - name = Resources; - path = OpenRCT2; - sourceTree = ""; - }; - D4C1EDD01C266A0B00F71B63 /* data */ = { - isa = PBXGroup; - children = ( - D4EC48E31C2637710024B507 /* g2.dat */, - D4EC48E41C2637710024B507 /* language */, - D43407E11D0E14CE00C2B3D4 /* shaders */, - D4EC48E51C2637710024B507 /* sequence */, - ); - path = data; - sourceTree = ""; - }; - D4EC48811C2634870024B507 /* include */ = { - isa = PBXGroup; - children = ( - 666B99C425FD29C80081509F /* brotli */, - 666B99BC25FD29C80081509F /* bzlib.h */, - 666B99BA25FD29C70081509F /* discord_register.h */, - 666B99B825FD29C70081509F /* discord_rpc.h */, - 666B99BE25FD29C80081509F /* duk_config.h */, - 666B99B925FD29C70081509F /* duktape.h */, - 666B99C125FD29C80081509F /* freetype */, - 666B99B225FD29C70081509F /* ft2build.h */, - 666B99BD25FD29C80081509F /* libpng16 */, - 666B99C525FD29C80081509F /* nlohmann */, - 666B99B425FD29C70081509F /* openssl */, - 666B99C225FD29C80081509F /* png.h */, - 666B99C025FD29C80081509F /* pngconf.h */, - 666B99B525FD29C70081509F /* pnglibconf.h */, - 666B99BB25FD29C70081509F /* rapidjson */, - 666B99C325FD29C80081509F /* SDL2 */, - 666B99B025FD29C70081509F /* speex */, - 666B99B125FD29C70081509F /* unicode */, - 666B99B325FD29C70081509F /* zconf.h */, - 666B99B725FD29C70081509F /* zip.h */, - 666B99BF25FD29C80081509F /* zipconf.h */, - 666B99B625FD29C70081509F /* zlib.h */, - ); - path = include; - sourceTree = ""; - }; - D4EC48C31C2634870024B507 /* lib */ = { - isa = PBXGroup; - children = ( - ); - path = lib; - sourceTree = ""; - }; - D4EC48CE1C26348E0024B507 /* system */ = { - isa = PBXGroup; - children = ( - D41B73EE1C2101890080A7B9 /* libcurl.tbd */, - D41B741C1C210A7A0080A7B9 /* libiconv.tbd */, - D47304D41C4FF8250015C0EA /* libz.tbd */, - ); - name = system; - sourceTree = ""; - }; - F76C83551EC4E7CC00FA49E2 /* libopenrct2 */ = { - isa = PBXGroup; - children = ( - C6352B871F477032006CCEE3 /* actions */, - F76C83561EC4E7CC00FA49E2 /* audio */, - F76C83621EC4E7CC00FA49E2 /* cmdline */, - F76C836D1EC4E7CC00FA49E2 /* config */, - F76C83781EC4E7CC00FA49E2 /* core */, - F76C839D1EC4E7CC00FA49E2 /* drawing */, - F76C83BB1EC4E7CC00FA49E2 /* interface */, - F76C83D71EC4E7CC00FA49E2 /* localisation */, - F76C83EA1EC4E7CC00FA49E2 /* management */, - F76C83F51EC4E7CC00FA49E2 /* network */, - F76C84111EC4E7CC00FA49E2 /* object */, - F76C843A1EC4E7CC00FA49E2 /* paint */, - F76C84531EC4E7CC00FA49E2 /* peep */, - F76C84591EC4E7CC00FA49E2 /* platform */, - F76C84661EC4E7CC00FA49E2 /* rct1 */, - F76C84761EC4E7CC00FA49E2 /* rct2 */, - F76C846C1EC4E7CC00FA49E2 /* rct12 */, - F76C84831EC4E7CC00FA49E2 /* ride */, - F76C84F31EC4E7CD00FA49E2 /* scenario */, - 93DFD03024521C19001FCBAF /* scripting */, - F76C84FB1EC4E7CD00FA49E2 /* title */, - F76C85041EC4E7CD00FA49E2 /* ui */, - F76C85061EC4E7CD00FA49E2 /* util */, - F76C850D1EC4E7CD00FA49E2 /* windows */, - F76C855B1EC4E7CD00FA49E2 /* world */, - 4C6A66901FE14C9500694CB6 /* Cheats.cpp */, - 4C6A66911FE14C9500694CB6 /* Cheats.h */, - 4CC4B8E21FE00C4100660D62 /* CmdlineSprite.cpp */, - 4CC4B8E31FE00C4200660D62 /* CmdlineSprite.h */, - F76C836C1EC4E7CC00FA49E2 /* common.h */, - F76C83761EC4E7CC00FA49E2 /* Context.cpp */, - F76C83771EC4E7CC00FA49E2 /* Context.h */, - 4C5DFF401FAC69D200CB093A /* Date.cpp */, - 4C5DFF411FAC69D200CB093A /* Date.h */, - 4CC4B8E51FE00C4E00660D62 /* Diagnostic.cpp */, - 4CC4B8E61FE00C4E00660D62 /* Diagnostic.h */, - F76C83B11EC4E7CC00FA49E2 /* Editor.cpp */, - F76C83B21EC4E7CC00FA49E2 /* Editor.h */, - C62D83881FD36D6E008C04F1 /* EditorObjectSelectionSession.cpp */, - C62D83891FD36D6F008C04F1 /* EditorObjectSelectionSession.h */, - F76C83B31EC4E7CC00FA49E2 /* FileClassifier.cpp */, - F76C83B41EC4E7CC00FA49E2 /* FileClassifier.h */, - 4CE4623F1FD0710E0001CD98 /* Game.cpp */, - 4CE462401FD0710E0001CD98 /* Game.h */, - 93DE974E209C3C0F00FB1CC8 /* GameState.cpp */, - 93DE974F209C3C0F00FB1CC8 /* GameState.h */, - C9C630B52235A22C009AD16E /* GameStateSnapshots.cpp */, - C9C630B42235A22C009AD16E /* GameStateSnapshots.h */, - C68313C51FDB4EBA006DB3D8 /* input.cpp */, - 4CC4B8E81FE00C5D00660D62 /* Input.cpp */, - F76C83BA1EC4E7CC00FA49E2 /* input.h */, - 4CC4B8E91FE00C5D00660D62 /* Input.h */, - 4CC4B8EA1FE00C5D00660D62 /* Intro.cpp */, - 4CC4B8EB1FE00C5D00660D62 /* Intro.h */, - F76C84381EC4E7CC00FA49E2 /* OpenRCT2.cpp */, - F76C84391EC4E7CC00FA49E2 /* OpenRCT2.h */, - F76C84511EC4E7CC00FA49E2 /* ParkImporter.cpp */, - F76C84521EC4E7CC00FA49E2 /* ParkImporter.h */, - F76C84641EC4E7CC00FA49E2 /* PlatformEnvironment.cpp */, - F76C84651EC4E7CC00FA49E2 /* PlatformEnvironment.h */, - 4C358E5021C445F700ADE6BC /* ReplayManager.cpp */, - 4C358E5121C445F700ADE6BC /* ReplayManager.h */, - F76C84FA1EC4E7CD00FA49E2 /* sprites.h */, - 01C6F0C022FD519E0057E2F7 /* TrackImporter.cpp */, - 01C6F0C122FD519E0057E2F7 /* TrackImporter.h */, - F76C850B1EC4E7CD00FA49E2 /* Version.cpp */, - F76C850C1EC4E7CD00FA49E2 /* Version.h */, - ); - name = libopenrct2; - sourceTree = ""; - }; - F76C83561EC4E7CC00FA49E2 /* audio */ = { - isa = PBXGroup; - children = ( - F76C83571EC4E7CC00FA49E2 /* Audio.cpp */, - F76C83581EC4E7CC00FA49E2 /* audio.h */, - F76C83591EC4E7CC00FA49E2 /* AudioChannel.h */, - F76C835A1EC4E7CC00FA49E2 /* AudioContext.h */, - F76C835B1EC4E7CC00FA49E2 /* AudioMixer.cpp */, - F76C835C1EC4E7CC00FA49E2 /* AudioMixer.h */, - F76C835D1EC4E7CC00FA49E2 /* AudioSource.h */, - F775F5361EE3724F001F00E7 /* DummyAudioContext.cpp */, - F76C835E1EC4E7CC00FA49E2 /* NullAudioSource.cpp */, - ); - path = audio; - sourceTree = ""; - }; - F76C83621EC4E7CC00FA49E2 /* cmdline */ = { - isa = PBXGroup; - children = ( - D48AFDB61EF78DBF0081C644 /* BenchGfxCommmands.cpp */, - 4C724B2121F0AD790012ADD0 /* BenchSpriteSort.cpp */, - 9329D51F240C17C60054301C /* BenchUpdate.cpp */, - F76C83631EC4E7CC00FA49E2 /* CommandLine.cpp */, - F76C83641EC4E7CC00FA49E2 /* CommandLine.hpp */, - F76C83651EC4E7CC00FA49E2 /* ConvertCommand.cpp */, - F76C83661EC4E7CC00FA49E2 /* RootCommands.cpp */, - F76C83671EC4E7CC00FA49E2 /* ScreenshotCommands.cpp */, - 4CB1375521C2E9F80029FCDA /* SimulateCommands.cpp */, - F76C83681EC4E7CC00FA49E2 /* SpriteCommands.cpp */, - F76C83691EC4E7CC00FA49E2 /* UriHandler.cpp */, - ); - path = cmdline; - sourceTree = ""; - }; - F76C836D1EC4E7CC00FA49E2 /* config */ = { - isa = PBXGroup; - children = ( - F76C836E1EC4E7CC00FA49E2 /* Config.cpp */, - F76C836F1EC4E7CC00FA49E2 /* Config.h */, - F76C83701EC4E7CC00FA49E2 /* ConfigEnum.hpp */, - F76C83711EC4E7CC00FA49E2 /* IniReader.cpp */, - F76C83721EC4E7CC00FA49E2 /* IniReader.hpp */, - F76C83731EC4E7CC00FA49E2 /* IniWriter.cpp */, - F76C83741EC4E7CC00FA49E2 /* IniWriter.hpp */, - ); - path = config; - sourceTree = ""; - }; - F76C83781EC4E7CC00FA49E2 /* core */ = { - isa = PBXGroup; - children = ( - 4CA23D62263C91D700077AA1 /* ChecksumStream.cpp */, - 4CA23D63263C91D700077AA1 /* ChecksumStream.h */, - 2A5354EA22099C7200A5440F /* CircularBuffer.h */, - F76C83791EC4E7CC00FA49E2 /* Collections.hpp */, - F76C837A1EC4E7CC00FA49E2 /* Console.cpp */, - F76C837B1EC4E7CC00FA49E2 /* Console.hpp */, - 9344BEF720C1E6180047D165 /* Crypt.h */, - 9344BEF820C1E6180047D165 /* Crypt.OpenSSL.cpp */, - C6352B811F477022006CCEE3 /* DataSerialiser.h */, - 2ADE2F22224418B1002598AF /* DataSerialiserTag.h */, - C6352B821F477022006CCEE3 /* DataSerialiserTraits.h */, - F76C837C1EC4E7CC00FA49E2 /* Diagnostics.cpp */, - F76C837D1EC4E7CC00FA49E2 /* Diagnostics.hpp */, - C6352B831F477022006CCEE3 /* Endianness.h */, - F76C837F1EC4E7CC00FA49E2 /* File.cpp */, - F76C83801EC4E7CC00FA49E2 /* File.h */, - 2ADE2F26224418B2002598AF /* FileIndex.hpp */, - F76C83811EC4E7CC00FA49E2 /* FileScanner.cpp */, - F76C83821EC4E7CC00FA49E2 /* FileScanner.h */, - 4C8BB67825533D4C005C8830 /* FileStream.cpp */, - 4C8BB67725533D4B005C8830 /* FileStream.h */, - 4C8BB67625533D4B005C8830 /* FileSystem.hpp */, - 93DFD02D24521BA0001FCBAF /* FileWatcher.cpp */, - 93DFD02C24521B9F001FCBAF /* FileWatcher.h */, - F76C83841EC4E7CC00FA49E2 /* Guard.cpp */, - F76C83851EC4E7CC00FA49E2 /* Guard.hpp */, - 4C8A6FF223EB5326001A8255 /* Http.cURL.cpp */, - 4C8A6FF123EB5325001A8255 /* Http.h */, - 93CBA4C220A7502E00867D56 /* Imaging.cpp */, - 93CBA4C120A7502D00867D56 /* Imaging.h */, - F76C83861EC4E7CC00FA49E2 /* IStream.cpp */, - F76C83871EC4E7CC00FA49E2 /* IStream.hpp */, - 4C8BB67B25533D59005C8830 /* JobPool.cpp */, - 4C8BB67A25533D58005C8830 /* JobPool.h */, - F76C83881EC4E7CC00FA49E2 /* Json.cpp */, - F76C83891EC4E7CC00FA49E2 /* Json.hpp */, - 93378D00252B4F550077D2D8 /* JsonFwd.hpp */, - F76C838B1EC4E7CC00FA49E2 /* Memory.hpp */, - F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */, - F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */, - 2ADE2F24224418B2002598AF /* Meta.hpp */, - 2ADE2F23224418B1002598AF /* Numerics.hpp */, - F76C838F1EC4E7CC00FA49E2 /* Path.cpp */, - F76C83901EC4E7CC00FA49E2 /* Path.hpp */, - 2ADE2F21224418B1002598AF /* Random.hpp */, - 4CA39E502513F8A00094066B /* RTL.FriBidi.cpp */, - 4CA39E4F2513F8A00094066B /* RTL.h */, - 4CA39E4E2513F8A00094066B /* RTL.ICU.cpp */, - F76C83921EC4E7CC00FA49E2 /* String.cpp */, - F76C83931EC4E7CC00FA49E2 /* String.hpp */, - 4C8BB67D25533D64005C8830 /* StringBuilder.cpp */, - 4C8BB68025533D64005C8830 /* StringBuilder.h */, - 4C8BB67E25533D64005C8830 /* StringReader.cpp */, - 4C8BB67F25533D64005C8830 /* StringReader.h */, - F76C83991EC4E7CC00FA49E2 /* Zip.cpp */, - F76C839A1EC4E7CC00FA49E2 /* Zip.h */, - BA2317BF6FB54E328DEB7055 /* EnumMap.hpp */, - F4D523B8782E4C458AF1490D /* GroupVector.hpp */, - F28A181D311D4E078FDB090C /* ZipStream.hpp */, - 4248E4E4394842D4AF6119DA /* Crypt.OpenRCT2.cpp */, - F9061C16C67A45D7915FA229 /* OrcaStream.hpp */, - ); - path = core; - sourceTree = ""; - }; - F76C839D1EC4E7CC00FA49E2 /* drawing */ = { - isa = PBXGroup; - children = ( - F7C44AF62030E74B007E099F /* AVX2Drawing.cpp */, - 4C7B53D520002CA400A52E21 /* Drawing.cpp */, - F76C839F1EC4E7CC00FA49E2 /* drawing.h */, - 6341F4E02400AA0F0052902B /* Drawing.Sprite.BMP.cpp */, - 93F76EEB20BFF6F900D4512C /* Drawing.Sprite.cpp */, - 6341F4DF2400AA0E0052902B /* Drawing.Sprite.RLE.cpp */, - 93F76EEC20BFF6F900D4512C /* Drawing.String.cpp */, - 4C7B53D620002CA400A52E21 /* Font.cpp */, - 4C7B53CB1FFF995100A52E21 /* Font.h */, - F76C83A31EC4E7CC00FA49E2 /* IDrawingContext.h */, - F76C83A41EC4E7CC00FA49E2 /* IDrawingEngine.h */, - F76C83A51EC4E7CC00FA49E2 /* Image.cpp */, - 93CBA4C720A7504400867D56 /* ImageImporter.cpp */, - 93CBA4C820A7504500867D56 /* ImageImporter.h */, - 4C7B53D720002CA400A52E21 /* LightFX.cpp */, - F76C83A71EC4E7CC00FA49E2 /* lightfx.h */, - 4C7B53CD200029CE00A52E21 /* Line.cpp */, - F76C83A91EC4E7CC00FA49E2 /* NewDrawing.cpp */, - F76C83AA1EC4E7CC00FA49E2 /* NewDrawing.h */, - F76C83AB1EC4E7CC00FA49E2 /* Weather.cpp */, - F76C83AC1EC4E7CC00FA49E2 /* Weather.h */, - 4C7B53CF200029D900A52E21 /* Rect.cpp */, - 4C7B53D0200029D900A52E21 /* ScrollingText.cpp */, - 4C6A66BB1FED04EE00694CB6 /* SSE41Drawing.cpp */, - C651A8D71F30204300443BCA /* Text.cpp */, - C651A8D81F30204300443BCA /* Text.h */, - 4C7B53D820002CA400A52E21 /* TTF.cpp */, - 4CB832AA1EFFB8D100B88761 /* ttf.h */, - 4C7B54682007BF2E00A52E21 /* TTFSDLPort.cpp */, - 4C8B426E1EEB1ABD00F015CA /* X8DrawingEngine.cpp */, - 4C8B426F1EEB1ABD00F015CA /* X8DrawingEngine.h */, - ); - path = drawing; - sourceTree = ""; - }; - F76C83BB1EC4E7CC00FA49E2 /* interface */ = { - isa = PBXGroup; - children = ( - 4C7B53DD200143C200A52E21 /* Chat.cpp */, - 4C7B53DE200143C200A52E21 /* Chat.h */, - 4C7B53DF200143C200A52E21 /* Colour.cpp */, - 4C7B53E0200143C200A52E21 /* Colour.h */, - 93FB272024ED3601008241C9 /* Cursors.cpp */, - 4C7B53E3200143C200A52E21 /* Cursors.h */, - 4C7B53E4200143C200A52E21 /* FontFamilies.cpp */, - 4C7B53E5200143C200A52E21 /* FontFamilies.h */, - 4C7B53E6200143C200A52E21 /* Fonts.cpp */, - 4C7B53E7200143C200A52E21 /* Fonts.h */, - 93F76EEF20BFF71700D4512C /* InteractiveConsole.cpp */, - 939A35A120C12FFD00630B3F /* InteractiveConsole.h */, - 4C7B53E8200143C200A52E21 /* Screenshot.cpp */, - 4C7B53E9200143C200A52E21 /* Screenshot.h */, - 4C3B423720591513000C5BB7 /* StdInOutConsole.cpp */, - 4C7B53EC200143C200A52E21 /* Viewport.cpp */, - 4C7B53ED200143C200A52E21 /* Viewport.h */, - 4C7B53F0200143C200A52E21 /* Widget.h */, - 01DDFE6422FD608500221318 /* Window_internal.cpp */, - C67B28182002D7F200109C93 /* Window_internal.h */, - 4C7B53F1200143C200A52E21 /* Window.cpp */, - 4C7B53F2200143C200A52E21 /* Window.h */, - 4C8BB68425533DB9005C8830 /* ZoomLevel.cpp */, - 4C8BB68325533DB9005C8830 /* ZoomLevel.h */, - ); - path = interface; - sourceTree = ""; - }; - F76C83D71EC4E7CC00FA49E2 /* localisation */ = { - isa = PBXGroup; - children = ( - 4C7B53C61FFF94F900A52E21 /* ConversionTables.cpp */, - 2ADE2F2D224418E7002598AF /* ConversionTables.h */, - 4C7B53AA1FFF935B00A52E21 /* Convert.cpp */, - 4C7B53AB1FFF935B00A52E21 /* Currency.cpp */, - 4C7B53AC1FFF935B00A52E21 /* Currency.h */, - 4C7B53AE1FFF935B00A52E21 /* Date.h */, - 4C7B53AF1FFF935B00A52E21 /* FormatCodes.cpp */, - 4C7B53B01FFF935B00A52E21 /* FormatCodes.h */, - 93AE2388252F948A00CD03C3 /* Formatter.cpp */, - 93AE2387252F948A00CD03C3 /* Formatter.h */, - 93B4DC1325487CDE008D63FF /* Formatting.cpp */, - 93B4DC1425487CDE008D63FF /* Formatting.h */, - 4C7B53B11FFF935B00A52E21 /* Language.cpp */, - 4C7B53C91FFF991000A52E21 /* Language.h */, - 4C7B53B31FFF935B00A52E21 /* LanguagePack.cpp */, - 4C7B53B41FFF935B00A52E21 /* LanguagePack.h */, - 4C7B53B51FFF935B00A52E21 /* Localisation.cpp */, - 93F76EF120BFF74200D4512C /* Localisation.Date.cpp */, - 4C7B53B61FFF935B00A52E21 /* Localisation.h */, - 933F2CB620935653001B33FD /* LocalisationService.cpp */, - 933F2CBA20935668001B33FD /* LocalisationService.h */, - 4C7B53B71FFF935B00A52E21 /* RealNames.cpp */, - 4C7B53B81FFF935B00A52E21 /* StringIds.h */, - 4C7B53BB1FFF935B00A52E21 /* UTF8.cpp */, - ); - path = localisation; - sourceTree = ""; - }; - F76C83EA1EC4E7CC00FA49E2 /* management */ = { - isa = PBXGroup; - children = ( - 4C93F1B01F8E185600A9330D /* Award.cpp */, - 4C93F1B11F8E185600A9330D /* Award.h */, - 4C93F1B21F8E185600A9330D /* Finance.cpp */, - 4C93F1B31F8E185600A9330D /* Finance.h */, - 4C93F1B41F8E185600A9330D /* Marketing.cpp */, - 4C93F1B51F8E185600A9330D /* Marketing.h */, - 4C93F1B61F8E185600A9330D /* NewsItem.cpp */, - 4C93F1B71F8E185600A9330D /* NewsItem.h */, - 4C93F1B81F8E185600A9330D /* Research.cpp */, - 4C93F1B91F8E185600A9330D /* Research.h */, - ); - path = management; - sourceTree = ""; - }; - F76C83F51EC4E7CC00FA49E2 /* network */ = { - isa = PBXGroup; - children = ( - 2ADE2F3022441905002598AF /* DiscordService.cpp */, - 2ADE2F2F22441905002598AF /* DiscordService.h */, - F76C83F91EC4E7CC00FA49E2 /* network.h */, - F76C83FA1EC4E7CC00FA49E2 /* NetworkAction.cpp */, - F76C83FB1EC4E7CC00FA49E2 /* NetworkAction.h */, - 936F412524CE030F00E07BCF /* NetworkBase.cpp */, - 936F412724CE030F00E07BCF /* NetworkBase.h */, - 936F412624CE030F00E07BCF /* NetworkClient.cpp */, - 936F412424CE030E00E07BCF /* NetworkClient.h */, - F76C83FC1EC4E7CC00FA49E2 /* NetworkConnection.cpp */, - F76C83FD1EC4E7CC00FA49E2 /* NetworkConnection.h */, - F76C83FE1EC4E7CC00FA49E2 /* NetworkGroup.cpp */, - F76C83FF1EC4E7CC00FA49E2 /* NetworkGroup.h */, - F76C84001EC4E7CC00FA49E2 /* NetworkKey.cpp */, - F76C84011EC4E7CC00FA49E2 /* NetworkKey.h */, - F76C84021EC4E7CC00FA49E2 /* NetworkPacket.cpp */, - F76C84031EC4E7CC00FA49E2 /* NetworkPacket.h */, - F76C84041EC4E7CC00FA49E2 /* NetworkPlayer.cpp */, - F76C84051EC4E7CC00FA49E2 /* NetworkPlayer.h */, - F76C84061EC4E7CC00FA49E2 /* NetworkServerAdvertiser.cpp */, - F76C84071EC4E7CC00FA49E2 /* NetworkServerAdvertiser.h */, - F76C84081EC4E7CC00FA49E2 /* NetworkTypes.h */, - F76C84091EC4E7CC00FA49E2 /* NetworkUser.cpp */, - F76C840A1EC4E7CC00FA49E2 /* NetworkUser.h */, - F76C840B1EC4E7CC00FA49E2 /* ServerList.cpp */, - F76C840C1EC4E7CC00FA49E2 /* ServerList.h */, - F76C840D1EC4E7CC00FA49E2 /* Socket.cpp */, - F76C840E1EC4E7CC00FA49E2 /* Socket.h */, - ); - path = network; - sourceTree = ""; - }; - F76C84111EC4E7CC00FA49E2 /* object */ = { - isa = PBXGroup; - children = ( - F76C84121EC4E7CC00FA49E2 /* BannerObject.cpp */, - F76C84131EC4E7CC00FA49E2 /* BannerObject.h */, - F7B2048B2024E7800000AD7E /* DefaultObjects.cpp */, - F7B2048D2024E8A90000AD7E /* DefaultObjects.h */, - F76C84141EC4E7CC00FA49E2 /* EntranceObject.cpp */, - F76C84151EC4E7CC00FA49E2 /* EntranceObject.h */, - F76C84161EC4E7CC00FA49E2 /* FootpathItemObject.cpp */, - F76C84171EC4E7CC00FA49E2 /* FootpathItemObject.h */, - F76C84181EC4E7CC00FA49E2 /* FootpathObject.cpp */, - F76C84191EC4E7CC00FA49E2 /* FootpathObject.h */, - 4C976BC2263976F0002DEBD5 /* FootpathRailingsObject.cpp */, - 4C976BC3263976F0002DEBD5 /* FootpathRailingsObject.h */, - 4C976BC1263976F0002DEBD5 /* FootpathSurfaceObject.cpp */, - 4C976BC4263976F0002DEBD5 /* FootpathSurfaceObject.h */, - F76C841A1EC4E7CC00FA49E2 /* ImageTable.cpp */, - F76C841B1EC4E7CC00FA49E2 /* ImageTable.h */, - F76C841C1EC4E7CC00FA49E2 /* LargeSceneryObject.cpp */, - F76C841D1EC4E7CC00FA49E2 /* LargeSceneryObject.h */, - 4C91FD5D25AE476700CA5DA4 /* MusicObject.cpp */, - 4C91FD5E25AE476700CA5DA4 /* MusicObject.h */, - F76C841E1EC4E7CC00FA49E2 /* Object.cpp */, - F76C841F1EC4E7CC00FA49E2 /* Object.h */, - F76C84201EC4E7CC00FA49E2 /* ObjectFactory.cpp */, - F76C84211EC4E7CC00FA49E2 /* ObjectFactory.h */, - 4C7B53A21FFC15ED00A52E21 /* ObjectLimits.h */, - 4C7B53A31FFC180400A52E21 /* ObjectList.cpp */, - 4C7B53A41FFC180400A52E21 /* ObjectList.h */, - F76C84221EC4E7CC00FA49E2 /* ObjectManager.cpp */, - F76C84231EC4E7CC00FA49E2 /* ObjectManager.h */, - F76C84241EC4E7CC00FA49E2 /* ObjectRepository.cpp */, - F76C84251EC4E7CC00FA49E2 /* ObjectRepository.h */, - F76C84261EC4E7CC00FA49E2 /* RideObject.cpp */, - F76C84271EC4E7CC00FA49E2 /* RideObject.h */, - F76C84281EC4E7CC00FA49E2 /* SceneryGroupObject.cpp */, - F76C84291EC4E7CC00FA49E2 /* SceneryGroupObject.h */, - 4C1A53EC205FD19F000F8EF5 /* SceneryObject.cpp */, - F76C842A1EC4E7CC00FA49E2 /* SceneryObject.h */, - F76C842B1EC4E7CC00FA49E2 /* SmallSceneryObject.cpp */, - F76C842C1EC4E7CC00FA49E2 /* SmallSceneryObject.h */, - 93F6004F213DD7E300EEB83E /* StationObject.cpp */, - 93F6004E213DD7E300EEB83E /* StationObject.h */, - F76C842F1EC4E7CC00FA49E2 /* StringTable.cpp */, - F76C84301EC4E7CC00FA49E2 /* StringTable.h */, - 93F6004A213DD7DC00EEB83E /* TerrainEdgeObject.cpp */, - 93F6004B213DD7DD00EEB83E /* TerrainEdgeObject.h */, - 93F60049213DD7DC00EEB83E /* TerrainSurfaceObject.cpp */, - 93F60048213DD7DC00EEB83E /* TerrainSurfaceObject.h */, - F76C84311EC4E7CC00FA49E2 /* WallObject.cpp */, - F76C84321EC4E7CC00FA49E2 /* WallObject.h */, - F76C84331EC4E7CC00FA49E2 /* WaterObject.cpp */, - F76C84341EC4E7CC00FA49E2 /* WaterObject.h */, - ); - path = object; - sourceTree = ""; - }; - F76C843A1EC4E7CC00FA49E2 /* paint */ = { - isa = PBXGroup; - children = ( - F76C84491EC4E7CC00FA49E2 /* sprite */, - F76C843B1EC4E7CC00FA49E2 /* tile_element */, - 4C6A66AE1FE278C900694CB6 /* Paint.cpp */, - 4C6A66AF1FE278C900694CB6 /* Paint.h */, - 4C6A66B01FE278C900694CB6 /* Painter.cpp */, - 4C6A66B11FE278C900694CB6 /* Painter.h */, - 4C6A66B21FE278C900694CB6 /* PaintHelpers.cpp */, - 4C6A66B31FE278C900694CB6 /* Supports.cpp */, - 4C6A66B41FE278C900694CB6 /* Supports.h */, - 4C7B540020015AC600A52E21 /* VirtualFloor.cpp */, - 2ADE2F332244191E002598AF /* VirtualFloor.h */, - ); - path = paint; - sourceTree = ""; - }; - F76C843B1EC4E7CC00FA49E2 /* tile_element */ = { - isa = PBXGroup; - children = ( - 93F76EFC20BFF77A00D4512C /* Paint.Banner.cpp */, - 93F76EFE20BFF77A00D4512C /* Paint.Entrance.cpp */, - 93F76EF920BFF77900D4512C /* Paint.LargeScenery.cpp */, - 93F76EF820BFF77900D4512C /* Paint.Path.cpp */, - 93F76EFB20BFF77A00D4512C /* Paint.SmallScenery.cpp */, - 93F76EFA20BFF77900D4512C /* Paint.Surface.cpp */, - 939A359D20C12FDD00630B3F /* Paint.Surface.h */, - 93F76EFD20BFF77A00D4512C /* Paint.TileElement.cpp */, - 939A359E20C12FDE00630B3F /* Paint.TileElement.h */, - 93F76EF720BFF77900D4512C /* Paint.Wall.cpp */, - ); - path = tile_element; - sourceTree = ""; - }; - F76C84491EC4E7CC00FA49E2 /* sprite */ = { - isa = PBXGroup; - children = ( - 939A359720C12FC700630B3F /* Paint.Litter.cpp */, - 939A359820C12FC700630B3F /* Paint.Misc.cpp */, - 93F76EF320BFF76D00D4512C /* Paint.Peep.cpp */, - 93F76EF420BFF76D00D4512C /* Paint.Sprite.cpp */, - 939A359920C12FC700630B3F /* Paint.Sprite.h */, - ); - path = sprite; - sourceTree = ""; - }; - F76C84531EC4E7CC00FA49E2 /* peep */ = { - isa = PBXGroup; - children = ( - 51160A24250C7A15002029F6 /* GuestPathfinding.h */, - 9346F9D6208A191900C77D91 /* Guest.cpp */, - 9346F9D7208A191900C77D91 /* GuestPathfinding.cpp */, - 4CFE4E7B1F90A3F1005243C2 /* Peep.cpp */, - 4CFE4E7C1F90A3F1005243C2 /* Peep.h */, - 4CFE4E7D1F90A3F1005243C2 /* PeepData.cpp */, - 4CFE4E7E1F90A3F1005243C2 /* Staff.cpp */, - 4CFE4E7F1F90A3F1005243C2 /* Staff.h */, - 58DEACC694664E7C8DACB93D /* RideUseSystem.cpp */, - 2DA720D496604387806AC168 /* RideUseSystem.h */, - ); - path = peep; - sourceTree = ""; - }; - F76C84591EC4E7CC00FA49E2 /* platform */ = { - isa = PBXGroup; - children = ( - 4C7B54742010DF3C00A52E21 /* Android.cpp */, - F76C845A1EC4E7CC00FA49E2 /* Crash.cpp */, - 4C7B547E2010DFF700A52E21 /* Crash.h */, - 4C7B54762010DF4300A52E21 /* Linux.cpp */, - F76C845D1EC4E7CC00FA49E2 /* macos.mm */, - 4CE462441FD161360001CD98 /* Platform.Android.cpp */, - F76C845E1EC4E7CC00FA49E2 /* platform.h */, - 4CE462461FD1613D0001CD98 /* Platform.Linux.cpp */, - F7B20489201E91BF0000AD7E /* Platform.macOS.mm */, - 4CE462481FD1613D0001CD98 /* Platform.Posix.cpp */, - 4CE462491FD1613D0001CD98 /* Platform.Win32.cpp */, - F76C84601EC4E7CC00FA49E2 /* Platform2.h */, - 4C7B54782010DF4C00A52E21 /* Posix.cpp */, - 4C7B54792010DF4C00A52E21 /* Shared.cpp */, - 4C7B547A2010DF4C00A52E21 /* Windows.cpp */, - ); - path = platform; - sourceTree = ""; - }; - F76C84661EC4E7CC00FA49E2 /* rct1 */ = { - isa = PBXGroup; - children = ( - 4C7B54022004C57400A52E21 /* RCT1.h */, - F76C84671EC4E7CC00FA49E2 /* S4Importer.cpp */, - 01C6F0C322FD51B70057E2F7 /* T4Importer.cpp */, - F76C84681EC4E7CC00FA49E2 /* Tables.cpp */, - F76C84691EC4E7CC00FA49E2 /* Tables.h */, - ); - path = rct1; - sourceTree = ""; - }; - F76C846C1EC4E7CC00FA49E2 /* rct12 */ = { - isa = PBXGroup; - children = ( - 4C29DEB2218C6AE500E8707F /* RCT12.cpp */, - 4C7B54032004C57B00A52E21 /* RCT12.h */, - F76C846D1EC4E7CC00FA49E2 /* SawyerChunk.cpp */, - F76C846E1EC4E7CC00FA49E2 /* SawyerChunk.h */, - F76C846F1EC4E7CC00FA49E2 /* SawyerChunkReader.cpp */, - F76C84701EC4E7CC00FA49E2 /* SawyerChunkReader.h */, - F76C84711EC4E7CC00FA49E2 /* SawyerChunkWriter.cpp */, - F76C84721EC4E7CC00FA49E2 /* SawyerChunkWriter.h */, - F76C84731EC4E7CC00FA49E2 /* SawyerEncoding.cpp */, - F76C84741EC4E7CC00FA49E2 /* SawyerEncoding.h */, - ); - path = rct12; - sourceTree = ""; - }; - F76C84761EC4E7CC00FA49E2 /* rct2 */ = { - isa = PBXGroup; - children = ( - 4CB30178249E382B0034A7F6 /* RCT2.cpp */, - 4C7B54042004C58200A52E21 /* RCT2.h */, - F76C847D1EC4E7CC00FA49E2 /* S6Exporter.cpp */, - F76C847E1EC4E7CC00FA49E2 /* S6Exporter.h */, - F76C847F1EC4E7CC00FA49E2 /* S6Importer.cpp */, - 933C55B424B858490057E64B /* SeaDecrypt.cpp */, - 01C6F0C522FD51FC0057E2F7 /* T6Exporter.cpp */, - 01C6F0C722FD51FC0057E2F7 /* T6Exporter.h */, - 01C6F0C622FD51FC0057E2F7 /* T6Importer.cpp */, - ); - path = rct2; - sourceTree = ""; - }; - F76C84831EC4E7CC00FA49E2 /* ride */ = { - isa = PBXGroup; - children = ( - F76C84861EC4E7CC00FA49E2 /* coaster */, - F76C84A91EC4E7CC00FA49E2 /* gentle */, - F76C84C01EC4E7CC00FA49E2 /* shops */, - F76C84C61EC4E7CC00FA49E2 /* thrill */, - F76C84DE1EC4E7CD00FA49E2 /* transport */, - F76C84EA1EC4E7CD00FA49E2 /* water */, - 4C6AC2101F9E1CB3004324AA /* CableLift.cpp */, - 4C6AC2111F9E1CB3004324AA /* CableLift.h */, - 4C6A66BF1FF9322A00694CB6 /* Ride.cpp */, - 4C6A66C01FF9322A00694CB6 /* Ride.h */, - 4C91FD6025AE483600CA5DA4 /* RideAudio.cpp */, - 4C91FD6125AE483600CA5DA4 /* RideAudio.h */, - 4C7B541420060D8E00A52E21 /* RideData.cpp */, - 4C7B541520060D8E00A52E21 /* RideData.h */, - F73E320B2011589E00C4D975 /* RideRatings.cpp */, - F73E320C2011589F00C4D975 /* RideRatings.h */, - 2ADE2F352244195F002598AF /* RideTypes.h */, - 4CDCB0BC20A9902E00321367 /* ShopItem.cpp */, - 4CDCB0BD20A9902F00321367 /* ShopItem.h */, - 4C6AC20D1F9E1693004324AA /* Station.cpp */, - 4C6AC20E1F9E1693004324AA /* Station.h */, - 4CFE4E8E1F9625B0005243C2 /* Track.cpp */, - 4CFE4E8F1F9625B0005243C2 /* Track.h */, - 4CFE4E861F950164005243C2 /* TrackData.cpp */, - 4CFE4E871F950164005243C2 /* TrackData.h */, - 4C4C1E971F58226500560300 /* TrackDesign.cpp */, - 4C4C1E991F5832AA00560300 /* TrackDesign.h */, - F76C84DC1EC4E7CD00FA49E2 /* TrackDesignRepository.cpp */, - F76C84DD1EC4E7CD00FA49E2 /* TrackDesignRepository.h */, - F73E320E2011589F00C4D975 /* TrackDesignSave.cpp */, - 4C7B540B20060D8100A52E21 /* TrackPaint.cpp */, - 4C7B540C20060D8100A52E21 /* TrackPaint.h */, - 4C882FB825FEA80D0039D1C4 /* TrainManager.cpp */, - 4C882FB925FEA80E0039D1C4 /* TrainManager.h */, - 4CFE4E831F90AF41005243C2 /* Vehicle.cpp */, - 4CFE4E841F90AF41005243C2 /* Vehicle.h */, - 4C882FBB25FEA8260039D1C4 /* VehicleColour.h */, - 4C7B54052005735F00A52E21 /* VehicleData.cpp */, - 4C7B540920060D7000A52E21 /* VehicleData.h */, - 4C882FBC25FEA8270039D1C4 /* VehicleEntry.h */, - 4C7B54072005736700A52E21 /* VehiclePaint.cpp */, - 4C7B540A20060D7900A52E21 /* VehiclePaint.h */, - 4CB2716824195B45000CF9EE /* VehicleSubpositionData.cpp */, - 4CB2716924195B45000CF9EE /* VehicleSubpositionData.h */, - 6BCCA2EF0F5A40D5B83A83AC /* RideConstruction.cpp */, - ); - path = ride; - sourceTree = ""; - }; - F76C84861EC4E7CC00FA49E2 /* coaster */ = { - isa = PBXGroup; - children = ( - 4C93F1181F8B744400A9330D /* AirPoweredVerticalCoaster.cpp */, - 4C93F1191F8B744400A9330D /* BobsleighCoaster.cpp */, - 4C93F11A1F8B744400A9330D /* BolligerMabillardTrack.h */, - 4C93F11B1F8B744400A9330D /* BolligerMabillardTrack.cpp */, - 4C93F11C1F8B744400A9330D /* CompactInvertedCoaster.cpp */, - 4C93F11D1F8B744400A9330D /* CorkscrewRollerCoaster.cpp */, - 4C93F11E1F8B744400A9330D /* FlyingRollerCoaster.cpp */, - 4C93F11F1F8B744400A9330D /* GigaCoaster.cpp */, - 4C93F1201F8B744400A9330D /* HeartlineTwisterCoaster.cpp */, - 4C1EE63C24AB4A2700D7177F /* HybridCoaster.cpp */, - 4C93F1211F8B744400A9330D /* InvertedHairpinCoaster.cpp */, - 4C93F1221F8B744400A9330D /* InvertedImpulseCoaster.cpp */, - 4C93F1231F8B744400A9330D /* InvertedRollerCoaster.cpp */, - 4C93F1241F8B744400A9330D /* JuniorRollerCoaster.h */, - 4C93F1251F8B744400A9330D /* JuniorRollerCoaster.cpp */, - 4C93F1261F8B744400A9330D /* LayDownRollerCoaster.cpp */, - 4C93F1271F8B744400A9330D /* LimLaunchedRollerCoaster.cpp */, - 4C93F1281F8B744400A9330D /* LoopingRollerCoaster.cpp */, - 4C93F1291F8B744400A9330D /* MineRide.cpp */, - 4C93F12A1F8B744400A9330D /* MineTrainCoaster.cpp */, - 4C93F12B1F8B744400A9330D /* MiniRollerCoaster.cpp */, - 4C93F12C1F8B744400A9330D /* MiniSuspendedCoaster.cpp */, - 4C93F12D1F8B744400A9330D /* MultiDimensionRollerCoaster.cpp */, - 4C93F12E1F8B744400A9330D /* ReverseFreefallCoaster.cpp */, - 4C93F12F1F8B744400A9330D /* ReverserRollerCoaster.cpp */, - 4C93F1301F8B744400A9330D /* SideFrictionRollerCoaster.cpp */, - 4C2BF6C3258FF2FB005CD9A0 /* SingleRailRollerCoaster.cpp */, - 4C93F1311F8B744400A9330D /* StandUpRollerCoaster.cpp */, - 4C93F1321F8B744400A9330D /* Steeplechase.cpp */, - 4C93F1331F8B744400A9330D /* SuspendedSwingingCoaster.cpp */, - 4C93F1341F8B744400A9330D /* TwisterRollerCoaster.cpp */, - 4C93F1351F8B744400A9330D /* VerticalDropRollerCoaster.cpp */, - 4C93F1361F8B744400A9330D /* VirginiaReel.cpp */, - 4C93F1371F8B744400A9330D /* WildMouse.cpp */, - 4C93F1381F8B744400A9330D /* WoodenRollerCoaster.cpp */, - 4C93F1391F8B744400A9330D /* WoodenWildMouse.cpp */, - ); - path = coaster; - sourceTree = ""; - }; - F76C84A91EC4E7CC00FA49E2 /* gentle */ = { - isa = PBXGroup; - children = ( - 4C93F15A1F8B745700A9330D /* CarRide.cpp */, - 4C93F15B1F8B745700A9330D /* Circus.cpp */, - 4C93F15C1F8B745700A9330D /* CrookedHouse.cpp */, - 4C93F15D1F8B745700A9330D /* Dodgems.cpp */, - 4C93F15E1F8B745700A9330D /* FerrisWheel.cpp */, - 4C93F15F1F8B745700A9330D /* FlyingSaucers.cpp */, - 4C93F1601F8B745700A9330D /* GhostTrain.cpp */, - 4C93F1611F8B745700A9330D /* HauntedHouse.cpp */, - 4C93F1621F8B745700A9330D /* Maze.cpp */, - 4C93F1631F8B745700A9330D /* MerryGoRound.cpp */, - 4C93F1641F8B745700A9330D /* MiniGolf.cpp */, - 4C93F1651F8B745700A9330D /* MiniHelicopters.cpp */, - 4C93F1661F8B745700A9330D /* MonorailCycles.cpp */, - 4C93F1671F8B745700A9330D /* ObservationTower.cpp */, - 4C93F1681F8B745700A9330D /* SpaceRings.cpp */, - 4C93F1691F8B745700A9330D /* SpiralSlide.cpp */, - ); - path = gentle; - sourceTree = ""; - }; - F76C84C01EC4E7CC00FA49E2 /* shops */ = { - isa = PBXGroup; - children = ( - 4C93F17A1F8B747300A9330D /* Facility.cpp */, - 4C93F17B1F8B747300A9330D /* Shop.cpp */, - ); - path = shops; - sourceTree = ""; - }; - F76C84C61EC4E7CC00FA49E2 /* thrill */ = { - isa = PBXGroup; - children = ( - 4C93F17E1F8B747A00A9330D /* 3dCinema.cpp */, - 4C93F17F1F8B747A00A9330D /* Enterprise.cpp */, - 4C93F1801F8B747A00A9330D /* GoKarts.cpp */, - 4C93F1811F8B747A00A9330D /* LaunchedFreefall.cpp */, - 4C93F1821F8B747A00A9330D /* MagicCarpet.cpp */, - 4C93F1831F8B747A00A9330D /* MotionSimulator.cpp */, - 4C93F1841F8B747A00A9330D /* SwingingShip.cpp */, - 4C93F1851F8B747A00A9330D /* RotoDrop.cpp */, - 4C93F1861F8B747A00A9330D /* SwingingInverterShip.cpp */, - 4C93F1871F8B747A00A9330D /* TopSpin.cpp */, - 4C93F1881F8B747A00A9330D /* Twist.cpp */, - ); - path = thrill; - sourceTree = ""; - }; - F76C84DE1EC4E7CD00FA49E2 /* transport */ = { - isa = PBXGroup; - children = ( - 4C93F1941F8B748200A9330D /* Chairlift.cpp */, - 4C93F1951F8B748200A9330D /* Lift.cpp */, - 4C93F1961F8B748200A9330D /* MiniatureRailway.cpp */, - 4C93F1971F8B748200A9330D /* Monorail.cpp */, - 4C93F1981F8B748200A9330D /* SuspendedMonorail.cpp */, - ); - path = transport; - sourceTree = ""; - }; - F76C84EA1EC4E7CD00FA49E2 /* water */ = { - isa = PBXGroup; - children = ( - 4C93F19E1F8B748900A9330D /* BoatHire.cpp */, - 4C93F19F1F8B748900A9330D /* DingySlide.cpp */, - 4C93F1A01F8B748900A9330D /* LogFlume.cpp */, - 4C93F1A11F8B748900A9330D /* RiverRapids.cpp */, - 4C93F1A21F8B748900A9330D /* SplashBoats.cpp */, - 4C93F1A31F8B748900A9330D /* SubmarineRide.cpp */, - 4C93F1A41F8B748900A9330D /* WaterCoaster.cpp */, - ); - path = water; - sourceTree = ""; - }; - F76C84F31EC4E7CD00FA49E2 /* scenario */ = { - isa = PBXGroup; - children = ( - F70839911FFC0AFF002DCEFA /* Scenario.cpp */, - F76C84F51EC4E7CD00FA49E2 /* scenario.h */, - F76C84F61EC4E7CD00FA49E2 /* ScenarioRepository.cpp */, - F76C84F71EC4E7CD00FA49E2 /* ScenarioRepository.h */, - F76C84F81EC4E7CD00FA49E2 /* ScenarioSources.cpp */, - F76C84F91EC4E7CD00FA49E2 /* ScenarioSources.h */, - ); - path = scenario; - sourceTree = ""; - }; - F76C84FB1EC4E7CD00FA49E2 /* title */ = { - isa = PBXGroup; - children = ( - F76C84FC1EC4E7CD00FA49E2 /* TitleScreen.cpp */, - F76C84FD1EC4E7CD00FA49E2 /* TitleScreen.h */, - F76C84FE1EC4E7CD00FA49E2 /* TitleSequence.cpp */, - F76C84FF1EC4E7CD00FA49E2 /* TitleSequence.h */, - F76C85001EC4E7CD00FA49E2 /* TitleSequenceManager.cpp */, - F76C85011EC4E7CD00FA49E2 /* TitleSequenceManager.h */, - F76C85031EC4E7CD00FA49E2 /* TitleSequencePlayer.h */, - ); - path = title; - sourceTree = ""; - }; - F76C85041EC4E7CD00FA49E2 /* ui */ = { - isa = PBXGroup; - children = ( - F775F5331EE35A6B001F00E7 /* DummyUiContext.cpp */, - F7CB864B1EEDA1A80030C877 /* DummyWindowManager.cpp */, - F76C85051EC4E7CD00FA49E2 /* UiContext.h */, - F7CB864C1EEDA1A80030C877 /* WindowManager.h */, - ); - path = ui; - sourceTree = ""; - }; - F76C85061EC4E7CD00FA49E2 /* util */ = { - isa = PBXGroup; - children = ( - 4C6A668A1FE14C3A00694CB6 /* SawyerCoding.cpp */, - 4C6A668B1FE14C3A00694CB6 /* SawyerCoding.h */, - 4C6A668C1FE14C3A00694CB6 /* Util.cpp */, - 4C6A668D1FE14C3A00694CB6 /* Util.h */, - ); - path = util; - sourceTree = ""; - }; - F76C850D1EC4E7CD00FA49E2 /* windows */ = { - isa = PBXGroup; - children = ( - F7B2048E2024E8B30000AD7E /* _legacy.cpp */, - C654DF3E1F69C18C0040F43D /* Intent.cpp */, - C654DF3F1F69C18C0040F43D /* Intent.h */, - F76C854A1EC4E7CD00FA49E2 /* tile_inspector.h */, - ); - path = windows; - sourceTree = ""; - }; - F76C855B1EC4E7CD00FA49E2 /* world */ = { - isa = PBXGroup; - children = ( - 4C7B541D2007646A00A52E21 /* Balloon.cpp */, - 4C7B541E2007646A00A52E21 /* Banner.cpp */, - 4C7B541F2007646A00A52E21 /* Banner.h */, - 4C7B54202007646A00A52E21 /* Climate.cpp */, - 4C7B54212007646A00A52E21 /* Climate.h */, - 4C7B54222007646A00A52E21 /* Duck.cpp */, - 4CA23DB1263C920900077AA1 /* Entity.cpp */, - 4CA23DAF263C920900077AA1 /* Entity.h */, - 4CA23DB0263C920900077AA1 /* EntityList.h */, - 4C7B54232007646A00A52E21 /* Entrance.cpp */, - 4C7B54242007646A00A52E21 /* Entrance.h */, - 4C7B54252007646A00A52E21 /* Footpath.cpp */, - 4C7B54262007646A00A52E21 /* Footpath.h */, - 4C7B54272007646A00A52E21 /* Fountain.cpp */, - 4C7B54282007646A00A52E21 /* Fountain.h */, - 4C7B54292007646A00A52E21 /* LargeScenery.cpp */, - 4C7B542A2007646A00A52E21 /* LargeScenery.h */, - 4C9196ED204FF3E000869A24 /* Location.hpp */, - 4C7B542C2007646A00A52E21 /* Map.cpp */, - 4C7B542D2007646A00A52E21 /* Map.h */, - 4C7B542E2007646A00A52E21 /* MapAnimation.cpp */, - 4C7B542F2007646A00A52E21 /* MapAnimation.h */, - 4C7B54302007646A00A52E21 /* MapGen.cpp */, - 4C7B54312007646A00A52E21 /* MapGen.h */, - 4C7B54322007646A00A52E21 /* MapHelpers.cpp */, - 4C7B54332007646A00A52E21 /* MapHelpers.h */, - 4C7B54342007646A00A52E21 /* MoneyEffect.cpp */, - 4C7B54352007646A00A52E21 /* Park.cpp */, - 4C7B54362007646A00A52E21 /* Park.h */, - 4C7B54372007646A00A52E21 /* Particle.cpp */, - 4C7B54382007646A00A52E21 /* Scenery.cpp */, - 4C7B54392007646A00A52E21 /* Scenery.h */, - 4C7B543A2007646A00A52E21 /* SmallScenery.cpp */, - 4C7B543B2007646A00A52E21 /* SmallScenery.h */, - 4C7B543C2007646A00A52E21 /* Sprite.cpp */, - 4C7B543D2007646A00A52E21 /* Sprite.h */, - 2ADE2F372244198A002598AF /* SpriteBase.h */, - 9308D9FB209908080079EE96 /* Surface.cpp */, - 9308D9FD209908090079EE96 /* Surface.h */, - 20DE495E25DA8C6B00F2DF6D /* TileElementBase.cpp */, - 9308D9FA209908080079EE96 /* TileElement.cpp */, - 9308D9FC209908080079EE96 /* TileElement.h */, - 4C7B543E2007646A00A52E21 /* TileInspector.cpp */, - 4C7B543F2007646A00A52E21 /* TileInspector.h */, - 4C7B54402007646A00A52E21 /* Wall.cpp */, - 4C7B54412007646A00A52E21 /* Wall.h */, - 4C7B54422007646A00A52E21 /* Water.h */, - 0EB0D1DF6CC74E4190301D84 /* EntityTweener.cpp */, - 091352A950004312BAB18717 /* EntityTweener.h */, - 9D3DD6CD73F5421880280D9D /* Litter.cpp */, - ); - path = world; - sourceTree = ""; - }; - F76C857C1EC4E80E00FA49E2 /* openrct2-cli */ = { - isa = PBXGroup; - children = ( - F76C857D1EC4E80E00FA49E2 /* Cli.cpp */, - ); - name = "openrct2-cli"; - path = "src/openrct2-cli"; - sourceTree = SOURCE_ROOT; - }; - F76C85801EC4E82600FA49E2 /* openrct2-ui */ = { - isa = PBXGroup; - children = ( - F76C85811EC4E82600FA49E2 /* audio */, - F76C858D1EC4E82600FA49E2 /* drawing */, - F7CB86451EEDA1200030C877 /* input */, - C68313CF1FDB4F4C006DB3D8 /* interface */, - 4C25594D244A326100CE7E45 /* scripting */, - 933CBDB820CB1B3F00134678 /* title */, - F7CB86401EEDA0E20030C877 /* windows */, - F76C858A1EC4E82600FA49E2 /* CursorData.cpp */, - F76C858B1EC4E82600FA49E2 /* CursorRepository.cpp */, - F76C858C1EC4E82600FA49E2 /* CursorRepository.h */, - F76C85A81EC4E82600FA49E2 /* SDLException.h */, - F76C85A91EC4E82600FA49E2 /* TextComposition.cpp */, - F76C85AA1EC4E82600FA49E2 /* TextComposition.h */, - F76C85AB1EC4E82600FA49E2 /* Ui.cpp */, - F775F5321EE35A48001F00E7 /* Ui.h */, - F76C85AC1EC4E82600FA49E2 /* UiContext.cpp */, - F76C85AD1EC4E82600FA49E2 /* UiContext.h */, - F76C85AE1EC4E82600FA49E2 /* UiContext.Linux.cpp */, - F7D7747E1EC61E5100BE6EBC /* UiContext.macOS.mm */, - F76C85AF1EC4E82600FA49E2 /* UiContext.Win32.cpp */, - F7CB863D1EEDA0B50030C877 /* WindowManager.cpp */, - F7CB863E1EEDA0B50030C877 /* WindowManager.h */, - ); - name = "openrct2-ui"; - path = "src/openrct2-ui"; - sourceTree = SOURCE_ROOT; - }; - F76C85811EC4E82600FA49E2 /* audio */ = { - isa = PBXGroup; - children = ( - F76C85821EC4E82600FA49E2 /* AudioChannel.cpp */, - F76C85831EC4E82600FA49E2 /* AudioContext.cpp */, - F76C85841EC4E82600FA49E2 /* AudioContext.h */, - F76C85851EC4E82600FA49E2 /* AudioFormat.h */, - F76C85861EC4E82600FA49E2 /* AudioMixer.cpp */, - F76C85871EC4E82600FA49E2 /* FileAudioSource.cpp */, - F76C85881EC4E82600FA49E2 /* MemoryAudioSource.cpp */, - ); - path = audio; - sourceTree = ""; - }; - F76C858D1EC4E82600FA49E2 /* drawing */ = { - isa = PBXGroup; - children = ( - F76C858E1EC4E82600FA49E2 /* engines */, - 93CBA4BF20A74FF200867D56 /* BitmapReader.cpp */, - 93CBA4BE20A74FF200867D56 /* BitmapReader.h */, - ); - path = drawing; - sourceTree = ""; - }; - F76C858E1EC4E82600FA49E2 /* engines */ = { - isa = PBXGroup; - children = ( - F76C85901EC4E82600FA49E2 /* opengl */, - F76C858F1EC4E82600FA49E2 /* DrawingEngines.h */, - 4C8B42711EEB1AE400F015CA /* HardwareDisplayDrawingEngine.cpp */, - F76C85A61EC4E82600FA49E2 /* SoftwareDrawingEngine.cpp */, - ); - path = engines; - sourceTree = ""; - }; - F76C85901EC4E82600FA49E2 /* opengl */ = { - isa = PBXGroup; - children = ( - F76C85911EC4E82600FA49E2 /* ApplyPaletteShader.cpp */, - F76C85921EC4E82600FA49E2 /* ApplyPaletteShader.h */, - D45E09161F99CF2F00854B2B /* ApplyTransparencyShader.cpp */, - D45E09151F99CF2F00854B2B /* ApplyTransparencyShader.h */, - F76C85931EC4E82600FA49E2 /* DrawCommands.h */, - F76C85961EC4E82600FA49E2 /* DrawLineShader.cpp */, - F76C85971EC4E82600FA49E2 /* DrawLineShader.h */, - F76C85941EC4E82600FA49E2 /* DrawRectShader.cpp */, - F76C85951EC4E82600FA49E2 /* DrawRectShader.h */, - F76C859A1EC4E82600FA49E2 /* GLSLTypes.h */, - F76C859B1EC4E82600FA49E2 /* OpenGLAPI.cpp */, - F76C859C1EC4E82600FA49E2 /* OpenGLAPI.h */, - D43BAB921F8C2B2B00A9E362 /* OpenGLAPIProc.h */, - F76C859D1EC4E82600FA49E2 /* OpenGLDrawingEngine.cpp */, - F76C859E1EC4E82600FA49E2 /* OpenGLFramebuffer.cpp */, - F76C859F1EC4E82600FA49E2 /* OpenGLFramebuffer.h */, - F76C85A01EC4E82600FA49E2 /* OpenGLShaderProgram.cpp */, - F76C85A11EC4E82600FA49E2 /* OpenGLShaderProgram.h */, - F76C85A21EC4E82600FA49E2 /* SwapFramebuffer.cpp */, - F76C85A31EC4E82600FA49E2 /* SwapFramebuffer.h */, - F76C85A41EC4E82600FA49E2 /* TextureCache.cpp */, - F76C85A51EC4E82600FA49E2 /* TextureCache.h */, - D4974F1A1FA04A1900F7FD7F /* TransparencyDepth.cpp */, - D4974F1B1FA04A1900F7FD7F /* TransparencyDepth.h */, - ); - path = opengl; - sourceTree = ""; - }; - F7CB86401EEDA0E20030C877 /* windows */ = { - isa = PBXGroup; - children = ( - C666EE551F37ACB10061AA04 /* About.cpp */, - C654DF1C1F69C0430040F43D /* Banner.cpp */, - C666EE561F37ACB10061AA04 /* Changelog.cpp */, - C666EE571F37ACB10061AA04 /* Cheats.cpp */, - C64644EE1F3FA4120026AC2D /* ClearScenery.cpp */, - C666EE581F37ACB10061AA04 /* CustomCurrency.cpp */, - C666EE591F37ACB10061AA04 /* DebugPaint.cpp */, - C654DF1D1F69C0430040F43D /* DemolishRidePrompt.cpp */, - C68313CA1FDB4EEC006DB3D8 /* Dropdown.cpp */, - C67CCD651FBBCFDB004FAE4C /* EditorBottomToolbar.cpp */, - C64644EF1F3FA4120026AC2D /* EditorInventionsList.cpp */, - C67CCD671FBBD137004FAE4C /* EditorMain.cpp */, - C64644F01F3FA4120026AC2D /* EditorObjectiveOptions.cpp */, - C62D83861FCC7D19008C04F1 /* EditorObjectSelection.cpp */, - C64644F11F3FA4120026AC2D /* EditorScenarioOptions.cpp */, - C654DF1E1F69C0430040F43D /* Error.cpp */, - C654DF1F1F69C0430040F43D /* Finances.cpp */, - C64644F21F3FA4120026AC2D /* Footpath.cpp */, - C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */, - C685E5161F8907840090598F /* Guest.cpp */, - C654DF201F69C0430040F43D /* GuestList.cpp */, - C654DF211F69C0430040F43D /* InstallTrack.cpp */, - C64644F31F3FA4120026AC2D /* Land.cpp */, - C666EE5A1F37ACB10061AA04 /* LandRights.cpp */, - C654DF221F69C0430040F43D /* LoadSave.cpp */, - C64644F41F3FA4120026AC2D /* Main.cpp */, - C685E5171F8907840090598F /* Map.cpp */, - C666EE5B1F37ACB10061AA04 /* MapGen.cpp */, - C6D2BEE41F9BAACD008B557C /* MapTooltip.cpp */, - C6D2BEE51F9BAACD008B557C /* MazeConstruction.cpp */, - C666EE5C1F37ACB10061AA04 /* Multiplayer.cpp */, - C6D2BEE91F9BB83B008B557C /* NetworkStatus.cpp */, - C654DF231F69C0430040F43D /* NewCampaign.cpp */, - C685E5141F8907840090598F /* NewRide.cpp */, - C666EE5E1F37ACB10061AA04 /* News.cpp */, - C666EE5F1F37ACB10061AA04 /* NewsOptions.cpp */, - C61FB2701FA3E25C0095FB9D /* ObjectLoadError.cpp */, - C666EE601F37ACB10061AA04 /* Options.cpp */, - C654DF241F69C0430040F43D /* Park.cpp */, - C654DF251F69C0430040F43D /* Player.cpp */, - C685E5181F8907840090598F /* Research.cpp */, - C6D2BEE11F9BAA6C008B557C /* Ride.cpp */, - C6E415501FAFD6DB00D4A52A /* RideConstruction.cpp */, - C632C81E1F8A445700781F6D /* RideList.cpp */, - C666EE611F37ACB10061AA04 /* SavePrompt.cpp */, - 930EEA6924FC00940070314E /* ScenarioSelect.cpp */, - C61ADB201FB7DC060024F2EF /* Scenery.cpp */, - 304FE94F23A2996600470197 /* SceneryScatter.cpp */, - C666EE621F37ACB10061AA04 /* ServerList.cpp */, - C666EE631F37ACB10061AA04 /* ServerStart.cpp */, - C666ED751F33DBB20061AA04 /* ShortcutKeys.cpp */, - C654DF261F69C0430040F43D /* Sign.cpp */, - C685E5151F8907840090598F /* Staff.cpp */, - C654DF271F69C0430040F43D /* StaffFirePrompt.cpp */, - C64644F51F3FA4120026AC2D /* StaffList.cpp */, - C61FB2711FA3E25C0095FB9D /* TextInput.cpp */, - C666EE641F37ACB10061AA04 /* Themes.cpp */, - C68D98BB1FC6B8AB008E8378 /* TileInspector.cpp */, - C654DF281F69C0430040F43D /* TitleCommandEditor.cpp */, - C654DF291F69C0430040F43D /* TitleEditor.cpp */, - C666EE651F37ACB10061AA04 /* TitleExit.cpp */, - C666EE661F37ACB10061AA04 /* TitleLogo.cpp */, - C666EE671F37ACB10061AA04 /* TitleMenu.cpp */, - C666EE681F37ACB10061AA04 /* TitleOptions.cpp */, - C68313C91FDB4EEC006DB3D8 /* Tooltip.cpp */, - C61ADB1E1FB6A0A60024F2EF /* TopToolbar.cpp */, - C654DF2B1F69C0430040F43D /* TrackDesignManage.cpp */, - C654DF2C1F69C0430040F43D /* TrackDesignPlace.cpp */, - C6D2BEE31F9BAACC008B557C /* TrackList.cpp */, - C64644F61F3FA4120026AC2D /* ViewClipping.cpp */, - C666EE691F37ACB10061AA04 /* Viewport.cpp */, - C64644F71F3FA4120026AC2D /* Water.cpp */, - C666EE6A1F37ACB10061AA04 /* Window.h */, - ); - path = windows; - sourceTree = ""; - }; - F7CB86451EEDA1200030C877 /* input */ = { - isa = PBXGroup; - children = ( - 4CB991C425CEE53A00C692B4 /* InputManager.cpp */, - 4CB991C325CEE53A00C692B4 /* InputManager.h */, - C68313C71FDB4ED4006DB3D8 /* MouseInput.cpp */, - 4CB991CA25CEE54500C692B4 /* ShortcutIds.h */, - 4CB991C925CEE54500C692B4 /* ShortcutInput.cpp */, - 4CB991C625CEE54400C692B4 /* ShortcutManager.cpp */, - 4CB991C825CEE54500C692B4 /* ShortcutManager.h */, - 4CB991C725CEE54500C692B4 /* Shortcuts.cpp */, - ); - path = input; - sourceTree = ""; - }; - 59B0CA75A27A4C5EB9EF6CA7 /* bindings */ = { - isa = PBXGroup; - children = ( - EDFE9D20A43646C7981E7254 /* entity */, - C1C271EB7D2B4A3AA23CE0E6 /* game */, - 9192A7EACCF44110BF1B89BC /* network */, - CCCD0912DE2D444FA8DA7222 /* object */, - 0B69C59376EB45E58BA6ADF5 /* ride */, - 281760CC5B1249CBA8E771D7 /* world */, - ); - name = bindings; - sourceTree = ""; - }; - EDFE9D20A43646C7981E7254 /* entity */ = { - isa = PBXGroup; - children = ( - 6DF61461D47C40CF92019B24 /* ScEntity.hpp */, - B734D45D6B1D45E89AD2E6CE /* ScVehicle.cpp */, - 8E2C4C07B668487DA3493122 /* ScVehicle.hpp */, - 5DB792F5A06849BDAF95B28F /* ScGuest.cpp */, - CAFBD63A702F42F2BDB53A39 /* ScGuest.hpp */, - 2B63F2F751A3427C9CE9B214 /* ScPeep.hpp */, - 3EFAF58A62B44C4B887559B7 /* ScStaff.cpp */, - C30AB6C640464647ABE90EC4 /* ScStaff.hpp */, - 36C67B84754D4FEFA3678AA9 /* ScLitter.cpp */, - C30388F4F6D34DF59EF7072C /* ScLitter.hpp */, - ); - name = entity; - sourceTree = ""; - }; - C1C271EB7D2B4A3AA23CE0E6 /* game */ = { - isa = PBXGroup; - children = ( - 3F68EA974AF941BCAD28A04F /* ScCheats.hpp */, - FD736DB2EE1C4C888977BCAF /* ScConfiguration.hpp */, - E4B39FC3EB9C4EFDA82F42D7 /* ScConsole.hpp */, - DAF78631DD8D45E3B3C2FDD1 /* ScContext.hpp */, - 8865B46C60FD434CAD50A2F4 /* ScDisposable.hpp */, - ); - name = game; - sourceTree = ""; - }; - 9192A7EACCF44110BF1B89BC /* network */ = { - isa = PBXGroup; - children = ( - BDEB01D4A8144819A82E3CB4 /* ScNetwork.hpp */, - D4DD54E62DAE4E4889E26DF6 /* ScSocket.hpp */, - DA49170D35604E6A986D09D9 /* ScPlayerGroup.cpp */, - 887EBCE57E4A48C88191346E /* ScPlayerGroup.hpp */, - E2A4181A243F4B77BA36ACE2 /* ScPlayer.cpp */, - 7A08C451885D4D419FB4820D /* ScPlayer.hpp */, - 200F0E6CAD3B41499A3CFC36 /* ScNetwork.cpp */, - ); - name = network; - sourceTree = ""; - }; - CCCD0912DE2D444FA8DA7222 /* object */ = { - isa = PBXGroup; - children = ( - 24F9DF02868247738D05CC40 /* ScObject.hpp */, - ); - name = object; - sourceTree = ""; - }; - 0B69C59376EB45E58BA6ADF5 /* ride */ = { - isa = PBXGroup; - children = ( - AD97B712FDF7454CADC7A328 /* ScRide.hpp */, - 522FE124ED4F4E18BCF79042 /* ScRideStation.cpp */, - 1260386710BF4EA4B4FC31D3 /* ScRideStation.hpp */, - F3B00C9900ED42AFA72764ED /* ScRide.cpp */, - ); - name = ride; - sourceTree = ""; - }; - 281760CC5B1249CBA8E771D7 /* world */ = { - isa = PBXGroup; - children = ( - 0C2031084A4E462EB6E5BDE4 /* ScClimate.hpp */, - 613ADB50EF0F4D73A66E4538 /* ScDate.hpp */, - 74CDED6B7EF041458032681A /* ScMap.hpp */, - 9AB8D336AB654D0280549A89 /* ScPark.hpp */, - A9F55F2291284217BA0E4E51 /* ScScenario.hpp */, - 22D7DD798F054A068273739B /* ScTile.hpp */, - E4BE60702D7549488A32CC0B /* ScMap.cpp */, - 1939C9C3CFDB4FB6BA5DE47E /* ScParkMessage.cpp */, - 56E37ADCDBD440BD8AC35446 /* ScParkMessage.hpp */, - E9C4DE37309A4B5F965D7718 /* ScPark.cpp */, - 43D18154E96444749737E3F6 /* ScTileElement.cpp */, - F4C26E211F1D44C9ADA70740 /* ScTileElement.hpp */, - 5B67E36A8620400CA70FBA49 /* ScTile.cpp */, - ); - name = world; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - F76C80981EC4D9FA00FA49E2 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 93DFD05624521C1A001FCBAF /* ScriptEngine.h in Headers */, - 66A10ED0257F1DF800DD651A /* BannerSetColourAction.h in Headers */, - 66A10EC6257F1DF800DD651A /* FootpathPlaceAction.h in Headers */, - 66A10FA9257F1E1800DD651A /* ParkSetNameAction.h in Headers */, - 66A10F69257F1E1800DD651A /* ParkSetLoanAction.h in Headers */, - 2ADE2F3122441905002598AF /* DiscordService.h in Headers */, - 66A10FD2257F1E3000DD651A /* WallPlaceAction.h in Headers */, - 66A10F8C257F1E1800DD651A /* RideCreateAction.h in Headers */, - 66A10F65257F1E1700DD651A /* TileModifyAction.h in Headers */, - 66A10ED4257F1DF800DD651A /* ClearAction.h in Headers */, - 66A10F5F257F1E1700DD651A /* SmallScenerySetColourAction.h in Headers */, - 66A10FA5257F1E1800DD651A /* RideSetPriceAction.h in Headers */, - C67B28172002D67A00109C93 /* Viewport.h in Headers */, - 66A10FDD257F1E3000DD651A /* WallSetColourAction.h in Headers */, - 66A10F8D257F1E1800DD651A /* GuestSetFlagsAction.h in Headers */, - 66A10FA7257F1E1800DD651A /* PeepPickupAction.h in Headers */, - 939A359C20C12FC800630B3F /* Paint.Sprite.h in Headers */, - 9308DA04209908090079EE96 /* TileElement.h in Headers */, - C67B28152002D67A00109C93 /* Widget.h in Headers */, - 66A10F99257F1E1800DD651A /* LargeScenerySetColourAction.h in Headers */, - 93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */, - 66A10F90257F1E1800DD651A /* MazePlaceTrackAction.h in Headers */, - 66A10F6E257F1E1800DD651A /* LandRaiseAction.h in Headers */, - 66A10F78257F1E1800DD651A /* StaffSetColourAction.h in Headers */, - 66A10F67257F1E1700DD651A /* RideEntranceExitPlaceAction.h in Headers */, - 66A10F8A257F1E1800DD651A /* ParkSetResearchFundingAction.h in Headers */, - C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */, - 66A10F50257F1E1700DD651A /* ParkEntranceRemoveAction.h in Headers */, - 66A10F4D257F1E1700DD651A /* StaffSetNameAction.h in Headers */, - 66A10FD6257F1E3000DD651A /* WallRemoveAction.h in Headers */, - 939A359F20C12FDE00630B3F /* Paint.Surface.h in Headers */, - 66A10F7B257F1E1800DD651A /* MazeSetTrackAction.h in Headers */, - C67B28192002D7F200109C93 /* Window_internal.h in Headers */, - 66A10F53257F1E1700DD651A /* LandLowerAction.h in Headers */, - 66A10F5E257F1E1700DD651A /* LargeSceneryRemoveAction.h in Headers */, - 66A10F5D257F1E1700DD651A /* RideSetStatusAction.h in Headers */, - 93B4DC1625487CDF008D63FF /* Formatting.h in Headers */, - 66A10F86257F1E1800DD651A /* LoadOrQuitAction.h in Headers */, - 93DFD02E24521BA0001FCBAF /* FileWatcher.h in Headers */, - 2ADE2F28224418B2002598AF /* DataSerialiserTag.h in Headers */, - 66A10F74257F1E1800DD651A /* RideEntranceExitRemoveAction.h in Headers */, - 66A10F9A257F1E1800DD651A /* StaffFireAction.h in Headers */, - 66A10FAC257F1E1800DD651A /* RideSetSettingAction.h in Headers */, - 2ADE2F2E224418E7002598AF /* ConversionTables.h in Headers */, - 933F2CBB20935668001B33FD /* LocalisationService.h in Headers */, - 66A10EC9257F1DF800DD651A /* CustomAction.h in Headers */, - 66A10FDF257F1E3000DD651A /* TrackSetBrakeSpeedAction.h in Headers */, - 66A10F54257F1E1700DD651A /* RideSetAppearanceAction.h in Headers */, - C6352B861F477022006CCEE3 /* Endianness.h in Headers */, - 66A10F5A257F1E1700DD651A /* GuestSetNameAction.h in Headers */, - 66A10F87257F1E1800DD651A /* SmallSceneryPlaceAction.h in Headers */, - 66A10ECA257F1DF800DD651A /* ClimateSetAction.h in Headers */, - 66A10F77257F1E1800DD651A /* StaffSetOrdersAction.h in Headers */, - 2ADE2F2C224418B2002598AF /* FileIndex.hpp in Headers */, - 66A10FAF257F1E1800DD651A /* RideSetNameAction.h in Headers */, - 93CBA4CC20A7504500867D56 /* ImageImporter.h in Headers */, - 66A10F62257F1E1700DD651A /* SurfaceSetStyleAction.h in Headers */, - 66A10EC1257F1DF800DD651A /* FootpathAdditionRemoveAction.h in Headers */, - 66A10FD0257F1E3000DD651A /* TrackPlaceAction.h in Headers */, - 66A10F4C257F1E1700DD651A /* PlaceParkEntranceAction.h in Headers */, - 66A10F96257F1E1800DD651A /* SignSetStyleAction.h in Headers */, - 2ADE2F29224418B2002598AF /* Numerics.hpp in Headers */, - 66A10FD5257F1E3000DD651A /* WaterRaiseAction.h in Headers */, - 936F412B24CE030F00E07BCF /* NetworkBase.h in Headers */, - 66A10EC2257F1DF800DD651A /* FootpathRemoveAction.h in Headers */, - 66A10EA3257F1DE100DD651A /* BalloonPressAction.h in Headers */, - 2ADE2F382244198B002598AF /* SpriteBase.h in Headers */, - 66A10EC8257F1DF800DD651A /* BannerPlaceAction.h in Headers */, - C62D838B1FD36D6F008C04F1 /* EditorObjectSelectionSession.h in Headers */, - 2ADE2F27224418B2002598AF /* Random.hpp in Headers */, - 9344BEF920C1E6180047D165 /* Crypt.h in Headers */, - 66A10F63257F1E1700DD651A /* PlayerKickAction.h in Headers */, - 66A10FD7257F1E3000DD651A /* WaterLowerAction.h in Headers */, - 939A35A220C12FFD00630B3F /* InteractiveConsole.h in Headers */, - 93CBA4C320A7502E00867D56 /* Imaging.h in Headers */, - 66A10F4E257F1E1700DD651A /* PauseToggleAction.h in Headers */, - 93DFD04E24521C1A001FCBAF /* Duktape.hpp in Headers */, - 66A10FA2257F1E1800DD651A /* LargeSceneryPlaceAction.h in Headers */, - 2ADE2F3622441960002598AF /* RideTypes.h in Headers */, - 66A10F68257F1E1800DD651A /* NetworkModifyGroupAction.h in Headers */, - 66A10F88257F1E1800DD651A /* SignSetNameAction.h in Headers */, - 93AE2389252F948A00CD03C3 /* Formatter.h in Headers */, - 66A10F91257F1E1800DD651A /* StaffHireNewAction.h in Headers */, - 9308DA05209908090079EE96 /* Surface.h in Headers */, - 66A10F9F257F1E1800DD651A /* LandBuyRightsAction.h in Headers */, - 93DE9753209C3C1000FB1CC8 /* GameState.h in Headers */, - 66A10ED9257F1DF800DD651A /* FootpathAdditionPlaceAction.h in Headers */, - 936F412824CE030F00E07BCF /* NetworkClient.h in Headers */, - 2ADE2F2A224418B2002598AF /* Meta.hpp in Headers */, - 93DFD04624521C1A001FCBAF /* HookEngine.h in Headers */, - 66A10F81257F1E1800DD651A /* RideSetVehicleAction.h in Headers */, - 66A10F83257F1E1800DD651A /* PlayerSetGroupAction.h in Headers */, - 66A10F8E257F1E1800DD651A /* LandSetRightsAction.h in Headers */, - 66A10FDA257F1E3000DD651A /* WaterSetHeightAction.h in Headers */, - 66A10F51257F1E1700DD651A /* RideDemolishAction.h in Headers */, - 66A10F73257F1E1800DD651A /* LandSetHeightAction.h in Headers */, - 66A10F4F257F1E1700DD651A /* ParkSetDateAction.h in Headers */, - 66A10FD3257F1E3000DD651A /* TrackRemoveAction.h in Headers */, - C6352B841F477022006CCEE3 /* DataSerialiser.h in Headers */, - 939A35A020C12FDE00630B3F /* Paint.TileElement.h in Headers */, - 66A10ED3257F1DF800DD651A /* BannerRemoveAction.h in Headers */, - 66A10F84257F1E1800DD651A /* StaffSetPatrolAreaAction.h in Headers */, - 66A10F56257F1E1700DD651A /* SmallSceneryRemoveAction.h in Headers */, - 66A10F5C257F1E1700DD651A /* SetParkEntranceFeeAction.h in Headers */, - 66A10F8F257F1E1800DD651A /* StaffSetCostumeAction.h in Headers */, - 66A10ED5257F1DF800DD651A /* BannerSetStyleAction.h in Headers */, - 66A10F97257F1E1800DD651A /* SetCheatAction.h in Headers */, - 66A10F92257F1E1800DD651A /* ParkSetParameterAction.h in Headers */, - 93DFD04424521C1A001FCBAF /* Plugin.h in Headers */, - 66A10FB6257F1E1800DD651A /* RideSetColourSchemeAction.h in Headers */, - 66A10FA6257F1E1800DD651A /* ParkMarketingAction.h in Headers */, - C67B28162002D67A00109C93 /* Window.h in Headers */, - 66A10FB8257F1E1800DD651A /* ScenarioSetSettingAction.h in Headers */, - 66A10F72257F1E1800DD651A /* PlacePeepSpawnAction.h in Headers */, - 66A10ED7257F1DF800DD651A /* FootpathPlaceFromTrackAction.h in Headers */, - 66A10ECE257F1DF800DD651A /* BannerSetNameAction.h in Headers */, - 2ADE2F342244191E002598AF /* VirtualFloor.h in Headers */, - 66A10F8B257F1E1800DD651A /* LandSmoothAction.h in Headers */, - F42186C5840D4196981ADD16 /* EntityTweener.h in Headers */, - 317B766A750D4365B22A1682 /* EnumMap.hpp in Headers */, - 8C801369C7E44292A5348DFB /* ScEntity.hpp in Headers */, - BCCE3EDC711F4F0587F1C359 /* ScCheats.hpp in Headers */, - F396A397541149D6ACA290D2 /* ScConfiguration.hpp in Headers */, - 2EEDD899BAF94706ACED5F6D /* ScConsole.hpp in Headers */, - 74E3377F2FC04316959F1AED /* ScContext.hpp in Headers */, - A10C0EE3C2614B53AFB6ED35 /* ScDisposable.hpp in Headers */, - 05F6EF4AAFEC4BA4A454046B /* ScNetwork.hpp in Headers */, - AC4C9184C93A4113A6BEEC60 /* ScSocket.hpp in Headers */, - A962C2EF5FA6429C92318441 /* ScObject.hpp in Headers */, - E09450B2440E465CBCE62DEB /* ScRide.hpp in Headers */, - A2EC8BBCB8AD49ECB1C22F9D /* ScClimate.hpp in Headers */, - 2AE59B9E2E4D496286970915 /* ScDate.hpp in Headers */, - 7930E9462549403181C5D164 /* ScMap.hpp in Headers */, - 43D56A4FA1734F25995F4968 /* ScPark.hpp in Headers */, - 0AFABA9549854247A5C61D52 /* ScScenario.hpp in Headers */, - F8A3BFA6806D448B86F1FF6A /* ScTile.hpp in Headers */, - D274ADAB9B644AC581EA2299 /* ScVehicle.hpp in Headers */, - 428B1DADD66C4829894AD0A1 /* ScGuest.hpp in Headers */, - D7B575F07C4D4E42887C72AA /* ScPeep.hpp in Headers */, - 9DF65BAE250C4307AE5794DB /* ScStaff.hpp in Headers */, - 359328A3A65D49578912CA40 /* ScLitter.hpp in Headers */, - 97C222A2A4F543E9AEC3912B /* ScPlayerGroup.hpp in Headers */, - 2D0A43F28D5747C9B617F342 /* ScPlayer.hpp in Headers */, - 63858E295E3F451283987982 /* ScRideStation.hpp in Headers */, - AD5EC8B5EBF240B3874BC581 /* ScParkMessage.hpp in Headers */, - DEC539DE402F4B8993E4C357 /* ScTileElement.hpp in Headers */, - E6C71B6165224F65AA87E65B /* RideUseSystem.h in Headers */, - C8D612EB56BD4214BEC0F7FF /* GroupVector.hpp in Headers */, - B2F44E535BD14A03BE8B9D14 /* ZipStream.hpp in Headers */, - F1BE1CB5525C4FF794A3F3CE /* ChangeMapSizeAction.h in Headers */, - B769EFE0AA1149AE93C15DED /* OrcaStream.hpp in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D497D0771C20FD52002BF46A /* OpenRCT2 */ = { - isa = PBXNativeTarget; - buildConfigurationList = D497D0891C20FD53002BF46A /* Build configuration list for PBXNativeTarget "OpenRCT2" */; - buildPhases = ( - 4CF67195206B7BEF0034ADDD /* Download JSON objects */, - D4E09E831E049C0600F53CE3 /* Download Title Sequences */, - D4CA88671D4E962100060C11 /* Get Git Variables */, - D497D0741C20FD52002BF46A /* Sources */, - D497D0751C20FD52002BF46A /* Frameworks */, - D41B74201C210B190080A7B9 /* Embed Frameworks */, - D42C09D21C254F4E00309751 /* Build g2.dat */, - D497D0761C20FD52002BF46A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F76C88901EC5325700FA49E2 /* PBXTargetDependency */, - C68B2D491EC790970020651C /* PBXTargetDependency */, - ); - name = OpenRCT2; - productName = OpenRCT2; - productReference = D497D0781C20FD52002BF46A /* OpenRCT2.app */; - productType = "com.apple.product-type.application"; - }; - F76C80991EC4D9FA00FA49E2 /* libopenrct2 */ = { - isa = PBXNativeTarget; - buildConfigurationList = F76C809D1EC4D9FA00FA49E2 /* Build configuration list for PBXNativeTarget "libopenrct2" */; - buildPhases = ( - F76C809F1EC4DB0300FA49E2 /* Get Git Variables */, - F76C80961EC4D9FA00FA49E2 /* Sources */, - F76C88381EC4EB5900FA49E2 /* Resources */, - F76C80981EC4D9FA00FA49E2 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - C68B2D4B1EC7909B0020651C /* PBXTargetDependency */, - ); - name = libopenrct2; - productName = libopenrct2; - productReference = F76C809A1EC4D9FA00FA49E2 /* libopenrct2.a */; - productType = "com.apple.product-type.library.static"; - }; - F7D774831EC66CD700BE6EBC /* OpenRCT2-cli */ = { - isa = PBXNativeTarget; - buildConfigurationList = F7D7748A1EC66CD700BE6EBC /* Build configuration list for PBXNativeTarget "OpenRCT2-cli" */; - buildPhases = ( - F7D7748C1EC66E9300BE6EBC /* Get Git Variables */, - F7D774801EC66CD700BE6EBC /* Sources */, - F7D774811EC66CD700BE6EBC /* Frameworks */, - F7D774821EC66CD700BE6EBC /* Embed Frameworks */, - F7D774AA1EC6740D00BE6EBC /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - C68B2D4D1EC7909E0020651C /* PBXTargetDependency */, - ); - name = "OpenRCT2-cli"; - productName = "OpenRCT2-cli"; - productReference = F7D774841EC66CD700BE6EBC /* OpenRCT2-cli */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D497D0701C20FD52002BF46A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = OpenRCT2; - TargetAttributes = { - C68B2D431EC790690020651C = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - }; - D497D0771C20FD52002BF46A = { - CreatedOnToolsVersion = 7.2; - SystemCapabilities = { - com.apple.HardenedRuntime = { - enabled = 1; - }; - }; - }; - F76C80991EC4D9FA00FA49E2 = { - CreatedOnToolsVersion = 8.3.2; - ProvisioningStyle = Automatic; - }; - F7D774831EC66CD700BE6EBC = { - CreatedOnToolsVersion = 8.3.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = D497D0731C20FD52002BF46A /* Build configuration list for PBXProject "OpenRCT2" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - English, - en, - Base, - ); - mainGroup = D497D06F1C20FD52002BF46A; - productRefGroup = D497D0791C20FD52002BF46A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D497D0771C20FD52002BF46A /* OpenRCT2 */, - F76C80991EC4D9FA00FA49E2 /* libopenrct2 */, - F7D774831EC66CD700BE6EBC /* OpenRCT2-cli */, - C68B2D431EC790690020651C /* Download Libraries */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - D497D0761C20FD52002BF46A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF67197206B7E720034ADDD /* object in Resources */, - D4EC48E61C2637710024B507 /* g2.dat in Resources */, - D4EC48E71C2637710024B507 /* language in Resources */, - F79F428F1F3260F1009E42F8 /* changelog.txt in Resources */, - D43407E21D0E14CE00C2B3D4 /* shaders in Resources */, - D4EC48E81C2637710024B507 /* sequence in Resources */, - 631D7A3625F590A100EA2B45 /* openrct2.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F76C88381EC4EB5900FA49E2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 4CF67195206B7BEF0034ADDD /* Download JSON objects */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Download JSON objects"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "version=\"1.0.20\"\nzipname=\"objects.zip\"\nliburl=\"https://github.com/OpenRCT2/objects/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/object\" || ! -e \"${SRCROOT}/objectsversion\" || $(head -n 1 \"${SRCROOT}/objectsversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/object\" ]]; then rm -r \"${SRCROOT}/data/object\"; fi\nmkdir -p \"${SRCROOT}/data/object\"\n\ncurl -fLo \"${SRCROOT}/data/object/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/object\" \"${SRCROOT}/data/object/$zipname\"\nrm \"${SRCROOT}/data/object/$zipname\"\n\necho $version > \"${SRCROOT}/objectsversion\"\nfi\n"; - }; - C68B2D471EC790710020651C /* Download Libraries */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Download Libraries"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "version=\"28\"\nzipname=\"openrct2-libs-v28-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -fLo \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n"; - }; - D42C09D21C254F4E00309751 /* Build g2.dat */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/resources/g2/*", - ); - name = "Build g2.dat"; - outputPaths = ( - "$(SRCROOT)/data/g2.dat", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}\" sprite build \"${SRCROOT}/data/g2.dat\" \"${SRCROOT}/resources/g2/sprites.json\"\n"; - }; - D4CA88671D4E962100060C11 /* Get Git Variables */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Get Git Variables"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/gitversion.h", - "$(DERIVED_FILE_DIR)/Info.plist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"#define\" OPENRCT2_VERSION_TAG \\\"$(git describe HEAD | sed -E 's/-g.+$//')\\\" > \"${DERIVED_FILE_DIR}/gitversion.h\"\n\nbranch=$(git rev-parse --abbrev-ref HEAD)\nif [ \"$branch\" != \"master\" ]; then\necho \"#define\" OPENRCT2_BRANCH \\\"$branch\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\nshortsha1=$(git rev-parse --short HEAD)\nif [ \"$shortsha1\" != \"HEAD\" ]; then\necho \"#define\" OPENRCT2_COMMIT_SHA1_SHORT \\\"$shortsha1\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\ncp \"${SRCROOT}/distribution/macos/Info.plist\" \"${DERIVED_FILE_DIR}/Info.plist\"\nplutil -replace CFBundleVersion -string \"$(git rev-parse --short HEAD)\" \"${DERIVED_FILE_DIR}/Info.plist\"\n"; - showEnvVarsInLog = 0; - }; - D4E09E831E049C0600F53CE3 /* Download Title Sequences */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Download Title Sequences"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "version=\"0.1.2c\"\nzipname=\"title-sequences.zip\"\nliburl=\"https://github.com/OpenRCT2/title-sequences/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/sequence\" || ! -e \"${SRCROOT}/sequencesversion\" || $(head -n 1 \"${SRCROOT}/sequencesversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/sequence\" ]]; then rm -r \"${SRCROOT}/data/sequence\"; fi\nmkdir -p \"${SRCROOT}/data/sequence\"\n\ncurl -fLo \"${SRCROOT}/data/sequence/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/sequence\" \"${SRCROOT}/data/sequence/$zipname\"\nrm \"${SRCROOT}/data/sequence/$zipname\"\n\necho $version > \"${SRCROOT}/sequencesversion\"\nfi\n"; - }; - F76C809F1EC4DB0300FA49E2 /* Get Git Variables */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Get Git Variables"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/gitversion.h", - "$(DERIVED_FILE_DIR)/Info.plist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"#define\" OPENRCT2_VERSION_TAG \\\"$(git describe HEAD | sed -E 's/-g.+$//')\\\" > \"${DERIVED_FILE_DIR}/gitversion.h\"\n\nbranch=$(git rev-parse --abbrev-ref HEAD)\nif [ \"$branch\" != \"master\" ]; then\necho \"#define\" OPENRCT2_BRANCH \\\"$branch\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\nshortsha1=$(git rev-parse --short HEAD)\nif [ \"$shortsha1\" != \"HEAD\" ]; then\necho \"#define\" OPENRCT2_COMMIT_SHA1_SHORT \\\"$shortsha1\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\ncp \"${SRCROOT}/distribution/macos/Info.plist\" \"${DERIVED_FILE_DIR}/Info.plist\"\nplutil -replace CFBundleVersion -string \"$(git rev-parse --short HEAD)\" \"${DERIVED_FILE_DIR}/Info.plist\"\n"; - showEnvVarsInLog = 0; - }; - F7D7748C1EC66E9300BE6EBC /* Get Git Variables */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Get Git Variables"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/gitversion.h", - "$(DERIVED_FILE_DIR)/Info.plist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"#define\" OPENRCT2_VERSION_TAG \\\"$(git describe HEAD | sed -E 's/-g.+$//')\\\" > \"${DERIVED_FILE_DIR}/gitversion.h\"\n\nbranch=$(git rev-parse --abbrev-ref HEAD)\nif [ \"$branch\" != \"master\" ]; then\necho \"#define\" OPENRCT2_BRANCH \\\"$branch\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\nshortsha1=$(git rev-parse --short HEAD)\nif [ \"$shortsha1\" != \"HEAD\" ]; then\necho \"#define\" OPENRCT2_COMMIT_SHA1_SHORT \\\"$shortsha1\\\" >> \"${DERIVED_FILE_DIR}/gitversion.h\"\nfi\n\ncp \"${SRCROOT}/distribution/macos/Info.plist\" \"${DERIVED_FILE_DIR}/Info.plist\"\nplutil -replace CFBundleVersion -string \"$(git rev-parse --short HEAD)\" \"${DERIVED_FILE_DIR}/Info.plist\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D497D0741C20FD52002BF46A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C68313CB1FDB4EEC006DB3D8 /* Tooltip.cpp in Sources */, - 4CB1375621C2E9F80029FCDA /* SimulateCommands.cpp in Sources */, - C654DF2F1F69C0430040F43D /* Error.cpp in Sources */, - 4CB2716A24195B45000CF9EE /* VehicleSubpositionData.cpp in Sources */, - C64644F81F3FA4120026AC2D /* ClearScenery.cpp in Sources */, - C654DF2E1F69C0430040F43D /* DemolishRidePrompt.cpp in Sources */, - C6D2BEE21F9BAA6C008B557C /* Ride.cpp in Sources */, - C666EE7C1F37ACB10061AA04 /* TitleLogo.cpp in Sources */, - 932A212022D73CFA00C57EDB /* GameAction.cpp in Sources */, - F76C88781EC5324E00FA49E2 /* AudioChannel.cpp in Sources */, - C666EE6D1F37ACB10061AA04 /* Cheats.cpp in Sources */, - C685E5191F8907850090598F /* NewRide.cpp in Sources */, - 9346F9DB208A191900C77D91 /* GuestPathfinding.cpp in Sources */, - C654DF361F69C0430040F43D /* Player.cpp in Sources */, - 933F2CB720935653001B33FD /* LocalisationService.cpp in Sources */, - 4C8BB68225533D65005C8830 /* StringReader.cpp in Sources */, - 4C255958244A328B00CE7E45 /* CustomMenu.cpp in Sources */, - F76C88791EC5324E00FA49E2 /* AudioContext.cpp in Sources */, - C666EE7A1F37ACB10061AA04 /* Themes.cpp in Sources */, - C666EE7F1F37ACB10061AA04 /* Viewport.cpp in Sources */, - C632C81F1F8A445700781F6D /* RideList.cpp in Sources */, - C68878C420289B710084B384 /* OpenGLAPI.cpp in Sources */, - 933CBDBB20CB1B3F00134678 /* TitleSequencePlayer.cpp in Sources */, - 4C2BF6C4258FF2FB005CD9A0 /* SingleRailRollerCoaster.cpp in Sources */, - 930EEA6A24FC00950070314E /* ScenarioSelect.cpp in Sources */, - C654DF3C1F69C0430040F43D /* TrackDesignManage.cpp in Sources */, - C64645001F3FA4120026AC2D /* ViewClipping.cpp in Sources */, - 4C91FD6225AE483700CA5DA4 /* RideAudio.cpp in Sources */, - C68878C020289B710084B384 /* ApplyPaletteShader.cpp in Sources */, - C666EE791F37ACB10061AA04 /* ServerStart.cpp in Sources */, - C61ADB231FBBCB8B0024F2EF /* GameBottomToolbar.cpp in Sources */, - 4C81F7E124672C4D000E61BF /* CustomListView.cpp in Sources */, - 4C1EE63D24AB4A2700D7177F /* HybridCoaster.cpp in Sources */, - 6341F4E22400AA0F0052902B /* Drawing.Sprite.BMP.cpp in Sources */, - C666EE7E1F37ACB10061AA04 /* TitleOptions.cpp in Sources */, - F76C887A1EC5324E00FA49E2 /* AudioMixer.cpp in Sources */, - C68313C81FDB4ED4006DB3D8 /* MouseInput.cpp in Sources */, - C68878C920289B710084B384 /* TextureCache.cpp in Sources */, - C61ADB1F1FB6A0A70024F2EF /* TopToolbar.cpp in Sources */, - F76C887B1EC5324E00FA49E2 /* FileAudioSource.cpp in Sources */, - C68878CA20289B710084B384 /* TransparencyDepth.cpp in Sources */, - C64644FD1F3FA4120026AC2D /* Land.cpp in Sources */, - C68878CB20289B710084B384 /* HardwareDisplayDrawingEngine.cpp in Sources */, - C666EE6B1F37ACB10061AA04 /* About.cpp in Sources */, - C666ED771F33DBB20061AA04 /* ShortcutKeys.cpp in Sources */, - 6341F4E12400AA0F0052902B /* Drawing.Sprite.RLE.cpp in Sources */, - C666EE6C1F37ACB10061AA04 /* Changelog.cpp in Sources */, - C64644FC1F3FA4120026AC2D /* Footpath.cpp in Sources */, - 4C882FBA25FEA80E0039D1C4 /* TrainManager.cpp in Sources */, - F76C887C1EC5324E00FA49E2 /* MemoryAudioSource.cpp in Sources */, - C654DF3D1F69C0430040F43D /* TrackDesignPlace.cpp in Sources */, - C666EE721F37ACB10061AA04 /* Multiplayer.cpp in Sources */, - 01C6F0C822FD51FC0057E2F7 /* T6Exporter.cpp in Sources */, - C654DF371F69C0430040F43D /* Sign.cpp in Sources */, - 93CBA4C920A7504500867D56 /* ImageImporter.cpp in Sources */, - 933CBDB620CB1ACD00134678 /* Theme.cpp in Sources */, - 93CBA4C020A74FF200867D56 /* BitmapReader.cpp in Sources */, - 01DDFE6522FD608500221318 /* Window_internal.cpp in Sources */, - C68878CC20289B710084B384 /* SoftwareDrawingEngine.cpp in Sources */, - C67CCD681FBBD138004FAE4C /* EditorMain.cpp in Sources */, - C6E415511FAFD6DC00D4A52A /* RideConstruction.cpp in Sources */, - 932A211F22D73CFA00C57EDB /* GameActionRegistration.cpp in Sources */, - 4C8BB67925533D4C005C8830 /* FileStream.cpp in Sources */, - 933CBDBD20CB1BA900134678 /* ViewportInteraction.cpp in Sources */, - C685E51B1F8907850090598F /* Guest.cpp in Sources */, - 4CA23DB2263C920900077AA1 /* Entity.cpp in Sources */, - C64644F91F3FA4120026AC2D /* EditorInventionsList.cpp in Sources */, - C68878C720289B710084B384 /* OpenGLShaderProgram.cpp in Sources */, - 4C976BC5263976F0002DEBD5 /* FootpathSurfaceObject.cpp in Sources */, - 4CA39E512513F8A00094066B /* RTL.ICU.cpp in Sources */, - 93CBA4C420A7502E00867D56 /* Imaging.cpp in Sources */, - C6D2BEE61F9BAACE008B557C /* TrackList.cpp in Sources */, - 4CB991CB25CEE54500C692B4 /* ShortcutManager.cpp in Sources */, - C666EE701F37ACB10061AA04 /* LandRights.cpp in Sources */, - 93F6004D213DD7DD00EEB83E /* TerrainEdgeObject.cpp in Sources */, - 4C724B2221F0AD790012ADD0 /* BenchSpriteSort.cpp in Sources */, - C666EE781F37ACB10061AA04 /* ServerList.cpp in Sources */, - C654DF341F69C0430040F43D /* NewCampaign.cpp in Sources */, - F76C887D1EC5324E00FA49E2 /* CursorData.cpp in Sources */, - C68878C520289B710084B384 /* OpenGLDrawingEngine.cpp in Sources */, - C6D2BEE71F9BAACE008B557C /* MapTooltip.cpp in Sources */, - C666EE7B1F37ACB10061AA04 /* TitleExit.cpp in Sources */, - 4C976BC6263976F0002DEBD5 /* FootpathRailingsObject.cpp in Sources */, - F7D7747F1EC61E5100BE6EBC /* UiContext.macOS.mm in Sources */, - F76C887E1EC5324E00FA49E2 /* CursorRepository.cpp in Sources */, - C654DF331F69C0430040F43D /* LoadSave.cpp in Sources */, - C61ADB211FB7DC060024F2EF /* Scenery.cpp in Sources */, - C68878C120289B710084B384 /* ApplyTransparencyShader.cpp in Sources */, - 4CB991C525CEE53B00C692B4 /* InputManager.cpp in Sources */, - 304FE95023A2996600470197 /* SceneryScatter.cpp in Sources */, - C685E51C1F8907850090598F /* Map.cpp in Sources */, - 4C255959244A328B00CE7E45 /* UiExtensions.cpp in Sources */, - 01C6F0C922FD51FC0057E2F7 /* T6Importer.cpp in Sources */, - 4CC5258223A19C2900D4366D /* TrackDesignAction.cpp in Sources */, - C654DF381F69C0430040F43D /* StaffFirePrompt.cpp in Sources */, - C68313D51FDB4F4C006DB3D8 /* Graph.cpp in Sources */, - C685E51D1F8907850090598F /* Research.cpp in Sources */, - 4CA39E522513F8A00094066B /* RTL.FriBidi.cpp in Sources */, - 01C6F0C422FD51B70057E2F7 /* T4Importer.cpp in Sources */, - C64644FB1F3FA4120026AC2D /* EditorScenarioOptions.cpp in Sources */, - 93F60050213DD7E400EEB83E /* StationObject.cpp in Sources */, - C654DF321F69C0430040F43D /* InstallTrack.cpp in Sources */, - C64644FF1F3FA4120026AC2D /* StaffList.cpp in Sources */, - 932A211E22D73CFA00C57EDB /* GameActionCompat.cpp in Sources */, - 4C29DEB3218C6AE500E8707F /* RCT12.cpp in Sources */, - C6D2BEE81F9BAACE008B557C /* MazeConstruction.cpp in Sources */, - 4C8A6FF323EB5326001A8255 /* Http.cURL.cpp in Sources */, - C666EE771F37ACB10061AA04 /* SavePrompt.cpp in Sources */, - C654DF391F69C0430040F43D /* TitleCommandEditor.cpp in Sources */, - C61FB2731FA3E25D0095FB9D /* TextInput.cpp in Sources */, - 4C91FD5F25AE476700CA5DA4 /* MusicObject.cpp in Sources */, - C62D83871FCC7D1A008C04F1 /* EditorObjectSelection.cpp in Sources */, - 4C3B4236205914F7000C5BB7 /* InGameConsole.cpp in Sources */, - 4CB991CD25CEE54500C692B4 /* ShortcutInput.cpp in Sources */, - C68878C820289B710084B384 /* SwapFramebuffer.cpp in Sources */, - C67CCD661FBBCFDB004FAE4C /* EditorBottomToolbar.cpp in Sources */, - C654DF351F69C0430040F43D /* Park.cpp in Sources */, - 4C8BB68525533DB9005C8830 /* ZoomLevel.cpp in Sources */, - C654DF3A1F69C0430040F43D /* TitleEditor.cpp in Sources */, - C666EE6F1F37ACB10061AA04 /* DebugPaint.cpp in Sources */, - F7CB863F1EEDA0B50030C877 /* WindowManager.cpp in Sources */, - C68878C620289B710084B384 /* OpenGLFramebuffer.cpp in Sources */, - C654DF301F69C0430040F43D /* Finances.cpp in Sources */, - 9308DA01209908090079EE96 /* Surface.cpp in Sources */, - 933CBDBF20CB1BCA00134678 /* Window.cpp in Sources */, - 4C25595A244A328B00CE7E45 /* CustomWindow.cpp in Sources */, - C68878C320289B710084B384 /* DrawRectShader.cpp in Sources */, - C666EE751F37ACB10061AA04 /* NewsOptions.cpp in Sources */, - C654DF311F69C0430040F43D /* GuestList.cpp in Sources */, - 4C8BB67C25533D59005C8830 /* JobPool.cpp in Sources */, - 01C6F0C222FD519E0057E2F7 /* TrackImporter.cpp in Sources */, - 4C8BB68125533D65005C8830 /* StringBuilder.cpp in Sources */, - 4CA23D64263C91D800077AA1 /* ChecksumStream.cpp in Sources */, - C666EE761F37ACB10061AA04 /* Options.cpp in Sources */, - 4CB991CC25CEE54500C692B4 /* Shortcuts.cpp in Sources */, - C666EE6E1F37ACB10061AA04 /* CustomCurrency.cpp in Sources */, - C654DF2D1F69C0430040F43D /* Banner.cpp in Sources */, - C666EE711F37ACB10061AA04 /* MapGen.cpp in Sources */, - 4CB30179249E382B0034A7F6 /* RCT2.cpp in Sources */, - C6D2BEEA1F9BB83C008B557C /* NetworkStatus.cpp in Sources */, - C64645011F3FA4120026AC2D /* Water.cpp in Sources */, - C61FB2721FA3E25D0095FB9D /* ObjectLoadError.cpp in Sources */, - C68D98BC1FC6B8AB008E8378 /* TileInspector.cpp in Sources */, - C64644FA1F3FA4120026AC2D /* EditorObjectiveOptions.cpp in Sources */, - C666EE741F37ACB10061AA04 /* News.cpp in Sources */, - F76C888A1EC5324E00FA49E2 /* TextComposition.cpp in Sources */, - C68313CC1FDB4EEC006DB3D8 /* Dropdown.cpp in Sources */, - C68313D61FDB4F4C006DB3D8 /* LandTool.cpp in Sources */, - C64644FE1F3FA4120026AC2D /* Main.cpp in Sources */, - C68878C220289B710084B384 /* DrawLineShader.cpp in Sources */, - F76C888B1EC5324E00FA49E2 /* Ui.cpp in Sources */, - C685E51A1F8907850090598F /* Staff.cpp in Sources */, - C9C630B62235A22D009AD16E /* GameStateSnapshots.cpp in Sources */, - F76C888C1EC5324E00FA49E2 /* UiContext.cpp in Sources */, - C666EE7D1F37ACB10061AA04 /* TitleMenu.cpp in Sources */, - 93F6004C213DD7DD00EEB83E /* TerrainSurfaceObject.cpp in Sources */, - 933CBDB520CB1ACD00134678 /* Widget.cpp in Sources */, - 9308D9FE209908090079EE96 /* TileElement.cpp in Sources */, - F76C888D1EC5324E00FA49E2 /* UiContext.Linux.cpp in Sources */, - 9346F9D8208A191900C77D91 /* Guest.cpp in Sources */, - 4C358E5221C445F700ADE6BC /* ReplayManager.cpp in Sources */, - F76C888E1EC5324E00FA49E2 /* UiContext.Win32.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F76C80961EC4D9FA00FA49E2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F7C44AF82030E8D3007E099F /* AVX2Drawing.cpp in Sources */, - 66A10FAE257F1E1800DD651A /* SmallSceneryPlaceAction.cpp in Sources */, - F70839931FFC0B61002DCEFA /* Scenario.cpp in Sources */, - C688791C20289B9B0084B384 /* Facility.cpp in Sources */, - C688790C20289B9B0084B384 /* CarRide.cpp in Sources */, - 66A10F75257F1E1800DD651A /* RideSetPriceAction.cpp in Sources */, - 66A10F6D257F1E1800DD651A /* ParkSetParameterAction.cpp in Sources */, - C688786820289A4A0084B384 /* Util.cpp in Sources */, - C688792720289B9B0084B384 /* TopSpin.cpp in Sources */, - C688787E20289ADE0084B384 /* Drawing.cpp in Sources */, - 93AE238A252F948A00CD03C3 /* Formatter.cpp in Sources */, - C68878A120289B200084B384 /* Localisation.cpp in Sources */, - C68878ED20289B9B0084B384 /* BobsleighCoaster.cpp in Sources */, - C688785E20289A0A0084B384 /* Fountain.cpp in Sources */, - F7CB864E1EEDA2050030C877 /* DummyWindowManager.cpp in Sources */, - C688789E20289B200084B384 /* FormatCodes.cpp in Sources */, - C688785820289A0A0084B384 /* Balloon.cpp in Sources */, - C688788820289ADE0084B384 /* X8DrawingEngine.cpp in Sources */, - 66A10F6A257F1E1800DD651A /* LargeScenerySetColourAction.cpp in Sources */, - 9329D520240C17C60054301C /* BenchUpdate.cpp in Sources */, - F775F5381EE3725C001F00E7 /* DummyAudioContext.cpp in Sources */, - F775F5351EE35A89001F00E7 /* DummyUiContext.cpp in Sources */, - 2A1F4FE1221FF4B0003CA045 /* Audio.cpp in Sources */, - C688790920289B9B0084B384 /* WildMouse.cpp in Sources */, - C688791420289B9B0084B384 /* Maze.cpp in Sources */, - 66A10ED8257F1DF800DD651A /* BannerSetColourAction.cpp in Sources */, - C688784C202899BE0084B384 /* Game.cpp in Sources */, - F76C85B41EC4E88300FA49E2 /* AudioMixer.cpp in Sources */, - F76C85B71EC4E88300FA49E2 /* NullAudioSource.cpp in Sources */, - C68878E720289B9B0084B384 /* Platform.Posix.cpp in Sources */, - 66A10F93257F1E1800DD651A /* LandSmoothAction.cpp in Sources */, - C68878CE20289B9B0084B384 /* ObjectList.cpp in Sources */, - C688788120289ADE0084B384 /* Line.cpp in Sources */, - 93CBA4CA20A7504500867D56 /* ImageImporter.cpp in Sources */, - 66A10F7F257F1E1800DD651A /* MazePlaceTrackAction.cpp in Sources */, - C688792520289B9B0084B384 /* RotoDrop.cpp in Sources */, - F76C85BA1EC4E88300FA49E2 /* CommandLine.cpp in Sources */, - C68878EE20289B9B0084B384 /* BolligerMabillardTrack.cpp in Sources */, - 93F76F0420BFF77B00D4512C /* Paint.Banner.cpp in Sources */, - F76C85BC1EC4E88300FA49E2 /* ConvertCommand.cpp in Sources */, - F76C85BD1EC4E88300FA49E2 /* RootCommands.cpp in Sources */, - C688791320289B9B0084B384 /* HauntedHouse.cpp in Sources */, - C688786E20289A6F0084B384 /* Vehicle.cpp in Sources */, - F76C85BE1EC4E88300FA49E2 /* ScreenshotCommands.cpp in Sources */, - C688786320289A0A0084B384 /* MapHelpers.cpp in Sources */, - F76C85BF1EC4E88300FA49E2 /* SpriteCommands.cpp in Sources */, - 66A10F76257F1E1800DD651A /* SmallSceneryRemoveAction.cpp in Sources */, - F76C85C01EC4E88300FA49E2 /* UriHandler.cpp in Sources */, - C688786220289A0A0084B384 /* MapGen.cpp in Sources */, - C68878A820289B2A0084B384 /* NewsItem.cpp in Sources */, - 93F76EED20BFF6F900D4512C /* Drawing.Sprite.cpp in Sources */, - 933F2CB820935653001B33FD /* LocalisationService.cpp in Sources */, - F76C85C41EC4E88300FA49E2 /* Config.cpp in Sources */, - 66A10EC4257F1DF800DD651A /* FootpathAdditionPlaceAction.cpp in Sources */, - C688792920289B9B0084B384 /* Chairlift.cpp in Sources */, - 20DE495F25DA8C6B00F2DF6D /* TileElementBase.cpp in Sources */, - C68878A020289B200084B384 /* LanguagePack.cpp in Sources */, - F76C85C71EC4E88300FA49E2 /* IniReader.cpp in Sources */, - 93F76F0020BFF77B00D4512C /* Paint.Path.cpp in Sources */, - F76C85C91EC4E88300FA49E2 /* IniWriter.cpp in Sources */, - C688792620289B9B0084B384 /* SwingingInverterShip.cpp in Sources */, - 93F76EF220BFF74200D4512C /* Localisation.Date.cpp in Sources */, - F76C85CC1EC4E88300FA49E2 /* Context.cpp in Sources */, - C68878E220289B9B0084B384 /* Staff.cpp in Sources */, - 66A10F7E257F1E1800DD651A /* RideSetColourSchemeAction.cpp in Sources */, - F76C85CF1EC4E88300FA49E2 /* Console.cpp in Sources */, - C68878DC20289B9B0084B384 /* Painter.cpp in Sources */, - 933C55B524B858490057E64B /* SeaDecrypt.cpp in Sources */, - C688790120289B9B0084B384 /* ReverserRollerCoaster.cpp in Sources */, - C688786120289A0A0084B384 /* MapAnimation.cpp in Sources */, - F76C85D11EC4E88300FA49E2 /* Diagnostics.cpp in Sources */, - 66A10FB0257F1E1800DD651A /* SignSetStyleAction.cpp in Sources */, - F76C85D41EC4E88300FA49E2 /* File.cpp in Sources */, - C688790220289B9B0084B384 /* SideFrictionRollerCoaster.cpp in Sources */, - F76C85D61EC4E88300FA49E2 /* FileScanner.cpp in Sources */, - 66A10F59257F1E1700DD651A /* SetCheatAction.cpp in Sources */, - C68878F820289B9B0084B384 /* LayDownRollerCoaster.cpp in Sources */, - C6887856202899FA0084B384 /* Scenery.cpp in Sources */, - C688785D20289A0A0084B384 /* Footpath.cpp in Sources */, - F76C85D91EC4E88300FA49E2 /* Guard.cpp in Sources */, - C688790520289B9B0084B384 /* SuspendedSwingingCoaster.cpp in Sources */, - C68878E920289B9B0084B384 /* Posix.cpp in Sources */, - 66A10EA2257F1DE100DD651A /* BalloonPressAction.cpp in Sources */, - D48AFDB71EF78DBF0081C644 /* BenchGfxCommmands.cpp in Sources */, - 66A10F79257F1E1800DD651A /* RideCreateAction.cpp in Sources */, - C688790320289B9B0084B384 /* StandUpRollerCoaster.cpp in Sources */, - C62D838A1FD36D6F008C04F1 /* EditorObjectSelectionSession.cpp in Sources */, - C6887851202899EA0084B384 /* Wall.cpp in Sources */, - F76C85DB1EC4E88300FA49E2 /* IStream.cpp in Sources */, - C688785A20289A0A0084B384 /* Climate.cpp in Sources */, - 66A10FA8257F1E1800DD651A /* RideEntranceExitRemoveAction.cpp in Sources */, - C68878A920289B2A0084B384 /* Research.cpp in Sources */, - 66A10F61257F1E1700DD651A /* PlaceParkEntranceAction.cpp in Sources */, - C6887850202899D40084B384 /* Cheats.cpp in Sources */, - C688784D202899C40084B384 /* Diagnostic.cpp in Sources */, - C688787020289A6F0084B384 /* VehiclePaint.cpp in Sources */, - 93F76F0320BFF77B00D4512C /* Paint.SmallScenery.cpp in Sources */, - F76C85DD1EC4E88300FA49E2 /* Json.cpp in Sources */, - C688793120289B9B0084B384 /* RiverRapids.cpp in Sources */, - F76C85E11EC4E88300FA49E2 /* MemoryStream.cpp in Sources */, - F76C85E41EC4E88300FA49E2 /* Path.cpp in Sources */, - F76C85E71EC4E88300FA49E2 /* String.cpp in Sources */, - C68878DE20289B9B0084B384 /* Supports.cpp in Sources */, - C688791720289B9B0084B384 /* MiniHelicopters.cpp in Sources */, - 93B4DC1525487CDF008D63FF /* Formatting.cpp in Sources */, - 66A10EC3257F1DF800DD651A /* FootpathPlaceFromTrackAction.cpp in Sources */, - C688784F202899D00084B384 /* CmdlineSprite.cpp in Sources */, - F76C85EE1EC4E88300FA49E2 /* Zip.cpp in Sources */, - C688793220289B9B0084B384 /* SplashBoats.cpp in Sources */, - 66A10FB2257F1E1800DD651A /* LargeSceneryRemoveAction.cpp in Sources */, - F76C85F91EC4E88300FA49E2 /* Image.cpp in Sources */, - C68878FF20289B9B0084B384 /* MultiDimensionRollerCoaster.cpp in Sources */, - 66A10F58257F1E1700DD651A /* StaffSetNameAction.cpp in Sources */, - 66A10F6C257F1E1800DD651A /* LoadOrQuitAction.cpp in Sources */, - C688789220289B140084B384 /* FontFamilies.cpp in Sources */, - C68878F120289B9B0084B384 /* FlyingRollerCoaster.cpp in Sources */, - C688792B20289B9B0084B384 /* MiniatureRailway.cpp in Sources */, - F76C85FD1EC4E88300FA49E2 /* NewDrawing.cpp in Sources */, - F76C85FF1EC4E88300FA49E2 /* Weather.cpp in Sources */, - C688785920289A0A0084B384 /* Banner.cpp in Sources */, - C68878EC20289B9B0084B384 /* AirPoweredVerticalCoaster.cpp in Sources */, - 66A10FAD257F1E1800DD651A /* TileModifyAction.cpp in Sources */, - C688790B20289B9B0084B384 /* WoodenWildMouse.cpp in Sources */, - C688792320289B9B0084B384 /* MotionSimulator.cpp in Sources */, - 93DE9751209C3C1000FB1CC8 /* GameState.cpp in Sources */, - C68878EF20289B9B0084B384 /* CompactInvertedCoaster.cpp in Sources */, - C68878E320289B9B0084B384 /* Android.cpp in Sources */, - 66A10F70257F1E1800DD651A /* ParkSetDateAction.cpp in Sources */, - F76C86051EC4E88300FA49E2 /* Editor.cpp in Sources */, - F76C86071EC4E88300FA49E2 /* FileClassifier.cpp in Sources */, - 66A10FDE257F1E3000DD651A /* WaterLowerAction.cpp in Sources */, - C688786920289A660084B384 /* CableLift.cpp in Sources */, - C688790020289B9B0084B384 /* ReverseFreefallCoaster.cpp in Sources */, - 93F76EF620BFF76E00D4512C /* Paint.Sprite.cpp in Sources */, - C6607F481FE2B97E00D3FC0D /* Input.cpp in Sources */, - 66A10ECC257F1DF800DD651A /* ClearAction.cpp in Sources */, - 66A10FDB257F1E3000DD651A /* WallPlaceAction.cpp in Sources */, - C688789F20289B200084B384 /* Language.cpp in Sources */, - C688791620289B9B0084B384 /* MiniGolf.cpp in Sources */, - C688787820289A780084B384 /* Track.cpp in Sources */, - 66A10ED6257F1DF800DD651A /* FootpathPlaceAction.cpp in Sources */, - F76C86491EC4E88300FA49E2 /* NetworkAction.cpp in Sources */, - C688788020289ADE0084B384 /* LightFX.cpp in Sources */, - F76C864B1EC4E88300FA49E2 /* NetworkConnection.cpp in Sources */, - F76C864D1EC4E88300FA49E2 /* NetworkGroup.cpp in Sources */, - F76C864F1EC4E88300FA49E2 /* NetworkKey.cpp in Sources */, - C688789620289B140084B384 /* Viewport.cpp in Sources */, - 93DFD05224521C1A001FCBAF /* Plugin.cpp in Sources */, - C68878A520289B2A0084B384 /* Award.cpp in Sources */, - F76C86511EC4E88300FA49E2 /* NetworkPacket.cpp in Sources */, - F76C86531EC4E88300FA49E2 /* NetworkPlayer.cpp in Sources */, - F76C86551EC4E88300FA49E2 /* NetworkServerAdvertiser.cpp in Sources */, - 93F76EFF20BFF77B00D4512C /* Paint.Wall.cpp in Sources */, - F76C86581EC4E88300FA49E2 /* NetworkUser.cpp in Sources */, - F76C865A1EC4E88300FA49E2 /* ServerList.cpp in Sources */, - F76C865C1EC4E88300FA49E2 /* Socket.cpp in Sources */, - C688784B202899B90084B384 /* Intro.cpp in Sources */, - C68878FD20289B9B0084B384 /* MiniRollerCoaster.cpp in Sources */, - 93F76EF520BFF76E00D4512C /* Paint.Peep.cpp in Sources */, - C6887857202899FD0084B384 /* Park.cpp in Sources */, - F76C86601EC4E88300FA49E2 /* BannerObject.cpp in Sources */, - 66A10FB4257F1E1800DD651A /* ScenarioSetSettingAction.cpp in Sources */, - C688792A20289B9B0084B384 /* Lift.cpp in Sources */, - F76C86621EC4E88300FA49E2 /* EntranceObject.cpp in Sources */, - 93DFD04824521C1A001FCBAF /* HookEngine.cpp in Sources */, - C688792820289B9B0084B384 /* Twist.cpp in Sources */, - C688792D20289B9B0084B384 /* SuspendedMonorail.cpp in Sources */, - C688788620289ADE0084B384 /* TTF.cpp in Sources */, - F76C86641EC4E88300FA49E2 /* FootpathItemObject.cpp in Sources */, - C688786020289A0A0084B384 /* Map.cpp in Sources */, - 9308DA02209908090079EE96 /* Surface.cpp in Sources */, - C68878DD20289B9B0084B384 /* PaintHelpers.cpp in Sources */, - F76C86661EC4E88300FA49E2 /* FootpathObject.cpp in Sources */, - 66A10F80257F1E1800DD651A /* NetworkModifyGroupAction.cpp in Sources */, - C688793420289B9B0084B384 /* WaterCoaster.cpp in Sources */, - F76C86681EC4E88300FA49E2 /* ImageTable.cpp in Sources */, - C68878E620289B9B0084B384 /* Platform.Linux.cpp in Sources */, - 93DFD04B24521C1A001FCBAF /* ScriptEngine.cpp in Sources */, - C688785B20289A0A0084B384 /* Duck.cpp in Sources */, - F76C866A1EC4E88300FA49E2 /* LargeSceneryObject.cpp in Sources */, - C688788E20289AE70084B384 /* SSE41Drawing.cpp in Sources */, - F76C866C1EC4E88400FA49E2 /* Object.cpp in Sources */, - F76C866E1EC4E88400FA49E2 /* ObjectFactory.cpp in Sources */, - 66A10FAB257F1E1800DD651A /* LandSetRightsAction.cpp in Sources */, - 93FB272124ED3601008241C9 /* Cursors.cpp in Sources */, - C68878A220289B200084B384 /* RealNames.cpp in Sources */, - 66A10F94257F1E1800DD651A /* StaffSetOrdersAction.cpp in Sources */, - 66A10EC7257F1DF800DD651A /* FootpathRemoveAction.cpp in Sources */, - C688787120289A780084B384 /* Ride.cpp in Sources */, - F76C86701EC4E88400FA49E2 /* ObjectManager.cpp in Sources */, - 66A10F52257F1E1700DD651A /* StaffSetCostumeAction.cpp in Sources */, - C688791D20289B9B0084B384 /* Shop.cpp in Sources */, - F76C86721EC4E88400FA49E2 /* ObjectRepository.cpp in Sources */, - F76C86741EC4E88400FA49E2 /* RideObject.cpp in Sources */, - C688790820289B9B0084B384 /* VirginiaReel.cpp in Sources */, - C688791B20289B9B0084B384 /* SpiralSlide.cpp in Sources */, - C688786C20289A6F0084B384 /* TrackDesign.cpp in Sources */, - C68878F220289B9B0084B384 /* GigaCoaster.cpp in Sources */, - C688792420289B9B0084B384 /* SwingingShip.cpp in Sources */, - C68878F420289B9B0084B384 /* InvertedHairpinCoaster.cpp in Sources */, - C68878A620289B2A0084B384 /* Finance.cpp in Sources */, - 66A10FA4257F1E1800DD651A /* RideSetNameAction.cpp in Sources */, - C688788720289ADE0084B384 /* TTFSDLPort.cpp in Sources */, - F76C86761EC4E88400FA49E2 /* SceneryGroupObject.cpp in Sources */, - 66A10FB1257F1E1800DD651A /* RideDemolishAction.cpp in Sources */, - C68878F620289B9B0084B384 /* InvertedRollerCoaster.cpp in Sources */, - 66A10F55257F1E1700DD651A /* SurfaceSetStyleAction.cpp in Sources */, - C68878E420289B9B0084B384 /* Linux.cpp in Sources */, - F76C86791EC4E88400FA49E2 /* SmallSceneryObject.cpp in Sources */, - 93F9DA3820B46F9D00D1BE92 /* ShopItem.cpp in Sources */, - 66A10ECD257F1DF800DD651A /* BannerRemoveAction.cpp in Sources */, - C688787720289A780084B384 /* Station.cpp in Sources */, - C68878DF20289B9B0084B384 /* VirtualFloor.cpp in Sources */, - C68878CD20289B9B0084B384 /* DefaultObjects.cpp in Sources */, - 939A359A20C12FC800630B3F /* Paint.Litter.cpp in Sources */, - C688788220289ADE0084B384 /* Rect.cpp in Sources */, - C688787320289A780084B384 /* RideRatings.cpp in Sources */, - C688790D20289B9B0084B384 /* Circus.cpp in Sources */, - C688788F20289B140084B384 /* Chat.cpp in Sources */, - C688789A20289B200084B384 /* ConversionTables.cpp in Sources */, - 66A10ED2257F1DF800DD651A /* FootpathAdditionRemoveAction.cpp in Sources */, - C688791020289B9B0084B384 /* FerrisWheel.cpp in Sources */, - C688791120289B9B0084B384 /* FlyingSaucers.cpp in Sources */, - C688784A202899B40084B384 /* input.cpp in Sources */, - F76C867D1EC4E88400FA49E2 /* StringTable.cpp in Sources */, - C688791520289B9B0084B384 /* MerryGoRound.cpp in Sources */, - F76C867F1EC4E88400FA49E2 /* WallObject.cpp in Sources */, - C68878FC20289B9B0084B384 /* MineTrainCoaster.cpp in Sources */, - C6887854202899F30084B384 /* SmallScenery.cpp in Sources */, - C68878DB20289B9B0084B384 /* Paint.cpp in Sources */, - F76C86811EC4E88400FA49E2 /* WaterObject.cpp in Sources */, - F76C86861EC4E88400FA49E2 /* OpenRCT2.cpp in Sources */, - 66A10F89257F1E1800DD651A /* PauseToggleAction.cpp in Sources */, - 66A10F66257F1E1700DD651A /* RideSetVehicleAction.cpp in Sources */, - C68878F320289B9B0084B384 /* HeartlineTwisterCoaster.cpp in Sources */, - C688788320289ADE0084B384 /* ScrollingText.cpp in Sources */, - C68878F720289B9B0084B384 /* JuniorRollerCoaster.cpp in Sources */, - 66A10F6F257F1E1800DD651A /* RideEntranceExitPlaceAction.cpp in Sources */, - 66A10F64257F1E1700DD651A /* LandRaiseAction.cpp in Sources */, - 66A10F7D257F1E1800DD651A /* ParkSetNameAction.cpp in Sources */, - C688792020289B9B0084B384 /* GoKarts.cpp in Sources */, - 66A10FD9257F1E3000DD651A /* WaterSetHeightAction.cpp in Sources */, - 939A359B20C12FC800630B3F /* Paint.Misc.cpp in Sources */, - C688792E20289B9B0084B384 /* BoatHire.cpp in Sources */, - F76C869C1EC4E88400FA49E2 /* ParkImporter.cpp in Sources */, - F76C86A31EC4E88400FA49E2 /* Crash.cpp in Sources */, - 66A10ED1257F1DF800DD651A /* CustomAction.cpp in Sources */, - 2A1F4FE2221FF4B0003CA045 /* macos.mm in Sources */, - C688789420289B140084B384 /* Screenshot.cpp in Sources */, - 9346F9DC208A191900C77D91 /* GuestPathfinding.cpp in Sources */, - C688790620289B9B0084B384 /* TwisterRollerCoaster.cpp in Sources */, - C688786720289A4A0084B384 /* SawyerCoding.cpp in Sources */, - 93F9DA3B20B4701100D1BE92 /* StdInOutConsole.cpp in Sources */, - 66A10FA1257F1E1800DD651A /* SmallScenerySetColourAction.cpp in Sources */, - 66A10F95257F1E1800DD651A /* GuestSetFlagsAction.cpp in Sources */, - 66A10FB5257F1E1800DD651A /* SignSetNameAction.cpp in Sources */, - 66A10FDC257F1E3000DD651A /* TrackPlaceAction.cpp in Sources */, - 9344BEFA20C1E6180047D165 /* Crypt.OpenSSL.cpp in Sources */, - 66A10ECB257F1DF800DD651A /* BannerSetStyleAction.cpp in Sources */, - 93F76F0520BFF77B00D4512C /* Paint.TileElement.cpp in Sources */, - C68878FE20289B9B0084B384 /* MiniSuspendedCoaster.cpp in Sources */, - F76C86AD1EC4E88400FA49E2 /* PlatformEnvironment.cpp in Sources */, - 66A10F6B257F1E1800DD651A /* ParkSetLoanAction.cpp in Sources */, - 66A10FE0257F1E3000DD651A /* WallRemoveAction.cpp in Sources */, - 66A10FBB257F1E1800DD651A /* LargeSceneryPlaceAction.cpp in Sources */, - 66A10F7A257F1E1800DD651A /* RideSetSettingAction.cpp in Sources */, - C688791220289B9B0084B384 /* GhostTrain.cpp in Sources */, - C688787F20289ADE0084B384 /* Font.cpp in Sources */, - 93CBA4C520A7502E00867D56 /* Imaging.cpp in Sources */, - F76C86AF1EC4E88400FA49E2 /* S4Importer.cpp in Sources */, - 66A10F7C257F1E1800DD651A /* StaffHireNewAction.cpp in Sources */, - 66A10F85257F1E1800DD651A /* LandSetHeightAction.cpp in Sources */, - F76C86B01EC4E88400FA49E2 /* Tables.cpp in Sources */, - C688788520289ADE0084B384 /* Text.cpp in Sources */, - F76C86B41EC4E88400FA49E2 /* SawyerChunk.cpp in Sources */, - C68878F920289B9B0084B384 /* LimLaunchedRollerCoaster.cpp in Sources */, - C68878E120289B9B0084B384 /* PeepData.cpp in Sources */, - F76C86B61EC4E88400FA49E2 /* SawyerChunkReader.cpp in Sources */, - F76C86B81EC4E88400FA49E2 /* SawyerChunkWriter.cpp in Sources */, - 66A10FE1257F1E3000DD651A /* WallSetColourAction.cpp in Sources */, - C6887855202899F60084B384 /* Particle.cpp in Sources */, - C688784E202899CB0084B384 /* Date.cpp in Sources */, - 66A10F9B257F1E1800DD651A /* ParkSetResearchFundingAction.cpp in Sources */, - F76C86BA1EC4E88400FA49E2 /* SawyerEncoding.cpp in Sources */, - F76C86C31EC4E88400FA49E2 /* S6Exporter.cpp in Sources */, - C68878E820289B9B0084B384 /* Platform.Win32.cpp in Sources */, - C688791A20289B9B0084B384 /* SpaceRings.cpp in Sources */, - C688790420289B9B0084B384 /* Steeplechase.cpp in Sources */, - C68878E020289B9B0084B384 /* Peep.cpp in Sources */, - 936F412A24CE030F00E07BCF /* NetworkClient.cpp in Sources */, - F76C86C51EC4E88400FA49E2 /* S6Importer.cpp in Sources */, - C688790A20289B9B0084B384 /* WoodenRollerCoaster.cpp in Sources */, - 93F76F0220BFF77B00D4512C /* Paint.Surface.cpp in Sources */, - 66A10ECF257F1DF800DD651A /* ClimateSetAction.cpp in Sources */, - 93DFD02F24521BA0001FCBAF /* FileWatcher.cpp in Sources */, - F76C871C1EC4E88400FA49E2 /* TrackDesignRepository.cpp in Sources */, - C68878FA20289B9B0084B384 /* LoopingRollerCoaster.cpp in Sources */, - 66A10F57257F1E1700DD651A /* RideSetAppearanceAction.cpp in Sources */, - 66A10FB9257F1E1800DD651A /* RideSetStatusAction.cpp in Sources */, - C68878A720289B2A0084B384 /* Marketing.cpp in Sources */, - F76C87331EC4E88400FA49E2 /* ScenarioRepository.cpp in Sources */, - C68878FB20289B9B0084B384 /* MineRide.cpp in Sources */, - 66A10FD8257F1E3000DD651A /* TrackRemoveAction.cpp in Sources */, - 9308D9FF209908090079EE96 /* TileElement.cpp in Sources */, - 66A10FAA257F1E1800DD651A /* SetParkEntranceFeeAction.cpp in Sources */, - 66A10F9E257F1E1800DD651A /* ParkMarketingAction.cpp in Sources */, - C688789020289B140084B384 /* Colour.cpp in Sources */, - 66A10FA3257F1E1800DD651A /* LandLowerAction.cpp in Sources */, - 66A10FB7257F1E1800DD651A /* LandBuyRightsAction.cpp in Sources */, - C68878EB20289B9B0084B384 /* Windows.cpp in Sources */, - C688789920289B140084B384 /* Window.cpp in Sources */, - F76C87351EC4E88400FA49E2 /* ScenarioSources.cpp in Sources */, - F76C87381EC4E88400FA49E2 /* TitleScreen.cpp in Sources */, - F76C873A1EC4E88400FA49E2 /* TitleSequence.cpp in Sources */, - 66A10EC0257F1DF800DD651A /* BannerPlaceAction.cpp in Sources */, - C6887852202899ED0084B384 /* TileInspector.cpp in Sources */, - F76C873C1EC4E88400FA49E2 /* TitleSequenceManager.cpp in Sources */, - 66A10F9D257F1E1800DD651A /* StaffFireAction.cpp in Sources */, - C688793320289B9B0084B384 /* SubmarineRide.cpp in Sources */, - 93F76EEE20BFF6F900D4512C /* Drawing.String.cpp in Sources */, - C688785C20289A0A0084B384 /* Entrance.cpp in Sources */, - C688790E20289B9B0084B384 /* CrookedHouse.cpp in Sources */, - C68878F520289B9B0084B384 /* InvertedImpulseCoaster.cpp in Sources */, - C688793020289B9B0084B384 /* LogFlume.cpp in Sources */, - 66A10F82257F1E1800DD651A /* PlayerSetGroupAction.cpp in Sources */, - 2ADE2F3222441905002598AF /* DiscordService.cpp in Sources */, - C688786620289A430084B384 /* Intent.cpp in Sources */, - 66A10FBA257F1E1800DD651A /* PlayerKickAction.cpp in Sources */, - C68878E520289B9B0084B384 /* Platform.Android.cpp in Sources */, - C68878EA20289B9B0084B384 /* Shared.cpp in Sources */, - F76C87451EC4E88400FA49E2 /* Version.cpp in Sources */, - 9346F9D9208A191900C77D91 /* Guest.cpp in Sources */, - C688789C20289B200084B384 /* Currency.cpp in Sources */, - 66A10F9C257F1E1800DD651A /* PeepPickupAction.cpp in Sources */, - C68879A420289C060084B384 /* Platform.macOS.mm in Sources */, - 66A10FA0257F1E1800DD651A /* StaffSetPatrolAreaAction.cpp in Sources */, - 66A10F5B257F1E1700DD651A /* GuestSetNameAction.cpp in Sources */, - C688787420289A780084B384 /* TrackDesignSave.cpp in Sources */, - C688790F20289B9B0084B384 /* Dodgems.cpp in Sources */, - C688791E20289B9B0084B384 /* 3dCinema.cpp in Sources */, - C688786420289A0A0084B384 /* MoneyEffect.cpp in Sources */, - 66A10F98257F1E1800DD651A /* PlacePeepSpawnAction.cpp in Sources */, - C68878A420289B200084B384 /* UTF8.cpp in Sources */, - C688786D20289A6F0084B384 /* TrackPaint.cpp in Sources */, - 93F76F0620BFF77B00D4512C /* Paint.Entrance.cpp in Sources */, - C688792120289B9B0084B384 /* LaunchedFreefall.cpp in Sources */, - 66A10FD4257F1E3000DD651A /* TrackSetBrakeSpeedAction.cpp in Sources */, - C688791920289B9B0084B384 /* ObservationTower.cpp in Sources */, - 93F76EF020BFF71700D4512C /* InteractiveConsole.cpp in Sources */, - C6887853202899F00084B384 /* Sprite.cpp in Sources */, - 66A10FB3257F1E1800DD651A /* MazeSetTrackAction.cpp in Sources */, - 66A10EC5257F1DF800DD651A /* BannerSetNameAction.cpp in Sources */, - C688786F20289A6F0084B384 /* VehicleData.cpp in Sources */, - C688786520289A400084B384 /* _legacy.cpp in Sources */, - C688785F20289A0A0084B384 /* LargeScenery.cpp in Sources */, - C688792C20289B9B0084B384 /* Monorail.cpp in Sources */, - C688792220289B9B0084B384 /* MagicCarpet.cpp in Sources */, - 93F76F0120BFF77B00D4512C /* Paint.LargeScenery.cpp in Sources */, - C688790720289B9B0084B384 /* VerticalDropRollerCoaster.cpp in Sources */, - 66A10F60257F1E1700DD651A /* ParkEntranceRemoveAction.cpp in Sources */, - 93F9DA3A20B46FCA00D1BE92 /* SceneryObject.cpp in Sources */, - 936F412924CE030F00E07BCF /* NetworkBase.cpp in Sources */, - C688787520289A780084B384 /* RideData.cpp in Sources */, - C688789B20289B200084B384 /* Convert.cpp in Sources */, - C688791F20289B9B0084B384 /* Enterprise.cpp in Sources */, - C688789320289B140084B384 /* Fonts.cpp in Sources */, - C688792F20289B9B0084B384 /* DingySlide.cpp in Sources */, - C688787920289A780084B384 /* TrackData.cpp in Sources */, - 66A10F71257F1E1800DD651A /* StaffSetColourAction.cpp in Sources */, - C68878F020289B9B0084B384 /* CorkscrewRollerCoaster.cpp in Sources */, - 66A10FD1257F1E3000DD651A /* WaterRaiseAction.cpp in Sources */, - C688791820289B9B0084B384 /* MonorailCycles.cpp in Sources */, - E73A781EBC3C440A99D59821 /* EntityTweener.cpp in Sources */, - 0746674FA0794ABF86E406A1 /* Litter.cpp in Sources */, - B9B6F97CE24E4A559C7BBA0A /* RideConstruction.cpp in Sources */, - 73FB2E7C254144D9BAE4925A /* ScVehicle.cpp in Sources */, - BC39D70B9A2249E4B14E99FA /* ScGuest.cpp in Sources */, - 7A06F880718F49CA9FB71F52 /* ScStaff.cpp in Sources */, - 8E6484F6C43644F4B644D361 /* ScLitter.cpp in Sources */, - 149D1ACFD5FA42938364C843 /* ScPlayerGroup.cpp in Sources */, - E436DE7807A74621B7BF2276 /* ScPlayer.cpp in Sources */, - F08623EA69E7456DB79F3E06 /* ScNetwork.cpp in Sources */, - CDC72A71A28542F4AD73A91C /* ScRideStation.cpp in Sources */, - 705A4B342C7D4F38B26BAFA4 /* ScRide.cpp in Sources */, - 2B8F76B32C944D3C97F0FFAF /* ScMap.cpp in Sources */, - BE55C1C86BFE4A0DA61260E2 /* ScParkMessage.cpp in Sources */, - 887B0043454440BAB322A9E8 /* ScPark.cpp in Sources */, - 5B6E418A2F264952BA0CC2F2 /* ScTileElement.cpp in Sources */, - 6C90BE01D190493295071B23 /* ScTile.cpp in Sources */, - 258C212125F84FA2B4C3BCAE /* RideUseSystem.cpp in Sources */, - 7CDC7EE9B12E40FB9FE78546 /* Crypt.OpenRCT2.cpp in Sources */, - 4653963391E945D397BCCA0C /* ChangeMapSizeAction.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7D774801EC66CD700BE6EBC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9308DA00209908090079EE96 /* TileElement.cpp in Sources */, - 93CBA4CB20A7504500867D56 /* ImageImporter.cpp in Sources */, - 9346F9DD208A191900C77D91 /* GuestPathfinding.cpp in Sources */, - 9346F9DA208A191900C77D91 /* Guest.cpp in Sources */, - F7D7749E1EC6713200BE6EBC /* Cli.cpp in Sources */, - 93CBA4C620A7502E00867D56 /* Imaging.cpp in Sources */, - 9308DA03209908090079EE96 /* Surface.cpp in Sources */, - 933F2CB920935653001B33FD /* LocalisationService.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - C68B2D491EC790970020651C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C68B2D431EC790690020651C /* Download Libraries */; - targetProxy = C68B2D481EC790970020651C /* PBXContainerItemProxy */; - }; - C68B2D4B1EC7909B0020651C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C68B2D431EC790690020651C /* Download Libraries */; - targetProxy = C68B2D4A1EC7909B0020651C /* PBXContainerItemProxy */; - }; - C68B2D4D1EC7909E0020651C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F76C80991EC4D9FA00FA49E2 /* libopenrct2 */; - targetProxy = C68B2D4C1EC7909E0020651C /* PBXContainerItemProxy */; - }; - F76C88901EC5325700FA49E2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F76C80991EC4D9FA00FA49E2 /* libopenrct2 */; - targetProxy = F76C888F1EC5325700FA49E2 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - C68B2D441EC790690020651C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - C68B2D451EC790690020651C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - D497D0871C20FD53002BF46A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = x86_64; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - OPENGL_NO_LINK, - "OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"", - __ENABLE_LIGHTFX__, - ENABLE_SCRIPTING, - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - LD_NO_PIE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - D497D0881C20FD53002BF46A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = x86_64; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - OPENGL_NO_LINK, - "OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"", - __ENABLE_LIGHTFX__, - ENABLE_SCRIPTING, - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - LD_NO_PIE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - D497D08A1C20FD53002BF46A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_UNREACHABLE_CODE = NO; - CLANG_X86_VECTOR_INSTRUCTIONS = default; - COMBINE_HIDPI_IMAGES = YES; - ENABLE_HARDENED_RUNTIME = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = NO; - GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/libxc/include/freetype2", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - INFOPLIST_FILE = "$(DERIVED_FILE_DIR)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - "$(PROJECT_DIR)/discord-rpc/build/src", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_BUNDLE_IDENTIFIER = io.openrct2.OpenRCT2; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - D497D08B1C20FD53002BF46A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_UNREACHABLE_CODE = NO; - CLANG_X86_VECTOR_INSTRUCTIONS = default; - COMBINE_HIDPI_IMAGES = YES; - ENABLE_HARDENED_RUNTIME = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = NO; - GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/libxc/include/freetype2", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - INFOPLIST_FILE = "$(DERIVED_FILE_DIR)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - "$(PROJECT_DIR)/discord-rpc/build/src", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_BUNDLE_IDENTIFIER = io.openrct2.OpenRCT2; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - F76C809B1EC4D9FA00FA49E2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = NO; - CLANG_WARN_UNREACHABLE_CODE = NO; - CODE_SIGN_IDENTITY = "-"; - EXECUTABLE_PREFIX = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - OPENGL_NO_LINK, - "OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"", - __ENABLE_LIGHTFX__, - ENABLE_SCRIPTING, - __ENABLE_DISCORD__, - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = NO; - GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/libxc/include/freetype2", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; - }; - name = Debug; - }; - F76C809C1EC4D9FA00FA49E2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = NO; - CLANG_WARN_UNREACHABLE_CODE = NO; - CODE_SIGN_IDENTITY = "-"; - EXECUTABLE_PREFIX = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - OPENGL_NO_LINK, - "OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"", - __ENABLE_LIGHTFX__, - ENABLE_SCRIPTING, - __ENABLE_DISCORD__, - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = NO; - GCC_WARN_UNUSED_VARIABLE = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/libxc/include/freetype2", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; - }; - name = Release; - }; - F7D774881EC66CD700BE6EBC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = NO; - CODE_SIGN_IDENTITY = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - "$(PROJECT_DIR)/discord-rpc/build/src", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - F7D774891EC66CD700BE6EBC /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_ENABLE_OBJC_ARC = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = NO; - CODE_SIGN_IDENTITY = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/libxc/include", - "$(SRCROOT)/libxc/include/SDL2", - "$(SRCROOT)/libxc/include/libpng16", - "$(SRCROOT)/libxc/include/openssl", - "$(SRCROOT)/src/", - "$(SRCROOT)/src/thirdparty/", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/libxc/lib", - "$(PROJECT_DIR)/discord-rpc/build/src", - ); - MACOSX_DEPLOYMENT_TARGET = 10.14; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C68B2D461EC790690020651C /* Build configuration list for PBXAggregateTarget "Download Libraries" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C68B2D441EC790690020651C /* Debug */, - C68B2D451EC790690020651C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D497D0731C20FD52002BF46A /* Build configuration list for PBXProject "OpenRCT2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D497D0871C20FD53002BF46A /* Debug */, - D497D0881C20FD53002BF46A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D497D0891C20FD53002BF46A /* Build configuration list for PBXNativeTarget "OpenRCT2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D497D08A1C20FD53002BF46A /* Debug */, - D497D08B1C20FD53002BF46A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F76C809D1EC4D9FA00FA49E2 /* Build configuration list for PBXNativeTarget "libopenrct2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F76C809B1EC4D9FA00FA49E2 /* Debug */, - F76C809C1EC4D9FA00FA49E2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F7D7748A1EC66CD700BE6EBC /* Build configuration list for PBXNativeTarget "OpenRCT2-cli" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F7D774881EC66CD700BE6EBC /* Debug */, - F7D774891EC66CD700BE6EBC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D497D0701C20FD52002BF46A /* Project object */; -} diff --git a/OpenRCT2.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/OpenRCT2.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 872dc2754b..0000000000 --- a/OpenRCT2.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/OpenRCT2.xcscmblueprint b/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/OpenRCT2.xcscmblueprint deleted file mode 100644 index adc84574df..0000000000 --- a/OpenRCT2.xcodeproj/project.xcworkspace/xcshareddata/OpenRCT2.xcscmblueprint +++ /dev/null @@ -1,16 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "E48FB7C08C6966C4BACE7D0390CDFA7C64DD04D8", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "E48FB7C08C6966C4BACE7D0390CDFA7C64DD04D8" : 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "6B7243E0-B9B8-4E6D-ACE9-4DF346FA52C7", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "E48FB7C08C6966C4BACE7D0390CDFA7C64DD04D8" : "OpenRCT2\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "OpenRCT2", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "OpenRCT2.xcodeproj" -} diff --git a/OpenRCT2.xcodeproj/xcshareddata/xcschemes/OpenRCT2.xcscheme b/OpenRCT2.xcodeproj/xcshareddata/xcschemes/OpenRCT2.xcscheme deleted file mode 100644 index 91c482ea49..0000000000 --- a/OpenRCT2.xcodeproj/xcshareddata/xcschemes/OpenRCT2.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OpenRCT2.xcodeproj/xcshareddata/xcschemes/PaintTest.xcscheme b/OpenRCT2.xcodeproj/xcshareddata/xcschemes/PaintTest.xcscheme deleted file mode 100644 index eac94eb327..0000000000 --- a/OpenRCT2.xcodeproj/xcshareddata/xcschemes/PaintTest.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/readme.md b/readme.md index 1e56144a5b..32df17863a 100644 --- a/readme.md +++ b/readme.md @@ -92,10 +92,6 @@ OpenRCT2 requires original files of RollerCoaster Tycoon 2 to play. It can be bo - Desktop development with C++ ### macOS: -- Xcode 10+ - -The program can also be built as a command line program using CMake. This type of build requires: - - Xcode Command Line Tools - [Homebrew](https://brew.sh) - CMake (available through Homebrew) @@ -143,20 +139,28 @@ msbuild openrct2.proj /t:PublishPortable ``` ### macOS: -#### Xcode: -The recommended way of building OpenRCT2 for macOS is with Xcode. The Xcode build will create a self-contained application bundles which include all the necessary game files and dependencies. Open the project file OpenRCT2.xcodeproj in Xcode and build from there. Building this way will handle the dependencies for you automatically. You can also invoke an Xcode build from the command line using `xcodebuild`. - #### CMake: -A command line version of OpenRCT2 can be built using CMake. CMake will retrieve the dependences from [Dependencies](https://github.com/OpenRCT2/Dependencies/) automatically. You can build the project using CMake using the following commands: +The recommended way of building OpenRCT2 for macOS is with CMake. CMake can build either a self-contained application bundles which include all the necessary game files and dependencies, or it can build a command line version that links against system installed dependencies. CMake will retrieve the dependences from [Dependencies](https://github.com/OpenRCT2/Dependencies/) automatically. You can build the macOS app using CMake using the following commands: ``` mkdir build cd build cmake .. +make install +``` +Then you can run the game by opening `OpenRCT2.app` + +To build the command line version, you'll need to disable the macOS app bundle: +``` +mkdir build +cd build +cmake .. -DMACOS_BUNDLE=off make ln -s ../data data ``` Then you can run the game by running `./openrct2`. +To link against system dependencies instead of letting CMake download the dependencies from [Dependencies](https://github.com/OpenRCT2/Dependencies), add `-DMACOS_USE_DEPENDENCIES=off` to your cmake args. + Detailed instructions can be found on [Building OpenRCT2 on macOS using CMake](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-macOS-using-CMake). ### Linux: From 5ee78213b20d37f4f0a453117ebf6003f483d515 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 10 Oct 2021 11:09:26 +0100 Subject: [PATCH 532/681] Port over research == operator from NSF --- .../windows/EditorInventionsList.cpp | 4 ++-- src/openrct2/management/Research.cpp | 24 +++++++++---------- src/openrct2/management/Research.h | 3 ++- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index d785a8fd40..8b8eefafcb 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -162,7 +162,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex) { for (size_t i = 0; i < researchList.size(); i++) { - if (researchList[i].Equals(beforeItem)) + if (researchList[i] == *beforeItem) { researchList.insert((researchList.begin() + i), _editorInventionsListDraggedItem); return; @@ -610,7 +610,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window* w, rct_drawpix gfx_filter_rect(dpi, 0, top, boxWidth, bottom, FilterPaletteID::PaletteDarken1); } - if (researchItem.Equals(&_editorInventionsListDraggedItem)) + if (researchItem == _editorInventionsListDraggedItem) continue; // TODO: this parameter by itself produces very light text. diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 79d68be515..2e201a60b5 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -420,7 +420,7 @@ void research_remove(ResearchItem* researchItem) for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++) { auto& researchItem2 = *it; - if (researchItem2.Equals(researchItem)) + if (researchItem2 == *researchItem) { gResearchItemsUninvented.erase(it); return; @@ -429,7 +429,7 @@ void research_remove(ResearchItem* researchItem) for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++) { auto& researchItem2 = *it; - if (researchItem2.Equals(researchItem)) + if (researchItem2 == *researchItem) { gResearchItemsInvented.erase(it); return; @@ -857,23 +857,18 @@ void ResearchItem::SetNull() entryIndex = OBJECT_ENTRY_INDEX_NULL; } -bool ResearchItem::Equals(const ResearchItem* otherItem) const -{ - return (entryIndex == otherItem->entryIndex && baseRideType == otherItem->baseRideType && type == otherItem->type); -} - bool ResearchItem::Exists() const { for (auto const& researchItem : gResearchItemsUninvented) { - if (researchItem.Equals(this)) + if (researchItem == *this) { return true; } } for (auto const& researchItem : gResearchItemsInvented) { - if (researchItem.Equals(this)) + if (researchItem == *this) { return true; } @@ -919,6 +914,11 @@ rct_string_id ResearchItem::GetCategoryName() const return _researchCategoryNames[categoryValue]; } +bool ResearchItem::operator==(const ResearchItem& rhs) const +{ + return (entryIndex == rhs.entryIndex && baseRideType == rhs.baseRideType && type == rhs.type); +} + static std::bitset _seenRideType = {}; static void research_update_first_of_type(ResearchItem* researchItem) @@ -975,11 +975,11 @@ void research_determine_first_of_type() // The last research item will also be present in gResearchItemsInvented. // Avoid marking its ride type as "invented" prematurely. - if (gResearchLastItem.has_value() && !gResearchLastItem->IsNull() && researchItem.Equals(&gResearchLastItem.value())) + if (gResearchLastItem.has_value() && !gResearchLastItem->IsNull() && researchItem == gResearchLastItem.value()) continue; // The next research item is (sometimes?) also present in gResearchItemsInvented, even though it isn't invented yet(!) - if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem.Equals(&gResearchNextItem.value())) + if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == gResearchNextItem.value()) continue; research_mark_ride_type_as_seen(researchItem); @@ -999,7 +999,7 @@ void research_determine_first_of_type() for (auto& researchItem : gResearchItemsUninvented) { // The next research item is (sometimes?) also present in gResearchItemsUninvented - if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem.Equals(&gResearchNextItem.value())) + if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem == gResearchNextItem.value()) { // Copy the "first of type" flag. researchItem.flags = gResearchNextItem->flags; diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index c3a730bb4c..ba0560a031 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -62,7 +62,6 @@ struct ResearchItem bool IsNull() const; void SetNull(); - bool Equals(const ResearchItem* otherItem) const; bool Exists() const; bool IsAlwaysResearched() const; rct_string_id GetName() const; @@ -127,6 +126,8 @@ struct ResearchItem category = static_cast(oldResearchItem.category); } } + + bool operator==(const ResearchItem& rhs) const; }; // Only used to mark as null nowadays. Deprecated. TODO: remove. From 961d51eae4891198fcd5b011b24c8d78a689ec73 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 10 Oct 2021 11:17:52 +0100 Subject: [PATCH 533/681] Fix hovering on scenery window showing incorrect hover for 1 tick The scenery window will periodically reset the hover selection so that when you move the cursor out of the window it correctly switches to the actual selection. This leads to the price and description resetting for a singular tick which looks a bit odd and unexpected. To fix this instead when it tries to reset it first checks to see if the cursor is still over the hover selection and if it is does not reset the selection. --- src/openrct2-ui/windows/Scenery.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index ef44da5f7a..9d58e17215 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -712,6 +712,8 @@ static void window_scenery_dropdown(rct_window* w, rct_widgetindex widgetIndex, w->Invalidate(); } +static ScenerySelection get_scenery_id_by_cursor_pos(rct_window* w, const ScreenCoordsXY& screenCoords); + /** * * rct2: 0x006E1B9F @@ -720,6 +722,28 @@ static void window_scenery_periodic_update(rct_window* w) { if (!_selectedScenery.IsUndefined()) { + // Find out what scenery the cursor is over + const CursorState* state = context_get_cursor_state(); + rct_widgetindex widgetIndex = window_find_widget_from_point(w, state->position); + if (widgetIndex == WIDX_SCENERY_LIST) + { + ScreenCoordsXY scrollPos = {}; + int32_t scrollArea = 0; + int32_t scrollId = 0; + WidgetScrollGetPart(w, &w->widgets[WIDX_SCENERY_LIST], state->position, scrollPos, &scrollArea, &scrollId); + if (scrollArea == SCROLL_PART_VIEW) + { + const ScenerySelection scenery = get_scenery_id_by_cursor_pos(w, 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 = {}; } } From c812b696bdcc3f66ea9981c1aa66d7c620040f04 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 10 Oct 2021 15:01:18 -0600 Subject: [PATCH 534/681] Fix #14741: crash on macOS exit (#15550) --- distribution/changelog.txt | 1 + src/openrct2/paint/Painter.cpp | 9 +++++++++ src/openrct2/paint/Painter.h | 1 + 3 files changed, 11 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d1fb7b809e..181d9c1061 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -15,6 +15,7 @@ - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). +- Fix: [#14741] Crash when exiting OpenRCT2 on macOS. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15136] Exported SV6 files cause vanilla RCT2 to hang. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 46ccdd559d..f831f9cb56 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -170,3 +170,12 @@ void Painter::ReleaseSession(paint_session* session) session->PaintEntryChain.Clear(); _freePaintSessions.push_back(session); } + +Painter::~Painter() +{ + for (auto&& session : _paintSessionPool) + { + ReleaseSession(session.get()); + } + _paintSessionPool.clear(); +} diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index d776f6f557..7bcc9ba2f0 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -49,6 +49,7 @@ namespace OpenRCT2 paint_session* CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags); void ReleaseSession(paint_session* session); + ~Painter(); private: void PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text); From 6f8e017a329cb8b5b830a398f7121917c28d364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 11 Oct 2021 19:49:05 +0300 Subject: [PATCH 535/681] Backport track design changes Co-authored-by: Ted John --- src/openrct2/core/DataSerialiserTraits.h | 95 +++--- src/openrct2/localisation/StringIds.h | 2 + src/openrct2/rct12/RCT12.cpp | 46 ++- src/openrct2/rct12/RCT12.h | 3 + src/openrct2/rct2/RCT2.cpp | 106 +++++++ src/openrct2/rct2/RCT2.h | 12 + src/openrct2/rct2/T6Exporter.cpp | 4 +- src/openrct2/rct2/T6Importer.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 223 ++++++++----- src/openrct2/ride/TrackDesign.h | 14 +- src/openrct2/ride/TrackDesignSave.cpp | 379 ++++++++++++++--------- 11 files changed, 583 insertions(+), 303 deletions(-) diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index ca391d360c..a878a86ab9 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -598,6 +598,50 @@ template<> struct DataSerializerTraits_t } }; +template<> struct DataSerializerTraits_t +{ + static void encode(OpenRCT2::IStream* stream, const ObjectEntryDescriptor& val) + { + stream->WriteValue(static_cast(val.Generation)); + if (val.Generation == ObjectGeneration::DAT) + { + DataSerializerTraits s; + s.encode(stream, val.Entry); + } + else + { + stream->WriteValue(static_cast(val.GetType())); + stream->WriteString(val.Identifier); + } + } + + static void decode(OpenRCT2::IStream* stream, ObjectEntryDescriptor& val) + { + auto generation = static_cast(stream->ReadValue()); + if (generation == ObjectGeneration::DAT) + { + DataSerializerTraits s; + rct_object_entry entry; + s.decode(stream, entry); + val = ObjectEntryDescriptor(entry); + } + else + { + auto type = static_cast(stream->ReadValue()); + auto identifier = stream->ReadStdString(); + val = ObjectEntryDescriptor(type, identifier); + } + } + + static void log(OpenRCT2::IStream* stream, const ObjectEntryDescriptor& val) + { + auto identifier = std::string(val.GetName()); + char msg[128] = {}; + snprintf(msg, sizeof(msg), "ObjectEntryDescriptor[%s]", identifier.c_str()); + stream->Write(msg, strlen(msg)); + } +}; + template<> struct DataSerializerTraits_t { static void encode(OpenRCT2::IStream* stream, const TrackDesignTrackElement& val) @@ -677,7 +721,7 @@ template<> struct DataSerializerTraits_t stream->Write(&val.flags); stream->Write(&val.primary_colour); stream->Write(&val.secondary_colour); - DataSerializerTraits s; + DataSerializerTraits s; s.encode(stream, val.scenery_object); } static void decode(OpenRCT2::IStream* stream, TrackDesignSceneryElement& val) @@ -688,7 +732,7 @@ template<> struct DataSerializerTraits_t stream->Read(&val.flags); stream->Read(&val.primary_colour); stream->Read(&val.secondary_colour); - DataSerializerTraits s; + DataSerializerTraits s; s.decode(stream, val.scenery_object); } static void log(OpenRCT2::IStream* stream, const TrackDesignSceneryElement& val) @@ -698,7 +742,9 @@ template<> struct DataSerializerTraits_t msg, sizeof(msg), "TrackDesignSceneryElement(x = %d, y = %d, z = %d, flags = %d, colour1 = %d, colour2 = %d)", val.x, val.y, val.z, val.flags, val.primary_colour, val.secondary_colour); stream->Write(msg, strlen(msg)); - stream->WriteArray(val.scenery_object.name, 8); + + auto identifier = val.scenery_object.GetName(); + stream->WriteArray(identifier.data(), identifier.size()); } }; @@ -722,49 +768,6 @@ template<> struct DataSerializerTraits_t } }; -template<> struct DataSerializerTraits_t -{ - static void encode(OpenRCT2::IStream* stream, const ObjectEntryDescriptor& val) - { - stream->Write(&val.Generation); - if (val.Generation == ObjectGeneration::DAT) - { - DataSerializerTraits s; - s.encode(stream, val.Entry); - } - else - { - DataSerializerTraits s; - s.encode(stream, val.Identifier); - } - } - static void decode(OpenRCT2::IStream* stream, ObjectEntryDescriptor& val) - { - ObjectGeneration generation; - stream->Read(&generation); - if (generation == ObjectGeneration::DAT) - { - rct_object_entry obj; - DataSerializerTraits s; - s.decode(stream, obj); - val = ObjectEntryDescriptor(obj); - } - else - { - std::string id; - DataSerializerTraits s; - s.decode(stream, id); - val = ObjectEntryDescriptor(id); - } - } - static void log(OpenRCT2::IStream* stream, const ObjectEntryDescriptor& val) - { - char msg[128] = {}; - snprintf(msg, sizeof(msg), "ObjectEntryDescriptor (Generation = %d)", static_cast(val.Generation)); - stream->Write(msg, strlen(msg)); - } -}; - template<> struct DataSerializerTraits_t { static void encode(OpenRCT2::IStream* stream, const IntensityRange& val) diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 67e5a98bfd..e122424fe2 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3913,6 +3913,8 @@ enum STR_FOLLOW_SUBJECT_TIP = 6458, + STR_UNSUPPORTED_OBJECT_FORMAT = 6459, + // 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 }; diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 08de6fab9f..4a387f6ea9 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -1347,21 +1347,12 @@ RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType) return origTrackType; } -money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue) -{ - if (origValue == RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE) - return COMPANY_VALUE_ON_FAILED_OBJECTIVE; - - return ToMoney64(origValue); -} - -money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue) -{ - if (origValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) - return RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE; - - return ToMoney32(origValue); -} +static constexpr std::string_view _stationStyles[] = { + "rct2.station.plain", "rct2.station.wooden", "rct2.station.canvas_tent", "rct2.station.castle_grey", + "rct2.station.castle_brown", "rct2.station.jungle", "rct2.station.log", "rct2.station.classical", + "rct2.station.abstract", "rct2.station.snow", "rct2.station.pagoda", "rct2.station.space", + "openrct2.station.noentrance" +}; static constexpr std::string_view _musicStyles[] = { "rct2.music.dodgems", @@ -1399,6 +1390,15 @@ static constexpr std::string_view _musicStyles[] = { "rct2.music.candy", }; +std::string_view GetStationIdentifierFromStyle(uint8_t style) +{ + if (style < std::size(_stationStyles)) + { + return _stationStyles[style]; + } + return {}; +} + std::optional GetStyleFromMusicIdentifier(std::string_view identifier) { auto it = std::find(std::begin(_musicStyles), std::end(_musicStyles), identifier); @@ -1408,3 +1408,19 @@ std::optional GetStyleFromMusicIdentifier(std::string_view identifier) } return std::nullopt; } + +money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue) +{ + if (origValue == RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE) + return COMPANY_VALUE_ON_FAILED_OBJECTIVE; + + return ToMoney64(origValue); +} + +money32 OpenRCT2CompletedCompanyValueToRCT12(money64 origValue) +{ + if (origValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) + return RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE; + + return ToMoney32(origValue); +} diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 9507cb1c90..3e23bc95c7 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -19,6 +19,8 @@ #include #include +class ObjectList; + using track_type_t = uint16_t; using RCT12TrackType = uint8_t; @@ -940,6 +942,7 @@ std::string ConvertFormattedStringToRCT2(std::string_view buffer, size_t maxLeng std::string GetTruncatedRCT2String(std::string_view src, size_t maxLength); track_type_t RCT12FlatTrackTypeToOpenRCT2(RCT12TrackType origTrackType); RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType); +std::string_view GetStationIdentifierFromStyle(uint8_t style); std::optional GetStyleFromMusicIdentifier(std::string_view identifier); static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index 2fba4a88c6..b20d609a04 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -7,7 +7,9 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Context.h" #include "../object/Object.h" +#include "../object/ObjectManager.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ride/Track.h" @@ -156,3 +158,107 @@ RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType) // This function is safe to run this way round. return OpenRCT2FlatTrackTypeToRCT12(origTrackType); } + +static FootpathMapping _footpathMappings[] = { + // RCT2 mappings + { "PATHASH ", "rct2.footpath_surface.ash", "rct2.footpath_surface.queue_yellow", "rct2.footpath_railings.bamboo_black" }, + { "PATHCRZY", "rct2.footpath_surface.crazy_paving", "rct2.footpath_surface.queue_yellow", + "rct2.footpath_railings.concrete" }, + { "PATHDIRT", "rct2.footpath_surface.dirt", "rct2.footpath_surface.queue_yellow", "rct2.footpath_railings.bamboo_brown" }, + { "PATHSPCE", "rct2.footpath_surface.tarmac_red", "rct2.footpath_surface.queue_red", "rct2.footpath_railings.space" }, + { "ROAD ", "rct2.footpath_surface.road", "rct2.footpath_surface.queue_blue", "rct2.footpath_railings.wood" }, + { "TARMACB ", "rct2.footpath_surface.tarmac_brown", "rct2.footpath_surface.queue_yellow", + "rct2.footpath_railings.concrete" }, + { "TARMACG ", "rct2.footpath_surface.tarmac_green", "rct2.footpath_surface.queue_green", + "rct2.footpath_railings.concrete_green" }, + { "TARMAC ", "rct2.footpath_surface.tarmac", "rct2.footpath_surface.queue_blue", "rct2.footpath_railings.wood" }, + // Time Twister + { "1920PATH", "rct2tt.footpath_surface.pavement", "rct2tt.footpath_surface.queue_pavement", + "rct2tt.footpath_railings.pavement" }, + { "FUTRPATH", "rct2tt.footpath_surface.circuitboard", "rct2tt.footpath_surface.queue_circuitboard", + "rct2tt.footpath_railings.circuitboard" }, + { "FUTRPAT2", "rct2tt.footpath_surface.circuitboard", "rct2tt.footpath_surface.queue_circuitboard", + "openrct2.footpath_railings.invisible" }, + { "JURRPATH", "rct2tt.footpath_surface.rocky", "rct2.footpath_surface.queue_yellow", "rct2tt.footpath_railings.rocky" }, + { "MEDIPATH", "rct2tt.footpath_surface.medieval", "rct2.footpath_surface.queue_yellow", + "rct2tt.footpath_railings.medieval" }, + { "MYTHPATH", "rct2tt.footpath_surface.mosaic", "rct2.footpath_surface.queue_yellow", + "rct2tt.footpath_railings.balustrade" }, + { "RANBPATH", "rct2tt.footpath_surface.rainbow", "rct2tt.footpath_surface.queue_rainbow", + "rct2tt.footpath_railings.rainbow" }, + + // RCT 1 mappings (for reverse lookup) + { "PATHASH ", "rct1aa.footpath_surface.ash", "rct1aa.footpath_surface.queue_yellow", + "rct2.footpath_railings.bamboo_black" }, + { "PATHCRZY", "rct1.footpath_surface.crazy_paving", "rct1aa.footpath_surface.queue_yellow", + "rct2.footpath_railings.concrete" }, + { "PATHDIRT", "rct1.footpath_surface.dirt", "rct1aa.footpath_surface.queue_yellow", "rct2.footpath_railings.bamboo_brown" }, + { "PATHSPCE", "rct1aa.footpath_surface.tarmac_red", "rct1.footpath_surface.queue_red", "rct1ll.footpath_railings.space" }, + { "TARMACB ", "rct1aa.footpath_surface.tarmac_brown", "rct1aa.footpath_surface.queue_yellow", + "rct2.footpath_railings.concrete" }, + { "TARMACG ", "rct1aa.footpath_surface.tarmac_green", "rct1aa.footpath_surface.queue_green", + "rct2.footpath_railings.concrete_green" }, + { "TARMAC ", "rct1.footpath_surface.tarmac", "rct1.footpath_surface.queue_blue", "rct2.footpath_railings.wood" }, + { "PATHCRZY", "rct1.footpath_surface.tiles_brown", "rct1aa.footpath_surface.queue_yellow", + "rct2.footpath_railings.concrete" }, + { "PATHCRZY", "rct1aa.footpath_surface.tiles_grey", "rct1.footpath_surface.queue_blue", "rct2.footpath_railings.concrete" }, + { "PATHCRZY", "rct1ll.footpath_surface.tiles_red", "rct1.footpath_surface.queue_red", "rct2.footpath_railings.concrete" }, + { "PATHCRZY", "rct1ll.footpath_surface.tiles_green", "rct1aa.footpath_surface.queue_green", + "rct2.footpath_railings.concrete" }, +}; + +const FootpathMapping* GetFootpathSurfaceId(const ObjectEntryDescriptor& desc, bool ideallyLoaded, bool isQueue) +{ + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + + auto name = desc.Entry.GetName(); + for (const auto& mapping : _footpathMappings) + { + if (mapping.Original == name) + { + if (ideallyLoaded) + { + auto obj = objManager.GetLoadedObject( + ObjectEntryDescriptor(isQueue ? mapping.QueueSurface : mapping.NormalSurface)); + if (obj == nullptr) + continue; + } + return &mapping; + } + } + return nullptr; +} + +std::optional GetBestObjectEntryForSurface(std::string_view surface, std::string_view railings) +{ + rct_object_entry result; + std::memset(&result, 0, sizeof(result)); + + result.SetType(ObjectType::Paths); + + auto foundMapping = false; + for (const auto& mapping : _footpathMappings) + { + if (surface == mapping.NormalSurface || surface == mapping.QueueSurface) + { + if (railings == mapping.Railing) + { + // Best match found + foundMapping = true; + result.SetName(mapping.Original); + break; + } + + if (!foundMapping) + { + // Found a mapping, but keep searching to see if there is a closer match + foundMapping = true; + result.SetName(mapping.Original); + } + } + } + + if (foundMapping) + return result; + return {}; +} diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 22575fe640..d571ec96d6 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1077,3 +1077,15 @@ RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); * Handles single and multi-byte strings. */ size_t GetRCT2StringBufferLen(const char* buffer, size_t maxBufferLen); + +struct FootpathMapping +{ + std::string_view Original; + std::string_view NormalSurface; + std::string_view QueueSurface; + std::string_view Railing; +}; + +const FootpathMapping* GetFootpathSurfaceId( + const ObjectEntryDescriptor& desc, bool ideallyLoaded = false, bool isQueue = false); +std::optional GetBestObjectEntryForSurface(std::string_view surface, std::string_view railings); diff --git a/src/openrct2/rct2/T6Exporter.cpp b/src/openrct2/rct2/T6Exporter.cpp index 292e410f77..33554c5a83 100644 --- a/src/openrct2/rct2/T6Exporter.cpp +++ b/src/openrct2/rct2/T6Exporter.cpp @@ -80,7 +80,7 @@ bool T6Exporter::SaveTrack(OpenRCT2::IStream* stream) tempStream.WriteArray(_trackDesign->track_rail_colour, RCT12_NUM_COLOUR_SCHEMES); tempStream.WriteArray(_trackDesign->track_support_colour, RCT12_NUM_COLOUR_SCHEMES); tempStream.WriteValue(_trackDesign->flags2); - tempStream.Write(&_trackDesign->vehicle_object, sizeof(rct_object_entry)); + tempStream.Write(&_trackDesign->vehicle_object.Entry, sizeof(rct_object_entry)); tempStream.WriteValue(_trackDesign->space_required_x); tempStream.WriteValue(_trackDesign->space_required_y); tempStream.WriteArray(_trackDesign->vehicle_additional_colour, RCT2_MAX_CARS_PER_TRAIN); @@ -123,7 +123,7 @@ bool T6Exporter::SaveTrack(OpenRCT2::IStream* stream) for (const auto& sceneryElement : _trackDesign->scenery_elements) { - tempStream.Write(&sceneryElement.scenery_object, sizeof(rct_object_entry)); + tempStream.Write(&sceneryElement.scenery_object.Entry, sizeof(rct_object_entry)); tempStream.WriteValue(sceneryElement.x); tempStream.WriteValue(sceneryElement.y); tempStream.WriteValue(sceneryElement.z); diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index 55794068e4..a32037b4c9 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -200,7 +200,7 @@ public: rct_td6_scenery_element t6SceneryElement{}; _stream.Read(&t6SceneryElement, sizeof(rct_td6_scenery_element)); TrackDesignSceneryElement sceneryElement{}; - sceneryElement.scenery_object = t6SceneryElement.scenery_object; + sceneryElement.scenery_object = ObjectEntryDescriptor(t6SceneryElement.scenery_object); sceneryElement.x = t6SceneryElement.x; sceneryElement.y = t6SceneryElement.y; sceneryElement.z = t6SceneryElement.z; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 0a816bf473..55317043d2 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -41,6 +41,7 @@ #include "../management/Finance.h" #include "../network/network.h" #include "../object/FootpathObject.h" +#include "../object/FootpathSurfaceObject.h" #include "../object/ObjectList.h" #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" @@ -648,37 +649,133 @@ static void track_design_load_scenery_objects(TrackDesign* td6) // Load scenery objects for (const auto& scenery : td6->scenery_elements) { - const rct_object_entry* sceneryEntry = &scenery.scenery_object; - object_manager_load_object(sceneryEntry); + if (scenery.scenery_object.HasValue()) + { + objectManager.LoadObject(td6->vehicle_object); + } } } +struct TrackSceneryEntry +{ + ObjectType Type = ObjectType::None; + ObjectEntryIndex Index = OBJECT_ENTRY_INDEX_NULL; + ObjectEntryIndex SecondaryIndex = OBJECT_ENTRY_INDEX_NULL; // For footpath railing +}; + +static ObjectEntryIndex TrackDesignGetDefaultSurfaceIndex(bool isQueue) +{ + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) + { + auto footpathSurfaceObj = GetPathSurfaceEntry(i); + if (footpathSurfaceObj != nullptr) + { + if (footpathSurfaceObj->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) + { + continue; + } + + if (isQueue != ((footpathSurfaceObj->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + continue; + } + + return i; + } + } + return OBJECT_ENTRY_INDEX_NULL; +} + +static ObjectEntryIndex TrackDesignGetDefaultRailingIndex() +{ + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) + { + auto footpathRailingsObj = GetPathRailingsEntry(i); + if (footpathRailingsObj != nullptr) + { + return i; + } + } + return OBJECT_ENTRY_INDEX_NULL; +} + +static std::optional TrackDesignPlaceSceneryElementGetEntry(const TrackDesignSceneryElement& scenery) +{ + TrackSceneryEntry result; + + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); + if (scenery.scenery_object.GetType() == ObjectType::Paths) + { + auto footpathMapping = GetFootpathSurfaceId(scenery.scenery_object, true, scenery.IsQueue()); + if (footpathMapping == nullptr) + { + // Check if legacy path object is loaded + auto obj = objectMgr.GetLoadedObject(scenery.scenery_object); + if (obj != nullptr) + { + result.Type = obj->GetObjectType(); + result.Index = objectMgr.GetLoadedObjectEntryIndex(obj); + } + else + { + result.Type = ObjectType::FootpathSurface; + } + } + else + { + result.Type = ObjectType::FootpathSurface; + result.Index = objectMgr.GetLoadedObjectEntryIndex( + ObjectEntryDescriptor(scenery.IsQueue() ? footpathMapping->QueueSurface : footpathMapping->NormalSurface)); + result.SecondaryIndex = objectMgr.GetLoadedObjectEntryIndex(ObjectEntryDescriptor(footpathMapping->Railing)); + } + + if (result.Index == OBJECT_ENTRY_INDEX_NULL) + result.Index = TrackDesignGetDefaultSurfaceIndex(scenery.IsQueue()); + if (result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL) + result.SecondaryIndex = TrackDesignGetDefaultRailingIndex(); + + if (result.Index == OBJECT_ENTRY_INDEX_NULL || result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL) + { + _trackDesignPlaceStateSceneryUnavailable = true; + return {}; + } + } + else + { + auto obj = objectMgr.GetLoadedObject(scenery.scenery_object); + if (obj != nullptr) + { + result.Type = obj->GetObjectType(); + result.Index = objectMgr.GetLoadedObjectEntryIndex(obj); + } + else + { + _trackDesignPlaceStateSceneryUnavailable = true; + return {}; + } + } + return result; +} + /** * * rct2: 0x006D247A */ static void track_design_mirror_scenery(TrackDesign* td6) { + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); for (auto& scenery : td6->scenery_elements) { - ObjectType entry_type{ 0 }; - ObjectEntryIndex entryIndex{ 0 }; - if (!find_object_in_entry_group(&scenery.scenery_object, &entry_type, &entryIndex)) - { - entry_type = scenery.scenery_object.GetType(); - if (entry_type != ObjectType::Paths) - { - continue; - } + auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery); + if (!entryInfo) + continue; - entryIndex = 0; - } - - switch (entry_type) + auto obj = objectMgr.GetLoadedObject(entryInfo->Type, entryInfo->Index); + switch (obj->GetObjectType()) { case ObjectType::LargeScenery: { - auto* sceneryEntry = static_cast(object_entry_get_chunk(entry_type, entryIndex)); + auto* sceneryEntry = reinterpret_cast(obj->GetLegacyData()); int16_t x1 = 0, x2 = 0, y1 = 0, y2 = 0; for (rct_large_scenery_tile* tile = sceneryEntry->tiles; tile->x_offset != -1; tile++) { @@ -723,7 +820,7 @@ static void track_design_mirror_scenery(TrackDesign* td6) } case ObjectType::SmallScenery: { - auto* sceneryEntry = static_cast(object_entry_get_chunk(entry_type, entryIndex)); + auto* sceneryEntry = reinterpret_cast(obj->GetLegacyData()); scenery.y = -scenery.y; if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) @@ -753,6 +850,7 @@ static void track_design_mirror_scenery(TrackDesign* td6) break; } case ObjectType::Paths: + case ObjectType::FootpathSurface: { scenery.y = -scenery.y; @@ -768,7 +866,6 @@ static void track_design_mirror_scenery(TrackDesign* td6) break; } default: - // This switch processes only ObjectType for Scenery items. break; } } @@ -865,54 +962,11 @@ static void track_design_update_max_min_coordinates(const CoordsXYZ& coords) std::max(_trackPreviewMax.z, coords.z) }; } -static bool TrackDesignPlaceSceneryElementGetEntry( - ObjectType& entry_type, ObjectEntryIndex& entry_index, const TrackDesignSceneryElement& scenery) -{ - if (!find_object_in_entry_group(&scenery.scenery_object, &entry_type, &entry_index)) - { - entry_type = scenery.scenery_object.GetType(); - if (entry_type != ObjectType::Paths) - { - _trackDesignPlaceStateSceneryUnavailable = true; - return true; - } - - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - { - _trackDesignPlaceStateSceneryUnavailable = true; - return true; - } - - entry_index = 0; - for (; entry_index < object_entry_group_counts[EnumValue(ObjectType::Paths)]; entry_index++) - { - const auto* legacyPathEntry = GetLegacyFootpathEntry(entry_index); - if (legacyPathEntry == nullptr) - { - return true; - } - const auto& surfaceDescriptor = legacyPathEntry->GetPathSurfaceDescriptor(); - if (surfaceDescriptor.IsEditorOnly()) - { - return true; - } - } - - if (entry_index == object_entry_group_counts[EnumValue(ObjectType::Paths)]) - { - _trackDesignPlaceStateSceneryUnavailable = true; - return true; - } - } - return false; -} - static bool TrackDesignPlaceSceneryElementRemoveGhost( CoordsXY mapCoord, const TrackDesignSceneryElement& scenery, uint8_t rotation, int32_t originZ) { - ObjectType entry_type; - ObjectEntryIndex entry_index; - if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) + auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery); + if (!entryInfo) { return true; } @@ -927,14 +981,14 @@ static bool TrackDesignPlaceSceneryElementRemoveGhost( 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; - switch (entry_type) + switch (entryInfo->Type) { case ObjectType::SmallScenery: { uint8_t quadrant = (scenery.flags >> 2) + _currentTrackPieceDirection; quadrant &= 3; - auto* sceneryEntry = get_small_scenery_entry(entry_index); + auto* sceneryEntry = get_small_scenery_entry(entryInfo->Index); if (!(!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) && sceneryEntry->HasFlag( SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) @@ -942,7 +996,7 @@ static bool TrackDesignPlaceSceneryElementRemoveGhost( quadrant = 0; } - ga = std::make_unique(CoordsXYZ{ mapCoord.x, mapCoord.y, z }, quadrant, entry_index); + ga = std::make_unique(CoordsXYZ{ mapCoord.x, mapCoord.y, z }, quadrant, entryInfo->Index); break; } case ObjectType::LargeScenery: @@ -952,6 +1006,7 @@ static bool TrackDesignPlaceSceneryElementRemoveGhost( ga = std::make_unique(CoordsXYZD{ mapCoord.x, mapCoord.y, z, sceneryRotation }); break; case ObjectType::Paths: + case ObjectType::FootpathSurface: ga = std::make_unique(CoordsXYZ{ mapCoord.x, mapCoord.y, z }); break; default: @@ -970,10 +1025,7 @@ static bool TrackDesignPlaceSceneryElementGetPlaceZ(const TrackDesignSceneryElem _trackDesignPlaceSceneryZ = z; } - ObjectType entry_type; - ObjectEntryIndex entry_index; - TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery); - + TrackDesignPlaceSceneryElementGetEntry(scenery); return true; } @@ -1007,9 +1059,8 @@ static std::optional TrackDesignPlaceSceneryElement( || _trackDesignPlaceOperation == PTD_OPERATION_PLACE_GHOST || _trackDesignPlaceOperation == PTD_OPERATION_PLACE_TRACK_PREVIEW) { - ObjectType entry_type; - ObjectEntryIndex entry_index; - if (TrackDesignPlaceSceneryElementGetEntry(entry_type, entry_index, scenery)) + auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery); + if (!entryInfo) { return 0; } @@ -1019,7 +1070,7 @@ static std::optional TrackDesignPlaceSceneryElement( uint8_t flags; uint8_t quadrant; - switch (entry_type) + switch (entryInfo->Type) { case ObjectType::SmallScenery: { @@ -1059,7 +1110,7 @@ static std::optional TrackDesignPlaceSceneryElement( gGameCommandErrorTitle = STR_CANT_POSITION_THIS_HERE; auto smallSceneryPlace = SmallSceneryPlaceAction( - { mapCoord.x, mapCoord.y, z, rotation }, quadrant, entry_index, scenery.primary_colour, + { mapCoord.x, mapCoord.y, z, rotation }, quadrant, entryInfo->Index, scenery.primary_colour, scenery.secondary_colour); smallSceneryPlace.SetFlags(flags); @@ -1105,7 +1156,8 @@ static std::optional TrackDesignPlaceSceneryElement( flags |= GAME_COMMAND_FLAG_REPLAY; } auto sceneryPlaceAction = LargeSceneryPlaceAction( - { mapCoord.x, mapCoord.y, z, rotation }, entry_index, scenery.primary_colour, scenery.secondary_colour); + { mapCoord.x, mapCoord.y, z, rotation }, entryInfo->Index, scenery.primary_colour, + scenery.secondary_colour); sceneryPlaceAction.SetFlags(flags); auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&sceneryPlaceAction) : GameActions::QueryNested(&sceneryPlaceAction); @@ -1148,7 +1200,7 @@ static std::optional TrackDesignPlaceSceneryElement( flags |= GAME_COMMAND_FLAG_REPLAY; } auto wallPlaceAction = WallPlaceAction( - entry_index, { mapCoord.x, mapCoord.y, z }, rotation, scenery.primary_colour, scenery.secondary_colour, + entryInfo->Index, { mapCoord.x, mapCoord.y, z }, rotation, scenery.primary_colour, scenery.secondary_colour, (scenery.flags & 0xFC) >> 2); wallPlaceAction.SetFlags(flags); auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&wallPlaceAction) @@ -1158,6 +1210,7 @@ static std::optional TrackDesignPlaceSceneryElement( break; } case ObjectType::Paths: + case ObjectType::FootpathSurface: if (_trackDesignPlaceOperation == PTD_OPERATION_GET_PLACE_Z) { return 0; @@ -1196,12 +1249,14 @@ static std::optional TrackDesignPlaceSceneryElement( } uint8_t slope = ((bh >> 5) & 0x3) | ((bh >> 2) & 0x4); uint8_t edges = bh & 0xF; - PathConstructFlags constructFlags = PathConstructFlag::IsLegacyPathObject; + PathConstructFlags constructFlags = 0; if (isQueue) constructFlags |= PathConstructFlag::IsQueue; + if (entryInfo->Type == ObjectType::Paths) + constructFlags |= PathConstructFlag::IsLegacyPathObject; auto footpathPlaceAction = FootpathPlaceFromTrackAction( - { mapCoord.x, mapCoord.y, z * COORDS_Z_STEP }, slope, entry_index, OBJECT_ENTRY_INDEX_NULL, edges, - constructFlags); + { mapCoord.x, mapCoord.y, z * COORDS_Z_STEP }, slope, entryInfo->Index, entryInfo->SecondaryIndex, + edges, constructFlags); footpathPlaceAction.SetFlags(flags); auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&footpathPlaceAction) : GameActions::QueryNested(&footpathPlaceAction); @@ -1903,7 +1958,13 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o return false; ride->custom_name = {}; - ride->entrance_style = td6->entrance_style; + + auto stationIdentifier = GetStationIdentifierFromStyle(td6->entrance_style); + ride->entrance_style = objManager.GetLoadedObjectEntryIndex(stationIdentifier); + if (ride->entrance_style == OBJECT_ENTRY_INDEX_NULL) + { + ride->entrance_style = gLastEntranceStyle; + } for (int32_t i = 0; i < RCT12_NUM_COLOUR_SCHEMES; i++) { diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 4bbfd49ed5..eabc486918 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -32,13 +32,13 @@ struct TrackDesignEntranceElement /* Track Scenery entry size: 0x16 */ struct TrackDesignSceneryElement { - rct_object_entry scenery_object; // 0x00 - int8_t x; // 0x10 - int8_t y; // 0x11 - int8_t z; // 0x12 - uint8_t flags; // 0x13 direction quadrant tertiary colour - uint8_t primary_colour; // 0x14 - uint8_t secondary_colour; // 0x15 + ObjectEntryDescriptor scenery_object; + int8_t x; + int8_t y; + int8_t z; + uint8_t flags; + uint8_t primary_colour; + uint8_t secondary_colour; bool IsQueue() const { diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index e342d72d23..90d5cbfb3c 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -14,7 +14,12 @@ #include "../interface/Viewport.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" +#include "../object/FootpathObject.h" +#include "../object/FootpathRailingsObject.h" +#include "../object/FootpathSurfaceObject.h" +#include "../object/LargeSceneryObject.h" #include "../object/ObjectList.h" +#include "../object/ObjectManager.h" #include "../util/SawyerCoding.h" #include "../util/Util.h" #include "../windows/Intent.h" @@ -41,9 +46,25 @@ ride_id_t gTrackDesignSaveRideIndex = RIDE_ID_NULL; std::vector _trackSavedTileElements; std::vector _trackSavedTileElementsDesc; +struct TrackDesignAddStatus +{ + bool IsSuccess{}; + rct_string_id Message{}; + + static TrackDesignAddStatus Success() + { + return { true, rct_string_id() }; + } + + static TrackDesignAddStatus Fail(rct_string_id message) + { + return { false, message }; + } +}; + static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement); static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex, int32_t cx, int32_t cy); -static bool track_design_save_add_tile_element( +static TrackDesignAddStatus track_design_save_add_tile_element( ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement); static void track_design_save_remove_tile_element( ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement); @@ -72,11 +93,10 @@ void track_design_save_select_tile_element( { if (collect) { - if (!track_design_save_add_tile_element(interactionType, loc, tileElement)) + auto result = track_design_save_add_tile_element(interactionType, loc, tileElement); + if (!result.IsSuccess) { - context_show_error( - STR_SAVE_TRACK_SCENERY_UNABLE_TO_SELECT_ADDITIONAL_ITEM_OF_SCENERY, - STR_SAVE_TRACK_SCENERY_TOO_MANY_ITEMS_SELECTED, {}); + context_show_error(STR_SAVE_TRACK_SCENERY_UNABLE_TO_SELECT_ADDITIONAL_ITEM_OF_SCENERY, result.Message, {}); } } } @@ -188,16 +208,18 @@ static void track_design_save_push_tile_element(const CoordsXY& loc, TileElement } } -/** - * - * rct2: 0x006D2FA7 - */ +static bool track_design_is_supported_object(const Object* obj) +{ + const auto& entry = obj->GetObjectEntry(); + return !entry.IsEmpty(); +} + static void track_design_save_push_tile_element_desc( const rct_object_entry& entry, const CoordsXYZ& loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour) { auto tileLoc = TileCoordsXYZ(loc); TrackDesignSceneryElement item{}; - item.scenery_object = entry; + item.scenery_object = ObjectEntryDescriptor(entry); item.x = tileLoc.x; item.y = tileLoc.y; item.z = tileLoc.z; @@ -208,96 +230,146 @@ static void track_design_save_push_tile_element_desc( _trackSavedTileElementsDesc.push_back(std::move(item)); } -static void track_design_save_add_scenery(const CoordsXY& loc, SmallSceneryElement* sceneryElement) +static void track_design_save_push_tile_element_desc( + const Object* obj, const CoordsXYZ& loc, uint8_t flags, uint8_t primaryColour, uint8_t secondaryColour) { - int32_t entryType = sceneryElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::SmallScenery, entryType); + const auto& entry = obj->GetObjectEntry(); + if (entry.IsEmpty()) + { + // Unsupported, should have been blocked earlier + assert(false); + } - uint8_t flags = 0; - flags |= sceneryElement->GetDirection(); - flags |= sceneryElement->GetSceneryQuadrant() << 2; - - uint8_t primaryColour = sceneryElement->GetPrimaryColour(); - uint8_t secondaryColour = sceneryElement->GetSecondaryColour(); - - track_design_save_push_tile_element(loc, reinterpret_cast(sceneryElement)); - track_design_save_push_tile_element_desc( - entry->GetObjectEntry(), { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags, primaryColour, secondaryColour); + track_design_save_push_tile_element_desc(entry, loc, flags, primaryColour, secondaryColour); } -static void track_design_save_add_large_scenery(const CoordsXY& loc, LargeSceneryElement* tileElement) +static TrackDesignAddStatus track_design_save_add_scenery(const CoordsXY& loc, SmallSceneryElement* sceneryElement) { - rct_large_scenery_tile *sceneryTiles, *tile; - int32_t direction, sequence; - - if (tileElement == nullptr) + auto entryIndex = sceneryElement->GetEntryIndex(); + auto obj = object_entry_get_object(ObjectType::SmallScenery, entryIndex); + if (obj != nullptr && track_design_is_supported_object(obj)) { - log_warning("Null tile element"); - return; + uint8_t flags = 0; + flags |= sceneryElement->GetDirection(); + flags |= sceneryElement->GetSceneryQuadrant() << 2; + + uint8_t primaryColour = sceneryElement->GetPrimaryColour(); + uint8_t secondaryColour = sceneryElement->GetSecondaryColour(); + + track_design_save_push_tile_element(loc, reinterpret_cast(sceneryElement)); + track_design_save_push_tile_element_desc( + obj, { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags, primaryColour, secondaryColour); + return TrackDesignAddStatus::Success(); } - int32_t entryType = tileElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::LargeScenery, entryType); - sceneryTiles = get_large_scenery_entry(entryType)->tiles; + return TrackDesignAddStatus::Fail(STR_UNSUPPORTED_OBJECT_FORMAT); +} - int32_t z = tileElement->base_height; - direction = tileElement->GetDirection(); - sequence = tileElement->GetSequenceIndex(); - - auto sceneryOrigin = map_large_scenery_get_origin( - { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); - if (!sceneryOrigin.has_value()) +static TrackDesignAddStatus track_design_save_add_large_scenery(const CoordsXY& loc, LargeSceneryElement* tileElement) +{ + auto entryIndex = tileElement->GetEntryIndex(); + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = objectMgr.GetLoadedObject(ObjectType::LargeScenery, entryIndex); + if (obj != nullptr && track_design_is_supported_object(obj)) { - return; - } + auto sceneryEntry = reinterpret_cast(obj->GetLegacyData()); + auto sceneryTiles = sceneryEntry->tiles; - // Iterate through each tile of the large scenery element - sequence = 0; - for (tile = sceneryTiles; tile->x_offset != -1; tile++, sequence++) - { - CoordsXY offsetPos{ tile->x_offset, tile->y_offset }; - auto rotatedOffsetPos = offsetPos.Rotate(direction); + int32_t z = tileElement->base_height; + auto direction = tileElement->GetDirection(); + auto sequence = tileElement->GetSequenceIndex(); - CoordsXYZ tileLoc = { sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y, - sceneryOrigin->z + tile->z_offset }; - auto largeElement = map_get_large_scenery_segment({ tileLoc, static_cast(direction) }, sequence); - if (largeElement != nullptr) + auto sceneryOrigin = map_large_scenery_get_origin( + { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); + if (!sceneryOrigin.has_value()) { - if (sequence == 0) - { - uint8_t flags = largeElement->GetDirection(); - uint8_t primaryColour = largeElement->GetPrimaryColour(); - uint8_t secondaryColour = largeElement->GetSecondaryColour(); + return TrackDesignAddStatus::Success(); + } - track_design_save_push_tile_element_desc( - entry->GetObjectEntry(), tileLoc, flags, primaryColour, secondaryColour); + // Iterate through each tile of the large scenery element + sequence = 0; + for (auto tile = sceneryTiles; tile->x_offset != -1; tile++, sequence++) + { + CoordsXY offsetPos{ tile->x_offset, tile->y_offset }; + auto rotatedOffsetPos = offsetPos.Rotate(direction); + + CoordsXYZ tileLoc = { sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y, + sceneryOrigin->z + tile->z_offset }; + auto largeElement = map_get_large_scenery_segment({ tileLoc, static_cast(direction) }, sequence); + if (largeElement != nullptr) + { + if (sequence == 0) + { + uint8_t flags = largeElement->GetDirection(); + uint8_t primaryColour = largeElement->GetPrimaryColour(); + uint8_t secondaryColour = largeElement->GetSecondaryColour(); + + track_design_save_push_tile_element_desc(obj, tileLoc, flags, primaryColour, secondaryColour); + } + track_design_save_push_tile_element({ tileLoc.x, tileLoc.y }, reinterpret_cast(largeElement)); } - track_design_save_push_tile_element({ tileLoc.x, tileLoc.y }, reinterpret_cast(largeElement)); + } + return TrackDesignAddStatus::Success(); + } + + return TrackDesignAddStatus::Fail(STR_UNSUPPORTED_OBJECT_FORMAT); +} + +static TrackDesignAddStatus track_design_save_add_wall(const CoordsXY& loc, WallElement* wallElement) +{ + auto entryIndex = wallElement->GetEntryIndex(); + auto obj = object_entry_get_object(ObjectType::Walls, entryIndex); + if (obj != nullptr && track_design_is_supported_object(obj)) + { + uint8_t flags = 0; + flags |= wallElement->GetDirection(); + flags |= wallElement->GetTertiaryColour() << 2; + + uint8_t secondaryColour = wallElement->GetSecondaryColour(); + uint8_t primaryColour = wallElement->GetPrimaryColour(); + + track_design_save_push_tile_element(loc, reinterpret_cast(wallElement)); + track_design_save_push_tile_element_desc( + obj, { loc.x, loc.y, wallElement->GetBaseZ() }, flags, primaryColour, secondaryColour); + return TrackDesignAddStatus::Success(); + } + + return TrackDesignAddStatus::Fail(STR_UNSUPPORTED_OBJECT_FORMAT); +} + +static std::optional track_design_save_footpath_get_best_entry(PathElement* pathElement) +{ + rct_object_entry pathEntry; + auto legacyPathObj = pathElement->GetLegacyPathEntry(); + if (legacyPathObj != nullptr) + { + pathEntry = legacyPathObj->GetObjectEntry(); + if (!pathEntry.IsEmpty()) + { + return pathEntry; } } + else + { + auto surfaceEntry = pathElement->GetSurfaceEntry(); + if (surfaceEntry != nullptr) + { + auto surfaceId = surfaceEntry->GetIdentifier(); + auto railingsEntry = pathElement->GetRailingsEntry(); + auto railingsId = railingsEntry == nullptr ? "" : railingsEntry->GetIdentifier(); + return GetBestObjectEntryForSurface(surfaceId, railingsId); + } + } + return {}; } -static void track_design_save_add_wall(const CoordsXY& loc, WallElement* wallElement) +static TrackDesignAddStatus track_design_save_add_footpath(const CoordsXY& loc, PathElement* pathElement) { - int32_t entryType = wallElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::Walls, entryType); - - uint8_t flags = 0; - flags |= wallElement->GetDirection(); - flags |= wallElement->GetTertiaryColour() << 2; - - uint8_t secondaryColour = wallElement->GetSecondaryColour(); - uint8_t primaryColour = wallElement->GetPrimaryColour(); - - track_design_save_push_tile_element(loc, reinterpret_cast(wallElement)); - track_design_save_push_tile_element_desc( - entry->GetObjectEntry(), { loc.x, loc.y, wallElement->GetBaseZ() }, flags, primaryColour, secondaryColour); -} - -static void track_design_save_add_footpath(const CoordsXY& loc, PathElement* pathElement) -{ - int32_t entryType = pathElement->GetLegacyPathEntryIndex(); - auto entry = object_entry_get_object(ObjectType::Paths, entryType); + auto pathEntry = track_design_save_footpath_get_best_entry(pathElement); + if (!pathElement) + { + return TrackDesignAddStatus::Fail(STR_UNSUPPORTED_OBJECT_FORMAT); + } uint8_t flags = 0; flags |= pathElement->GetEdges(); @@ -308,37 +380,34 @@ static void track_design_save_add_footpath(const CoordsXY& loc, PathElement* pat flags |= 1 << 7; track_design_save_push_tile_element(loc, reinterpret_cast(pathElement)); - track_design_save_push_tile_element_desc(entry->GetObjectEntry(), { loc.x, loc.y, pathElement->GetBaseZ() }, flags, 0, 0); + track_design_save_push_tile_element_desc(*pathEntry, { loc.x, loc.y, pathElement->GetBaseZ() }, flags, 0, 0); + return TrackDesignAddStatus::Success(); } /** * * rct2: 0x006D2B3C */ -static bool track_design_save_add_tile_element( +static TrackDesignAddStatus track_design_save_add_tile_element( ViewportInteractionItem interactionType, const CoordsXY& loc, TileElement* tileElement) { if (!track_design_save_can_add_tile_element(tileElement)) { - return false; + return TrackDesignAddStatus::Fail(STR_SAVE_TRACK_SCENERY_TOO_MANY_ITEMS_SELECTED); } switch (interactionType) { case ViewportInteractionItem::Scenery: - track_design_save_add_scenery(loc, tileElement->AsSmallScenery()); - return true; + return track_design_save_add_scenery(loc, tileElement->AsSmallScenery()); case ViewportInteractionItem::LargeScenery: - track_design_save_add_large_scenery(loc, tileElement->AsLargeScenery()); - return true; + return track_design_save_add_large_scenery(loc, tileElement->AsLargeScenery()); case ViewportInteractionItem::Wall: - track_design_save_add_wall(loc, tileElement->AsWall()); - return true; + return track_design_save_add_wall(loc, tileElement->AsWall()); case ViewportInteractionItem::Footpath: - track_design_save_add_footpath(loc, tileElement->AsPath()); - return true; + return track_design_save_add_footpath(loc, tileElement->AsPath()); default: - return false; + return TrackDesignAddStatus::Fail(STR_UNKNOWN_OBJECT_TYPE); } } @@ -370,7 +439,7 @@ static void track_design_save_pop_tile_element(const CoordsXY& loc, TileElement* * * rct2: 0x006D2FDD */ -static void track_design_save_pop_tile_element_desc(const rct_object_entry& entry, const CoordsXYZ& loc, uint8_t flags) +static void track_design_save_pop_tile_element_desc(const ObjectEntryDescriptor& entry, const CoordsXYZ& loc, uint8_t flags) { size_t removeIndex = SIZE_MAX; auto tileLoc = TileCoordsXYZ(loc); @@ -399,93 +468,101 @@ static void track_design_save_pop_tile_element_desc(const rct_object_entry& entr static void track_design_save_remove_scenery(const CoordsXY& loc, SmallSceneryElement* sceneryElement) { - int32_t entryType = sceneryElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::SmallScenery, entryType); + auto entryIndex = sceneryElement->GetEntryIndex(); + auto obj = object_entry_get_object(ObjectType::SmallScenery, entryIndex); + if (obj != nullptr) + { + uint8_t flags = 0; + flags |= sceneryElement->GetDirection(); + flags |= sceneryElement->GetSceneryQuadrant() << 2; - uint8_t flags = 0; - flags |= sceneryElement->GetDirection(); - flags |= sceneryElement->GetSceneryQuadrant() << 2; - - track_design_save_pop_tile_element(loc, reinterpret_cast(sceneryElement)); - track_design_save_pop_tile_element_desc(entry->GetObjectEntry(), { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags); + track_design_save_pop_tile_element(loc, reinterpret_cast(sceneryElement)); + track_design_save_pop_tile_element_desc(obj->GetDescriptor(), { loc.x, loc.y, sceneryElement->GetBaseZ() }, flags); + } } static void track_design_save_remove_large_scenery(const CoordsXY& loc, LargeSceneryElement* tileElement) { - rct_large_scenery_tile *sceneryTiles, *tile; - int32_t direction, sequence; - if (tileElement == nullptr) { log_warning("Null tile element"); return; } - int32_t entryType = tileElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::LargeScenery, entryType); - sceneryTiles = get_large_scenery_entry(entryType)->tiles; - - int32_t z = tileElement->base_height; - direction = tileElement->GetDirection(); - sequence = tileElement->GetSequenceIndex(); - - auto sceneryOrigin = map_large_scenery_get_origin( - { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); - if (!sceneryOrigin) + auto entryIndex = tileElement->GetEntryIndex(); + auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = objectMgr.GetLoadedObject(ObjectType::LargeScenery, entryIndex); + if (obj != nullptr) { - return; - } + auto sceneryEntry = reinterpret_cast(obj->GetLegacyData()); + auto sceneryTiles = sceneryEntry->tiles; - // Iterate through each tile of the large scenery element - sequence = 0; - for (tile = sceneryTiles; tile->x_offset != -1; tile++, sequence++) - { - CoordsXY offsetPos{ tile->x_offset, tile->y_offset }; - auto rotatedOffsetPos = offsetPos.Rotate(direction); + int32_t z = tileElement->base_height; + auto direction = tileElement->GetDirection(); + auto sequence = tileElement->GetSequenceIndex(); - CoordsXYZ tileLoc = { sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y, - sceneryOrigin->z + tile->z_offset }; - auto largeElement = map_get_large_scenery_segment({ tileLoc, static_cast(direction) }, sequence); - if (largeElement != nullptr) + auto sceneryOrigin = map_large_scenery_get_origin( + { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); + if (!sceneryOrigin) { - if (sequence == 0) + return; + } + + // Iterate through each tile of the large scenery element + sequence = 0; + for (auto tile = sceneryTiles; tile->x_offset != -1; tile++, sequence++) + { + CoordsXY offsetPos{ tile->x_offset, tile->y_offset }; + auto rotatedOffsetPos = offsetPos.Rotate(direction); + + CoordsXYZ tileLoc = { sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y, + sceneryOrigin->z + tile->z_offset }; + auto largeElement = map_get_large_scenery_segment({ tileLoc, static_cast(direction) }, sequence); + if (largeElement != nullptr) { - uint8_t flags = largeElement->GetDirection(); - track_design_save_pop_tile_element_desc(entry->GetObjectEntry(), tileLoc, flags); + if (sequence == 0) + { + uint8_t flags = largeElement->GetDirection(); + track_design_save_pop_tile_element_desc(obj->GetDescriptor(), tileLoc, flags); + } + track_design_save_pop_tile_element({ tileLoc.x, tileLoc.y }, reinterpret_cast(largeElement)); } - track_design_save_pop_tile_element({ tileLoc.x, tileLoc.y }, reinterpret_cast(largeElement)); } } } static void track_design_save_remove_wall(const CoordsXY& loc, WallElement* wallElement) { - int32_t entryType = wallElement->GetEntryIndex(); - auto entry = object_entry_get_object(ObjectType::Walls, entryType); + auto entryIndex = wallElement->GetEntryIndex(); + auto obj = object_entry_get_object(ObjectType::Walls, entryIndex); + if (obj != nullptr) + { + uint8_t flags = 0; + flags |= wallElement->GetDirection(); + flags |= wallElement->GetTertiaryColour() << 2; - uint8_t flags = 0; - flags |= wallElement->GetDirection(); - flags |= wallElement->GetTertiaryColour() << 2; - - track_design_save_pop_tile_element(loc, reinterpret_cast(wallElement)); - track_design_save_pop_tile_element_desc(entry->GetObjectEntry(), { loc.x, loc.y, wallElement->GetBaseZ() }, flags); + track_design_save_pop_tile_element(loc, reinterpret_cast(wallElement)); + track_design_save_pop_tile_element_desc(obj->GetDescriptor(), { loc.x, loc.y, wallElement->GetBaseZ() }, flags); + } } static void track_design_save_remove_footpath(const CoordsXY& loc, PathElement* pathElement) { - int32_t entryType = pathElement->GetLegacyPathEntryIndex(); - auto entry = object_entry_get_object(ObjectType::Paths, entryType); + auto pathEntry = track_design_save_footpath_get_best_entry(pathElement); + if (pathElement) + { + uint8_t flags = 0; + flags |= pathElement->GetEdges(); + flags |= (pathElement->GetSlopeDirection()) << 5; + if (pathElement->IsSloped()) + flags |= 0b00010000; + if (pathElement->IsQueue()) + flags |= 1 << 7; - uint8_t flags = 0; - flags |= pathElement->GetEdges(); - if (pathElement->IsSloped()) - flags |= (1 << 4); - flags |= (pathElement->GetSlopeDirection()) << 5; - if (pathElement->IsQueue()) - flags |= (1 << 7); - - track_design_save_pop_tile_element(loc, reinterpret_cast(pathElement)); - track_design_save_pop_tile_element_desc(entry->GetObjectEntry(), { loc.x, loc.y, pathElement->GetBaseZ() }, flags); + track_design_save_pop_tile_element(loc, reinterpret_cast(pathElement)); + track_design_save_pop_tile_element_desc( + ObjectEntryDescriptor(*pathEntry), { loc.x, loc.y, pathElement->GetBaseZ() }, flags); + } } /** From d5bac4783470cf027b6a7c48d3346b15d209c892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 11 Oct 2021 19:49:30 +0300 Subject: [PATCH 536/681] Bump up network version --- 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 6e7564d2a1..4022d40a3c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "13" +#define NETWORK_STREAM_VERSION "14" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 0ef4ed35e9053d347c64086b600673564cd07f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 11 Oct 2021 20:18:14 +0300 Subject: [PATCH 537/681] Fix scenery being disabled, footpath railings don't exist in develop --- src/openrct2/ride/TrackDesign.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 55317043d2..63cb9fae7c 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -651,7 +651,7 @@ static void track_design_load_scenery_objects(TrackDesign* td6) { if (scenery.scenery_object.HasValue()) { - objectManager.LoadObject(td6->vehicle_object); + objectManager.LoadObject(scenery.scenery_object); } } } @@ -734,7 +734,7 @@ static std::optional TrackDesignPlaceSceneryElementGetEntry(c if (result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL) result.SecondaryIndex = TrackDesignGetDefaultRailingIndex(); - if (result.Index == OBJECT_ENTRY_INDEX_NULL || result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL) + if (result.Index == OBJECT_ENTRY_INDEX_NULL) { _trackDesignPlaceStateSceneryUnavailable = true; return {}; From b4cd8e462882ca495f602532e1cf8fd5dbf93518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:01:11 -0700 Subject: [PATCH 538/681] Fix #15560: Memory leak due to OpenGL Renderer not releasing a texture --- distribution/changelog.txt | 1 + src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp | 5 +++++ src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h | 1 + 3 files changed, 7 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d547108d3f..9d9fde6605 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -36,6 +36,7 @@ - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. +- Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp index fb7098183c..39c88b9dec 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp @@ -27,6 +27,11 @@ SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) glClearBufferfv(GL_DEPTH, 0, depthValueTransparent); } +SwapFramebuffer::~SwapFramebuffer() +{ + glDeleteTextures(1, &_backDepth); +} + void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint paletteTex) { _mixFramebuffer.Bind(); diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h index 5880e254f9..44d1659a3b 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h @@ -33,6 +33,7 @@ private: public: SwapFramebuffer(int32_t width, int32_t height); + ~SwapFramebuffer(); const OpenGLFramebuffer& GetFinalFramebuffer() const { From c2d9d727d9278f8f5d21982bbf72edd6c3246420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 12 Oct 2021 20:50:17 +0300 Subject: [PATCH 539/681] Fix #15566: Litter age underflow --- src/openrct2/world/Litter.cpp | 5 +++++ src/openrct2/world/Litter.h | 1 + src/openrct2/world/Park.cpp | 10 ++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index c3348056a0..a5310d9f42 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -126,3 +126,8 @@ rct_string_id Litter::GetName() const return STR_NONE; return litterNames[EnumValue(SubType)]; } + +uint32_t Litter::GetAge() const +{ + return gCurrentTicks - creationTick; +} diff --git a/src/openrct2/world/Litter.h b/src/openrct2/world/Litter.h index 2aafcfeecf..52c8381f60 100644 --- a/src/openrct2/world/Litter.h +++ b/src/openrct2/world/Litter.h @@ -40,4 +40,5 @@ struct Litter : EntityBase static void RemoveAt(const CoordsXYZ& litterPos); void Serialise(DataSerialiser& stream); rct_string_id GetName() const; + uint32_t GetAge() const; }; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index c8ff39b4bd..709269153c 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -464,13 +464,15 @@ int32_t Park::CalculateParkRating() const // Litter { int32_t litterCount = 0; - for (auto litter : EntityList()) + for (auto* litter : EntityList()) { - // Ignore recently dropped litter - if (litter->creationTick - gCurrentTicks >= 7680) + if (litter->GetAge() < 7680) { - litterCount++; + // Ignore recently dropped litter. + continue; } + + litterCount++; } result -= 600 - (4 * (150 - std::min(150, litterCount))); } From f2372337bfb2946f9da2d862443b182f9e86f370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 12 Oct 2021 21:36:13 +0300 Subject: [PATCH 540/681] Bump up network version --- 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 6e7564d2a1..4022d40a3c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "13" +#define NETWORK_STREAM_VERSION "14" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From ba96d6a7fd4d1c8f71c55017ea10e21f1c17dac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 12 Oct 2021 21:44:30 +0300 Subject: [PATCH 541/681] Update replays --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b422d41619..dd15138ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,9 +65,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.55") +set(REPLAYS_VERSION "0.0.56") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "70B4B7CB26A428801676BCC615F3881E72A45406") +set(REPLAYS_SHA1 "C47048B71A95A95428A08035C94AD10E7A020D4D") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index d8fcfb7bc1..a895838c42 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.55/replays.zip - 70B4B7CB26A428801676BCC615F3881E72A45406 + https://github.com/OpenRCT2/replays/releases/download/v0.0.56/replays.zip + C47048B71A95A95428A08035C94AD10E7A020D4D From f2bfec977f2569a79e44b4056d7c5b49e306bf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 13 Oct 2021 21:35:21 +0300 Subject: [PATCH 542/681] Update changelog.txt --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9d9fde6605..f7855cd3e8 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -37,6 +37,7 @@ - Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. +- Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. From a3641aa102f7db494d73e9aba68eee0a3f74aaa6 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 29 Sep 2021 22:04:23 +0200 Subject: [PATCH 543/681] Fix: Surface slopes edited by TI have invalid clearance --- src/openrct2/world/TileInspector.cpp | 32 +++++++++------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 56c5613875..d103d1b7dd 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -587,49 +587,37 @@ namespace OpenRCT2::TileInspector if (isExecuting) { const uint8_t originalSlope = surfaceElement->GetSlope(); - const bool diagonal = (originalSlope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) >> 4; - uint8_t newSlope = surfaceElement->GetSlope() ^ (1 << cornerIndex); - surfaceElement->SetSlope(newSlope); - if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - surfaceElement->clearance_height = surfaceElement->base_height + 2; - } - else - { - surfaceElement->clearance_height = surfaceElement->base_height; - } // All corners are raised - if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) == TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) + if ((newSlope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) == TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { - uint8_t slope = TILE_ELEMENT_SLOPE_FLAT; - - if (diagonal) + newSlope = TILE_ELEMENT_SLOPE_FLAT; + if ((originalSlope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) != 0) { switch (originalSlope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { case TILE_ELEMENT_SLOPE_S_CORNER_DN: - slope |= TILE_ELEMENT_SLOPE_N_CORNER_UP; + newSlope |= TILE_ELEMENT_SLOPE_N_CORNER_UP; break; case TILE_ELEMENT_SLOPE_W_CORNER_DN: - slope |= TILE_ELEMENT_SLOPE_E_CORNER_UP; + newSlope |= TILE_ELEMENT_SLOPE_E_CORNER_UP; break; case TILE_ELEMENT_SLOPE_N_CORNER_DN: - slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; + newSlope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; break; case TILE_ELEMENT_SLOPE_E_CORNER_DN: - slope |= TILE_ELEMENT_SLOPE_W_CORNER_UP; + newSlope |= TILE_ELEMENT_SLOPE_W_CORNER_UP; break; } } - surfaceElement->SetSlope(slope); - // Update base and clearance heights surfaceElement->base_height += 2; - surfaceElement->clearance_height = surfaceElement->base_height + (diagonal ? 2 : 0); + surfaceElement->clearance_height = surfaceElement->base_height; } + surfaceElement->SetSlope(newSlope); + map_invalidate_tile_full(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) From f09006b6dd4ad438719157639c347995cab50417 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Tue, 12 Oct 2021 10:13:11 +0200 Subject: [PATCH 544/681] Do not change clearance height when toggling slope --- src/openrct2/world/TileInspector.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index d103d1b7dd..fcb3a3798f 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -641,18 +641,6 @@ namespace OpenRCT2::TileInspector { uint8_t newSlope = surfaceElement->GetSlope() ^ TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT; surfaceElement->SetSlope(newSlope); - if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - { - surfaceElement->clearance_height = surfaceElement->base_height + 4; - } - else if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - surfaceElement->clearance_height = surfaceElement->base_height + 2; - } - else - { - surfaceElement->clearance_height = surfaceElement->base_height; - } map_invalidate_tile_full(loc); From ea4c21522b71289a1132e3b327da967d54481236 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 13 Oct 2021 23:42:28 +0200 Subject: [PATCH 545/681] Increment network version --- 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 6e7564d2a1..4022d40a3c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "13" +#define NETWORK_STREAM_VERSION "14" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From cac2708066e3ac6483898540a8828254db027f5e Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Wed, 13 Oct 2021 23:44:17 +0200 Subject: [PATCH 546/681] Add changelog entry --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9d9fde6605..f414f49d1e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#15451] Guest list name filter remains after group selection. - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. +- Fix: [#15490] Tile inspector needlessly updates clearance height when changing surface slopes. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. From f701d2ceb5c9cc0c7f296c9415e932a33acfe692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:31:37 +0300 Subject: [PATCH 547/681] Make EntityList const correct --- src/openrct2/world/EntityList.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/world/EntityList.h b/src/openrct2/world/EntityList.h index 19489ae49b..60d967aac5 100644 --- a/src/openrct2/world/EntityList.h +++ b/src/openrct2/world/EntityList.h @@ -165,11 +165,11 @@ public: { } - EntityListIterator_t begin() + EntityListIterator_t begin() const { return EntityListIterator_t(std::cbegin(vec), std::cend(vec)); } - EntityListIterator_t end() + EntityListIterator_t end() const { return EntityListIterator_t(std::cend(vec), std::cend(vec)); } From e1fb987c12e62c1bd94824046d2af2bbd252e9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:32:05 +0300 Subject: [PATCH 548/681] Replace loop with count_if --- src/openrct2/world/Park.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 709269153c..ddcec0d235 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -463,17 +463,11 @@ int32_t Park::CalculateParkRating() const // Litter { - int32_t litterCount = 0; - for (auto* litter : EntityList()) - { - if (litter->GetAge() < 7680) - { - // Ignore recently dropped litter. - continue; - } + // Counts the amount of litter whose age is min. 7680 ticks (5~ min) old. + const auto litterList = EntityList(); + const auto litterCount = std::count_if( + litterList.begin(), litterList.end(), [](auto* litter) { return litter->GetAge() >= 7680; }); - litterCount++; - } result -= 600 - (4 * (150 - std::min(150, litterCount))); } From 04004d9b8c8ad34364005e2d9148b6604b6656d4 Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Thu, 14 Oct 2021 23:01:47 +0900 Subject: [PATCH 549/681] Fix #15377: Station Hover doesn't show entrance/exit ghost (#15523) Fix #15377: Station Hover doesn't show entrance/exit ghost Replacing tileElement->AsTrack() with trackElement Changing const auto* to TrackElement* Replacing trackElement with auto Implementing ZehMatt's Feedback Update changelog.txt --- distribution/changelog.txt | 1 + src/openrct2/ride/RideConstruction.cpp | 197 ++++++------------------- 2 files changed, 49 insertions(+), 149 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9d9fde6605..c921a159a9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -31,6 +31,7 @@ - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Fix: [#15451] Guest list name filter remains after group selection. +- Fix: [#15377] Entrance/exit ghost doesn't work on different stations without touching them first. - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 18fafd2572..90dc3fd58f 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1202,43 +1202,6 @@ money32 set_operating_setting_nested(ride_id_t rideId, RideSetSetting setting, u return res->Error == GameActions::Status::Ok ? 0 : MONEY32_UNDEFINED; } -// Finds the direction a ride entrance should face for an NxN station. -// Direction is valid if queryLocation is directly adjacent to this station. -static Direction GetRideEntranceDirection(const CoordsXY& queryLocation, CoordsXY entranceMin, CoordsXY entranceMax) -{ - entranceMin -= CoordsXY(32, 32); - entranceMax += CoordsXY(32, 32); - if (queryLocation.x == entranceMin.x) - { - if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) - { - return 0; - } - } - if (queryLocation.y == entranceMax.y) - { - if (queryLocation.x > entranceMin.x && queryLocation.x < entranceMax.x) - { - return 1; - } - } - if (queryLocation.x == entranceMax.x) - { - if (queryLocation.y > entranceMin.y && queryLocation.y < entranceMax.y) - { - return 2; - } - } - if (queryLocation.y == entranceMin.y) - { - if (queryLocation.x > entranceMin.x && queryLocation.x < entranceMax.x) - { - return 3; - } - } - return INVALID_DIRECTION; -} - /** * * rct2: 0x006CCF70 @@ -1253,18 +1216,19 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC { if (info.Element->GetType() == TILE_ELEMENT_TYPE_TRACK) { - if (info.Element->AsTrack()->GetRideIndex() == gRideEntranceExitPlaceRideIndex) + const auto* trackElement = info.Element->AsTrack(); + if (trackElement->GetRideIndex() == gRideEntranceExitPlaceRideIndex) { - const auto& ted = GetTrackElementDescriptor(info.Element->AsTrack()->GetTrackType()); + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) { - if (info.Element->AsTrack()->GetTrackType() == TrackElemType::Maze) + if (trackElement->GetTrackType() == TrackElemType::Maze) { gRideEntranceExitPlaceStationIndex = 0; } else { - gRideEntranceExitPlaceStationIndex = info.Element->AsTrack()->GetStationIndex(); + gRideEntranceExitPlaceStationIndex = trackElement->GetStationIndex(); } } } @@ -1302,132 +1266,67 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC return entranceExitCoords; } - // flat rides - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) + // find the quadrant the mouse is hovering over - that's the direction to start searching for a station TileElement + Direction startDirection = 0; + auto mapX = (coordsAtHeight->x & 0x1F) - 16; + auto mapY = (coordsAtHeight->y & 0x1F) - 16; + if (std::abs(mapX) < std::abs(mapY)) { - // find the quadrant the mouse is hovering over - that's the direction to start searching for a station TileElement - Direction startDirection = 0; - auto mapX = (coordsAtHeight->x & 0x1F) - 16; - auto mapY = (coordsAtHeight->y & 0x1F) - 16; - if (std::abs(mapX) < std::abs(mapY)) - { - startDirection = mapY < 0 ? 3 : 1; - } - else - { - startDirection = mapX < 0 ? 0 : 2; - } - // check all 4 directions, starting with the mouse's quadrant - for (uint8_t directionIncrement = 0; directionIncrement < 4; directionIncrement++) - { - entranceExitCoords.direction = (startDirection + directionIncrement) & 3; - // search for TrackElement one tile over, shifted in the search direction - auto nextLocation = entranceExitCoords; - nextLocation += CoordsDirectionDelta[entranceExitCoords.direction]; - if (map_is_location_valid(nextLocation)) - { - // iterate over every element in the tile until we find what we want - auto tileElement = map_get_first_element_at(nextLocation); - if (tileElement == nullptr) - continue; - do - { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - continue; - if (tileElement->GetBaseZ() != stationBaseZ) - continue; - if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) - continue; - if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Maze) - { - // if it's a maze, it can place the entrance and exit immediately - entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; - } - if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) - continue; - // if it's not a maze, the sequence properties for the TrackElement must be found to determine if an - // entrance can be placed on that side - - // get the ride entrance's side relative to the TrackElement - Direction direction = (direction_reverse(entranceExitCoords.direction) - tileElement->GetDirection()) & 3; - const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - if (ted.SequenceProperties[tileElement->AsTrack()->GetSequenceIndex()] & (1 << direction)) - { - // if that side of the TrackElement supports stations, the ride entrance is valid and faces away from - // the station - entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; - } - } while (!(tileElement++)->IsLastForTile()); - } - } - gRideEntranceExitPlaceDirection = INVALID_DIRECTION; + startDirection = mapY < 0 ? 3 : 1; } - // tracked rides excluding tower rides else { - // create a 2-point rectangle. The rectangle will have a width or height of 0 depending on station direction - CoordsXY entranceMin = { stationStart }; - CoordsXY entranceMax = { stationStart }; - - // get the beginning of the station TrackElement - auto tileElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex); - if (tileElement == nullptr) + startDirection = mapX < 0 ? 0 : 2; + } + // check all 4 directions, starting with the mouse's quadrant + for (uint8_t directionIncrement = 0; directionIncrement < 4; directionIncrement++) + { + entranceExitCoords.direction = (startDirection + directionIncrement) & 3; + // search for TrackElement one tile over, shifted in the search direction + auto nextLocation = entranceExitCoords; + nextLocation += CoordsDirectionDelta[entranceExitCoords.direction]; + if (map_is_location_valid(nextLocation)) { - entranceExitCoords.SetNull(); - return entranceExitCoords; - } - auto stationDirection = tileElement->GetDirection(); - entranceExitCoords.direction = stationDirection; - - auto next = entranceMax; - // find additional station TrackElements and extend the line of valid entrance locations - while (true) - { - entranceMax = next; - next -= CoordsDirectionDelta[stationDirection]; - tileElement = map_get_first_element_at(next); + // iterate over every element in the tile until we find what we want + auto* tileElement = map_get_first_element_at(nextLocation); if (tileElement == nullptr) - break; - bool goToNextTile = false; - + continue; do { if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (tileElement->AsTrack()->GetRideIndex() != gRideEntranceExitPlaceRideIndex) + if (tileElement->GetBaseZ() != stationBaseZ) continue; - if (tileElement->AsTrack()->GetStationIndex() != gRideEntranceExitPlaceStationIndex) + auto* trackElement = tileElement->AsTrack(); + if (trackElement->GetRideIndex() != gRideEntranceExitPlaceRideIndex) continue; - - if (tileElement->AsTrack()->IsStation()) + if (trackElement->GetTrackType() == TrackElemType::Maze) { - goToNextTile = true; + // if it's a maze, it can place the entrance and exit immediately + entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); + gRideEntranceExitPlaceDirection = entranceExitCoords.direction; + return entranceExitCoords; } - } while (!goToNextTile && !(tileElement++)->IsLastForTile()); + // if it's not a maze, the sequence properties for the TrackElement must be found to determine if an + // entrance can be placed on that side - if (!goToNextTile) - break; - } - // swap variables for valid ranges - if (entranceMin.x > entranceMax.x) - std::swap(entranceMin.x, entranceMax.x); - if (entranceMin.y > entranceMax.y) - std::swap(entranceMin.y, entranceMax.y); + gRideEntranceExitPlaceStationIndex = trackElement->GetStationIndex(); - // get the station direction from its position - auto direction = GetRideEntranceDirection(entranceExitCoords, entranceMin, entranceMax); - - if (direction != INVALID_DIRECTION && direction != stationDirection && direction != direction_reverse(stationDirection)) - { - entranceExitCoords.direction = direction; - gRideEntranceExitPlaceDirection = entranceExitCoords.direction; - return entranceExitCoords; + // get the ride entrance's side relative to the TrackElement + Direction direction = (direction_reverse(entranceExitCoords.direction) - tileElement->GetDirection()) & 3; + const auto& ted = GetTrackElementDescriptor(trackElement->GetTrackType()); + if (ted.SequenceProperties[trackElement->GetSequenceIndex()] & (1 << direction)) + { + // if that side of the TrackElement supports stations, the ride entrance is valid and faces away from + // the station + entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); + gRideEntranceExitPlaceDirection = entranceExitCoords.direction; + return entranceExitCoords; + } + } while (!(tileElement++)->IsLastForTile()); } } + gRideEntranceExitPlaceDirection = INVALID_DIRECTION; return entranceExitCoords; } From 780ebea3f0c0ccbba39af5eda5b99d3cc2dea90f Mon Sep 17 00:00:00 2001 From: Makke94 Date: Thu, 14 Oct 2021 16:35:40 +0200 Subject: [PATCH 550/681] Refactor TrackList Window into class (#13812) (#15533) * Close #13812: Refactor window to class: TrackList * Close #13812: Refactor window to class: TrackList * Remove misplaced include * Refactor to CamelCase * Remove forward declaration * Fix unsafe string_view operation * Access local widgets insted of global * Override correct function Co-authored-by: Makke --- src/openrct2-ui/windows/TrackList.cpp | 1416 ++++++++++++------------- 1 file changed, 679 insertions(+), 737 deletions(-) diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 03045137d2..6cdc7e4e29 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -60,58 +60,693 @@ static rct_widget window_track_list_widgets[] = { WIDGETS_END, }; -static void window_track_list_close(rct_window *w); -static void window_track_list_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_track_list_update(rct_window *w); -static void window_track_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_track_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_track_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_track_list_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_track_list_invalidate(rct_window *w); -static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_track_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); - -static rct_window_event_list window_track_list_events([](auto& events) -{ - events.close = &window_track_list_close; - events.mouse_up = &window_track_list_mouseup; - events.update = &window_track_list_update; - events.get_scroll_size = &window_track_list_scrollgetsize; - events.scroll_mousedown = &window_track_list_scrollmousedown; - events.scroll_mouseover = &window_track_list_scrollmouseover; - events.text_input = &window_track_list_textinput; - events.invalidate = &window_track_list_invalidate; - events.paint = &window_track_list_paint; - events.scroll_paint = &window_track_list_scrollpaint; -}); // clang-format on constexpr uint16_t TRACK_DESIGN_INDEX_UNLOADED = UINT16_MAX; RideSelection _window_track_list_item; -static std::vector _trackDesigns; -static utf8 _filterString[USER_STRING_MAX_LENGTH]; -static std::vector _filteredTrackIds; -static uint16_t _loadedTrackDesignIndex; -static std::unique_ptr _loadedTrackDesign; -static std::vector _trackDesignPreviewPixels; +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; -static void track_list_load_designs(RideSelection item); -static bool track_list_load_design_for_preview(utf8* path); + void FilterList() + { + _filteredTrackIds.clear(); -/** - * - * rct2: 0x006CF1A2 - */ -rct_window* window_track_list_open(RideSelection item) + // Nothing to filter, so fill the list with all indices + if (String::LengthOf(_filterString) == 0) + { + for (uint16_t i = 0; i < _trackDesigns.size(); i++) + _filteredTrackIds.push_back(i); + + return; + } + + // Convert filter to lowercase + utf8 filterStringLower[sizeof(_filterString)]; + String::Set(filterStringLower, sizeof(filterStringLower), _filterString); + for (int32_t i = 0; filterStringLower[i] != '\0'; i++) + filterStringLower[i] = static_cast(tolower(filterStringLower[i])); + + // Fill the set with indices for tracks that match the filter + for (uint16_t i = 0; i < _trackDesigns.size(); i++) + { + utf8 trackNameLower[USER_STRING_MAX_LENGTH]; + String::Set(trackNameLower, sizeof(trackNameLower), _trackDesigns[i].name); + for (int32_t j = 0; trackNameLower[j] != '\0'; j++) + trackNameLower[j] = static_cast(tolower(trackNameLower[j])); + + if (strstr(trackNameLower, filterStringLower) != nullptr) + { + _filteredTrackIds.push_back(i); + } + } + } + + 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(); + ride_construct_new(_window_track_list_item); + return; + } + listIndex--; + } + + // Displays a message if the ride can't load, fix #4080 + if (_loadedTrackDesign == nullptr) + { + context_show_error(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]; + track_design_file_ref* tdRef = &_trackDesigns[trackDesignIndex]; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + auto intent = Intent(WC_MANAGE_TRACK_DESIGN); + intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); + context_open_intent(&intent); + } + else + { + if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED + && (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE)) + { + context_show_error(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); + } + + auto intent = Intent(WC_TRACK_DESIGN_PLACE); + intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); + context_open_intent(&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 = get_ride_entry_name(item.EntryIndex); + } + } + _trackDesigns = repo->GetItemsForObjectEntry(item.Type, entryName); + + FilterList(); + } + + bool LoadDesignPreview(utf8* path) + { + _loadedTrackDesign = track_design_open(path); + if (_loadedTrackDesign != nullptr) + { + track_design_draw_preview(_loadedTrackDesign.get(), _trackDesignPreviewPixels.data()); + return true; + } + return false; + } + +public: + void OnOpen() override + { + String::Set(_filterString, sizeof(_filterString), ""); + window_track_list_widgets[WIDX_FILTER_STRING].string = _filterString; + widgets = window_track_list_widgets; + enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_BACK) | (1ULL << WIDX_FILTER_STRING) + | (1ULL << WIDX_FILTER_CLEAR) | (1ULL << WIDX_ROTATE) | (1ULL << WIDX_TOGGLE_SCENERY); + + WindowInitScrollWidgets(this); + track_list.track_list_being_updated = false; + track_list.reload_track_designs = 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; + window_push_others_right(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 + for (auto& trackDesign : _trackDesigns) + { + free(trackDesign.name); + free(trackDesign.path); + } + _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) + { + Close(); + Editor::LoadTrackManager(); + } + } + + void OnMouseUp(const rct_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)) + { + context_open_window(WC_CONSTRUCT_RIDE); + } + break; + case WIDX_FILTER_STRING: + window_start_textbox(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; + } + } + + 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 (!track_list.track_list_being_updated) + { + int32_t i = GetListItemFromPosition(screenCoords); + if (i != -1) + { + SelectFromList(i); + } + } + } + + void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (!track_list.track_list_being_updated) + { + int32_t i = GetListItemFromPosition(screenCoords); + if (i != -1 && selected_list_item != i) + { + selected_list_item = i; + Invalidate(); + } + } + } + + void OnTextInput(const rct_widgetindex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_FILTER_STRING || text.empty()) + 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 + { + rct_string_id stringId = STR_NONE; + rct_ride_entry* entry = get_ride_entry(_window_track_list_item.EntryIndex); + + if (entry != nullptr) + { + RideNaming rideName = get_ride_naming(_window_track_list_item.Type, entry); + stringId = rideName.Name; + } + + Formatter::Common().Add(stringId); + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + window_track_list_widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS; + window_track_list_widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_RENAME_OR_DELETE_IT; + } + else + { + window_track_list_widgets[WIDX_TITLE].text = STR_SELECT_DESIGN; + window_track_list_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); + window_track_list_widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; + window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::FlatBtn; + if (gTrackDesignSceneryToggle) + { + pressed_widgets &= ~(1ULL << WIDX_TOGGLE_SCENERY); + } + else + { + pressed_widgets |= (1ULL << WIDX_TOGGLE_SCENERY); + } + } + else + { + pressed_widgets &= ~(1ULL << WIDX_TRACK_PREVIEW); + disabled_widgets |= (1ULL << WIDX_TRACK_PREVIEW); + window_track_list_widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; + window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::Empty; + } + + // When debugging tools are on, shift everything up a bit to make room for displaying the path. + const int32_t bottomMargin = gConfigGeneral.debugging_tools ? (WINDOW_PADDING + DEBUG_PATH_HEIGHT) : WINDOW_PADDING; + window_track_list_widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin; + window_track_list_widgets[WIDX_ROTATE].bottom = height - bottomMargin; + window_track_list_widgets[WIDX_ROTATE].top = window_track_list_widgets[WIDX_ROTATE].bottom + - ROTATE_AND_SCENERY_BUTTON_SIZE; + window_track_list_widgets[WIDX_TOGGLE_SCENERY].bottom = window_track_list_widgets[WIDX_ROTATE].top; + window_track_list_widgets[WIDX_TOGGLE_SCENERY].top = window_track_list_widgets[WIDX_TOGGLE_SCENERY].bottom + - ROTATE_AND_SCENERY_BUTTON_SIZE; + } + + void OnUpdate() override + { + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + { + window_update_textbox_caret(); + widget_invalidate(this, WIDX_FILTER_STRING); // TODO Check this + } + + if (track_list.reload_track_designs) + { + LoadDesignsList(_window_track_list_item); + selected_list_item = 0; + Invalidate(); + track_list.reload_track_designs = false; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + + int32_t listItemIndex = selected_list_item; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + if (_trackDesigns.empty() || listItemIndex == -1) + return; + } + else + { + if (listItemIndex == 0) + return; + + // Because the first item in the list is "Build a custom design", lower the index by one + listItemIndex--; + } + + int32_t trackIndex = _filteredTrackIds[listItemIndex]; + + // Track preview + auto& tdWidget = widgets[WIDX_TRACK_PREVIEW]; + int32_t colour = ColourMapA[colours[0]].darkest; + utf8* path = _trackDesigns[trackIndex].path; + + // Show track file path (in debug mode) + if (gConfigGeneral.debugging_tools) + { + utf8 pathBuffer[MAX_PATH]; + const utf8* pathPtr = pathBuffer; + shorten_path(pathBuffer, sizeof(pathBuffer), path, width, FontSpriteBase::MEDIUM); + auto ft = Formatter(); + ft.Add(pathPtr); + 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 }; + gfx_fill_rect(&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() }; + + rct_g1_element g1temp = {}; + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.width = 370; + g1temp.height = 217; + g1temp.flags = G1_FLAG_BMP; + gfx_set_g1_element(SPR_TEMP, &g1temp); + drawing_engine_invalidate_image(SPR_TEMP); + gfx_draw_sprite(&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); + 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)) + { + if (_loadedTrackDesign->type != RIDE_TYPE_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, rct_drawpixelinfo& dpi) override + { + uint8_t paletteIndex = ColourMapA[colours[0]].mid_light; + gfx_clear(&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 + rct_string_id stringId; + if (listIndex == static_cast(selected_list_item)) + { + // Highlight + gfx_filter_rect( + &dpi, screenCoords.x, screenCoords.y, width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, + FilterPaletteID::PaletteDarken1); + stringId = STR_WINDOW_COLOUR_2_STRINGID; + } + else + { + stringId = STR_BLACK_STRING; + } + + auto ft = Formatter(); + ft.Add(STR_BUILD_CUSTOM_DESIGN); + DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + listIndex++; + } + + for (auto i : _filteredTrackIds) + { + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y < dpi.y + dpi.height) + { + rct_string_id stringId; + if (listIndex == static_cast(selected_list_item)) + { + // Highlight + gfx_filter_rect( + &dpi, screenCoords.x, screenCoords.y, 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); + DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + } + + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + listIndex++; + } + } + + bool SetRideSelection(const RideSelection item) + { + _window_track_list_item = item; + LoadDesignsList(item); + return true; + } +}; + +rct_window* window_track_list_open(const RideSelection item) { window_close_construction_windows(); - _window_track_list_item = item; - - String::Set(_filterString, sizeof(_filterString), ""); - track_list_load_designs(item); - ScreenCoordsXY screenPos{}; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { @@ -123,700 +758,7 @@ rct_window* window_track_list_open(RideSelection item) { screenPos = { 0, TOP_TOOLBAR_HEIGHT + 2 }; } - - rct_window* w = WindowCreate(screenPos, 600, WH, &window_track_list_events, WC_TRACK_DESIGN_LIST, 0); - - window_track_list_widgets[WIDX_FILTER_STRING].string = _filterString; - w->widgets = window_track_list_widgets; - w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_BACK) | (1ULL << WIDX_FILTER_STRING) | (1ULL << WIDX_FILTER_CLEAR) - | (1ULL << WIDX_ROTATE) | (1ULL << WIDX_TOGGLE_SCENERY); - - WindowInitScrollWidgets(w); - w->track_list.track_list_being_updated = false; - w->track_list.reload_track_designs = false; - - // Start with first track highlighted - w->selected_list_item = 0; - if (_trackDesigns.size() != 0 && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - w->selected_list_item = 1; - } - - gTrackDesignSceneryToggle = false; - window_push_others_right(w); - _currentTrackPieceDirection = 2; - - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); - - _loadedTrackDesign = nullptr; - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; - + auto* w = WindowCreate(WC_TRACK_DESIGN_LIST, WW, WH, 0); + w->SetRideSelection(item); return w; } - -static void window_track_list_filter_list() -{ - _filteredTrackIds.clear(); - - // Nothing to filter, so fill the list with all indices - if (String::LengthOf(_filterString) == 0) - { - for (uint16_t i = 0; i < _trackDesigns.size(); i++) - _filteredTrackIds.push_back(i); - - return; - } - - // Convert filter to lowercase - utf8 filterStringLower[sizeof(_filterString)]; - String::Set(filterStringLower, sizeof(filterStringLower), _filterString); - for (int32_t i = 0; filterStringLower[i] != '\0'; i++) - filterStringLower[i] = static_cast(tolower(filterStringLower[i])); - - // Fill the set with indices for tracks that match the filter - for (uint16_t i = 0; i < _trackDesigns.size(); i++) - { - utf8 trackNameLower[USER_STRING_MAX_LENGTH]; - String::Set(trackNameLower, sizeof(trackNameLower), _trackDesigns[i].name); - for (int32_t j = 0; trackNameLower[j] != '\0'; j++) - trackNameLower[j] = static_cast(tolower(trackNameLower[j])); - - if (strstr(trackNameLower, filterStringLower) != nullptr) - { - _filteredTrackIds.push_back(i); - } - } -} - -/** - * - * rct2: 0x006CFD76 - */ -static void window_track_list_close(rct_window* w) -{ - // Dispose track design and preview - _loadedTrackDesign = nullptr; - _trackDesignPreviewPixels.clear(); - _trackDesignPreviewPixels.shrink_to_fit(); - - // Dispose track list - for (auto& trackDesign : _trackDesigns) - { - free(trackDesign.name); - free(trackDesign.path); - } - _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) - { - window_close_by_number(WC_MANAGE_TRACK_DESIGN, w->number); - window_close_by_number(WC_TRACK_DELETE_PROMPT, w->number); - Editor::LoadTrackManager(); - } -} - -/** - * - * rct2: 0x006CFB82 - */ -static void window_track_list_select(rct_window* w, int32_t listIndex) -{ - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - if (listIndex == 0) - { - window_close(w); - ride_construct_new(_window_track_list_item); - return; - } - listIndex--; - } - - // Displays a message if the ride can't load, fix #4080 - if (_loadedTrackDesign == nullptr) - { - context_show_error(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]; - track_design_file_ref* tdRef = &_trackDesigns[trackDesignIndex]; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - auto intent = Intent(WC_MANAGE_TRACK_DESIGN); - intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - context_open_intent(&intent); - } - else - { - if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED - && (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE)) - { - context_show_error(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); - } - - auto intent = Intent(WC_TRACK_DESIGN_PLACE); - intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - context_open_intent(&intent); - } -} - -static int32_t window_track_list_get_list_item_index_from_position(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; -} - -/** - * - * rct2: 0x006CFA31 - */ -static void window_track_list_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_ROTATE: - _currentTrackPieceDirection++; - _currentTrackPieceDirection %= 4; - w->Invalidate(); - break; - case WIDX_TOGGLE_SCENERY: - gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; - w->Invalidate(); - break; - case WIDX_BACK: - window_close(w); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - context_open_window(WC_CONSTRUCT_RIDE); - } - break; - case WIDX_FILTER_STRING: - window_start_textbox(w, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); - break; - case WIDX_FILTER_CLEAR: - // Keep the highlighted item selected - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - if (w->selected_list_item != -1 && _filteredTrackIds.size() > static_cast(w->selected_list_item)) - w->selected_list_item = _filteredTrackIds[w->selected_list_item]; - else - w->selected_list_item = -1; - } - else - { - if (w->selected_list_item != 0) - w->selected_list_item = _filteredTrackIds[w->selected_list_item - 1] + 1; - } - - String::Set(_filterString, sizeof(_filterString), ""); - window_track_list_filter_list(); - w->Invalidate(); - break; - } -} - -/** - * - * rct2: 0x006CFAB0 - */ -static void window_track_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) -{ - size_t numItems = _filteredTrackIds.size(); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - // Extra item: custom design - numItems++; - } - - *height = static_cast(numItems * SCROLLABLE_ROW_HEIGHT); -} - -/** - * - * rct2: 0x006CFB39 - */ -static void window_track_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - if (!w->track_list.track_list_being_updated) - { - int32_t i = window_track_list_get_list_item_index_from_position(screenCoords); - if (i != -1) - { - window_track_list_select(w, i); - } - } -} - -/** - * - * rct2: 0x006CFAD7 - */ -static void window_track_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - if (!w->track_list.track_list_being_updated) - { - int32_t i = window_track_list_get_list_item_index_from_position(screenCoords); - if (i != -1 && w->selected_list_item != i) - { - w->selected_list_item = i; - w->Invalidate(); - } - } -} - -static void window_track_list_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text) -{ - if (widgetIndex != WIDX_FILTER_STRING || text == nullptr) - return; - - if (String::Equals(_filterString, text)) - return; - - String::Set(_filterString, sizeof(_filterString), text); - - window_track_list_filter_list(); - - w->scrolls->v_top = 0; - - w->Invalidate(); -} - -static void window_track_list_update(rct_window* w) -{ - if (gCurrentTextBox.window.classification == w->classification && gCurrentTextBox.window.number == w->number) - { - window_update_textbox_caret(); - widget_invalidate(w, WIDX_FILTER_STRING); - } - - if (w->track_list.reload_track_designs) - { - track_list_load_designs(_window_track_list_item); - w->selected_list_item = 0; - w->Invalidate(); - w->track_list.reload_track_designs = false; - } -} - -/** - * - * rct2: 0x006CF2D6 - */ -static void window_track_list_invalidate(rct_window* w) -{ - rct_string_id stringId = STR_NONE; - rct_ride_entry* entry = get_ride_entry(_window_track_list_item.EntryIndex); - - if (entry != nullptr) - { - RideNaming rideName = get_ride_naming(_window_track_list_item.Type, entry); - stringId = rideName.Name; - } - - Formatter::Common().Add(stringId); - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - window_track_list_widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS; - window_track_list_widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_RENAME_OR_DELETE_IT; - } - else - { - window_track_list_widgets[WIDX_TITLE].text = STR_SELECT_DESIGN; - window_track_list_widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP; - } - - if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) || w->selected_list_item != 0) - { - w->pressed_widgets |= 1ULL << WIDX_TRACK_PREVIEW; - w->disabled_widgets &= ~(1ULL << WIDX_TRACK_PREVIEW); - window_track_list_widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; - window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::FlatBtn; - if (gTrackDesignSceneryToggle) - { - w->pressed_widgets &= ~(1ULL << WIDX_TOGGLE_SCENERY); - } - else - { - w->pressed_widgets |= (1ULL << WIDX_TOGGLE_SCENERY); - } - } - else - { - w->pressed_widgets &= ~(1ULL << WIDX_TRACK_PREVIEW); - w->disabled_widgets |= (1ULL << WIDX_TRACK_PREVIEW); - window_track_list_widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; - window_track_list_widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::Empty; - } - - // When debugging tools are on, shift everything up a bit to make room for displaying the path. - const int32_t bottomMargin = gConfigGeneral.debugging_tools ? (WINDOW_PADDING + DEBUG_PATH_HEIGHT) : WINDOW_PADDING; - window_track_list_widgets[WIDX_TRACK_LIST].bottom = w->height - bottomMargin; - window_track_list_widgets[WIDX_ROTATE].bottom = w->height - bottomMargin; - window_track_list_widgets[WIDX_ROTATE].top = window_track_list_widgets[WIDX_ROTATE].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE; - window_track_list_widgets[WIDX_TOGGLE_SCENERY].bottom = window_track_list_widgets[WIDX_ROTATE].top; - window_track_list_widgets[WIDX_TOGGLE_SCENERY].top = window_track_list_widgets[WIDX_TOGGLE_SCENERY].bottom - - ROTATE_AND_SCENERY_BUTTON_SIZE; -} - -/** - * - * rct2: 0x006CF387 - */ -static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - - int32_t listItemIndex = w->selected_list_item; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - if (_trackDesigns.empty() || listItemIndex == -1) - return; - } - else - { - if (listItemIndex == 0) - return; - - // Because the first item in the list is "Build a custom design", lower the index by one - listItemIndex--; - } - - int32_t trackIndex = _filteredTrackIds[listItemIndex]; - - // Track preview - int32_t colour; - rct_widget* widget = &window_track_list_widgets[WIDX_TRACK_PREVIEW]; - colour = ColourMapA[w->colours[0]].darkest; - utf8* path = _trackDesigns[trackIndex].path; - - // Show track file path (in debug mode) - if (gConfigGeneral.debugging_tools) - { - utf8 pathBuffer[MAX_PATH]; - const utf8* pathPtr = pathBuffer; - shorten_path(pathBuffer, sizeof(pathBuffer), path, w->width, FontSpriteBase::MEDIUM); - auto ft = Formatter(); - ft.Add(pathPtr); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 0, w->height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft, { w->colours[1] }); - } - - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - gfx_fill_rect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); - - if (_loadedTrackDesignIndex != trackIndex) - { - if (track_list_load_design_for_preview(path)) - { - _loadedTrackDesignIndex = trackIndex; - } - else - { - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; - } - } - - if (!_loadedTrackDesign) - { - return; - } - - auto trackPreview = screenPos; - screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->midY() }; - - rct_g1_element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); - g1temp.width = 370; - g1temp.height = 217; - g1temp.flags = G1_FLAG_BMP; - gfx_set_g1_element(SPR_TEMP, &g1temp); - drawing_engine_invalidate_image(SPR_TEMP); - gfx_draw_sprite(dpi, ImageId(SPR_TEMP), trackPreview); - - screenPos.y = w->windowPos.y + widget->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); - DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE }); - - // Information - screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->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)) - { - if (_loadedTrackDesign->type != RIDE_TYPE_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); - } -} - -/** - * - * rct2: 0x006CF8CD - */ -static void window_track_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) -{ - uint8_t paletteIndex = ColourMapA[w->colours[0]].mid_light; - gfx_clear(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 - rct_string_id stringId; - if (listIndex == static_cast(w->selected_list_item)) - { - // Highlight - gfx_filter_rect( - dpi, screenCoords.x, screenCoords.y, w->width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, - FilterPaletteID::PaletteDarken1); - stringId = STR_WINDOW_COLOUR_2_STRINGID; - } - else - { - stringId = STR_BLACK_STRING; - } - - auto ft = Formatter(); - ft.Add(STR_BUILD_CUSTOM_DESIGN); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - listIndex++; - } - - for (auto i : _filteredTrackIds) - { - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi->y && screenCoords.y < dpi->y + dpi->height) - { - rct_string_id stringId; - if (listIndex == static_cast(w->selected_list_item)) - { - // Highlight - gfx_filter_rect( - dpi, screenCoords.x, screenCoords.y, w->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); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); - } - - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - listIndex++; - } -} - -static void track_list_load_designs(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 = get_ride_entry_name(item.EntryIndex); - } - } - _trackDesigns = repo->GetItemsForObjectEntry(item.Type, entryName); - - window_track_list_filter_list(); -} - -static bool track_list_load_design_for_preview(utf8* path) -{ - _loadedTrackDesign = track_design_open(path); - if (_loadedTrackDesign != nullptr) - { - track_design_draw_preview(_loadedTrackDesign.get(), _trackDesignPreviewPixels.data()); - return true; - } - return false; -} From dc6a8a6235437b004f015748308417dc523c6c2e Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 14 Oct 2021 16:53:48 +0100 Subject: [PATCH 551/681] Refactor ObjectLoadError to class (#15573) * Move into class * Refactor names and const * Apply review comments --- src/openrct2-ui/windows/ObjectLoadError.cpp | 531 +++++++++----------- 1 file changed, 251 insertions(+), 280 deletions(-) diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 1e58bdd72b..ecce57249d 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -284,323 +284,294 @@ static rct_widget window_object_load_error_widgets[] = { #endif WIDGETS_END, }; - -static rct_string_id get_object_type_string(ObjectType type); -static void window_object_load_error_close(rct_window *w); -static void window_object_load_error_update(rct_window *w); -static void window_object_load_error_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_object_load_error_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_object_load_error_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_object_load_error_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_object_load_error_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); -#ifndef DISABLE_HTTP -static void window_object_load_error_download_all(rct_window* w); -static void window_object_load_error_update_list(rct_window* w); -#endif - -static rct_window_event_list window_object_load_error_events([](auto& events) -{ - events.close = &window_object_load_error_close; - events.mouse_up = &window_object_load_error_mouseup; - events.update = &window_object_load_error_update; - events.get_scroll_size = &window_object_load_error_scrollgetsize; - events.scroll_mousedown = &window_object_load_error_scrollmousedown; - events.scroll_mouseover = &window_object_load_error_scrollmouseover; - events.paint = &window_object_load_error_paint; - events.scroll_paint = &window_object_load_error_scrollpaint; -}); // clang-format on -static std::vector _invalid_entries; -static int32_t highlighted_index = -1; -static std::string file_path; -#ifndef DISABLE_HTTP -static ObjectDownloader _objDownloader; -static bool _updatedListAfterDownload; -#endif - /** * Returns an rct_string_id that represents an rct_object_entry's type. * * Could possibly be moved out of the window file if other * uses exist and a suitable location is found. */ -static rct_string_id get_object_type_string(ObjectType type) +static constexpr rct_string_id GetStringFromObjectType(const ObjectType type) { - rct_string_id result; switch (type) { case ObjectType::Ride: - result = STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS; - break; + return STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS; case ObjectType::SmallScenery: - result = STR_OBJECT_SELECTION_SMALL_SCENERY; - break; + return STR_OBJECT_SELECTION_SMALL_SCENERY; case ObjectType::LargeScenery: - result = STR_OBJECT_SELECTION_LARGE_SCENERY; - break; + return STR_OBJECT_SELECTION_LARGE_SCENERY; case ObjectType::Walls: - result = STR_OBJECT_SELECTION_WALLS_FENCES; - break; + return STR_OBJECT_SELECTION_WALLS_FENCES; case ObjectType::Banners: - result = STR_OBJECT_SELECTION_PATH_SIGNS; - break; + return STR_OBJECT_SELECTION_PATH_SIGNS; case ObjectType::Paths: - result = STR_OBJECT_SELECTION_FOOTPATHS; - break; + return STR_OBJECT_SELECTION_FOOTPATHS; case ObjectType::PathBits: - result = STR_OBJECT_SELECTION_PATH_EXTRAS; - break; + return STR_OBJECT_SELECTION_PATH_EXTRAS; case ObjectType::SceneryGroup: - result = STR_OBJECT_SELECTION_SCENERY_GROUPS; - break; + return STR_OBJECT_SELECTION_SCENERY_GROUPS; case ObjectType::ParkEntrance: - result = STR_OBJECT_SELECTION_PARK_ENTRANCE; - break; + return STR_OBJECT_SELECTION_PARK_ENTRANCE; case ObjectType::Water: - result = STR_OBJECT_SELECTION_WATER; - break; + return STR_OBJECT_SELECTION_WATER; default: - result = STR_UNKNOWN_OBJECT_TYPE; + return STR_UNKNOWN_OBJECT_TYPE; } - return result; } -/** - * Returns a newline-separated string listing all object names. - * Used for placing all names on the clipboard. - */ -static void copy_object_names_to_clipboard(rct_window* w) +class ObjectLoadErrorWindow final : public rct_window { - std::stringstream stream; - for (uint16_t i = 0; i < w->no_list_items; i++) +private: + std::vector _invalidEntries; + int32_t _highlightedIndex = -1; + std::string _filePath; +#ifndef DISABLE_HTTP + ObjectDownloader _objDownloader; + bool _updatedListAfterDownload{}; + + void DownloadAllObjects() { - const auto& entry = _invalid_entries[i]; - stream << entry.GetName(); - stream << PLATFORM_NEWLINE; + if (!_objDownloader.IsDownloading()) + { + _updatedListAfterDownload = false; + _objDownloader.Begin(_invalidEntries); + } } - auto clip = stream.str(); - OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(clip.c_str()); -} + 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; + } + widget_invalidate(this, WIDX_SCROLL); + } + +public: + void OnOpen() override + { + widgets = window_object_load_error_widgets; + enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_COPY_CURRENT) | (1ULL << WIDX_COPY_ALL) + | (1ULL << WIDX_DOWNLOAD_ALL); + + 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 rct_widgetindex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + window_close(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; + widget_invalidate(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; + } +#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; + + widget_invalidate(this, WIDX_SCROLL); + } + + void OnDraw(rct_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, rct_drawpixelinfo& dpi) override + { + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + gfx_fill_rect( + &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) + gfx_fill_rect(&dpi, screenRect, ColourMapA[colours[1]].darker); + else if (i == _highlightedIndex) + gfx_fill_rect(&dpi, screenRect, ColourMapA[colours[1]].mid_dark); + else if ((i & 1) != 0) // odd / even check + gfx_fill_rect(&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()); + gfx_draw_string(&dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); + + if (entry.Generation == ObjectGeneration::DAT) + { + // ... source game ... + const auto sourceStringId = object_manager_get_source_game_string(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 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(); + } +}; rct_window* window_object_load_error_open(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { - _invalid_entries = std::vector(missingObjects, missingObjects + numMissingObjects); - // Check if window is already open - rct_window* window = window_bring_to_front_by_class(WC_OBJECT_LOAD_ERROR); + auto* window = window_bring_to_front_by_class(WC_OBJECT_LOAD_ERROR); if (window == nullptr) { - window = WindowCreateCentred(WW, WH, &window_object_load_error_events, WC_OBJECT_LOAD_ERROR, 0); - - window->widgets = window_object_load_error_widgets; - window->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_COPY_CURRENT) | (1ULL << WIDX_COPY_ALL) - | (1ULL << WIDX_DOWNLOAD_ALL); - - WindowInitScrollWidgets(window); - window->colours[0] = COLOUR_LIGHT_BLUE; - window->colours[1] = COLOUR_LIGHT_BLUE; - window->colours[2] = COLOUR_LIGHT_BLUE; + window = WindowCreate(WC_OBJECT_LOAD_ERROR, WW, WH, 0); } - // Refresh list items and path - window->no_list_items = static_cast(numMissingObjects); - file_path = path; + static_cast(window)->Initialise(path, numMissingObjects, missingObjects); - window->Invalidate(); return window; } - -static void window_object_load_error_close(rct_window* w) -{ - _invalid_entries.clear(); - _invalid_entries.shrink_to_fit(); -} - -static void window_object_load_error_update(rct_window* w) -{ - w->frame_no++; - - // Check if the mouse is hovering over the list - if (!WidgetIsHighlighted(w, WIDX_SCROLL)) - { - highlighted_index = -1; - widget_invalidate(w, 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 (w->frame_no % 64 == 0) - { - window_object_load_error_update_list(w); - } - } - else if (!_updatedListAfterDownload) - { - window_object_load_error_update_list(w); - _updatedListAfterDownload = true; - } -#endif -} - -static void window_object_load_error_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(w); - break; - case WIDX_COPY_CURRENT: - if (w->selected_list_item > -1 && w->selected_list_item < w->no_list_items) - { - auto name = std::string(_invalid_entries[w->selected_list_item].GetName()); - OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(name.c_str()); - } - break; - case WIDX_COPY_ALL: - copy_object_names_to_clipboard(w); - break; -#ifndef DISABLE_HTTP - case WIDX_DOWNLOAD_ALL: - window_object_load_error_download_all(w); - break; -#endif - } -} - -static void window_object_load_error_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - // Highlight item that the cursor is over, or remove highlighting if none - int32_t selected_item; - selected_item = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (selected_item < 0 || selected_item >= w->no_list_items) - highlighted_index = -1; - else - highlighted_index = selected_item; - - widget_invalidate(w, WIDX_SCROLL); -} - -static void window_object_load_error_select_element_from_list(rct_window* w, int32_t index) -{ - if (index < 0 || index > w->no_list_items) - { - w->selected_list_item = -1; - } - else - { - w->selected_list_item = index; - } - widget_invalidate(w, WIDX_SCROLL); -} - -static void window_object_load_error_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - int32_t selected_item; - selected_item = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - window_object_load_error_select_element_from_list(w, selected_item); -} - -static void window_object_load_error_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) -{ - *height = w->no_list_items * SCROLLABLE_ROW_HEIGHT; -} - -static void window_object_load_error_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - - // Draw explanatory message - auto ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); - DrawTextWrapped(dpi, w->windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); - - // Draw file name - ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); - ft.Add(file_path.c_str()); - DrawTextEllipsised(dpi, { w->windowPos.x + 5, w->windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); -} - -static void window_object_load_error_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex) -{ - auto dpiCoords = ScreenCoordsXY{ dpi->x, dpi->y }; - gfx_fill_rect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi->width - 1, dpi->height - 1 } }, ColourMapA[w->colours[1]].mid_light); - const int32_t list_width = w->widgets[WIDX_SCROLL].width(); - - for (int32_t i = 0; i < w->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; - - auto screenRect = ScreenRect{ { 0, screenCoords.y }, { list_width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }; - // If hovering over item, change the color and fill the backdrop. - if (i == w->selected_list_item) - gfx_fill_rect(dpi, screenRect, ColourMapA[w->colours[1]].darker); - else if (i == highlighted_index) - gfx_fill_rect(dpi, screenRect, ColourMapA[w->colours[1]].mid_dark); - else if ((i & 1) != 0) // odd / even check - gfx_fill_rect(dpi, screenRect, ColourMapA[w->colours[1]].light); - - // Draw the actual object entry's name... - screenCoords.x = NAME_COL_LEFT - 3; - - const auto& entry = _invalid_entries[i]; - - auto name = entry.GetName(); - char buffer[256]; - String::Set(buffer, sizeof(buffer), name.data(), name.size()); - gfx_draw_string(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); - - if (entry.Generation == ObjectGeneration::DAT) - { - // ... source game ... - rct_string_id sourceStringId = object_manager_get_source_game_string(entry.Entry.GetSourceGame()); - DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); - } - - // ... and type - rct_string_id type = get_object_type_string(entry.GetType()); - DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); - } -} - -#ifndef DISABLE_HTTP - -static void window_object_load_error_download_all(rct_window* w) -{ - if (!_objDownloader.IsDownloading()) - { - _updatedListAfterDownload = false; - _objDownloader.Begin(_invalid_entries); - } -} - -static void window_object_load_error_update_list(rct_window* w) -{ - auto entries = _objDownloader.GetDownloadedEntries(); - for (auto& de : entries) - { - _invalid_entries.erase( - std::remove_if( - _invalid_entries.begin(), _invalid_entries.end(), - [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), - _invalid_entries.end()); - w->no_list_items = static_cast(_invalid_entries.size()); - } -} - -#endif From c2d3ca5f8503fc773ba0349d23ec7226753b8526 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 14 Oct 2021 23:27:28 +0200 Subject: [PATCH 552/681] Automatically deduce std::array types This also improves formatting of some arrays with weird or no indention. --- src/openrct2-ui/windows/Research.cpp | 10 ++++++++-- src/openrct2/paint/sprite/Paint.Misc.cpp | 10 ++++++++-- src/openrct2/platform/Shared.cpp | 2 +- src/openrct2/platform/Windows.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/gentle/GhostTrain.cpp | 2 +- src/openrct2/world/Banner.cpp | 20 +++++++++++--------- src/openrct2/world/Fountain.cpp | 20 +++++++++++--------- src/openrct2/world/Map.cpp | 10 ++++++---- 9 files changed, 48 insertions(+), 30 deletions(-) diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 0d881d6d57..24ee76c84f 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -314,7 +314,10 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp else { // Research type - std::array strings = { STR_RESEARCH_UNKNOWN, 0 }; + std::array strings = { + static_cast(STR_RESEARCH_UNKNOWN), + STR_NONE, + }; rct_string_id label = STR_RESEARCH_TYPE_LABEL; if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH) { @@ -374,7 +377,10 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp if (gResearchLastItem.has_value()) { rct_string_id lastDevelopmentFormat = STR_EMPTY; - std::array strings = { gResearchLastItem->GetName(), 0 }; + std::array strings = { + gResearchLastItem->GetName(), + STR_NONE, + }; auto type = gResearchLastItem->type; if (type == Research::EntryType::Scenery) { diff --git a/src/openrct2/paint/sprite/Paint.Misc.cpp b/src/openrct2/paint/sprite/Paint.Misc.cpp index 61352ae456..4e119ace7e 100644 --- a/src/openrct2/paint/sprite/Paint.Misc.cpp +++ b/src/openrct2/paint/sprite/Paint.Misc.cpp @@ -122,8 +122,14 @@ template<> void PaintEntity(paint_session* session, const JumpingFountain* jumpi uint32_t baseImageId = (jumpingFountain->FountainType == JumpingFountainType::Snow) ? JumpingFountainSnowBaseImage : JumpingFountainWaterBaseImage; uint32_t imageId = baseImageId + ebx * 16 + jumpingFountain->frame; - constexpr std::array antiClockWiseBoundingBoxes = { CoordsXY{ -COORDS_XY_STEP, -3 }, CoordsXY{ 0, -3 } }; - constexpr std::array clockWiseBoundingBoxes = { CoordsXY{ -COORDS_XY_STEP, 3 }, CoordsXY{ 0, 3 } }; + constexpr std::array antiClockWiseBoundingBoxes = { + CoordsXY{ -COORDS_XY_STEP, -3 }, + CoordsXY{ 0, -3 }, + }; + constexpr std::array clockWiseBoundingBoxes = { + CoordsXY{ -COORDS_XY_STEP, 3 }, + CoordsXY{ 0, 3 }, + }; auto bb = isAntiClockwise ? antiClockWiseBoundingBoxes : clockWiseBoundingBoxes; diff --git a/src/openrct2/platform/Shared.cpp b/src/openrct2/platform/Shared.cpp index ba4f591b7d..c0244401e1 100644 --- a/src/openrct2/platform/Shared.cpp +++ b/src/openrct2/platform/Shared.cpp @@ -237,7 +237,7 @@ CurrencyType platform_get_currency_value(const char* currCode) #ifndef _WIN32 std::string platform_sanitise_filename(const std::string& path) { - static const std::array prohibited = { '/' }; + static constexpr std::array prohibited = { '/' }; auto sanitised = path; std::replace_if( sanitised.begin(), sanitised.end(), diff --git a/src/openrct2/platform/Windows.cpp b/src/openrct2/platform/Windows.cpp index 594dcdf7e1..04c70360e1 100644 --- a/src/openrct2/platform/Windows.cpp +++ b/src/openrct2/platform/Windows.cpp @@ -196,7 +196,7 @@ std::string platform_get_rct2_steam_dir() std::string platform_sanitise_filename(const std::string& path) { - static const std::array prohibited = { '<', '>', '*', '\\', ':', '|', '?', '"', '/' }; + static constexpr std::array prohibited = { '<', '>', '*', '\\', ':', '|', '?', '"', '/' }; auto sanitised = path; std::replace_if( sanitised.begin(), sanitised.end(), diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 8044cdcd9a..0a23876093 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7262,7 +7262,7 @@ void Vehicle::UpdateAnimationAnimalFlying() Invalidate(); } // number of frames to skip before updating again - constexpr std::array frameWaitTimes = { 5, 3, 5, 3 }; + constexpr std::array frameWaitTimes = { 5, 3, 5, 3 }; animationState = frameWaitTimes[animation_frame]; } diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 521ade0e6d..3e40b4847b 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -361,7 +361,7 @@ static void paint_ghost_train_station( { uint32_t imageId; - static constexpr const std::array imageIds = { + static constexpr const std::array imageIds = { SPR_STATION_BASE_B_SW_NE, SPR_STATION_BASE_B_NW_SE, SPR_STATION_BASE_B_SW_NE, diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index fa590e5a72..ce9993d6b4 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -194,15 +194,17 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex) */ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos) { - static constexpr const std::array NeighbourCheckOrder = { CoordsXY{ COORDS_XY_STEP, 0 }, - CoordsXY{ -COORDS_XY_STEP, 0 }, - { 0, COORDS_XY_STEP }, - CoordsXY{ 0, -COORDS_XY_STEP }, - CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP }, - CoordsXY{ +COORDS_XY_STEP, -COORDS_XY_STEP }, - CoordsXY{ +COORDS_XY_STEP, +COORDS_XY_STEP }, - CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP }, - CoordsXY{ 0, 0 } }; + static constexpr const std::array NeighbourCheckOrder = { + CoordsXY{ COORDS_XY_STEP, 0 }, + CoordsXY{ -COORDS_XY_STEP, 0 }, + CoordsXY{ 0, COORDS_XY_STEP }, + CoordsXY{ 0, -COORDS_XY_STEP }, + CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP }, + CoordsXY{ +COORDS_XY_STEP, -COORDS_XY_STEP }, + CoordsXY{ +COORDS_XY_STEP, +COORDS_XY_STEP }, + CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP }, + CoordsXY{ 0, 0 }, + }; for (const auto& neighhbourCoords : NeighbourCheckOrder) { diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 977e8e3ab7..c4466504a3 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -28,7 +28,7 @@ enum class PATTERN FAST_RANDOM_CHASERS, }; -static constexpr const std::array _fountainDirectionsNegative = { +static constexpr const std::array _fountainDirectionsNegative = { CoordsXY{ -COORDS_XY_STEP, 0 }, CoordsXY{ -COORDS_XY_STEP, -COORDS_XY_STEP }, CoordsXY{ 0, 0 }, @@ -39,14 +39,16 @@ static constexpr const std::array _fountainDirectionsNegative = { CoordsXY{ -COORDS_XY_STEP, -COORDS_XY_STEP }, }; -static constexpr const std::array _fountainDirectionsPositive = { CoordsXY{ COORDS_XY_STEP, 0 }, - CoordsXY{ 0, 0 }, - CoordsXY{ 0, COORDS_XY_STEP }, - CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP }, - CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP }, - CoordsXY{ COORDS_XY_STEP, 0 }, - CoordsXY{ 0, 0 }, - CoordsXY{ 0, COORDS_XY_STEP } }; +static constexpr const std::array _fountainDirectionsPositive = { + CoordsXY{ COORDS_XY_STEP, 0 }, + CoordsXY{ 0, 0 }, + CoordsXY{ 0, COORDS_XY_STEP }, + CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP }, + CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP }, + CoordsXY{ COORDS_XY_STEP, 0 }, + CoordsXY{ 0, 0 }, + CoordsXY{ 0, COORDS_XY_STEP }, +}; constexpr auto _FountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 constexpr auto _FountainChanceOfStoppingRandomMode = 0x2000; // 0.125 diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 8b90b8d3e0..64d49fad9b 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1077,10 +1077,12 @@ void map_invalidate_map_selection_tiles() static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t* top, int32_t* right, int32_t* bottom) { uint32_t rotation = get_current_rotation(); - std::array corners{ CoordsXY{ _range.GetLeft(), _range.GetTop() }, - CoordsXY{ _range.GetRight(), _range.GetTop() }, - CoordsXY{ _range.GetRight(), _range.GetBottom() }, - CoordsXY{ _range.GetLeft(), _range.GetBottom() } }; + const std::array corners{ + CoordsXY{ _range.GetLeft(), _range.GetTop() }, + CoordsXY{ _range.GetRight(), _range.GetTop() }, + CoordsXY{ _range.GetRight(), _range.GetBottom() }, + CoordsXY{ _range.GetLeft(), _range.GetBottom() }, + }; *left = std::numeric_limits::max(); *top = std::numeric_limits::max(); From 7f3dc5c0015a6065f3e7c2c92e2aa97fb08872cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 15 Oct 2021 01:12:38 +0300 Subject: [PATCH 553/681] Fix fallback for missing path objects --- src/openrct2/ride/TrackDesign.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 63cb9fae7c..5c33e6bd00 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -699,6 +699,25 @@ static ObjectEntryIndex TrackDesignGetDefaultRailingIndex() return OBJECT_ENTRY_INDEX_NULL; } +static ObjectEntryIndex TrackDesignGetDefaultPathIndex(bool isQueue) +{ + for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) + { + auto legacyPathEntry = GetLegacyFootpathEntry(i); + if (legacyPathEntry != nullptr) + { + const auto& surfaceDescriptor = isQueue ? legacyPathEntry->GetQueueSurfaceDescriptor() + : legacyPathEntry->GetPathSurfaceDescriptor(); + if (surfaceDescriptor.IsEditorOnly()) + { + continue; + } + return i; + } + } + return OBJECT_ENTRY_INDEX_NULL; +} + static std::optional TrackDesignPlaceSceneryElementGetEntry(const TrackDesignSceneryElement& scenery) { TrackSceneryEntry result; @@ -734,6 +753,13 @@ static std::optional TrackDesignPlaceSceneryElementGetEntry(c if (result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL) result.SecondaryIndex = TrackDesignGetDefaultRailingIndex(); + // NOTE: This block can be deleted in the NSF branch. + if (result.Index == OBJECT_ENTRY_INDEX_NULL) + { + result.Type = ObjectType::Paths; + result.Index = TrackDesignGetDefaultPathIndex(scenery.IsQueue()); + } + if (result.Index == OBJECT_ENTRY_INDEX_NULL) { _trackDesignPlaceStateSceneryUnavailable = true; From 83a3da0a28df2f6da61dcf5880f16e51959dabec Mon Sep 17 00:00:00 2001 From: Sijmen Date: Fri, 15 Oct 2021 01:46:45 +0200 Subject: [PATCH 554/681] Refactor window_dropdown_paint (Part of #12098) (#15574) * Refactor window_dropdown_paint - Use ScreenRect (#12098) and ScreenCoordsXY - Move variables to a more local scope, with the appropriate types - Reduce nesting in if statements * Apply suggestions from code review Co-authored-by: Tulio Leao * Combine all screenCoords calculations in window_dropdown_paint * Remove brackets from cellCoords calculation Co-authored-by: Tulio Leao --- src/openrct2-ui/windows/Dropdown.cpp | 66 ++++++++++------------------ 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 77aa199642..71e9db36bc 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -286,90 +286,72 @@ void WindowDropdownClose() static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi) { - int32_t cell_x, cell_y, l, t, r, b, item, image; - WindowDrawWidgets(w, dpi); int32_t highlightedIndex = gDropdownHighlightedIndex; for (int32_t i = 0; i < gDropdownNumItems; i++) { + ScreenCoordsXY cellCoords; if (_dropdown_list_vertically) - { - cell_x = i / _dropdown_num_rows; - cell_y = i % _dropdown_num_rows; - } + cellCoords = { i / _dropdown_num_rows, i % _dropdown_num_rows }; else - { - cell_x = i % _dropdown_num_columns; - cell_y = i / _dropdown_num_columns; - } + cellCoords = { i % _dropdown_num_columns, i / _dropdown_num_columns }; + + ScreenCoordsXY screenCoords = w->windowPos + + ScreenCoordsXY{ 2 + (cellCoords.x * _dropdown_item_width), 2 + (cellCoords.y * _dropdown_item_height) }; if (gDropdownItemsFormat[i] == Dropdown::SeparatorString) { - l = w->windowPos.x + 2 + (cell_x * _dropdown_item_width); - t = w->windowPos.y + 2 + (cell_y * _dropdown_item_height); - r = l + _dropdown_item_width - 1; - t += (_dropdown_item_height / 2); - b = t; + const ScreenCoordsXY leftTop = screenCoords + ScreenCoordsXY{ 0, (_dropdown_item_height / 2) }; + const ScreenCoordsXY rightBottom = leftTop + ScreenCoordsXY{ _dropdown_item_width - 1, 0 }; + const ScreenCoordsXY shadowOffset{ 0, 1 }; if (w->colours[0] & COLOUR_FLAG_TRANSLUCENT) { translucent_window_palette palette = TranslucentWindowPalettes[BASE_COLOUR(w->colours[0])]; - gfx_filter_rect(dpi, l, t, r, b, palette.highlight); - gfx_filter_rect(dpi, l, t + 1, r, b + 1, palette.shadow); + gfx_filter_rect(dpi, { leftTop, rightBottom }, palette.highlight); + gfx_filter_rect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow); } else { - gfx_fill_rect(dpi, { { l, t }, { r, b } }, ColourMapA[w->colours[0]].mid_dark); - gfx_fill_rect(dpi, { { l, t + 1 }, { r, b + 1 } }, ColourMapA[w->colours[0]].lightest); + gfx_fill_rect(dpi, { leftTop, rightBottom }, ColourMapA[w->colours[0]].mid_dark); + gfx_fill_rect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[w->colours[0]].lightest); } } else { - // if (i == highlightedIndex) { - l = w->windowPos.x + 2 + (cell_x * _dropdown_item_width); - t = w->windowPos.y + 2 + (cell_y * _dropdown_item_height); - r = l + _dropdown_item_width - 1; - b = t + _dropdown_item_height - 1; - gfx_filter_rect(dpi, l, t, r, b, FilterPaletteID::PaletteDarken3); + // Darken the cell's background slightly when highlighted + const ScreenCoordsXY rightBottom = screenCoords + + ScreenCoordsXY{ _dropdown_item_width - 1, _dropdown_item_height - 1 }; + gfx_filter_rect(dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3); } - item = gDropdownItemsFormat[i]; + rct_string_id item = gDropdownItemsFormat[i]; if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) { // Image item - image = static_cast(gDropdownItemsArgs[i]); + auto image = static_cast(gDropdownItemsArgs[i]); if (item == Dropdown::FormatColourPicker && highlightedIndex == i) image++; - gfx_draw_sprite( - dpi, ImageId::FromUInt32(image), - w->windowPos + ScreenCoordsXY{ 2 + (cell_x * _dropdown_item_width), 2 + (cell_y * _dropdown_item_height) }); + gfx_draw_sprite(dpi, ImageId::FromUInt32(image), screenCoords); } else { // Text item - if (i < Dropdown::ItemsMaxSize) - { - if (Dropdown::IsChecked(i)) - { - item++; - } - } + if (i < Dropdown::ItemsMaxSize && Dropdown::IsChecked(i)) + item++; // Calculate colour colour_t colour = NOT_TRANSLUCENT(w->colours[0]); if (i == highlightedIndex) colour = COLOUR_WHITE; - if (Dropdown::IsDisabled(i)) - if (i < Dropdown::ItemsMaxSize) - colour = NOT_TRANSLUCENT(w->colours[0]) | COLOUR_FLAG_INSET; + if (i < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(i)) + colour = NOT_TRANSLUCENT(w->colours[0]) | COLOUR_FLAG_INSET; // Draw item string - ScreenCoordsXY screenCoords = { w->windowPos.x + 2 + (cell_x * _dropdown_item_width), - w->windowPos.y + 2 + (cell_y * _dropdown_item_height) }; Formatter ft(reinterpret_cast(&gDropdownItemsArgs[i])); DrawTextEllipsised(dpi, screenCoords, w->width - 5, item, ft, { colour }); } From eba2041aaa94fa68c793b4a4254e06024f6d8305 Mon Sep 17 00:00:00 2001 From: hjort96 <31574839+hjort96@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:41:30 +0200 Subject: [PATCH 555/681] Close #13791: Refactor window to class Options (#15558) * Create class OptionsWindow. Moving functions to class. * Move functions to class OptionsWindow * Fix coding style Co-authored-by: hjort96 --- src/openrct2-ui/windows/Options.cpp | 3522 ++++++++++++++------------- 1 file changed, 1803 insertions(+), 1719 deletions(-) diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 469e01bfeb..b7e1105413 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -422,13 +422,6 @@ const int32_t window_options_tab_animation_frames[] = 16, // WINDOW_OPTIONS_PAGE_ADVANCED, }; -static void window_options_set_page(rct_window *w, int32_t page); -static void window_options_set_pressed_tab(rct_window *w); -static void window_options_draw_tab_image(rct_drawpixelinfo *dpi, rct_window *w, int32_t page, int32_t spriteIndex); -static void window_options_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w); -static void window_options_show_dropdown(rct_window *w, rct_widget *widget, int32_t num_items); -static void window_options_update_height_markers(); - #pragma region Enabled Widgets #define MAIN_OPTIONS_ENABLED_WIDGETS \ @@ -549,1817 +542,1908 @@ static uint64_t window_options_page_enabled_widgets[] = { }; // clang-format on -#pragma region Common tab events - -static void window_options_common_mouseup(rct_window* w, rct_widgetindex widgetIndex) +class OptionsWindow final : public Window { - switch (widgetIndex) +public: + void OnOpen() override { - case WIDX_CLOSE: - window_close(w); - 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: - window_options_set_page(w, widgetIndex - WIDX_TAB_1); - break; + this->widgets = window_options_display_widgets; + this->enabled_widgets = window_options_page_enabled_widgets[WINDOW_OPTIONS_PAGE_DISPLAY]; + this->page = WINDOW_OPTIONS_PAGE_DISPLAY; + this->frame_no = 0; + WindowInitScrollWidgets(this); } -} -static void window_options_common_invalidate_before(rct_window* w) -{ - if (window_options_page_widgets[w->page] != w->widgets) + void OnMouseUp(rct_widgetindex widgetIndex) override { - w->widgets = window_options_page_widgets[w->page]; - WindowInitScrollWidgets(w); - } - window_options_set_pressed_tab(w); - - w->disabled_widgets = 0; - auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); - if (!hasFilePicker) - { - w->enabled_widgets &= ~(1ULL << WIDX_ALWAYS_NATIVE_LOADSAVE); - w->disabled_widgets |= (1ULL << WIDX_ALWAYS_NATIVE_LOADSAVE); - w->widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WindowWidgetType::Empty; - } -} - -static void window_options_common_invalidate_after(rct_window* w) -{ - // Automatically adjust window height to fit widgets - int32_t y = 0; - for (auto widget = &w->widgets[WIDX_PAGE_START]; widget->type != WindowWidgetType::Last; widget++) - { - y = std::max(y, widget->bottom); - } - w->height = y + 6; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; -} - -static void window_options_common_update(rct_window* w) -{ - // Tab animation - w->frame_no++; - widget_invalidate(w, WIDX_TAB_1 + w->page); -} - -#pragma region Display Tab - -static void window_options_display_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) - { - case WIDX_UNCAP_FPS_CHECKBOX: - gConfigGeneral.uncap_fps ^= 1; - drawing_engine_set_vsync(gConfigGeneral.use_vsync); - config_save_default(); - w->Invalidate(); - break; - case WIDX_USE_VSYNC_CHECKBOX: - gConfigGeneral.use_vsync ^= 1; - drawing_engine_set_vsync(gConfigGeneral.use_vsync); - config_save_default(); - w->Invalidate(); - break; - case WIDX_SHOW_FPS_CHECKBOX: - gConfigGeneral.show_fps ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_MULTITHREADING_CHECKBOX: - gConfigGeneral.multithreading ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_MINIMIZE_FOCUS_LOSS: - gConfigGeneral.minimize_fullscreen_focus_loss ^= 1; - platform_refresh_video(false); - config_save_default(); - w->Invalidate(); - break; - case WIDX_STEAM_OVERLAY_PAUSE: - gConfigGeneral.steam_overlay_pause ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_DISABLE_SCREENSAVER_LOCK: - gConfigGeneral.disable_screensaver ^= 1; - ApplyScreenSaverLockSetting(); - config_save_default(); - w->Invalidate(); - break; - } -} - -static void window_options_display_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_RESOLUTION_DROPDOWN: + if (widgetIndex < WIDX_PAGE_START) + CommonMouseUp(widgetIndex); + else { - const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); - - int32_t selectedResolution = -1; - for (size_t i = 0; i < resolutions.size(); i++) + switch (page) { - const Resolution& resolution = resolutions[i]; + 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; + } + } + } - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + void OnMouseDown(rct_widgetindex widgetIndex) override + { + switch (page) + { + 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; + } + } - uint16_t* args = reinterpret_cast(&gDropdownItemsArgs[i]); - args[0] = STR_RESOLUTION_X_BY_Y; - args[1] = resolution.Width; - args[2] = resolution.Height; + void OnDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) override + { + 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; + } + } - if (resolution.Width == gConfigGeneral.fullscreen_width - && resolution.Height == gConfigGeneral.fullscreen_height) + void OnPrepareDraw() override + { + 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; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + switch (page) + { + case WINDOW_OPTIONS_PAGE_DISPLAY: + DisplayDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_RENDERING: + RenderingDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_CULTURE: + CultureDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + ControlsDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_MISC: + MiscDraw(&dpi); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedDraw(&dpi); + break; + default: + break; + } + } + + void OnUpdate() override + { + 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; + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + switch (this->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 }; + } + } + +private: +#pragma region Common events + void CommonMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + window_close(this); + 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: + case WIDX_TAB_7: + SetPage(widgetIndex - WIDX_TAB_1); + break; + } + } + + void CommonPrepareDrawBefore() + { + if (window_options_page_widgets[this->page] != this->widgets) + { + this->widgets = window_options_page_widgets[this->page]; + WindowInitScrollWidgets(this); + } + SetPressedTab(); + + this->disabled_widgets = 0; + auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); + if (!hasFilePicker) + { + this->enabled_widgets &= ~(1ULL << WIDX_ALWAYS_NATIVE_LOADSAVE); + this->disabled_widgets |= (1ULL << WIDX_ALWAYS_NATIVE_LOADSAVE); + this->widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WindowWidgetType::Empty; + } + } + + void CommonPrepareDrawAfter() + { + // Automatically adjust window height to fit widgets + int32_t y = 0; + for (auto widget = &this->widgets[WIDX_PAGE_START]; widget->type != WindowWidgetType::Last; widget++) + { + y = std::max(y, widget->bottom); + } + this->height = y + 6; + this->widgets[WIDX_BACKGROUND].bottom = this->height - 1; + this->widgets[WIDX_PAGE_BACKGROUND].bottom = this->height - 1; + } + + void CommonUpdate() + { + // Tab animation + this->frame_no++; + widget_invalidate(this, WIDX_TAB_1 + this->page); + } +#pragma endregion + +#pragma region Display tab events + void DisplayMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_UNCAP_FPS_CHECKBOX: + gConfigGeneral.uncap_fps ^= 1; + drawing_engine_set_vsync(gConfigGeneral.use_vsync); + config_save_default(); + this->Invalidate(); + break; + case WIDX_USE_VSYNC_CHECKBOX: + gConfigGeneral.use_vsync ^= 1; + drawing_engine_set_vsync(gConfigGeneral.use_vsync); + config_save_default(); + this->Invalidate(); + break; + case WIDX_SHOW_FPS_CHECKBOX: + gConfigGeneral.show_fps ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_MULTITHREADING_CHECKBOX: + gConfigGeneral.multithreading ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_MINIMIZE_FOCUS_LOSS: + gConfigGeneral.minimize_fullscreen_focus_loss ^= 1; + platform_refresh_video(false); + config_save_default(); + this->Invalidate(); + break; + case WIDX_STEAM_OVERLAY_PAUSE: + gConfigGeneral.steam_overlay_pause ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_DISABLE_SCREENSAVER_LOCK: + gConfigGeneral.disable_screensaver ^= 1; + ApplyScreenSaverLockSetting(); + config_save_default(); + this->Invalidate(); + break; + } + } + + void DisplayMouseDown(rct_widgetindex widgetIndex) + { + rct_widget* widget = &this->widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_RESOLUTION_DROPDOWN: + { + const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); + + int32_t selectedResolution = -1; + for (size_t i = 0; i < resolutions.size(); i++) { - selectedResolution = static_cast(i); + const Resolution& resolution = resolutions[i]; + + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + + uint16_t* args = reinterpret_cast(&gDropdownItemsArgs[i]); + args[0] = STR_RESOLUTION_X_BY_Y; + args[1] = resolution.Width; + args[2] = resolution.Height; + + if (resolution.Width == gConfigGeneral.fullscreen_width + && resolution.Height == gConfigGeneral.fullscreen_height) + { + selectedResolution = static_cast(i); + } + } + + this->ShowDropdown(widget, static_cast(resolutions.size())); + + if (selectedResolution != -1 && selectedResolution < 32) + { + Dropdown::SetChecked(selectedResolution, true); } } - window_options_show_dropdown(w, widget, static_cast(resolutions.size())); - - if (selectedResolution != -1 && selectedResolution < 32) - { - Dropdown::SetChecked(selectedResolution, true); - } - } - - break; - case WIDX_FULLSCREEN_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_OPTIONS_DISPLAY_WINDOWED; - gDropdownItemsArgs[1] = STR_OPTIONS_DISPLAY_FULLSCREEN; - gDropdownItemsArgs[2] = STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS; - - window_options_show_dropdown(w, widget, 3); - - Dropdown::SetChecked(gConfigGeneral.fullscreen_mode, true); break; - case WIDX_DRAWING_ENGINE_DROPDOWN: - { - int32_t numItems = 3; + case WIDX_FULLSCREEN_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_OPTIONS_DISPLAY_WINDOWED; + gDropdownItemsArgs[1] = STR_OPTIONS_DISPLAY_FULLSCREEN; + gDropdownItemsArgs[2] = STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS; + + this->ShowDropdown(widget, 3); + + Dropdown::SetChecked(gConfigGeneral.fullscreen_mode, true); + break; + case WIDX_DRAWING_ENGINE_DROPDOWN: + { + int32_t numItems = 3; #ifdef DISABLE_OPENGL - numItems = 2; + numItems = 2; #endif - for (int32_t i = 0; i < numItems; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = DrawingEngineStringIds[i]; + for (int32_t i = 0; i < numItems; i++) + { + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = DrawingEngineStringIds[i]; + } + this->ShowDropdown(widget, numItems); + Dropdown::SetChecked(EnumValue(gConfigGeneral.drawing_engine), true); + break; } - window_options_show_dropdown(w, widget, numItems); - Dropdown::SetChecked(EnumValue(gConfigGeneral.drawing_engine), true); - break; - } - case WIDX_SCALE_UP: - gConfigGeneral.window_scale += 0.25f; - config_save_default(); - gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); - break; - case WIDX_SCALE_DOWN: - gConfigGeneral.window_scale -= 0.25f; - gConfigGeneral.window_scale = std::max(0.5f, gConfigGeneral.window_scale); - config_save_default(); - gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); - break; - case WIDX_SCALE_QUALITY_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_SCALING_QUALITY_LINEAR; - gDropdownItemsArgs[1] = STR_SCALING_QUALITY_SMOOTH_NN; - - window_options_show_dropdown(w, widget, 2); - - // Note: offset by one to compensate for lack of NN option. - Dropdown::SetChecked(static_cast(gConfigGeneral.scale_quality) - 1, true); - break; - } -} - -static void window_options_display_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_RESOLUTION_DROPDOWN: - { - const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); - - const Resolution& resolution = resolutions[dropdownIndex]; - if (resolution.Width != gConfigGeneral.fullscreen_width || resolution.Height != gConfigGeneral.fullscreen_height) - { - gConfigGeneral.fullscreen_width = resolution.Width; - gConfigGeneral.fullscreen_height = resolution.Height; - - if (gConfigGeneral.fullscreen_mode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - context_set_fullscreen_mode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); - - config_save_default(); - gfx_invalidate_screen(); - } - } - break; - case WIDX_FULLSCREEN_DROPDOWN: - if (dropdownIndex != gConfigGeneral.fullscreen_mode) - { - context_set_fullscreen_mode(dropdownIndex); - - gConfigGeneral.fullscreen_mode = static_cast(dropdownIndex); - config_save_default(); - gfx_invalidate_screen(); - } - break; - case WIDX_DRAWING_ENGINE_DROPDOWN: - if (dropdownIndex != EnumValue(gConfigGeneral.drawing_engine)) - { - DrawingEngine srcEngine = drawing_engine_get_type(); - DrawingEngine dstEngine = static_cast(dropdownIndex); - - gConfigGeneral.drawing_engine = dstEngine; - bool recreate_window = drawing_engine_requires_new_window(srcEngine, dstEngine); - platform_refresh_video(recreate_window); - config_save_default(); - w->Invalidate(); - } - break; - case WIDX_SCALE_QUALITY_DROPDOWN: - // Note: offset by one to compensate for lack of NN option. - if (static_cast(dropdownIndex + 1) != gConfigGeneral.scale_quality) - { - gConfigGeneral.scale_quality = static_cast(dropdownIndex + 1); + case WIDX_SCALE_UP: + gConfigGeneral.window_scale += 0.25f; config_save_default(); gfx_invalidate_screen(); context_trigger_resize(); - } - break; - } -} - -static void window_options_display_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - // Resolution dropdown caption. - auto ft = Formatter::Common(); - ft.Increment(16); - ft.Add(static_cast(gConfigGeneral.fullscreen_width)); - ft.Add(static_cast(gConfigGeneral.fullscreen_height)); - - // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" - if (gConfigGeneral.fullscreen_mode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - { - w->disabled_widgets |= (1ULL << WIDX_RESOLUTION_DROPDOWN); - w->disabled_widgets |= (1ULL << WIDX_RESOLUTION); - } - else - { - w->disabled_widgets &= ~(1ULL << WIDX_RESOLUTION_DROPDOWN); - w->disabled_widgets &= ~(1ULL << WIDX_RESOLUTION); - } - - // Disable Steam Overlay checkbox when using software rendering. - if (gConfigGeneral.drawing_engine == DrawingEngine::Software) - { - w->disabled_widgets |= (1ULL << WIDX_STEAM_OVERLAY_PAUSE); - } - else - { - w->disabled_widgets &= ~(1ULL << WIDX_STEAM_OVERLAY_PAUSE); - } - - // Disable scaling quality dropdown when using software rendering or when using an integer scalar. - // In the latter case, nearest neighbour rendering will be used to scale. - if (gConfigGeneral.drawing_engine == DrawingEngine::Software - || gConfigGeneral.window_scale == std::floor(gConfigGeneral.window_scale)) - { - w->disabled_widgets |= (1ULL << WIDX_SCALE_QUALITY); - w->disabled_widgets |= (1ULL << WIDX_SCALE_QUALITY_DROPDOWN); - } - else - { - w->disabled_widgets &= ~(1ULL << WIDX_SCALE_QUALITY); - w->disabled_widgets &= ~(1ULL << WIDX_SCALE_QUALITY_DROPDOWN); - } - - // Disable changing VSync for Software engine, as we can't control its use of VSync - if (gConfigGeneral.drawing_engine == DrawingEngine::Software) - { - w->disabled_widgets |= (1ULL << WIDX_USE_VSYNC_CHECKBOX); - } - else - { - w->disabled_widgets &= ~(1ULL << WIDX_USE_VSYNC_CHECKBOX); - } - - WidgetSetCheckboxValue(w, WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.uncap_fps); - WidgetSetCheckboxValue(w, WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.use_vsync); - WidgetSetCheckboxValue(w, WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.show_fps); - WidgetSetCheckboxValue(w, WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.multithreading); - WidgetSetCheckboxValue(w, WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.minimize_fullscreen_focus_loss); - WidgetSetCheckboxValue(w, WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.steam_overlay_pause); - WidgetSetCheckboxValue(w, WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.disable_screensaver); - - // Dropdown captions for straightforward strings. - window_options_display_widgets[WIDX_FULLSCREEN].text = window_options_fullscreen_mode_names[gConfigGeneral.fullscreen_mode]; - window_options_display_widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.drawing_engine)]; - window_options_display_widgets[WIDX_SCALE_QUALITY].text = window_options_scale_quality_names - [static_cast(gConfigGeneral.scale_quality) - 1]; - - window_options_common_invalidate_after(w); -} - -static void window_options_display_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_FULLSCREEN].top + 1 }, STR_FULLSCREEN_MODE, - {}, { w->colours[1] }); - - // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" - colour_t colour = w->colours[1]; - if (gConfigGeneral.fullscreen_mode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - { - colour |= COLOUR_FLAG_INSET; - } - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10 + 15, window_options_display_widgets[WIDX_RESOLUTION].top + 1 }, - STR_DISPLAY_RESOLUTION, {}, { colour }); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, {}, - { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_display_widgets[WIDX_DRAWING_ENGINE].top + 1 }, - STR_DRAWING_ENGINE, {}, { w->colours[1] }); - - auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.window_scale * 100)); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SCALE].left + 1, w->widgets[WIDX_SCALE].top + 1 }, - STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { w->colours[1] }); - - colour = w->colours[1]; - if (gConfigGeneral.drawing_engine == DrawingEngine::Software - || gConfigGeneral.window_scale == std::floor(gConfigGeneral.window_scale)) - { - colour |= COLOUR_FLAG_INSET; - } - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 25, window_options_display_widgets[WIDX_SCALE_QUALITY].top + 1 }, - STR_SCALING_QUALITY, {}, { colour }); -} - -#pragma region Rendering Tab - -static void window_options_rendering_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) - { - case WIDX_TILE_SMOOTHING_CHECKBOX: - gConfigGeneral.landscape_smoothing ^= 1; - config_save_default(); - gfx_invalidate_screen(); - break; - case WIDX_GRIDLINES_CHECKBOX: - gConfigGeneral.always_show_gridlines ^= 1; - config_save_default(); - gfx_invalidate_screen(); - if ((w = window_get_main()) != nullptr) - { - if (gConfigGeneral.always_show_gridlines) - w->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; - else - w->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; - } - break; - case WIDX_DAY_NIGHT_CHECKBOX: - gConfigGeneral.day_night_cycle ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_ENABLE_LIGHT_FX_CHECKBOX: - gConfigGeneral.enable_light_fx ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: - gConfigGeneral.enable_light_fx_for_vehicles ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_UPPER_CASE_BANNERS_CHECKBOX: - gConfigGeneral.upper_case_banners ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: - gConfigGeneral.disable_lightning_effect ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: - gConfigGeneral.render_weather_effects ^= 1; - gConfigGeneral.render_weather_gloom = gConfigGeneral.render_weather_effects; - config_save_default(); - w->Invalidate(); - gfx_invalidate_screen(); - break; - case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: - gConfigGeneral.show_guest_purchases ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: - gConfigGeneral.transparent_screenshot ^= 1; - config_save_default(); - w->Invalidate(); - break; - } -} - -static void window_options_rendering_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - switch (widgetIndex) - { - case WIDX_VIRTUAL_FLOOR_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_VIRTUAL_FLOOR_STYLE_DISABLED; - gDropdownItemsArgs[1] = STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT; - gDropdownItemsArgs[2] = STR_VIRTUAL_FLOOR_STYLE_GLASSY; - - widget = &w->widgets[widgetIndex - 1]; - window_options_show_dropdown(w, widget, 3); - - Dropdown::SetChecked(static_cast(gConfigGeneral.virtual_floor_style), true); - break; - } -} - -static void window_options_rendering_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_VIRTUAL_FLOOR_DROPDOWN: - gConfigGeneral.virtual_floor_style = static_cast(dropdownIndex); - config_save_default(); - break; - } -} - -static void window_options_rendering_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - WidgetSetCheckboxValue(w, WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.landscape_smoothing); - WidgetSetCheckboxValue(w, WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.always_show_gridlines); - WidgetSetCheckboxValue(w, WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.day_night_cycle); - WidgetSetCheckboxValue(w, WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.show_guest_purchases); - WidgetSetCheckboxValue(w, WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.transparent_screenshot); - WidgetSetCheckboxValue(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); - - rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, - STR_VIRTUAL_FLOOR_STYLE_GLASSY }; - - window_options_rendering_widgets[WIDX_VIRTUAL_FLOOR].text = VirtualFloorStyleStrings[static_cast( - gConfigGeneral.virtual_floor_style)]; - - WidgetSetCheckboxValue(w, WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.enable_light_fx); - if (gConfigGeneral.day_night_cycle && gConfigGeneral.drawing_engine == DrawingEngine::SoftwareWithHardwareDisplay) - { - w->disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - } - else - { - w->disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - gConfigGeneral.enable_light_fx = false; - } - - WidgetSetCheckboxValue(w, WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.enable_light_fx_for_vehicles); - if (gConfigGeneral.day_night_cycle && gConfigGeneral.drawing_engine == DrawingEngine::SoftwareWithHardwareDisplay - && gConfigGeneral.enable_light_fx) - { - w->disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - } - else - { - w->disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - gConfigGeneral.enable_light_fx_for_vehicles = false; - } - - WidgetSetCheckboxValue( - w, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, gConfigGeneral.render_weather_effects || gConfigGeneral.render_weather_gloom); - WidgetSetCheckboxValue(w, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.disable_lightning_effect); - if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom) - { - WidgetSetCheckboxValue(w, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); - w->enabled_widgets &= ~(1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - w->disabled_widgets |= (1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - } - else - { - w->enabled_widgets |= (1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - w->disabled_widgets &= ~(1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - } - - window_options_common_invalidate_after(w); -} - -static void window_options_rendering_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); -} - -#pragma region Culture Tab - -static void window_options_culture_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); -} - -static void window_options_culture_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_HEIGHT_LABELS_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_HEIGHT_IN_UNITS; - gDropdownItemsArgs[1] = STR_REAL_VALUES; - - window_options_show_dropdown(w, widget, 2); - - Dropdown::SetChecked(gConfigGeneral.show_height_as_units ? 0 : 1, true); - break; - case WIDX_CURRENCY_DROPDOWN: - { - constexpr auto num_items = EnumValue(CurrencyType::Count) + 1; // All the currencies plus the separator - size_t num_ordinary_currencies = EnumValue(CurrencyType::Count) - 1; // All the currencies except custom currency - - for (size_t i = 0; i < num_ordinary_currencies; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = CurrencyDescriptors[i].stringId; - } - - gDropdownItemsFormat[num_ordinary_currencies] = Dropdown::SeparatorString; - - gDropdownItemsFormat[num_ordinary_currencies + 1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[num_ordinary_currencies + 1] = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].stringId; - - window_options_show_dropdown(w, widget, num_items); - - if (gConfigGeneral.currency_format == CurrencyType::Custom) - { - Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format) + 1, true); - } - else - { - Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format), true); - } - break; - } - case WIDX_DISTANCE_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_IMPERIAL; - gDropdownItemsArgs[1] = STR_METRIC; - gDropdownItemsArgs[2] = STR_SI; - - window_options_show_dropdown(w, widget, 3); - - Dropdown::SetChecked(static_cast(gConfigGeneral.measurement_format), true); - break; - case WIDX_TEMPERATURE_DROPDOWN: - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_CELSIUS; - gDropdownItemsArgs[1] = STR_FAHRENHEIT; - - window_options_show_dropdown(w, widget, 2); - - Dropdown::SetChecked(static_cast(gConfigGeneral.temperature_format), true); - break; - case WIDX_LANGUAGE_DROPDOWN: - for (size_t i = 1; i < LANGUAGE_COUNT; i++) - { - gDropdownItemsFormat[i - 1] = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItemsArgs[i - 1] = reinterpret_cast(LanguagesDescriptors[i].native_name); - } - window_options_show_dropdown(w, widget, LANGUAGE_COUNT - 1); - Dropdown::SetChecked(LocalisationService_GetCurrentLanguage() - 1, true); - break; - case WIDX_DATE_FORMAT_DROPDOWN: - for (size_t i = 0; i < 4; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = DateFormatStringIds[i]; - } - window_options_show_dropdown(w, widget, 4); - Dropdown::SetChecked(gConfigGeneral.date_format, true); - break; - } -} - -static void window_options_culture_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_HEIGHT_LABELS_DROPDOWN: - // reset flag and set it to 1 if height as units is selected - gConfigGeneral.show_height_as_units = 0; - - if (dropdownIndex == 0) - { - gConfigGeneral.show_height_as_units = 1; - } - config_save_default(); - window_options_update_height_markers(); - break; - case WIDX_CURRENCY_DROPDOWN: - if (dropdownIndex == EnumValue(CurrencyType::Custom) + 1) - { // Add 1 because the separator occupies a position - gConfigGeneral.currency_format = static_cast(dropdownIndex - 1); - context_open_window(WC_CUSTOM_CURRENCY_CONFIG); - } - else - { - gConfigGeneral.currency_format = static_cast(dropdownIndex); - } - config_save_default(); - gfx_invalidate_screen(); - break; - case WIDX_DISTANCE_DROPDOWN: - gConfigGeneral.measurement_format = static_cast(dropdownIndex); - config_save_default(); - window_options_update_height_markers(); - break; - case WIDX_TEMPERATURE_DROPDOWN: - if (dropdownIndex != static_cast(gConfigGeneral.temperature_format)) - { - gConfigGeneral.temperature_format = static_cast(dropdownIndex); + context_update_cursor_scale(); + break; + case WIDX_SCALE_DOWN: + gConfigGeneral.window_scale -= 0.25f; + gConfigGeneral.window_scale = std::max(0.5f, gConfigGeneral.window_scale); config_save_default(); gfx_invalidate_screen(); - } - break; - case WIDX_LANGUAGE_DROPDOWN: + context_trigger_resize(); + context_update_cursor_scale(); + break; + case WIDX_SCALE_QUALITY_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_SCALING_QUALITY_LINEAR; + gDropdownItemsArgs[1] = STR_SCALING_QUALITY_SMOOTH_NN; + + this->ShowDropdown(widget, 2); + + // Note: offset by one to compensate for lack of NN option. + Dropdown::SetChecked(static_cast(gConfigGeneral.scale_quality) - 1, true); + break; + } + } + + void DisplayDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) { - auto fallbackLanguage = LocalisationService_GetCurrentLanguage(); - if (dropdownIndex != LocalisationService_GetCurrentLanguage() - 1) + case WIDX_RESOLUTION_DROPDOWN: { - if (!language_open(dropdownIndex + 1)) + const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); + + const Resolution& resolution = resolutions[dropdownIndex]; + if (resolution.Width != gConfigGeneral.fullscreen_width + || resolution.Height != gConfigGeneral.fullscreen_height) { - // Failed to open language file, try to recover by falling - // back to previously used language - if (language_open(fallbackLanguage)) - { - // It worked, so we can say it with error message in-game - context_show_error(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); - } - // report error to console regardless - log_error("Failed to open language file."); - } - else - { - gConfigGeneral.language = dropdownIndex + 1; + gConfigGeneral.fullscreen_width = resolution.Width; + gConfigGeneral.fullscreen_height = resolution.Height; + + if (gConfigGeneral.fullscreen_mode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + context_set_fullscreen_mode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); + config_save_default(); gfx_invalidate_screen(); } } + break; + case WIDX_FULLSCREEN_DROPDOWN: + if (dropdownIndex != gConfigGeneral.fullscreen_mode) + { + context_set_fullscreen_mode(dropdownIndex); + + gConfigGeneral.fullscreen_mode = static_cast(dropdownIndex); + config_save_default(); + gfx_invalidate_screen(); + } + break; + case WIDX_DRAWING_ENGINE_DROPDOWN: + if (dropdownIndex != EnumValue(gConfigGeneral.drawing_engine)) + { + DrawingEngine srcEngine = drawing_engine_get_type(); + DrawingEngine dstEngine = static_cast(dropdownIndex); + + gConfigGeneral.drawing_engine = dstEngine; + bool recreate_window = drawing_engine_requires_new_window(srcEngine, dstEngine); + platform_refresh_video(recreate_window); + config_save_default(); + this->Invalidate(); + } + break; + case WIDX_SCALE_QUALITY_DROPDOWN: + // Note: offset by one to compensate for lack of NN option. + if (static_cast(dropdownIndex + 1) != gConfigGeneral.scale_quality) + { + gConfigGeneral.scale_quality = static_cast(dropdownIndex + 1); + config_save_default(); + gfx_invalidate_screen(); + context_trigger_resize(); + } + break; } - break; - case WIDX_DATE_FORMAT_DROPDOWN: - if (dropdownIndex != gConfigGeneral.date_format) - { - gConfigGeneral.date_format = static_cast(dropdownIndex); + } + + void DisplayPrepareDraw() + { + CommonPrepareDrawBefore(); + + // Resolution dropdown caption. + auto ft = Formatter::Common(); + ft.Increment(16); + ft.Add(static_cast(gConfigGeneral.fullscreen_width)); + ft.Add(static_cast(gConfigGeneral.fullscreen_height)); + + // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" + if (gConfigGeneral.fullscreen_mode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + { + this->disabled_widgets |= (1ULL << WIDX_RESOLUTION_DROPDOWN); + this->disabled_widgets |= (1ULL << WIDX_RESOLUTION); + } + else + { + this->disabled_widgets &= ~(1ULL << WIDX_RESOLUTION_DROPDOWN); + this->disabled_widgets &= ~(1ULL << WIDX_RESOLUTION); + } + + // Disable Steam Overlay checkbox when using software rendering. + if (gConfigGeneral.drawing_engine == DrawingEngine::Software) + { + this->disabled_widgets |= (1ULL << WIDX_STEAM_OVERLAY_PAUSE); + } + else + { + this->disabled_widgets &= ~(1ULL << WIDX_STEAM_OVERLAY_PAUSE); + } + + // Disable scaling quality dropdown when using software rendering or when using an integer scalar. + // In the latter case, nearest neighbour rendering will be used to scale. + if (gConfigGeneral.drawing_engine == DrawingEngine::Software + || gConfigGeneral.window_scale == std::floor(gConfigGeneral.window_scale)) + { + this->disabled_widgets |= (1ULL << WIDX_SCALE_QUALITY); + this->disabled_widgets |= (1ULL << WIDX_SCALE_QUALITY_DROPDOWN); + } + else + { + this->disabled_widgets &= ~(1ULL << WIDX_SCALE_QUALITY); + this->disabled_widgets &= ~(1ULL << WIDX_SCALE_QUALITY_DROPDOWN); + } + + // Disable changing VSync for Software engine, as we can't control its use of VSync + if (gConfigGeneral.drawing_engine == DrawingEngine::Software) + { + this->disabled_widgets |= (1ULL << WIDX_USE_VSYNC_CHECKBOX); + } + else + { + this->disabled_widgets &= ~(1ULL << WIDX_USE_VSYNC_CHECKBOX); + } + + WidgetSetCheckboxValue(this, WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.uncap_fps); + WidgetSetCheckboxValue(this, WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.use_vsync); + WidgetSetCheckboxValue(this, WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.show_fps); + WidgetSetCheckboxValue(this, WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.multithreading); + WidgetSetCheckboxValue(this, WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.minimize_fullscreen_focus_loss); + WidgetSetCheckboxValue(this, WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.steam_overlay_pause); + WidgetSetCheckboxValue(this, WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.disable_screensaver); + + // Dropdown captions for straightforward strings. + this->widgets[WIDX_FULLSCREEN].text = window_options_fullscreen_mode_names[gConfigGeneral.fullscreen_mode]; + this->widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.drawing_engine)]; + this->widgets[WIDX_SCALE_QUALITY].text = window_options_scale_quality_names + [static_cast(gConfigGeneral.scale_quality) - 1]; + + CommonPrepareDrawAfter(); + } + + void DisplayDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_FULLSCREEN].top + 1 }, STR_FULLSCREEN_MODE, {}, + { this->colours[1] }); + + // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" + colour_t colour = this->colours[1]; + if (gConfigGeneral.fullscreen_mode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + { + colour |= COLOUR_FLAG_INSET; + } + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10 + 15, this->widgets[WIDX_RESOLUTION].top + 1 }, STR_DISPLAY_RESOLUTION, + {}, { colour }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_SCALE].top + 1 }, STR_UI_SCALING_DESC, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_DRAWING_ENGINE].top + 1 }, STR_DRAWING_ENGINE, {}, + { this->colours[1] }); + + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.window_scale * 100)); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ this->widgets[WIDX_SCALE].left + 1, this->widgets[WIDX_SCALE].top + 1 }, + STR_WINDOW_OBJECTIVE_VALUE_RATING, ft, { this->colours[1] }); + + colour = this->colours[1]; + if (gConfigGeneral.drawing_engine == DrawingEngine::Software + || gConfigGeneral.window_scale == std::floor(gConfigGeneral.window_scale)) + { + colour |= COLOUR_FLAG_INSET; + } + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 25, this->widgets[WIDX_SCALE_QUALITY].top + 1 }, STR_SCALING_QUALITY, {}, + { colour }); + } +#pragma endregion + +#pragma region Rendering tab events + void RenderingMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_TILE_SMOOTHING_CHECKBOX: + gConfigGeneral.landscape_smoothing ^= 1; config_save_default(); gfx_invalidate_screen(); + break; + case WIDX_GRIDLINES_CHECKBOX: + { + gConfigGeneral.always_show_gridlines ^= 1; + config_save_default(); + gfx_invalidate_screen(); + rct_window* mainWindow = window_get_main(); + if (mainWindow != nullptr) + { + if (gConfigGeneral.always_show_gridlines) + mainWindow->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; + else + mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; + } + break; } - break; - } -} - -static void window_options_culture_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - // Language - auto ft = Formatter::Common(); - ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); - - // Currency: pounds, dollars, etc. (10 total) - window_options_culture_widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)] - .stringId; - - // Distance: metric / imperial / si - { - rct_string_id stringId = STR_NONE; - switch (gConfigGeneral.measurement_format) - { - case MeasurementFormat::Imperial: - stringId = STR_IMPERIAL; + case WIDX_DAY_NIGHT_CHECKBOX: + gConfigGeneral.day_night_cycle ^= 1; + config_save_default(); + this->Invalidate(); break; - case MeasurementFormat::Metric: - stringId = STR_METRIC; + case WIDX_ENABLE_LIGHT_FX_CHECKBOX: + gConfigGeneral.enable_light_fx ^= 1; + config_save_default(); + this->Invalidate(); break; - case MeasurementFormat::SI: - stringId = STR_SI; + case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: + gConfigGeneral.enable_light_fx_for_vehicles ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_UPPER_CASE_BANNERS_CHECKBOX: + gConfigGeneral.upper_case_banners ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: + gConfigGeneral.disable_lightning_effect ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: + gConfigGeneral.render_weather_effects ^= 1; + gConfigGeneral.render_weather_gloom = gConfigGeneral.render_weather_effects; + config_save_default(); + this->Invalidate(); + gfx_invalidate_screen(); + break; + case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: + gConfigGeneral.show_guest_purchases ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: + gConfigGeneral.transparent_screenshot ^= 1; + config_save_default(); + this->Invalidate(); break; } - window_options_culture_widgets[WIDX_DISTANCE].text = stringId; } - // Date format - window_options_culture_widgets[WIDX_DATE_FORMAT].text = DateFormatStringIds[gConfigGeneral.date_format]; - - // Temperature: celsius/fahrenheit - window_options_culture_widgets[WIDX_TEMPERATURE].text = gConfigGeneral.temperature_format == TemperatureUnit::Fahrenheit - ? STR_FAHRENHEIT - : STR_CELSIUS; - - // Height: units/real values - window_options_culture_widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.show_height_as_units ? STR_HEIGHT_IN_UNITS - : STR_REAL_VALUES; - - window_options_common_invalidate_after(w); -} - -static void window_options_culture_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_LANGUAGE].top + 1 }, STR_OPTIONS_LANGUAGE, - {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, {}, - { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DISTANCE].top + 1 }, STR_DISTANCE_AND_SPEED, - {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, {}, - { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_HEIGHT_LABELS].top + 1 }, STR_HEIGHT_LABELS, - {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, {}, - { w->colours[1] }); -} - -#pragma region Audio Tab - -static void window_options_audio_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) + void RenderingMouseDown(rct_widgetindex widgetIndex) { - case WIDX_SOUND_CHECKBOX: - gConfigSound.sound_enabled = !gConfigSound.sound_enabled; - config_save_default(); - w->Invalidate(); - break; + switch (widgetIndex) + { + case WIDX_VIRTUAL_FLOOR_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_VIRTUAL_FLOOR_STYLE_DISABLED; + gDropdownItemsArgs[1] = STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT; + gDropdownItemsArgs[2] = STR_VIRTUAL_FLOOR_STYLE_GLASSY; - case WIDX_MASTER_SOUND_CHECKBOX: - gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; - if (!gConfigSound.master_sound_enabled) - OpenRCT2::Audio::Pause(); - else - OpenRCT2::Audio::Resume(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - config_save_default(); - w->Invalidate(); - break; + rct_widget* widget = &this->widgets[widgetIndex - 1]; + this->ShowDropdown(widget, 3); - case WIDX_MUSIC_CHECKBOX: - gConfigSound.ride_music_enabled = !gConfigSound.ride_music_enabled; - if (!gConfigSound.ride_music_enabled) - { - OpenRCT2::RideAudio::StopAllChannels(); - } - config_save_default(); - w->Invalidate(); - break; - - case WIDX_AUDIO_FOCUS_CHECKBOX: - gConfigSound.audio_focus = !gConfigSound.audio_focus; - config_save_default(); - w->Invalidate(); - break; + Dropdown::SetChecked(static_cast(gConfigGeneral.virtual_floor_style), true); + break; + } } -} -static void window_options_audio_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) + void RenderingDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) { - case WIDX_SOUND_DROPDOWN: - OpenRCT2::Audio::PopulateDevices(); + if (dropdownIndex == -1) + return; - // populate the list with the sound devices - for (int32_t i = 0; i < OpenRCT2::Audio::GetDeviceCount(); i++) - { - gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItemsArgs[i] = reinterpret_cast(OpenRCT2::Audio::GetDeviceName(i).c_str()); - } - - window_options_show_dropdown(w, widget, OpenRCT2::Audio::GetDeviceCount()); - - Dropdown::SetChecked(OpenRCT2::Audio::GetCurrentDeviceIndex(), true); - break; - case WIDX_TITLE_MUSIC_DROPDOWN: - uint32_t num_items = 4; - - for (size_t i = 0; i < num_items; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = window_options_title_music_names[i]; - } - - window_options_show_dropdown(w, widget, num_items); - - Dropdown::SetChecked(gConfigSound.title_music, true); - break; + switch (widgetIndex) + { + case WIDX_VIRTUAL_FLOOR_DROPDOWN: + gConfigGeneral.virtual_floor_style = static_cast(dropdownIndex); + config_save_default(); + break; + } } -} -static void window_options_audio_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) + void RenderingPrepareDraw() { - case WIDX_SOUND_DROPDOWN: - OpenRCT2::Audio::InitRideSounds(dropdownIndex); - if (dropdownIndex < OpenRCT2::Audio::GetDeviceCount()) + CommonPrepareDrawBefore(); + + WidgetSetCheckboxValue(this, WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.landscape_smoothing); + WidgetSetCheckboxValue(this, WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.always_show_gridlines); + WidgetSetCheckboxValue(this, WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.day_night_cycle); + WidgetSetCheckboxValue(this, WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.show_guest_purchases); + WidgetSetCheckboxValue(this, WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.transparent_screenshot); + WidgetSetCheckboxValue(this, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); + + rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, + STR_VIRTUAL_FLOOR_STYLE_GLASSY }; + + this->widgets[WIDX_VIRTUAL_FLOOR].text = VirtualFloorStyleStrings[static_cast( + gConfigGeneral.virtual_floor_style)]; + + WidgetSetCheckboxValue(this, WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.enable_light_fx); + if (gConfigGeneral.day_night_cycle && gConfigGeneral.drawing_engine == DrawingEngine::SoftwareWithHardwareDisplay) + { + this->disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + } + else + { + this->disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + gConfigGeneral.enable_light_fx = false; + } + + WidgetSetCheckboxValue(this, WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.enable_light_fx_for_vehicles); + if (gConfigGeneral.day_night_cycle && gConfigGeneral.drawing_engine == DrawingEngine::SoftwareWithHardwareDisplay + && gConfigGeneral.enable_light_fx) + { + this->disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + } + else + { + this->disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + gConfigGeneral.enable_light_fx_for_vehicles = false; + } + + WidgetSetCheckboxValue( + this, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, + gConfigGeneral.render_weather_effects || gConfigGeneral.render_weather_gloom); + WidgetSetCheckboxValue(this, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.disable_lightning_effect); + if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom) + { + WidgetSetCheckboxValue(this, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); + this->enabled_widgets &= ~(1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + this->disabled_widgets |= (1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + } + else + { + this->enabled_widgets |= (1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + this->disabled_widgets &= ~(1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + } + + CommonPrepareDrawAfter(); + } + + void RenderingDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + DrawTabImages(dpi); + } + +#pragma endregion + +#pragma region Culture tab events + void CultureMouseDown(rct_widgetindex widgetIndex) + { + rct_widget* widget = &this->widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_HEIGHT_LABELS_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_HEIGHT_IN_UNITS; + gDropdownItemsArgs[1] = STR_REAL_VALUES; + + this->ShowDropdown(widget, 2); + + Dropdown::SetChecked(gConfigGeneral.show_height_as_units ? 0 : 1, true); + break; + case WIDX_CURRENCY_DROPDOWN: { - if (dropdownIndex == 0) + // 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++) { - Mixer_Init(nullptr); - gConfigSound.device = nullptr; + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = CurrencyDescriptors[i].stringId; + } + + gDropdownItemsFormat[numOrdinaryCurrencies] = Dropdown::SeparatorString; + + gDropdownItemsFormat[numOrdinaryCurrencies + 1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[numOrdinaryCurrencies + 1] = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].stringId; + + this->ShowDropdown(widget, numItems); + + if (gConfigGeneral.currency_format == CurrencyType::Custom) + { + Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format) + 1, true); } else { - const char* devicename = OpenRCT2::Audio::GetDeviceName(dropdownIndex).c_str(); - Mixer_Init(devicename); - SafeFree(gConfigSound.device); - gConfigSound.device = strndup(devicename, OpenRCT2::Audio::MaxDeviceNameSize); + Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format), true); + } + break; + } + case WIDX_DISTANCE_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[2] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_IMPERIAL; + gDropdownItemsArgs[1] = STR_METRIC; + gDropdownItemsArgs[2] = STR_SI; + + this->ShowDropdown(widget, 3); + + Dropdown::SetChecked(static_cast(gConfigGeneral.measurement_format), true); + break; + case WIDX_TEMPERATURE_DROPDOWN: + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_CELSIUS; + gDropdownItemsArgs[1] = STR_FAHRENHEIT; + + this->ShowDropdown(widget, 2); + + Dropdown::SetChecked(static_cast(gConfigGeneral.temperature_format), true); + break; + case WIDX_LANGUAGE_DROPDOWN: + for (size_t i = 1; i < LANGUAGE_COUNT; i++) + { + gDropdownItemsFormat[i - 1] = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItemsArgs[i - 1] = reinterpret_cast(LanguagesDescriptors[i].native_name); + } + this->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++) + { + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = DateFormatStringIds[i]; + } + this->ShowDropdown(widget, 4); + Dropdown::SetChecked(gConfigGeneral.date_format, true); + break; + } + } + + void CultureDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_HEIGHT_LABELS_DROPDOWN: + // reset flag and set it to 1 if height as units is selected + gConfigGeneral.show_height_as_units = 0; + + if (dropdownIndex == 0) + { + gConfigGeneral.show_height_as_units = 1; } config_save_default(); - OpenRCT2::Audio::PlayTitleMusic(); - } - w->Invalidate(); - break; - case WIDX_TITLE_MUSIC_DROPDOWN: - if ((dropdownIndex == 1 || dropdownIndex == 3) && !Platform::FileExists(context_get_path_legacy(PATH_ID_CSS50))) - { - context_show_error(STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND, STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND_HINT, {}); - } - else - { - gConfigSound.title_music = static_cast(dropdownIndex); - config_save_default(); - w->Invalidate(); - } - - OpenRCT2::Audio::StopTitleMusic(); - if (dropdownIndex != 0) - OpenRCT2::Audio::PlayTitleMusic(); - break; - } -} - -static uint8_t get_scroll_percentage(const rct_widget& widget, const rct_scroll& scroll) -{ - uint8_t width = widget.width() - 1; - return static_cast(scroll.h_left) / (scroll.h_right - width) * 100; -} - -static void window_options_audio_update(rct_window* w) -{ - window_options_common_update(w); - - if (w->page == WINDOW_OPTIONS_PAGE_AUDIO) - { - const auto& masterVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; - const auto& masterVolumeScroll = w->scrolls[0]; - uint8_t master_volume = get_scroll_percentage(masterVolumeWidget, masterVolumeScroll); - if (master_volume != gConfigSound.master_volume) - { - gConfigSound.master_volume = master_volume; - config_save_default(); - widget_invalidate(w, WIDX_MASTER_VOLUME); - } - - const auto& soundVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; - const auto& soundVolumeScroll = w->scrolls[1]; - uint8_t sound_volume = get_scroll_percentage(soundVolumeWidget, soundVolumeScroll); - if (sound_volume != gConfigSound.sound_volume) - { - gConfigSound.sound_volume = sound_volume; - config_save_default(); - widget_invalidate(w, WIDX_SOUND_VOLUME); - } - - const auto& musicVolumeWidget = window_options_audio_widgets[WIDX_MASTER_VOLUME]; - const auto& musicVolumeScroll = w->scrolls[2]; - uint8_t ride_music_volume = get_scroll_percentage(musicVolumeWidget, musicVolumeScroll); - if (ride_music_volume != gConfigSound.ride_music_volume) - { - gConfigSound.ride_music_volume = ride_music_volume; - config_save_default(); - widget_invalidate(w, WIDX_MUSIC_VOLUME); - } - } -} - -static void window_options_audio_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height) -{ - *width = 500; -} - -static void initialize_scroll_position(rct_window* w, rct_widgetindex widget_index, int32_t scroll_id, uint8_t volume) -{ - const auto& widget = window_options_audio_widgets[widget_index]; - auto& scroll = w->scrolls[scroll_id]; - - int32_t widget_size = scroll.h_right - (widget.width() - 1); - scroll.h_left = ceil(volume / 100.0f * widget_size); - - WidgetScrollUpdateThumbs(w, widget_index); -} - -static void window_options_audio_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - // Sound device - rct_string_id audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; - const char* audioDeviceName = nullptr; - const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); - if (currentDeviceIndex == -1) - { - audioDeviceStringId = STR_SOUND_NONE; - } - else - { - audioDeviceStringId = STR_STRING; -#ifndef __linux__ - if (currentDeviceIndex == 0) - { - audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; - } -#endif // __linux__ - if (audioDeviceStringId == STR_STRING) - { - audioDeviceName = OpenRCT2::Audio::GetDeviceName(currentDeviceIndex).c_str(); - } - } - - window_options_audio_widgets[WIDX_SOUND].text = audioDeviceStringId; - auto ft = Formatter::Common(); - ft.Add(audioDeviceName); - - window_options_audio_widgets[WIDX_TITLE_MUSIC].text = window_options_title_music_names[gConfigSound.title_music]; - - WidgetSetCheckboxValue(w, WIDX_SOUND_CHECKBOX, gConfigSound.sound_enabled); - WidgetSetCheckboxValue(w, WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); - WidgetSetCheckboxValue(w, WIDX_MUSIC_CHECKBOX, gConfigSound.ride_music_enabled); - WidgetSetCheckboxValue(w, WIDX_AUDIO_FOCUS_CHECKBOX, gConfigSound.audio_focus); - WidgetSetEnabled(w, WIDX_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); - WidgetSetEnabled(w, WIDX_MUSIC_CHECKBOX, gConfigSound.master_sound_enabled); - - // Initialize only on first frame, otherwise the scrollbars won't be able to be modified - if (w->frame_no == 0) - { - initialize_scroll_position(w, WIDX_MASTER_VOLUME, 0, gConfigSound.master_volume); - initialize_scroll_position(w, WIDX_SOUND_VOLUME, 1, gConfigSound.sound_volume); - initialize_scroll_position(w, WIDX_MUSIC_VOLUME, 2, gConfigSound.ride_music_volume); - } - - window_options_common_invalidate_after(w); -} - -static void window_options_audio_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); -} - -#pragma region Controls and Interface Tab - -static void window_options_controls_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) - { - case WIDX_HOTKEY_DROPDOWN: - context_open_window(WC_KEYBOARD_SHORTCUT_LIST); - break; - case WIDX_SCREEN_EDGE_SCROLLING: - gConfigGeneral.edge_scrolling ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_TRAP_CURSOR: - gConfigGeneral.trap_cursor ^= 1; - config_save_default(); - context_set_cursor_trap(gConfigGeneral.trap_cursor); - w->Invalidate(); - break; - case WIDX_ZOOM_TO_CURSOR: - gConfigGeneral.zoom_to_cursor ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_TOOLBAR_SHOW_FINANCES: - gConfigInterface.toolbar_show_finances ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_RESEARCH: - gConfigInterface.toolbar_show_research ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_CHEATS: - gConfigInterface.toolbar_show_cheats ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_NEWS: - gConfigInterface.toolbar_show_news ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_MUTE: - gConfigInterface.toolbar_show_mute ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_CHAT: - gConfigInterface.toolbar_show_chat ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_TOOLBAR_SHOW_ZOOM: - gConfigInterface.toolbar_show_zoom ^= 1; - config_save_default(); - w->Invalidate(); - window_invalidate_by_class(WC_TOP_TOOLBAR); - break; - case WIDX_INVERT_DRAG: - gConfigGeneral.invert_viewport_drag ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_THEMES_BUTTON: - context_open_window(WC_THEMES); - w->Invalidate(); - break; - } -} - -static void window_options_controls_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_THEMES_DROPDOWN: - uint32_t num_items = static_cast(ThemeManagerGetNumAvailableThemes()); - - for (size_t i = 0; i < num_items; i++) - { - gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItemsArgs[i] = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); - } - - WindowDropdownShowTextCustomWidth( - { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, - Dropdown::Flag::StayOpen, num_items, widget->width() - 3); - - Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); - widget_invalidate(w, WIDX_THEMES_DROPDOWN); - break; - } -} - -static void window_options_controls_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_THEMES_DROPDOWN: - if (dropdownIndex != -1) - { - ThemeManagerSetActiveAvailableTheme(dropdownIndex); - } - config_save_default(); - break; - } -} - -static void window_options_controls_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - WidgetSetCheckboxValue(w, WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.edge_scrolling); - WidgetSetCheckboxValue(w, WIDX_TRAP_CURSOR, gConfigGeneral.trap_cursor); - WidgetSetCheckboxValue(w, WIDX_INVERT_DRAG, gConfigGeneral.invert_viewport_drag); - WidgetSetCheckboxValue(w, WIDX_ZOOM_TO_CURSOR, gConfigGeneral.zoom_to_cursor); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.toolbar_show_finances); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.toolbar_show_research); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.toolbar_show_cheats); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.toolbar_show_news); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.toolbar_show_mute); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.toolbar_show_chat); - WidgetSetCheckboxValue(w, WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.toolbar_show_zoom); - - size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); - const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); - auto ft = Formatter::Common(); - ft.Add(activeThemeName); - - window_options_common_invalidate_after(w); -} - -static void window_options_controls_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); - - DrawTextBasic( - dpi, - w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15 }, - STR_SHOW_TOOLBAR_BUTTONS_FOR, {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_controls_and_interface_widgets[WIDX_THEMES].top + 1 }, - STR_THEMES_LABEL_CURRENT_THEME, {}, { w->colours[1] }); -} - -#pragma region Miscellaneous Tab - -static void window_options_misc_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) - { - case WIDX_REAL_NAME_CHECKBOX: - gConfigGeneral.show_real_names_of_guests ^= 1; - config_save_default(); - w->Invalidate(); - peep_update_names(gConfigGeneral.show_real_names_of_guests); - break; - case WIDX_AUTO_STAFF_PLACEMENT: - gConfigGeneral.auto_staff_placement ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_TITLE_SEQUENCE_BUTTON: - window_title_editor_open(0); - break; - case WIDX_SCENARIO_UNLOCKING: - gConfigGeneral.scenario_unlocking_enabled ^= 1; - config_save_default(); - window_close_by_class(WC_SCENARIO_SELECT); - break; - case WIDX_TITLE_SEQUENCE_RANDOM: - gConfigInterface.random_title_sequence ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_AUTO_OPEN_SHOPS: - gConfigGeneral.auto_open_shops = !gConfigGeneral.auto_open_shops; - config_save_default(); - w->Invalidate(); - break; - case WIDX_ALLOW_EARLY_COMPLETION: - gConfigGeneral.allow_early_completion ^= 1; - // Only the server can control this setting and needs to send the - // current value of allow_early_completion to all clients - if (network_get_mode() == NETWORK_MODE_SERVER) - { - auto setAllowEarlyCompletionAction = ScenarioSetSettingAction( - ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.allow_early_completion); - GameActions::Execute(&setAllowEarlyCompletionAction); - } - config_save_default(); - w->Invalidate(); - break; - } -} - -static void window_options_misc_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - uint32_t num_items; - - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_TITLE_SEQUENCE_DROPDOWN: - num_items = static_cast(title_sequence_manager_get_count()); - for (size_t i = 0; i < num_items; i++) - { - gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItemsArgs[i] = reinterpret_cast(title_sequence_manager_get_name(i)); - } - - WindowDropdownShowText( - { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], - Dropdown::Flag::StayOpen, num_items); - - Dropdown::SetChecked(static_cast(title_get_current_sequence()), true); - break; - case WIDX_SCENARIO_GROUPING_DROPDOWN: - num_items = 2; - - gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[0] = STR_OPTIONS_SCENARIO_DIFFICULTY; - gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[1] = STR_OPTIONS_SCENARIO_ORIGIN; - - WindowDropdownShowTextCustomWidth( - { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, - Dropdown::Flag::StayOpen, num_items, widget->width() - 3); - - Dropdown::SetChecked(gConfigGeneral.scenario_select_mode, true); - break; - case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - for (size_t i = 0; i < 7; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = RideInspectionIntervalNames[i]; - } - - window_options_show_dropdown(w, widget, 7); - Dropdown::SetChecked(gConfigGeneral.default_inspection_interval, true); - break; - } -} - -static void window_options_misc_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_TITLE_SEQUENCE_DROPDOWN: - if (dropdownIndex != static_cast(title_get_current_sequence())) - { - title_sequence_change_preset(static_cast(dropdownIndex)); - config_save_default(); - w->Invalidate(); - } - break; - case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - if (dropdownIndex != gConfigGeneral.default_inspection_interval) - { - gConfigGeneral.default_inspection_interval = static_cast(dropdownIndex); - config_save_default(); - w->Invalidate(); - } - break; - case WIDX_SCENARIO_GROUPING_DROPDOWN: - if (dropdownIndex != gConfigGeneral.scenario_select_mode) - { - gConfigGeneral.scenario_select_mode = dropdownIndex; - gConfigInterface.scenarioselect_last_tab = 0; - config_save_default(); - w->Invalidate(); - window_close_by_class(WC_SCENARIO_SELECT); - } - break; - } -} - -static void window_options_misc_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - const utf8* name = title_sequence_manager_get_name(title_get_config_sequence()); - auto ft = Formatter::Common(); - 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 (network_get_mode() != NETWORK_MODE_NONE) - { - w->disabled_widgets |= (1ULL << WIDX_REAL_NAME_CHECKBOX); - window_options_misc_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 (network_get_mode() == NETWORK_MODE_CLIENT) - { - w->disabled_widgets |= (1ULL << WIDX_ALLOW_EARLY_COMPLETION); - window_options_misc_widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; - } - } - - WidgetSetCheckboxValue(w, WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.show_real_names_of_guests); - WidgetSetCheckboxValue(w, WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.auto_staff_placement); - WidgetSetCheckboxValue(w, WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.auto_open_shops); - WidgetSetCheckboxValue(w, WIDX_TITLE_SEQUENCE_RANDOM, gConfigInterface.random_title_sequence); - WidgetSetCheckboxValue(w, WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.allow_early_completion); - - // Disable title sequence dropdown if set to random - if (gConfigInterface.random_title_sequence) - { - w->disabled_widgets |= (1ULL << WIDX_TITLE_SEQUENCE_DROPDOWN); - w->disabled_widgets |= (1ULL << WIDX_TITLE_SEQUENCE); - } - else - { - w->disabled_widgets &= ~(1ULL << WIDX_TITLE_SEQUENCE_DROPDOWN); - w->disabled_widgets &= ~(1ULL << WIDX_TITLE_SEQUENCE); - } - - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_DIFFICULTY) - window_options_misc_widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_DIFFICULTY; - else - window_options_misc_widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_ORIGIN; - - WidgetSetCheckboxValue(w, WIDX_SCENARIO_UNLOCKING, gConfigGeneral.scenario_unlocking_enabled); - - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN) - { - w->disabled_widgets &= ~(1ULL << WIDX_SCENARIO_UNLOCKING); - } - else - { - w->disabled_widgets |= (1ULL << WIDX_SCENARIO_UNLOCKING); - } - - window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames - [gConfigGeneral.default_inspection_interval]; - - window_options_common_invalidate_after(w); -} - -static void window_options_misc_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top + 1 }, STR_TITLE_SEQUENCE, - {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_SCENARIO_GROUPING].top + 1 }, - STR_OPTIONS_SCENARIO_GROUPING, {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 10, window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1 }, - STR_DEFAULT_INSPECTION_INTERVAL, {}, { w->colours[1] }); -} - -#pragma region Advanced Tab - -static void window_options_advanced_mouseup(rct_window* w, rct_widgetindex widgetIndex) -{ - if (widgetIndex < WIDX_PAGE_START) - return window_options_common_mouseup(w, widgetIndex); - - switch (widgetIndex) - { - case WIDX_DEBUGGING_TOOLS: - gConfigGeneral.debugging_tools ^= 1; - config_save_default(); - gfx_invalidate_screen(); - break; - case WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM: - gConfigGeneral.allow_loading_with_incorrect_checksum = !gConfigGeneral.allow_loading_with_incorrect_checksum; - config_save_default(); - w->Invalidate(); - break; - case WIDX_SAVE_PLUGIN_DATA_CHECKBOX: - gConfigGeneral.save_plugin_data ^= 1; - config_save_default(); - w->Invalidate(); - break; - case WIDX_STAY_CONNECTED_AFTER_DESYNC: - gConfigNetwork.stay_connected = !gConfigNetwork.stay_connected; - config_save_default(); - w->Invalidate(); - break; - case WIDX_ALWAYS_NATIVE_LOADSAVE: - gConfigGeneral.use_native_browse_dialog = !gConfigGeneral.use_native_browse_dialog; - config_save_default(); - w->Invalidate(); - break; - case WIDX_PATH_TO_RCT1_BUTTON: - { - utf8string rct1path = platform_open_directory_browser(language_get_string(STR_PATH_TO_RCT1_BROWSER)); - if (rct1path != nullptr) - { - // Check if this directory actually contains RCT1 - if (Csg1datPresentAtLocation(rct1path)) + this->UpdateHeightMarkers(); + break; + case WIDX_CURRENCY_DROPDOWN: + if (dropdownIndex == EnumValue(CurrencyType::Custom) + 1) + { // Add 1 because the separator occupies a position + gConfigGeneral.currency_format = static_cast(dropdownIndex - 1); + context_open_window(WC_CUSTOM_CURRENCY_CONFIG); + } + else { - if (Csg1idatPresentAtLocation(rct1path)) + gConfigGeneral.currency_format = static_cast(dropdownIndex); + } + config_save_default(); + gfx_invalidate_screen(); + break; + case WIDX_DISTANCE_DROPDOWN: + gConfigGeneral.measurement_format = static_cast(dropdownIndex); + config_save_default(); + this->UpdateHeightMarkers(); + break; + case WIDX_TEMPERATURE_DROPDOWN: + if (dropdownIndex != static_cast(gConfigGeneral.temperature_format)) + { + gConfigGeneral.temperature_format = static_cast(dropdownIndex); + config_save_default(); + gfx_invalidate_screen(); + } + break; + case WIDX_LANGUAGE_DROPDOWN: + { + auto fallbackLanguage = LocalisationService_GetCurrentLanguage(); + if (dropdownIndex != LocalisationService_GetCurrentLanguage() - 1) + { + if (!language_open(dropdownIndex + 1)) { - if (CsgAtLocationIsUsable(rct1path)) + // Failed to open language file, try to recover by falling + // back to previously used language + if (language_open(fallbackLanguage)) { - SafeFree(gConfigGeneral.rct1_path); - gConfigGeneral.rct1_path = rct1path; - gConfigInterface.scenarioselect_last_tab = 0; - config_save_default(); - context_show_error(STR_RESTART_REQUIRED, STR_NONE, {}); + // It worked, so we can say it with error message in-game + context_show_error(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); + } + // report error to console regardless + log_error("Failed to open language file."); + } + else + { + gConfigGeneral.language = dropdownIndex + 1; + config_save_default(); + gfx_invalidate_screen(); + } + } + } + break; + case WIDX_DATE_FORMAT_DROPDOWN: + if (dropdownIndex != gConfigGeneral.date_format) + { + gConfigGeneral.date_format = static_cast(dropdownIndex); + config_save_default(); + gfx_invalidate_screen(); + } + break; + } + } + + void CulturePrepareDraw() + { + this->CommonPrepareDrawBefore(); + + // Language + auto ft = Formatter::Common(); + ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); + + // Currency: pounds, dollars, etc. (10 total) + this->widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)].stringId; + + // Distance: metric / imperial / si + { + rct_string_id stringId = STR_NONE; + switch (gConfigGeneral.measurement_format) + { + case MeasurementFormat::Imperial: + stringId = STR_IMPERIAL; + break; + case MeasurementFormat::Metric: + stringId = STR_METRIC; + break; + case MeasurementFormat::SI: + stringId = STR_SI; + break; + } + this->widgets[WIDX_DISTANCE].text = stringId; + } + + // Date format + this->widgets[WIDX_DATE_FORMAT].text = DateFormatStringIds[gConfigGeneral.date_format]; + + // Temperature: celsius/fahrenheit + this->widgets[WIDX_TEMPERATURE].text = gConfigGeneral.temperature_format == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT + : STR_CELSIUS; + + // Height: units/real values + this->widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.show_height_as_units ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; + + this->CommonPrepareDrawAfter(); + } + + void CultureDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_LANGUAGE].top + 1 }, STR_OPTIONS_LANGUAGE, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_CURRENCY].top + 1 }, STR_CURRENCY, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_DISTANCE].top + 1 }, STR_DISTANCE_AND_SPEED, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_TEMPERATURE].top + 1 }, STR_TEMPERATURE, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_HEIGHT_LABELS].top + 1 }, STR_HEIGHT_LABELS, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_DATE_FORMAT].top + 1 }, STR_DATE_FORMAT, {}, + { this->colours[1] }); + } + +#pragma endregion + +#pragma region Audio tab events + void AudioMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_SOUND_CHECKBOX: + gConfigSound.sound_enabled = !gConfigSound.sound_enabled; + config_save_default(); + this->Invalidate(); + break; + + case WIDX_MASTER_SOUND_CHECKBOX: + gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; + if (!gConfigSound.master_sound_enabled) + OpenRCT2::Audio::Pause(); + else + OpenRCT2::Audio::Resume(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + config_save_default(); + this->Invalidate(); + break; + + case WIDX_MUSIC_CHECKBOX: + gConfigSound.ride_music_enabled = !gConfigSound.ride_music_enabled; + if (!gConfigSound.ride_music_enabled) + { + OpenRCT2::RideAudio::StopAllChannels(); + } + config_save_default(); + this->Invalidate(); + break; + + case WIDX_AUDIO_FOCUS_CHECKBOX: + gConfigSound.audio_focus = !gConfigSound.audio_focus; + config_save_default(); + this->Invalidate(); + break; + } + } + + void AudioMouseDown(rct_widgetindex widgetIndex) + { + rct_widget* widget = &this->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++) + { + gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItemsArgs[i] = reinterpret_cast(OpenRCT2::Audio::GetDeviceName(i).c_str()); + } + + this->ShowDropdown(widget, OpenRCT2::Audio::GetDeviceCount()); + + Dropdown::SetChecked(OpenRCT2::Audio::GetCurrentDeviceIndex(), true); + break; + case WIDX_TITLE_MUSIC_DROPDOWN: + uint32_t numItems = 4; + + for (size_t i = 0; i < numItems; i++) + { + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = window_options_title_music_names[i]; + } + + this->ShowDropdown(widget, numItems); + + Dropdown::SetChecked(gConfigSound.title_music, true); + break; + } + } + + void AudioDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_SOUND_DROPDOWN: + OpenRCT2::Audio::InitRideSounds(dropdownIndex); + if (dropdownIndex < OpenRCT2::Audio::GetDeviceCount()) + { + if (dropdownIndex == 0) + { + Mixer_Init(nullptr); + gConfigSound.device = nullptr; + } + else + { + const char* devicename = OpenRCT2::Audio::GetDeviceName(dropdownIndex).c_str(); + Mixer_Init(devicename); + SafeFree(gConfigSound.device); + gConfigSound.device = strndup(devicename, OpenRCT2::Audio::MaxDeviceNameSize); + } + config_save_default(); + OpenRCT2::Audio::PlayTitleMusic(); + } + this->Invalidate(); + break; + case WIDX_TITLE_MUSIC_DROPDOWN: + if ((dropdownIndex == 1 || dropdownIndex == 3) && !Platform::FileExists(context_get_path_legacy(PATH_ID_CSS50))) + { + context_show_error(STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND, STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND_HINT, {}); + } + else + { + gConfigSound.title_music = static_cast(dropdownIndex); + config_save_default(); + this->Invalidate(); + } + + OpenRCT2::Audio::StopTitleMusic(); + if (dropdownIndex != 0) + OpenRCT2::Audio::PlayTitleMusic(); + break; + } + } + + void AudioUpdate() + { + const auto& masterVolumeWidget = this->widgets[WIDX_MASTER_VOLUME]; + const auto& masterVolumeScroll = this->scrolls[0]; + uint8_t masterVolume = this->GetScrollPercentage(masterVolumeWidget, masterVolumeScroll); + if (masterVolume != gConfigSound.master_volume) + { + gConfigSound.master_volume = masterVolume; + config_save_default(); + widget_invalidate(this, WIDX_MASTER_VOLUME); + } + + const auto& soundVolumeWidget = this->widgets[WIDX_MASTER_VOLUME]; + const auto& soundVolumeScroll = this->scrolls[1]; + uint8_t soundVolume = this->GetScrollPercentage(soundVolumeWidget, soundVolumeScroll); + if (soundVolume != gConfigSound.sound_volume) + { + gConfigSound.sound_volume = soundVolume; + config_save_default(); + widget_invalidate(this, WIDX_SOUND_VOLUME); + } + + const auto& musicVolumeWidget = this->widgets[WIDX_MASTER_VOLUME]; + const auto& musicVolumeScroll = this->scrolls[2]; + uint8_t rideMusicVolume = this->GetScrollPercentage(musicVolumeWidget, musicVolumeScroll); + if (rideMusicVolume != gConfigSound.ride_music_volume) + { + gConfigSound.ride_music_volume = rideMusicVolume; + config_save_default(); + widget_invalidate(this, WIDX_MUSIC_VOLUME); + } + } + + ScreenSize AudioScrollGetSize(int32_t scrollIndex) + { + return { 500, 0 }; + } + + void AudioPrepareDraw() + { + this->CommonPrepareDrawBefore(); + + // Sound device + rct_string_id audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; + const char* audioDeviceName = nullptr; + const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); + if (currentDeviceIndex == -1) + { + audioDeviceStringId = STR_SOUND_NONE; + } + else + { + audioDeviceStringId = STR_STRING; +#ifndef __linux__ + if (currentDeviceIndex == 0) + { + audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; + } +#endif // __linux__ + if (audioDeviceStringId == STR_STRING) + { + audioDeviceName = OpenRCT2::Audio::GetDeviceName(currentDeviceIndex).c_str(); + } + } + + this->widgets[WIDX_SOUND].text = audioDeviceStringId; + auto ft = Formatter::Common(); + ft.Add(audioDeviceName); + + this->widgets[WIDX_TITLE_MUSIC].text = window_options_title_music_names[gConfigSound.title_music]; + + WidgetSetCheckboxValue(this, WIDX_SOUND_CHECKBOX, gConfigSound.sound_enabled); + WidgetSetCheckboxValue(this, WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); + WidgetSetCheckboxValue(this, WIDX_MUSIC_CHECKBOX, gConfigSound.ride_music_enabled); + WidgetSetCheckboxValue(this, WIDX_AUDIO_FOCUS_CHECKBOX, gConfigSound.audio_focus); + WidgetSetEnabled(this, WIDX_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); + WidgetSetEnabled(this, WIDX_MUSIC_CHECKBOX, gConfigSound.master_sound_enabled); + + // Initialize only on first frame, otherwise the scrollbars won't be able to be modified + if (this->frame_no == 0) + { + this->InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, gConfigSound.master_volume); + this->InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, gConfigSound.sound_volume); + this->InitializeScrollPosition(WIDX_MUSIC_VOLUME, 2, gConfigSound.ride_music_volume); + } + + this->CommonPrepareDrawAfter(); + } + + void AudioDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + } + +#pragma endregion + +#pragma region Controls tab events + void ControlsMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_HOTKEY_DROPDOWN: + context_open_window(WC_KEYBOARD_SHORTCUT_LIST); + break; + case WIDX_SCREEN_EDGE_SCROLLING: + gConfigGeneral.edge_scrolling ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_TRAP_CURSOR: + gConfigGeneral.trap_cursor ^= 1; + config_save_default(); + context_set_cursor_trap(gConfigGeneral.trap_cursor); + this->Invalidate(); + break; + case WIDX_ZOOM_TO_CURSOR: + gConfigGeneral.zoom_to_cursor ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_TOOLBAR_SHOW_FINANCES: + gConfigInterface.toolbar_show_finances ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_RESEARCH: + gConfigInterface.toolbar_show_research ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_CHEATS: + gConfigInterface.toolbar_show_cheats ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_NEWS: + gConfigInterface.toolbar_show_news ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_MUTE: + gConfigInterface.toolbar_show_mute ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_CHAT: + gConfigInterface.toolbar_show_chat ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_TOOLBAR_SHOW_ZOOM: + gConfigInterface.toolbar_show_zoom ^= 1; + config_save_default(); + this->Invalidate(); + window_invalidate_by_class(WC_TOP_TOOLBAR); + break; + case WIDX_INVERT_DRAG: + gConfigGeneral.invert_viewport_drag ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_THEMES_BUTTON: + context_open_window(WC_THEMES); + this->Invalidate(); + break; + } + } + + void ControlsMouseDown(rct_widgetindex widgetIndex) + { + rct_widget* widget = &this->widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_THEMES_DROPDOWN: + uint32_t numItems = static_cast(ThemeManagerGetNumAvailableThemes()); + + for (size_t i = 0; i < numItems; i++) + { + gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItemsArgs[i] = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); + } + + WindowDropdownShowTextCustomWidth( + { this->windowPos.x + widget->left, this->windowPos.y + widget->top }, widget->height() + 1, + this->colours[1], 0, Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + + Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); + widget_invalidate(this, WIDX_THEMES_DROPDOWN); + break; + } + } + + void ControlsDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_THEMES_DROPDOWN: + if (dropdownIndex != -1) + { + ThemeManagerSetActiveAvailableTheme(dropdownIndex); + } + config_save_default(); + break; + } + } + + void ControlsPrepareDraw() + { + this->CommonPrepareDrawBefore(); + + WidgetSetCheckboxValue(this, WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.edge_scrolling); + WidgetSetCheckboxValue(this, WIDX_TRAP_CURSOR, gConfigGeneral.trap_cursor); + WidgetSetCheckboxValue(this, WIDX_INVERT_DRAG, gConfigGeneral.invert_viewport_drag); + WidgetSetCheckboxValue(this, WIDX_ZOOM_TO_CURSOR, gConfigGeneral.zoom_to_cursor); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.toolbar_show_finances); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.toolbar_show_research); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.toolbar_show_cheats); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.toolbar_show_news); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.toolbar_show_mute); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.toolbar_show_chat); + WidgetSetCheckboxValue(this, WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.toolbar_show_zoom); + + size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); + const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); + auto ft = Formatter::Common(); + ft.Add(activeThemeName); + + this->CommonPrepareDrawAfter(); + } + + void ControlsDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_TOOLBAR_BUTTONS_GROUP].top + 15 }, + STR_SHOW_TOOLBAR_BUTTONS_FOR, {}, { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_THEMES].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, {}, + { this->colours[1] }); + } + +#pragma endregion + +#pragma region Misc tab events + void MiscMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_REAL_NAME_CHECKBOX: + gConfigGeneral.show_real_names_of_guests ^= 1; + config_save_default(); + this->Invalidate(); + peep_update_names(gConfigGeneral.show_real_names_of_guests); + break; + case WIDX_AUTO_STAFF_PLACEMENT: + gConfigGeneral.auto_staff_placement ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_TITLE_SEQUENCE_BUTTON: + window_title_editor_open(0); + break; + case WIDX_SCENARIO_UNLOCKING: + gConfigGeneral.scenario_unlocking_enabled ^= 1; + config_save_default(); + window_close_by_class(WC_SCENARIO_SELECT); + break; + case WIDX_TITLE_SEQUENCE_RANDOM: + gConfigInterface.random_title_sequence ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_AUTO_OPEN_SHOPS: + gConfigGeneral.auto_open_shops = !gConfigGeneral.auto_open_shops; + config_save_default(); + this->Invalidate(); + break; + case WIDX_ALLOW_EARLY_COMPLETION: + gConfigGeneral.allow_early_completion ^= 1; + // Only the server can control this setting and needs to send the + // current value of allow_early_completion to all clients + if (network_get_mode() == NETWORK_MODE_SERVER) + { + auto setAllowEarlyCompletionAction = ScenarioSetSettingAction( + ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.allow_early_completion); + GameActions::Execute(&setAllowEarlyCompletionAction); + } + config_save_default(); + this->Invalidate(); + break; + } + } + + void MiscMouseDown(rct_widgetindex widgetIndex) + { + rct_widget* widget = &this->widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_TITLE_SEQUENCE_DROPDOWN: + { + uint32_t numItems = static_cast(title_sequence_manager_get_count()); + for (size_t i = 0; i < numItems; i++) + { + gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItemsArgs[i] = reinterpret_cast(title_sequence_manager_get_name(i)); + } + + WindowDropdownShowText( + { this->windowPos.x + widget->left, this->windowPos.y + widget->top }, widget->height() + 1, + this->colours[1], Dropdown::Flag::StayOpen, numItems); + + Dropdown::SetChecked(static_cast(title_get_current_sequence()), true); + break; + } + case WIDX_SCENARIO_GROUPING_DROPDOWN: + { + uint32_t numItems = 2; + + gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[0] = STR_OPTIONS_SCENARIO_DIFFICULTY; + gDropdownItemsFormat[1] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[1] = STR_OPTIONS_SCENARIO_ORIGIN; + + WindowDropdownShowTextCustomWidth( + { this->windowPos.x + widget->left, this->windowPos.y + widget->top }, widget->height() + 1, + this->colours[1], 0, Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + + Dropdown::SetChecked(gConfigGeneral.scenario_select_mode, true); + break; + } + case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: + for (size_t i = 0; i < 7; i++) + { + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = RideInspectionIntervalNames[i]; + } + + this->ShowDropdown(widget, 7); + Dropdown::SetChecked(gConfigGeneral.default_inspection_interval, true); + break; + } + } + + void MiscDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_TITLE_SEQUENCE_DROPDOWN: + if (dropdownIndex != static_cast(title_get_current_sequence())) + { + title_sequence_change_preset(static_cast(dropdownIndex)); + config_save_default(); + this->Invalidate(); + } + break; + case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: + if (dropdownIndex != gConfigGeneral.default_inspection_interval) + { + gConfigGeneral.default_inspection_interval = static_cast(dropdownIndex); + config_save_default(); + this->Invalidate(); + } + break; + case WIDX_SCENARIO_GROUPING_DROPDOWN: + if (dropdownIndex != gConfigGeneral.scenario_select_mode) + { + gConfigGeneral.scenario_select_mode = dropdownIndex; + gConfigInterface.scenarioselect_last_tab = 0; + config_save_default(); + this->Invalidate(); + window_close_by_class(WC_SCENARIO_SELECT); + } + break; + } + } + + void MiscPrepareDraw() + { + this->CommonPrepareDrawBefore(); + + const utf8* name = title_sequence_manager_get_name(title_get_config_sequence()); + auto ft = Formatter::Common(); + 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 (network_get_mode() != NETWORK_MODE_NONE) + { + this->disabled_widgets |= (1ULL << WIDX_REAL_NAME_CHECKBOX); + this->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 (network_get_mode() == NETWORK_MODE_CLIENT) + { + this->disabled_widgets |= (1ULL << WIDX_ALLOW_EARLY_COMPLETION); + this->widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; + } + } + + WidgetSetCheckboxValue(this, WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.show_real_names_of_guests); + WidgetSetCheckboxValue(this, WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.auto_staff_placement); + WidgetSetCheckboxValue(this, WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.auto_open_shops); + WidgetSetCheckboxValue(this, WIDX_TITLE_SEQUENCE_RANDOM, gConfigInterface.random_title_sequence); + WidgetSetCheckboxValue(this, WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.allow_early_completion); + + // Disable title sequence dropdown if set to random + if (gConfigInterface.random_title_sequence) + { + this->disabled_widgets |= (1ULL << WIDX_TITLE_SEQUENCE_DROPDOWN); + this->disabled_widgets |= (1ULL << WIDX_TITLE_SEQUENCE); + } + else + { + this->disabled_widgets &= ~(1ULL << WIDX_TITLE_SEQUENCE_DROPDOWN); + this->disabled_widgets &= ~(1ULL << WIDX_TITLE_SEQUENCE); + } + + if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_DIFFICULTY) + this->widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_DIFFICULTY; + else + this->widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_ORIGIN; + + WidgetSetCheckboxValue(this, WIDX_SCENARIO_UNLOCKING, gConfigGeneral.scenario_unlocking_enabled); + + if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN) + { + this->disabled_widgets &= ~(1ULL << WIDX_SCENARIO_UNLOCKING); + } + else + { + this->disabled_widgets |= (1ULL << WIDX_SCENARIO_UNLOCKING); + } + + this->widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[gConfigGeneral + .default_inspection_interval]; + + this->CommonPrepareDrawAfter(); + } + + void MiscDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); + + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_TITLE_SEQUENCE].top + 1 }, STR_TITLE_SEQUENCE, {}, + { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_SCENARIO_GROUPING].top + 1 }, + STR_OPTIONS_SCENARIO_GROUPING, {}, { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 10, this->widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1 }, + STR_DEFAULT_INSPECTION_INTERVAL, {}, { this->colours[1] }); + } + +#pragma endregion + +#pragma region Advanced tab events + void AdvancedMouseUp(rct_widgetindex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_DEBUGGING_TOOLS: + gConfigGeneral.debugging_tools ^= 1; + config_save_default(); + gfx_invalidate_screen(); + break; + case WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM: + gConfigGeneral.allow_loading_with_incorrect_checksum = !gConfigGeneral.allow_loading_with_incorrect_checksum; + config_save_default(); + this->Invalidate(); + break; + case WIDX_SAVE_PLUGIN_DATA_CHECKBOX: + gConfigGeneral.save_plugin_data ^= 1; + config_save_default(); + this->Invalidate(); + break; + case WIDX_STAY_CONNECTED_AFTER_DESYNC: + gConfigNetwork.stay_connected = !gConfigNetwork.stay_connected; + config_save_default(); + this->Invalidate(); + break; + case WIDX_ALWAYS_NATIVE_LOADSAVE: + gConfigGeneral.use_native_browse_dialog = !gConfigGeneral.use_native_browse_dialog; + config_save_default(); + this->Invalidate(); + break; + case WIDX_PATH_TO_RCT1_BUTTON: + { + utf8string rct1path = platform_open_directory_browser(language_get_string(STR_PATH_TO_RCT1_BROWSER)); + if (rct1path != nullptr) + { + // Check if this directory actually contains RCT1 + if (Csg1datPresentAtLocation(rct1path)) + { + if (Csg1idatPresentAtLocation(rct1path)) + { + if (CsgAtLocationIsUsable(rct1path)) + { + SafeFree(gConfigGeneral.rct1_path); + gConfigGeneral.rct1_path = rct1path; + gConfigInterface.scenarioselect_last_tab = 0; + config_save_default(); + context_show_error(STR_RESTART_REQUIRED, STR_NONE, {}); + } + else + { + SafeFree(rct1path); + context_show_error(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + } } else { SafeFree(rct1path); - context_show_error(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + context_show_error(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); } } else { SafeFree(rct1path); - context_show_error(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); + context_show_error(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); } } - else + this->Invalidate(); + break; + } + case WIDX_PATH_TO_RCT1_CLEAR: + if (!str_is_null_or_empty(gConfigGeneral.rct1_path)) { - SafeFree(rct1path); - context_show_error(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); + SafeFree(gConfigGeneral.rct1_path); + config_save_default(); } - } - w->Invalidate(); - break; + this->Invalidate(); + break; } - case WIDX_PATH_TO_RCT1_CLEAR: - if (!str_is_null_or_empty(gConfigGeneral.rct1_path)) - { - SafeFree(gConfigGeneral.rct1_path); - config_save_default(); - } - w->Invalidate(); - break; } -} -static void window_options_advanced_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) -{ - widget = &w->widgets[widgetIndex - 1]; - - switch (widgetIndex) + void AdvancedMouseDown(rct_widgetindex widgetIndex) { - case WIDX_AUTOSAVE_DROPDOWN: - for (size_t i = AUTOSAVE_EVERY_MINUTE; i <= AUTOSAVE_NEVER; i++) - { - gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; - gDropdownItemsArgs[i] = window_options_autosave_names[i]; - } + rct_widget* widget = &this->widgets[widgetIndex - 1]; - window_options_show_dropdown(w, widget, AUTOSAVE_NEVER + 1); - Dropdown::SetChecked(gConfigGeneral.autosave_frequency, true); - break; - case WIDX_AUTOSAVE_AMOUNT_UP: - gConfigGeneral.autosave_amount += 1; - config_save_default(); - widget_invalidate(w, WIDX_AUTOSAVE); - widget_invalidate(w, WIDX_AUTOSAVE_DROPDOWN); - widget_invalidate(w, WIDX_AUTOSAVE_AMOUNT); - break; - case WIDX_AUTOSAVE_AMOUNT_DOWN: - if (gConfigGeneral.autosave_amount > 1) - { - gConfigGeneral.autosave_amount -= 1; - config_save_default(); - widget_invalidate(w, WIDX_AUTOSAVE); - widget_invalidate(w, WIDX_AUTOSAVE_DROPDOWN); - widget_invalidate(w, WIDX_AUTOSAVE_AMOUNT); - } - } -} - -static void window_options_advanced_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_AUTOSAVE_DROPDOWN: - if (dropdownIndex != gConfigGeneral.autosave_frequency) - { - gConfigGeneral.autosave_frequency = static_cast(dropdownIndex); - config_save_default(); - w->Invalidate(); - } - break; - } -} - -static void window_options_advanced_invalidate(rct_window* w) -{ - window_options_common_invalidate_before(w); - - WidgetSetCheckboxValue(w, WIDX_DEBUGGING_TOOLS, gConfigGeneral.debugging_tools); - WidgetSetCheckboxValue(w, WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM, gConfigGeneral.allow_loading_with_incorrect_checksum); - WidgetSetCheckboxValue(w, WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.save_plugin_data); - WidgetSetCheckboxValue(w, WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.stay_connected); - WidgetSetCheckboxValue(w, WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.use_native_browse_dialog); - - window_options_common_invalidate_after(w); -} - -static void window_options_advanced_paint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(w, dpi); - window_options_draw_tab_images(dpi, w); - - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE].top + 1 }, - STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, {}, { w->colours[1] }); - DrawTextBasic( - dpi, - w->windowPos - + ScreenCoordsXY{ window_options_advanced_widgets[WIDX_AUTOSAVE].left + 1, - window_options_advanced_widgets[WIDX_AUTOSAVE].top }, - window_options_autosave_names[gConfigGeneral.autosave_frequency], {}, { w->colours[1] }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 24, window_options_advanced_widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_AUTOSAVE_AMOUNT, {}, { w->colours[1] }); - auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.autosave_amount)); - DrawTextBasic( - dpi, - w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, w->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, ft, { w->colours[1] }); - - ft = Formatter(); - ft.Add(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path)); - - rct_widget pathWidget = window_options_advanced_widgets[WIDX_PATH_TO_RCT1_BUTTON]; - - // Apply vertical alignment if appropriate. - int32_t widgetHeight = pathWidget.bottom - pathWidget.top; - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); - uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; - ScreenCoordsXY screenCoords = { w->windowPos.x + pathWidget.left + 1, - w->windowPos.y + pathWidget.top + static_cast(padding) }; - DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { w->colours[1] }); -} - -static OpenRCT2String window_options_advanced_tooltip( - rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback) -{ - if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) - { - if (str_is_null_or_empty(gConfigGeneral.rct1_path)) + switch (widgetIndex) { - // No tooltip if the path is empty - return { STR_NONE, {} }; + case WIDX_AUTOSAVE_DROPDOWN: + for (size_t i = AUTOSAVE_EVERY_MINUTE; i <= AUTOSAVE_NEVER; i++) + { + gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL; + gDropdownItemsArgs[i] = window_options_autosave_names[i]; + } + + this->ShowDropdown(widget, AUTOSAVE_NEVER + 1); + Dropdown::SetChecked(gConfigGeneral.autosave_frequency, true); + break; + case WIDX_AUTOSAVE_AMOUNT_UP: + gConfigGeneral.autosave_amount += 1; + config_save_default(); + widget_invalidate(this, WIDX_AUTOSAVE); + widget_invalidate(this, WIDX_AUTOSAVE_DROPDOWN); + widget_invalidate(this, WIDX_AUTOSAVE_AMOUNT); + break; + case WIDX_AUTOSAVE_AMOUNT_DOWN: + if (gConfigGeneral.autosave_amount > 1) + { + gConfigGeneral.autosave_amount -= 1; + config_save_default(); + widget_invalidate(this, WIDX_AUTOSAVE); + widget_invalidate(this, WIDX_AUTOSAVE_DROPDOWN); + widget_invalidate(this, WIDX_AUTOSAVE_AMOUNT); + } } - - auto ft = Formatter(); - ft.Add(gConfigGeneral.rct1_path); - return { fallback, ft }; } - return { fallback, {} }; -} -#pragma region Event lists + void AdvancedDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; -static rct_window_event_list window_options_events_display([](auto& events) { - events.mouse_up = &window_options_display_mouseup; - events.mouse_down = &window_options_display_mousedown; - events.dropdown = &window_options_display_dropdown; - events.update = &window_options_common_update; - events.invalidate = &window_options_display_invalidate; - events.paint = &window_options_display_paint; -}); + switch (widgetIndex) + { + case WIDX_AUTOSAVE_DROPDOWN: + if (dropdownIndex != gConfigGeneral.autosave_frequency) + { + gConfigGeneral.autosave_frequency = static_cast(dropdownIndex); + config_save_default(); + this->Invalidate(); + } + break; + } + } -static rct_window_event_list window_options_events_rendering([](auto& events) { - events.mouse_up = &window_options_rendering_mouseup; - events.mouse_down = &window_options_rendering_mousedown; - events.dropdown = &window_options_rendering_dropdown; - events.update = &window_options_common_update; - events.invalidate = &window_options_rendering_invalidate; - events.paint = &window_options_rendering_paint; -}); + void AdvancedPrepareDraw() + { + this->CommonPrepareDrawBefore(); -static rct_window_event_list window_options_events_culture([](auto& events) { - events.mouse_up = &window_options_culture_mouseup; - events.mouse_down = &window_options_culture_mousedown; - events.dropdown = &window_options_culture_dropdown; - events.update = &window_options_common_update; - events.invalidate = &window_options_culture_invalidate; - events.paint = &window_options_culture_paint; -}); + WidgetSetCheckboxValue(this, WIDX_DEBUGGING_TOOLS, gConfigGeneral.debugging_tools); + WidgetSetCheckboxValue( + this, WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM, gConfigGeneral.allow_loading_with_incorrect_checksum); + WidgetSetCheckboxValue(this, WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.save_plugin_data); + WidgetSetCheckboxValue(this, WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.stay_connected); + WidgetSetCheckboxValue(this, WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.use_native_browse_dialog); -static rct_window_event_list window_options_events_audio([](auto& events) { - events.mouse_up = &window_options_audio_mouseup; - events.mouse_down = &window_options_audio_mousedown; - events.dropdown = &window_options_audio_dropdown; - events.update = &window_options_audio_update; - events.get_scroll_size = &window_options_audio_scrollgetsize; - events.invalidate = &window_options_audio_invalidate; - events.paint = &window_options_audio_paint; -}); + this->CommonPrepareDrawAfter(); + } -static rct_window_event_list window_options_events_controls([](auto& events) { - events.mouse_up = &window_options_controls_mouseup; - events.mouse_down = &window_options_controls_mousedown; - events.dropdown = &window_options_controls_dropdown; - events.update = &window_options_common_update; - events.invalidate = &window_options_controls_invalidate; - events.paint = &window_options_controls_paint; -}); + void AdvancedDraw(rct_drawpixelinfo* dpi) + { + WindowDrawWidgets(this, dpi); + this->DrawTabImages(dpi); -static rct_window_event_list window_options_events_misc([](auto& events) { - events.mouse_up = &window_options_misc_mouseup; - events.mouse_down = &window_options_misc_mousedown; - events.dropdown = &window_options_misc_dropdown; - events.update = &window_options_common_update; - events.invalidate = &window_options_misc_invalidate; - events.paint = &window_options_misc_paint; -}); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 24, this->widgets[WIDX_AUTOSAVE].top + 1 }, + STR_OPTIONS_AUTOSAVE_FREQUENCY_LABEL, {}, { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ this->widgets[WIDX_AUTOSAVE].left + 1, this->widgets[WIDX_AUTOSAVE].top }, + window_options_autosave_names[gConfigGeneral.autosave_frequency], {}, { this->colours[1] }); + DrawTextBasic( + dpi, this->windowPos + ScreenCoordsXY{ 24, this->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, STR_AUTOSAVE_AMOUNT, {}, + { this->colours[1] }); + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.autosave_amount)); + DrawTextBasic( + dpi, + this->windowPos + + ScreenCoordsXY{ this->widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, this->widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, + STR_WINDOW_OBJECTIVE_VALUE_GUEST_COUNT, ft, { this->colours[1] }); -static rct_window_event_list window_options_events_advanced([](auto& events) { - events.mouse_up = &window_options_advanced_mouseup; - events.mouse_down = &window_options_advanced_mousedown; - events.dropdown = &window_options_advanced_dropdown; - events.update = &window_options_common_update; - events.tooltip = &window_options_advanced_tooltip; - events.invalidate = &window_options_advanced_invalidate; - events.paint = &window_options_advanced_paint; -}); + ft = Formatter(); + ft.Add(Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path)); -// clang-format off -static rct_window_event_list* window_options_event_lists[] = { - &window_options_events_display, - &window_options_events_rendering, - &window_options_events_culture, - &window_options_events_audio, - &window_options_events_controls, - &window_options_events_misc, - &window_options_events_advanced, + rct_widget pathWidget = this->widgets[WIDX_PATH_TO_RCT1_BUTTON]; + + // Apply vertical alignment if appropriate. + int32_t widgetHeight = pathWidget.bottom - pathWidget.top; + int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; + ScreenCoordsXY screenCoords = { this->windowPos.x + pathWidget.left + 1, + this->windowPos.y + pathWidget.top + static_cast(padding) }; + DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { this->colours[1] }); + } + + OpenRCT2String AdvancedTooltip(rct_widgetindex widgetIndex, rct_string_id fallback) + { + if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) + { + if (str_is_null_or_empty(gConfigGeneral.rct1_path)) + { + // No tooltip if the path is empty + return { STR_NONE, {} }; + } + + auto ft = Formatter(); + ft.Add(gConfigGeneral.rct1_path); + return { fallback, ft }; + } + return { fallback, {} }; + } + +#pragma endregion + + void SetPage(int32_t p) + { + this->page = p; + this->frame_no = 0; + this->enabled_widgets = window_options_page_enabled_widgets[this->page]; + this->pressed_widgets = 0; + this->widgets = window_options_page_widgets[this->page]; + + this->Invalidate(); + window_event_resize_call(this); + window_event_invalidate_call(this); + WindowInitScrollWidgets(this); + this->Invalidate(); + } + + void SetPressedTab() + { + for (int32_t i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++) + this->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + this->pressed_widgets |= 1LL << (WIDX_TAB_1 + this->page); + } + + void ShowDropdown(rct_widget* widget, int32_t num_items) + { + // helper function, all dropdown boxes have similar properties + WindowDropdownShowTextCustomWidth( + { this->windowPos.x + widget->left, this->windowPos.y + widget->top }, widget->height() + 1, this->colours[1], 0, + Dropdown::Flag::StayOpen, num_items, widget->width() - 3); + } + + void DrawTabImages(rct_drawpixelinfo* dpi) + { + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_TAB_PAINT_0); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CULTURE, SPR_TAB_TIMER_0); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_AUDIO, SPR_TAB_MUSIC_0); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, SPR_TAB_GEARS_0); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_MISC, SPR_TAB_RIDE_0); + this->DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0); + } + + void DrawTabImage(rct_drawpixelinfo* dpi, int32_t p, int32_t spriteIndex) + { + rct_widgetindex widgetIndex = WIDX_TAB_1 + p; + rct_widget* widget = &this->widgets[widgetIndex]; + + auto screenCoords = this->windowPos + ScreenCoordsXY{ widget->left, widget->top }; + + if (!(this->disabled_widgets & (1LL << widgetIndex))) + { + if (this->page == p) + { + int32_t frame = this->frame_no / window_options_tab_animation_divisor[this->page]; + spriteIndex += (frame % window_options_tab_animation_frames[this->page]); + } + + // Draw normal, enabled sprite. + gfx_draw_sprite(dpi, ImageId(spriteIndex), screenCoords); + } + else + { + // Get the window background colour + uint8_t window_colour = NOT_TRANSLUCENT(this->colours[widget->colour]); + + // Draw greyed out (light border bottom right shadow) + gfx_draw_sprite_solid(dpi, spriteIndex, screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); + + // Draw greyed out (dark) + gfx_draw_sprite_solid(dpi, spriteIndex, screenCoords, ColourMapA[window_colour].mid_light); + } + } + + void UpdateHeightMarkers() + { + config_save_default(); + gfx_invalidate_screen(); + } + + uint8_t GetScrollPercentage(const rct_widget& widget, const rct_scroll& scroll) + { + uint8_t w = widget.width() - 1; + return static_cast(scroll.h_left) / (scroll.h_right - w) * 100; + } + + void InitializeScrollPosition(rct_widgetindex widgetIndex, int32_t scrollId, uint8_t volume) + { + const auto& widget = this->widgets[widgetIndex]; + auto& scroll = this->scrolls[scrollId]; + + int32_t widgetSize = scroll.h_right - (widget.width() - 1); + scroll.h_left = ceil(volume / 100.0f * widgetSize); + + WidgetScrollUpdateThumbs(this, widgetIndex); + } }; + // clang-format on - -#pragma region Common - /** * * rct2: 0x006BAC5B */ rct_window* window_options_open() { - rct_window* w; - - // Check if window is already open - w = window_bring_to_front_by_class(WC_OPTIONS); - if (w != nullptr) - return w; - - w = WindowCreateCentred(WW, WH, &window_options_events_display, WC_OPTIONS, 0); - w->widgets = window_options_display_widgets; - w->enabled_widgets = window_options_page_enabled_widgets[WINDOW_OPTIONS_PAGE_DISPLAY]; - w->page = WINDOW_OPTIONS_PAGE_DISPLAY; - w->frame_no = 0; - WindowInitScrollWidgets(w); - - return w; -} - -static void window_options_set_page(rct_window* w, int32_t page) -{ - w->page = page; - w->frame_no = 0; - w->event_handlers = window_options_event_lists[page]; - w->enabled_widgets = window_options_page_enabled_widgets[page]; - w->pressed_widgets = 0; - w->widgets = window_options_page_widgets[page]; - - w->Invalidate(); - window_event_resize_call(w); - window_event_invalidate_call(w); - WindowInitScrollWidgets(w); - w->Invalidate(); -} - -static void window_options_set_pressed_tab(rct_window* w) -{ - int32_t i; - for (i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++) - w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page); -} - -static void window_options_draw_tab_image(rct_drawpixelinfo* dpi, rct_window* w, int32_t page, int32_t spriteIndex) -{ - rct_widgetindex widgetIndex = WIDX_TAB_1 + page; - rct_widget* widget = &w->widgets[widgetIndex]; - - auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top }; - - if (!(w->disabled_widgets & (1LL << widgetIndex))) + auto* window = window_bring_to_front_by_class(WC_OPTIONS); + if (window == nullptr) { - if (w->page == page) - { - int32_t frame = w->frame_no / window_options_tab_animation_divisor[w->page]; - spriteIndex += (frame % window_options_tab_animation_frames[w->page]); - } - - // Draw normal, enabled sprite. - gfx_draw_sprite(dpi, ImageId(spriteIndex), screenCoords); - } - else - { - // Get the window background colour - uint8_t window_colour = NOT_TRANSLUCENT(w->colours[widget->colour]); - - // Draw greyed out (light border bottom right shadow) - gfx_draw_sprite_solid(dpi, spriteIndex, screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); - - // Draw greyed out (dark) - gfx_draw_sprite_solid(dpi, spriteIndex, screenCoords, ColourMapA[window_colour].mid_light); + window = WindowCreate(WC_OPTIONS, WW, WH, WF_CENTRE_SCREEN); } + return window; } - -static void window_options_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w) -{ - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_TAB_PAINT_0); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_CULTURE, SPR_TAB_TIMER_0); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_AUDIO, SPR_TAB_MUSIC_0); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, SPR_TAB_GEARS_0); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_MISC, SPR_TAB_RIDE_0); - window_options_draw_tab_image(dpi, w, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0); -} - -// helper function, all dropdown boxes have similar properties -static void window_options_show_dropdown(rct_window* w, rct_widget* widget, int32_t num_items) -{ - WindowDropdownShowTextCustomWidth( - { w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0, - Dropdown::Flag::StayOpen, num_items, widget->width() - 3); -} - -static void window_options_update_height_markers() -{ - config_save_default(); - gfx_invalidate_screen(); -} - -#pragma endregion From 5cf4a53b667d1eaf0e0dc0f85168c4870e72123d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Oct 2021 16:21:14 +0200 Subject: [PATCH 556/681] Make research_remove take const ref --- src/openrct2-ui/windows/EditorInventionsList.cpp | 2 +- src/openrct2/EditorObjectSelectionSession.cpp | 4 ++-- src/openrct2/management/Research.cpp | 6 +++--- src/openrct2/management/Research.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 8b8eefafcb..57ce405185 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -155,7 +155,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex) w->Invalidate(); } - research_remove(&_editorInventionsListDraggedItem); + research_remove(_editorInventionsListDraggedItem); auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented; if (beforeItem != nullptr) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 7b276dfe11..31a994bb41 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -318,7 +318,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip tmp.type = Research::EntryType::Ride; tmp.entryIndex = entryIndex; tmp.baseRideType = rideType; - research_remove(&tmp); + research_remove(tmp); } break; } @@ -327,7 +327,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip ResearchItem tmp = {}; tmp.type = Research::EntryType::Scenery; tmp.entryIndex = entryIndex; - research_remove(&tmp); + research_remove(tmp); break; } default: diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 2e201a60b5..e41fa3ec2b 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -415,12 +415,12 @@ static void research_insert_researched(ResearchItem&& item) * * rct2: 0x006857CF */ -void research_remove(ResearchItem* researchItem) +void research_remove(const ResearchItem& researchItem) { for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++) { auto& researchItem2 = *it; - if (researchItem2 == *researchItem) + if (researchItem2 == researchItem) { gResearchItemsUninvented.erase(it); return; @@ -429,7 +429,7 @@ void research_remove(ResearchItem* researchItem) for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++) { auto& researchItem2 = *it; - if (researchItem2 == *researchItem) + if (researchItem2 == researchItem) { gResearchItemsInvented.erase(it); return; diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index ba0560a031..bd827dae8e 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -176,7 +176,7 @@ void research_populate_list_random(); void research_finish_item(ResearchItem* researchItem); void research_insert(ResearchItem&& item, bool researched); -void research_remove(ResearchItem* researchItem); +void research_remove(const ResearchItem& researchItem); bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched); void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched); From eb14c426fd3ca52e2d60a7608694b173beb4520b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Oct 2021 17:01:04 +0200 Subject: [PATCH 557/681] Rename research_remove() to ResearchRemove() --- src/openrct2-ui/windows/EditorInventionsList.cpp | 2 +- src/openrct2/EditorObjectSelectionSession.cpp | 4 ++-- src/openrct2/management/Research.cpp | 2 +- src/openrct2/management/Research.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 57ce405185..da3e0e5af9 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -155,7 +155,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex) w->Invalidate(); } - research_remove(_editorInventionsListDraggedItem); + ResearchRemove(_editorInventionsListDraggedItem); auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented; if (beforeItem != nullptr) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 31a994bb41..5b071e49b2 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -318,7 +318,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip tmp.type = Research::EntryType::Ride; tmp.entryIndex = entryIndex; tmp.baseRideType = rideType; - research_remove(tmp); + ResearchRemove(tmp); } break; } @@ -327,7 +327,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip ResearchItem tmp = {}; tmp.type = Research::EntryType::Scenery; tmp.entryIndex = entryIndex; - research_remove(tmp); + ResearchRemove(tmp); break; } default: diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index e41fa3ec2b..d7d9c4944f 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -415,7 +415,7 @@ static void research_insert_researched(ResearchItem&& item) * * rct2: 0x006857CF */ -void research_remove(const ResearchItem& researchItem) +void ResearchRemove(const ResearchItem& researchItem) { for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++) { diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index bd827dae8e..3271eef7fc 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -176,7 +176,7 @@ void research_populate_list_random(); void research_finish_item(ResearchItem* researchItem); void research_insert(ResearchItem&& item, bool researched); -void research_remove(const ResearchItem& researchItem); +void ResearchRemove(const ResearchItem& researchItem); bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched); void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched); From 8682a8677e387e3e530e2c40e67b0c602e0b2ae9 Mon Sep 17 00:00:00 2001 From: Bas Date: Fri, 15 Oct 2021 21:39:58 +0200 Subject: [PATCH 558/681] Fix unable to read litter information in plugin api --- distribution/changelog.txt | 1 + distribution/openrct2.d.ts | 2 +- src/openrct2/scripting/ScriptEngine.cpp | 1 + src/openrct2/scripting/ScriptEngine.h | 2 +- src/openrct2/scripting/bindings/entity/ScLitter.cpp | 13 +++++++++---- src/openrct2/scripting/bindings/world/ScMap.cpp | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 5417294eaf..dc6858e87d 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -40,6 +40,7 @@ - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. - Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). +- Fix: [#15582] [Plugin] Litter properties return incorrect values. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 1bd55ee09c..da94ea7000 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1504,7 +1504,7 @@ declare global { /** * The tick number this entity was created. */ - creationTime: number; + creationTick: number; } type LitterType = "vomit" | diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index c90c4583e7..1e20e96a58 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -409,6 +409,7 @@ void ScriptEngine::Initialise() ScTile::Register(ctx); ScTileElement::Register(ctx); ScEntity::Register(ctx); + ScLitter::Register(ctx); ScVehicle::Register(ctx); ScPeep::Register(ctx); ScGuest::Register(ctx); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 1e0c0db23b..f954aff12c 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 37; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 38; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index df59a9b7fe..0483f7d205 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -48,10 +48,15 @@ namespace OpenRCT2::Scripting std::string ScLitter::litterType_get() const { auto* litter = GetLitter(); - auto it = LitterTypeMap.find(litter->SubType); - if (it == LitterTypeMap.end()) - return ""; - return std::string{ it->first }; + if (litter != nullptr) + { + auto it = LitterTypeMap.find(litter->SubType); + if (it != LitterTypeMap.end()) + { + return std::string{ it->first }; + } + } + return ""; } void ScLitter::litterType_set(const std::string& litterType) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index ade039e148..4276a190f2 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -122,7 +122,7 @@ namespace OpenRCT2::Scripting { for (auto sprite : EntityList()) { - result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); + result.push_back(GetObjectAsDukValue(_context, std::make_shared(sprite->sprite_index))); } } else if (type == "duck") From aff3b41feb63e34aa27516aa2d590f65ffc93648 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 16 Oct 2021 18:02:26 +0200 Subject: [PATCH 559/681] Refactor research status drawing code --- src/openrct2-ui/windows/Research.cpp | 123 +++++++++++++-------------- 1 file changed, 58 insertions(+), 65 deletions(-) diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 24ee76c84f..2801ebc474 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -291,61 +291,58 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp if (gResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) { - { - auto ft = Formatter(); - ft.Add(STR_RESEARCH_UNKNOWN); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); - screenCoords.y += 25; - } - // Progress - { - auto ft = Formatter(); - ft.Add(STR_RESEARCH_COMPLETED_AL); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); - screenCoords.y += 15; - } + // Research type + auto ft = Formatter(); + ft.Add(STR_RESEARCH_UNKNOWN); + DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); + screenCoords.y += 25; - { - auto ft = Formatter(); - ft.Add(STR_RESEARCH_STAGE_UNKNOWN); - DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); - } + // 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 - std::array strings = { - static_cast(STR_RESEARCH_UNKNOWN), - STR_NONE, - }; + auto ft = Formatter(); rct_string_id label = STR_RESEARCH_TYPE_LABEL; - if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH) + if (gResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH) { - strings[0] = gResearchNextItem->GetCategoryName(); - if (gResearchProgressStage != RESEARCH_STAGE_DESIGNING) + ft.Add(STR_RESEARCH_UNKNOWN); + } + else if (gResearchProgressStage == RESEARCH_STAGE_DESIGNING) + { + ft.Add(gResearchNextItem->GetCategoryName()); + } + else if (gResearchNextItem->type == Research::EntryType::Ride) + { + const auto& rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType); + if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { - strings[0] = gResearchNextItem->GetName(); - if (gResearchNextItem->type == Research::EntryType::Ride) - { - auto rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) - { - strings[0] = rtd.Naming.Name; - } - else - { - strings[1] = rtd.Naming.Name; - label = STR_RESEARCH_TYPE_LABEL_VEHICLE; - } - } - } + ft.Add(gResearchNextItem->GetName()); + } + else if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) + { + ft.Add(rtd.Naming.Name); + } + else + { + ft.Add(gResearchNextItem->GetName()); + ft.Add(rtd.Naming.Name); + label = STR_RESEARCH_TYPE_LABEL_VEHICLE; } } - auto ft = Formatter(); - ft.Add(strings[0]); - ft.Add(strings[1]); + else + { + ft.Add(gResearchNextItem->GetName()); + } DrawTextWrapped(dpi, screenCoords, 296, label, ft); screenCoords.y += 25; @@ -377,36 +374,32 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp if (gResearchLastItem.has_value()) { rct_string_id lastDevelopmentFormat = STR_EMPTY; - std::array strings = { - gResearchLastItem->GetName(), - STR_NONE, - }; - auto type = gResearchLastItem->type; - if (type == Research::EntryType::Scenery) + auto ft = Formatter(); + if (gResearchLastItem->type == Research::EntryType::Scenery) { lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; + ft.Add(gResearchLastItem->GetName()); } else { lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; - auto rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + const auto& rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType); + if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { - if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) - { - strings[0] = rtd.Naming.Name; - } - else - { - strings[1] = rtd.Naming.Name; - lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL; - } + ft.Add(gResearchLastItem->GetName()); + } + else if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) + { + ft.Add(rtd.Naming.Name); + } + else + { + ft.Add(gResearchLastItem->GetName()); + ft.Add(rtd.Naming.Name); + lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL; } } - auto ft = Formatter(); - ft.Add(strings[0]); - ft.Add(strings[1]); DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); } } From 5cb1cee0d82a8c041090ff7ee2b9d918a61cacd8 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 17 Oct 2021 09:15:13 +0200 Subject: [PATCH 560/681] Fix #15584: Ride income underflows when on-ride photos are making losses --- 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 dc6858e87d..dbe17103cc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -41,6 +41,7 @@ - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. - Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). - Fix: [#15582] [Plugin] Litter properties return incorrect values. +- Fix: [#15584] Ride income underflows when on-ride photos are making losses. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 1eabd0f6cf..6dca4c68d3 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -374,7 +374,7 @@ money64 Ride::CalculateIncomePerHour() const // TODO: use data from the last 5 minutes instead of all-time values for a more accurate calculation if (rideTicketsSold > 0) { - priceMinusCost += ((no_secondary_items_sold * shopItemProfit) / rideTicketsSold); + priceMinusCost += ((static_cast(no_secondary_items_sold) * shopItemProfit) / rideTicketsSold); } } else From fe46a2cf09825d1dfe7d064c887289d8e8e3d831 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 17 Oct 2021 14:56:11 +0100 Subject: [PATCH 561/681] Fix Custom Currency window (#15596) * Fix custom currency window exchange rate This was using the wrong size type for the money * Change name of string id This was being used by two windows and should be made generic --- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2-ui/windows/CustomCurrency.cpp | 10 +++++----- src/openrct2/localisation/StringIds.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 67341f7537..cc4ece8633 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -239,7 +239,7 @@ static rct_widget window_cheats_guests_widgets[] = MakeWidget({ 11, 279}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_VANDALISM, STR_CHEAT_DISABLE_VANDALISM_TIP), // disable vandalism MakeWidget({ 11, 300}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_LITTERING, STR_CHEAT_DISABLE_LITTERING_TIP), // disable littering MakeWidget({ 5, 342}, {238, 69}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_GIVE_ALL_GUESTS ), // Guests parameters group frame - MakeWidget({ 11, 363}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_CURRENCY_FORMAT ), // give guests money + MakeWidget({ 11, 363}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CURRENCY_FORMAT ), // give guests money MakeWidget({127, 363}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_PARK_MAP ), // give guests park maps MakeWidget({ 11, 384}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_BALLOON ), // give guests balloons MakeWidget({127, 384}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index a19229282f..b1a00bbb46 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -35,10 +35,10 @@ enum WINDOW_CUSTOM_CURRENCY_WIDGET_IDX { static rct_widget window_custom_currency_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeSpinnerWidgets({100, 30}, {101, 11}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_CHEAT_CURRENCY_FORMAT), // NB: 3 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 ), + MakeSpinnerWidgets({100, 30}, {101, 11}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_CURRENCY_FORMAT), // NB: 3 widgets + MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_EMPTY ), + MakeWidget ({220, 50}, {131, 11}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), + MakeWidget ({339, 51}, { 11, 9}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), WIDGETS_END, }; @@ -212,7 +212,7 @@ static void custom_currency_window_text_input([[maybe_unused]] struct rct_window static void custom_currency_window_paint(rct_window* w, rct_drawpixelinfo* dpi) { auto ft = Formatter::Common(); - ft.Add(100); + ft.Add(MONEY(10, 0)); WindowDrawWidgets(w, dpi); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index e122424fe2..b99e4d82f8 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -2864,7 +2864,7 @@ enum STR_ROTATE_ANTI_CLOCKWISE = 5459, STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE = 5460, STR_CHEAT_SET_GUESTS_PARAMETERS = 5461, - STR_CHEAT_CURRENCY_FORMAT = 5462, + STR_CURRENCY_FORMAT = 5462, STR_CHEAT_HAVE_FUN = 5463, STR_CHEAT_GENERAL_GROUP = 5464, STR_CHEAT_WEATHER_GROUP = 5465, From 9dd20ec6191e182829cab9744ba56d6d5cf90faf Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 17 Oct 2021 15:31:56 +0200 Subject: [PATCH 562/681] Improve array formatting For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly. --- src/openrct2-ui/UiContext.cpp | 6 +- src/openrct2-ui/interface/Theme.cpp | 22 +- src/openrct2-ui/interface/Window.cpp | 30 +- src/openrct2-ui/windows/Cheats.cpp | 4 +- .../windows/EditorBottomToolbar.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 22 +- .../windows/EditorObjectiveOptions.cpp | 8 +- .../windows/EditorScenarioOptions.cpp | 8 +- src/openrct2-ui/windows/Guest.cpp | 143 +- src/openrct2-ui/windows/Map.cpp | 55 +- src/openrct2-ui/windows/MapGen.cpp | 94 +- src/openrct2-ui/windows/Multiplayer.cpp | 18 +- src/openrct2-ui/windows/NewRide.cpp | 19 +- src/openrct2-ui/windows/NewsOptions.cpp | 12 +- src/openrct2-ui/windows/Options.cpp | 9 +- src/openrct2-ui/windows/Park.cpp | 8 +- src/openrct2-ui/windows/Player.cpp | 6 +- src/openrct2-ui/windows/Research.cpp | 13 +- src/openrct2-ui/windows/Ride.cpp | 262 +-- src/openrct2-ui/windows/RideConstruction.cpp | 542 ++--- src/openrct2-ui/windows/RideList.cpp | 72 +- src/openrct2-ui/windows/Staff.cpp | 71 +- src/openrct2-ui/windows/Themes.cpp | 57 +- src/openrct2-ui/windows/TileInspector.cpp | 49 +- src/openrct2-ui/windows/TitleEditor.cpp | 63 +- src/openrct2-ui/windows/TopToolbar.cpp | 54 +- src/openrct2/Diagnostic.cpp | 10 +- src/openrct2/actions/LandBuyRightsAction.h | 5 +- src/openrct2/actions/LandSmoothAction.h | 5 +- src/openrct2/actions/ParkSetParameterAction.h | 7 +- src/openrct2/actions/RideSetVehicleAction.cpp | 8 +- src/openrct2/drawing/Drawing.cpp | 6 +- src/openrct2/drawing/Font.cpp | 6 +- src/openrct2/drawing/X8DrawingEngine.cpp | 6 +- src/openrct2/interface/InteractiveConsole.cpp | 37 +- .../localisation/Localisation.Date.cpp | 10 +- src/openrct2/localisation/Localisation.cpp | 5 +- src/openrct2/localisation/RealNames.cpp | 6 +- src/openrct2/management/Award.cpp | 8 +- src/openrct2/network/NetworkBase.cpp | 4 +- src/openrct2/object/ObjectList.cpp | 4 +- src/openrct2/paint/Paint.cpp | 7 +- src/openrct2/paint/Supports.cpp | 36 +- .../paint/tile_element/Paint.Path.cpp | 63 +- .../paint/tile_element/Paint.Surface.cpp | 103 +- .../paint/tile_element/Paint.TileElement.cpp | 5 +- src/openrct2/peep/Guest.cpp | 22 +- src/openrct2/peep/Peep.cpp | 36 +- src/openrct2/peep/Staff.cpp | 2 +- src/openrct2/platform/Platform.Linux.cpp | 14 +- src/openrct2/rct12/RCT12.cpp | 8 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/RideData.cpp | 2 +- src/openrct2/ride/RideRatings.cpp | 4 +- src/openrct2/ride/TrackPaint.cpp | 109 +- src/openrct2/ride/Vehicle.cpp | 766 +++---- src/openrct2/ride/VehicleData.cpp | 18 +- src/openrct2/ride/VehiclePaint.cpp | 1765 +++++++++-------- .../coaster/AirPoweredVerticalCoaster.cpp | 40 +- .../ride/coaster/BolligerMabillardTrack.cpp | 14 +- .../ride/coaster/JuniorRollerCoaster.cpp | 977 +++++---- src/openrct2/ride/coaster/VirginiaReel.cpp | 42 +- src/openrct2/ride/coaster/WildMouse.cpp | 6 +- .../ride/coaster/WoodenRollerCoaster.cpp | 1466 +++++++++----- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 2 +- src/openrct2/ride/gentle/CarRide.cpp | 28 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 28 +- src/openrct2/ride/gentle/Dodgems.cpp | 8 +- src/openrct2/ride/gentle/GhostTrain.cpp | 28 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 8 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 7 +- src/openrct2/ride/gentle/MonorailCycles.cpp | 47 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 17 +- .../ride/thrill/SwingingInverterShip.cpp | 29 +- src/openrct2/ride/thrill/SwingingShip.cpp | 7 +- src/openrct2/ride/transport/Chairlift.cpp | 8 +- .../ride/transport/MiniatureRailway.cpp | 443 +++-- src/openrct2/ride/transport/Monorail.cpp | 103 +- src/openrct2/ride/water/DingySlide.cpp | 176 +- src/openrct2/ride/water/LogFlume.cpp | 136 +- src/openrct2/ride/water/RiverRapids.cpp | 10 +- src/openrct2/ride/water/SplashBoats.cpp | 88 +- src/openrct2/ride/water/SubmarineRide.cpp | 7 +- src/openrct2/ride/water/WaterCoaster.cpp | 11 +- src/openrct2/world/Climate.cpp | 5 +- src/openrct2/world/Footpath.cpp | 7 +- src/openrct2/world/Fountain.cpp | 8 +- src/openrct2/world/Location.hpp | 7 +- src/openrct2/world/Map.cpp | 115 +- src/openrct2/world/MapAnimation.cpp | 2 +- src/openrct2/world/MapGen.cpp | 5 +- src/openrct2/world/MoneyEffect.cpp | 7 +- src/openrct2/world/Scenery.cpp | 7 +- test/tests/S6ImportExportTests.cpp | 5 +- test/tests/sawyercoding_test.cpp | 33 +- 95 files changed, 4968 insertions(+), 3709 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 1410aa0cdc..3b5b3da4d6 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -172,7 +172,11 @@ public: void SetFullscreenMode(FULLSCREEN_MODE mode) override { - static constexpr const int32_t SDLFSFlags[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP }; + static constexpr const int32_t SDLFSFlags[] = { + 0, + SDL_WINDOW_FULLSCREEN, + SDL_WINDOW_FULLSCREEN_DESKTOP, + }; uint32_t windowFlags = SDLFSFlags[static_cast(mode)]; // HACK Changing window size when in fullscreen usually has no effect diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 5384a6287d..f9d8e62f8f 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -213,23 +213,20 @@ static constexpr const UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { WC_MAP, COLOURS_RCT1(COLOUR_DARK_BROWN, COLOUR_GREY, COLOUR_GREY, COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK) }, { WC_ABOUT, COLOURS_RCT1(COLOUR_GREY, COLOUR_DARK_BROWN, COLOUR_WHITE, COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK) }, { WC_CHANGELOG, COLOURS_RCT1(COLOUR_DARK_BROWN, COLOUR_DARK_BROWN, COLOUR_WHITE, COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK) }, - - THEME_DEF_END + THEME_DEF_END, }; +// clang-format on -static constexpr const UIThemeWindowEntry PredefinedThemeRCT2_Entries[] = -{ - THEME_DEF_END +static constexpr const UIThemeWindowEntry PredefinedThemeRCT2_Entries[] = { + THEME_DEF_END, }; const UITheme PredefinedThemeRCT1 = UITheme::CreatePredefined( - "*RCT1", PredefinedThemeRCT1_Entries, UITHEME_FLAG_USE_LIGHTS_RIDE | - UITHEME_FLAG_USE_LIGHTS_PARK | - UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT | - UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); + "*RCT1", PredefinedThemeRCT1_Entries, + UITHEME_FLAG_USE_LIGHTS_RIDE | UITHEME_FLAG_USE_LIGHTS_PARK | UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT + | UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); -const UITheme PredefinedThemeRCT2 = UITheme::CreatePredefined( - "*RCT2", PredefinedThemeRCT2_Entries, 0); +const UITheme PredefinedThemeRCT2 = UITheme::CreatePredefined("*RCT2", PredefinedThemeRCT2_Entries, 0); struct PredefinedTheme { @@ -239,9 +236,8 @@ struct PredefinedTheme static constexpr const PredefinedTheme PredefinedThemes[] = { { &PredefinedThemeRCT1, STR_TITLE_SEQUENCE_RCT1 }, - { &PredefinedThemeRCT2, STR_TITLE_SEQUENCE_RCT2 } + { &PredefinedThemeRCT2, STR_TITLE_SEQUENCE_RCT2 }, }; -// clang-format on #pragma endregion diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index b3134b0ea0..5e3774a544 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -113,10 +113,10 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) // Place window in an empty corner of the screen const ScreenCoordsXY cornerPositions[] = { - { 0, 30 }, // topLeft - { screenWidth - width, 30 }, // topRight - { 0, screenHeight - 34 - height }, // bottomLeft - { screenWidth - width, screenHeight - 34 - height } // bottomRight + { 0, 30 }, // topLeft + { screenWidth - width, 30 }, // topRight + { 0, screenHeight - 34 - height }, // bottomLeft + { screenWidth - width, screenHeight - 34 - height }, // bottomRight }; for (const auto& cornerPos : cornerPositions) @@ -133,14 +133,16 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) if (w->flags & WF_STICK_TO_BACK) continue; - const ScreenCoordsXY offsets[] = { { w->width + 2, 0 }, - { -w->width - 2, 0 }, - { 0, w->height + 2 }, - { 0, -w->height - 2 }, - { w->width + 2, -w->height - 2 }, - { -w->width - 2, -w->height - 2 }, - { w->width + 2, w->height + 2 }, - { -w->width - 2, w->height + 2 } }; + const ScreenCoordsXY offsets[] = { + { w->width + 2, 0 }, + { -w->width - 2, 0 }, + { 0, w->height + 2 }, + { 0, -w->height - 2 }, + { w->width + 2, -w->height - 2 }, + { -w->width - 2, -w->height - 2 }, + { w->width + 2, w->height + 2 }, + { -w->width - 2, w->height + 2 }, + }; for (const auto& offset : offsets) { @@ -158,14 +160,12 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height) if (w->flags & WF_STICK_TO_BACK) continue; - // clang-format off const ScreenCoordsXY offsets[] = { { w->width + 2, 0 }, { -w->width - 2, 0 }, { 0, w->height + 2 }, - { 0, -w->height - 2 } + { 0, -w->height - 2 }, }; - // clang-format on for (const auto& offset : offsets) { diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index cc4ece8633..06b3ceabe4 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -413,7 +413,7 @@ static uint64_t window_cheats_page_enabled_widgets[] = { (1ULL << WIDX_DISABLE_RIDE_VALUE_AGING) | (1ULL << WIDX_IGNORE_RESEARCH_STATUS) | (1ULL << WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES) | - (1ULL << WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS) + (1ULL << WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS), }; static uint64_t window_cheats_page_hold_down_widgets[] = { @@ -432,7 +432,7 @@ static uint64_t window_cheats_page_hold_down_widgets[] = { (1ULL << WIDX_INCREASE_PARK_RATING) | (1ULL << WIDX_DECREASE_PARK_RATING), - 0 + 0, }; static rct_string_id window_cheats_page_titles[] = { diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index edbf0a48cf..ad021fcfea 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -73,7 +73,7 @@ static EMPTY_ARGS_VOID_POINTER *previous_button_mouseup_events[] = { window_editor_bottom_toolbar_jump_back_to_options_selection, nullptr, window_editor_bottom_toolbar_jump_back_to_object_selection, - nullptr + nullptr, }; static EMPTY_ARGS_VOID_POINTER *next_button_mouseup_events[] = { @@ -84,7 +84,7 @@ static EMPTY_ARGS_VOID_POINTER *next_button_mouseup_events[] = { window_editor_bottom_toolbar_jump_forward_to_save_scenario, nullptr, nullptr, - nullptr + nullptr, }; static constexpr const rct_string_id EditorStepNames[] = { diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 81957c73f9..d96ab1f713 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -213,8 +213,12 @@ static rct_window_event_list window_editor_object_selection_events([](auto& even #pragma endregion -static constexpr const int32_t window_editor_object_selection_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 }; -static constexpr const int32_t window_editor_object_selection_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 }; +static constexpr const int32_t window_editor_object_selection_animation_loops[] = { + 20, 32, 10, 72, 24, 28, 16, +}; +static constexpr const int32_t window_editor_object_selection_animation_divisor[] = { + 4, 8, 2, 4, 4, 4, 2, +}; static void window_editor_object_set_page(rct_window* w, int32_t page); static void window_editor_object_selection_set_pressed_tab(rct_window* w); @@ -1089,11 +1093,15 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf } } - const int32_t ride_tabs[] = { SPR_TAB_RIDE_16, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_TRANSPORT_0, - SPR_TAB_RIDES_GENTLE_0, IMAGE_TYPE_REMAP | 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 }; + const int32_t ride_tabs[] = { + SPR_TAB_RIDE_16, IMAGE_TYPE_REMAP | SPR_TAB_RIDES_TRANSPORT_0, + SPR_TAB_RIDES_GENTLE_0, IMAGE_TYPE_REMAP | 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 (get_selected_object_type(w) == ObjectType::Ride) diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index efb6d4eb02..d9234fc869 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -113,7 +113,7 @@ static rct_widget window_editor_objective_options_rides_widgets[] = { static rct_widget *window_editor_objective_options_widgets[] = { window_editor_objective_options_main_widgets, - window_editor_objective_options_rides_widgets + window_editor_objective_options_rides_widgets, }; #pragma endregion @@ -168,7 +168,7 @@ static rct_window_event_list window_objective_options_rides_events([](auto& even static rct_window_event_list *window_editor_objective_options_page_events[] = { &window_objective_options_main_events, - &window_objective_options_rides_events + &window_objective_options_rides_events, }; #pragma endregion @@ -193,7 +193,7 @@ static uint64_t window_editor_objective_options_page_enabled_widgets[] = { (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_1) | - (1ULL << WIDX_TAB_2) + (1ULL << WIDX_TAB_2), }; static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { @@ -202,7 +202,7 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { (1ULL << WIDX_OBJECTIVE_ARG_2_INCREASE) | (1ULL << WIDX_OBJECTIVE_ARG_2_DECREASE), - 0 + 0, }; // clang-format on diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index a17aaf1bb2..756193278b 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -171,7 +171,7 @@ static rct_widget window_editor_scenario_options_park_widgets[] = { static rct_widget *window_editor_scenario_options_widgets[] = { window_editor_scenario_options_financial_widgets, window_editor_scenario_options_guests_widgets, - window_editor_scenario_options_park_widgets + window_editor_scenario_options_park_widgets, }; #pragma endregion @@ -237,7 +237,7 @@ static rct_window_event_list window_scenario_options_park_events([](auto& events static rct_window_event_list *window_editor_scenario_options_page_events[] = { &window_scenario_options_financial_events, &window_scenario_options_guests_events, - &window_scenario_options_park_events + &window_scenario_options_park_events, }; #pragma endregion @@ -288,7 +288,7 @@ static uint64_t window_editor_scenario_options_page_enabled_widgets[] = { (1ULL << WIDX_FORBID_LANDSCAPE_CHANGES) | (1ULL << WIDX_FORBID_HIGH_CONSTRUCTION) | (1ULL << WIDX_HARD_PARK_RATING) | - (1ULL << WIDX_HARD_GUEST_GENERATION) + (1ULL << WIDX_HARD_GUEST_GENERATION), }; static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = { @@ -313,7 +313,7 @@ static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = { (1ULL << WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE) | (1ULL << WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE) | (1ULL << WIDX_ENTRY_PRICE_INCREASE) | - (1ULL << WIDX_ENTRY_PRICE_DECREASE) + (1ULL << WIDX_ENTRY_PRICE_DECREASE), }; // clang-format on diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index c57d0331f0..9b0941bcb0 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -36,8 +36,8 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; static constexpr const int32_t WH = 157; static constexpr const int32_t WW = 192; -// clang-format off -enum WINDOW_GUEST_PAGE { +enum WINDOW_GUEST_PAGE +{ WINDOW_GUEST_OVERVIEW, WINDOW_GUEST_STATS, WINDOW_GUEST_RIDES, @@ -47,7 +47,8 @@ enum WINDOW_GUEST_PAGE { WINDOW_GUEST_DEBUG }; -enum WINDOW_GUEST_WIDGET_IDX { +enum WINDOW_GUEST_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -75,17 +76,18 @@ validate_global_widx(WC_PEEP, WIDX_PICKUP); static constexpr int32_t TabWidth = 30; -#define MAIN_GUEST_WIDGETS \ - WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ - MakeWidget({ 0, 43}, {192, 114}, WindowWidgetType::Resize, WindowColour::Secondary), /* Resize */ \ - MakeTab ({ 3, 17}, STR_SHOW_GUEST_VIEW_TIP ), /* Tab 1 */ \ - MakeTab ({ 34, 17}, STR_SHOW_GUEST_NEEDS_TIP ), /* Tab 2 */ \ - MakeTab ({ 65, 17}, STR_SHOW_GUEST_VISITED_RIDES_TIP ), /* Tab 3 */ \ - MakeTab ({ 96, 17}, STR_SHOW_GUEST_FINANCE_TIP ), /* Tab 4 */ \ - MakeTab ({127, 17}, STR_SHOW_GUEST_THOUGHTS_TIP ), /* Tab 5 */ \ - MakeTab ({158, 17}, STR_SHOW_GUEST_ITEMS_TIP ), /* Tab 6 */ \ - MakeTab ({189, 17}, STR_DEBUG_TIP ) /* Tab 7 */ +#define MAIN_GUEST_WIDGETS \ + WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ + MakeWidget({ 0, 43 }, { 192, 114 }, WindowWidgetType::Resize, WindowColour::Secondary), /* Resize */ \ + MakeTab({ 3, 17 }, STR_SHOW_GUEST_VIEW_TIP), /* Tab 1 */ \ + MakeTab({ 34, 17 }, STR_SHOW_GUEST_NEEDS_TIP), /* Tab 2 */ \ + MakeTab({ 65, 17 }, STR_SHOW_GUEST_VISITED_RIDES_TIP), /* Tab 3 */ \ + MakeTab({ 96, 17 }, STR_SHOW_GUEST_FINANCE_TIP), /* Tab 4 */ \ + MakeTab({ 127, 17 }, STR_SHOW_GUEST_THOUGHTS_TIP), /* Tab 5 */ \ + MakeTab({ 158, 17 }, STR_SHOW_GUEST_ITEMS_TIP), /* Tab 6 */ \ + MakeTab({ 189, 17 }, STR_DEBUG_TIP) /* Tab 7 */ +// clang-format off static rct_widget window_guest_overview_widgets[] = { MAIN_GUEST_WIDGETS, MakeWidget({ 3, 45}, {164, 12}, WindowWidgetType::LabelCentred, WindowColour::Secondary ), // Label Thought marquee @@ -97,6 +99,7 @@ static rct_widget window_guest_overview_widgets[] = { MakeWidget({167, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_TRACK_PEEP, STR_TOGGLE_GUEST_TRACKING_TIP), // Track Button WIDGETS_END, }; +// clang-format on static rct_widget window_guest_stats_widgets[] = { MAIN_GUEST_WIDGETS, @@ -105,7 +108,7 @@ static rct_widget window_guest_stats_widgets[] = { static rct_widget window_guest_rides_widgets[] = { MAIN_GUEST_WIDGETS, - MakeWidget({3, 57}, {186, 87}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), + MakeWidget({ 3, 57 }, { 186, 87 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), WIDGETS_END, }; @@ -130,15 +133,17 @@ static rct_widget window_guest_debug_widgets[] = { }; // 0x981D0C -static rct_widget *window_guest_page_widgets[] = { +// clang-format off +static rct_widget* window_guest_page_widgets[] = { window_guest_overview_widgets, window_guest_stats_widgets, window_guest_rides_widgets, window_guest_finance_widgets, window_guest_thoughts_widgets, window_guest_inventory_widgets, - window_guest_debug_widgets + window_guest_debug_widgets, }; +// clang-format on static void window_guest_set_page(rct_window* w, int32_t page); static void window_guest_disable_widgets(rct_window* w); @@ -146,49 +151,48 @@ static void window_guest_viewport_init(rct_window* w); static void window_guest_common_resize(rct_window* w); static void window_guest_common_invalidate(rct_window* w); -static void window_guest_overview_close(rct_window *w); -static void window_guest_overview_resize(rct_window *w); -static void window_guest_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex); -static void window_guest_overview_mouse_down(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_guest_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_guest_overview_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_guest_overview_invalidate(rct_window *w); -static void window_guest_overview_viewport_rotate(rct_window *w); +static void window_guest_overview_close(rct_window* w); +static void window_guest_overview_resize(rct_window* w); +static void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex); +static void window_guest_overview_mouse_down(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_guest_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_guest_overview_invalidate(rct_window* w); +static void window_guest_overview_viewport_rotate(rct_window* w); static void window_guest_overview_update(rct_window* w); -static void window_guest_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text); +static void window_guest_overview_text_input(rct_window* w, rct_widgetindex widgetIndex, char* text); static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_guest_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex); -static void window_guest_follow(rct_window *w); +static void window_guest_overview_tool_abort(rct_window* w, rct_widgetindex widgetIndex); +static void window_guest_follow(rct_window* w); static void window_guest_show_locate_dropdown(rct_window* w, rct_widget* widget); -static void window_guest_mouse_up(rct_window *w, rct_widgetindex widgetIndex); +static void window_guest_mouse_up(rct_window* w, rct_widgetindex widgetIndex); -static void window_guest_stats_update(rct_window *w); -static void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_guest_stats_update(rct_window* w); +static void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_guest_rides_update(rct_window *w); -static void window_guest_rides_scroll_get_size(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_guest_rides_scroll_mouse_down(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_guest_rides_scroll_mouse_over(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_guest_rides_invalidate(rct_window *w); -static void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_guest_rides_update(rct_window* w); +static void window_guest_rides_scroll_get_size(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_guest_rides_scroll_mouse_down(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_guest_rides_scroll_mouse_over(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_guest_rides_invalidate(rct_window* w); +static void window_guest_rides_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_guest_rides_scroll_paint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static void window_guest_finance_update(rct_window *w); -static void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_guest_finance_update(rct_window* w); +static void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_guest_thoughts_update(rct_window *w); -static void window_guest_thoughts_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_guest_thoughts_update(rct_window* w); +static void window_guest_thoughts_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_guest_inventory_update(rct_window *w); -static void window_guest_inventory_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_guest_inventory_update(rct_window* w); +static void window_guest_inventory_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_guest_debug_update(rct_window *w); -static void window_guest_debug_paint(rct_window *w, rct_drawpixelinfo* dpi); +static void window_guest_debug_update(rct_window* w); +static void window_guest_debug_paint(rct_window* w, rct_drawpixelinfo* dpi); -static rct_window_event_list window_guest_overview_events([](auto& events) -{ +static rct_window_event_list window_guest_overview_events([](auto& events) { events.close = &window_guest_overview_close; events.mouse_up = &window_guest_overview_mouse_up; events.mouse_down = &window_guest_overview_mouse_down; @@ -204,8 +208,7 @@ static rct_window_event_list window_guest_overview_events([](auto& events) events.paint = &window_guest_overview_paint; }); -static rct_window_event_list window_guest_stats_events([](auto& events) -{ +static rct_window_event_list window_guest_stats_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_stats_update; @@ -213,8 +216,7 @@ static rct_window_event_list window_guest_stats_events([](auto& events) events.paint = &window_guest_stats_paint; }); -static rct_window_event_list window_guest_rides_events([](auto& events) -{ +static rct_window_event_list window_guest_rides_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_rides_update; @@ -226,8 +228,7 @@ static rct_window_event_list window_guest_rides_events([](auto& events) events.scroll_paint = &window_guest_rides_scroll_paint; }); -static rct_window_event_list window_guest_finance_events([](auto& events) -{ +static rct_window_event_list window_guest_finance_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_finance_update; @@ -235,8 +236,7 @@ static rct_window_event_list window_guest_finance_events([](auto& events) events.paint = &window_guest_finance_paint; }); -static rct_window_event_list window_guest_thoughts_events([](auto& events) -{ +static rct_window_event_list window_guest_thoughts_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_thoughts_update; @@ -244,8 +244,7 @@ static rct_window_event_list window_guest_thoughts_events([](auto& events) events.paint = &window_guest_thoughts_paint; }); -static rct_window_event_list window_guest_inventory_events([](auto& events) -{ +static rct_window_event_list window_guest_inventory_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_inventory_update; @@ -253,8 +252,7 @@ static rct_window_event_list window_guest_inventory_events([](auto& events) events.paint = &window_guest_inventory_paint; }); -static rct_window_event_list window_guest_debug_events([](auto& events) -{ +static rct_window_event_list window_guest_debug_events([](auto& events) { events.mouse_up = &window_guest_mouse_up; events.resize = &window_guest_common_resize; events.update = &window_guest_debug_update; @@ -263,14 +261,15 @@ static rct_window_event_list window_guest_debug_events([](auto& events) }); // 0x981D24 -static rct_window_event_list *window_guest_page_events[] = { +// clang-format off +static rct_window_event_list* window_guest_page_events[] = { &window_guest_overview_events, &window_guest_stats_events, &window_guest_rides_events, &window_guest_finance_events, &window_guest_thoughts_events, &window_guest_inventory_events, - &window_guest_debug_events + &window_guest_debug_events, }; void window_guest_set_colours(); @@ -343,20 +342,20 @@ static constexpr const uint32_t window_guest_page_enabled_widgets[] = { (1ULL << WIDX_TAB_4) | (1ULL << WIDX_TAB_5) | (1ULL << WIDX_TAB_6) | - (1ULL << WIDX_TAB_7) -}; - -static constexpr const rct_size16 window_guest_page_sizes[][2] = { - { 192, 159, 500, 450 }, // WINDOW_GUEST_OVERVIEW - { 192, 180, 192, 180 }, // WINDOW_GUEST_STATS - { 192, 180, 500, 400 }, // WINDOW_GUEST_RIDES - { 210, 148, 210, 148 }, // WINDOW_GUEST_FINANCE - { 192, 159, 500, 450 }, // WINDOW_GUEST_THOUGHTS - { 192, 159, 500, 450 }, // WINDOW_GUEST_INVENTORY - { 192, 171, 192, 171 } // WINDOW_GUEST_DEBUG + (1ULL << WIDX_TAB_7), }; // clang-format on +static constexpr const rct_size16 window_guest_page_sizes[][2] = { + { 192, 159, 500, 450 }, // WINDOW_GUEST_OVERVIEW + { 192, 180, 192, 180 }, // WINDOW_GUEST_STATS + { 192, 180, 500, 400 }, // WINDOW_GUEST_RIDES + { 210, 148, 210, 148 }, // WINDOW_GUEST_FINANCE + { 192, 159, 500, 450 }, // WINDOW_GUEST_THOUGHTS + { 192, 159, 500, 450 }, // WINDOW_GUEST_INVENTORY + { 192, 171, 192, 171 }, // WINDOW_GUEST_DEBUG +}; + static Guest* GetGuest(rct_window* w) { auto guest = GetEntity(w->number); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index f04b0f44ce..ce4feb57b9 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -66,13 +66,14 @@ constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10; // minimap. In order to distinguish those from actual coordinates, we use a separate name. using MapCoordsXY = TileCoordsXY; -// clang-format off -enum { +enum +{ PAGE_PEEPS, PAGE_RIDES }; -enum WINDOW_MAP_WIDGET_IDX { +enum WINDOW_MAP_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -99,6 +100,7 @@ enum WINDOW_MAP_WIDGET_IDX { validate_global_widx(WC_MAP, WIDX_ROTATE_90); +// clang-format off static rct_widget window_map_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 0, 43}, {245, 215}, WindowWidgetType::Resize, WindowColour::Secondary ), @@ -127,39 +129,39 @@ static constexpr const 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 } + { 0 - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, }; +// clang-format on /** rct2: 0x00981BCC */ static constexpr const 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 + 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 void window_map_close(rct_window *w); -static void window_map_resize(rct_window *w); -static void window_map_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_map_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_map_update(rct_window *w); +static void window_map_close(rct_window* w); +static void window_map_resize(rct_window* w); +static void window_map_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_map_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_map_update(rct_window* w); static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_map_toolabort(rct_window *w, rct_widgetindex widgetIndex); -static void window_map_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_map_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_map_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_map_invalidate(rct_window *w); -static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_map_toolabort(rct_window* w, rct_widgetindex widgetIndex); +static void window_map_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_map_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_map_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_map_invalidate(rct_window* w); +static void window_map_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_map_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static rct_window_event_list window_map_events([](auto& events) -{ +static rct_window_event_list window_map_events([](auto& events) { events.close = &window_map_close; events.mouse_up = &window_map_mouseup; events.resize = &window_map_resize; @@ -177,7 +179,6 @@ static rct_window_event_list window_map_events([](auto& events) events.paint = &window_map_paint; events.scroll_paint = &window_map_scrollpaint; }); -// clang-format on /** rct2: 0x00F1AD61 */ static uint8_t _activeTool; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 68cd87ec92..5f6754c6da 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -26,8 +26,8 @@ using namespace OpenRCT2; -// clang-format off -enum { +enum +{ WINDOW_MAPGEN_PAGE_BASE, WINDOW_MAPGEN_PAGE_RANDOM, WINDOW_MAPGEN_PAGE_SIMPLEX, @@ -35,7 +35,8 @@ enum { WINDOW_MAPGEN_PAGE_COUNT }; -enum { +enum +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -113,6 +114,7 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; static constexpr const int32_t WW = 250; static constexpr const int32_t WH = 273; +// 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 */ \ @@ -169,49 +171,49 @@ static rct_widget HeightmapWidgets[] = { MakeSpinnerWidgets({104, 160}, { 95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // WIDX_HEIGHTMAP_WATER_LEVEL{,_UP,_DOWN} WIDGETS_END, }; +// clang-format on -static rct_widget *PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { +static rct_widget* PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { MapWidgets, RandomWidgets, SimplexWidgets, - HeightmapWidgets + HeightmapWidgets, }; #pragma endregion #pragma region Events -static void window_mapgen_shared_close(rct_window *w); -static void window_mapgen_shared_mouseup(rct_window *w, rct_widgetindex widgetIndex); +static void window_mapgen_shared_close(rct_window* w); +static void window_mapgen_shared_mouseup(rct_window* w, rct_widgetindex widgetIndex); -static void window_mapgen_base_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_mapgen_base_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_mapgen_base_update(rct_window *w); -static void window_mapgen_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_mapgen_base_invalidate(rct_window *w); -static void window_mapgen_base_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_mapgen_base_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_mapgen_base_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_mapgen_base_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_mapgen_base_update(rct_window* w); +static void window_mapgen_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_mapgen_base_invalidate(rct_window* w); +static void window_mapgen_base_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_mapgen_random_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_mapgen_random_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_mapgen_random_update(rct_window *w); -static void window_mapgen_random_invalidate(rct_window *w); -static void window_mapgen_random_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_mapgen_random_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_mapgen_random_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_mapgen_random_update(rct_window* w); +static void window_mapgen_random_invalidate(rct_window* w); +static void window_mapgen_random_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_mapgen_simplex_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_mapgen_simplex_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_mapgen_simplex_update(rct_window *w); -static void window_mapgen_simplex_invalidate(rct_window *w); -static void window_mapgen_simplex_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_mapgen_simplex_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_mapgen_simplex_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_mapgen_simplex_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_mapgen_simplex_update(rct_window* w); +static void window_mapgen_simplex_invalidate(rct_window* w); +static void window_mapgen_simplex_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_mapgen_heightmap_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_mapgen_heightmap_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_mapgen_heightmap_invalidate(rct_window *w); -static void window_mapgen_heightmap_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_mapgen_heightmap_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_mapgen_heightmap_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_mapgen_heightmap_invalidate(rct_window* w); +static void window_mapgen_heightmap_paint(rct_window* w, rct_drawpixelinfo* dpi); -static rct_window_event_list BaseEvents([](auto& events) -{ +static rct_window_event_list BaseEvents([](auto& events) { events.close = &window_mapgen_shared_close; events.mouse_up = &window_mapgen_base_mouseup; events.mouse_down = &window_mapgen_base_mousedown; @@ -222,8 +224,7 @@ static rct_window_event_list BaseEvents([](auto& events) events.paint = &window_mapgen_base_paint; }); -static rct_window_event_list RandomEvents([](auto& events) -{ +static rct_window_event_list RandomEvents([](auto& events) { events.close = &window_mapgen_shared_close; events.mouse_up = &window_mapgen_random_mouseup; events.mouse_down = &window_mapgen_random_mousedown; @@ -232,8 +233,7 @@ static rct_window_event_list RandomEvents([](auto& events) events.paint = &window_mapgen_random_paint; }); -static rct_window_event_list SimplexEvents([](auto& events) -{ +static rct_window_event_list SimplexEvents([](auto& events) { events.close = &window_mapgen_shared_close; events.mouse_up = &window_mapgen_simplex_mouseup; events.mouse_down = &window_mapgen_simplex_mousedown; @@ -244,8 +244,7 @@ static rct_window_event_list SimplexEvents([](auto& events) events.paint = &window_mapgen_simplex_paint; }); -static rct_window_event_list HeightmapEvents([](auto& events) -{ +static rct_window_event_list HeightmapEvents([](auto& events) { events.close = &window_mapgen_shared_close; events.mouse_up = &window_mapgen_heightmap_mouseup; events.mouse_down = &window_mapgen_heightmap_mousedown; @@ -253,17 +252,18 @@ static rct_window_event_list HeightmapEvents([](auto& events) events.paint = &window_mapgen_heightmap_paint; }); -static rct_window_event_list *PageEvents[] = { +static rct_window_event_list* PageEvents[] = { &BaseEvents, &RandomEvents, &SimplexEvents, - &HeightmapEvents + &HeightmapEvents, }; #pragma endregion #pragma region Enabled widgets +// clang-format off static uint64_t PageEnabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_1) | @@ -393,17 +393,27 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { 0, (1ULL << WIDX_HEIGHTMAP_SMOOTH_TILES) }; +// clang-format on #pragma endregion static constexpr const int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = { - 1, 1, 1, 1 + 1, + 1, + 1, + 1, }; static constexpr const int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = { - 1, 1, 1, 1 + 1, + 1, + 1, + 1, }; static constexpr const int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = { - 16, 16, 16, 0 + 16, + 16, + 16, + 0, }; // clang-format on diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 0705f3c7d4..2c8e8b8b6b 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -107,7 +107,7 @@ static rct_widget *window_multiplayer_page_widgets[] = { window_multiplayer_information_widgets, window_multiplayer_players_widgets, window_multiplayer_groups_widgets, - window_multiplayer_options_widgets + window_multiplayer_options_widgets, }; static constexpr const uint64_t window_multiplayer_page_enabled_widgets[] = { @@ -212,12 +212,22 @@ static rct_window_event_list *window_multiplayer_page_events[] = { &window_multiplayer_information_events, &window_multiplayer_players_events, &window_multiplayer_groups_events, - &window_multiplayer_options_events + &window_multiplayer_options_events, }; // clang-format on -static constexpr const int32_t window_multiplayer_animation_divisor[] = { 4, 4, 2, 2 }; -static constexpr const int32_t window_multiplayer_animation_frames[] = { 8, 8, 7, 4 }; +static constexpr const int32_t window_multiplayer_animation_divisor[] = { + 4, + 4, + 2, + 2, +}; +static constexpr const int32_t window_multiplayer_animation_frames[] = { + 8, + 8, + 7, + 4, +}; static void window_multiplayer_draw_tab_images(rct_window* w, rct_drawpixelinfo* dpi); static void window_multiplayer_set_page(rct_window* w, int32_t page); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index f7e14cc34b..52edabd054 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -151,7 +151,7 @@ static constexpr const char RideTypeViewOrder[] = { RIDE_TYPE_INFORMATION_KIOSK, RIDE_TYPE_FIRST_AID, RIDE_TYPE_CASH_MACHINE, - RIDE_TYPE_TOILETS + RIDE_TYPE_TOILETS, }; #pragma endregion @@ -164,7 +164,7 @@ enum { WINDOW_NEW_RIDE_PAGE_WATER, WINDOW_NEW_RIDE_PAGE_SHOP, WINDOW_NEW_RIDE_PAGE_RESEARCH, - WINDOW_NEW_RIDE_PAGE_COUNT + WINDOW_NEW_RIDE_PAGE_COUNT, }; #pragma region Widgets @@ -247,11 +247,15 @@ static constexpr const rct_string_id window_new_ride_titles[WINDOW_NEW_RIDE_PAGE STR_NEW_SHOPS_STALLS, STR_RESEARCH_AND_DEVELOPMENT, }; - -static constexpr const int32_t window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 }; -static constexpr const int32_t window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 }; // clang-format on +static constexpr const int32_t window_new_ride_tab_animation_loops[] = { + 20, 32, 10, 72, 24, 28, 16, +}; +static constexpr const int32_t window_new_ride_tab_animation_divisor[] = { + 4, 8, 2, 4, 4, 4, 2, +}; + static void window_new_ride_set_page(rct_window* w, int32_t page); static void window_new_ride_refresh_widget_sizing(rct_window* w); static RideSelection window_new_ride_scroll_get_ride_list_item_at(rct_window* w, const ScreenCoordsXY& screenCoords); @@ -600,8 +604,9 @@ static void window_new_ride_set_pressed_tab(rct_window* w) w->pressed_widgets |= 1LL << (WIDX_TAB_1 + _windowNewRideCurrentTab); } -static constexpr 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 }; +static constexpr 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, +}; static void window_new_ride_draw_tab_image(rct_drawpixelinfo* dpi, rct_window* w, int32_t page, int32_t spriteIndex) { diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 8d9acc372e..00c4004166 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -247,8 +247,16 @@ static void window_news_options_set_page(rct_window* w, int32_t page) } } -const int32_t window_news_option_tab_animation_divisor[] = { 1, 4, 4 }; -const int32_t window_news_option_tab_animation_frames[] = { 1, 16, 8 }; +const int32_t window_news_option_tab_animation_divisor[] = { + 1, + 4, + 4, +}; +const int32_t window_news_option_tab_animation_frames[] = { + 1, + 16, + 8, +}; static void window_news_options_draw_tab_image(rct_window* w, rct_drawpixelinfo* dpi, int32_t page, int32_t spriteIndex) { diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index b7e1105413..2cb0a64b97 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -392,7 +392,7 @@ static constexpr const rct_string_id window_options_title_music_names[] = { static constexpr const rct_string_id window_options_scale_quality_names[] = { STR_SCALING_QUALITY_LINEAR, - STR_SCALING_QUALITY_SMOOTH_NN + STR_SCALING_QUALITY_SMOOTH_NN, }; static constexpr const rct_string_id window_options_fullscreen_mode_names[] = { @@ -1240,8 +1240,11 @@ private: WidgetSetCheckboxValue(this, WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.transparent_screenshot); WidgetSetCheckboxValue(this, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); - rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, - STR_VIRTUAL_FLOOR_STYLE_GLASSY }; + static constexpr rct_string_id VirtualFloorStyleStrings[] = { + STR_VIRTUAL_FLOOR_STYLE_DISABLED, + STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, + STR_VIRTUAL_FLOOR_STYLE_GLASSY, + }; this->widgets[WIDX_VIRTUAL_FLOOR].text = VirtualFloorStyleStrings[static_cast( gConfigGeneral.virtual_floor_style)]; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index bfbc5ad5db..c08e4a223b 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -142,7 +142,7 @@ static rct_widget *window_park_page_widgets[] = { window_park_price_widgets, window_park_stats_widgets, window_park_objective_widgets, - window_park_awards_widgets + window_park_awards_widgets, }; #pragma endregion @@ -273,7 +273,7 @@ static rct_window_event_list *window_park_page_events[] = { &window_park_price_events, &window_park_stats_events, &window_park_objective_events, - &window_park_awards_events + &window_park_awards_events, }; #pragma endregion @@ -351,7 +351,7 @@ static uint32_t window_park_page_enabled_widgets[] = { (1ULL << WIDX_TAB_4) | (1ULL << WIDX_TAB_5) | (1ULL << WIDX_TAB_6) | - (1ULL << WIDX_TAB_7) + (1ULL << WIDX_TAB_7), }; static uint32_t window_park_page_hold_down_widgets[] = { @@ -364,7 +364,7 @@ static uint32_t window_park_page_hold_down_widgets[] = { 0, 0, - 0 + 0, }; #pragma endregion diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 35001e9efc..a9b95b172b 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -73,7 +73,7 @@ static rct_widget window_player_statistics_widgets[] = { static rct_widget *window_player_page_widgets[] = { window_player_overview_widgets, - window_player_statistics_widgets + window_player_statistics_widgets, }; #pragma endregion @@ -120,7 +120,7 @@ static rct_window_event_list window_player_statistics_events([](auto& events) static rct_window_event_list *window_player_page_events[] = { &window_player_overview_events, - &window_player_statistics_events + &window_player_statistics_events, }; #pragma endregion @@ -141,7 +141,7 @@ static uint32_t window_player_page_enabled_widgets[] = { (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_1) | - (1ULL << WIDX_TAB_2) + (1ULL << WIDX_TAB_2), }; // clang-format on diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 2801ebc474..7c7aec69ce 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -92,7 +92,7 @@ static rct_widget window_research_funding_widgets[] = { static rct_widget *window_research_page_widgets[] = { window_research_development_widgets, - window_research_funding_widgets + window_research_funding_widgets, }; #pragma endregion @@ -133,7 +133,7 @@ static rct_window_event_list window_research_funding_events([](auto& events) static rct_window_event_list *window_research_page_events[] = { &window_research_development_events, - &window_research_funding_events + &window_research_funding_events, }; #pragma endregion @@ -157,12 +157,16 @@ static uint32_t window_research_page_enabled_widgets[] = { (1ULL << WIDX_THRILL_RIDES) | (1ULL << WIDX_WATER_RIDES) | (1ULL << WIDX_SHOPS_AND_STALLS) | - (1ULL << WIDX_SCENERY_AND_THEMING) + (1ULL << WIDX_SCENERY_AND_THEMING), }; +// clang-format on #pragma endregion -const int32_t window_research_tab_animation_loops[] = { 16, 16 }; +const int32_t window_research_tab_animation_loops[] = { + 16, + 16, +}; static constexpr const rct_string_id ResearchStageNames[] = { STR_RESEARCH_STAGE_INITIAL_RESEARCH, @@ -170,7 +174,6 @@ static constexpr const rct_string_id ResearchStageNames[] = { STR_RESEARCH_STAGE_COMPLETING_DESIGN, STR_RESEARCH_STAGE_UNKNOWN, }; -// clang-format on static void window_research_set_page(rct_window* w, int32_t page); static void window_research_set_pressed_tab(rct_window* w); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 5170e4bbad..8131b436e9 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -382,7 +382,7 @@ static rct_widget *window_ride_page_widgets[] = { window_ride_measurements_widgets, window_ride_graphs_widgets, window_ride_income_widgets, - window_ride_customer_widgets + window_ride_customer_widgets, }; #define MAIN_RIDE_ENABLED_WIDGETS \ @@ -519,115 +519,117 @@ static constexpr const uint64_t window_ride_page_hold_down_widgets[] = { (1ULL << WIDX_PRIMARY_PRICE_DECREASE) | (1ULL << WIDX_SECONDARY_PRICE_INCREASE) | (1ULL << WIDX_SECONDARY_PRICE_DECREASE), - 0 + 0, }; +// clang-format on #pragma endregion #pragma region Events -static void window_ride_init_viewport(rct_window *w); +static void window_ride_init_viewport(rct_window* w); -static void window_ride_main_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_main_resize(rct_window *w); -static void window_ride_main_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_main_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_main_update(rct_window *w); -static void window_ride_main_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_ride_main_viewport_rotate(rct_window *w); -static void window_ride_main_invalidate(rct_window *w); -static void window_ride_main_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_ride_main_follow_ride(rct_window *w); +static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_main_resize(rct_window* w); +static void window_ride_main_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_main_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_main_update(rct_window* w); +static void window_ride_main_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_ride_main_viewport_rotate(rct_window* w); +static void window_ride_main_invalidate(rct_window* w); +static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_ride_main_follow_ride(rct_window* w); -static void window_ride_vehicle_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_vehicle_resize(rct_window *w); -static void window_ride_vehicle_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_vehicle_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_vehicle_update(rct_window *w); -static OpenRCT2String window_ride_vehicle_tooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); -static void window_ride_vehicle_invalidate(rct_window *w); -static void window_ride_vehicle_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_ride_vehicle_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_ride_vehicle_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_vehicle_resize(rct_window* w); +static void window_ride_vehicle_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_vehicle_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_vehicle_update(rct_window* w); +static OpenRCT2String window_ride_vehicle_tooltip( + rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); +static void window_ride_vehicle_invalidate(rct_window* w); +static void window_ride_vehicle_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static void window_ride_operating_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_operating_resize(rct_window *w); -static void window_ride_operating_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_operating_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_operating_update(rct_window *w); -static void window_ride_operating_invalidate(rct_window *w); -static void window_ride_operating_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_operating_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_operating_resize(rct_window* w); +static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_operating_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_operating_update(rct_window* w); +static void window_ride_operating_invalidate(rct_window* w); +static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_ride_maintenance_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_maintenance_resize(rct_window *w); -static void window_ride_maintenance_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_maintenance_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_maintenance_update(rct_window *w); -static void window_ride_maintenance_invalidate(rct_window *w); -static void window_ride_maintenance_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_maintenance_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_maintenance_resize(rct_window* w); +static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_maintenance_update(rct_window* w); +static void window_ride_maintenance_invalidate(rct_window* w); +static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_ride_colour_close(rct_window *w); -static void window_ride_colour_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_colour_resize(rct_window *w); -static void window_ride_colour_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_colour_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_colour_update(rct_window *w); -static void window_ride_colour_tooldown(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_colour_tooldrag(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_colour_invalidate(rct_window *w); -static void window_ride_colour_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_ride_colour_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_ride_colour_close(rct_window* w); +static void window_ride_colour_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_colour_resize(rct_window* w); +static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_colour_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_colour_update(rct_window* w); +static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_colour_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_colour_invalidate(rct_window* w); +static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_ride_colour_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static void window_ride_music_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_music_resize(rct_window *w); -static void window_ride_music_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_music_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_music_update(rct_window *w); -static void window_ride_music_invalidate(rct_window *w); -static void window_ride_music_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_music_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_music_resize(rct_window* w); +static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_music_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_music_update(rct_window* w); +static void window_ride_music_invalidate(rct_window* w); +static void window_ride_music_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_ride_measurements_close(rct_window *w); -static void window_ride_measurements_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_measurements_resize(rct_window *w); -static void window_ride_measurements_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_measurements_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_measurements_update(rct_window *w); -static void window_ride_measurements_tooldown(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_measurements_tooldrag(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_measurements_toolabort(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_measurements_invalidate(rct_window *w); -static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_measurements_close(rct_window* w); +static void window_ride_measurements_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_measurements_resize(rct_window* w); +static void window_ride_measurements_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_measurements_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_measurements_update(rct_window* w); +static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_measurements_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_measurements_toolabort(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_measurements_invalidate(rct_window* w); +static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_ride_graphs_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_graphs_resize(rct_window *w); -static void window_ride_graphs_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_graphs_update(rct_window *w); -static void window_ride_graphs_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_ride_graphs_15(rct_window *w, int32_t scrollIndex, int32_t scrollAreaType); -static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback); -static void window_ride_graphs_invalidate(rct_window *w); -static void window_ride_graphs_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_ride_graphs_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_graphs_resize(rct_window* w); +static void window_ride_graphs_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_graphs_update(rct_window* w); +static void window_ride_graphs_scrollgetheight(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_ride_graphs_15(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); +static OpenRCT2String window_ride_graphs_tooltip( + rct_window* w, const rct_widgetindex widgetIndex, const rct_string_id fallback); +static void window_ride_graphs_invalidate(rct_window* w); +static void window_ride_graphs_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_ride_graphs_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static void window_ride_income_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_income_resize(rct_window *w); -static void window_ride_income_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_income_update(rct_window *w); -static void window_ride_income_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_ride_income_invalidate(rct_window *w); -static void window_ride_income_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_income_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_income_resize(rct_window* w); +static void window_ride_income_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_income_update(rct_window* w); +static void window_ride_income_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_ride_income_invalidate(rct_window* w); +static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi); static bool window_ride_income_can_modify_primary_price(rct_window* w); -static void window_ride_customer_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_customer_resize(rct_window *w); -static void window_ride_customer_update(rct_window *w); -static void window_ride_customer_invalidate(rct_window *w); -static void window_ride_customer_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_customer_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_customer_resize(rct_window* w); +static void window_ride_customer_update(rct_window* w); +static void window_ride_customer_invalidate(rct_window* w); +static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_ride_set_page(rct_window *w, int32_t page); +static void window_ride_set_page(rct_window* w, int32_t page); // 0x0098DFD4 -static rct_window_event_list window_ride_main_events([](auto& events) -{ +static rct_window_event_list window_ride_main_events([](auto& events) { events.mouse_up = &window_ride_main_mouseup; events.resize = &window_ride_main_resize; events.mouse_down = &window_ride_main_mousedown; @@ -640,8 +642,7 @@ static rct_window_event_list window_ride_main_events([](auto& events) }); // 0x0098E204 -static rct_window_event_list window_ride_vehicle_events([](auto& events) -{ +static rct_window_event_list window_ride_vehicle_events([](auto& events) { events.mouse_up = &window_ride_vehicle_mouseup; events.resize = &window_ride_vehicle_resize; events.mouse_down = &window_ride_vehicle_mousedown; @@ -654,8 +655,7 @@ static rct_window_event_list window_ride_vehicle_events([](auto& events) }); // 0x0098E0B4 -static rct_window_event_list window_ride_operating_events([](auto& events) -{ +static rct_window_event_list window_ride_operating_events([](auto& events) { events.mouse_up = &window_ride_operating_mouseup; events.resize = &window_ride_operating_resize; events.mouse_down = &window_ride_operating_mousedown; @@ -666,8 +666,7 @@ static rct_window_event_list window_ride_operating_events([](auto& events) }); // 0x0098E124 -static rct_window_event_list window_ride_maintenance_events([](auto& events) -{ +static rct_window_event_list window_ride_maintenance_events([](auto& events) { events.mouse_up = &window_ride_maintenance_mouseup; events.resize = &window_ride_maintenance_resize; events.mouse_down = &window_ride_maintenance_mousedown; @@ -678,8 +677,7 @@ static rct_window_event_list window_ride_maintenance_events([](auto& events) }); // 0x0098E044 -static rct_window_event_list window_ride_colour_events([](auto& events) -{ +static rct_window_event_list window_ride_colour_events([](auto& events) { events.close = &window_ride_colour_close; events.mouse_up = &window_ride_colour_mouseup; events.resize = &window_ride_colour_resize; @@ -694,8 +692,7 @@ static rct_window_event_list window_ride_colour_events([](auto& events) }); // 0x0098E194 -static rct_window_event_list window_ride_music_events([](auto& events) -{ +static rct_window_event_list window_ride_music_events([](auto& events) { events.mouse_up = &window_ride_music_mouseup; events.resize = &window_ride_music_resize; events.mouse_down = &window_ride_music_mousedown; @@ -706,8 +703,7 @@ static rct_window_event_list window_ride_music_events([](auto& events) }); // 0x0098DE14 -static rct_window_event_list window_ride_measurements_events([](auto& events) -{ +static rct_window_event_list window_ride_measurements_events([](auto& events) { events.close = &window_ride_measurements_close; events.mouse_up = &window_ride_measurements_mouseup; events.resize = &window_ride_measurements_resize; @@ -722,8 +718,7 @@ static rct_window_event_list window_ride_measurements_events([](auto& events) }); // 0x0098DF64 -static rct_window_event_list window_ride_graphs_events([](auto& events) -{ +static rct_window_event_list window_ride_graphs_events([](auto& events) { events.mouse_up = &window_ride_graphs_mouseup; events.resize = &window_ride_graphs_resize; events.mouse_down = &window_ride_graphs_mousedown; @@ -737,8 +732,7 @@ static rct_window_event_list window_ride_graphs_events([](auto& events) }); // 0x0098DEF4 -static rct_window_event_list window_ride_income_events([](auto& events) -{ +static rct_window_event_list window_ride_income_events([](auto& events) { events.mouse_up = &window_ride_income_mouseup; events.resize = &window_ride_income_resize; events.mouse_down = &window_ride_income_mousedown; @@ -749,8 +743,7 @@ static rct_window_event_list window_ride_income_events([](auto& events) }); // 0x0098DE84 -static rct_window_event_list window_ride_customer_events([](auto& events) -{ +static rct_window_event_list window_ride_customer_events([](auto& events) { events.mouse_up = &window_ride_customer_mouseup; events.resize = &window_ride_customer_resize; events.update = &window_ride_customer_update; @@ -758,6 +751,7 @@ static rct_window_event_list window_ride_customer_events([](auto& events) events.paint = &window_ride_customer_paint; }); +// clang-format off static rct_window_event_list *window_ride_page_events[] = { &window_ride_main_events, &window_ride_vehicle_events, @@ -768,8 +762,9 @@ static rct_window_event_list *window_ride_page_events[] = { &window_ride_measurements_events, &window_ride_graphs_events, &window_ride_income_events, - &window_ride_customer_events + &window_ride_customer_events, }; +// clang-format on #pragma endregion @@ -780,16 +775,22 @@ static std::unique_ptr _trackDesign; // Cached overall view for each ride // (Re)calculated when the ride window is opened -struct ride_overall_view { +struct ride_overall_view +{ CoordsXYZ loc; uint8_t zoom; }; static std::vector ride_overall_views = {}; -static constexpr const int32_t window_ride_tab_animation_divisor[] = { 0, 0, 2, 2, 4, 2, 8, 8, 2, 0 }; -static constexpr const int32_t window_ride_tab_animation_frames[] = { 0, 0, 4, 16, 8, 16, 8, 8, 8, 0 }; +static constexpr const int32_t window_ride_tab_animation_divisor[] = { + 0, 0, 2, 2, 4, 2, 8, 8, 2, 0, +}; +static constexpr const int32_t window_ride_tab_animation_frames[] = { + 0, 0, 4, 16, 8, 16, 8, 8, 8, 0, +}; +// clang-format off static constexpr const rct_string_id RatingNames[] = { STR_RATING_LOW, STR_RATING_MEDIUM, @@ -807,7 +808,7 @@ static constexpr const rct_string_id RideBreakdownReasonNames[] = { STR_RIDE_BREAKDOWN_DOORS_STUCK_OPEN, STR_RIDE_BREAKDOWN_VEHICLE_MALFUNCTION, STR_RIDE_BREAKDOWN_BRAKES_FAILURE, - STR_RIDE_BREAKDOWN_CONTROL_FAILURE + STR_RIDE_BREAKDOWN_CONTROL_FAILURE, }; const rct_string_id ColourSchemeNames[4] = { @@ -874,19 +875,20 @@ static constexpr const rct_string_id SingleSessionVehicleStatusNames[] = { STR_STOPPING_1, // Vehicle::Status::Arriving STR_UNLOADING_PASSENGERS, // Vehicle::Status::UnloadingPassengers }; +// clang-format on -struct window_ride_maze_design_option { +struct window_ride_maze_design_option +{ rct_string_id text; uint32_t sprite; }; static constexpr const window_ride_maze_design_option MazeOptions[] = { - { STR_RIDE_DESIGN_MAZE_BRICK_WALLS, SPR_RIDE_DESIGN_PREVIEW_MAZE_BRICK_WALLS }, - { STR_RIDE_DESIGN_MAZE_HEDGES, SPR_RIDE_DESIGN_PREVIEW_MAZE_HEDGES }, - { STR_RIDE_DESIGN_MAZE_ICE_BLOCKS, SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS }, - { STR_RIDE_DESIGN_MAZE_WOODEN_FENCES, SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES }, + { STR_RIDE_DESIGN_MAZE_BRICK_WALLS, SPR_RIDE_DESIGN_PREVIEW_MAZE_BRICK_WALLS }, + { STR_RIDE_DESIGN_MAZE_HEDGES, SPR_RIDE_DESIGN_PREVIEW_MAZE_HEDGES }, + { STR_RIDE_DESIGN_MAZE_ICE_BLOCKS, SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS }, + { STR_RIDE_DESIGN_MAZE_WOODEN_FENCES, SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES }, }; -// clang-format on struct rct_window_graphs_y_axis { @@ -4951,17 +4953,17 @@ static void window_ride_colour_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi #pragma region Music static constexpr const uint8_t MusicStyleOrder[] = { - MUSIC_STYLE_GENTLE, MUSIC_STYLE_SUMMER, MUSIC_STYLE_WATER, - MUSIC_STYLE_RAGTIME, MUSIC_STYLE_TECHNO, MUSIC_STYLE_MECHANICAL, - MUSIC_STYLE_MODERN, MUSIC_STYLE_WILD_WEST, MUSIC_STYLE_PIRATES, - MUSIC_STYLE_ROCK, MUSIC_STYLE_ROCK_STYLE_2, MUSIC_STYLE_ROCK_STYLE_3, - MUSIC_STYLE_FANTASY, MUSIC_STYLE_HORROR, MUSIC_STYLE_TOYLAND, - MUSIC_STYLE_CANDY_STYLE, MUSIC_STYLE_ROMAN_FANFARE, MUSIC_STYLE_ORIENTAL, - MUSIC_STYLE_MARTIAN, MUSIC_STYLE_SPACE, MUSIC_STYLE_JUNGLE_DRUMS, - MUSIC_STYLE_JURASSIC, MUSIC_STYLE_EGYPTIAN, MUSIC_STYLE_DODGEMS_BEAT, - MUSIC_STYLE_SNOW, MUSIC_STYLE_ICE, MUSIC_STYLE_MEDIEVAL, - MUSIC_STYLE_URBAN, MUSIC_STYLE_ORGAN, MUSIC_STYLE_CUSTOM_MUSIC_1, - MUSIC_STYLE_CUSTOM_MUSIC_2 + MUSIC_STYLE_GENTLE, MUSIC_STYLE_SUMMER, MUSIC_STYLE_WATER, + MUSIC_STYLE_RAGTIME, MUSIC_STYLE_TECHNO, MUSIC_STYLE_MECHANICAL, + MUSIC_STYLE_MODERN, MUSIC_STYLE_WILD_WEST, MUSIC_STYLE_PIRATES, + MUSIC_STYLE_ROCK, MUSIC_STYLE_ROCK_STYLE_2, MUSIC_STYLE_ROCK_STYLE_3, + MUSIC_STYLE_FANTASY, MUSIC_STYLE_HORROR, MUSIC_STYLE_TOYLAND, + MUSIC_STYLE_CANDY_STYLE, MUSIC_STYLE_ROMAN_FANFARE, MUSIC_STYLE_ORIENTAL, + MUSIC_STYLE_MARTIAN, MUSIC_STYLE_SPACE, MUSIC_STYLE_JUNGLE_DRUMS, + MUSIC_STYLE_JURASSIC, MUSIC_STYLE_EGYPTIAN, MUSIC_STYLE_DODGEMS_BEAT, + MUSIC_STYLE_SNOW, MUSIC_STYLE_ICE, MUSIC_STYLE_MEDIEVAL, + MUSIC_STYLE_URBAN, MUSIC_STYLE_ORGAN, MUSIC_STYLE_CUSTOM_MUSIC_1, + MUSIC_STYLE_CUSTOM_MUSIC_2, }; static std::vector window_ride_current_music_style_order; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 95028f8525..b34917ff6d 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -47,8 +47,8 @@ using namespace OpenRCT2::TrackMetaData; #pragma region Widgets -// clang-format off -enum { +enum +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -96,6 +96,7 @@ 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 static rct_widget window_ride_construction_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 3, 17}, {160, 57}, WindowWidgetType::Groupbox, WindowColour::Primary , STR_RIDE_CONSTRUCTION_DIRECTION ), @@ -135,26 +136,26 @@ static rct_widget window_ride_construction_widgets[] = { MakeWidget ({139, 338}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SIMULATE, STR_SIMULATE_RIDE_TIP ), WIDGETS_END, }; +// clang-format on #pragma endregion #pragma region Events -static void window_ride_construction_close(rct_window *w); -static void window_ride_construction_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_construction_resize(rct_window *w); -static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); -static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_construction_update(rct_window *w); +static void window_ride_construction_close(rct_window* w); +static void window_ride_construction_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_construction_resize(rct_window* w); +static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_construction_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_construction_update(rct_window* w); static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_construction_invalidate(rct_window *w); -static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_ride_construction_invalidate(rct_window* w); +static void window_ride_construction_paint(rct_window* w, rct_drawpixelinfo* dpi); static bool track_piece_direction_is_diagonal(const uint8_t direction); -//0x993EEC -static rct_window_event_list window_ride_construction_events([](auto& events) -{ +// 0x993EEC +static rct_window_event_list window_ride_construction_events([](auto& events) { events.close = &window_ride_construction_close; events.mouse_up = &window_ride_construction_mouseup; events.resize = &window_ride_construction_resize; @@ -173,265 +174,264 @@ static rct_window_event_list window_ride_construction_events([](auto& events) // rct2: 0x00999492 static constexpr const rct_string_id RideConfigurationStringIds[] = { - 0, // 0 - STR_STATION_PLATFORM, // 1 - 0, // 2 - 0, // 3 - 0, // 4 - 0, // 5 - 0, // 6 - 0, // 7 - 0, // 8 - 0, // 9 - 0, // 10 - 0, // 11 - 0, // 12 - 0, // 13 - 0, // 14 - 0, // 15 - 0, // 16 - 0, // 17 - 0, // 18 - 0, // 19 - 0, // 20 - 0, // 21 - 0, // 22 - 0, // 23 - 0, // 24 - 0, // 25 - 0, // 26 - 0, // 27 - 0, // 28 - 0, // 29 - 0, // 30 - 0, // 31 - 0, // 32 - 0, // 33 - 0, // 34 - 0, // 35 - 0, // 36 - 0, // 37 - STR_S_BEND_LEFT, // 38 - STR_S_BEND_RIGHT, // 39 - STR_VERTICAL_LOOP_LEFT, // 40 - STR_VERTICAL_LOOP_RIGHT, // 41 - 0, // 42 - 0, // 43 - 0, // 44 - 0, // 45 - 0, // 46 - 0, // 47 - 0, // 48 - 0, // 49 - 0, // 50 - 0, // 51 - STR_IN_LINE_TWIST_LEFT, // 52 - STR_IN_LINE_TWIST_RIGHT, // 53 - STR_IN_LINE_TWIST_LEFT, // 54 - STR_IN_LINE_TWIST_RIGHT, // 55 - STR_HALF_LOOP, // 56 - STR_HALF_LOOP, // 57 - STR_HALF_CORKSCREW_LEFT, // 58 - STR_HALF_CORKSCREW_RIGHT, // 59 - STR_HALF_CORKSCREW_LEFT, // 60 - STR_HALF_CORKSCREW_RIGHT, // 61 - 0, // 62 - 0, // 63 - 0, // 64 - 0, // 65 - STR_ENTRY_EXIT_PLATFORM, // 66 - STR_VERTICAL_TOWER, // 67 - 0, // 68 - 0, // 69 - 0, // 70 - 0, // 71 - 0, // 72 - 0, // 73 - 0, // 74 - 0, // 75 - 0, // 76 - 0, // 77 - 0, // 78 - 0, // 79 - 0, // 80 - 0, // 81 - 0, // 82 - STR_S_BEND_LEFT, // 83 - STR_S_BEND_RIGHT, // 84 - 0, // 85 - 0, // 86 - STR_HELIX_UP_SMALL, // 87 - STR_HELIX_UP_SMALL, // 88 - STR_HELIX_DOWN_SMALL, // 89 - STR_HELIX_DOWN_SMALL, // 90 - STR_HELIX_UP_LARGE, // 91 - STR_HELIX_UP_LARGE, // 92 - STR_HELIX_DOWN_LARGE, // 93 - STR_HELIX_DOWN_LARGE, // 94 - 0, // 95 - 0, // 96 - 0, // 97 - 0, // 98 - STR_BRAKES, // 99 - STR_BOOSTER, // 100 - 0, // 101 - STR_HELIX_UP_LARGE, // 102 - STR_HELIX_UP_LARGE, // 103 - STR_HELIX_DOWN_LARGE, // 104 - STR_HELIX_DOWN_LARGE, // 105 - STR_HELIX_UP_LEFT, // 106 - STR_HELIX_UP_RIGHT, // 107 - STR_HELIX_DOWN_LEFT, // 108 - STR_HELIX_DOWN_RIGHT, // 109 - STR_BASE_SIZE_2_X_2, // 110 - STR_BASE_SIZE_4_X_4, // 111 - STR_WATERFALLS, // 112 - STR_RAPIDS, // 113 - STR_ON_RIDE_PHOTO_SECTION, // 114 - STR_BASE_SIZE_2_X_4, // 115 - STR_BASE_SIZE_5_X_1, // 116 - STR_WATER_SPLASH, // 117 - 0, // 118 - 0, // 119 - STR_WHIRLPOOL, // 120 - 0, // 121 - 0, // 122 - STR_CABLE_LIFT_HILL, // 123 - STR_SLOPE_UP_TO_VERTICAL, // 124 - STR_VERTICAL_TRACK, // 125 - 0, // 126 - 0, // 127 - 0, // 128 - 0, // 129 - 0, // 130 - 0, // 131 - STR_HOLDING_BRAKE_FOR_DROP, // 132 - 0, // 133 - 0, // 134 - 0, // 135 - 0, // 136 - 0, // 137 - 0, // 138 - 0, // 139 - 0, // 140 - 0, // 141 - 0, // 142 - 0, // 143 - 0, // 144 - 0, // 145 - 0, // 146 - 0, // 147 - 0, // 148 - 0, // 149 - 0, // 150 - 0, // 151 - 0, // 152 - 0, // 153 - 0, // 154 - 0, // 155 - 0, // 156 - 0, // 157 - 0, // 158 - 0, // 159 - 0, // 160 - 0, // 161 - 0, // 162 - 0, // 163 - 0, // 164 - 0, // 165 - 0, // 166 - 0, // 167 - 0, // 168 - 0, // 169 - 0, // 170 - 0, // 171 - STR_REVERSER_TURNTABLE, // 172 - STR_SPINNING_TUNNEL, // 173 - STR_BARREL_ROLL_LEFT, // 174 - STR_BARREL_ROLL_RIGHT, // 175 - STR_BARREL_ROLL_LEFT, // 176 - STR_BARREL_ROLL_RIGHT, // 177 - 0, // 178 - 0, // 179 - 0, // 180 - 0, // 181 - STR_LAUNCHED_LIFT_HILL, // 182 - STR_LARGE_HALF_LOOP_LEFT, // 183 - STR_LARGE_HALF_LOOP_RIGHT, // 184 - STR_LARGE_HALF_LOOP_LEFT, // 185 - STR_LARGE_HALF_LOOP_RIGHT, // 186 - STR_IN_LINE_TWIST_LEFT, // 187 - STR_IN_LINE_TWIST_RIGHT, // 188 - STR_IN_LINE_TWIST_LEFT, // 189 - STR_IN_LINE_TWIST_RIGHT, // 190 - STR_HALF_LOOP, // 191 - STR_HALF_LOOP, // 192 - STR_HALF_CORKSCREW_LEFT, // 193 - STR_HALF_CORKSCREW_RIGHT, // 194 - STR_HALF_CORKSCREW_LEFT, // 195 - STR_HALF_CORKSCREW_RIGHT, // 196 - STR_UPPER_TRANSFER, // 197 - STR_LOWER_TRANSFER, // 198 - STR_HEARTLINE_ROLL_LEFT, // 199 - STR_HEARTLINE_ROLL_RIGHT, // 200 - STR_GOLF_HOLE_A, // 201 - STR_GOLF_HOLE_B, // 202 - STR_GOLF_HOLE_C, // 203 - STR_GOLF_HOLE_D, // 204 - STR_GOLF_HOLE_E, // 205 - STR_QUARTER_LOOP, // 206 - STR_QUARTER_LOOP, // 207 - STR_QUARTER_LOOP, // 208 - STR_CURVED_LIFT_HILL_LEFT, // 209 - STR_CURVED_LIFT_HILL_RIGHT, // 210 - STR_REVERSER_LEFT, // 211 - STR_REVERSER_RIGHT, // 212 - STR_TOP_SECTION, // 213 - STR_VERTICAL_TRACK, // 214 - STR_SLOPE_TO_LEVEL, // 215 - STR_BLOCK_BRAKES, // 216 - 0, // 217 - 0, // 218 - 0, // 219 - 0, // 220 - 0, // 221 - 0, // 222 - 0, // 223 - 0, // 224 - 0, // 225 - 0, // 226 - 0, // 227 - 0, // 228 - 0, // 229 - 0, // 230 - 0, // 231 - 0, // 232 - 0, // 233 - 0, // 234 - 0, // 235 - 0, // 236 - 0, // 237 - 0, // 238 - 0, // 239 - 0, // 240 - 0, // 241 - 0, // 242 - 0, // 243 - 0, // 244 - 0, // 245 - 0, // 246 - 0, // 247 - 0, // 248 - 0, // 249 - 0, // 250 - 0, // 251 - 0, // 252 - STR_QUARTER_LOOP, // 253 - STR_QUARTER_LOOP, // 254 - STR_QUARTER_LOOP, // 255 - STR_SPINNING_CONTROL_TOGGLE_TRACK, // 256 + 0, // 0 + STR_STATION_PLATFORM, // 1 + 0, // 2 + 0, // 3 + 0, // 4 + 0, // 5 + 0, // 6 + 0, // 7 + 0, // 8 + 0, // 9 + 0, // 10 + 0, // 11 + 0, // 12 + 0, // 13 + 0, // 14 + 0, // 15 + 0, // 16 + 0, // 17 + 0, // 18 + 0, // 19 + 0, // 20 + 0, // 21 + 0, // 22 + 0, // 23 + 0, // 24 + 0, // 25 + 0, // 26 + 0, // 27 + 0, // 28 + 0, // 29 + 0, // 30 + 0, // 31 + 0, // 32 + 0, // 33 + 0, // 34 + 0, // 35 + 0, // 36 + 0, // 37 + STR_S_BEND_LEFT, // 38 + STR_S_BEND_RIGHT, // 39 + STR_VERTICAL_LOOP_LEFT, // 40 + STR_VERTICAL_LOOP_RIGHT, // 41 + 0, // 42 + 0, // 43 + 0, // 44 + 0, // 45 + 0, // 46 + 0, // 47 + 0, // 48 + 0, // 49 + 0, // 50 + 0, // 51 + STR_IN_LINE_TWIST_LEFT, // 52 + STR_IN_LINE_TWIST_RIGHT, // 53 + STR_IN_LINE_TWIST_LEFT, // 54 + STR_IN_LINE_TWIST_RIGHT, // 55 + STR_HALF_LOOP, // 56 + STR_HALF_LOOP, // 57 + STR_HALF_CORKSCREW_LEFT, // 58 + STR_HALF_CORKSCREW_RIGHT, // 59 + STR_HALF_CORKSCREW_LEFT, // 60 + STR_HALF_CORKSCREW_RIGHT, // 61 + 0, // 62 + 0, // 63 + 0, // 64 + 0, // 65 + STR_ENTRY_EXIT_PLATFORM, // 66 + STR_VERTICAL_TOWER, // 67 + 0, // 68 + 0, // 69 + 0, // 70 + 0, // 71 + 0, // 72 + 0, // 73 + 0, // 74 + 0, // 75 + 0, // 76 + 0, // 77 + 0, // 78 + 0, // 79 + 0, // 80 + 0, // 81 + 0, // 82 + STR_S_BEND_LEFT, // 83 + STR_S_BEND_RIGHT, // 84 + 0, // 85 + 0, // 86 + STR_HELIX_UP_SMALL, // 87 + STR_HELIX_UP_SMALL, // 88 + STR_HELIX_DOWN_SMALL, // 89 + STR_HELIX_DOWN_SMALL, // 90 + STR_HELIX_UP_LARGE, // 91 + STR_HELIX_UP_LARGE, // 92 + STR_HELIX_DOWN_LARGE, // 93 + STR_HELIX_DOWN_LARGE, // 94 + 0, // 95 + 0, // 96 + 0, // 97 + 0, // 98 + STR_BRAKES, // 99 + STR_BOOSTER, // 100 + 0, // 101 + STR_HELIX_UP_LARGE, // 102 + STR_HELIX_UP_LARGE, // 103 + STR_HELIX_DOWN_LARGE, // 104 + STR_HELIX_DOWN_LARGE, // 105 + STR_HELIX_UP_LEFT, // 106 + STR_HELIX_UP_RIGHT, // 107 + STR_HELIX_DOWN_LEFT, // 108 + STR_HELIX_DOWN_RIGHT, // 109 + STR_BASE_SIZE_2_X_2, // 110 + STR_BASE_SIZE_4_X_4, // 111 + STR_WATERFALLS, // 112 + STR_RAPIDS, // 113 + STR_ON_RIDE_PHOTO_SECTION, // 114 + STR_BASE_SIZE_2_X_4, // 115 + STR_BASE_SIZE_5_X_1, // 116 + STR_WATER_SPLASH, // 117 + 0, // 118 + 0, // 119 + STR_WHIRLPOOL, // 120 + 0, // 121 + 0, // 122 + STR_CABLE_LIFT_HILL, // 123 + STR_SLOPE_UP_TO_VERTICAL, // 124 + STR_VERTICAL_TRACK, // 125 + 0, // 126 + 0, // 127 + 0, // 128 + 0, // 129 + 0, // 130 + 0, // 131 + STR_HOLDING_BRAKE_FOR_DROP, // 132 + 0, // 133 + 0, // 134 + 0, // 135 + 0, // 136 + 0, // 137 + 0, // 138 + 0, // 139 + 0, // 140 + 0, // 141 + 0, // 142 + 0, // 143 + 0, // 144 + 0, // 145 + 0, // 146 + 0, // 147 + 0, // 148 + 0, // 149 + 0, // 150 + 0, // 151 + 0, // 152 + 0, // 153 + 0, // 154 + 0, // 155 + 0, // 156 + 0, // 157 + 0, // 158 + 0, // 159 + 0, // 160 + 0, // 161 + 0, // 162 + 0, // 163 + 0, // 164 + 0, // 165 + 0, // 166 + 0, // 167 + 0, // 168 + 0, // 169 + 0, // 170 + 0, // 171 + STR_REVERSER_TURNTABLE, // 172 + STR_SPINNING_TUNNEL, // 173 + STR_BARREL_ROLL_LEFT, // 174 + STR_BARREL_ROLL_RIGHT, // 175 + STR_BARREL_ROLL_LEFT, // 176 + STR_BARREL_ROLL_RIGHT, // 177 + 0, // 178 + 0, // 179 + 0, // 180 + 0, // 181 + STR_LAUNCHED_LIFT_HILL, // 182 + STR_LARGE_HALF_LOOP_LEFT, // 183 + STR_LARGE_HALF_LOOP_RIGHT, // 184 + STR_LARGE_HALF_LOOP_LEFT, // 185 + STR_LARGE_HALF_LOOP_RIGHT, // 186 + STR_IN_LINE_TWIST_LEFT, // 187 + STR_IN_LINE_TWIST_RIGHT, // 188 + STR_IN_LINE_TWIST_LEFT, // 189 + STR_IN_LINE_TWIST_RIGHT, // 190 + STR_HALF_LOOP, // 191 + STR_HALF_LOOP, // 192 + STR_HALF_CORKSCREW_LEFT, // 193 + STR_HALF_CORKSCREW_RIGHT, // 194 + STR_HALF_CORKSCREW_LEFT, // 195 + STR_HALF_CORKSCREW_RIGHT, // 196 + STR_UPPER_TRANSFER, // 197 + STR_LOWER_TRANSFER, // 198 + STR_HEARTLINE_ROLL_LEFT, // 199 + STR_HEARTLINE_ROLL_RIGHT, // 200 + STR_GOLF_HOLE_A, // 201 + STR_GOLF_HOLE_B, // 202 + STR_GOLF_HOLE_C, // 203 + STR_GOLF_HOLE_D, // 204 + STR_GOLF_HOLE_E, // 205 + STR_QUARTER_LOOP, // 206 + STR_QUARTER_LOOP, // 207 + STR_QUARTER_LOOP, // 208 + STR_CURVED_LIFT_HILL_LEFT, // 209 + STR_CURVED_LIFT_HILL_RIGHT, // 210 + STR_REVERSER_LEFT, // 211 + STR_REVERSER_RIGHT, // 212 + STR_TOP_SECTION, // 213 + STR_VERTICAL_TRACK, // 214 + STR_SLOPE_TO_LEVEL, // 215 + STR_BLOCK_BRAKES, // 216 + 0, // 217 + 0, // 218 + 0, // 219 + 0, // 220 + 0, // 221 + 0, // 222 + 0, // 223 + 0, // 224 + 0, // 225 + 0, // 226 + 0, // 227 + 0, // 228 + 0, // 229 + 0, // 230 + 0, // 231 + 0, // 232 + 0, // 233 + 0, // 234 + 0, // 235 + 0, // 236 + 0, // 237 + 0, // 238 + 0, // 239 + 0, // 240 + 0, // 241 + 0, // 242 + 0, // 243 + 0, // 244 + 0, // 245 + 0, // 246 + 0, // 247 + 0, // 248 + 0, // 249 + 0, // 250 + 0, // 251 + 0, // 252 + STR_QUARTER_LOOP, // 253 + STR_QUARTER_LOOP, // 254 + STR_QUARTER_LOOP, // 255 + STR_SPINNING_CONTROL_TOGGLE_TRACK, // 256 }; -// clang-format on #pragma endregion diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 7cbfb545c3..be837d8a6f 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -29,15 +29,16 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; static constexpr const int32_t WH = 240; static constexpr const int32_t WW = 340; -// clang-format off -enum { +enum +{ PAGE_RIDES, PAGE_SHOPS_AND_STALLS, PAGE_KIOSKS_AND_FACILITIES, PAGE_COUNT }; -enum WINDOW_RIDE_LIST_WIDGET_IDX { +enum WINDOW_RIDE_LIST_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -55,6 +56,7 @@ enum WINDOW_RIDE_LIST_WIDGET_IDX { WIDX_QUICK_DEMOLISH, }; +// clang-format off static rct_widget window_ride_list_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {340, 197}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab page background @@ -71,24 +73,24 @@ static rct_widget window_ride_list_widgets[] = { MakeWidget({315, 90}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_QUICK_DEMOLISH_RIDE ), WIDGETS_END, }; +// clang-format on static bool _quickDemolishMode = false; static std::vector _rideList; -static void window_ride_list_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_ride_list_resize(rct_window *w); -static void window_ride_list_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_ride_list_update(rct_window *w); -static void window_ride_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_ride_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_ride_list_invalidate(rct_window *w); -static void window_ride_list_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_ride_list_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_ride_list_resize(rct_window* w); +static void window_ride_list_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_ride_list_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_ride_list_update(rct_window* w); +static void window_ride_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_ride_list_invalidate(rct_window* w); +static void window_ride_list_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static rct_window_event_list window_ride_list_events([](auto& events) -{ +static rct_window_event_list window_ride_list_events([](auto& events) { events.mouse_up = &window_ride_list_mouseup; events.resize = &window_ride_list_resize; events.mouse_down = &window_ride_list_mousedown; @@ -102,7 +104,8 @@ static rct_window_event_list window_ride_list_events([](auto& events) events.scroll_paint = &window_ride_list_scrollpaint; }); -enum { +enum +{ INFORMATION_TYPE_STATUS, INFORMATION_TYPE_POPULARITY, INFORMATION_TYPE_SATISFACTION, @@ -118,7 +121,7 @@ enum { INFORMATION_TYPE_RELIABILITY, INFORMATION_TYPE_DOWN_TIME, INFORMATION_TYPE_GUESTS_FAVOURITE, - DROPDOWN_LIST_COUNT + DROPDOWN_LIST_COUNT, }; static constexpr const rct_string_id ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { @@ -136,7 +139,7 @@ static constexpr const rct_string_id ride_info_type_string_mapping[DROPDOWN_LIST STR_QUEUE_TIME, STR_RELIABILITY, STR_DOWN_TIME, - STR_GUESTS_FAVOURITE + STR_GUESTS_FAVOURITE, }; static constexpr const rct_string_id ride_list_statusbar_count_strings[PAGE_COUNT] = { @@ -146,21 +149,21 @@ static constexpr const rct_string_id ride_list_statusbar_count_strings[PAGE_COUN }; static constexpr const bool ride_info_type_money_mapping[DROPDOWN_LIST_COUNT] = { - false, - false, - false, - true, - false, - true, - false, - false, - true, - true, - false, - false, - false, - false, - false + 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 }; static constexpr const rct_string_id page_names[] = { @@ -168,7 +171,6 @@ static constexpr const rct_string_id page_names[] = { STR_SHOPS_AND_STALLS, STR_RESTROOMS_AND_INFORMATION_KIOSKS, }; -// clang-format on static int32_t _window_ride_list_information_type = INFORMATION_TYPE_STATUS; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 9e208678c5..f6d7891805 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -35,14 +35,15 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; static constexpr const int32_t WW = 190; static constexpr const int32_t WH = 180; -// clang-format off -enum WINDOW_STAFF_PAGE { +enum WINDOW_STAFF_PAGE +{ WINDOW_STAFF_OVERVIEW, WINDOW_STAFF_OPTIONS, WINDOW_STAFF_STATISTICS, }; -enum WINDOW_STAFF_WIDGET_IDX { +enum WINDOW_STAFF_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -70,6 +71,7 @@ enum WINDOW_STAFF_WIDGET_IDX { 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 */ \ @@ -100,63 +102,63 @@ static rct_widget window_staff_options_widgets[] = { MakeWidget ({WW - 17, 51}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_COSTUME_TIP), // Costume Dropdown Button WIDGETS_END, }; +// clang-format on -//0x9AF9F4 +// 0x9AF9F4 static rct_widget window_staff_stats_widgets[] = { MAIN_STAFF_WIDGETS, WIDGETS_END, }; -static rct_widget *window_staff_page_widgets[] = { +static rct_widget* window_staff_page_widgets[] = { window_staff_overview_widgets, window_staff_options_widgets, - window_staff_stats_widgets + window_staff_stats_widgets, }; static void window_staff_set_page(rct_window* w, int32_t page); static void window_staff_disable_widgets(rct_window* w); -static void window_staff_unknown_05(rct_window *w); +static void window_staff_unknown_05(rct_window* w); static void window_staff_viewport_init(rct_window* w); -static void window_staff_overview_close(rct_window *w); -static void window_staff_overview_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_staff_overview_resize(rct_window *w); -static void window_staff_overview_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_staff_overview_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_staff_overview_close(rct_window* w); +static void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_staff_overview_resize(rct_window* w); +static void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); static void window_staff_overview_update(rct_window* w); -static void window_staff_overview_invalidate(rct_window *w); -static void window_staff_overview_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_staff_overview_invalidate(rct_window* w); +static void window_staff_overview_paint(rct_window* w, rct_drawpixelinfo* dpi); static void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi); static void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); -static void window_staff_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex); -static void window_staff_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_staff_overview_viewport_rotate(rct_window *w); -static void window_staff_follow(rct_window *w); +static void window_staff_overview_tool_abort(rct_window* w, rct_widgetindex widgetIndex); +static void window_staff_overview_text_input(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_staff_overview_viewport_rotate(rct_window* w); +static void window_staff_follow(rct_window* w); static void window_staff_show_locate_dropdown(rct_window* w, rct_widget* widget); -static void window_staff_options_mouseup(rct_window *w, rct_widgetindex widgetIndex); +static void window_staff_options_mouseup(rct_window* w, rct_widgetindex widgetIndex); static void window_staff_options_update(rct_window* w); -static void window_staff_options_invalidate(rct_window *w); -static void window_staff_options_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_staff_options_invalidate(rct_window* w); +static void window_staff_options_paint(rct_window* w, rct_drawpixelinfo* dpi); static void window_staff_options_tab_paint(rct_window* w, rct_drawpixelinfo* dpi); -static void window_staff_options_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_staff_options_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_staff_options_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_staff_options_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_staff_stats_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_staff_stats_resize(rct_window *w); +static void window_staff_stats_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_staff_stats_resize(rct_window* w); static void window_staff_stats_update(rct_window* w); -static void window_staff_stats_invalidate(rct_window *w); -static void window_staff_stats_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_staff_stats_invalidate(rct_window* w); +static void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi); static void window_staff_stats_tab_paint(rct_window* w, rct_drawpixelinfo* dpi); void window_staff_set_colours(); // 0x992AEC -static rct_window_event_list window_staff_overview_events([](auto& events) -{ +static rct_window_event_list window_staff_overview_events([](auto& events) { events.close = &window_staff_overview_close; events.mouse_up = &window_staff_overview_mouseup; events.resize = &window_staff_overview_resize; @@ -175,8 +177,7 @@ static rct_window_event_list window_staff_overview_events([](auto& events) }); // 0x992B5C -static rct_window_event_list window_staff_options_events([](auto& events) -{ +static rct_window_event_list window_staff_options_events([](auto& events) { events.mouse_up = &window_staff_options_mouseup; events.resize = &window_staff_stats_resize; events.mouse_down = &window_staff_options_mousedown; @@ -188,8 +189,7 @@ static rct_window_event_list window_staff_options_events([](auto& events) }); // 0x992BCC -static rct_window_event_list window_staff_stats_events([](auto& events) -{ +static rct_window_event_list window_staff_stats_events([](auto& events) { events.mouse_up = &window_staff_stats_mouseup; events.resize = &window_staff_stats_resize; events.unknown_05 = &window_staff_unknown_05; @@ -198,12 +198,13 @@ static rct_window_event_list window_staff_stats_events([](auto& events) events.paint = &window_staff_stats_paint; }); -static rct_window_event_list *window_staff_page_events[] = { +static rct_window_event_list* window_staff_page_events[] = { &window_staff_overview_events, &window_staff_options_events, - &window_staff_stats_events + &window_staff_stats_events, }; +// clang-format off static constexpr const uint32_t window_staff_page_enabled_widgets[] = { (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB_1) | diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 6861f3c471..cf2d5e0d72 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -21,8 +21,8 @@ #include #include -// clang-format off -enum { +enum +{ WINDOW_THEMES_TAB_SETTINGS, WINDOW_THEMES_TAB_MAIN_UI, WINDOW_THEMES_TAB_PARK, @@ -35,22 +35,21 @@ enum { WINDOW_THEMES_TAB_COUNT }; -static void window_themes_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_themes_resize(rct_window *w); -static void window_themes_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_themes_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_themes_update(rct_window *w); -static void window_themes_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_themes_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_themes_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_themes_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static void window_themes_invalidate(rct_window *w); -static void window_themes_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_themes_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); -static void window_themes_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w); +static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_themes_resize(rct_window* w); +static void window_themes_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_themes_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_themes_update(rct_window* w); +static void window_themes_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_themes_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_themes_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_themes_invalidate(rct_window* w); +static void window_themes_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); +static void window_themes_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w); -static rct_window_event_list window_themes_events([](auto& events) -{ +static rct_window_event_list window_themes_events([](auto& events) { events.mouse_up = &window_themes_mouseup; events.resize = &window_themes_resize; events.mouse_down = &window_themes_mousedown; @@ -65,7 +64,8 @@ static rct_window_event_list window_themes_events([](auto& events) events.scroll_paint = &window_themes_scrollpaint; }); -enum WINDOW_THEMES_WIDGET_IDX { +enum WINDOW_THEMES_WIDGET_IDX +{ WIDX_THEMES_BACKGROUND, WIDX_THEMES_TITLE, WIDX_THEMES_CLOSE, @@ -98,6 +98,7 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_THEMES_TITLE; static constexpr const int32_t WW = 320; static constexpr const int32_t WH = 107; +// clang-format off static rct_widget window_themes_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {320, 64}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel @@ -135,7 +136,7 @@ static int32_t window_themes_tab_animation_loops[] = { 32, 8, 14, - 38 + 38, }; static int32_t window_themes_tab_animation_divisor[] = { 4, @@ -146,7 +147,7 @@ static int32_t window_themes_tab_animation_divisor[] = { 2, 2, 2, - 2 + 2, }; static int32_t window_themes_tab_sprites[] = { SPR_TAB_PAINT_0, @@ -157,7 +158,7 @@ static int32_t window_themes_tab_sprites[] = { SPR_TAB_WRENCH_0, SPR_TAB_GEARS_0, SPR_TAB_STAFF_OPTIONS_0, - SPR_TAB_FINANCES_MARKETING_0 + SPR_TAB_FINANCES_MARKETING_0, }; static rct_windowclass window_themes_tab_1_classes[] = { @@ -168,7 +169,7 @@ static rct_windowclass window_themes_tab_1_classes[] = { WC_TITLE_MENU, WC_TITLE_EXIT, WC_TITLE_OPTIONS, - WC_SCENARIO_SELECT + WC_SCENARIO_SELECT, }; static rct_windowclass window_themes_tab_2_classes[] = { @@ -178,7 +179,7 @@ static rct_windowclass window_themes_tab_2_classes[] = { WC_RESEARCH, WC_MAP, WC_VIEWPORT, - WC_RECENT_NEWS + WC_RECENT_NEWS, }; static rct_windowclass window_themes_tab_3_classes[] = { @@ -192,7 +193,7 @@ static rct_windowclass window_themes_tab_3_classes[] = { WC_RIDE_CONSTRUCTION, WC_TRACK_DESIGN_PLACE, WC_CONSTRUCT_RIDE, - WC_TRACK_DESIGN_LIST + WC_TRACK_DESIGN_LIST, }; static rct_windowclass window_themes_tab_4_classes[] = { @@ -202,7 +203,7 @@ static rct_windowclass window_themes_tab_4_classes[] = { WC_GUEST_LIST, WC_STAFF, WC_STAFF_LIST, - WC_BANNER + WC_BANNER, }; static rct_windowclass window_themes_tab_5_classes[] = { @@ -212,7 +213,7 @@ static rct_windowclass window_themes_tab_5_classes[] = { WC_EDITOR_OBJECTIVE_OPTIONS, WC_MAPGEN, WC_MANAGE_TRACK_DESIGN, - WC_INSTALL_TRACK + WC_INSTALL_TRACK, }; static rct_windowclass window_themes_tab_6_classes[] = { @@ -242,8 +243,9 @@ static rct_windowclass window_themes_tab_7_classes[] = { WC_LOADSAVE_OVERWRITE_PROMPT, WC_NETWORK_STATUS, }; +// clang-format on -static rct_windowclass *window_themes_tab_classes[] = { +static rct_windowclass* window_themes_tab_classes[] = { nullptr, window_themes_tab_1_classes, window_themes_tab_2_classes, @@ -253,7 +255,6 @@ static rct_windowclass *window_themes_tab_classes[] = { window_themes_tab_6_classes, window_themes_tab_7_classes, }; -// clang-format on static uint8_t _selected_tab = 0; static int16_t _colour_index_1 = -1; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 2eda35345c..69519de644 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -34,7 +34,6 @@ #include #include -// clang-format off static constexpr const rct_string_id EntranceTypeStringIds[] = { STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_ENTRANCE, STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_EXIT, @@ -44,17 +43,18 @@ static constexpr const rct_string_id EntranceTypeStringIds[] = { static constexpr const rct_string_id ParkEntrancePartStringIds[] = { STR_TILE_INSPECTOR_ENTRANCE_MIDDLE, STR_TILE_INSPECTOR_ENTRANCE_LEFT, - STR_TILE_INSPECTOR_ENTRANCE_RIGHT + STR_TILE_INSPECTOR_ENTRANCE_RIGHT, }; static constexpr const rct_string_id WallSlopeStringIds[] = { STR_TILE_INSPECTOR_WALL_FLAT, STR_TILE_INSPECTOR_WALL_SLOPED_LEFT, STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT, - STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME + STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, }; -enum WINDOW_TILE_INSPECTOR_WIDGET_IDX { +enum WINDOW_TILE_INSPECTOR_WIDGET_IDX +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -180,18 +180,18 @@ constexpr int32_t MIN_WH = 130; constexpr int32_t MAX_WH = 800; // Button space for top buttons -constexpr int32_t BW = WW - 5; // Button's right side -constexpr int32_t BX = BW - 23; // Button's left side -constexpr int32_t BY = 17; // Button's Top -constexpr int32_t BH = BY + 23; // Button's Bottom +constexpr int32_t BW = WW - 5; // Button's right side +constexpr int32_t BX = BW - 23; // Button's left side +constexpr int32_t BY = 17; // Button's Top +constexpr int32_t BH = BY + 23; // Button's Bottom constexpr int32_t BS = 24; // Column offsets for the table headers -constexpr int32_t COL_X_TYPE = 3; // Type -constexpr int32_t COL_X_BH = COL_X_TYPE + 312; // Base height -constexpr int32_t COL_X_CH = COL_X_BH + 20; // Clearance height -constexpr int32_t COL_X_GF = COL_X_CH + 20; // Ghost flag -constexpr int32_t COL_X_LF = COL_X_GF + 12; // Last for tile flag +constexpr int32_t COL_X_TYPE = 3; // Type +constexpr int32_t COL_X_BH = COL_X_TYPE + 312; // Base height +constexpr int32_t COL_X_CH = COL_X_BH + 20; // Clearance height +constexpr int32_t COL_X_GF = COL_X_CH + 20; // Ghost flag +constexpr int32_t COL_X_LF = COL_X_GF + 12; // Last for tile flag constexpr int32_t PADDING_BOTTOM = 15; constexpr int32_t GROUPBOX_PADDING = 6; @@ -200,6 +200,7 @@ constexpr int32_t VERTICAL_GROUPBOX_PADDING = 4; constexpr int32_t BUTTONW = 130; constexpr int32_t BUTTONH = 17; +// clang-format off // Calculates the .left, .right, .top and .bottom for buttons in a group box. // Buttons are used as reference points for all other widgets in the group boxes. #define GBBL(col) (12 + col * (BUTTONW + HORIZONTAL_GROUPBOX_PADDING)) @@ -387,8 +388,10 @@ static rct_widget *PageWidgets[] = { BannerWidgets, CorruptWidgets, }; +// clang-format on -static struct { +static struct +{ // Offsets from the bottom of the window int16_t details_top_offset, details_bottom_offset; int16_t properties_top_offset, properties_bottom_offset; @@ -403,10 +406,9 @@ static struct { { WALL_GBDT, WALL_GBDB, WALL_GBPT, WALL_GBPB, STR_TILE_INSPECTOR_GROUPBOX_WALL_INFO }, { LAR_GBDT, LAR_GBDB, LAR_GBPT, LAR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_LARGE_SCENERY_INFO }, { BAN_GBDT, BAN_GBDB, BAN_GBPT, BAN_GBPB, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO }, - { COR_GBDT, COR_GBDB, COR_GBPT, COR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_CORRUPT_INFO } + { COR_GBDT, COR_GBDB, COR_GBPT, COR_GBPB, STR_TILE_INSPECTOR_GROUPBOX_CORRUPT_INFO }, }; -// clang-format on static constexpr int32_t ViewportInteractionFlags = EnumsToFlags( ViewportInteractionItem::Terrain, ViewportInteractionItem::Entity, ViewportInteractionItem::Ride, ViewportInteractionItem::Scenery, ViewportInteractionItem::Footpath, ViewportInteractionItem::FootpathItem, @@ -441,9 +443,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* static void window_tile_inspector_set_page(rct_window* w, const TileInspectorPage page); static void window_tile_inspector_close(rct_window* w); -// clang-format off -static rct_window_event_list TileInspectorWindowEvents([](auto& events) -{ +static rct_window_event_list TileInspectorWindowEvents([](auto& events) { events.mouse_up = &window_tile_inspector_mouseup; events.resize = &window_tile_inspector_resize; events.mouse_down = &window_tile_inspector_mousedown; @@ -461,6 +461,7 @@ static rct_window_event_list TileInspectorWindowEvents([](auto& events) events.close = &window_tile_inspector_close; }); +// clang-format off static uint64_t PageEnabledWidgets[] = { (1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT), (1ULL << WIDX_CLOSE) | (1ULL << WIDX_BUTTON_CORRUPT) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_SURFACE_BUTTON_REMOVE_FENCES) | (1ULL << WIDX_SURFACE_BUTTON_RESTORE_FENCES) | (1ULL << WIDX_SURFACE_CHECK_CORNER_N) | (1ULL << WIDX_SURFACE_CHECK_CORNER_E) | (1ULL << WIDX_SURFACE_CHECK_CORNER_S) | (1ULL << WIDX_SURFACE_CHECK_CORNER_W) | (1ULL << WIDX_SURFACE_CHECK_DIAGONAL), @@ -2013,10 +2014,12 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) if (sceneryEntry != nullptr && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) { int16_t quadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); - static rct_string_id quadrant_string_idx[] = { STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE }; + static constexpr rct_string_id quadrant_string_idx[] = { + 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(quadrant_string_idx[quadrant]); DrawTextBasic( diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index bca3f5f4db..034e9bc372 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -35,38 +35,37 @@ using namespace OpenRCT2; -// clang-format off -enum WINDOW_TITLE_EDITOR_TAB { +enum WINDOW_TITLE_EDITOR_TAB +{ WINDOW_TITLE_EDITOR_TAB_PRESETS, WINDOW_TITLE_EDITOR_TAB_SAVES, WINDOW_TITLE_EDITOR_TAB_SCRIPT, WINDOW_TITLE_EDITOR_TAB_COUNT }; -static void window_title_editor_close(rct_window * w); -static void window_title_editor_mouseup(rct_window * w, rct_widgetindex widgetIndex); -static void window_title_editor_resize(rct_window * w); -static void window_title_editor_mousedown(rct_window * w, rct_widgetindex widgetIndex, rct_widget * widget); -static void window_title_editor_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_title_editor_update(rct_window * w); -static void window_title_editor_scrollgetsize(rct_window * w, int32_t scrollIndex, int32_t * width, int32_t * height); -static void window_title_editor_scrollmousedown(rct_window * w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_title_editor_scrollmouseover(rct_window * w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_title_editor_textinput(rct_window * w, rct_widgetindex widgetIndex, char * text); -static void window_title_editor_invalidate(rct_window * w); -static void window_title_editor_paint(rct_window * w, rct_drawpixelinfo * dpi); -static void window_title_editor_scrollpaint(rct_window * w, rct_drawpixelinfo * dpi, int32_t scrollIndex); -static void window_title_editor_scrollpaint_saves(rct_window * w, rct_drawpixelinfo * dpi); -static void window_title_editor_scrollpaint_commands(rct_window * w, rct_drawpixelinfo * dpi); -static void window_title_editor_draw_tab_images(rct_drawpixelinfo * dpi, rct_window * w); +static void window_title_editor_close(rct_window* w); +static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_title_editor_resize(rct_window* w); +static void window_title_editor_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_title_editor_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_title_editor_update(rct_window* w); +static void window_title_editor_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_title_editor_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_title_editor_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_title_editor_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static void window_title_editor_invalidate(rct_window* w); +static void window_title_editor_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_title_editor_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); +static void window_title_editor_scrollpaint_saves(rct_window* w, rct_drawpixelinfo* dpi); +static void window_title_editor_scrollpaint_commands(rct_window* w, rct_drawpixelinfo* dpi); +static void window_title_editor_draw_tab_images(rct_drawpixelinfo* dpi, rct_window* w); static void window_title_editor_load_sequence(size_t index); -static ITitleSequencePlayer * window_title_editor_get_player(); +static ITitleSequencePlayer* window_title_editor_get_player(); static bool window_title_editor_check_can_edit(); -static void window_title_editor_add_park_callback(int32_t result, const utf8 * path); -static void window_title_editor_rename_park(size_t index, const utf8 * name); +static void window_title_editor_add_park_callback(int32_t result, const utf8* path); +static void window_title_editor_rename_park(size_t index, const utf8* name); -static rct_window_event_list window_title_editor_events([](auto& events) -{ +static rct_window_event_list window_title_editor_events([](auto& events) { events.close = &window_title_editor_close; events.mouse_up = &window_title_editor_mouseup; events.resize = &window_title_editor_resize; @@ -82,7 +81,8 @@ static rct_window_event_list window_title_editor_events([](auto& events) events.scroll_paint = &window_title_editor_scrollpaint; }); -enum WINDOW_TITLE_EDITOR_WIDGET_IDX { +enum WINDOW_TITLE_EDITOR_WIDGET_IDX +{ WIDX_TITLE_EDITOR_BACKGROUND, WIDX_TITLE_EDITOR_TITLE, WIDX_TITLE_EDITOR_CLOSE, @@ -110,7 +110,7 @@ enum WINDOW_TITLE_EDITOR_WIDGET_IDX { WIDX_TITLE_EDITOR_INSERT, WIDX_TITLE_EDITOR_EDIT, WIDX_TITLE_EDITOR_DELETE, - //WIDX_TITLE_EDITOR_RELOAD, + // WIDX_TITLE_EDITOR_RELOAD, WIDX_TITLE_EDITOR_SKIP_TO, WIDX_TITLE_EDITOR_MOVE_DOWN, @@ -135,6 +135,7 @@ static constexpr const ScreenSize REORDER_BTN = { 36, 14 }; static constexpr int32_t SCROLL_WIDTH = 350; +// clang-format off static rct_widget window_title_editor_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, { 320, 84}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel @@ -173,32 +174,32 @@ static rct_widget window_title_editor_widgets[] = { MakeWidget ({ 62, 238}, PLAYBACK_BTN, WindowWidgetType::ImgBtn, WindowColour::Secondary, SPR_G2_TITLE_SKIP, STR_TITLE_EDITOR_ACTION_SKIP_TIP ), // Skip WIDGETS_END, }; +// clang-format on static size_t _selectedTitleSequence = SIZE_MAX; static bool _isSequenceReadOnly; static std::unique_ptr _editingTitleSequence; -static const utf8 * _sequenceName; +static const utf8* _sequenceName; -static utf8 * _renameSavePath = nullptr; +static utf8* _renameSavePath = nullptr; static int16_t _window_title_editor_highlighted_index; static int32_t window_title_editor_tab_animation_loops[] = { 64, 1, - 28 + 28, }; static int32_t window_title_editor_tab_animation_divisor[] = { 4, 1, - 4 + 4, }; static int32_t window_title_editor_tab_sprites[] = { SPR_TAB_RIDE_0, SPR_FLOPPY, - SPR_TAB_STATS_0 + SPR_TAB_STATS_0, }; -// clang-format on void window_title_editor_open(int32_t tab) { diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 3fb9c53b5e..0fa790d3bb 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -70,8 +70,8 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; -// clang-format off -enum { +enum +{ WIDX_PAUSE, WIDX_FILE_MENU, WIDX_MUTE, @@ -110,7 +110,8 @@ 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 FILE_MENU_DDIDX { +enum FILE_MENU_DDIDX +{ DDIDX_NEW_GAME = 0, DDIDX_LOAD_GAME = 1, DDIDX_SAVE_GAME = 2, @@ -128,7 +129,8 @@ enum FILE_MENU_DDIDX { DDIDX_EXIT_OPENRCT2 = 14, }; -enum TOP_TOOLBAR_VIEW_MENU_DDIDX { +enum TOP_TOOLBAR_VIEW_MENU_DDIDX +{ DDIDX_UNDERGROUND_INSIDE = 0, DDIDX_TRANSPARENT_WATER = 1, DDIDX_HIDE_BASE = 2, @@ -147,24 +149,27 @@ enum TOP_TOOLBAR_VIEW_MENU_DDIDX { DDIDX_VIEW_CLIPPING = 15, DDIDX_HIGHLIGHT_PATH_ISSUES = 16, - TOP_TOOLBAR_VIEW_MENU_COUNT + TOP_TOOLBAR_VIEW_MENU_COUNT, }; -enum TOP_TOOLBAR_DEBUG_DDIDX { +enum TOP_TOOLBAR_DEBUG_DDIDX +{ DDIDX_CONSOLE = 0, DDIDX_DEBUG_PAINT = 1, - TOP_TOOLBAR_DEBUG_COUNT + TOP_TOOLBAR_DEBUG_COUNT, }; -enum TOP_TOOLBAR_NETWORK_DDIDX { +enum TOP_TOOLBAR_NETWORK_DDIDX +{ DDIDX_MULTIPLAYER = 0, DDIDX_MULTIPLAYER_RECONNECT = 1, - TOP_TOOLBAR_NETWORK_COUNT + TOP_TOOLBAR_NETWORK_COUNT, }; -enum { +enum +{ DDIDX_CHEATS, DDIDX_TILE_INSPECTOR = 1, DDIDX_OBJECT_SELECTION = 2, @@ -176,21 +181,24 @@ enum { DDIDX_DISABLE_CLEARANCE_CHECKS = 8, DDIDX_DISABLE_SUPPORT_LIMITS = 9, - TOP_TOOLBAR_CHEATS_COUNT + TOP_TOOLBAR_CHEATS_COUNT, }; -enum { +enum +{ DDIDX_SHOW_MAP, DDIDX_OPEN_VIEWPORT, }; -enum { +enum +{ DDIDX_ROTATE_CLOCKWISE, DDIDX_ROTATE_ANTI_CLOCKWISE, }; #pragma region Toolbar_widget_ordering +// clang-format off // from left to right static constexpr const int32_t left_aligned_widgets_order[] = { WIDX_PAUSE, @@ -209,7 +217,6 @@ static constexpr const int32_t left_aligned_widgets_order[] = { WIDX_ROTATE, WIDX_VIEW_MENU, WIDX_MAP, - }; // from right to left @@ -229,7 +236,7 @@ static constexpr const int32_t right_aligned_widgets_order[] = { WIDX_SCENERY, WIDX_WATER, WIDX_LAND, - WIDX_CLEAR_SCENERY + WIDX_CLEAR_SCENERY, }; #pragma endregion @@ -264,20 +271,20 @@ static rct_widget window_top_toolbar_widgets[] = { MakeWidget ({ 0, 0}, {10, 1}, WindowWidgetType::Empty, WindowColour::Primary ), // Artificial widget separator WIDGETS_END, }; +// clang-format on -static void window_top_toolbar_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_top_toolbar_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget); -static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_top_toolbar_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget); +static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoordsy); -static void window_top_toolbar_tool_abort(rct_window *w, rct_widgetindex widgetIndex); -static void window_top_toolbar_invalidate(rct_window *w); -static void window_top_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi); +static void window_top_toolbar_tool_abort(rct_window* w, rct_widgetindex widgetIndex); +static void window_top_toolbar_invalidate(rct_window* w); +static void window_top_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi); -static rct_window_event_list window_top_toolbar_events([](auto& events) -{ +static rct_window_event_list window_top_toolbar_events([](auto& events) { events.mouse_up = &window_top_toolbar_mouseup; events.mouse_down = &window_top_toolbar_mousedown; events.dropdown = &window_top_toolbar_dropdown; @@ -289,7 +296,6 @@ static rct_window_event_list window_top_toolbar_events([](auto& events) events.invalidate = &window_top_toolbar_invalidate; events.paint = &window_top_toolbar_paint; }); -// clang-format on static void top_toolbar_init_view_menu(rct_window* window, rct_widget* widget); static void top_toolbar_view_menu_dropdown(int16_t dropdownIndex); diff --git a/src/openrct2/Diagnostic.cpp b/src/openrct2/Diagnostic.cpp index 90cf9f9d71..0ec589871f 100644 --- a/src/openrct2/Diagnostic.cpp +++ b/src/openrct2/Diagnostic.cpp @@ -20,7 +20,9 @@ #endif [[maybe_unused]] static bool _log_location_enabled = true; -bool _log_levels[static_cast(DiagnosticLevel::Count)] = { true, true, true, false, true }; +bool _log_levels[static_cast(DiagnosticLevel::Count)] = { + true, true, true, false, true, +}; static FILE* diagnostic_get_stream(DiagnosticLevel level) { @@ -36,9 +38,9 @@ static FILE* diagnostic_get_stream(DiagnosticLevel level) #ifdef __ANDROID__ -int _android_log_priority[static_cast(DiagnosticLevel::Count)] = { ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, - ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, - ANDROID_LOG_INFO }; +int _android_log_priority[static_cast(DiagnosticLevel::Count)] = { + ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO, +}; void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...) { diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index bdc863d0e7..8d7cf06ee9 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -24,7 +24,10 @@ private: MapRange _range; LandBuyRightSetting _setting{ LandBuyRightSetting::Count }; - constexpr static rct_string_id _ErrorTitles[] = { STR_CANT_BUY_LAND, STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE }; + constexpr static rct_string_id _ErrorTitles[] = { + STR_CANT_BUY_LAND, + STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE, + }; public: LandBuyRightsAction() = default; diff --git a/src/openrct2/actions/LandSmoothAction.h b/src/openrct2/actions/LandSmoothAction.h index d72b08ffd2..3bd71ae3e6 100644 --- a/src/openrct2/actions/LandSmoothAction.h +++ b/src/openrct2/actions/LandSmoothAction.h @@ -19,7 +19,10 @@ private: uint8_t _selectionType{}; bool _isLowering{}; - constexpr static rct_string_id _ErrorTitles[] = { STR_CANT_LOWER_LAND_HERE, STR_CANT_RAISE_LAND_HERE }; + constexpr static rct_string_id _ErrorTitles[] = { + STR_CANT_LOWER_LAND_HERE, + STR_CANT_RAISE_LAND_HERE, + }; public: LandSmoothAction() = default; diff --git a/src/openrct2/actions/ParkSetParameterAction.h b/src/openrct2/actions/ParkSetParameterAction.h index eefb88bcea..f546039fde 100644 --- a/src/openrct2/actions/ParkSetParameterAction.h +++ b/src/openrct2/actions/ParkSetParameterAction.h @@ -25,7 +25,12 @@ private: ParkParameter _parameter{ ParkParameter::Count }; uint64_t _value{}; - constexpr static rct_string_id _ErrorTitles[] = { STR_CANT_CLOSE_PARK, STR_CANT_OPEN_PARK, STR_NONE, STR_NONE }; + constexpr static rct_string_id _ErrorTitles[] = { + STR_CANT_CLOSE_PARK, + STR_CANT_OPEN_PARK, + STR_NONE, + STR_NONE, + }; public: ParkSetParameterAction() = default; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index b03b792348..22e8a6eb59 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -25,9 +25,11 @@ #include "../util/Util.h" #include "../world/Park.h" -constexpr static rct_string_id SetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, - STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, - STR_RIDE_SET_VEHICLE_TYPE_FAIL }; +constexpr static rct_string_id SetVehicleTypeErrorTitle[] = { + STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, + STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, + STR_RIDE_SET_VEHICLE_TYPE_FAIL, +}; RideSetVehicleAction::RideSetVehicleAction(ride_id_t rideIndex, RideSetVehicleType type, uint8_t value, uint8_t colour) : _rideIndex(rideIndex) diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index c4c9d2f466..30c3543a24 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -110,7 +110,7 @@ thread_local uint8_t gPeepPalette[256] = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, }; /** rct2: 0x009ABF0C */ @@ -130,12 +130,12 @@ thread_local uint8_t gOtherPalette[256] = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, }; // Originally 0x9ABE04 uint8_t text_palette[0x8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; enum diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index ee4fbdb8b4..3186c9ad25 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -19,7 +19,11 @@ #include #include -static constexpr const int32_t SpriteFontLineHeight[FONT_SIZE_COUNT] = { 6, 10, 10 }; +static constexpr const int32_t SpriteFontLineHeight[FONT_SIZE_COUNT] = { + 6, + 10, + 10, +}; static uint8_t _spriteFontCharacterWidths[FONT_SIZE_COUNT][FONT_SPRITE_GLYPH_COUNT]; static uint8_t _additionalSpriteFontCharacterWidth[FONT_SIZE_COUNT][SPR_G2_GLYPH_COUNT] = {}; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index cb6581836f..f5266c836e 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -511,13 +511,13 @@ static constexpr const uint16_t PatternInverse[] = { 0b0000011111111000, 0b0000001111111100, 0b0000000111111110, - 0b0000000011111111 + 0b0000000011111111, }; /** rct2: 0x0097FEFC */ -static constexpr const uint16_t * Patterns[] = { +static constexpr const uint16_t* Patterns[] = { Pattern, - PatternInverse + PatternInverse, }; // clang-format on diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 9a89012429..5c17d1dec0 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1774,6 +1774,7 @@ static constexpr const utf8* console_variable_table[] = { "cheat_disable_support_limits", "current_rotation", }; + static constexpr const utf8* console_window_table[] = { "object_selection", "inventions_list", @@ -1781,8 +1782,9 @@ static constexpr const utf8* console_window_table[] = { "objective_options", "options", "themes", - "title_sequences" + "title_sequences", }; +// clang-format on static constexpr const console_command console_command_table[] = { { "abort", cc_abort, "Calls std::abort(), for testing purposes only.", "abort" }, @@ -1797,19 +1799,22 @@ static constexpr const console_command console_command_table[] = { { "get", cc_get, "Gets the value of the specified variable.", "get " }, { "help", cc_help, "Lists commands or info about a command.", "help [command]" }, { "hide", cc_hide, "Hides the console.", "hide" }, - { "load_object", cc_load_object, "Loads the object file into the scenario.\n" - "Loading a scenery group will not load its associated objects.\n" - "This is a safer method opposed to \"open object_selection\".", - "load_object " }, + { "load_object", cc_load_object, + "Loads the object file into the scenario.\n" + "Loading a scenery group will not load its associated objects.\n" + "This is a safer method opposed to \"open object_selection\".", + "load_object " }, { "load_park", cc_load_park, "Load park from save directory or by absolute path", "load_park " }, { "object_count", cc_object_count, "Shows the number of objects of each type in the scenario.", "object_count" }, { "open", cc_open, "Opens the window with the give name.", "open ." }, { "quit", cc_close, "Closes the console.", "quit" }, { "remove_park_fences", cc_remove_park_fences, "Removes all park fences from the surface", "remove_park_fences" }, - { "remove_unused_objects", cc_remove_unused_objects, "Removes all the unused objects from the object selection.", "remove_unused_objects" }, - { "remove_floating_objects", cc_remove_floating_objects, "Removes floating objects", "remove_floating_objects"}, + { "remove_unused_objects", cc_remove_unused_objects, "Removes all the unused objects from the object selection.", + "remove_unused_objects" }, + { "remove_floating_objects", cc_remove_floating_objects, "Removes floating objects", "remove_floating_objects" }, { "rides", cc_rides, "Ride management.", "rides " }, - { "save_park", cc_save_park, "Save current state of park. If no name specified default path will be used.", "save_park [name]" }, + { "save_park", cc_save_park, "Save current state of park. If no name specified default path will be used.", + "save_park [name]" }, { "say", cc_say, "Say to other players.", "say " }, { "set", cc_set, "Sets the variable to the specified value.", "set " }, { "show_limits", cc_show_limits, "Shows the map data counts and limits.", "show_limits" }, @@ -1817,15 +1822,15 @@ static constexpr const console_command console_command_table[] = { { "terminate", cc_terminate, "Calls std::terminate(), for testing purposes only.", "terminate" }, { "variables", cc_variables, "Lists all the variables that can be used with get and sometimes set.", "variables" }, { "windows", cc_windows, "Lists all the windows that can be opened.", "windows" }, - { "replay_startrecord", cc_replay_startrecord, "Starts recording a new replay.", "replay_startrecord [max_ticks]"}, - { "replay_stoprecord", cc_replay_stoprecord, "Stops recording a new replay.", "replay_stoprecord"}, - { "replay_start", cc_replay_start, "Starts a replay", "replay_start "}, - { "replay_stop", cc_replay_stop, "Stops the replay", "replay_stop"}, - { "replay_normalise", cc_replay_normalise, "Normalises the replay to remove all gaps", "replay_normalise "}, - { "mp_desync", cc_mp_desync, "Forces a multiplayer desync", "cc_mp_desync [desync_type, 0 = Random t-shirt color on random guest, 1 = Remove random guest ]"}, - + { "replay_startrecord", cc_replay_startrecord, "Starts recording a new replay.", "replay_startrecord [max_ticks]" }, + { "replay_stoprecord", cc_replay_stoprecord, "Stops recording a new replay.", "replay_stoprecord" }, + { "replay_start", cc_replay_start, "Starts a replay", "replay_start " }, + { "replay_stop", cc_replay_stop, "Stops the replay", "replay_stop" }, + { "replay_normalise", cc_replay_normalise, "Normalises the replay to remove all gaps", + "replay_normalise " }, + { "mp_desync", cc_mp_desync, "Forces a multiplayer desync", + "cc_mp_desync [desync_type, 0 = Random t-shirt color on random guest, 1 = Remove random guest ]" }, }; -// clang-format on static int32_t cc_windows(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv) { diff --git a/src/openrct2/localisation/Localisation.Date.cpp b/src/openrct2/localisation/Localisation.Date.cpp index 7e1a415a4a..aed68d3158 100644 --- a/src/openrct2/localisation/Localisation.Date.cpp +++ b/src/openrct2/localisation/Localisation.Date.cpp @@ -19,23 +19,23 @@ uint16_t gDateMonthTicks; int32_t gDateMonthsElapsed; // rct2: 0x00993988 -const int16_t days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31 }; +const int16_t days_in_month[MONTH_COUNT] = { + 31, 30, 31, 30, 31, 31, 30, 31, +}; -// clang-format off const rct_string_id DateFormatStringIds[] = { STR_DATE_FORMAT_DAY_MONTH_YEAR, STR_DATE_FORMAT_MONTH_DAY_YEAR, STR_DATE_FORMAT_YEAR_MONTH_DAY, - STR_DATE_FORMAT_YEAR_DAY_MONTH + STR_DATE_FORMAT_YEAR_DAY_MONTH, }; const rct_string_id DateFormatStringFormatIds[] = { STR_DATE_FORMAT_DMY, STR_DATE_FORMAT_MDY, STR_DATE_FORMAT_YMD, - STR_DATE_FORMAT_YDM + STR_DATE_FORMAT_YDM, }; -// clang-format on openrct2_timeofday gRealTimeOfDay; diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 27d9660a24..6e41d9699b 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -392,8 +392,9 @@ void format_string_to_upper(utf8* dest, size_t size, rct_string_id format, const void format_readable_size(char* buf, size_t bufSize, uint64_t sizeBytes) { - constexpr uint32_t SizeTable[] = { STR_SIZE_BYTE, STR_SIZE_KILOBYTE, STR_SIZE_MEGABYTE, STR_SIZE_GIGABYTE, - STR_SIZE_TERABYTE }; + constexpr uint32_t SizeTable[] = { + STR_SIZE_BYTE, STR_SIZE_KILOBYTE, STR_SIZE_MEGABYTE, STR_SIZE_GIGABYTE, STR_SIZE_TERABYTE, + }; double size = sizeBytes; size_t idx = 0; diff --git a/src/openrct2/localisation/RealNames.cpp b/src/openrct2/localisation/RealNames.cpp index b9b3fd78fb..5dfb9487d1 100644 --- a/src/openrct2/localisation/RealNames.cpp +++ b/src/openrct2/localisation/RealNames.cpp @@ -9,11 +9,11 @@ #include "Localisation.h" -// clang-format off const char real_name_initials[] = { - 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W' + 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W', }; +// clang-format off // The peep sorter assumes this array is alphabetically ordered const char *real_names[] = { "Aaron", @@ -1039,6 +1039,6 @@ const char *real_names[] = { "Yvonne", "Zachary", "Zachery", - "Zola" + "Zola", }; // clang-format on diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index f6cb615059..d71c05d518 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -469,8 +469,12 @@ static bool award_is_deserved_best_custom_designed_rides(int32_t activeAwardType static bool award_is_deserved_most_dazzling_ride_colours(int32_t activeAwardTypes) { /** At least 5 colourful rides and more than half of the rides are colourful. */ - static constexpr const colour_t dazzling_ride_colours[] = { COLOUR_BRIGHT_PURPLE, COLOUR_BRIGHT_GREEN, COLOUR_LIGHT_ORANGE, - COLOUR_BRIGHT_PINK }; + static constexpr const colour_t dazzling_ride_colours[] = { + COLOUR_BRIGHT_PURPLE, + COLOUR_BRIGHT_GREEN, + COLOUR_LIGHT_ORANGE, + COLOUR_BRIGHT_PINK, + }; if (activeAwardTypes & EnumToFlag(ParkAward::MostDisappointing)) return false; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 4022d40a3c..f0970fba8d 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -841,7 +841,9 @@ void NetworkBase::ServerClientDisconnected() std::string NetworkBase::GenerateAdvertiseKey() { // Generate a string of 16 random hex characters (64-integer key as a hex formatted string) - static char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + static char hexChars[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', + }; char key[17]; for (int32_t i = 0; i < 16; i++) { diff --git a/src/openrct2/object/ObjectList.cpp b/src/openrct2/object/ObjectList.cpp index 808696ddcf..9057a36c69 100644 --- a/src/openrct2/object/ObjectList.cpp +++ b/src/openrct2/object/ObjectList.cpp @@ -22,7 +22,6 @@ #include // 98DA00 -// clang-format off int32_t object_entry_group_counts[] = { MAX_RIDE_OBJECTS, // rides MAX_SMALL_SCENERY_OBJECTS, // small scenery @@ -45,6 +44,7 @@ int32_t object_entry_group_counts[] = { static_assert(std::size(object_entry_group_counts) == EnumValue(ObjectType::Count)); // 98DA2C +// clang-format off int32_t object_entry_group_encoding[] = { CHUNK_ENCODING_RLE, CHUNK_ENCODING_RLE, @@ -56,7 +56,7 @@ int32_t object_entry_group_encoding[] = { CHUNK_ENCODING_RLE, CHUNK_ENCODING_RLE, CHUNK_ENCODING_RLE, - CHUNK_ENCODING_ROTATE + CHUNK_ENCODING_ROTATE, }; // clang-format on diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index c688b2524c..c710b2f4a0 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -212,8 +212,11 @@ template void PaintSessionGenerateRotate(paint_session* sessi uint16_t numVerticalTiles = (session->DPI.height + 2128) >> 5; // Adjacent tiles to also check due to overlapping of sprites - constexpr CoordsXY adjacentTiles[] = { CoordsXY{ -32, 32 }.Rotate(direction), CoordsXY{ 0, 32 }.Rotate(direction), - CoordsXY{ 32, 0 }.Rotate(direction) }; + constexpr CoordsXY adjacentTiles[] = { + CoordsXY{ -32, 32 }.Rotate(direction), + CoordsXY{ 0, 32 }.Rotate(direction), + CoordsXY{ 32, 0 }.Rotate(direction), + }; constexpr CoordsXY nextVerticalTile = CoordsXY{ 32, 32 }.Rotate(direction); for (; numVerticalTiles > 0; --numVerticalTiles) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 9ae4a481c5..d8b20b2c45 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -20,15 +20,15 @@ /** rct2: 0x0097AF20, 0x0097AF21 */ // clang-format off static constexpr const CoordsXY SupportBoundBoxes[] = { - {4, 4}, - {28, 4}, - {4, 28}, - {28, 28}, - {16, 16}, - {16, 4}, - {4, 16}, - {28, 16}, - {16, 28} + { 4, 4 }, + { 28, 4 }, + { 4, 28 }, + { 28, 28 }, + { 16, 16 }, + { 16, 4 }, + { 4, 16 }, + { 28, 16 }, + { 16, 28 }, }; /** rct2: 0x0097AF32 */ @@ -76,14 +76,14 @@ static constexpr const uint8_t _97AF32[] = { /** rct2: 0x0097B052, 0x0097B053 */ static constexpr const CoordsXY loc_97B052[] = { - {-15, -1}, - {0, -2}, - {-2, -1}, - {-1, -15}, - {-26, -1}, - {0, -2}, - {-2, -1}, - {-1, -26} + { -15, -1 }, + { 0, -2 }, + { -2, -1 }, + { -1, -15 }, + { -26, -1 }, + { 0, -2 }, + { -2, -1 }, + { -1, -26 }, }; /** rct2: 0x0097B062, 0x0097B063 */ @@ -399,7 +399,7 @@ static constexpr const unk_supports_desc byte_97B23C[] = { {{{0, 0, 0}, {1, 1, 8}}, 0, 1}, // Steep to flat large 4 {{{0, 0, 0}, {1, 1, 8}}, 0, 1}, {{{0, 0, 0}, {1, 1, 8}}, 0, 1}, - {{{0, 0, 0}, {1, 1, 8}}, 0, 1} + {{{0, 0, 0}, {1, 1, 8}}, 0, 1}, }; /* 0x0098D8D4 */ diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 24625f0bc0..53a492ddd0 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -39,51 +39,42 @@ using namespace OpenRCT2; bool gPaintWidePathsAsGhost = false; -// clang-format off -const uint8_t PathSlopeToLandSlope[] = -{ +const uint8_t PathSlopeToLandSlope[] = { TILE_ELEMENT_SLOPE_SW_SIDE_UP, TILE_ELEMENT_SLOPE_NW_SIDE_UP, TILE_ELEMENT_SLOPE_NE_SIDE_UP, - TILE_ELEMENT_SLOPE_SE_SIDE_UP + TILE_ELEMENT_SLOPE_SE_SIDE_UP, }; static constexpr const uint8_t byte_98D6E0[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 0, 1, 2, 20, 4, 5, 6, 22, 8, 9, 10, 26, 12, 13, 14, 36, - 0, 1, 2, 3, 4, 5, 21, 23, 8, 9, 10, 11, 12, 13, 33, 37, - 0, 1, 2, 3, 4, 5, 6, 24, 8, 9, 10, 11, 12, 13, 14, 38, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 29, 30, 34, 39, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 40, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 35, 41, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 25, 10, 27, 12, 31, 14, 43, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 28, 12, 13, 14, 44, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 45, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 46, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 32, 14, 47, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 48, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 50 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 20, 4, 5, 6, 22, 8, 9, 10, 26, 12, 13, 14, 36, + 0, 1, 2, 3, 4, 5, 21, 23, 8, 9, 10, 11, 12, 13, 33, 37, 0, 1, 2, 3, 4, 5, 6, 24, 8, 9, 10, 11, 12, 13, 14, 38, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 29, 30, 34, 39, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 40, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 35, 41, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 42, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 25, 10, 27, 12, 31, 14, 43, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 28, 12, 13, 14, 44, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 45, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 46, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 32, 14, 47, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 48, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 50, }; +// clang-format off static constexpr const int16_t stru_98D804[][4] = { - {3, 3, 26, 26}, - {0, 3, 29, 26}, - {3, 3, 26, 29}, - {0, 3, 29, 29}, - {3, 3, 29, 26}, - {0, 3, 32, 26}, - {3, 3, 29, 29}, - {0, 3, 32, 29}, - {3, 0, 26, 29}, - {0, 0, 29, 29}, - {3, 0, 26, 32}, - {0, 0, 29, 32}, - {3, 0, 29, 29}, - {0, 0, 32, 29}, - {3, 0, 29, 32}, - {0, 0, 32, 32}, + { 3, 3, 26, 26 }, + { 0, 3, 29, 26 }, + { 3, 3, 26, 29 }, + { 0, 3, 29, 29 }, + { 3, 3, 29, 26 }, + { 0, 3, 32, 26 }, + { 3, 3, 29, 29 }, + { 0, 3, 32, 29 }, + { 3, 0, 26, 29 }, + { 0, 0, 29, 29 }, + { 3, 0, 26, 32 }, + { 0, 0, 29, 32 }, + { 3, 0, 29, 29 }, + { 0, 0, 32, 29 }, + { 3, 0, 29, 32 }, + { 0, 0, 32, 32 }, }; static constexpr const uint8_t byte_98D8A4[] = { diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index ba9f146089..5cdecc095b 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -35,13 +35,8 @@ #include #include -// clang-format off -static constexpr const uint8_t byte_97B444[] = -{ - 0, 2, 1, 3, 8, 10, 9, 11, 4, 6, - 5, 7, 12, 14, 13, 15, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 0, 16, 0, 18, - 15, 0 +static constexpr const uint8_t byte_97B444[] = { + 0, 2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 16, 0, 18, 15, 0, }; // rct2: 0x97B464, 0x97B474, 0x97B484, 0x97B494 @@ -50,26 +45,26 @@ static constexpr const CoordsXY viewport_surface_paint_data[][4] = { { 32, 0 }, { -32, 32 }, { -64, -32 }, - { 0, -64 } + { 0, -64 }, }, { { 0, 32 }, { -64, 0 }, { -32, -64 }, - { 32, -32 } + { 32, -32 }, }, { { 0, -32 }, { 0, 0 }, { -32, 0 }, - { -32, -32 } + { -32, -32 }, }, { { -32, 0 }, { -32, -32 }, { 0, -32 }, - { 0, 0 } - } + { 0, 0 }, + }, }; enum @@ -88,11 +83,12 @@ struct corner_height uint8_t left; }; +// clang-format off /** * rct2: 0x0097B4A4 (R), 0x0097B4C4 (T), 0x0097B4E4 (L), 0x0097B504 (B) */ static constexpr const corner_height corner_heights[] = { - // T R B L + // T R B L { 0, 0, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 }, @@ -130,25 +126,25 @@ static constexpr const corner_height corner_heights[] = { // bottom left tint static constexpr const uint8_t byte_97B524[] = { 2, 5, 1, 4, 2, 5, 1, 2, 2, 4, - 1, 2, 1, 3, 0, 3, 1, 5, 0 + 1, 2, 1, 3, 0, 3, 1, 5, 0, }; // top left tint static constexpr const uint32_t byte_97B537[] = { 2, 5, 2, 4, 2, 5, 1, 1, 3, 4, - 3, 2, 1, 2, 0, 3, 1, 5, 0 + 3, 2, 1, 2, 0, 3, 1, 5, 0, }; // top right tint static constexpr const uint8_t byte_97B54A[] = { 2, 2, 2, 4, 0, 0, 1, 1, 3, 4, - 3, 5, 1, 2, 2, 3, 1, 5, 0 + 3, 5, 1, 2, 2, 3, 1, 5, 0, }; // bottom right tint static constexpr const uint8_t byte_97B55D[] = { 2, 2, 1, 4, 0, 0, 1, 2, 2, 4, - 1, 5, 1, 3, 2, 3, 1, 5, 0 + 1, 5, 1, 3, 2, 3, 1, 5, 0, }; static constexpr const uint8_t _tunnelHeights[TUNNEL_TYPE_COUNT][2] = { @@ -203,23 +199,20 @@ static constexpr const int16_t _boundBoxZOffsets[TUNNEL_TYPE_COUNT] = { 0, }; +// clang-format on // tunnel offset static constexpr const uint8_t byte_97B5B0[TUNNEL_TYPE_COUNT] = { - 0, 0, 0, 3, 3, 3, 6, 6, 6, 6, - 10, 11, 12, 13, 14, 14, - 16, 17, 18, 19, 20, 21, 22 + 0, 0, 0, 3, 3, 3, 6, 6, 6, 6, 10, 11, 12, 13, 14, 14, 16, 17, 18, 19, 20, 21, 22, }; -static constexpr const uint8_t byte_97B740[] = -{ - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 0, 3, 0, 1, 4, 0 +static constexpr const uint8_t byte_97B740[] = { + 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 1, 4, 0, }; struct tile_descriptor { TileCoordsXY tile_coords; - const TileElement * tile_element; + const TileElement* tile_element; uint8_t terrain; uint8_t slope; corner_height corner_heights; @@ -227,20 +220,23 @@ struct tile_descriptor struct tile_surface_boundary_data { - int32_t bit_1; - int32_t bit_8; - int32_t bit_4; - int32_t bit_2; + int32_t bit_1; + int32_t bit_8; + int32_t bit_4; + int32_t bit_2; uint32_t image[5]; CoordsXY offset; CoordsXY box_offset; CoordsXY box_size; }; -static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = -{ - { // Bottom right - 1, 8, 4, 2, +static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = { + { + // Bottom right + 1, + 8, + 4, + 2, { SPR_TERRAIN_BOUNDARY_FENCES_1, SPR_TERRAIN_BOUNDARY_FENCES_5, @@ -249,11 +245,15 @@ static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = SPR_TERRAIN_BOUNDARY_FENCES_5, }, { 1, 31 }, - { 1, 31 }, - { 30, 1 } + { 1, 31 }, + { 30, 1 }, }, - { // Bottom left - 1, 2, 4, 8, + { + // Bottom left + 1, + 2, + 4, + 8, { SPR_TERRAIN_BOUNDARY_FENCES_2, SPR_TERRAIN_BOUNDARY_FENCES_6, @@ -262,11 +262,15 @@ static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = SPR_TERRAIN_BOUNDARY_FENCES_6, }, { 31, 0 }, - { 31, 1 }, - { 1, 30 } + { 31, 1 }, + { 1, 30 }, }, - { // Top left - 4, 2, 8, 1, + { + // Top left + 4, + 2, + 8, + 1, { SPR_TERRAIN_BOUNDARY_FENCES_1, SPR_TERRAIN_BOUNDARY_FENCES_3, @@ -275,11 +279,15 @@ static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = SPR_TERRAIN_BOUNDARY_FENCES_5, }, { 1, 0 }, - { 1, 1 }, - { 30, 1 } + { 1, 1 }, + { 30, 1 }, }, - { // Top right - 4, 8, 2, 1, + { + // Top right + 4, + 8, + 2, + 1, { SPR_TERRAIN_BOUNDARY_FENCES_2, SPR_TERRAIN_BOUNDARY_FENCES_4, @@ -288,11 +296,10 @@ static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = SPR_TERRAIN_BOUNDARY_FENCES_6, }, { 1, 1 }, - { 1, 1 }, - { 1, 30 } + { 1, 1 }, + { 1, 30 }, }, }; -// clang-format on static const TerrainSurfaceObject* get_surface_object(size_t index) { diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 19c93a786c..bd3723be8d 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -404,8 +404,9 @@ void paint_util_force_set_general_support_height(paint_session* session, int16_t session->Support.slope = slope; } -const uint16_t segment_offsets[9] = { SEGMENT_B4, SEGMENT_B8, SEGMENT_BC, SEGMENT_C0, SEGMENT_C4, - SEGMENT_C8, SEGMENT_CC, SEGMENT_D0, SEGMENT_D4 }; +const uint16_t segment_offsets[9] = { + SEGMENT_B4, SEGMENT_B8, SEGMENT_BC, SEGMENT_C0, SEGMENT_C4, SEGMENT_C8, SEGMENT_CC, SEGMENT_D0, SEGMENT_D4, +}; void paint_util_set_segment_support_height(paint_session* session, int32_t segments, uint16_t height, uint8_t slope) { diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 7a5fb800aa..d26701c5db 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -163,7 +163,10 @@ static constexpr const CoordsXY _WatchingPositionOffsets[] = { }; static constexpr const ride_rating NauseaMaximumThresholds[] = { - 300, 600, 800, 1000 + 300, + 600, + 800, + 1000, }; /** rct2: 009823AC */ @@ -210,8 +213,9 @@ static constexpr const char *gPeepEasterEggNames[] = { "KATIE SMITH", "EILIDH BELL", "NANCY STILLWAGON", - "DAVID ELLIS" + "DAVID ELLIS", }; +// clang-format on // Flags used by PeepThoughtToActionMap enum PeepThoughtToActionFlag : uint8_t @@ -406,9 +410,11 @@ static struct // These arrays contain the base minimum and maximum nausea ratings for peeps, based on their nausea tolerance level. static constexpr const ride_rating NauseaMinimumThresholds[] = { - 0, 0, 200, 400 + 0, + 0, + 200, + 400, }; -// clang-format on static bool peep_has_voucher_for_free_ride(Guest* peep, Ride* ride); static void peep_ride_is_too_intense(Guest* peep, Ride* ride, bool peepAtRide); @@ -1764,9 +1770,11 @@ void Guest::OnExitRide(Ride* ride) { InsertNewThought(PeepThoughtType::WasGreat, ride->id); - static constexpr OpenRCT2::Audio::SoundId laughs[3] = { OpenRCT2::Audio::SoundId::Laugh1, - OpenRCT2::Audio::SoundId::Laugh2, - OpenRCT2::Audio::SoundId::Laugh3 }; + static constexpr OpenRCT2::Audio::SoundId laughs[3] = { + OpenRCT2::Audio::SoundId::Laugh1, + OpenRCT2::Audio::SoundId::Laugh2, + OpenRCT2::Audio::SoundId::Laugh3, + }; int32_t laughType = scenario_rand() & 7; if (laughType < 3) { diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 76a2bb9aba..620498252c 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -74,12 +74,11 @@ static void* _crowdSoundChannel = nullptr; static void peep_128_tick_update(Peep* peep, int32_t index); static void peep_release_balloon(Guest* peep, int16_t spawn_height); -// clang-format off static PeepActionSpriteType PeepSpecialSpriteToSpriteTypeMap[] = { PeepActionSpriteType::None, PeepActionSpriteType::HoldMat, - PeepActionSpriteType::StaffMower + PeepActionSpriteType::StaffMower, }; static PeepActionSpriteType PeepActionToSpriteTypeMap[] = { @@ -113,20 +112,15 @@ static PeepActionSpriteType PeepActionToSpriteTypeMap[] = { PeepActionSpriteType::Disgust, PeepActionSpriteType::DrawPicture, PeepActionSpriteType::BeingWatched, - PeepActionSpriteType::WithdrawMoney + PeepActionSpriteType::WithdrawMoney, }; const bool gSpriteTypeToSlowWalkMap[] = { - false, false, false, false, false, false, false, false, - false, false, false, true, false, false, true, true, - true, true, true, false, true, false, true, true, - true, false, false, true, true, false, false, true, - true, true, true, true, true, true, false, true, - false, true, true, true, true, true, true, true, + false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, + true, true, true, false, true, false, true, true, true, false, false, true, true, false, false, true, + true, true, true, true, true, true, false, true, false, true, true, true, true, true, true, true, }; -// clang-format on - template<> bool EntityBase::Is() const { return Type == EntityType::Guest || Type == EntityType::Staff; @@ -373,7 +367,12 @@ void Peep::StateReset() } /** rct2: 0x00981D7C, 0x00981D7E */ -static constexpr const CoordsXY word_981D7C[4] = { { -2, 0 }, { 0, 2 }, { 2, 0 }, { 0, -2 } }; +static constexpr const CoordsXY word_981D7C[4] = { + { -2, 0 }, + { 0, 2 }, + { 2, 0 }, + { 0, -2 }, +}; std::optional Peep::UpdateAction() { @@ -476,9 +475,12 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) const auto curLoc = GetLocation(); Litter::Create({ curLoc, sprite_direction }, (sprite_index & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); - static constexpr OpenRCT2::Audio::SoundId coughs[4] = { OpenRCT2::Audio::SoundId::Cough1, OpenRCT2::Audio::SoundId::Cough2, - OpenRCT2::Audio::SoundId::Cough3, - OpenRCT2::Audio::SoundId::Cough4 }; + static constexpr OpenRCT2::Audio::SoundId coughs[4] = { + OpenRCT2::Audio::SoundId::Cough1, + OpenRCT2::Audio::SoundId::Cough2, + OpenRCT2::Audio::SoundId::Cough3, + OpenRCT2::Audio::SoundId::Cough4, + }; auto soundId = coughs[scenario_rand() & 3]; OpenRCT2::Audio::Play3D(soundId, curLoc); @@ -2455,7 +2457,9 @@ rct_string_id get_real_name_string_id_from_id(uint32_t id) // Generate a name_string_idx from the peep Id using bit twiddling uint16_t ax = static_cast(id + 0xF0B); uint16_t dx = 0; - static constexpr uint16_t twiddlingBitOrder[] = { 4, 9, 3, 7, 5, 8, 2, 1, 6, 0, 12, 11, 13, 10 }; + static constexpr uint16_t twiddlingBitOrder[] = { + 4, 9, 3, 7, 5, 8, 2, 1, 6, 0, 12, 11, 13, 10, + }; for (size_t i = 0; i < std::size(twiddlingBitOrder); i++) { dx |= (ax & (1 << twiddlingBitOrder[i]) ? 1 : 0) << i; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 7b927b487d..5086620659 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -2011,7 +2011,7 @@ static constexpr const uint32_t FixingSubstatesForBreakdown[9] = { (1 << PEEP_FIXING_MOVE_TO_STATION_EXIT) | (1 << PEEP_FIXING_FINISH_FIX_OR_INSPECT) | (1 << PEEP_FIXING_LEAVE_BY_ENTRANCE_EXIT) - ) + ), }; // clang-format on diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp index 6c78d94254..762e5b3fdf 100644 --- a/src/openrct2/platform/Platform.Linux.cpp +++ b/src/openrct2/platform/Platform.Linux.cpp @@ -130,9 +130,19 @@ namespace Platform } # elif defined(__FreeBSD__) || defined(__NetBSD__) # if defined(__FreeBSD__) - const int32_t mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; + const int32_t mib[] = { + CTL_KERN, + KERN_PROC, + KERN_PROC_PATHNAME, + -1, + }; # else - const int32_t mib[] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME }; + const int32_t mib[] = { + CTL_KERN, + KERN_PROC_ARGS, + -1, + KERN_PROC_PATHNAME, + }; # endif auto exeLen = sizeof(exePath); if (sysctl(mib, 4, exePath, &exeLen, nullptr, 0) == -1) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 4a387f6ea9..65d85ebc93 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -1348,10 +1348,10 @@ RCT12TrackType OpenRCT2FlatTrackTypeToRCT12(track_type_t origTrackType) } static constexpr std::string_view _stationStyles[] = { - "rct2.station.plain", "rct2.station.wooden", "rct2.station.canvas_tent", "rct2.station.castle_grey", - "rct2.station.castle_brown", "rct2.station.jungle", "rct2.station.log", "rct2.station.classical", - "rct2.station.abstract", "rct2.station.snow", "rct2.station.pagoda", "rct2.station.space", - "openrct2.station.noentrance" + "rct2.station.plain", "rct2.station.wooden", "rct2.station.canvas_tent", "rct2.station.castle_grey", + "rct2.station.castle_brown", "rct2.station.jungle", "rct2.station.log", "rct2.station.classical", + "rct2.station.abstract", "rct2.station.snow", "rct2.station.pagoda", "rct2.station.space", + "openrct2.station.noentrance", }; static constexpr std::string_view _musicStyles[] = { diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 6dca4c68d3..602d9a417c 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1197,7 +1197,7 @@ static uint8_t _breakdownProblemProbabilities[] = { 10, // BREAKDOWN_DOORS_STUCK_OPEN 6, // BREAKDOWN_VEHICLE_MALFUNCTION 0, // BREAKDOWN_BRAKES_FAILURE - 3 // BREAKDOWN_CONTROL_FAILURE + 3, // BREAKDOWN_CONTROL_FAILURE }; /** diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 4c592c26b1..de8ea5b358 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -170,7 +170,7 @@ const rct_ride_entry_vehicle CableLiftVehicle = { const uint16_t RideFilmLength[3] = { 5000, // MOUSE_TAILS 6000, // STORM_CHASERS - 7000 // SPACE_RAIDERS + 7000, // SPACE_RAIDERS }; const rct_string_id RideModeNames[] = { diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index a0e908dc09..d2bcc2ccc0 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -789,7 +789,7 @@ static void ride_ratings_calculate_value(Ride* ride) { 120, 81, 256, 0 }, // 0.32x { 128, 81, 512, 0 }, // 0.16x { 200, 81, 1024, 0 }, // 0.08x - { 200, 9, 16, 0 } // 0.56x "easter egg" + { 200, 9, 16, 0 }, // 0.56x "easter egg" }; #ifdef ORIGINAL_RATINGS @@ -803,7 +803,7 @@ static void ride_ratings_calculate_value(Ride* ride) { 120, 81, 256, 0 }, // 0.32x { 128, 81, 512, 0 }, // 0.16x { 200, 81, 1024, 0 }, // 0.08x - { 200, 9, 16, 0 } // 0.56x "easter egg" + { 200, 9, 16, 0 }, // 0.56x "easter egg" }; #endif diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 362d89d0d2..1b135afaad 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -30,13 +30,12 @@ using namespace OpenRCT2::TrackMetaData; -// clang-format off /* rct2: 0x007667AC */ static constexpr TileCoordsXY EntranceOffsetEdgeNE[] = { { -1, 0 }, - { 0, -1 }, - { 1, 0 }, - { 0, 1 }, + { 0, -1 }, + { 1, 0 }, + { 0, 1 }, }; /* rct2: 0x007667AE */ @@ -48,10 +47,10 @@ static constexpr TileCoordsXY EntranceOffsetEdgeNW[] = { }; const uint8_t track_map_2x2[][4] = { - {0, 1, 2, 3}, - {1, 3, 0, 2}, - {3, 2, 1, 0}, - {2, 0, 3, 1} + { 0, 1, 2, 3 }, + { 1, 3, 0, 2 }, + { 3, 2, 1, 0 }, + { 2, 0, 3, 1 }, }; const uint8_t edges_2x2[] = { @@ -62,12 +61,13 @@ const uint8_t edges_2x2[] = { }; const uint8_t track_map_3x3[][9] = { - {0, 1, 2, 3, 4, 5, 6, 7, 8}, - {0, 3, 5, 7, 2, 8, 1, 6, 4}, - {0, 7, 8, 6, 5, 4, 3, 1, 2}, - {0, 6, 4, 1, 8, 2, 7, 3, 5} + { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, + { 0, 3, 5, 7, 2, 8, 1, 6, 4 }, + { 0, 7, 8, 6, 5, 4, 3, 1, 2 }, + { 0, 6, 4, 1, 8, 2, 7, 3, 5 }, }; +// clang-format off const uint8_t edges_3x3[] = { 0, EDGE_NE | EDGE_NW, @@ -79,14 +79,16 @@ const uint8_t edges_3x3[] = { EDGE_SW | EDGE_SE, EDGE_SW, }; +// clang-format on const uint8_t track_map_4x4[][16] = { - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}, - {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, - {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12 }, + { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3 }, }; +// clang-format off const uint8_t edges_4x4[] = { EDGE_NE | EDGE_NW, EDGE_NE, @@ -103,76 +105,79 @@ const uint8_t edges_4x4[] = { EDGE_NW | EDGE_SW, EDGE_SW, EDGE_SW, - EDGE_SW | EDGE_SE + EDGE_SW | EDGE_SE, }; +// clang-format on const uint8_t track_map_1x4[][4] = { - {0, 1, 2, 3}, - {2, 3, 0, 1}, - {2, 3, 0, 1}, - {0, 1, 2, 3}, + { 0, 1, 2, 3 }, + { 2, 3, 0, 1 }, + { 2, 3, 0, 1 }, + { 0, 1, 2, 3 }, }; const uint32_t floorSpritesCork[] = { SPR_FLOOR_CORK_SE_SW, SPR_FLOOR_CORK_SW, SPR_FLOOR_CORK_SE, - SPR_FLOOR_CORK + SPR_FLOOR_CORK, }; const uint32_t floorSpritesMetal[] = { SPR_FLOOR_METAL, SPR_FLOOR_METAL, SPR_FLOOR_METAL, - SPR_FLOOR_METAL + SPR_FLOOR_METAL, }; const uint32_t floorSpritesMetalB[] = { SPR_FLOOR_METAL_B, SPR_FLOOR_METAL_B, SPR_FLOOR_METAL_B, - SPR_FLOOR_METAL_B + SPR_FLOOR_METAL_B, }; const uint32_t fenceSpritesRope[] = { SPR_FENCE_ROPE_NE, SPR_FENCE_ROPE_SE, SPR_FENCE_ROPE_SW, - SPR_FENCE_ROPE_NW + SPR_FENCE_ROPE_NW, }; const uint32_t fenceSpritesMetal[] = { SPR_FENCE_METAL_NE, SPR_FENCE_METAL_SE, SPR_FENCE_METAL_SW, - SPR_FENCE_METAL_NW + SPR_FENCE_METAL_NW, }; - const uint32_t fenceSpritesMetalB[] = { SPR_FENCE_METAL_B_NE, SPR_FENCE_METAL_B_SE, SPR_FENCE_METAL_B_SW, - SPR_FENCE_METAL_B_NW + SPR_FENCE_METAL_B_NW, }; const uint32_t trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3] = { { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2 - }, { + SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2 - }, { + SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2 - }, { + SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2 + SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2, } }; @@ -189,29 +194,29 @@ static constexpr const uint32_t trackSpritesGhostTrainSpinningTunnel[2][2][4] = SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_0, SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_1, SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_2, - SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_3 + SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_3, }, { SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_SW_NE_FRAME_0, SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_SW_NE_FRAME_1, SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_SW_NE_FRAME_2, - SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_SW_NE_FRAME_3 - } + SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_SW_NE_FRAME_3, + }, }, { { SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_NW_SE_FRAME_0, SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_NW_SE_FRAME_1, SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_NW_SE_FRAME_2, - SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_NW_SE_FRAME_3 + SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_NW_SE_FRAME_3, }, { SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_NW_SE_FRAME_0, SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_NW_SE_FRAME_1, SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_NW_SE_FRAME_2, - SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_NW_SE_FRAME_3 - } - } + SPR_GHOST_TRAIN_SPINNING_TUNNEL_FRONT_NW_SE_FRAME_3, + }, + }, }; enum @@ -224,7 +229,6 @@ enum SPR_STATION_COVER_OFFSET_SE_NW_FRONT, SPR_STATION_COVER_OFFSET_TALL }; -// clang-format on bool track_paint_util_has_fence( enum edge_t edge, const CoordsXY& position, const TrackElement& trackElement, const Ride* ride, uint8_t rotation) @@ -1036,7 +1040,12 @@ constexpr CoordsXYZ defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { }, }; -static constexpr const int8_t right_helix_up_small_quarter_tiles_sprite_map[] = { 0, -1, 1, 2 }; +static constexpr const int8_t right_helix_up_small_quarter_tiles_sprite_map[] = { + 0, + -1, + 1, + 2, +}; void track_paint_util_right_helix_up_small_quarter_tiles_paint( paint_session* session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, @@ -1135,7 +1144,9 @@ constexpr CoordsXY defaultRightHelixUpLargeQuarterBoundLengths[4][5][2] = { }, }; -static constexpr const int8_t right_helix_up_large_quarter_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; +static constexpr const int8_t right_helix_up_large_quarter_sprite_map[] = { + 0, -1, 1, 2, -1, 3, 4, +}; void track_paint_util_right_helix_up_large_quarter_tiles_paint( paint_session* session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, uint32_t colourFlags, const uint32_t sprites[4][5][2], const CoordsXY offsets[4][5][2], @@ -1306,9 +1317,13 @@ const int8_t defaultEighthToDiagThickness[4][4] = { }, }; -const uint8_t mapLeftEighthTurnToOrthogonal[] = { 4, 2, 3, 1, 0 }; +const uint8_t mapLeftEighthTurnToOrthogonal[] = { + 4, 2, 3, 1, 0, +}; -static constexpr const int8_t eighth_to_diag_sprite_map[] = { 0, 1, 2, -1, 3 }; +static constexpr const int8_t eighth_to_diag_sprite_map[] = { + 0, 1, 2, -1, 3, +}; void track_paint_util_eighth_to_diag_tiles_paint( paint_session* session, const int8_t thickness[4][4], int16_t height, Direction direction, uint8_t trackSequence, uint32_t colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4], diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 0a23876093..0e7f1388b5 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -72,88 +72,87 @@ uint8_t _vehicleF64E2C; Vehicle* _vehicleFrontVehicle; CoordsXYZ unk_F64E20; -// clang-format off -static constexpr const OpenRCT2::Audio::SoundId byte_9A3A14[] = { OpenRCT2::Audio::SoundId::Scream8, - OpenRCT2::Audio::SoundId::Scream1 }; -static constexpr const OpenRCT2::Audio::SoundId byte_9A3A16[] = { OpenRCT2::Audio::SoundId::Scream1, - OpenRCT2::Audio::SoundId::Scream6 }; -static constexpr const OpenRCT2::Audio::SoundId byte_9A3A18[] = { - OpenRCT2::Audio::SoundId::Scream3, +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A14[] = { + OpenRCT2::Audio::SoundId::Scream8, + OpenRCT2::Audio::SoundId::Scream1, +}; +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A16[] = { OpenRCT2::Audio::SoundId::Scream1, - OpenRCT2::Audio::SoundId::Scream5, OpenRCT2::Audio::SoundId::Scream6, - OpenRCT2::Audio::SoundId::Scream7, - OpenRCT2::Audio::SoundId::Scream2, - OpenRCT2::Audio::SoundId::Scream4 +}; +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A18[] = { + OpenRCT2::Audio::SoundId::Scream3, OpenRCT2::Audio::SoundId::Scream1, OpenRCT2::Audio::SoundId::Scream5, + OpenRCT2::Audio::SoundId::Scream6, OpenRCT2::Audio::SoundId::Scream7, OpenRCT2::Audio::SoundId::Scream2, + OpenRCT2::Audio::SoundId::Scream4, }; -static constexpr const uint8_t _soundParams[OpenRCT2::Audio::RCT2SoundCount][2] = -{ - { 1, 0 }, // LiftClassic - { 1, 0 }, // TrackFrictionClassicWood - { 1, 0 }, // FrictionClassic - { 0, 1 }, // Scream1 - { 0, 0 }, // Click1 - { 0, 0 }, // Click2 - { 0, 0 }, // PlaceItem - { 0, 1 }, // Scream2 - { 0, 1 }, // Scream3 - { 0, 1 }, // Scream4 - { 0, 1 }, // Scream5 - { 0, 1 }, // Scream6 - { 1, 0 }, // LiftFrictionWheels - { 0, 0 }, // Purchase - { 0, 0 }, // Crash - { 0, 0 }, // LayingOutWater - { 0, 0 }, // Water1 - { 0, 0 }, // Water2 - { 0, 1 }, // TrainWhistle - { 0, 1 }, // TrainDeparting - { 0, 0 }, // WaterSplash - { 1, 0 }, // GoKartEngine - { 0, 0 }, // RideLaunch1 - { 0, 0 }, // RideLaunch2 - { 0, 0 }, // Cough1 - { 0, 0 }, // Cough2 - { 0, 0 }, // Cough3 - { 0, 0 }, // Cough4 - { 1, 0 }, // Rain - { 0, 0 }, // Thunder1 - { 0, 0 }, // Thunder2 - { 1, 0 }, // TrackFrictionTrain - { 1, 0 }, // TrackFrictionWater - { 0, 0 }, // BalloonPop - { 0, 0 }, // MechanicFix - { 0, 1 }, // Scream7 - { 0, 0 }, // ToiletFlush - { 0, 0 }, // Click3 - { 0, 0 }, // Quack - { 0, 0 }, // NewsItem - { 0, 0 }, // WindowOpen - { 0, 0 }, // Laugh1 - { 0, 0 }, // Laugh2 - { 0, 0 }, // Laugh3 - { 0, 0 }, // Applause - { 0, 0 }, // HauntedHouseScare - { 0, 0 }, // HauntedHouseScream1 - { 0, 0 }, // HauntedHouseScream2 - { 0, 0 }, // BlockBrakeClose - { 0, 0 }, // BlockBrakeRelease - { 0, 0 }, // Error - { 0, 0 }, // BrakeRelease - { 1, 0 }, // LiftArrow - { 1, 0 }, // LiftWood - { 1, 0 }, // TrackFrictionWood - { 1, 0 }, // LiftWildMouse - { 1, 0 }, // LiftBM - { 1, 2 }, // TrackFrictionBM - { 0, 1 }, // Scream8 - { 0, 1 }, // Tram - { 0, 0 }, // DoorOpen - { 0, 0 }, // DoorClose - { 0, 0 } // Portcullis +static constexpr const uint8_t _soundParams[OpenRCT2::Audio::RCT2SoundCount][2] = { + { 1, 0 }, // LiftClassic + { 1, 0 }, // TrackFrictionClassicWood + { 1, 0 }, // FrictionClassic + { 0, 1 }, // Scream1 + { 0, 0 }, // Click1 + { 0, 0 }, // Click2 + { 0, 0 }, // PlaceItem + { 0, 1 }, // Scream2 + { 0, 1 }, // Scream3 + { 0, 1 }, // Scream4 + { 0, 1 }, // Scream5 + { 0, 1 }, // Scream6 + { 1, 0 }, // LiftFrictionWheels + { 0, 0 }, // Purchase + { 0, 0 }, // Crash + { 0, 0 }, // LayingOutWater + { 0, 0 }, // Water1 + { 0, 0 }, // Water2 + { 0, 1 }, // TrainWhistle + { 0, 1 }, // TrainDeparting + { 0, 0 }, // WaterSplash + { 1, 0 }, // GoKartEngine + { 0, 0 }, // RideLaunch1 + { 0, 0 }, // RideLaunch2 + { 0, 0 }, // Cough1 + { 0, 0 }, // Cough2 + { 0, 0 }, // Cough3 + { 0, 0 }, // Cough4 + { 1, 0 }, // Rain + { 0, 0 }, // Thunder1 + { 0, 0 }, // Thunder2 + { 1, 0 }, // TrackFrictionTrain + { 1, 0 }, // TrackFrictionWater + { 0, 0 }, // BalloonPop + { 0, 0 }, // MechanicFix + { 0, 1 }, // Scream7 + { 0, 0 }, // ToiletFlush + { 0, 0 }, // Click3 + { 0, 0 }, // Quack + { 0, 0 }, // NewsItem + { 0, 0 }, // WindowOpen + { 0, 0 }, // Laugh1 + { 0, 0 }, // Laugh2 + { 0, 0 }, // Laugh3 + { 0, 0 }, // Applause + { 0, 0 }, // HauntedHouseScare + { 0, 0 }, // HauntedHouseScream1 + { 0, 0 }, // HauntedHouseScream2 + { 0, 0 }, // BlockBrakeClose + { 0, 0 }, // BlockBrakeRelease + { 0, 0 }, // Error + { 0, 0 }, // BrakeRelease + { 1, 0 }, // LiftArrow + { 1, 0 }, // LiftWood + { 1, 0 }, // TrackFrictionWood + { 1, 0 }, // LiftWildMouse + { 1, 0 }, // LiftBM + { 1, 2 }, // TrackFrictionBM + { 0, 1 }, // Scream8 + { 0, 1 }, // Tram + { 0, 0 }, // DoorOpen + { 0, 0 }, // DoorClose + { 0, 0 }, // Portcullis }; +// clang-format off static constexpr const uint8_t SpaceRingsTimeToSpriteMap[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, @@ -285,160 +284,141 @@ static constexpr const uint8_t SpaceRingsTimeToSpriteMap[] = 33, 32, 32, 32, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 0, - 255 + 255, }; +// clang-format on -static constexpr const int8_t SwingingTimeToSpriteMap_0[] = -{ - 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -3, -3, -3, - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -1, -1, -1, -1, -1, -1, -1, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_0[] = { + 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, + -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_1[] = -{ - 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -4, - -4, -4, -4, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_1[] = { + 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, + -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, + -5, -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_2[] = -{ - 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, - 2, 2, 1, 1, 1, 0, 0, 0, -1, -1, -1, -2, -2, -2, -3, -3, -3, -3, -4, -4, -4, -4, -4, -5, -5, -5, -5, -5, - -5, -6, -6, -6, -6, -6, -6, -6, -6, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -6, -6, - -6, -6, -6, -6, -6, -6, -5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -3, -3, -3, -3, -2, -2, -2, -1, -1, - -1, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_2[] = { + 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, + 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, + -1, -1, -1, -2, -2, -2, -3, -3, -3, -3, -4, -4, -4, -4, -4, -5, -5, -5, -5, -5, -5, -6, -6, -6, -6, -6, + -6, -6, -6, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -6, -6, -6, -6, -6, -6, -6, -6, + -5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -3, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_3[] = -{ - 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, - 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -3, -3, -4, -4, -4, -5, -5, -5, -5, -6, -6, -6, -6, -6, - -7, -7, -7, -7, -7, -7, -8, -8, -8, -8, -8, -8, -8, -8, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -8, -8, -8, -8, -8, -8, -8, -8, -7, -7, -7, -7, -7, -7, -6, -6, -6, -6, -6, -5, -5, -5, -5, -4, -4, - -4, -3, -3, -2, -2, -1, -1, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_3[] = { + 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, + 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, + 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, -1, + -1, -2, -2, -3, -3, -4, -4, -4, -5, -5, -5, -5, -6, -6, -6, -6, -6, -7, -7, -7, -7, -7, -7, -8, -8, -8, -8, + -8, -8, -8, -8, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -8, -8, -8, -8, -8, -8, -8, -8, -7, -7, + -7, -7, -7, -7, -6, -6, -6, -6, -6, -5, -5, -5, -5, -4, -4, -4, -3, -3, -2, -2, -1, -1, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_4[] = -{ - 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -5, - -5, -5, -5, -5, -5, -5, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -5, -5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, - -1, -1, -1, -1, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_4[] = { + 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, + 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, -1, + -1, -1, -1, -1, -2, -2, -2, -2, -2, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -5, -5, -5, -5, -5, -5, -5, -6, -6, + -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -5, -5, -5, -5, -5, -5, -5, -4, -4, + -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_5[] = -{ - 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, - 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, - 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, - 1, 1, 1, 1, 0, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, -3, -3, -3, -3, -4, -4, -4, -4, -5, -5, -5, -5, - -6, -6, -6, -6, -7, -7, -7, -7, -8, -8, -8, -8, -9, -9, -9, -9, -10, -10, -10, -10, -11, -11, -11, -11, - -12, -12, -12, -12, -13, -13, -13, -13, -13, -13, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -13, -13, -13, -13, -13, -13, -12, -12, -12, -12, -11, - -11, -11, -11, -10, -10, -10, -10, -9, -9, -9, -9, -8, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -5, - -5, -5, -5, -4, -4, -4, -4, -3, -3, -3, -3, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_5[] = { + 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, + 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, + 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, + 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, + 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, -3, -3, -3, -3, + -4, -4, -4, -4, -5, -5, -5, -5, -6, -6, -6, -6, -7, -7, -7, -7, -8, -8, -8, -8, -9, -9, -9, -9, + -10, -10, -10, -10, -11, -11, -11, -11, -12, -12, -12, -12, -13, -13, -13, -13, -13, -13, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -13, -13, -13, -13, -13, -13, -12, -12, -12, -12, -11, -11, + -11, -11, -10, -10, -10, -10, -9, -9, -9, -9, -8, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -5, -5, + -5, -5, -4, -4, -4, -4, -3, -3, -3, -3, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_6[] = -{ - 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, - 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, - 23, 23, 23, 22, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16, 16, 15, 15, - 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, - 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, -1, -1, -1, -2, -2, -2, -3, -3, -3, -4, -4, -4, -5, - -5, -5, -6, -6, -6, -7, -7, -7, -8, -8, -8, -9, -9, -9, -10, -10, -10, -11, -11, -11, -12, -12, -12, - -13, -13, -13, -14, -14, -14, -15, -15, -15, -16, -16, -16, -17, -17, -17, -18, -18, -18, -19, -19, -19, - -20, -20, -20, -21, -21, -21, -22, -22, -22, -23, -23, -23, -23, -23, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -23, -23, -23, -23, -23, -22, -22, -22, -21, -21, -21, -20, - -20, -20, -19, -19, -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, -14, -13, - -13, -13, -12, -12, -12, -11, -11, -11, -10, -10, -10, -9, -9, -9, -8, -8, -8, -7, -7, -7, -6, -6, -6, - -5, -5, -5, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_6[] = { + 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, + 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, + 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, + 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 22, + 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, 16, 16, 16, 15, 15, 15, + 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 9, 9, 9, 8, 8, 8, 7, 7, + 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, -1, + -1, -1, -2, -2, -2, -3, -3, -3, -4, -4, -4, -5, -5, -5, -6, -6, -6, -7, -7, -7, -8, -8, -8, + -9, -9, -9, -10, -10, -10, -11, -11, -11, -12, -12, -12, -13, -13, -13, -14, -14, -14, -15, -15, -15, -16, -16, + -16, -17, -17, -17, -18, -18, -18, -19, -19, -19, -20, -20, -20, -21, -21, -21, -22, -22, -22, -23, -23, -23, -23, + -23, -24, -24, -24, -24, -24, -24, -24, -24, -24, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -24, -24, -24, -24, -24, -24, -24, -24, -24, -23, -23, -23, -23, -23, -22, -22, -22, + -21, -21, -21, -20, -20, -20, -19, -19, -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, + -14, -13, -13, -13, -12, -12, -12, -11, -11, -11, -10, -10, -10, -9, -9, -9, -8, -8, -8, -7, -7, -7, -6, + -6, -6, -5, -5, -5, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_7[] = -{ - 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, - 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, - 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, -35, - -35, -35, -34, -34, -34, -33, -33, -33, -32, -32, -32, -31, -31, -31, -30, -30, -30, -29, -29, -29, -28, - -28, -28, -27, -27, -27, -26, -26, -26, -25, -25, -25, -24, -24, -24, -23, -23, -23, -22, -22, -22, -21, - -21, -21, -20, -20, -20, -19, -19, -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, - -14, -14, -13, -13, -13, -12, -12, -12, -11, -11, -11, -10, -10, -10, -9, -9, -9, -8, -8, -8, -7, -7, - -7, -6, -6, -6, -5, -5, -5, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_7[] = { + 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, + 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, + 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, + 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, + 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, -35, + -35, -35, -34, -34, -34, -33, -33, -33, -32, -32, -32, -31, -31, -31, -30, -30, -30, -29, -29, -29, -28, -28, + -28, -27, -27, -27, -26, -26, -26, -25, -25, -25, -24, -24, -24, -23, -23, -23, -22, -22, -22, -21, -21, -21, + -20, -20, -20, -19, -19, -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, -14, -13, + -13, -13, -12, -12, -12, -11, -11, -11, -10, -10, -10, -9, -9, -9, -8, -8, -8, -7, -7, -7, -6, -6, + -6, -5, -5, -5, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_8[] = -{ - 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, - 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, - 31, 31, 31, 31, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_8[] = { + 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, + 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 31, + 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, + 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_9[] = -{ - 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, - 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, - 31, 31, 31, 31, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_9[] = { + 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, + 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 31, + 31, 31, 31, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 28, 28, + 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_10[] = -{ - 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, - 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, - 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, - 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 31, 31, 31, 31, 30, - 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 27, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 24, 24, 24, - 24, 23, 23, 23, 23, 22, 22, 22, 22, 21, 21, 21, 21, 20, 20, 20, 20, 19, 19, 19, 19, 18, 18, 18, 18, 18, - 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, - 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, - 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 0, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_10[] = { + 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, + 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, + 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 31, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 28, + 28, 28, 28, 27, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22, 22, 22, 21, 21, 21, + 21, 20, 20, 20, 20, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, + 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, + 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 0, 0, -128, }; -static constexpr const int8_t SwingingTimeToSpriteMap_11[] = -{ - 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, - 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, - 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, - 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, - 31, 0, -128 +static constexpr const int8_t SwingingTimeToSpriteMap_11[] = { + 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, + 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, + 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 0, -128, }; /** rct2: 0x0099F9D0 */ -static constexpr const int8_t * SwingingTimeToSpriteMaps[] = { - SwingingTimeToSpriteMap_0, - SwingingTimeToSpriteMap_1, - SwingingTimeToSpriteMap_2, - SwingingTimeToSpriteMap_3, - SwingingTimeToSpriteMap_4, - SwingingTimeToSpriteMap_5, - SwingingTimeToSpriteMap_6, - SwingingTimeToSpriteMap_7, - SwingingTimeToSpriteMap_8, - SwingingTimeToSpriteMap_9, - SwingingTimeToSpriteMap_10, - SwingingTimeToSpriteMap_11, +static constexpr const int8_t* SwingingTimeToSpriteMaps[] = { + SwingingTimeToSpriteMap_0, SwingingTimeToSpriteMap_1, SwingingTimeToSpriteMap_2, SwingingTimeToSpriteMap_3, + SwingingTimeToSpriteMap_4, SwingingTimeToSpriteMap_5, SwingingTimeToSpriteMap_6, SwingingTimeToSpriteMap_7, + SwingingTimeToSpriteMap_8, SwingingTimeToSpriteMap_9, SwingingTimeToSpriteMap_10, SwingingTimeToSpriteMap_11, }; struct unk_9a36c4 @@ -449,293 +429,133 @@ struct unk_9a36c4 }; /** rct2: 0x009A36C4 */ -static constexpr const unk_9a36c4 Unk9A36C4[] = -{ - {-1, 0, 8716}, - {-1, 0, 8716}, - {-1, 0, 8716}, - {-1, 1, 12327}, - {-1, 1, 12327}, - {-1, 1, 12327}, - {0, 1, 8716}, - {-1, 1, 12327}, - {0, 1, 8716}, - {0, 1, 8716}, - {0, 1, 8716}, - {1, 1, 12327}, - {1, 1, 12327}, - {1, 1, 12327}, - {1, 0, 8716}, - {1, 1, 12327}, - {1, 0, 8716}, - {1, 0, 8716}, - {1, 0, 8716}, - {1, -1, 12327}, - {1, -1, 12327}, - {1, -1, 12327}, - {0, -1, 8716}, - {1, -1, 12327}, - {0, -1, 8716}, - {0, -1, 8716}, - {0, -1, 8716}, - {-1, -1, 12327}, - {-1, -1, 12327}, - {-1, -1, 12327}, - {-1, 0, 8716}, - {-1, -1, 12327}, +static constexpr const unk_9a36c4 Unk9A36C4[] = { + { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 0, 8716 }, { -1, 1, 12327 }, { -1, 1, 12327 }, { -1, 1, 12327 }, + { 0, 1, 8716 }, { -1, 1, 12327 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 0, 1, 8716 }, { 1, 1, 12327 }, + { 1, 1, 12327 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 1, 12327 }, { 1, 0, 8716 }, { 1, 0, 8716 }, + { 1, 0, 8716 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 1, -1, 12327 }, { 0, -1, 8716 }, { 1, -1, 12327 }, + { 0, -1, 8716 }, { 0, -1, 8716 }, { 0, -1, 8716 }, { -1, -1, 12327 }, { -1, -1, 12327 }, { -1, -1, 12327 }, + { -1, 0, 8716 }, { -1, -1, 12327 }, }; /** rct2: 0x009A37C4 */ -static constexpr const CoordsXY SurroundingTiles[] = -{ - { 0, 0 }, - { 0, +COORDS_XY_STEP }, - { +COORDS_XY_STEP, 0 }, - { 0, -COORDS_XY_STEP }, - { 0, -COORDS_XY_STEP }, - { -COORDS_XY_STEP, 0 }, - { -COORDS_XY_STEP, 0 }, - { 0, +COORDS_XY_STEP }, - { 0, +COORDS_XY_STEP }, +static constexpr const CoordsXY SurroundingTiles[] = { + { 0, 0 }, + { 0, +COORDS_XY_STEP }, + { +COORDS_XY_STEP, 0 }, + { 0, -COORDS_XY_STEP }, + { 0, -COORDS_XY_STEP }, + { -COORDS_XY_STEP, 0 }, + { -COORDS_XY_STEP, 0 }, + { 0, +COORDS_XY_STEP }, + { 0, +COORDS_XY_STEP }, }; /** rct2: 0x009A37E4 */ -static constexpr const int32_t Unk9A37E4[] = -{ - 2147483647, - 2106585154, - 1985590284, - 1636362342, - 1127484953, - 2106585154, - 1985590284, - 1636362342, - 1127484953, - 58579923, - 0, - -555809667, - -1073741824, - -1518500249, - -1859775391, - -2074309916, - -2147483647, - 58579923, - 0, - -555809667, - -1073741824, - -1518500249, - -1859775391, - -2074309916, - 1859775393, - 1073741824, - 0, - -1073741824, - -1859775393, - 1859775393, - 1073741824, - 0, - -1073741824, - -1859775393, - 1859775393, - 1073741824, - 0, - -1073741824, - -1859775393, - 1859775393, - 1073741824, - 0, - -1073741824, - -1859775393, - 2144540595, - 2139311823, - 2144540595, - 2139311823, - 2135719507, - 2135719507, - 2125953864, - 2061796213, - 1411702590, - 2125953864, - 2061796213, - 1411702590, - 1985590284, - 1636362342, - 1127484953, - 2115506168, +static constexpr const int32_t Unk9A37E4[] = { + 2147483647, 2106585154, 1985590284, 1636362342, 1127484953, 2106585154, 1985590284, 1636362342, 1127484953, + 58579923, 0, -555809667, -1073741824, -1518500249, -1859775391, -2074309916, -2147483647, 58579923, + 0, -555809667, -1073741824, -1518500249, -1859775391, -2074309916, 1859775393, 1073741824, 0, + -1073741824, -1859775393, 1859775393, 1073741824, 0, -1073741824, -1859775393, 1859775393, 1073741824, + 0, -1073741824, -1859775393, 1859775393, 1073741824, 0, -1073741824, -1859775393, 2144540595, + 2139311823, 2144540595, 2139311823, 2135719507, 2135719507, 2125953864, 2061796213, 1411702590, 2125953864, + 2061796213, 1411702590, 1985590284, 1636362342, 1127484953, 2115506168, }; /** rct2: 0x009A38D4 */ -static constexpr const int32_t Unk9A38D4[] = -{ - 0, - 417115092, - 817995863, - 1390684831, - 1827693544, - -417115092, - -817995863, - -1390684831, - -1827693544, - 2066040965, - 2147483647, - 2074309916, - 1859775393, - 1518500249, - 1073741824, - 555809666, - 0, - -2066040965, - -2147483647, - -2074309916, - -1859775393, - -1518500249, - -1073741824, - -555809666, - 1073741824, - 1859775393, - 2147483647, - 1859775393, - 1073741824, - -1073741824, - -1859775393, - -2147483647, - -1859775393, - -1073741824, - 1073741824, - 1859775393, - 2147483647, - 1859775393, - 1073741824, - -1073741824, - -1859775393, - -2147483647, - -1859775393, - -1073741824, - 112390610, - 187165532, - -112390610, - -187165532, - 224473165, - -224473165, - 303325208, - 600568389, - 1618265062, - -303325208, - -600568389, - -1618265062, - -817995863, - -1390684831, - -1827693544, - 369214930, +static constexpr const int32_t Unk9A38D4[] = { + 0, 417115092, 817995863, 1390684831, 1827693544, -417115092, -817995863, -1390684831, -1827693544, + 2066040965, 2147483647, 2074309916, 1859775393, 1518500249, 1073741824, 555809666, 0, -2066040965, + -2147483647, -2074309916, -1859775393, -1518500249, -1073741824, -555809666, 1073741824, 1859775393, 2147483647, + 1859775393, 1073741824, -1073741824, -1859775393, -2147483647, -1859775393, -1073741824, 1073741824, 1859775393, + 2147483647, 1859775393, 1073741824, -1073741824, -1859775393, -2147483647, -1859775393, -1073741824, 112390610, + 187165532, -112390610, -187165532, 224473165, -224473165, 303325208, 600568389, 1618265062, -303325208, + -600568389, -1618265062, -817995863, -1390684831, -1827693544, 369214930, }; /** rct2: 0x009A39C4 */ -static constexpr const int32_t Unk9A39C4[] = -{ - 2147483647, - 2096579710, - 1946281152, - 2096579710, - 1946281152, - 1380375879, - 555809667, - -372906620, - -1231746017, - -1859775391, - 1380375879, - 555809667, - -372906620, - -1231746017, - -1859775391, - 0, - 2096579710, - 1946281152, - 2096579710, - 1946281152, +static constexpr const int32_t Unk9A39C4[] = { + 2147483647, 2096579710, 1946281152, 2096579710, 1946281152, 1380375879, 555809667, -372906620, -1231746017, -1859775391, + 1380375879, 555809667, -372906620, -1231746017, -1859775391, 0, 2096579710, 1946281152, 2096579710, 1946281152, }; -static constexpr const CoordsXY AvoidCollisionMoveOffset[] = -{ - { -1, 0 }, - { 0, 1 }, - { 1, 0 }, - { 0, -1 }, +static constexpr const CoordsXY AvoidCollisionMoveOffset[] = { + { -1, 0 }, + { 0, 1 }, + { 1, 0 }, + { 0, -1 }, }; - -static constexpr const OpenRCT2::Audio::SoundId DoorOpenSoundIds[] = -{ +static constexpr const OpenRCT2::Audio::SoundId DoorOpenSoundIds[] = { OpenRCT2::Audio::SoundId::DoorOpen, - OpenRCT2::Audio::SoundId::Portcullis + OpenRCT2::Audio::SoundId::Portcullis, }; -static constexpr const OpenRCT2::Audio::SoundId DoorCloseSoundIds[] = -{ +static constexpr const OpenRCT2::Audio::SoundId DoorCloseSoundIds[] = { OpenRCT2::Audio::SoundId::DoorClose, - OpenRCT2::Audio::SoundId::Portcullis + OpenRCT2::Audio::SoundId::Portcullis, }; static const struct { int8_t x, y, z; -} SteamParticleOffsets[][16] = -{ +} SteamParticleOffsets[][16] = { { - { -11, 0, 22 }, - { -10, 4, 22 }, - { -8, 8, 22 }, - { -4, 10, 22 }, - { 0, 11, 22 }, - { 4, 10, 22 }, - { 8, 8, 22 }, - { 10, 4, 22 }, - { 11, 0, 22 }, - { 10, -4, 22 }, - { 8, -8, 22 }, - { 4, -10, 22 }, - { 0, -11, 22 }, - { -4, -10, 22 }, - { -8, -8, 22 }, - { -10, -4, 22 } - }, { - { -9, 0, 27 }, - { -8, 4, 27 }, - { -6, 6, 27 }, - { -4, 8, 27 }, - { 0, 9, 27 }, - { 4, 8, 27 }, - { 6, 6, 27 }, - { 8, 4, 27 }, - { 9, 0, 27 }, - { 8, -4, 27 }, - { 6, -6, 27 }, - { 4, -8, 27 }, - { 0, -9, 27 }, - { -4, -8, 27 }, - { -6, -6, 27 }, - { -8, -4, 27 } - }, { - { -13, 0, 18 }, - { -12, 4, 17 }, - { -9, 9, 17 }, - { -4, 8, 17 }, - { 0, 13, 18 }, - { 4, 8, 17 }, - { 6, 6, 17 }, - { 8, 4, 17 }, - { 13, 0, 18 }, - { 8, -4, 17 }, - { 6, -6, 17 }, - { 4, -8, 17 }, - { 0, -13, 18 }, - { -4, -8, 17 }, - { -6, -6, 17 }, - { -8, -4, 17 } - } + { -11, 0, 22 }, + { -10, 4, 22 }, + { -8, 8, 22 }, + { -4, 10, 22 }, + { 0, 11, 22 }, + { 4, 10, 22 }, + { 8, 8, 22 }, + { 10, 4, 22 }, + { 11, 0, 22 }, + { 10, -4, 22 }, + { 8, -8, 22 }, + { 4, -10, 22 }, + { 0, -11, 22 }, + { -4, -10, 22 }, + { -8, -8, 22 }, + { -10, -4, 22 }, + }, + { + { -9, 0, 27 }, + { -8, 4, 27 }, + { -6, 6, 27 }, + { -4, 8, 27 }, + { 0, 9, 27 }, + { 4, 8, 27 }, + { 6, 6, 27 }, + { 8, 4, 27 }, + { 9, 0, 27 }, + { 8, -4, 27 }, + { 6, -6, 27 }, + { 4, -8, 27 }, + { 0, -9, 27 }, + { -4, -8, 27 }, + { -6, -6, 27 }, + { -8, -4, 27 }, + }, + { + { -13, 0, 18 }, + { -12, 4, 17 }, + { -9, 9, 17 }, + { -4, 8, 17 }, + { 0, 13, 18 }, + { 4, 8, 17 }, + { 6, 6, 17 }, + { 8, 4, 17 }, + { 13, 0, 18 }, + { 8, -4, 17 }, + { 6, -6, 17 }, + { 4, -8, 17 }, + { 0, -13, 18 }, + { -4, -8, 17 }, + { -6, -6, 17 }, + { -8, -4, 17 }, + }, }; -// clang-format on - template<> bool EntityBase::Is() const { return Type == EntityType::Vehicle; diff --git a/src/openrct2/ride/VehicleData.cpp b/src/openrct2/ride/VehicleData.cpp index 355438766c..89fa602571 100644 --- a/src/openrct2/ride/VehicleData.cpp +++ b/src/openrct2/ride/VehicleData.cpp @@ -62,7 +62,7 @@ static constexpr const uint8_t Rotation1TimeToSpriteMap_0[] = { 204, 204, 204, 205, 205, 205, 206, 206, 206, 207, 207, 207, 208, 208, 208, 209, 209, 209, 210, 210, 210, 211, 211, 211, 212, 212, 212, 213, 213, 213, 214, 214, 214, 215, 215, 215, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099F422 */ @@ -106,7 +106,7 @@ static constexpr const uint8_t Rotation1TimeToSpriteMap_1[] = { 204, 204, 204, 205, 205, 205, 206, 206, 206, 207, 207, 207, 208, 208, 208, 209, 209, 209, 210, 210, 210, 211, 211, 211, 212, 212, 212, 213, 213, 213, 214, 214, 214, 215, 215, 215, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099F6AB */ @@ -159,7 +159,7 @@ static constexpr const uint8_t Rotation1TimeToSpriteMap_2[] = { 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099F0F4 */ @@ -208,7 +208,7 @@ static constexpr const uint8_t Rotation2TimeToSpriteMap_0[] = { 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 40, 40, 41, 41, 42, 42, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 43, 43, 44, 44, 45, 45, 43, 43, 44, 44, 45, 45, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x009A26A6 */ @@ -219,7 +219,7 @@ static constexpr const uint8_t Rotation2TimeToSpriteMap_1[] = { 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, 46, 46, 47, 47, 48, 48, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x009A270E */ @@ -252,7 +252,7 @@ static constexpr const uint8_t Rotation2TimeToSpriteMap_2[] = { 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x009A2428 */ @@ -296,7 +296,7 @@ static constexpr const uint8_t Rotation3TimeToSpriteMap_0[] = { 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 119, 119, 119, 120, 120, 120, 121, 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, 127, 127, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099ED49 */ @@ -324,7 +324,7 @@ static constexpr const uint8_t Rotation3TimeToSpriteMap_1[] = { 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 119, 119, 119, 120, 120, 120, 121, 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, 127, 127, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099EED1 */ @@ -361,7 +361,7 @@ static constexpr const uint8_t Rotation3TimeToSpriteMap_2[] = { 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; /** rct2: 0x0099EB1C */ diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 64f8c128a6..84ecc2748d 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -22,872 +22,913 @@ #include -// clang-format off // 0x0098E52C: const vehicle_boundbox VehicleBoundboxes[16][224] = { - { // 0x0099123C: - { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, - { -10, -6, -22, 16, 12, 14 }, { -8, -8, -22, 16, 16, 14 }, { -6, -11, -27, 3, 16, 19 }, { -8, -8, -22, 16, 16, 14 }, - { -11, -6, -27, 16, 5, 19 }, { -8, -8, -22, 16, 16, 14 }, { -6, -10, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, - { -10, -6, -22, 16, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, - { -3, -10, -33, 3, 16, 27 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, - { -13, -6, -33, 16, 5, 24 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, - { -6, -10, -22, 12, 16, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, - { -10, -6, -33, 20, 12, 24 }, { -2, -3, -33, 3, 10, 29 }, { -13, -6, -33, 20, 5, 24 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, - { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, - { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, - { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, - { -10, -6, -33, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -33, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -22, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -22, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -38, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -28, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, - { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -6, -22, 16, 12, 14 }, - { -8, -6, -22, 16, 12, 14 }, { -8, -6, -22, 16, 12, 14 }, { -8, -8, -22, 16, 16, 14 }, { -6, -8, -22, 12, 16, 14 }, - { -6, -8, -22, 12, 16, 14 }, { -6, -8, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -6, -22, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x0099027C: - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x009907BC: - { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, - { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, - { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, - { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, - { -6, -6, -23, 12, 12, 14 }, { -9, -6, -23, 18, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -9, -23, 12, 18, 14 }, - { -6, -6, -23, 12, 12, 14 }, { -6, -9, -23, 12, 18, 14 }, { -8, -8, -23, 16, 16, 14 }, { -9, -6, -23, 18, 12, 14 }, - { -6, -6, -23, 12, 12, 14 }, { -9, -6, -23, 18, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -9, -23, 12, 18, 14 }, - { -6, -6, -23, 12, 12, 14 }, { -6, -9, -23, 12, 18, 14 }, { -8, -8, -23, 16, 16, 14 }, { -9, -6, -23, 18, 12, 14 }, - { -10, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -11, -28, 3, 16, 19 }, { -8, -8, -23, 16, 16, 14 }, - { -11, -6, -28, 16, 5, 19 }, { -8, -8, -23, 16, 16, 14 }, { -6, -10, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, - { -10, -6, -23, 16, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, - { -3, -10, -34, 3, 16, 27 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, - { -13, -6, -34, 16, 5, 24 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, - { -6, -10, -23, 12, 16, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, - { -10, -6, -34, 20, 12, 24 }, { -2, -3, -34, 3, 10, 29 }, { -13, -6, -34, 20, 5, 24 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, - { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, - { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, - { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, - { -10, -6, -34, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -34, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -23, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -23, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -39, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -29, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, - { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, - { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, - { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x009921FC: - { -19, -6, -28, 38, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, - { -6, -19, -28, 12, 38, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, - { -19, -6, -28, 38, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, - { -6, -19, -28, 12, 38, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, - { -15, -6, -28, 18, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 28, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 28, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -15, -28, 12, 18, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -13, -6, -39, 16, 5, 24 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 20, 12, 24 }, { -2, -3, -39, 3, 10, 29 }, { -13, -6, -39, 20, 5, 24 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x00991CBC: - { -24, -6, -28, 32, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, - { -6, -11, -28, 12, 32, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, - { -11, -6, -28, 32, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, - { -6, -24, -28, 12, 32, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, - { -15, -6, -28, 18, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 28, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 28, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -15, -28, 12, 18, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -13, -6, -39, 16, 5, 24 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 20, 12, 24 }, { -2, -3, -39, 3, 10, 29 }, { -13, -6, -39, 20, 5, 24 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x0098F52C - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -13, -6, 1, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -13, 3, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -13, -6, 3, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -13, 1, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -18, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, - { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, - { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x0098EFEC: - { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, - { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, - { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, - { -6, -10, 2, 12, 20, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -6, 1, 16, 12, 14 }, - { -10, -6, 2, 20, 12, 14 }, { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, - { -6, -10, 1, 12, 20, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -6, 1, 16, 12, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -10, 1, 12, 20, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -10, 1, 12, 20, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, - { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, - { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, - { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, - { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x0098EAAC: - { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 2, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -8, -8, 1, 16, 16, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -8, -6, 2, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -8, -8, 1, 16, 16, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, - { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 6, 6, 15 }, - { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, - { -12, -12, -8, 6, 6, 15 }, { -12, -6, -8, 6, 6, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, - { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, - { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, - { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x0098E56C: - { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, - { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, - { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, - { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, - { -3, -6, 1, 6, 12, 14 }, { -3, -6, 1, 6, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -3, 1, 12, 6, 14 }, - { -6, -3, 2, 12, 6, 14 }, { -6, -3, 1, 12, 6, 14 }, { -8, -8, 1, 16, 16, 14 }, { -3, -6, 1, 6, 12, 14 }, - { -3, -6, 2, 6, 12, 14 }, { -3, -6, 1, 6, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -3, 1, 12, 6, 14 }, - { -6, -3, 1, 12, 6, 14 }, { -6, -3, 1, 12, 6, 14 }, { -8, -8, 1, 16, 16, 14 }, { -3, -6, 1, 6, 12, 14 }, - { -3, -6, 1, 6, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -3, 1, 12, 6, 7 }, { -8, -8, 1, 16, 16, 7 }, - { -3, -6, 1, 6, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -3, 1, 12, 6, 7 }, { 0, 0, 1, 8, 8, 7 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, - { 0, -6, -4, 10, 12, 7 }, { 0, -6, -4, 10, 12, 7 }, { 0, -6, -4, 10, 12, 7 }, { -6, -12, -4, 12, 10, 7 }, - { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, - { -12, -6, -4, 10, 12, 7 }, { -12, -6, -4, 10, 12, 7 }, { -12, -6, -4, 10, 12, 7 }, { -6, 0, -4, 12, 10, 7 }, - { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, - { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, - { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, - { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, - { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, - { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, - { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, - { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, - { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, - { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, - { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x00990CFC: - { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -11, -6, 1, 22, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -11, 3, 12, 22, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -11, -6, 3, 22, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -11, 1, 12, 22, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -12, -6, 1, 24, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -12, 1, 12, 24, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -18, -6, 1, 24, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 24, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -12, -6, 5, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -12, 5, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -18, -6, 5, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { 0, -6, -10, 14, 12, 24 }, { -6, -17, -10, 3, 14, 24 }, { -17, -6, -10, 14, 5, 24 }, { -6, 0, -10, 12, 14, 24 }, - { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, - { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, - { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, - { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, - { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, - { -14, -6, 1, 28, 12, 14 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, 1, 12, 28, 14 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x0098FA6C: - { -18, -6, 1, 36, 12, 11 }, { -17, -6, 1, 34, 12, 11 }, { -15, -15, 1, 30, 30, 11 }, { -6, -17, 1, 12, 34, 11 }, - { -6, -18, 1, 12, 36, 11 }, { -6, -17, 1, 12, 34, 11 }, { -15, -15, 1, 30, 30, 11 }, { -17, -6, 1, 34, 12, 11 }, - { -18, -6, 1, 36, 12, 11 }, { -17, -6, 1, 34, 12, 11 }, { -15, -15, 1, 30, 30, 11 }, { -6, -17, 1, 12, 34, 11 }, - { -6, -18, 1, 12, 36, 11 }, { -6, -17, 1, 12, 34, 11 }, { -15, -15, 1, 30, 30, 11 }, { -17, -6, 1, 34, 12, 11 }, - { -14, -6, 1, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 3, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 3, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, - { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, - { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, - { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, - { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, - { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, - { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, - { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x0099177C: - { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -13, -6, 1, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -13, 3, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -13, -6, 3, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -13, 1, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, - { -18, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, - { -14, -6, 5, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -18, -6, 5, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, - { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, - { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, - { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, - { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, - { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, - { -14, -6, 1, 28, 12, 14 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, 1, 12, 28, 14 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, - { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, - { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, - },{ // 0x009900FC: - { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - },{ // 0x009901BC: - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, - { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, - },{ // 0x0098FFAC: - { -3, -6, -1, 6, 12, 1 }, { -3, -5, -1, 6, 10, 1 }, { -5, -5, -1, 10, 10, 1 }, { -5, -3, -1, 10, 6, 1 }, - { -6, -3, -1, 12, 6, 1 }, { -5, -3, -1, 10, 6, 1 }, { -5, -5, -1, 10, 10, 1 }, { -3, -5, -1, 6, 10, 1 }, - { -3, -6, -1, 6, 12, 1 }, { -3, -5, -1, 6, 10, 1 }, { -5, -5, -1, 10, 10, 1 }, { -5, -3, -1, 10, 6, 1 }, - { -6, -3, -1, 12, 6, 1 }, { -5, -3, -1, 10, 6, 1 }, { -5, -5, -1, 10, 10, 1 }, { -3, -5, -1, 6, 10, 1 }, - { -3, -6, -8, 6, 12, 1 }, { -3, -6, -1, 6, 12, 1 }, { -8, -8, -1, 16, 16, 1 }, { -6, -3, -1, 12, 6, 1 }, - { -6, -3, 0, 12, 6, 1 }, { -6, -3, -1, 12, 6, 1 }, { -8, -8, -1, 16, 16, 1 }, { -3, -6, -1, 6, 12, 1 }, - { -3, -6, 0, 6, 12, 1 }, { -3, -6, -1, 6, 12, 1 }, { -8, -8, -1, 16, 16, 1 }, { -6, -3, -1, 12, 6, 1 }, - { -6, -3, -8, 12, 6, 1 }, { -6, -3, -1, 12, 6, 1 }, { -8, -8, -1, 16, 16, 1 }, { -3, -6, -1, 6, 12, 1 }, - { -3, -6, -10, 6, 12, 1 }, { -8, -8, -2, 16, 16, 1 }, { -6, -3, -2, 12, 6, 1 }, { -8, -8, -2, 16, 16, 1 }, - { -3, -6, -2, 6, 12, 1 }, { -8, -8, -2, 16, 16, 1 }, { -6, -3, -10, 12, 6, 1 }, { 0, 0, -2, 8, 8, 1 }, - { -3, -6, -12, 6, 12, 1 }, { -8, -6, -6, 16, 12, 1 }, { -8, -8, -6, 16, 16, 1 }, { -6, -8, -6, 12, 16, 1 }, - { -6, -3, -2, 12, 6, 1 }, { -6, -8, -6, 12, 16, 1 }, { -8, -8, -6, 16, 16, 1 }, { -8, -6, -6, 16, 12, 1 }, - { -3, -6, -2, 6, 12, 1 }, { -8, -6, -6, 16, 12, 1 }, { -8, -8, -6, 16, 16, 1 }, { -6, -8, -6, 12, 16, 1 }, - { -6, -3, -12, 12, 6, 1 }, { -6, -8, -6, 12, 16, 1 }, { -8, -8, -6, 16, 16, 1 }, { -8, -6, -6, 16, 12, 1 }, - { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, - { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, - { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, - { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, - { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, - { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, - { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, - { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, - { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, - { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, - { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, - { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, - { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, - { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, - { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, - },{ // 0x0099273C: - { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, - { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, - { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, - { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, { -6, -6, 0, 12, 12, 31 }, + { + // 0x0099123C: + { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -5, -2, -22, 10, 4, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -2, -5, -22, 4, 10, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, { -3, -3, -22, 6, 6, 14 }, + { -10, -6, -22, 16, 12, 14 }, { -8, -8, -22, 16, 16, 14 }, { -6, -11, -27, 3, 16, 19 }, { -8, -8, -22, 16, 16, 14 }, + { -11, -6, -27, 16, 5, 19 }, { -8, -8, -22, 16, 16, 14 }, { -6, -10, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, + { -10, -6, -22, 16, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, + { -3, -10, -33, 3, 16, 27 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, + { -13, -6, -33, 16, 5, 24 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, + { -6, -10, -22, 12, 16, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, { -6, -6, -22, 12, 12, 14 }, + { -10, -6, -33, 20, 12, 24 }, { -2, -3, -33, 3, 10, 29 }, { -13, -6, -33, 20, 5, 24 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, { -10, -6, -43, 5, 12, 34 }, + { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, { -2, 4, -33, 3, 10, 29 }, + { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, { -13, -6, -33, 20, 5, 24 }, + { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, { -6, -15, -22, 12, 10, 14 }, + { -10, -6, -33, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -33, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -22, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -22, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -38, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -28, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, + { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -6, -22, 16, 12, 14 }, + { -8, -6, -22, 16, 12, 14 }, { -8, -6, -22, 16, 12, 14 }, { -8, -8, -22, 16, 16, 14 }, { -6, -8, -22, 12, 16, 14 }, + { -6, -8, -22, 12, 16, 14 }, { -6, -8, -22, 12, 16, 14 }, { -8, -8, -22, 16, 16, 14 }, { -8, -6, -22, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -22, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, -22, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -22, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x0099027C: + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x009907BC: + { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, + { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, + { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, + { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, + { -6, -6, -23, 12, 12, 14 }, { -9, -6, -23, 18, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -9, -23, 12, 18, 14 }, + { -6, -6, -23, 12, 12, 14 }, { -6, -9, -23, 12, 18, 14 }, { -8, -8, -23, 16, 16, 14 }, { -9, -6, -23, 18, 12, 14 }, + { -6, -6, -23, 12, 12, 14 }, { -9, -6, -23, 18, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -9, -23, 12, 18, 14 }, + { -6, -6, -23, 12, 12, 14 }, { -6, -9, -23, 12, 18, 14 }, { -8, -8, -23, 16, 16, 14 }, { -9, -6, -23, 18, 12, 14 }, + { -10, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -11, -28, 3, 16, 19 }, { -8, -8, -23, 16, 16, 14 }, + { -11, -6, -28, 16, 5, 19 }, { -8, -8, -23, 16, 16, 14 }, { -6, -10, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, + { -10, -6, -23, 16, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, + { -3, -10, -34, 3, 16, 27 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, + { -13, -6, -34, 16, 5, 24 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, + { -6, -10, -23, 12, 16, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, { -6, -6, -23, 12, 12, 14 }, + { -10, -6, -34, 20, 12, 24 }, { -2, -3, -34, 3, 10, 29 }, { -13, -6, -34, 20, 5, 24 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, { -10, -6, -44, 5, 12, 34 }, + { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, { -2, 4, -34, 3, 10, 29 }, + { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, { -13, -6, -34, 20, 5, 24 }, + { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, { -6, -15, -23, 12, 10, 14 }, + { -10, -6, -34, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -34, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -23, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -23, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -39, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -29, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, + { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, + { -8, -6, -23, 16, 12, 14 }, { -8, -6, -23, 16, 12, 14 }, { -8, -8, -23, 16, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, + { -6, -8, -23, 12, 16, 14 }, { -6, -8, -23, 12, 16, 14 }, { -8, -8, -23, 16, 16, 14 }, { -8, -6, -23, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x009921FC: + { -19, -6, -28, 38, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, + { -6, -19, -28, 12, 38, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, + { -19, -6, -28, 38, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, + { -6, -19, -28, 12, 38, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, + { -15, -6, -28, 18, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 28, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 28, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -15, -28, 12, 18, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -13, -6, -39, 16, 5, 24 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 20, 12, 24 }, { -2, -3, -39, 3, 10, 29 }, { -13, -6, -39, 20, 5, 24 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x00991CBC: + { -24, -6, -28, 32, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, + { -6, -11, -28, 12, 32, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, + { -11, -6, -28, 32, 12, 14 }, { -11, -6, -28, 22, 12, 14 }, { -11, -11, -28, 22, 22, 14 }, { -6, -11, -28, 12, 22, 14 }, + { -6, -24, -28, 12, 32, 14 }, { -6, -11, -28, 12, 22, 14 }, { -11, -11, -28, 22, 22, 14 }, { -11, -6, -28, 22, 12, 14 }, + { -15, -6, -28, 18, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 28, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 28, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -15, -28, 12, 18, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -13, -6, -39, 16, 5, 24 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 20, 12, 24 }, { -2, -3, -39, 3, 10, 29 }, { -13, -6, -39, 20, 5, 24 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x0098F52C + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -13, -6, 1, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -13, 3, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -13, -6, 3, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -13, 1, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -18, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, + { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, + { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x0098EFEC: + { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, + { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, + { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, + { -6, -10, 2, 12, 20, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -6, 1, 16, 12, 14 }, + { -10, -6, 2, 20, 12, 14 }, { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, + { -6, -10, 1, 12, 20, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -6, 1, 16, 12, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -10, 1, 12, 20, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -10, 1, 12, 20, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, + { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, + { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, + { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -9, -6, 1, 18, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -9, 1, 12, 18, 14 }, + { -6, -10, 1, 12, 20, 14 }, { -6, -9, 1, 12, 18, 14 }, { -8, -8, 1, 16, 16, 14 }, { -9, -6, 1, 18, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x0098EAAC: + { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 2, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -8, -8, 1, 16, 16, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -8, -6, 2, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -8, -8, 1, 16, 16, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -8, 1, 12, 16, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, + { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 6, 6, 15 }, + { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, { -12, -12, -8, 6, 6, 15 }, + { -12, -12, -8, 6, 6, 15 }, { -12, -6, -8, 6, 6, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, + { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, { -10, -6, -15, 20, 12, 7 }, { -6, -10, -15, 12, 20, 7 }, + { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -8, -6, 1, 16, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, { -6, -6, 1, 12, 12, 14 }, { -6, -7, 1, 12, 14, 14 }, + { -6, -8, 1, 12, 16, 14 }, { -6, -7, 1, 12, 14, 14 }, { -6, -6, 1, 12, 12, 14 }, { -7, -6, 1, 14, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x0098E56C: + { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, + { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, + { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, + { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, + { -3, -6, 1, 6, 12, 14 }, { -3, -6, 1, 6, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -3, 1, 12, 6, 14 }, + { -6, -3, 2, 12, 6, 14 }, { -6, -3, 1, 12, 6, 14 }, { -8, -8, 1, 16, 16, 14 }, { -3, -6, 1, 6, 12, 14 }, + { -3, -6, 2, 6, 12, 14 }, { -3, -6, 1, 6, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -3, 1, 12, 6, 14 }, + { -6, -3, 1, 12, 6, 14 }, { -6, -3, 1, 12, 6, 14 }, { -8, -8, 1, 16, 16, 14 }, { -3, -6, 1, 6, 12, 14 }, + { -3, -6, 1, 6, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -3, 1, 12, 6, 7 }, { -8, -8, 1, 16, 16, 7 }, + { -3, -6, 1, 6, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -3, 1, 12, 6, 7 }, { 0, 0, 1, 8, 8, 7 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, + { 0, -6, -4, 10, 12, 7 }, { 0, -6, -4, 10, 12, 7 }, { 0, -6, -4, 10, 12, 7 }, { -6, -12, -4, 12, 10, 7 }, + { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, { -6, -12, -4, 12, 10, 7 }, + { -12, -6, -4, 10, 12, 7 }, { -12, -6, -4, 10, 12, 7 }, { -12, -6, -4, 10, 12, 7 }, { -6, 0, -4, 12, 10, 7 }, + { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, { -6, 0, -4, 12, 10, 7 }, + { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, + { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, + { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, + { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, + { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, + { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, { -3, -6, -15, 6, 12, 6 }, { -6, -3, -15, 12, 6, 6 }, + { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, + { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, + { -3, -6, 1, 6, 12, 14 }, { -3, -5, 1, 6, 10, 14 }, { -5, -5, 1, 10, 10, 14 }, { -5, -3, 1, 10, 6, 14 }, + { -6, -3, 1, 12, 6, 14 }, { -5, -3, 1, 10, 6, 14 }, { -5, -5, 1, 10, 10, 14 }, { -3, -5, 1, 6, 10, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x00990CFC: + { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -11, -6, 1, 22, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -11, 3, 12, 22, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -11, -6, 3, 22, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -11, 1, 12, 22, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -12, -6, 1, 24, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -12, 1, 12, 24, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -18, -6, 1, 24, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 24, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -12, -6, 5, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -12, 5, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -18, -6, 5, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { 0, -6, -10, 14, 12, 24 }, { -6, -17, -10, 3, 14, 24 }, { -17, -6, -10, 14, 5, 24 }, { -6, 0, -10, 12, 14, 24 }, + { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, + { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, + { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, + { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, + { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, + { -14, -6, 1, 28, 12, 14 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, 1, 12, 28, 14 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -12, -6, 1, 24, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -12, 1, 12, 24, 14 }, { -6, -11, 1, 12, 22, 14 }, { -10, -10, 1, 20, 20, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x0098FA6C: + { -18, -6, 1, 36, 12, 11 }, { -17, -6, 1, 34, 12, 11 }, { -15, -15, 1, 30, 30, 11 }, { -6, -17, 1, 12, 34, 11 }, + { -6, -18, 1, 12, 36, 11 }, { -6, -17, 1, 12, 34, 11 }, { -15, -15, 1, 30, 30, 11 }, { -17, -6, 1, 34, 12, 11 }, + { -18, -6, 1, 36, 12, 11 }, { -17, -6, 1, 34, 12, 11 }, { -15, -15, 1, 30, 30, 11 }, { -6, -17, 1, 12, 34, 11 }, + { -6, -18, 1, 12, 36, 11 }, { -6, -17, 1, 12, 34, 11 }, { -15, -15, 1, 30, 30, 11 }, { -17, -6, 1, 34, 12, 11 }, + { -14, -6, 1, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 3, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 3, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -3, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -8, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { -8, -6, 5, 6, 12, 7 }, { -8, -6, 1, 16, 12, 7 }, { -8, -8, 1, 16, 16, 7 }, { -6, -8, 1, 12, 16, 7 }, + { -6, -3, 5, 12, 6, 7 }, { -6, -8, 1, 12, 16, 7 }, { -8, -8, 1, 16, 16, 7 }, { -8, -6, 1, 16, 12, 7 }, + { 0, -6, 5, 3, 12, 5 }, { -6, -13, 5, 3, 12, 5 }, { -13, -6, 5, 12, 5, 5 }, { -6, 0, 5, 12, 3, 5 }, + { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { 0, -6, -8, 10, 12, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, { -6, -12, -8, 12, 10, 15 }, + { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -12, -6, -8, 10, 12, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, { -6, 0, -8, 12, 10, 15 }, + { -3, -6, -4, 6, 12, 5 }, { -6, -13, -4, 3, 20, 5 }, { -13, -6, -4, 6, 5, 5 }, { -6, -3, -4, 12, 20, 5 }, + { -3, -6, 1, 6, 12, 6 }, { -6, -13, -10, 3, 6, 6 }, { -13, -6, -10, 6, 5, 6 }, { -6, -3, 1, 12, 6, 6 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -32, -32, 24, 4, 4, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -14, 1, 12, 28, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, 10, 12, 12, 14 }, { -6, -6, 10, 12, 12, 14 }, + { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, { -6, -6, -12, 12, 12, 2 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x0099177C: + { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -13, -6, 1, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -13, 3, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -13, -6, 3, 26, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -13, 1, 12, 26, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { -8, -8, 1, 16, 16, 14 }, + { -18, -6, 1, 28, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -14, 1, 12, 28, 14 }, { 0, 0, 1, 8, 8, 14 }, + { -14, -6, 5, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -18, -6, 5, 28, 12, 14 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 14 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, + { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, { 0, -6, -7, 10, 12, 14 }, + { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, { -6, -12, -7, 12, 10, 14 }, + { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, { -12, -6, -7, 10, 12, 14 }, + { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, { -6, 0, -7, 12, 10, 14 }, + { -14, -6, -10, 28, 12, 24 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, -10, 12, 28, 24 }, + { -14, -6, 1, 28, 12, 14 }, { -6, -17, -10, 3, 28, 24 }, { -17, -6, -10, 28, 5, 24 }, { -6, -14, 1, 12, 28, 14 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, { -14, -6, -15, 28, 12, 7 }, { -6, -14, -15, 12, 28, 7 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, { -10, -10, 1, 20, 20, 14 }, + { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { -8, -8, 1, 16, 16, 14 }, { 8, 8, 1, 8, 8, 14 }, + { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -6, -16, 1, 12, 32, 8 }, { -5, -5, 1, 10, 10, 8 }, { -4, -4, 1, 8, 8, 8 }, { -5, -5, 1, 10, 10, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, { -16, -6, 1, 32, 12, 8 }, { -6, -16, 1, 12, 32, 8 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, 1, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, 1, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + { -10, -6, -23, 20, 12, 14 }, { -6, -10, 1, 12, 20, 14 }, { -10, -6, -23, 20, 12, 14 }, { -6, -10, -23, 12, 20, 14 }, + }, + { + // 0x009900FC: + { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + }, + { + // 0x009901BC: + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -8, -6, 11, 16, 12, 4 }, { -8, -6, 11, 16, 12, 4 }, { -8, -8, 11, 16, 16, 4 }, { -6, -8, 11, 12, 16, 4 }, + { -6, -8, 11, 12, 16, 4 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, 11, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -6, -10, 11, 12, 20, 14 }, { -10, -6, -28, 20, 12, 14 }, { -6, -10, -28, 12, 20, 14 }, + }, + { + // 0x0098FFAC: + { -3, -6, -1, 6, 12, 1 }, { -3, -5, -1, 6, 10, 1 }, { -5, -5, -1, 10, 10, 1 }, { -5, -3, -1, 10, 6, 1 }, + { -6, -3, -1, 12, 6, 1 }, { -5, -3, -1, 10, 6, 1 }, { -5, -5, -1, 10, 10, 1 }, { -3, -5, -1, 6, 10, 1 }, + { -3, -6, -1, 6, 12, 1 }, { -3, -5, -1, 6, 10, 1 }, { -5, -5, -1, 10, 10, 1 }, { -5, -3, -1, 10, 6, 1 }, + { -6, -3, -1, 12, 6, 1 }, { -5, -3, -1, 10, 6, 1 }, { -5, -5, -1, 10, 10, 1 }, { -3, -5, -1, 6, 10, 1 }, + { -3, -6, -8, 6, 12, 1 }, { -3, -6, -1, 6, 12, 1 }, { -8, -8, -1, 16, 16, 1 }, { -6, -3, -1, 12, 6, 1 }, + { -6, -3, 0, 12, 6, 1 }, { -6, -3, -1, 12, 6, 1 }, { -8, -8, -1, 16, 16, 1 }, { -3, -6, -1, 6, 12, 1 }, + { -3, -6, 0, 6, 12, 1 }, { -3, -6, -1, 6, 12, 1 }, { -8, -8, -1, 16, 16, 1 }, { -6, -3, -1, 12, 6, 1 }, + { -6, -3, -8, 12, 6, 1 }, { -6, -3, -1, 12, 6, 1 }, { -8, -8, -1, 16, 16, 1 }, { -3, -6, -1, 6, 12, 1 }, + { -3, -6, -10, 6, 12, 1 }, { -8, -8, -2, 16, 16, 1 }, { -6, -3, -2, 12, 6, 1 }, { -8, -8, -2, 16, 16, 1 }, + { -3, -6, -2, 6, 12, 1 }, { -8, -8, -2, 16, 16, 1 }, { -6, -3, -10, 12, 6, 1 }, { 0, 0, -2, 8, 8, 1 }, + { -3, -6, -12, 6, 12, 1 }, { -8, -6, -6, 16, 12, 1 }, { -8, -8, -6, 16, 16, 1 }, { -6, -8, -6, 12, 16, 1 }, + { -6, -3, -2, 12, 6, 1 }, { -6, -8, -6, 12, 16, 1 }, { -8, -8, -6, 16, 16, 1 }, { -8, -6, -6, 16, 12, 1 }, + { -3, -6, -2, 6, 12, 1 }, { -8, -6, -6, 16, 12, 1 }, { -8, -8, -6, 16, 16, 1 }, { -6, -8, -6, 12, 16, 1 }, + { -6, -3, -12, 12, 6, 1 }, { -6, -8, -6, 12, 16, 1 }, { -8, -8, -6, 16, 16, 1 }, { -8, -6, -6, 16, 12, 1 }, + { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -16, -6, 1, 32, 12, 14 }, { -12, -6, 1, 24, 12, 14 }, { -10, -10, 1, 20, 20, 14 }, { -6, -12, 1, 12, 24, 14 }, + { -6, -16, 1, 12, 32, 14 }, { -6, -12, 1, 12, 24, 14 }, { -10, -10, 1, 20, 20, 14 }, { -12, -6, 1, 24, 12, 14 }, + { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -14, -6, 5, 28, 12, 9 }, { -11, -6, 1, 22, 12, 14 }, { -8, -8, 1, 16, 16, 14 }, { -6, -11, 1, 12, 22, 14 }, + { -6, -14, 5, 12, 28, 9 }, { -6, -11, 1, 12, 22, 14 }, { -8, -8, 1, 16, 16, 14 }, { -11, -6, 1, 22, 12, 14 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, { -6, -6, -4, 12, 12, 1 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -8, -6, -28, 16, 12, 14 }, { -8, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, + { -6, -8, -28, 12, 16, 14 }, { -6, -8, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -6, -28, 16, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -9, -6, -28, 18, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -9, -28, 12, 18, 14 }, + { -6, -6, -28, 12, 12, 14 }, { -6, -9, -28, 12, 18, 14 }, { -8, -8, -28, 16, 16, 14 }, { -9, -6, -28, 18, 12, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -8, -8, -28, 16, 16, 14 }, { -6, -11, -33, 3, 16, 19 }, { -8, -8, -28, 16, 16, 14 }, + { -11, -6, -33, 16, 5, 19 }, { -8, -8, -28, 16, 16, 14 }, { -6, -10, -28, 12, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + { -10, -6, -28, 16, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -3, -10, -39, 3, 16, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -39, 16, 3, 27 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -6, -10, -28, 12, 16, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, { -6, -6, -28, 12, 12, 14 }, + { -10, -6, -28, 20, 12, 14 }, { -2, -3, -39, 3, 10, 29 }, { -3, -2, -39, 10, 3, 29 }, { -6, -10, -28, 12, 20, 14 }, + { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, { -10, -6, -49, 5, 12, 34 }, + { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, { -2, 4, -39, 3, 10, 29 }, + { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, { -13, -6, -39, 20, 5, 24 }, + { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, { -6, -15, -28, 12, 10, 14 }, + { -10, -6, -39, 4, 12, 24 }, { -2, 4, -10, 3, 10, 24 }, { -3, -6, -39, 10, 5, 24 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -28, 3, 12, 14 }, { -6, 0, -10, 3, 10, 24 }, { -3, -6, -28, 10, 5, 14 }, { -6, -15, -10, 12, 10, 14 }, + { -10, -6, -44, 20, 12, 7 }, { -6, 0, -5, 12, 10, 7 }, { 0, -6, -34, 10, 12, 7 }, { -6, -15, -5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, 0, 5, 12, 10, 7 }, { 0, -6, 5, 10, 12, 7 }, { -6, -10, 5, 12, 10, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, { -10, -6, 5, 20, 12, 7 }, { -6, -10, 5, 12, 20, 7 }, + { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, { -8, -8, -28, 16, 16, 14 }, + }, + { + // 0x0099273C: + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, + { -6, -6, 0, 12, 12, 31 }, } }; -// clang-format on // 6D5214 static void vehicle_sprite_paint( diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 0e66c3e734..74cccfbcfa 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -259,7 +259,7 @@ static void air_powered_vertical_rc_track_right_quarter_turn_5( { SPR_AIR_POWERED_VERTICAL_RC_QUARTER_TURN_5_SE_NE_PART_2, { 16, 0, 0 }, { 0, 0, 0 }, { 16, 16, 2 } }, { SPR_AIR_POWERED_VERTICAL_RC_QUARTER_TURN_5_SE_NE_PART_3, { 0, 16, 0 }, { 0, 0, 0 }, { 32, 16, 2 } }, { SPR_AIR_POWERED_VERTICAL_RC_QUARTER_TURN_5_SE_NE_PART_4, { 0, 2, 0 }, { 0, 0, 0 }, { 32, 32, 2 } }, - } + }, }; track_paint_util_right_quarter_turn_5_tiles_paint_3( @@ -423,7 +423,7 @@ static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( { SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_SE_NE_PART_2, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 16, 3 } }, { SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_SE_NE_PART_3, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 3 } }, { SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_SE_NE_PART_4, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 3 } }, - } + }, }; track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -645,9 +645,15 @@ static void air_powered_vertical_rc_track_vertical_slope_up( }, }; - static constexpr const int8_t bbHeights03[] = { 1, 6, 14, 37, 76 }; - static constexpr const int8_t bbHeights12[] = { 1, 6, 14, 27, 59 }; - static constexpr const int32_t supportHeights[] = { 48, 64, 128, 176, 208, 240, 240 }; + static constexpr const int8_t bbHeights03[] = { + 1, 6, 14, 37, 76, + }; + static constexpr const int8_t bbHeights12[] = { + 1, 6, 14, 27, 59, + }; + static constexpr const int32_t supportHeights[] = { + 48, 64, 128, 176, 208, 240, 240, + }; uint32_t supportsImageId = supportImageIds[trackSequence][direction] | air_powered_vertical_rc_get_support_colour(session); uint32_t trackImageId = trackImageIds[trackSequence][direction] | session->TrackColours[SCHEME_TRACK]; @@ -803,14 +809,22 @@ static void air_powered_vertical_rc_track_vertical_top( } static constexpr const uint32_t imageIds[4][6] = { - { SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_SW_NE, SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_0, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_1, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_2, SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_NE_SW, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_3 }, - { SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_NW_SE, SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_0, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_1, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_2, SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_SE_NW, - SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_3 }, + { + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_SW_NE, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_0, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_1, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_2, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_NE_SW, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_SW_NE_SEQ_3, + }, + { + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_NW_SE, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_0, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_1, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_2, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_SUPPORT_SE_NW, + SPR_AIR_POWERED_VERTICAL_RC_VERTICAL_TOP_TRACK_NW_SE_SEQ_3, + }, }; uint32_t imageIdS, imageIdT; diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp index b7e829fcfa..1f866445e7 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.cpp @@ -38,7 +38,12 @@ void bolliger_mabillard_track_flat( { if (trackElement.HasChain()) { - uint32_t imageIds[] = { 17486, 17487, 17488, 17489 }; + uint32_t imageIds[] = { + 17486, + 17487, + 17488, + 17489, + }; PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | imageIds[direction], 0, 0, 32, 20, 3, height, 0, 6, height); @@ -50,7 +55,12 @@ void bolliger_mabillard_track_flat( } else { - uint32_t imageIds[] = { 17146, 17147, 17146, 17147 }; + uint32_t imageIds[] = { + 17146, + 17147, + 17146, + 17147, + }; PaintAddImageAsParentRotated( session, direction, session->TrackColours[SCHEME_TRACK] | imageIds[direction], 0, 0, 32, 20, 3, height, 0, 6, diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 3c5e3a250e..cba9e03243 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -639,9 +639,18 @@ enum }; static constexpr const uint32_t junior_rc_track_pieces_flat[3][4] = { - { SPR_JUNIOR_RC_FLAT_SW_NE, SPR_JUNIOR_RC_FLAT_NW_SE, SPR_JUNIOR_RC_FLAT_SW_NE, SPR_JUNIOR_RC_FLAT_NW_SE }, - { SPR_JUNIOR_RC_FLAT_CHAIN_SW_NE, SPR_JUNIOR_RC_FLAT_CHAIN_NW_SE, SPR_JUNIOR_RC_FLAT_CHAIN_SW_NE, - SPR_JUNIOR_RC_FLAT_CHAIN_NW_SE }, + { + SPR_JUNIOR_RC_FLAT_SW_NE, + SPR_JUNIOR_RC_FLAT_NW_SE, + SPR_JUNIOR_RC_FLAT_SW_NE, + SPR_JUNIOR_RC_FLAT_NW_SE, + }, + { + SPR_JUNIOR_RC_FLAT_CHAIN_SW_NE, + SPR_JUNIOR_RC_FLAT_CHAIN_NW_SE, + SPR_JUNIOR_RC_FLAT_CHAIN_SW_NE, + SPR_JUNIOR_RC_FLAT_CHAIN_NW_SE, + }, { SPR_WATER_RC_FLAT_CHAIN_SW_NE, SPR_WATER_RC_FLAT_CHAIN_NW_SE, @@ -651,22 +660,48 @@ static constexpr const uint32_t junior_rc_track_pieces_flat[3][4] = { }; static constexpr const uint32_t junior_rc_track_pieces_block_brake[2][4] = { - { SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE, SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE, SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE, - SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE }, - { SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE_BRAKED, SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE_BRAKED, SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE_BRAKED, - SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE_BRAKED }, + { + SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE, + SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE, + SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE, + SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE, + }, + { + SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE_BRAKED, + SPR_JUNIOR_RC_FLAT_BLOCK_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_BLOCK_NW_SE_BRAKED, + }, }; static constexpr const uint32_t junior_rc_track_pieces_station[2][4] = { - { SPR_JUNIOR_RC_STATION_SW_NE, SPR_JUNIOR_RC_STATION_NW_SE, SPR_JUNIOR_RC_STATION_SW_NE, SPR_JUNIOR_RC_STATION_NW_SE }, - { SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, - SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED }, + { + SPR_JUNIOR_RC_STATION_SW_NE, + SPR_JUNIOR_RC_STATION_NW_SE, + SPR_JUNIOR_RC_STATION_SW_NE, + SPR_JUNIOR_RC_STATION_NW_SE, + }, + { + SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, + SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, + }, }; static constexpr const uint32_t junior_rc_track_pieces_25_deg_up[3][4] = { - { SPR_JUNIOR_RC_25_DEG_SW_NE, SPR_JUNIOR_RC_25_DEG_NW_SE, SPR_JUNIOR_RC_25_DEG_NE_SW, SPR_JUNIOR_RC_25_DEG_SE_NW }, - { SPR_JUNIOR_RC_25_DEG_CHAIN_SW_NE, SPR_JUNIOR_RC_25_DEG_CHAIN_NW_SE, SPR_JUNIOR_RC_25_DEG_CHAIN_NE_SW, - SPR_JUNIOR_RC_25_DEG_CHAIN_SE_NW }, + { + SPR_JUNIOR_RC_25_DEG_SW_NE, + SPR_JUNIOR_RC_25_DEG_NW_SE, + SPR_JUNIOR_RC_25_DEG_NE_SW, + SPR_JUNIOR_RC_25_DEG_SE_NW, + }, + { + SPR_JUNIOR_RC_25_DEG_CHAIN_SW_NE, + SPR_JUNIOR_RC_25_DEG_CHAIN_NW_SE, + SPR_JUNIOR_RC_25_DEG_CHAIN_NE_SW, + SPR_JUNIOR_RC_25_DEG_CHAIN_SE_NW, + }, { SPR_WATER_RC_25_DEG_CHAIN_SW_NE, SPR_WATER_RC_25_DEG_CHAIN_NW_SE, @@ -676,10 +711,18 @@ static constexpr const uint32_t junior_rc_track_pieces_25_deg_up[3][4] = { }; static constexpr const uint32_t junior_rc_track_pieces_flat_to_25_deg_up[3][4] = { - { SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_SW_NE, SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_NW_SE, SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_NE_SW, - SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_SE_NW }, - { SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_SW_NE, SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_NW_SE, - SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_NE_SW, SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_SE_NW }, + { + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_SW_NE, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_NW_SE, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_NE_SW, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_SE_NW, + }, + { + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_SW_NE, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_NW_SE, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_NE_SW, + SPR_JUNIOR_RC_FLAT_TO_25_DEG_UP_CHAIN_SE_NW, + }, { SPR_WATER_RC_FLAT_TO_25_DEG_UP_CHAIN_SW_NE, SPR_WATER_RC_FLAT_TO_25_DEG_UP_CHAIN_NW_SE, @@ -689,10 +732,18 @@ static constexpr const uint32_t junior_rc_track_pieces_flat_to_25_deg_up[3][4] = }; static constexpr const uint32_t junior_rc_track_pieces_25_deg_up_to_flat[3][4] = { - { SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_SW_NE, SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_NW_SE, SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_NE_SW, - SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_SE_NW }, - { SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_SW_NE, SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_NW_SE, - SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_NE_SW, SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_SE_NW }, + { + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_SW_NE, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_NW_SE, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_NE_SW, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_SE_NW, + }, + { + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_SW_NE, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_NW_SE, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_NE_SW, + SPR_JUNIOR_RC_25_DEG_UP_TO_FLAT_CHAIN_SE_NW, + }, { SPR_WATER_RC_25_DEG_UP_TO_FLAT_CHAIN_SW_NE, SPR_WATER_RC_25_DEG_UP_TO_FLAT_CHAIN_NW_SE, @@ -712,7 +763,7 @@ static constexpr const uint32_t junior_rc_track_pieces_flat_to_right_bank[4][2] { SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_SW_NE, 0 }, { SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_NW_SE, 0 }, { SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_NE_SW, SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_NE_SW_FRONT }, - { SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_SE_NW, SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_SE_NW_FRONT } + { SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_SE_NW, SPR_JUNIOR_RC_FLAT_TO_RIGHT_BANK_SE_NW_FRONT }, }; static constexpr const uint32_t junior_rc_track_pieces_flat_quarter_turn_5_tiles[4][5] = { @@ -743,7 +794,7 @@ static constexpr const uint32_t junior_rc_track_pieces_flat_quarter_turn_5_tiles SPR_JUNIOR_RC_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_2, SPR_JUNIOR_RC_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_3, SPR_JUNIOR_RC_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_4, - } + }, }; static constexpr const uint32_t junior_rc_track_pieces_banked_quarter_turn_5_tiles[4][5] = { @@ -774,273 +825,321 @@ static constexpr const uint32_t junior_rc_track_pieces_banked_quarter_turn_5_til SPR_JUNIOR_RC_BANKED_QUARTER_TURN_5_TILES_SE_NE_PART_2, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_5_TILES_SE_NE_PART_3, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_5_TILES_SE_NE_PART_4, - } + }, }; static constexpr const uint32_t junior_rc_track_pieces_left_banked_to_25_deg_up[4][2] = { { SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_SW_NE, SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_SW_NE_FRONT }, { SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_NW_SE, SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_NW_SE_FRONT }, { SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_NE_SW, 0 }, - { SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_SE_NW, 0 } + { SPR_JUNIOR_RC_LEFT_BANK_TO_25_DEG_UP_SE_NW, 0 }, }; static constexpr const uint32_t junior_rc_track_pieces_right_banked_to_25_deg_up[4][2] = { { SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_SW_NE, 0 }, { SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_NW_SE, 0 }, { SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_NE_SW, SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_NE_SW_FRONT }, - { SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_SE_NW, SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_SE_NW_FRONT } + { SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_SE_NW, SPR_JUNIOR_RC_RIGHT_BANK_TO_25_DEG_UP_SE_NW_FRONT }, }; static constexpr const uint32_t junior_rc_track_pieces_25_deg_up_to_left_bank[4][2] = { { SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_SW_NE, SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_SW_NE_FRONT }, { SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_NW_SE, SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_NW_SE_FRONT }, { SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_NE_SW, 0 }, - { SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_SE_NW, 0 } + { SPR_JUNIOR_RC_25_DEG_UP_TO_LEFT_BANK_SE_NW, 0 }, }; static constexpr const uint32_t junior_rc_track_pieces_25_deg_up_to_right_bank[4][2] = { { SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_SW_NE, 0 }, { SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_NW_SE, 0 }, { SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_NE_SW, SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_NE_SW_FRONT }, - { SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_SE_NW, SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_SE_NW_FRONT } + { SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_SE_NW, SPR_JUNIOR_RC_25_DEG_UP_TO_RIGHT_BANK_SE_NW_FRONT }, }; static constexpr const uint32_t junior_rc_track_pieces_left_bank[4] = { - SPR_JUNIOR_RC_LEFT_BANK_SW_NE, SPR_JUNIOR_RC_LEFT_BANK_NW_SE, SPR_JUNIOR_RC_LEFT_BANK_NE_SW, SPR_JUNIOR_RC_LEFT_BANK_SE_NW + SPR_JUNIOR_RC_LEFT_BANK_SW_NE, + SPR_JUNIOR_RC_LEFT_BANK_NW_SE, + SPR_JUNIOR_RC_LEFT_BANK_NE_SW, + SPR_JUNIOR_RC_LEFT_BANK_SE_NW, }; static constexpr const uint32_t junior_rc_track_pieces_left_quarter_turn_5_tiles_25_deg_up[2][4][5] = { - { { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_4, - } }, - { { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_4, - }, - { - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_2, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_3, - SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_4, - } } + { + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_4, + }, + }, + { + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_4, + }, + { + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_2, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_3, + SPR_JUNIOR_RC_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_4, + }, + }, }; -// clang-format off -static constexpr const CoordsXY junior_rc_left_quarter_turn_5_tiles_25_deg_up_offsets[4][5] = { { - { 0, 6 }, - { 0, 0 }, - { 0, 16 }, - { 16, 0 }, - { 6, 0 }, - }, - { - { 6, 0 }, - { 0, 0 }, - { 16, 16 }, - { 0, 0 }, - { 0, 6 }, - }, - { - { 0, 6 }, - { 0, 16 }, - { 16, 0 }, - { 0, 0 }, - { 6, 0 }, - }, - { - { 6, 0 }, - { 16, 0 }, - { 0, 0 }, - { 0, 16 }, - { 0, 6 }, - } }; +static constexpr const CoordsXY junior_rc_left_quarter_turn_5_tiles_25_deg_up_offsets[4][5] = { + { + { 0, 6 }, + { 0, 0 }, + { 0, 16 }, + { 16, 0 }, + { 6, 0 }, + }, + { + { 6, 0 }, + { 0, 0 }, + { 16, 16 }, + { 0, 0 }, + { 0, 6 }, + }, + { + { 0, 6 }, + { 0, 16 }, + { 16, 0 }, + { 0, 0 }, + { 6, 0 }, + }, + { + { 6, 0 }, + { 16, 0 }, + { 0, 0 }, + { 0, 16 }, + { 0, 6 }, + }, +}; static constexpr const uint32_t junior_rc_track_pieces_right_quarter_turn_5_tiles_25_deg_up[2][4][5] = { - { { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_4, - } }, - { { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_4, - }, - { - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_2, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_3, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_4, - } } + { + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SW_SE_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NW_SW_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_NE_NW_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_SE_NE_PART_4, + }, + }, + { + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SW_SE_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NW_SW_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_NE_NW_PART_4, + }, + { + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_2, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_3, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP_CHAIN_SE_NE_PART_4, + }, + }, }; -static constexpr const uint32_t junior_rc_track_pieces_s_bend_left[2][4] = { { - SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_0, - SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_1, - SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_2, - SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_3, - }, - { - SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_3, - SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_2, - SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_1, - SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_0, - } }; +static constexpr const uint32_t junior_rc_track_pieces_s_bend_left[2][4] = { + { + SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_0, + SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_1, + SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_2, + SPR_JUNIOR_RC_S_BEND_LEFT_SW_NE_PART_3, + }, + { + SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_3, + SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_2, + SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_1, + SPR_JUNIOR_RC_S_BEND_LEFT_SE_NW_PART_0, + }, +}; -static constexpr const uint32_t junior_rc_track_pieces_s_bend_right[2][4] = { { - SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_0, - SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_1, - SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_2, - SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_3, - }, - { - SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_3, - SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_2, - SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_1, - SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_0, - } }; +static constexpr const uint32_t junior_rc_track_pieces_s_bend_right[2][4] = { + { + SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_0, + SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_1, + SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_2, + SPR_JUNIOR_RC_S_BEND_RIGHT_SW_NE_PART_3, + }, + { + SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_3, + SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_2, + SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_1, + SPR_JUNIOR_RC_S_BEND_RIGHT_SE_NW_PART_0, + }, +}; static constexpr const uint32_t junior_rc_track_pieces_flat_quarter_turn_3_tiles[4][3] = { - { SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_JUNIOR_RC_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t junior_rc_track_pieces_banked_quarter_turn_3_tiles[4][3] = { - { SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_up[2][4][2] = { - { { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SW_SE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SE_NE_PART_1 } }, - { { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1 } } + { + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SW_SE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_SE_NE_PART_1 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SW_SE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP_CHAIN_SE_NE_PART_1 }, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_down[2][4][2] = { - { { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SE_NE_PART_1 } }, - { { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SW_SE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SW_SE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NW_SW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NE_NW_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SE_NE_PART_1 } } + { + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SW_SE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_SE_NE_PART_1 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SW_SE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SW_SE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NW_SW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NE_NW_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_CHAIN_SE_NE_PART_1 }, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_up_small_quarter_tiles[4][3][2] = { @@ -1049,17 +1148,23 @@ static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_u { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SW_SE_PART_1 }, { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SW_SE_PART_2 }, }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_2, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_2_2 } }, - { { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_1 }, - { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_2 } }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_0_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_2 } } + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_2, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NW_SW_PART_2_2 }, + }, + { + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_1 }, + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_NE_NW_PART_2 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_0_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_SMALL_SE_NE_PART_2 }, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_down_small_quarter_tiles[4][3][2] = { @@ -1068,17 +1173,23 @@ static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_d { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SW_SE_PART_1 }, { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SW_SE_PART_2 }, }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_2, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_2_2 } }, - { { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_1 }, - { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_2 } }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_0_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_2 } } + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_2, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NW_SW_PART_2_2 }, + }, + { + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_1 }, + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_NE_NW_PART_2 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_0_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL_SE_NE_PART_2 }, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_up_large_quarter_tiles[4][5][2] = { @@ -1089,23 +1200,29 @@ static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_u { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SW_SE_PART_3 }, { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SW_SE_PART_4 }, }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_3 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_4, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_4_2 } }, - { { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_3 }, - { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_4 } }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_0_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_3 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_4 } } + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_3 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_4, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NW_SW_PART_4_2 }, + }, + { + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_3 }, + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_NE_NW_PART_4 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_0_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_3 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_UP_LARGE_SE_NE_PART_4 }, + }, }; static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_down_large_quarter_tiles[4][5][2] = { @@ -1116,27 +1233,37 @@ static constexpr const uint32_t junior_rc_track_pieces_right_half_banked_helix_d { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SW_SE_PART_3 }, { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SW_SE_PART_4 }, }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_3 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_4, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_4_2 } }, - { { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_0 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_3 }, - { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_4 } }, - { { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_0, - SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_0_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_1 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_2 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_3 }, - { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_4 } } + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_3 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_4, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NW_SW_PART_4_2 }, + }, + { + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_0 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_3 }, + { 0, SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_NE_NW_PART_4 }, + }, + { + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_0, + SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_0_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_1 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_2 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_3 }, + { SPR_JUNIOR_RC_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE_SE_NE_PART_4 }, + }, }; -static constexpr const uint32_t junior_rc_track_pieces_brake[4] = { SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, - SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED }; +static constexpr const uint32_t junior_rc_track_pieces_brake[4] = { + SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, + SPR_JUNIOR_RC_FLAT_SW_NE_BRAKED, + SPR_JUNIOR_RC_FLAT_NW_SE_BRAKED, +}; static constexpr const uint32_t junior_rc_track_pieces_left_eight_to_diag[4][4] = { { @@ -1247,52 +1374,117 @@ static constexpr const uint32_t junior_rc_track_pieces_right_eight_to_diag_bank[ }; static constexpr const uint32_t junior_rc_track_pieces_diag_flat[3][4] = { - { SPR_JUNIOR_RC_DIAG_FLAT_W_E, SPR_JUNIOR_RC_DIAG_FLAT_N_S, SPR_JUNIOR_RC_DIAG_FLAT_E_W, SPR_JUNIOR_RC_DIAG_FLAT_S_N }, - { SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_N_S, SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_E_W, - SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_S_N }, - { SPR_WATER_RC_DIAG_FLAT_CHAIN_W_E, SPR_WATER_RC_DIAG_FLAT_CHAIN_N_S, SPR_WATER_RC_DIAG_FLAT_CHAIN_E_W, - SPR_WATER_RC_DIAG_FLAT_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_FLAT_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_CHAIN_S_N, + }, + { + SPR_WATER_RC_DIAG_FLAT_CHAIN_W_E, + SPR_WATER_RC_DIAG_FLAT_CHAIN_N_S, + SPR_WATER_RC_DIAG_FLAT_CHAIN_E_W, + SPR_WATER_RC_DIAG_FLAT_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_25_deg_up[3][4] = { - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_N_S, SPR_JUNIOR_RC_DIAG_25_DEG_UP_E_W, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_N_S, SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_E_W, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_S_N }, - { SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_W_E, SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_N_S, SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_E_W, - SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_CHAIN_S_N, + }, + { + SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_W_E, + SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_N_S, + SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_E_W, + SPR_WATER_RC_DIAG_25_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_flat_to_25_deg_up[3][4] = { - { SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_N_S, - SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_E_W, SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_S_N }, - { SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_W_E, SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_N_S, - SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_E_W, SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_S_N, + }, + { + SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_W_E, + SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_N_S, + SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_E_W, + SPR_WATER_RC_DIAG_FLAT_TO_25_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_flat_to_60_deg_up[2][4] = { - { SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_N_S, - SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_E_W, SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_FLAT_TO_60_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_25_deg_up_to_flat[3][4] = { - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_N_S, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_E_W, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_S_N }, - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_S_N }, - { SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_W_E, SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_N_S, - SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_E_W, SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_S_N, + }, + { + SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_W_E, + SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_N_S, + SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_E_W, + SPR_WATER_RC_DIAG_25_DEG_UP_TO_FLAT_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_up_to_flat[2][4] = { - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_N_S, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_E_W, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_S_N }, - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_FLAT_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_25_deg_down[3][4] = { @@ -1517,9 +1709,18 @@ static constexpr const uint32_t junior_rc_track_pieces_60_deg_up_to_flat[2][4][2 }; static constexpr const uint32_t junior_rc_track_pieces_60_deg_up[2][4] = { - { SPR_JUNIOR_RC_60_DEG_SW_NE, SPR_JUNIOR_RC_60_DEG_NW_SE, SPR_JUNIOR_RC_60_DEG_NE_SW, SPR_JUNIOR_RC_60_DEG_SE_NW }, - { SPR_JUNIOR_RC_60_DEG_CHAIN_SW_NE, SPR_JUNIOR_RC_60_DEG_CHAIN_NW_SE, SPR_JUNIOR_RC_60_DEG_CHAIN_NE_SW, - SPR_JUNIOR_RC_60_DEG_CHAIN_SE_NW }, + { + SPR_JUNIOR_RC_60_DEG_SW_NE, + SPR_JUNIOR_RC_60_DEG_NW_SE, + SPR_JUNIOR_RC_60_DEG_NE_SW, + SPR_JUNIOR_RC_60_DEG_SE_NW, + }, + { + SPR_JUNIOR_RC_60_DEG_CHAIN_SW_NE, + SPR_JUNIOR_RC_60_DEG_CHAIN_NW_SE, + SPR_JUNIOR_RC_60_DEG_CHAIN_NE_SW, + SPR_JUNIOR_RC_60_DEG_CHAIN_SE_NW, + }, }; static constexpr const uint32_t junior_rc_track_pieces_25_deg_up_to_60_deg_up[2][4][2] = { @@ -1553,10 +1754,18 @@ static constexpr const uint32_t junior_rc_track_pieces_60_deg_up_to_25_deg_up[2] }; static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_up[2][4] = { - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_N_S, SPR_JUNIOR_RC_DIAG_60_DEG_UP_E_W, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_N_S, SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_E_W, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down[2][4] = { @@ -1575,17 +1784,33 @@ static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down[2][4] = }; static constexpr const uint32_t junior_rc_track_pieces_diag_25_deg_up_to_60_deg_up[2][4] = { - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_N_S, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_E_W, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_up_to_25_deg_up[2][4] = { - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_N_S, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_E_W, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_S_N }, - { SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_W_E, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_N_S, - SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_E_W, SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_S_N }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_S_N, + }, + { + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_W_E, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_N_S, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_E_W, + SPR_JUNIOR_RC_DIAG_60_DEG_UP_TO_25_DEG_UP_CHAIN_S_N, + }, }; static constexpr const uint32_t junior_rc_track_pieces_diag_25_deg_down_to_60_deg_down[2][4] = { @@ -1617,7 +1842,6 @@ static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down_to_25_de SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_60_DEG_UP_CHAIN_N_S, }, }; -// clang-format on void junior_rc_paint_track_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, @@ -1873,7 +2097,9 @@ static void junior_rc_right_quarter_turn_5_tiles_paint_setup( paint_util_set_general_support_height(session, height + 32, 0x20); } -static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; +static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { + 6, 4, 5, 3, 1, 2, 0, +}; /* rct2: 0x0051917A */ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( @@ -3036,7 +3262,10 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); } - uint8_t supportType[2][4] = { { 1, 0, 0, 2 }, { 2, 0, 0, 1 } }; + uint8_t supportType[2][4] = { + { 1, 0, 0, 2 }, + { 2, 0, 0, 1 }, + }; switch (trackSequence) { case 0: @@ -3115,7 +3344,10 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); } - uint8_t supportType[2][4] = { { 1, 0, 0, 2 }, { 2, 0, 0, 1 } }; + uint8_t supportType[2][4] = { + { 1, 0, 0, 2 }, + { 2, 0, 0, 1 }, + }; switch (trackSequence) { case 0: @@ -3258,7 +3490,12 @@ static void junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( isChained ? JuniorRcChainType::FrictionWheels : JuniorRcChainType::None); } -static constexpr const uint8_t junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t junior_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { + 3, + 1, + 2, + 0, +}; /** rct2: 0x008AAEC0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_up_paint_setup( @@ -4188,12 +4425,19 @@ static void junior_rc_right_eighth_to_orthogonal_bank_paint_setup( junior_rc_left_eighth_to_diag_bank_paint_setup(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } -static constexpr const int32_t junior_rc_diag_blocked_segments[] = { 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 }; +static constexpr const int32_t junior_rc_diag_blocked_segments[] = { + 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, +}; -static constexpr const uint8_t junior_rc_diag_support_segment[] = { 1, 0, 2, 3 }; +static constexpr const uint8_t junior_rc_diag_support_segment[] = { + 1, + 0, + 2, + 3, +}; void junior_rc_paint_track_diag_flat( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, uint16_t height, @@ -4951,7 +5195,12 @@ static constexpr const CoordsXY junior_rc_60_deg_up_tile_offsets[4] = { { 6, 0 }, }; -static constexpr const int8_t junior_rc_60_deg_up_bound_thickness[4] = { 1, 75, 75, 1 }; +static constexpr const int8_t junior_rc_60_deg_up_bound_thickness[4] = { + 1, + 75, + 75, + 1, +}; static constexpr const CoordsXY junior_rc_60_deg_up_bound_lengths[4] = { { 32, 20 }, @@ -5026,7 +5275,12 @@ static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4 { { 20, 32 }, { 0, 0 } }, }; -static constexpr const int8_t junior_rc_25_deg_up_to_60_deg_up_bound_thickness[4] = { 1, 43, 43, 1 }; +static constexpr const int8_t junior_rc_25_deg_up_to_60_deg_up_bound_thickness[4] = { + 1, + 43, + 43, + 1, +}; static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4][2] = { { { 0, 6 }, { 0, 0 } }, @@ -5394,7 +5648,12 @@ static constexpr const CoordsXY junior_rc_flat_to_60_deg_up_bound_lengths[4][2] { { 24, 32 }, { 0, 0 } }, }; -static constexpr const int8_t junior_rc_flat_to_60_deg_up_bound_thickness[4] = { 1, 43, 43, 1 }; +static constexpr const int8_t junior_rc_flat_to_60_deg_up_bound_thickness[4] = { + 1, + 43, + 43, + 1, +}; static constexpr const CoordsXY junior_rc_flat_to_60_deg_up_bound_offsets[4][2] = { { { 0, 4 }, { 0, 0 } }, diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index ce07e71615..3130ddce7b 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -130,14 +130,26 @@ static constexpr const uint32_t virginia_reel_track_pieces_25_deg_up_lift_hill[4 }; static constexpr const uint32_t virginia_reel_track_pieces_flat_quarter_turn_3_tiles[4][3] = { - { SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_VIRGINIA_REEL_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t virginia_reel_track_pieces_flat_quarter_turn_1_tile[4] = { @@ -447,7 +459,12 @@ static void paint_virginia_reel_station( paint_util_set_general_support_height(session, height + 32, 0x20); } -static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { 5, 2, 3, 4 }; +static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { + 5, + 2, + 3, + 4, +}; /** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( @@ -477,7 +494,12 @@ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( paint_util_set_general_support_height(session, height + 32, 0x20); } -static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_turn_map[] = { + 3, + 1, + 2, + 0, +}; /** rct2: 0x00811314 */ static void paint_virginia_reel_track_right_quarter_turn_3_tiles( diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index f93c77ea05..8911e33f2e 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -531,7 +531,7 @@ static void wild_mouse_track_right_quarter_turn_3( { SPR_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_0, { 0, 0, 0 }, { 6, 0, 0 }, { 20, 32, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_1, { 0, 0, 0 }, { 0, 16, 0 }, { 16, 16, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 3 } }, - } + }, }; track_paint_util_right_quarter_turn_3_tiles_paint_3( @@ -583,7 +583,7 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( { { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_DOWN_SE_NE_PART_0, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_DOWN_SE_NE_PART_1, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 3 } }, - } + }, }; static constexpr const int16_t generalSupportHeights[] = { 72, 56, 56, 72 }; @@ -651,7 +651,7 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( { { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_UP_SE_NE_PART_0, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_UP_SE_NE_PART_1, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 3 } }, - } + }, }; static constexpr const int16_t generalSupportHeights[] = { 72, 56, 56, 72 }; diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 2d4ccea959..f1fd868339 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -504,21 +504,57 @@ static void wooden_rc_track_25_deg_up( { static constexpr const uint32_t imageIds[2][4][4] = { { - { SPR_WOODEN_RC_25_DEG_SW_NE, SPR_WOODEN_RC_25_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_NW_SE, SPR_WOODEN_RC_25_DEG_RAILS_NW_SE, SPR_WOODEN_RC_25_DEG_FRONT_NW_SE, - SPR_WOODEN_RC_25_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_NE_SW, SPR_WOODEN_RC_25_DEG_RAILS_NE_SW, SPR_WOODEN_RC_25_DEG_FRONT_NE_SW, - SPR_WOODEN_RC_25_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_SE_NW, SPR_WOODEN_RC_25_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_25_DEG_SW_NE, + SPR_WOODEN_RC_25_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_NW_SE, + SPR_WOODEN_RC_25_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_NE_SW, + SPR_WOODEN_RC_25_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_SE_NW, + SPR_WOODEN_RC_25_DEG_RAILS_SE_NW, + 0, + 0, + }, }, { - { SPR_WOODEN_RC_25_DEG_CHAIN_SW_NE, SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_CHAIN_NW_SE, SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_NW_SE, SPR_WOODEN_RC_25_DEG_CHAIN_FRONT_NW_SE, - SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_CHAIN_NE_SW, SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_NE_SW, SPR_WOODEN_RC_25_DEG_CHAIN_FRONT_NE_SW, - SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_CHAIN_SE_NW, SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_SE_NW, 0, 0 }, - } + { + SPR_WOODEN_RC_25_DEG_CHAIN_SW_NE, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_CHAIN_NW_SE, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_CHAIN_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_CHAIN_NE_SW, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_CHAIN_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_CHAIN_SE_NW, + SPR_WOODEN_RC_25_DEG_CHAIN_RAILS_SE_NW, + 0, + 0, + }, + }, }; uint8_t isChained = trackElement.HasChain() ? 1 : 0; @@ -590,21 +626,57 @@ static void wooden_rc_track_flat_to_25_deg_up( { static constexpr const uint32_t imageIds[2][4][4] = { { - { SPR_WOODEN_RC_FLAT_TO_25_DEG_SW_NE, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_NW_SE, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_NW_SE, - SPR_WOODEN_RC_FLAT_TO_25_DEG_FRONT_NW_SE, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_NE_SW, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_NE_SW, - SPR_WOODEN_RC_FLAT_TO_25_DEG_FRONT_NE_SW, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_SE_NW, SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_SW_NE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_SE_NW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_RAILS_SE_NW, + 0, + 0, + }, }, { - { SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_SW_NE, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_NW_SE, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_NW_SE, - SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_FRONT_NW_SE, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_NE_SW, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_NE_SW, - SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_FRONT_NE_SW, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_SE_NW, SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_SE_NW, 0, 0 }, - } + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_SW_NE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_FRONT_NW_SE, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_FRONT_NE_SW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_SE_NW, + SPR_WOODEN_RC_FLAT_TO_25_DEG_CHAIN_RAILS_SE_NW, + 0, + 0, + }, + }, }; uint8_t isChained = trackElement.HasChain() ? 1 : 0; @@ -638,12 +710,30 @@ static void wooden_rc_track_25_deg_up_to_60_deg_up( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_25_DEG_TO_60_DEG_SW_NE, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_TO_60_DEG_NW_SE, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_NW_SE, - SPR_WOODEN_RC_25_DEG_TO_60_DEG_FRONT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_TO_60_DEG_NE_SW, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_NE_SW, - SPR_WOODEN_RC_25_DEG_TO_60_DEG_FRONT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_TO_60_DEG_SE_NW, SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_25_DEG_TO_60_DEG_SW_NE, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_TO_60_DEG_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_TO_60_DEG_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_TO_60_DEG_SE_NW, + SPR_WOODEN_RC_25_DEG_TO_60_DEG_RAILS_SE_NW, + 0, + 0, + }, }; if (direction == 0 || direction == 3) @@ -679,12 +769,30 @@ static void wooden_rc_track_60_deg_up_to_25_deg_up( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_60_DEG_TO_25_DEG_SW_NE, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_60_DEG_TO_25_DEG_NW_SE, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_NW_SE, - SPR_WOODEN_RC_60_DEG_TO_25_DEG_FRONT_NW_SE, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_60_DEG_TO_25_DEG_NE_SW, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_NE_SW, - SPR_WOODEN_RC_60_DEG_TO_25_DEG_FRONT_NE_SW, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_60_DEG_TO_25_DEG_SE_NW, SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_60_DEG_TO_25_DEG_SW_NE, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_60_DEG_TO_25_DEG_NW_SE, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_60_DEG_TO_25_DEG_NE_SW, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_60_DEG_TO_25_DEG_SE_NW, + SPR_WOODEN_RC_60_DEG_TO_25_DEG_RAILS_SE_NW, + 0, + 0, + }, }; if (direction == 0 || direction == 3) @@ -721,21 +829,57 @@ static void wooden_rc_track_25_deg_up_to_flat( { static constexpr const uint32_t imageIds[2][4][4] = { { - { SPR_WOODEN_RC_25_DEG_TO_FLAT_SW_NE, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_NW_SE, - SPR_WOODEN_RC_25_DEG_TO_FLAT_FRONT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_NE_SW, - SPR_WOODEN_RC_25_DEG_TO_FLAT_FRONT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_SE_NW, SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_SW_NE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_SE_NW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_RAILS_SE_NW, + 0, + 0, + }, }, { - { SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_SW_NE, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_NW_SE, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_NW_SE, - SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_FRONT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_NE_SW, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_NE_SW, - SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_FRONT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_SE_NW, SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_SE_NW, 0, 0 }, - } + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_SW_NE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_SE_NW, + SPR_WOODEN_RC_25_DEG_TO_FLAT_CHAIN_RAILS_SE_NW, + 0, + 0, + }, + }, }; uint8_t isChained = trackElement.HasChain() ? 1 : 0; @@ -816,198 +960,334 @@ static void wooden_rc_track_right_quarter_turn_5( const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { - { { - { SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_0, - { 0, 2, 0 }, - { 0, 2, 0 }, - { 32, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_2, - { 0, 16, 0 }, - { 0, 16, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_3, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_5, - { 16, 0, 0 }, - { 16, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_6, - { 2, 0, 0 }, - { 2, 0, 0 }, - { 32, 32, 2 } }, - }, - { - { SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_0, - { 2, 0, 0 }, - { 2, 0, 0 }, - { 32, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_2, - { 16, 0, 0 }, - { 16, 0, 0 }, - { 16, 34, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_3, - { 0, 16, 0 }, - { 0, 16, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_6, - { 0, 2, 0 }, - { 0, 2, 0 }, - { 32, 27, 2 } }, - }, - { - { SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_0, - { 0, 2, 0 }, - { 0, 2, 0 }, - { 32, 27, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_3, - { 16, 16, 0 }, - { 16, 16, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_6, - { 2, 0, 0 }, - { 2, 0, 0 }, - { 27, 32, 2 } }, - }, - { - { SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_0, - { 2, 0, 0 }, - { 2, 0, 0 }, - { 27, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_3, - { 16, 0, 0 }, - { 16, 0, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_5, - { 0, 16, 0 }, - { 0, 16, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_6, - { 0, 2, 0 }, - { 0, 2, 0 }, - { 32, 32, 2 } }, - } }, - { { - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_0, - { 0, 2, 0 }, - { 0, 2, 27 }, - { 32, 32, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_2, - { 0, 16, 0 }, - { 0, 16, 27 }, - { 32, 16, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_3, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 16, 16, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_5, - { 16, 0, 0 }, - { 16, 0, 27 }, - { 16, 32, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_6, - { 2, 0, 0 }, - { 2, 0, 27 }, - { 32, 32, 0 } }, - }, - { - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - }, - { - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_0, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_0, - { 0, 2, 0 }, - { 0, 2, 27 }, - { 32, 27, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_2, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 32, 16, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_3, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_3, - { 16, 16, 0 }, - { 16, 16, 27 }, - { 16, 16, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_5, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 16, 32, 0 } }, - { SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_6, - SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_6, - { 2, 0, 0 }, - { 2, 0, 27 }, - { 27, 32, 0 } }, - }, - { - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - } }, + { + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_0, + { 0, 2, 0 }, + { 0, 2, 0 }, + { 32, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_2, + { 0, 16, 0 }, + { 0, 16, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_3, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_5, + { 16, 0, 0 }, + { 16, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SW_SE_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SW_SE_SEQ_6, + { 2, 0, 0 }, + { 2, 0, 0 }, + { 32, 32, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_0, + { 2, 0, 0 }, + { 2, 0, 0 }, + { 32, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_2, + { 16, 0, 0 }, + { 16, 0, 0 }, + { 16, 34, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_3, + { 0, 16, 0 }, + { 0, 16, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NW_SW_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NW_SW_SEQ_6, + { 0, 2, 0 }, + { 0, 2, 0 }, + { 32, 27, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_0, + { 0, 2, 0 }, + { 0, 2, 0 }, + { 32, 27, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_3, + { 16, 16, 0 }, + { 16, 16, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_NE_NW_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_NE_NW_SEQ_6, + { 2, 0, 0 }, + { 2, 0, 0 }, + { 27, 32, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_0, + { 2, 0, 0 }, + { 2, 0, 0 }, + { 27, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_3, + { 16, 0, 0 }, + { 16, 0, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_5, + { 0, 16, 0 }, + { 0, 16, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_SE_NE_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_SE_NE_SEQ_6, + { 0, 2, 0 }, + { 0, 2, 0 }, + { 32, 32, 2 }, + }, + }, + }, + { + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_0, + { 0, 2, 0 }, + { 0, 2, 27 }, + { 32, 32, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_2, + { 0, 16, 0 }, + { 0, 16, 27 }, + { 32, 16, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_3, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 16, 16, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_5, + { 16, 0, 0 }, + { 16, 0, 27 }, + { 16, 32, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_SW_SE_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_6, + { 2, 0, 0 }, + { 2, 0, 27 }, + { 32, 32, 0 }, + }, + }, + { + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + }, + { + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_0, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_0, + { 0, 2, 0 }, + { 0, 2, 27 }, + { 32, 27, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_2, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 32, 16, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_3, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_3, + { 16, 16, 0 }, + { 16, 16, 27 }, + { 16, 16, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_5, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 16, 32, 0 }, + }, + { + SPR_WOODEN_RC_QUARTER_TURN_5_FRONT_NE_NW_SEQ_6, + SPR_WOODEN_RC_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_6, + { 2, 0, 0 }, + { 2, 0, 27 }, + { 27, 32, 0 }, + }, + }, + { + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + }, + }, }; static int8_t supportType[4][7] = { { 0, -1, 4, 2, -1, 4, 1 }, @@ -1071,12 +1351,30 @@ static void wooden_rc_track_flat_to_left_bank( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_SW_NE, SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_NW_SE, SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_NW_SE, - SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_FRONT_NW_SE, SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_NE_SW, SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_NE_SW, 0, 0 }, - { SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_SE_NW, SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_SE_NW, - SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_FRONT_SE_NW, SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_RAILS_FRONT_SE_NW }, + { + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_SW_NE, + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_NW_SE, + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_NW_SE, + SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_FRONT_NW_SE, + SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_NE_SW, + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_NE_SW, + 0, + 0, + }, + { + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_SE_NW, + SPR_WOODEN_RC_FLAT_TO_LEFT_BANK_RAILS_SE_NW, + SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_FRONT_SE_NW, + SPR_WOODEN_RC_RC_FLAT_TO_LEFT_BANK_RAILS_FRONT_SE_NW, + }, }; wooden_rc_track_paint( @@ -1098,12 +1396,30 @@ static void wooden_rc_track_flat_to_right_bank( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_SW_NE, SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_SW_NE, - SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_FRONT_SW_NE, SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_RAILS_FRONT_SW_NE }, - { SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_NW_SE, SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_NW_SE, 0, 0 }, - { SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_NE_SW, SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_NE_SW, - SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_FRONT_NE_SW, SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_SE_NW, SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_SW_NE, + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_SW_NE, + SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_FRONT_SW_NE, + SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_RAILS_FRONT_SW_NE, + }, + { + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_NW_SE, + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_NW_SE, + 0, + 0, + }, + { + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_NE_SW, + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_NE_SW, + SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_FRONT_NE_SW, + SPR_WOODEN_RC_RC_FLAT_TO_RIGHT_BANK_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_SE_NW, + SPR_WOODEN_RC_FLAT_TO_RIGHT_BANK_RAILS_SE_NW, + 0, + 0, + }, }; wooden_rc_track_paint( @@ -1140,198 +1456,334 @@ static void wooden_rc_track_banked_right_quarter_turn_5( const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[2][4][7] = { - { { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_0, - { 0, 0, 0 }, - { 0, 2, 0 }, - { 32, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_2, - { 0, 0, 0 }, - { 0, 16, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_3, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_5, - { 0, 0, 0 }, - { 16, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_6, - { 0, 0, 0 }, - { 2, 0, 0 }, - { 32, 32, 2 } }, - }, - { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_0, - { 0, 0, 0 }, - { 2, 0, 0 }, - { 32, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_2, - { 0, 0, 0 }, - { 16, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_3, - { 0, 0, 0 }, - { 0, 16, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_6, - { 0, 0, 0 }, - { 0, 2, 0 }, - { 32, 27, 2 } }, - }, - { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_0, - { 0, 0, 0 }, - { 0, 2, 0 }, - { 32, 27, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_3, - { 0, 0, 0 }, - { 16, 16, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_6, - { 0, 0, 0 }, - { 2, 0, 0 }, - { 27, 32, 2 } }, - }, - { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_0, - { 0, 0, 0 }, - { 2, 0, 0 }, - { 27, 32, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 0 }, - { 16, 32, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_3, - { 0, 0, 0 }, - { 16, 0, 0 }, - { 16, 16, 2 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_5, - { 0, 0, 0 }, - { 0, 16, 0 }, - { 32, 16, 2 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_6, - { 0, 0, 0 }, - { 0, 2, 0 }, - { 32, 32, 2 } }, - } }, - { { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_0, - { 0, 0, 0 }, - { 0, 2, 27 }, - { 32, 32, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_2, - { 0, 0, 0 }, - { 0, 16, 27 }, - { 32, 16, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_3, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 16, 16, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_5, - { 0, 0, 0 }, - { 16, 0, 27 }, - { 16, 32, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_6, - { 0, 0, 0 }, - { 2, 0, 27 }, - { 32, 32, 0 } }, - }, - { - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - }, - { - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_0, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_0, - { 0, 0, 0 }, - { 0, 2, 27 }, - { 32, 27, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_2, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_2, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 32, 16, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_3, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_3, - { 0, 0, 0 }, - { 16, 16, 27 }, - { 16, 16, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_5, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_5, - { 0, 0, 0 }, - { 0, 0, 27 }, - { 16, 32, 0 } }, - { SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_6, - SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_6, - { 0, 0, 0 }, - { 2, 0, 27 }, - { 27, 32, 0 } }, - }, - { - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, - } }, + { + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_0, + { 0, 0, 0 }, + { 0, 2, 0 }, + { 32, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_2, + { 0, 0, 0 }, + { 0, 16, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_3, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_5, + { 0, 0, 0 }, + { 16, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SW_SE_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SW_SE_SEQ_6, + { 0, 0, 0 }, + { 2, 0, 0 }, + { 32, 32, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_0, + { 0, 0, 0 }, + { 2, 0, 0 }, + { 32, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_2, + { 0, 0, 0 }, + { 16, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_3, + { 0, 0, 0 }, + { 0, 16, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NW_SW_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NW_SW_SEQ_6, + { 0, 0, 0 }, + { 0, 2, 0 }, + { 32, 27, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_0, + { 0, 0, 0 }, + { 0, 2, 0 }, + { 32, 27, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_3, + { 0, 0, 0 }, + { 16, 16, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_NE_NW_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_NE_NW_SEQ_6, + { 0, 0, 0 }, + { 2, 0, 0 }, + { 27, 32, 2 }, + }, + }, + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_0, + { 0, 0, 0 }, + { 2, 0, 0 }, + { 27, 32, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 16, 32, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_3, + { 0, 0, 0 }, + { 16, 0, 0 }, + { 16, 16, 2 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_5, + { 0, 0, 0 }, + { 0, 16, 0 }, + { 32, 16, 2 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_SE_NE_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_SE_NE_SEQ_6, + { 0, 0, 0 }, + { 0, 2, 0 }, + { 32, 32, 2 }, + }, + }, + }, + { + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_0, + { 0, 0, 0 }, + { 0, 2, 27 }, + { 32, 32, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_2, + { 0, 0, 0 }, + { 0, 16, 27 }, + { 32, 16, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_3, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 16, 16, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_5, + { 0, 0, 0 }, + { 16, 0, 27 }, + { 16, 32, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_SW_SE_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_SW_SE_SEQ_6, + { 0, 0, 0 }, + { 2, 0, 27 }, + { 32, 32, 0 }, + }, + }, + { + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + }, + { + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_0, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_0, + { 0, 0, 0 }, + { 0, 2, 27 }, + { 32, 27, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_2, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_2, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 32, 16, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_3, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_3, + { 0, 0, 0 }, + { 16, 16, 27 }, + { 16, 16, 0 }, + }, + { + 0, + 0, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_5, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_5, + { 0, 0, 0 }, + { 0, 0, 27 }, + { 16, 32, 0 }, + }, + { + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_FRONT_NE_NW_SEQ_6, + SPR_WOODEN_RC_BANKED_QUARTER_TURN_5_RAILS_FRONT_NE_NW_SEQ_6, + { 0, 0, 0 }, + { 2, 0, 27 }, + { 27, 32, 0 }, + }, + }, + { + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + }, + }, }; static int8_t supportType[4][7] = { { 0, -1, 4, 2, -1, 4, 1 }, @@ -1395,12 +1847,30 @@ static void wooden_rc_track_left_bank_to_25_deg_up( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_SW_NE, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_NW_SE, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_NW_SE, - SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_FRONT_NW_SE, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_NE_SW, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_NE_SW, - SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_FRONT_NE_SW, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_SE_NW, SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_SW_NE, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_NW_SE, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_NE_SW, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_SE_NW, + SPR_WOODEN_RC_LEFT_BANK_TO_25_DEG_RAILS_SE_NW, + 0, + 0, + }, }; wooden_rc_track_paint( @@ -1429,12 +1899,30 @@ static void wooden_rc_track_right_bank_to_25_deg_up( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_SW_NE, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_NW_SE, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_NW_SE, - SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_FRONT_NW_SE, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_NE_SW, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_NE_SW, - SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_FRONT_NE_SW, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_SE_NW, SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_SW_NE, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_NW_SE, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_NW_SE, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_FRONT_NW_SE, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_NE_SW, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_NE_SW, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_FRONT_NE_SW, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_SE_NW, + SPR_WOODEN_RC_RIGHT_BANK_TO_25_DEG_RAILS_SE_NW, + 0, + 0, + }, }; wooden_rc_track_paint( @@ -1463,12 +1951,30 @@ static void wooden_rc_track_25_deg_up_to_left_bank( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_SW_NE, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_NW_SE, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_NW_SE, - SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_FRONT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_NE_SW, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_NE_SW, - SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_FRONT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_SE_NW, SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_SW_NE, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_SE_NW, + SPR_WOODEN_RC_25_DEG_TO_LEFT_BANK_RAILS_SE_NW, + 0, + 0, + }, }; wooden_rc_track_paint( @@ -1497,12 +2003,30 @@ static void wooden_rc_track_25_deg_up_to_right_bank( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { - { SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_SW_NE, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_SW_NE, 0, 0 }, - { SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_NW_SE, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_NW_SE, - SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_FRONT_NW_SE, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_FRONT_NW_SE }, - { SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_NE_SW, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_NE_SW, - SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_FRONT_NE_SW, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_FRONT_NE_SW }, - { SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_SE_NW, SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_SE_NW, 0, 0 }, + { + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_SW_NE, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_SW_NE, + 0, + 0, + }, + { + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_FRONT_NW_SE, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_FRONT_NW_SE, + }, + { + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_FRONT_NE_SW, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_FRONT_NE_SW, + }, + { + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_SE_NW, + SPR_WOODEN_RC_25_DEG_TO_RIGHT_BANK_RAILS_SE_NW, + 0, + 0, + }, }; wooden_rc_track_paint( diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index a0b05eb7f6..c40daa3dca 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -506,7 +506,7 @@ static void wooden_wild_mouse_track_right_quarter_turn_3( { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_0, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_1, { 0, 16, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_2, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, - } + }, }; static uint8_t supportType[] = { 4, 5, 2, 3 }; diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 548a76ecd6..2f812e94fb 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -133,14 +133,26 @@ static constexpr const uint32_t car_ride_track_pieces_left_quarter_turn_1_tile[4 }; static constexpr const uint32_t car_ride_track_pieces_quarter_turn_3_tiles[4][3] = { - { SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; /** rct2: 0x006F72C8 */ diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index cb021b1f91..19e14172e3 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -20,11 +20,29 @@ struct rct_crooked_house_bound_box CoordsXY length; }; -static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { { { 6, 0 }, { 42, 24 } }, - { { 0, 0 }, { 0, 0 } }, - { { -16, -16 }, { 32, 32 } }, - { { 0, 0 }, { 0, 0 } }, // Unused - { { 0, 6 }, { 24, 42 } } }; +static constexpr const rct_crooked_house_bound_box crooked_house_data[] = { + { + { 6, 0 }, + { 42, 24 }, + }, + { + { 0, 0 }, + { 0, 0 }, + }, + { + { -16, -16 }, + { 32, 32 }, + }, + { + // Unused + { 0, 0 }, + { 0, 0 }, + }, + { + { 0, 6 }, + { 24, 42 }, + }, +}; /** * rct2: 0x0088ABA4 diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index fc2a81f38b..5bc9302976 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -26,8 +26,12 @@ enum SPR_DODGEMS_FENCE_TOP_LEFT = 21937 }; -static constexpr const uint32_t dodgems_fence_sprites[] = { SPR_DODGEMS_FENCE_TOP_RIGHT, SPR_DODGEMS_FENCE_BOTTOM_RIGHT, - SPR_DODGEMS_FENCE_BOTTOM_LEFT, SPR_DODGEMS_FENCE_TOP_LEFT }; +static constexpr const uint32_t dodgems_fence_sprites[] = { + SPR_DODGEMS_FENCE_TOP_RIGHT, + SPR_DODGEMS_FENCE_BOTTOM_RIGHT, + SPR_DODGEMS_FENCE_BOTTOM_LEFT, + SPR_DODGEMS_FENCE_TOP_LEFT, +}; static void paint_dodgems_roof(paint_session* session, int32_t height, int32_t offset) { diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 3e40b4847b..4fbfee40a8 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -103,14 +103,26 @@ static constexpr const uint32_t ghost_train_track_pieces_quarter_turn_1_tile[4] }; static constexpr const uint32_t ghost_train_track_pieces_quarter_turn_3_tiles[4][3] = { - { SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_GHOST_TRAIN_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t ghost_train_track_pieces_spinning_tunnel_track[4] = { diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 226faf31ab..545b5fb0af 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -16,10 +16,14 @@ #include "../Vehicle.h" /** rct2: 0x0142805C */ -static constexpr const uint32_t merry_go_round_rider_offsets[] = { 0, 32, 64, 96, 16, 48, 80, 112 }; +static constexpr const uint32_t merry_go_round_rider_offsets[] = { + 0, 32, 64, 96, 16, 48, 80, 112, +}; /** rct2: 0x0142807C */ -static constexpr const uint16_t merry_go_round_breakdown_vibration[] = { 0, 1, 2, 3, 4, 3, 2, 1, 0, 0 }; +static constexpr const uint16_t merry_go_round_breakdown_vibration[] = { + 0, 1, 2, 3, 4, 3, 2, 1, 0, 0, +}; /** * rct2: 0x0076287D diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index f98551127d..2643fab46a 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -264,7 +264,12 @@ static void paint_mini_helicopters_track_left_quarter_turn_3_tiles( paint_util_set_general_support_height(session, height + 32, 0x20); } -static constexpr const uint8_t mini_helicopters_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t mini_helicopters_right_quarter_turn_3_tiles_to_left_turn_map[] = { + 3, + 1, + 2, + 0, +}; /** rct2: 0x0081F3F8 */ static void paint_mini_helicopters_track_right_quarter_turn_3_tiles( diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 5183ec0f20..d51f027c8b 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -70,8 +70,10 @@ enum SPR_MONORAIL_CYCLES_S_BEND_RIGHT_NW_SE_PART_3 = 16869, }; -static constexpr const uint32_t monorail_cycles_track_pieces_flat[4] = { SPR_MONORAIL_CYCLES_FLAT_SW_NE, - SPR_MONORAIL_CYCLES_FLAT_NW_SE }; +static constexpr const uint32_t monorail_cycles_track_pieces_flat[4] = { + SPR_MONORAIL_CYCLES_FLAT_SW_NE, + SPR_MONORAIL_CYCLES_FLAT_NW_SE, +}; static constexpr const uint32_t monorail_cycles_track_pieces_flat_quarter_turn_5_tiles[4][5] = { { @@ -101,7 +103,7 @@ static constexpr const uint32_t monorail_cycles_track_pieces_flat_quarter_turn_5 SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_2, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_3, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_5_TILES_SE_NE_PART_4, - } + }, }; static constexpr const uint32_t monorail_cycles_track_pieces_s_bend_left[2][4] = { @@ -116,7 +118,7 @@ static constexpr const uint32_t monorail_cycles_track_pieces_s_bend_left[2][4] = SPR_MONORAIL_CYCLES_S_BEND_LEFT_NW_SE_PART_1, SPR_MONORAIL_CYCLES_S_BEND_LEFT_NW_SE_PART_2, SPR_MONORAIL_CYCLES_S_BEND_LEFT_NW_SE_PART_3, - } + }, }; static constexpr const uint32_t monorail_cycles_track_pieces_s_bend_right[2][4] = { @@ -131,18 +133,30 @@ static constexpr const uint32_t monorail_cycles_track_pieces_s_bend_right[2][4] SPR_MONORAIL_CYCLES_S_BEND_RIGHT_NW_SE_PART_1, SPR_MONORAIL_CYCLES_S_BEND_RIGHT_NW_SE_PART_2, SPR_MONORAIL_CYCLES_S_BEND_RIGHT_NW_SE_PART_3, - } + }, }; static constexpr const uint32_t monorail_cycles_track_pieces_flat_quarter_turn_3_tiles[4][3] = { - { SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_MONORAIL_CYCLES_FLAT_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static paint_struct* paint_monorail_cycles_util_7c( @@ -258,7 +272,12 @@ static void paint_monorail_cycles_track_left_quarter_turn_3_tiles( paint_util_set_general_support_height(session, height + 32, 0x20); } -static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_left_turn_map[] = { + 3, + 1, + 2, + 0, +}; /** rct2: 0x0088AD98 */ static void paint_monorail_cycles_track_right_quarter_turn_3_tiles( diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 36b1e2fc6e..8481ea262d 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -43,17 +43,22 @@ struct bound_box }; /** rct2: 0x01428220 */ -static constexpr const int16_t MagicCarpetOscillationZ[] = { -2, -1, 1, 5, 10, 16, 23, 30, 37, 45, 52, 59, 65, 70, 74, 76, - 77, 76, 74, 70, 65, 59, 52, 45, 37, 30, 23, 16, 10, 5, 1, -1 }; +static constexpr const int16_t MagicCarpetOscillationZ[] = { + -2, -1, 1, 5, 10, 16, 23, 30, 37, 45, 52, 59, 65, 70, 74, 76, 77, 76, 74, 70, 65, 59, 52, 45, 37, 30, 23, 16, 10, 5, 1, -1, +}; /** rct2: 0x01428260 */ -static constexpr const int8_t MagicCarpetOscillationXY[] = { 0, 6, 12, 18, 23, 27, 30, 31, 32, 31, 30, - 27, 23, 18, 12, 6, 0, -5, -11, -17, -22, -26, - -29, -30, -31, -30, -29, -26, -22, -17, -11, -5 }; +static constexpr const int8_t MagicCarpetOscillationXY[] = { + 0, 6, 12, 18, 23, 27, 30, 31, 32, 31, 30, 27, 23, 18, 12, 6, + 0, -5, -11, -17, -22, -26, -29, -30, -31, -30, -29, -26, -22, -17, -11, -5, +}; /** rct2: 0x014281F0 */ static constexpr const bound_box MagicCarpetBounds[] = { - { 0, 8, 32, 16 }, { 8, 0, 16, 32 }, { 0, 8, 32, 16 }, { 8, 0, 16, 32 } + { 0, 8, 32, 16 }, + { 8, 0, 16, 32 }, + { 0, 8, 32, 16 }, + { 8, 0, 16, 32 }, }; static const Vehicle* get_first_vehicle(const Ride* ride) diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index eac661e59e..bcbdb97980 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -17,10 +17,20 @@ #include "../Vehicle.h" /** rct2: 0x01428010 */ -static constexpr const uint32_t swinging_inverter_ship_base_sprite_offset[] = { 0, 16, 0, 16 }; +static constexpr const uint32_t swinging_inverter_ship_base_sprite_offset[] = { + 0, + 16, + 0, + 16, +}; /** rct2: 0x01428020 */ -static constexpr const uint32_t swinging_inverter_ship_animating_base_sprite_offset[] = { 32, 33, 32, 33 }; +static constexpr const uint32_t swinging_inverter_ship_animating_base_sprite_offset[] = { + 32, + 33, + 32, + 33, +}; struct swinging_inverter_ship_bound_box { @@ -32,7 +42,10 @@ struct swinging_inverter_ship_bound_box /** rct2: 0x01428020 */ static constexpr const swinging_inverter_ship_bound_box swinging_inverter_ship_bounds[] = { - { 32, 16, 0, 8 }, { 16, 32, 8, 0 }, { 32, 16, 0, 8 }, { 16, 32, 8, 0 } + { 32, 16, 0, 8 }, + { 16, 32, 8, 0 }, + { 32, 16, 0, 8 }, + { 16, 32, 8, 0 }, }; enum @@ -43,10 +56,12 @@ enum SPR_SWINGING_INVERTER_SHIP_FRAME_3 = 22001, }; -static constexpr const uint32_t swinging_inverter_ship_frame_sprites[] = { SPR_SWINGING_INVERTER_SHIP_FRAME_0, - SPR_SWINGING_INVERTER_SHIP_FRAME_1, - SPR_SWINGING_INVERTER_SHIP_FRAME_2, - SPR_SWINGING_INVERTER_SHIP_FRAME_3 }; +static constexpr const uint32_t swinging_inverter_ship_frame_sprites[] = { + SPR_SWINGING_INVERTER_SHIP_FRAME_0, + SPR_SWINGING_INVERTER_SHIP_FRAME_1, + SPR_SWINGING_INVERTER_SHIP_FRAME_2, + SPR_SWINGING_INVERTER_SHIP_FRAME_3, +}; static void paint_swinging_inverter_ship_structure( paint_session* session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index a923b133b7..f57d67cac5 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -33,7 +33,12 @@ struct swinging_ship_bound_box }; /** rct2: 0x008A83B0 */ -static constexpr const uint32_t swinging_ship_base_sprite_offset[] = { 0, 9, 0, 9 }; +static constexpr const uint32_t swinging_ship_base_sprite_offset[] = { + 0, + 9, + 0, + 9, +}; /** rct2: 0x008A83C0 */ static constexpr const swinging_ship_bound_box swinging_ship_data[] = { diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 101f424449..6053e40dc9 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -68,8 +68,12 @@ enum SPR_CHAIRLIFT_STATION_END_CAP_NW, }; -const uint32_t chairlift_bullwheel_frames[] = { SPR_CHAIRLIFT_BULLWHEEL_FRAME_1, SPR_CHAIRLIFT_BULLWHEEL_FRAME_2, - SPR_CHAIRLIFT_BULLWHEEL_FRAME_3, SPR_CHAIRLIFT_BULLWHEEL_FRAME_4 }; +const uint32_t chairlift_bullwheel_frames[] = { + SPR_CHAIRLIFT_BULLWHEEL_FRAME_1, + SPR_CHAIRLIFT_BULLWHEEL_FRAME_2, + SPR_CHAIRLIFT_BULLWHEEL_FRAME_3, + SPR_CHAIRLIFT_BULLWHEEL_FRAME_4, +}; static void chairlift_paint_util_draw_supports(paint_session* session, int32_t segments, uint16_t height) { diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 613e90d8d5..3aade1dc6c 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -134,8 +134,12 @@ enum SPR_MINIATURE_RAILWAY_DIAG_25_DEG_UP_S_N = 23452, }; -static constexpr const uint32_t miniature_railway_track_floor[4] = { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_90_DEG, - SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_90_DEG }; +static constexpr const uint32_t miniature_railway_track_floor[4] = { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_90_DEG, +}; static constexpr const uint32_t miniature_railway_track_pieces_flat[4] = { SPR_MINIATURE_RAILWAY_FLAT_SW_NE, @@ -144,8 +148,12 @@ static constexpr const uint32_t miniature_railway_track_pieces_flat[4] = { SPR_MINIATURE_RAILWAY_FLAT_NW_SE, }; -static constexpr const uint32_t miniature_railway_station_floor[4] = { SPR_STATION_BASE_A_SW_NE, SPR_STATION_BASE_A_NW_SE, - SPR_STATION_BASE_A_SW_NE, SPR_STATION_BASE_A_NW_SE }; +static constexpr const uint32_t miniature_railway_station_floor[4] = { + SPR_STATION_BASE_A_SW_NE, + SPR_STATION_BASE_A_NW_SE, + SPR_STATION_BASE_A_SW_NE, + SPR_STATION_BASE_A_NW_SE, +}; static constexpr const uint32_t miniature_railway_track_pieces_flat_station[4] = { SPR_MINIATURE_RAILWAY_FLAT_NO_BASE_SW_NE, @@ -182,7 +190,7 @@ static constexpr const uint32_t miniature_railway_track_pieces_flat_quarter_turn SPR_MINIATURE_RAILWAY_QUARTER_TURN_5_TILES_SE_NE_PART_2, SPR_MINIATURE_RAILWAY_QUARTER_TURN_5_TILES_SE_NE_PART_3, SPR_MINIATURE_RAILWAY_QUARTER_TURN_5_TILES_SE_NE_PART_4, - } + }, }; static constexpr const uint32_t miniature_railway_track_pieces_25_deg_up[4] = { @@ -218,7 +226,7 @@ static constexpr const uint32_t miniature_railway_track_pieces_s_bend_left[2][4] SPR_MINIATURE_RAILWAY_S_BEND_LEFT_SE_NW_PART_2, SPR_MINIATURE_RAILWAY_S_BEND_LEFT_SE_NW_PART_1, SPR_MINIATURE_RAILWAY_S_BEND_LEFT_SE_NW_PART_0, - } + }, }; static constexpr const uint32_t miniature_railway_track_pieces_s_bend_right[2][4] = { @@ -233,18 +241,30 @@ static constexpr const uint32_t miniature_railway_track_pieces_s_bend_right[2][4 SPR_MINIATURE_RAILWAY_S_BEND_RIGHT_SE_NW_PART_2, SPR_MINIATURE_RAILWAY_S_BEND_RIGHT_SE_NW_PART_1, SPR_MINIATURE_RAILWAY_S_BEND_RIGHT_SE_NW_PART_0, - } + }, }; static constexpr const uint32_t miniature_railway_track_pieces_flat_quarter_turn_3_tiles[4][3] = { - { SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t miniature_railway_track_pieces_right_eight_to_diag[4][4] = { @@ -573,16 +593,28 @@ static uint32_t miniature_railway_track_to_grooved_indent( if (direction & 0x1) { static constexpr uint32_t imageIds[2][2] = { - { SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW }, - { SPR_G2_MINIATURE_RAILWAY_INSET_END_SE, SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE }, + { + SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_NW, + }, + { + SPR_G2_MINIATURE_RAILWAY_INSET_END_SE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE, + }, }; imageIdAlt = imageIds[(correctedEdges & 0x2) ? 0 : 1][(correctedEdges & 0x8) ? 0 : 1]; } else { static constexpr uint32_t imageIds[2][2] = { - { SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW }, - { SPR_G2_MINIATURE_RAILWAY_INSET_END_NE, SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE }, + { + SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_SW, + }, + { + SPR_G2_MINIATURE_RAILWAY_INSET_END_NE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE, + }, }; imageIdAlt = imageIds[(correctedEdges & 0x1) ? 0 : 1][(correctedEdges & 0x4) ? 0 : 1]; } @@ -810,111 +842,140 @@ static void paint_miniature_railway_track_25_deg_down_to_flat( paint_miniature_railway_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } -// clang-format off -static constexpr const CoordsXY miniature_railway_right_quarter_turn_5_tiles_offsets[4][5] = { { - { 0, 2 }, - { 0, 16 }, - { 0, 0 }, - { 16, 0 }, - { 2, 0 }, - }, - { - { 2, 0 }, - { 16, 0 }, - { 0, 16 }, - { 0, 0 }, - { 0, 2 }, - }, - { - { 0, 2 }, - { 0, 0 }, - { 16, 16 }, - { 0, 0 }, - { 2, 0 }, - }, - { - { 2, 0 }, - { 0, 0 }, - { 16, 0 }, - { 0, 16 }, - { 0, 2 }, - } }; +static constexpr const CoordsXY miniature_railway_right_quarter_turn_5_tiles_offsets[4][5] = { + { + { 0, 2 }, + { 0, 16 }, + { 0, 0 }, + { 16, 0 }, + { 2, 0 }, + }, + { + { 2, 0 }, + { 16, 0 }, + { 0, 16 }, + { 0, 0 }, + { 0, 2 }, + }, + { + { 0, 2 }, + { 0, 0 }, + { 16, 16 }, + { 0, 0 }, + { 2, 0 }, + }, + { + { 2, 0 }, + { 0, 0 }, + { 16, 0 }, + { 0, 16 }, + { 0, 2 }, + }, +}; -static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_5_tiles_bound_offsets[4][5] = { { - { 0, 2, 0 }, - { 0, 16, 0 }, - { 0, 0, 0 }, - { 16, 0, 0 }, - { 2, 0, 0 }, - }, - { - { 2, 0, 0 }, - { 16, 0, 0 }, - { 0, 16, 0 }, - { 0, 0, 0 }, - { 0, 2, 0 }, - }, - { - { 0, 2, 0 }, - { 0, 0, 0 }, - { 16, 16, 0 }, - { 0, 0, 0 }, - { 2, 0, 0 }, - }, - { - { 2, 0, 0 }, - { 0, 0, 0 }, - { 16, 0, 0 }, - { 0, 16, 0 }, - { 0, 2, 0 }, - } }; +static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_5_tiles_bound_offsets[4][5] = { + { + { 0, 2, 0 }, + { 0, 16, 0 }, + { 0, 0, 0 }, + { 16, 0, 0 }, + { 2, 0, 0 }, + }, + { + { 2, 0, 0 }, + { 16, 0, 0 }, + { 0, 16, 0 }, + { 0, 0, 0 }, + { 0, 2, 0 }, + }, + { + { 0, 2, 0 }, + { 0, 0, 0 }, + { 16, 16, 0 }, + { 0, 0, 0 }, + { 2, 0, 0 }, + }, + { + { 2, 0, 0 }, + { 0, 0, 0 }, + { 16, 0, 0 }, + { 0, 16, 0 }, + { 0, 2, 0 }, + }, +}; -static constexpr const CoordsXY miniature_railway_right_quarter_turn_5_tiles_bound_lengths[4][5] = { { - { 32, 32 }, - { 32, 16 }, - { 16, 16 }, - { 16, 32 }, - { 32, 32 }, - }, - { - { 32, 32 }, - { 16, 34 }, - { 16, 16 }, - { 32, 16 }, - { 32, 27 }, - }, - { - { 32, 27 }, - { 32, 16 }, - { 16, 16 }, - { 16, 32 }, - { 27, 32 }, - }, - { - { 27, 32 }, - { 16, 32 }, - { 16, 16 }, - { 32, 16 }, - { 32, 32 }, - } }; -// clang-format on +static constexpr const CoordsXY miniature_railway_right_quarter_turn_5_tiles_bound_lengths[4][5] = { + { + { 32, 32 }, + { 32, 16 }, + { 16, 16 }, + { 16, 32 }, + { 32, 32 }, + }, + { + { 32, 32 }, + { 16, 34 }, + { 16, 16 }, + { 32, 16 }, + { 32, 27 }, + }, + { + { 32, 27 }, + { 32, 16 }, + { 16, 16 }, + { 16, 32 }, + { 27, 32 }, + }, + { + { 27, 32 }, + { 16, 32 }, + { 16, 16 }, + { 32, 16 }, + { 32, 32 }, + }, +}; static constexpr const uint32_t miniature_railway_right_quarter_turn_5_tiles_track_floor[4][5] = { - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_S_SEGMENT, - SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_W_SEGMENT, - SPR_FLOOR_PLANKS }, - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_N_SEGMENT, - SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, - SPR_FLOOR_PLANKS }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS, + }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS, + }, }; static constexpr const int8_t right_quarter_turn_5_supports_type[4][7] = { - { 0, -1, 4, 2, -1, 4, 1 }, { 1, -1, 5, 3, -1, 5, 0 }, { 0, -1, 2, 4, -1, 2, 1 }, { 1, -1, 3, 5, -1, 3, 0 } + { 0, -1, 4, 2, -1, 4, 1 }, + { 1, -1, 5, 3, -1, 5, 0 }, + { 0, -1, 2, 4, -1, 2, 1 }, + { 1, -1, 3, 5, -1, 3, 0 }, }; -static constexpr const int8_t miniature_railway_right_quarter_turn_5_tiles_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; +static constexpr const int8_t miniature_railway_right_quarter_turn_5_tiles_sprite_map[] = { + 0, -1, 1, 2, -1, 3, 4, +}; /** rct2: 0x008AD140 */ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( @@ -1016,17 +1077,25 @@ static void paint_miniature_railway_track_left_quarter_turn_5_tiles( } static constexpr const int8_t s_bend_left_supports_type[4][4] = { - { 0, 5, 3, 0 }, { 1, 2, 4, 1 }, { 0, 5, 3, 0 }, { 1, 2, 4, 1 } + { 0, 5, 3, 0 }, + { 1, 2, 4, 1 }, + { 0, 5, 3, 0 }, + { 1, 2, 4, 1 }, }; static constexpr const uint32_t miniature_railway_s_bend_left_tiles_track_floor[2][4] = { - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS, + }, { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_90_DEG, - } + }, }; /** rct2: 0x8AD150 */ @@ -1117,17 +1186,25 @@ static void paint_miniature_railway_track_s_bend_left( } static constexpr const int8_t s_bend_right_supports_type[4][4] = { - { 0, 4, 2, 0 }, { 1, 5, 3, 1 }, { 0, 4, 2, 0 }, { 1, 5, 3, 1 } + { 0, 4, 2, 0 }, + { 1, 5, 3, 1 }, + { 0, 4, 2, 0 }, + { 1, 5, 3, 1 }, }; static constexpr const uint32_t miniature_railway_s_bend_right_tiles_track_floor[2][4] = { - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS, + }, { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_90_DEG, - } + }, }; /** rct2: 0x008AD160 */ @@ -1237,29 +1314,31 @@ static constexpr const uint32_t miniature_railway_right_quarter_turn_3_tile_trac SPR_FLOOR_PLANKS_E_SEGMENT, 0, SPR_FLOOR_PLANKS_E_SEGMENT, - } + }, }; -static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_3_tile_bound_offsets[4][3] = { { - { 0, 6, 0 }, - { 16, 16, 0 }, - { 6, 0, 0 }, - }, - { - { 6, 0, 0 }, - { 16, 0, 0 }, - { 0, 6, 0 }, - }, - { - { 0, 6, 0 }, - { 0, 0, 0 }, - { 6, 0, 0 }, - }, - { - { 6, 0, 0 }, - { 0, 16, 0 }, - { 0, 6, 0 }, - } }; +static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_3_tile_bound_offsets[4][3] = { + { + { 0, 6, 0 }, + { 16, 16, 0 }, + { 6, 0, 0 }, + }, + { + { 6, 0, 0 }, + { 16, 0, 0 }, + { 0, 6, 0 }, + }, + { + { 0, 6, 0 }, + { 0, 0, 0 }, + { 6, 0, 0 }, + }, + { + { 6, 0, 0 }, + { 0, 16, 0 }, + { 0, 6, 0 }, + }, +}; /** rct2: 0x008AD1B0 */ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( @@ -1337,15 +1416,39 @@ static void paint_miniature_railway_track_left_quarter_turn_3_tiles( session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } -static constexpr const int8_t paint_miniature_railway_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; +static constexpr const int8_t paint_miniature_railway_eighth_to_diag_index[] = { + 0, 1, 2, -1, 3, +}; static constexpr const uint32_t miniature_railway_floor_track_pieces_left_eight_to_diag[4][5] = { - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_N_SEGMENT, - SPR_FLOOR_PLANKS }, - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_S_SEGMENT, - SPR_FLOOR_PLANKS }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS, + }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS, + }, }; static constexpr const CoordsXYZ miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[4][5] = { @@ -1480,13 +1583,34 @@ static void paint_miniature_railway_track_left_eighth_to_diag( } static constexpr const uint32_t miniature_railway_floor_track_pieces_right_eight_to_diag[4][5] = { - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_S_SEGMENT, - SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_E_SEGMENT, SPR_FLOOR_PLANKS_W_SEGMENT, - SPR_FLOOR_PLANKS }, - { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_S_SEGMENT, SPR_FLOOR_PLANKS_N_SEGMENT, SPR_FLOOR_PLANKS_90_DEG }, - { SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS_W_SEGMENT, SPR_FLOOR_PLANKS_E_SEGMENT, - SPR_FLOOR_PLANKS }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS, + }, + { + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS, + SPR_FLOOR_PLANKS_S_SEGMENT, + SPR_FLOOR_PLANKS_N_SEGMENT, + SPR_FLOOR_PLANKS_90_DEG, + }, + { + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_90_DEG, + SPR_FLOOR_PLANKS_W_SEGMENT, + SPR_FLOOR_PLANKS_E_SEGMENT, + SPR_FLOOR_PLANKS, + }, }; static constexpr const CoordsXYZ miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[4][5] = { @@ -1797,7 +1921,12 @@ static void miniature_railway_track_diag_25_deg_up( { { 0, 0 }, { +8, +16 }, { +8, +8 }, { +8, +8 } }, { { 0, 0 }, { -8, -8 }, { -8, -8 }, { +8, +8 } }, { { 0, 0 }, { +8, +8 }, { +8, +16 }, { +8, +8 } }, - { { 0, 0 }, { -8, -8 }, { -8, -8 }, { +8, +8 } }, + { + { 0, 0 }, + { -8, -8 }, + { -8, -8 }, + { +8, +8 }, + }, }; uint32_t imageId = miniature_railway_track_pieces_diag_25_deg_up[direction]; diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index ab6c1e9d4f..6cc63a6a11 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -167,7 +167,7 @@ static constexpr const uint32_t monorail_track_pieces_flat_quarter_turn_5_tiles[ SPR_MONORAIL_QUARTER_TURN_5_TILES_SE_NE_PART_2, SPR_MONORAIL_QUARTER_TURN_5_TILES_SE_NE_PART_3, SPR_MONORAIL_QUARTER_TURN_5_TILES_SE_NE_PART_4, - } + }, }; static constexpr const uint32_t monorail_track_pieces_25_deg_up[4] = { @@ -191,41 +191,57 @@ static constexpr const uint32_t monorail_track_pieces_25_deg_up_to_flat[4] = { SPR_MONORAIL_25_DEG_UP_TO_FLAT_SE_NW, }; -static constexpr const uint32_t monorail_track_pieces_s_bend_left[2][4] = { { - SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_0, - SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_1, - SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_2, - SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_3, - }, - { - SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_3, - SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_2, - SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_1, - SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_0, - } }; +static constexpr const uint32_t monorail_track_pieces_s_bend_left[2][4] = { + { + SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_0, + SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_1, + SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_2, + SPR_MONORAIL_S_BEND_LEFT_SW_NE_PART_3, + }, + { + SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_3, + SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_2, + SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_1, + SPR_MONORAIL_S_BEND_LEFT_SE_NW_PART_0, + }, +}; -static constexpr const uint32_t monorail_track_pieces_s_bend_right[2][4] = { { - SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_0, - SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_1, - SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_2, - SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_3, - }, - { - SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_3, - SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_2, - SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_1, - SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_0, - } }; +static constexpr const uint32_t monorail_track_pieces_s_bend_right[2][4] = { + { + SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_0, + SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_1, + SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_2, + SPR_MONORAIL_S_BEND_RIGHT_SW_NE_PART_3, + }, + { + SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_3, + SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_2, + SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_1, + SPR_MONORAIL_S_BEND_RIGHT_SE_NW_PART_0, + }, +}; static constexpr const uint32_t monorail_track_pieces_flat_quarter_turn_3_tiles[4][3] = { - { SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_0, SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_1, - SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_2 }, - { SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_0, SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_1, - SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_2 }, - { SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_0, SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_1, - SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_2 }, - { SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_0, SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_1, - SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_2 } + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_2, + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_2, + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_2, + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_2, + }, }; static constexpr const uint32_t ghost_train_track_pieces_right_eight_to_diag[4][4] = { @@ -990,7 +1006,9 @@ static void paint_monorail_track_left_quarter_turn_3_tiles( paint_monorail_track_right_quarter_turn_3_tiles(session, ride, trackSequence, (direction + 1) % 4, height, trackElement); } -static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { 0, 1, 2, -1, 3 }; +static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { + 0, 1, 2, -1, 3, +}; /** rct2: 0x008AE31C */ static void paint_monorail_track_left_eighth_to_diag( @@ -1155,12 +1173,19 @@ static constexpr const bool monorail_diag_image_segment[][4] = { { true, false, false, false }, }; -static constexpr const uint8_t monorail_diag_support_segment[] = { 1, 0, 2, 3 }; +static constexpr const uint8_t monorail_diag_support_segment[] = { + 1, + 0, + 2, + 3, +}; -static constexpr const int32_t monorail_diag_blocked_segments[] = { 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 }; +static constexpr const int32_t monorail_diag_blocked_segments[] = { + 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, +}; /** rct2: 0x008AE2AC */ static void paint_monorail_track_diag_flat( diff --git a/src/openrct2/ride/water/DingySlide.cpp b/src/openrct2/ride/water/DingySlide.cpp index 513a465055..dd16a364a4 100644 --- a/src/openrct2/ride/water/DingySlide.cpp +++ b/src/openrct2/ride/water/DingySlide.cpp @@ -726,7 +726,7 @@ static void dinghy_slide_track_right_quarter_turn_5( { SPR_DINGHY_SLIDE_QUARTER_TURN_5_SE_NE_PART_2, { 16, 0, 0 }, { 16, 0, 0 }, { 16, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_SE_NE_PART_3, { 0, 16, 0 }, { 0, 16, 0 }, { 32, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_SE_NE_PART_4, { 0, 2, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, - } + }, }; static constexpr const sprite_bb frontImageIds[4][5] = { { @@ -756,7 +756,7 @@ static void dinghy_slide_track_right_quarter_turn_5( { SPR_DINGHY_SLIDE_QUARTER_TURN_5_FRONT_SE_NE_PART_2, { 16, 0, 0 }, { 16, 0, 27 }, { 16, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_FRONT_SE_NE_PART_3, { 0, 16, 0 }, { 0, 16, 27 }, { 32, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_FRONT_SE_NE_PART_4, { 0, 2, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, - } + }, }; track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -842,22 +842,30 @@ static void dinghy_slide_track_s_bend_left( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_0 } }, - { { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_0 } }, + { + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_NW_NE_SEQ_0 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NW_SW_NW_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -937,22 +945,30 @@ static void dinghy_slide_track_s_bend_right( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_0 } }, - { { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_0 } }, + { + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_NE_SE_NE_SEQ_0 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_FRONT_SE_SW_SE_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -1049,7 +1065,7 @@ static void dinghy_slide_track_right_quarter_turn_3( { SPR_DINGHY_SLIDE_QUARTER_TURN_3_SE_NE_PART_0, { 0, 0, 0 }, { 6, 0, 0 }, { 20, 32, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_SE_NE_PART_1, { 0, 0, 0 }, { 0, 16, 0 }, { 16, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, - } + }, }; static constexpr const sprite_bb frontImageIds[4][3] = { { @@ -1071,7 +1087,7 @@ static void dinghy_slide_track_right_quarter_turn_3( { SPR_DINGHY_SLIDE_QUARTER_TURN_3_FRONT_SE_NE_PART_0, { 0, 0, 0 }, { 6, 0, 27 }, { 20, 32, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_FRONT_SE_NE_PART_1, { 0, 0, 0 }, { 0, 16, 27 }, { 16, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_FRONT_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, - } + }, }; track_paint_util_right_quarter_turn_3_tiles_paint_3( @@ -1426,7 +1442,7 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_SE_NE_PART_2, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_SE_NE_PART_3, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_SE_NE_PART_4, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, - } + }, }; static constexpr const sprite_bb frontImageIds[4][5] = { { @@ -1456,7 +1472,7 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_FRONT_SE_NE_PART_2, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_FRONT_SE_NE_PART_3, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_FRONT_SE_NE_PART_4, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, - } + }, }; track_paint_util_right_quarter_turn_5_tiles_paint_2( @@ -1535,22 +1551,30 @@ static void dinghy_slide_track_s_bend_left_covered( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_0 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_0 } }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_SE_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_NW_NE_SEQ_0 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_NW_SW_NW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NW_SW_NW_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -1630,22 +1654,30 @@ static void dinghy_slide_track_s_bend_right_covered( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_0 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_3 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_0 } }, - { { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_3 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_0 } }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_0 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_3 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SW_NW_SW_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_NE_SE_NE_SEQ_0 }, + }, + { + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_3, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_3 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_2, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_1, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_DINGHY_SLIDE_S_BEND_COVERED_SE_SW_SE_SEQ_0, SPR_DINGHY_SLIDE_S_BEND_COVERED_FRONT_SE_SW_SE_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -1742,7 +1774,7 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_SE_NE_PART_0, { 0, 0, 0 }, { 6, 0, 0 }, { 20, 32, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_SE_NE_PART_1, { 0, 0, 0 }, { 0, 16, 0 }, { 16, 16, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, - } + }, }; static constexpr const sprite_bb frontImageIds[4][3] = { { @@ -1764,7 +1796,7 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_FRONT_SE_NE_PART_0, { 0, 0, 0 }, { 6, 0, 27 }, { 20, 32, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_FRONT_SE_NE_PART_1, { 0, 0, 0 }, { 0, 16, 27 }, { 16, 16, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_FRONT_SE_NE_PART_2, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, - } + }, }; track_paint_util_right_quarter_turn_3_tiles_paint_3( diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 94130ba46f..2fe8f9d951 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -433,22 +433,30 @@ static void paint_log_flume_track_s_bend_left( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 }, - { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 } }, - { { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 }, - { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 } }, - { { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 } }, - { { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 } }, + { + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 }, + }, + { + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 }, + }, + { + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 }, + }, + { + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -528,22 +536,30 @@ static void paint_log_flume_track_s_bend_right( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 }, - { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 } }, - { { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 }, - { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 } }, - { { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 } }, - { { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, - { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, - { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 } }, + { + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 }, + }, + { + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 }, + }, + { + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 }, + }, + { + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -628,14 +644,26 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( }; static constexpr const uint32_t imageIdsFront[4][3] = { - { SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3 }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3, + }, }; track_paint_util_left_quarter_turn_3_tiles_paint( @@ -695,14 +723,26 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( }; static constexpr const uint32_t imageIdsFront[4][3] = { - { SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3 }, - { SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, - SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3 }, + { + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3, + }, + { + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3, + }, }; track_paint_util_right_quarter_turn_3_tiles_paint_2( diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index 7ca899d9e9..edbac9f93b 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -21,11 +21,11 @@ #ifndef NO_VEHICLES // 0x0099279E: -static constexpr const vehicle_boundbox _riverRapidsBoundbox[] = { { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, - { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, - { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, - { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, - { -13, -13, 1, 26, 26, 13 } }; +static constexpr const vehicle_boundbox _riverRapidsBoundbox[] = { + { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, + { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, + { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, { -13, -13, 1, 26, 26, 13 }, +}; #endif enum diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index af9068a484..097d29bf6b 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -379,7 +379,7 @@ static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Top[4][5] = { SPR_SPLASH_BOATS_TURN_LEFT_5_TOP_SE_SW_SEQ_3, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 16, 2 }, SPR_SPLASH_BOATS_TURN_LEFT_5_TOP_SE_SW_SEQ_5, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 }, SPR_SPLASH_BOATS_TURN_LEFT_5_TOP_SE_SW_SEQ_6, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 }, - } + }, }; static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Side[4][5] = { @@ -410,7 +410,7 @@ static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Side[4][5] = { SPR_SPLASH_BOATS_TURN_LEFT_5_SIDE_SE_SW_SEQ_3, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 16, 0 }, SPR_SPLASH_BOATS_TURN_LEFT_5_SIDE_SE_SW_SEQ_5, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 }, SPR_SPLASH_BOATS_TURN_LEFT_5_SIDE_SE_SW_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 }, - } + }, }; static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Top[4][5] = { @@ -441,7 +441,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Top[4][5] = { SPR_SPLASH_BOATS_TURN_RIGHT_5_TOP_SE_NE_SEQ_3, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 16, 2 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_TOP_SE_NE_SEQ_5, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_TOP_SE_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 }, - } + }, }; static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { @@ -472,7 +472,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { SPR_SPLASH_BOATS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_3, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 16, 0 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_5, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 }, - } + }, }; static void paint_splash_boats_track_25_deg_up( @@ -978,22 +978,30 @@ static void paint_splash_boats_track_s_bend_left( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_0 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_3 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_0 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_3 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_3 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_0 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_3 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_0 } }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_0 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_NW_NE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_3 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_0 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_SW_NW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_3 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_3 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_SE_SW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_NW_NE_SEQ_0 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_3 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_NE_SE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NW_SW_NW_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; @@ -1068,22 +1076,30 @@ static void paint_splash_boats_track_s_bend_right( const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4][2] = { - { { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_0 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_3 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_0 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_3 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_3 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_0 } }, - { { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_3 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_2 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_1 }, - { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_0 } }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_0 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NE_SE_NE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_3 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_0 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SE_SW_SE_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_3 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_3 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_SW_NW_SW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_NE_SE_NE_SEQ_0 }, + }, + { + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_0, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_3 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_1, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_2 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_2, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_1 }, + { SPR_SPLASH_BOATS_S_BEND_TOP_NW_NE_NW_SEQ_3, SPR_SPLASH_BOATS_S_BEND_SIDE_SE_SW_SE_SEQ_0 }, + }, }; uint32_t imageId = imageIds[direction][trackSequence][0] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 0b3a33bcc7..2b3cbdd52a 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -179,7 +179,12 @@ static void submarine_ride_paint_track_left_quarter_turn_3_tiles( paint_util_set_general_support_height(session, height + 16, 0x20); } -static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[] = { + 3, + 1, + 2, + 0, +}; static void submarine_ride_paint_track_right_quarter_turn_3_tiles( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) diff --git a/src/openrct2/ride/water/WaterCoaster.cpp b/src/openrct2/ride/water/WaterCoaster.cpp index 3fbef01e80..166de550c1 100644 --- a/src/openrct2/ride/water/WaterCoaster.cpp +++ b/src/openrct2/ride/water/WaterCoaster.cpp @@ -212,7 +212,9 @@ static void water_rc_track_right_quarter_turn_5_tiles_25_deg_up( session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } -static constexpr const uint8_t water_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; +static constexpr const uint8_t water_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { + 6, 4, 5, 3, 1, 2, 0, +}; static void water_rc_track_left_quarter_turn_5_tiles_25_deg_down( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -250,7 +252,12 @@ static void water_rc_track_right_quarter_turn_3_tiles_25_deg_down( session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } -static constexpr const uint8_t water_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { 3, 1, 2, 0 }; +static constexpr const uint8_t water_rc_left_quarter_turn_3_tiles_to_right_turn_map[] = { + 3, + 1, + 2, + 0, +}; static void water_rc_track_left_quarter_turn_3_tiles_25_deg_up( paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height, diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index e7f40fd650..101b1ae0b8 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -58,7 +58,10 @@ static int32_t _weatherVolume = 1; static uint32_t _lightningTimer; static uint32_t _thunderTimer; static void* _thunderSoundChannels[MAX_THUNDER_INSTANCES]; -static THUNDER_STATUS _thunderStatus[MAX_THUNDER_INSTANCES] = { THUNDER_STATUS::NONE, THUNDER_STATUS::NONE }; +static THUNDER_STATUS _thunderStatus[MAX_THUNDER_INSTANCES] = { + THUNDER_STATUS::NONE, + THUNDER_STATUS::NONE, +}; static OpenRCT2::Audio::SoundId _thunderSoundId; static int32_t _thunderVolume; static int32_t _thunderStereoEcho = 0; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 7d5424ce8f..b514ec864d 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -69,7 +69,12 @@ const CoordsXY BenchUseOffsets[8] = { }; /** rct2: 0x00981D6C, 0x00981D6E */ -const CoordsXY DirectionOffsets[4] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } }; +const CoordsXY DirectionOffsets[4] = { + { -1, 0 }, + { 0, 1 }, + { 1, 0 }, + { 0, -1 }, +}; // rct2: 0x0097B974 static constexpr const uint16_t EntranceDirections[] = { diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index c4466504a3..2bf539ea20 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -53,11 +53,13 @@ constexpr auto _FountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 constexpr auto _FountainChanceOfStoppingRandomMode = 0x2000; // 0.125 // rct2: 0x0097F040 -const uint8_t _fountainDirections[] = { 0, 1, 2, 3, 0, 1, 2, 3 }; +const uint8_t _fountainDirections[] = { + 0, 1, 2, 3, 0, 1, 2, 3, +}; // rct2: 0x0097F048 const uint8_t _fountainDirectionFlags[] = { - 0, 0, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, 0, 0 + 0, 0, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, FOUNTAIN_FLAG::DIRECTION, 0, 0, }; // rct2: 0x0097F050 @@ -69,7 +71,7 @@ const uint8_t _fountainPatternFlags[] = { FOUNTAIN_FLAG::GOTO_EDGE, // RACING_PAIRS FOUNTAIN_FLAG::FAST | FOUNTAIN_FLAG::GOTO_EDGE | FOUNTAIN_FLAG::SPLIT, // SPLITTING_CHASERS 0, // DOPEY_JUMPERS - FOUNTAIN_FLAG::FAST // FAST_RANDOM_CHASERS + FOUNTAIN_FLAG::FAST, // FAST_RANDOM_CHASERS }; template<> bool EntityBase::Is() const diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 6dba7e7ab6..62fb7025e1 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -491,7 +491,12 @@ const Direction INVALID_DIRECTION = 0xFF; * Array of all valid cardinal directions, to make it easy to write range-based for loops like: * for (Direction d : ALL_DIRECTIONS) */ -constexpr Direction ALL_DIRECTIONS[] = { 0, 1, 2, 3 }; +constexpr Direction ALL_DIRECTIONS[] = { + 0, + 1, + 2, + 3, +}; /** * Given a direction, return the direction that points the other way, diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 64d49fad9b..7185a6665f 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -78,8 +78,9 @@ const std::array CoordsDirectionDelta = { }; // clang-format on -const TileCoordsXY TileDirectionDelta[] = { { -1, 0 }, { 0, +1 }, { +1, 0 }, { 0, -1 }, - { -1, +1 }, { +1, +1 }, { +1, -1 }, { -1, -1 } }; +const TileCoordsXY TileDirectionDelta[] = { + { -1, 0 }, { 0, +1 }, { +1, 0 }, { 0, -1 }, { -1, +1 }, { +1, +1 }, { +1, -1 }, { -1, -1 }, +}; constexpr size_t MIN_TILE_ELEMENTS = 1024; @@ -831,25 +832,43 @@ bool map_is_location_owned_or_has_rights(const CoordsXY& loc) // 0x1F = new slope // 0x20 = base height increases const uint8_t tile_element_raise_styles[9][32] = { - { 0x01, 0x1B, 0x03, 0x1B, 0x05, 0x21, 0x07, 0x21, 0x09, 0x1B, 0x0B, 0x1B, 0x0D, 0x21, 0x20, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x23, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x29, 0x24, 0x1F }, // MAP_SELECT_TYPE_CORNER_0 - // (absolute rotation) - { 0x02, 0x03, 0x17, 0x17, 0x06, 0x07, 0x17, 0x17, 0x0A, 0x0B, 0x22, 0x22, 0x0E, 0x20, 0x22, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x37, 0x18, 0x19, 0x1A, 0x23, 0x1C, 0x28, 0x26, 0x1F }, // MAP_SELECT_TYPE_CORNER_1 - { 0x04, 0x05, 0x06, 0x07, 0x1E, 0x24, 0x1E, 0x24, 0x0C, 0x0D, 0x0E, 0x20, 0x1E, 0x24, 0x1E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x26, 0x18, 0x19, 0x1A, 0x21, 0x1C, 0x2C, 0x3E, 0x1F }, // MAP_SELECT_TYPE_CORNER_2 - { 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x20, 0x1D, 0x1D, 0x28, 0x28, 0x1D, 0x1D, 0x28, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x22, 0x18, 0x19, 0x1A, 0x29, 0x1C, 0x3D, 0x2C, 0x1F }, // MAP_SELECT_TYPE_CORNER_3 - { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x20, 0x20, 0x20, 0x21, 0x20, 0x28, 0x24, 0x20 }, // MAP_SELECT_TYPE_FULL - { 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0D, 0x0E, 0x20, 0x2C, 0x2C, 0x2C, 0x2C, - 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0C, 0x0E, 0x22, 0x0C, 0x0D, 0x0E, 0x21, 0x2C, 0x2C, 0x2C, 0x2C }, // MAP_SELECT_TYPE_EDGE_0 - { 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0D, 0x20, 0x20, 0x09, 0x29, 0x0B, 0x29, 0x0D, 0x29, 0x20, 0x29, - 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0D, 0x24, 0x22, 0x09, 0x29, 0x0B, 0x29, 0x0D, 0x29, 0x24, 0x29 }, // MAP_SELECT_TYPE_EDGE_1 - { 0x03, 0x03, 0x03, 0x23, 0x07, 0x07, 0x07, 0x23, 0x0B, 0x0B, 0x0B, 0x23, 0x20, 0x20, 0x20, 0x23, - 0x03, 0x03, 0x03, 0x23, 0x07, 0x07, 0x07, 0x23, 0x0B, 0x0B, 0x0B, 0x23, 0x20, 0x28, 0x24, 0x23 }, // MAP_SELECT_TYPE_EDGE_2 - { 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x26, 0x26, 0x0E, 0x20, 0x0E, 0x20, 0x0E, 0x20, 0x26, 0x26, - 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x26, 0x26, 0x0E, 0x20, 0x0E, 0x21, 0x0E, 0x28, 0x26, 0x26 }, // MAP_SELECT_TYPE_EDGE_3 + { + 0x01, 0x1B, 0x03, 0x1B, 0x05, 0x21, 0x07, 0x21, 0x09, 0x1B, 0x0B, 0x1B, 0x0D, 0x21, 0x20, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x23, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x29, 0x24, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_0 + // (absolute rotation) + { + 0x02, 0x03, 0x17, 0x17, 0x06, 0x07, 0x17, 0x17, 0x0A, 0x0B, 0x22, 0x22, 0x0E, 0x20, 0x22, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x37, 0x18, 0x19, 0x1A, 0x23, 0x1C, 0x28, 0x26, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_1 + { + 0x04, 0x05, 0x06, 0x07, 0x1E, 0x24, 0x1E, 0x24, 0x0C, 0x0D, 0x0E, 0x20, 0x1E, 0x24, 0x1E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x26, 0x18, 0x19, 0x1A, 0x21, 0x1C, 0x2C, 0x3E, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_2 + { + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x20, 0x1D, 0x1D, 0x28, 0x28, 0x1D, 0x1D, 0x28, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x22, 0x18, 0x19, 0x1A, 0x29, 0x1C, 0x3D, 0x2C, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_3 + { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x20, 0x20, 0x20, 0x21, 0x20, 0x28, 0x24, 0x20, + }, // MAP_SELECT_TYPE_FULL + { + 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0D, 0x0E, 0x20, 0x2C, 0x2C, 0x2C, 0x2C, + 0x0C, 0x0D, 0x0E, 0x20, 0x0C, 0x0C, 0x0E, 0x22, 0x0C, 0x0D, 0x0E, 0x21, 0x2C, 0x2C, 0x2C, 0x2C, + }, // MAP_SELECT_TYPE_EDGE_0 + { + 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0D, 0x20, 0x20, 0x09, 0x29, 0x0B, 0x29, 0x0D, 0x29, 0x20, 0x29, + 0x09, 0x09, 0x0B, 0x0B, 0x0D, 0x0D, 0x24, 0x22, 0x09, 0x29, 0x0B, 0x29, 0x0D, 0x29, 0x24, 0x29, + }, // MAP_SELECT_TYPE_EDGE_1 + { + 0x03, 0x03, 0x03, 0x23, 0x07, 0x07, 0x07, 0x23, 0x0B, 0x0B, 0x0B, 0x23, 0x20, 0x20, 0x20, 0x23, + 0x03, 0x03, 0x03, 0x23, 0x07, 0x07, 0x07, 0x23, 0x0B, 0x0B, 0x0B, 0x23, 0x20, 0x28, 0x24, 0x23, + }, // MAP_SELECT_TYPE_EDGE_2 + { + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x26, 0x26, 0x0E, 0x20, 0x0E, 0x20, 0x0E, 0x20, 0x26, 0x26, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x26, 0x26, 0x0E, 0x20, 0x0E, 0x21, 0x0E, 0x28, 0x26, 0x26, + }, // MAP_SELECT_TYPE_EDGE_3 }; // 0x00981ABE @@ -857,24 +876,42 @@ const uint8_t tile_element_raise_styles[9][32] = { // 0x1F = new slope // 0x20 = base height increases const uint8_t tile_element_lower_styles[9][32] = { - { 0x2E, 0x00, 0x2E, 0x02, 0x3E, 0x04, 0x3E, 0x06, 0x2E, 0x08, 0x2E, 0x0A, 0x3E, 0x0C, 0x3E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x06, 0x18, 0x19, 0x1A, 0x0B, 0x1C, 0x0C, 0x3E, 0x1F }, // MAP_SELECT_TYPE_CORNER_0 - { 0x2D, 0x2D, 0x00, 0x01, 0x2D, 0x2D, 0x04, 0x05, 0x3D, 0x3D, 0x08, 0x09, 0x3D, 0x3D, 0x0C, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x07, 0x18, 0x19, 0x1A, 0x09, 0x1C, 0x3D, 0x0C, 0x1F }, // MAP_SELECT_TYPE_CORNER_1 - { 0x2B, 0x3B, 0x2B, 0x3B, 0x00, 0x01, 0x02, 0x03, 0x2B, 0x3B, 0x2B, 0x3B, 0x08, 0x09, 0x0A, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x03, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x09, 0x0E, 0x1F }, // MAP_SELECT_TYPE_CORNER_2 - { 0x27, 0x27, 0x37, 0x37, 0x27, 0x27, 0x37, 0x37, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x37, 0x18, 0x19, 0x1A, 0x03, 0x1C, 0x0D, 0x06, 0x1F }, // MAP_SELECT_TYPE_CORNER_3 - { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x0D, 0x0E, 0x00 }, // MAP_SELECT_TYPE_FULL - { 0x23, 0x23, 0x23, 0x23, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, - 0x23, 0x23, 0x23, 0x23, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, 0x00, 0x0D, 0x0E, 0x03 }, // MAP_SELECT_TYPE_EDGE_0 - { 0x26, 0x00, 0x26, 0x02, 0x26, 0x04, 0x26, 0x06, 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x06, 0x06, - 0x26, 0x00, 0x26, 0x02, 0x26, 0x04, 0x26, 0x06, 0x00, 0x00, 0x02, 0x0B, 0x04, 0x0D, 0x06, 0x06 }, // MAP_SELECT_TYPE_EDGE_1 - { 0x2C, 0x00, 0x00, 0x00, 0x2C, 0x04, 0x04, 0x04, 0x2C, 0x08, 0x08, 0x08, 0x2C, 0x0C, 0x0C, 0x0C, - 0x2C, 0x00, 0x00, 0x00, 0x2C, 0x04, 0x04, 0x07, 0x2C, 0x08, 0x08, 0x0B, 0x2C, 0x0C, 0x0C, 0x0C }, // MAP_SELECT_TYPE_EDGE_2 - { 0x29, 0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x29, 0x29, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, - 0x29, 0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07, 0x29, 0x29, 0x08, 0x09, 0x08, 0x09, 0x0E, 0x09 }, // MAP_SELECT_TYPE_EDGE_3 + { + 0x2E, 0x00, 0x2E, 0x02, 0x3E, 0x04, 0x3E, 0x06, 0x2E, 0x08, 0x2E, 0x0A, 0x3E, 0x0C, 0x3E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x06, 0x18, 0x19, 0x1A, 0x0B, 0x1C, 0x0C, 0x3E, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_0 + { + 0x2D, 0x2D, 0x00, 0x01, 0x2D, 0x2D, 0x04, 0x05, 0x3D, 0x3D, 0x08, 0x09, 0x3D, 0x3D, 0x0C, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x07, 0x18, 0x19, 0x1A, 0x09, 0x1C, 0x3D, 0x0C, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_1 + { + 0x2B, 0x3B, 0x2B, 0x3B, 0x00, 0x01, 0x02, 0x03, 0x2B, 0x3B, 0x2B, 0x3B, 0x08, 0x09, 0x0A, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x03, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x09, 0x0E, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_2 + { + 0x27, 0x27, 0x37, 0x37, 0x27, 0x27, 0x37, 0x37, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x37, 0x18, 0x19, 0x1A, 0x03, 0x1C, 0x0D, 0x06, 0x1F, + }, // MAP_SELECT_TYPE_CORNER_3 + { + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x0D, 0x0E, 0x00, + }, // MAP_SELECT_TYPE_FULL + { + 0x23, 0x23, 0x23, 0x23, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, + 0x23, 0x23, 0x23, 0x23, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, 0x00, 0x0D, 0x0E, 0x03, + }, // MAP_SELECT_TYPE_EDGE_0 + { + 0x26, 0x00, 0x26, 0x02, 0x26, 0x04, 0x26, 0x06, 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x06, 0x06, + 0x26, 0x00, 0x26, 0x02, 0x26, 0x04, 0x26, 0x06, 0x00, 0x00, 0x02, 0x0B, 0x04, 0x0D, 0x06, 0x06, + }, // MAP_SELECT_TYPE_EDGE_1 + { + 0x2C, 0x00, 0x00, 0x00, 0x2C, 0x04, 0x04, 0x04, 0x2C, 0x08, 0x08, 0x08, 0x2C, 0x0C, 0x0C, 0x0C, + 0x2C, 0x00, 0x00, 0x00, 0x2C, 0x04, 0x04, 0x07, 0x2C, 0x08, 0x08, 0x0B, 0x2C, 0x0C, 0x0C, 0x0C, + }, // MAP_SELECT_TYPE_EDGE_2 + { + 0x29, 0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x29, 0x29, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, + 0x29, 0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07, 0x29, 0x29, 0x08, 0x09, 0x08, 0x09, 0x0E, 0x09, + }, // MAP_SELECT_TYPE_EDGE_3 }; int32_t map_get_corner_height(int32_t z, int32_t slope, int32_t direction) diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index a2b253eec5..f80a5a5271 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -582,7 +582,7 @@ static constexpr const map_animation_invalidate_event_handler _animatedObjectEve map_animation_invalidate_banner, map_animation_invalidate_large_scenery, map_animation_invalidate_wall_door, - map_animation_invalidate_wall + map_animation_invalidate_wall, }; /** diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 235ed65636..ee1e37a6ad 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -85,8 +85,9 @@ static constexpr const char* SnowTrees[] = { #pragma endregion // Randomly chosen base terrains. We rarely want a whole map made out of chequerboard or rock. -static constexpr const std::string_view BaseTerrain[] = { "rct2.surface.grass", "rct2.surface.sand", "rct2.surface.sandbrown", - "rct2.surface.dirt", "rct2.surface.ice" }; +static constexpr const std::string_view BaseTerrain[] = { + "rct2.surface.grass", "rct2.surface.sand", "rct2.surface.sandbrown", "rct2.surface.dirt", "rct2.surface.ice", +}; static void mapgen_place_trees(); static void mapgen_set_water_level(int32_t waterLevel); diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 9bfe2b68c7..1e57a997fa 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -18,7 +18,12 @@ #include "Map.h" #include "Sprite.h" -static constexpr const CoordsXY _moneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, { -1, -1 } }; +static constexpr const CoordsXY _moneyEffectMoveOffset[] = { + { 1, -1 }, + { 1, 1 }, + { -1, 1 }, + { -1, -1 }, +}; template<> bool EntityBase::Is() const { diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 79a1428531..c706866b6c 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -56,7 +56,12 @@ money64 gClearSceneryCost; static std::vector _restrictedScenery; // rct2: 0x009A3E74 -const CoordsXY SceneryQuadrantOffsets[] = { { 7, 7 }, { 7, 23 }, { 23, 23 }, { 23, 7 } }; +const CoordsXY SceneryQuadrantOffsets[] = { + { 7, 7 }, + { 7, 23 }, + { 23, 23 }, + { 23, 7 }, +}; void scenery_update_tile(const CoordsXY& sceneryPos) { diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index b878970784..5741842e01 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -262,7 +262,8 @@ TEST(SeaDecrypt, DecryptSea) auto path = TestData::GetParkPath("volcania.sea"); auto decrypted = DecryptSea(path); auto sha1 = Crypt::SHA1(decrypted.data(), decrypted.size()); - std::array expected = { 0x1B, 0x85, 0xFC, 0xC0, 0xE8, 0x9B, 0xBE, 0x72, 0xD9, 0x1F, - 0x6E, 0xC8, 0xB1, 0xFF, 0xEC, 0x70, 0x2A, 0x72, 0x05, 0xBB }; + std::array expected = { + 0x1B, 0x85, 0xFC, 0xC0, 0xE8, 0x9B, 0xBE, 0x72, 0xD9, 0x1F, 0x6E, 0xC8, 0xB1, 0xFF, 0xEC, 0x70, 0x2A, 0x72, 0x05, 0xBB, + }; ASSERT_EQ(sha1, expected); } diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index c449699192..027c60d5d8 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -503,20 +503,35 @@ const uint8_t SawyerCodingTest::rotatedata[] = { 0x40, 0x7d, 0xf4, 0xfa, 0x2f, 0x6b, 0x93, 0x44, 0x5e, }; -const uint8_t SawyerCodingTest::invalid1[] = { 0x02, 0x04, 0x00, 0x00, 0x00, 0xd4, 0xff, 0xce, 0xcf, 0x2e, 0x00 }; +const uint8_t SawyerCodingTest::invalid1[] = { + 0x02, 0x04, 0x00, 0x00, 0x00, 0xd4, 0xff, 0xce, 0xcf, 0x2e, 0x00, +}; -const uint8_t SawyerCodingTest::invalid2[] = { 0x02, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x27, 0x3f, 0x01, 0x00 }; +const uint8_t SawyerCodingTest::invalid2[] = { + 0x02, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x27, 0x3f, 0x01, 0x00, +}; -const uint8_t SawyerCodingTest::invalid3[] = { 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x73 }; +const uint8_t SawyerCodingTest::invalid3[] = { + 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x73, +}; -const uint8_t SawyerCodingTest::invalid4[] = { 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }; +const uint8_t SawyerCodingTest::invalid4[] = { + 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +}; -const uint8_t SawyerCodingTest::invalid5[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00 }; +const uint8_t SawyerCodingTest::invalid5[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, +}; -const uint8_t SawyerCodingTest::invalid6[] = { 0x02, 0x02, 0x00, 0x00, 0x00, 0x28, 0x7f }; +const uint8_t SawyerCodingTest::invalid6[] = { + 0x02, 0x02, 0x00, 0x00, 0x00, 0x28, 0x7f, +}; -const uint8_t SawyerCodingTest::invalid7[] = { 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 }; +const uint8_t SawyerCodingTest::invalid7[] = { + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +}; // This needs to be non-empty to satisfy MSVC. We still pass zero as length. -const uint8_t SawyerCodingTest::empty[] = { 0x00 }; +const uint8_t SawyerCodingTest::empty[] = { + 0x00, +}; From edde5096db3dcb668b3d74f20ecedf86c485fda0 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Tue, 19 Oct 2021 21:54:02 +0200 Subject: [PATCH 563/681] Use correct size for monorail_cycles_track_pieces_flat --- src/openrct2/ride/gentle/MonorailCycles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index d51f027c8b..ecf90721fb 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -70,7 +70,7 @@ enum SPR_MONORAIL_CYCLES_S_BEND_RIGHT_NW_SE_PART_3 = 16869, }; -static constexpr const uint32_t monorail_cycles_track_pieces_flat[4] = { +static constexpr const uint32_t monorail_cycles_track_pieces_flat[2] = { SPR_MONORAIL_CYCLES_FLAT_SW_NE, SPR_MONORAIL_CYCLES_FLAT_NW_SE, }; From 2d78a5efc3505cb6378dc35557f664f412c7d210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 19 Oct 2021 13:50:24 -0700 Subject: [PATCH 564/681] Move GameActionResult into its own unit (#15588) --- src/openrct2/actions/GameAction.cpp | 49 ------- src/openrct2/actions/GameAction.h | 140 +------------------ src/openrct2/actions/GameActionResult.cpp | 56 ++++++++ src/openrct2/actions/GameActionResult.h | 161 ++++++++++++++++++++++ src/openrct2/libopenrct2.vcxproj | 2 + 5 files changed, 226 insertions(+), 182 deletions(-) create mode 100644 src/openrct2/actions/GameActionResult.cpp create mode 100644 src/openrct2/actions/GameActionResult.h diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 0856d018a3..ed31433c72 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -34,55 +34,6 @@ using namespace OpenRCT2; namespace GameActions { - Result::Result(GameActions::Status error, rct_string_id message) - { - Error = error; - ErrorMessage = message; - } - - Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message) - { - Error = error; - ErrorTitle = title; - ErrorMessage = message; - } - - Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args) - { - Error = error; - ErrorTitle = title; - ErrorMessage = message; - std::copy_n(args, ErrorMessageArgs.size(), ErrorMessageArgs.begin()); - } - - std::string GameActions::Result::GetErrorTitle() const - { - std::string title; - if (auto error = ErrorTitle.AsString()) - { - title = *error; - } - else - { - title = format_string(ErrorTitle.GetStringId(), ErrorMessageArgs.data()); - } - return title; - } - - std::string GameActions::Result::GetErrorMessage() const - { - std::string message; - if (auto error = ErrorMessage.AsString()) - { - message = *error; - } - else - { - message = format_string(ErrorMessage.GetStringId(), ErrorMessageArgs.data()); - } - return message; - } - struct QueuedGameAction { uint32_t tick; diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 8a567dfd23..474d8fbf84 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -13,100 +13,15 @@ #include "../common.h" #include "../core/DataSerialiser.h" #include "../localisation/StringIds.h" +#include "GameActionResult.h" -#include #include #include #include #include -class StringVariant -{ -private: - rct_string_id StringId = STR_NONE; - std::string String; - -public: - StringVariant() = default; - - StringVariant(rct_string_id stringId) - : StringId(stringId) - { - } - - StringVariant(const std::string& s) - : String(s) - { - } - - StringVariant(std::string&& s) - : String(std::move(s)) - { - } - - StringVariant(const char* s) - : String(s) - { - } - - const std::string* AsString() const - { - if (!String.empty()) - { - return &String; - } - return {}; - } - - const rct_string_id* AsStringId() const - { - if (String.empty()) - { - return &StringId; - } - return {}; - } - - rct_string_id GetStringId() const - { - return String.empty() ? StringId : STR_NONE; - } -}; - -#ifdef __WARN_SUGGEST_FINAL_METHODS__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wsuggest-final-methods" -# pragma GCC diagnostic ignored "-Wsuggest-final-types" -#endif - namespace GameActions { - /** - * Common error codes for game actions. - */ - enum class Status : uint16_t - { - Ok, - InvalidParameters, - Disallowed, - GamePaused, - InsufficientFunds, - NotInEditorMode, - - NotOwned, - TooLow, - TooHigh, - NoClearance, - ItemAlreadyPlaced, - - NotClosed, - Broken, - - NoFreeElements, - - Unknown = UINT16_MAX, - }; - namespace Flags { constexpr uint16_t AllowWhilePaused = 1 << 0; @@ -114,55 +29,14 @@ namespace GameActions constexpr uint16_t EditorOnly = 1 << 2; } // namespace Flags - /** - * Represents the result of a game action query or execution. - */ - class Result - { - public: - using Ptr = std::unique_ptr; - - GameActions::Status Error = GameActions::Status::Ok; - StringVariant ErrorTitle; - StringVariant ErrorMessage; - std::array ErrorMessageArgs{}; - CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL }; - money32 Cost = 0; - ExpenditureType Expenditure = ExpenditureType::Count; - std::any ResultData; - - Result() = default; - Result(GameActions::Status error, rct_string_id message); - Result(GameActions::Status error, rct_string_id title, rct_string_id message); - Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args); - Result(const GameActions::Result&) = delete; - virtual ~Result(){}; - - std::string GetErrorTitle() const; - std::string GetErrorMessage() const; - - // It is recommended to use strong types since a type alias such as 'using MyType = uint32_t' - // is still just uint32_t, this guarantees the data is associated with the correct type. - template void SetData(const T&& data) - { - ResultData = std::forward(data); - } - - // This function will throw std::bad_any_cast if the type mismatches. - template T GetData() const - { - return std::any_cast(ResultData); - } - }; - - class ConstructClearResult final : public Result - { - public: - uint8_t GroundFlags{ 0 }; - }; - } // namespace GameActions +#ifdef __WARN_SUGGEST_FINAL_METHODS__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsuggest-final-methods" +# pragma GCC diagnostic ignored "-Wsuggest-final-types" +#endif + /** * */ diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp new file mode 100644 index 0000000000..b00fc39416 --- /dev/null +++ b/src/openrct2/actions/GameActionResult.cpp @@ -0,0 +1,56 @@ +#include "GameActionResult.h" + +#include "../localisation/Localisation.h" + +namespace GameActions +{ + Result::Result(GameActions::Status error, rct_string_id message) + { + Error = error; + ErrorMessage = message; + } + + Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message) + { + Error = error; + ErrorTitle = title; + ErrorMessage = message; + } + + Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args) + { + Error = error; + ErrorTitle = title; + ErrorMessage = message; + std::copy_n(args, ErrorMessageArgs.size(), ErrorMessageArgs.begin()); + } + + std::string GameActions::Result::GetErrorTitle() const + { + std::string title; + if (auto error = ErrorTitle.AsString()) + { + title = *error; + } + else + { + title = format_string(ErrorTitle.GetStringId(), ErrorMessageArgs.data()); + } + return title; + } + + std::string GameActions::Result::GetErrorMessage() const + { + std::string message; + if (auto error = ErrorMessage.AsString()) + { + message = *error; + } + else + { + message = format_string(ErrorMessage.GetStringId(), ErrorMessageArgs.data()); + } + return message; + } + +} // namespace GameActions diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h new file mode 100644 index 0000000000..9daab74d27 --- /dev/null +++ b/src/openrct2/actions/GameActionResult.h @@ -0,0 +1,161 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../localisation/StringIds.h" +#include "../management/Finance.h" +#include "../world/Location.hpp" + +#include +#include +#include +#include +#include +#include +#include + +class StringVariant +{ +private: + rct_string_id StringId = STR_NONE; + std::string String; + +public: + StringVariant() = default; + + StringVariant(rct_string_id stringId) + : StringId(stringId) + { + } + + StringVariant(const std::string& s) + : String(s) + { + } + + StringVariant(std::string&& s) + : String(std::move(s)) + { + } + + StringVariant(const char* s) + : String(s) + { + } + + const std::string* AsString() const + { + if (!String.empty()) + { + return &String; + } + return {}; + } + + const rct_string_id* AsStringId() const + { + if (String.empty()) + { + return &StringId; + } + return {}; + } + + rct_string_id GetStringId() const + { + return String.empty() ? StringId : STR_NONE; + } +}; + +namespace GameActions +{ + /** + * Common error codes for game actions. + */ + enum class Status : uint16_t + { + Ok, + InvalidParameters, + Disallowed, + GamePaused, + InsufficientFunds, + NotInEditorMode, + + NotOwned, + TooLow, + TooHigh, + NoClearance, + ItemAlreadyPlaced, + + NotClosed, + Broken, + + NoFreeElements, + + Unknown = std::numeric_limits>::max(), + }; + +#ifdef __WARN_SUGGEST_FINAL_METHODS__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsuggest-final-methods" +# pragma GCC diagnostic ignored "-Wsuggest-final-types" +#endif + + /** + * Represents the result of a game action query or execution. + */ + class Result + { + public: + using Ptr = std::unique_ptr; + + GameActions::Status Error = GameActions::Status::Ok; + StringVariant ErrorTitle; + StringVariant ErrorMessage; + std::array ErrorMessageArgs{}; + CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL }; + money32 Cost = 0; + ExpenditureType Expenditure = ExpenditureType::Count; + std::any ResultData; + + Result() = default; + Result(GameActions::Status error, rct_string_id message); + Result(GameActions::Status error, rct_string_id title, rct_string_id message); + Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args); + Result(const GameActions::Result&) = delete; + virtual ~Result(){}; + + std::string GetErrorTitle() const; + std::string GetErrorMessage() const; + + // It is recommended to use strong types since a type alias such as 'using MyType = uint32_t' + // is still just uint32_t, this guarantees the data is associated with the correct type. + template void SetData(const T&& data) + { + ResultData = std::forward(data); + } + + // This function will throw std::bad_any_cast if the type mismatches. + template T GetData() const + { + return std::any_cast(ResultData); + } + }; + +#ifdef __WARN_SUGGEST_FINAL_METHODS__ +# pragma GCC diagnostic pop +#endif + + class ConstructClearResult final : public Result + { + public: + uint8_t GroundFlags{ 0 }; + }; + +} // namespace GameActions diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 2e110ea5d6..26dcee802b 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -68,6 +68,7 @@ + @@ -519,6 +520,7 @@ + From e06f9c3ee70f492b7403d31a5038e34934bc8ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 05:15:24 -0700 Subject: [PATCH 565/681] Refactor result passing of TrackPlaceAction --- src/openrct2-ui/windows/RideConstruction.cpp | 12 +- src/openrct2/actions/TrackPlaceAction.cpp | 159 ++++++++++--------- src/openrct2/actions/TrackPlaceAction.h | 10 +- src/openrct2/windows/_legacy.cpp | 18 +-- 4 files changed, 103 insertions(+), 96 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index b34917ff6d..d582e02a56 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1664,8 +1664,8 @@ static void window_ride_construction_dropdown(rct_window* w, rct_widgetindex wid _currentTrackCurve = trackPiece | RideConstructionSpecialPieceSelected; window_ride_construction_update_active_elements(); } -static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const TrackPlaceActionResult* result); -static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const TrackPlaceActionResult* result); +static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); +static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); static void CloseConstructWindowOnCompletion(Ride* ride); static void CloseConstructWindowOnCompletion(Ride* ride) @@ -1687,7 +1687,7 @@ static void CloseConstructWindowOnCompletion(Ride* ride) } } -static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const TrackPlaceActionResult* result) +static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -1732,7 +1732,7 @@ static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, c CloseConstructWindowOnCompletion(ride); } -static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const TrackPlaceActionResult* result) +static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) { @@ -1833,8 +1833,8 @@ static void window_ride_construction_construct(rct_window* w) _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK_PLACE_ACTION_QUEUED; } - auto tpar = dynamic_cast(res.get()); - if (tpar != nullptr && tpar->GroundFlags & ELEMENT_IS_UNDERGROUND) + const auto resultData = res->GetData(); + if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) { viewport_set_visibility(1); } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index c1287a714b..ec46e18123 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -21,25 +21,6 @@ #include "RideSetSettingAction.h" using namespace OpenRCT2::TrackMetaData; -TrackPlaceActionResult::TrackPlaceActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE) -{ -} - -TrackPlaceActionResult::TrackPlaceActionResult(GameActions::Status error) - : GameActions::Result(error, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE) -{ -} - -TrackPlaceActionResult::TrackPlaceActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, message) -{ -} - -TrackPlaceActionResult::TrackPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args) - : GameActions::Result(error, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, message, args) -{ -} TrackPlaceAction::TrackPlaceAction( NetworkRideId_t rideIndex, int32_t trackType, const CoordsXYZD& origin, int32_t brakeSpeed, int32_t colour, @@ -87,42 +68,44 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (ride == nullptr) { log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } if (!direction_valid(_origin.direction)) { log_warning("Invalid direction for track placement, direction = %d", _origin.direction); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } - auto res = std::make_unique(); + auto res = MakeResult(); res->Expenditure = ExpenditureType::RideConstruction; res->Position.x = _origin.x + 16; res->Position.y = _origin.y + 16; res->Position.z = _origin.z; - res->GroundFlags = 0; + auto resultData = TrackPlaceActionResult{}; uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags; if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation) { - return std::make_unique(GameActions::Status::Disallowed, STR_NOT_ALLOWED_TO_MODIFY_STATION); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NOT_ALLOWED_TO_MODIFY_STATION); } if (!(GetActionFlags() & GameActions::Flags::AllowWhilePaused)) { if (game_is_paused() && !gCheatsBuildInPauseMode) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED); } } @@ -132,16 +115,18 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const { if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) { - return std::make_unique( - GameActions::Status::Disallowed, STR_ONLY_ONE_ON_RIDE_PHOTO_PER_RIDE); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_ONLY_ONE_ON_RIDE_PHOTO_PER_RIDE); } } else if (_trackType == TrackElemType::CableLiftHill) { if (ride->lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) { - return std::make_unique( - GameActions::Status::Disallowed, STR_ONLY_ONE_CABLE_LIFT_HILL_PER_RIDE); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_ONLY_ONE_CABLE_LIFT_HILL_PER_RIDE); } } // Backwards steep lift hills are allowed, even on roller coasters that do not support forwards steep lift hills. @@ -151,7 +136,9 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const const auto& ted = GetTrackElementDescriptor(_trackType); if (ted.Flags & TRACK_ELEM_FLAG_IS_STEEP_UP) { - return std::make_unique(GameActions::Status::Disallowed, STR_TOO_STEEP_FOR_LIFT_HILL); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TOO_STEEP_FOR_LIFT_HILL); } } } @@ -168,7 +155,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (!LocationValid(tileCoords) || (!map_is_location_owned(tileCoords) && !gCheatsSandboxMode)) { - return std::make_unique(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } numElements++; } @@ -176,7 +164,9 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (!CheckMapCapacity(numElements)) { log_warning("Not enough free map elements to place track."); - return std::make_unique(GameActions::Status::NoFreeElements, STR_TILE_ELEMENT_LIMIT_REACHED); + return MakeResult( + GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TILE_ELEMENT_LIMIT_REACHED); } if (!gCheatsAllowTrackPlaceInvalidHeights) @@ -185,16 +175,18 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const { if ((_origin.z & 0x0F) != 8) { - return std::make_unique( - GameActions::Status::InvalidParameters, STR_CONSTRUCTION_ERR_UNKNOWN); + return MakeResult( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CONSTRUCTION_ERR_UNKNOWN); } } else { if ((_origin.z & 0x0F) != 0) { - return std::make_unique( - GameActions::Status::InvalidParameters, STR_CONSTRUCTION_ERR_UNKNOWN); + return MakeResult( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CONSTRUCTION_ERR_UNKNOWN); } } } @@ -210,7 +202,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (mapLoc.z < 16) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_TOO_LOW); + return MakeResult( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_LOW); } int32_t baseZ = floor2(mapLoc.z, COORDS_Z_STEP); @@ -230,7 +223,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (clearanceZ > MAX_TRACK_HEIGHT) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_TOO_HIGH); + return MakeResult( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TOO_HIGH); } uint8_t crossingMode = (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS) @@ -257,19 +251,21 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } uint8_t mapGroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); - if (res->GroundFlags != 0 && (res->GroundFlags & mapGroundFlags) == 0) + if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } - res->GroundFlags = mapGroundFlags; + resultData.GroundFlags = mapGroundFlags; if (ted.Flags & TRACK_ELEM_FLAG_ONLY_ABOVE_GROUND) { - if (res->GroundFlags & ELEMENT_IS_UNDERGROUND) + if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); } } @@ -277,34 +273,40 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const { // No element has this flag if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_UNDERWATER); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_UNDERWATER); } } if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER && !gCheatsDisableClearanceChecks) { - return std::make_unique( - GameActions::Status::Disallowed, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !_trackDesignDrawingPreview) { auto surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + { + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + } auto waterHeight = surfaceElement->GetWaterHeight(); if (waterHeight == 0) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_WATER); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ON_WATER); } if (waterHeight != baseZ) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_WATER); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ON_WATER); } waterHeight -= LAND_HEIGHT_STEP; if (waterHeight == surfaceElement->GetBaseZ()) @@ -313,8 +315,9 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (slope == TILE_ELEMENT_SLOPE_W_CORNER_DN || slope == TILE_ELEMENT_SLOPE_S_CORNER_DN || slope == TILE_ELEMENT_SLOPE_E_CORNER_DN || slope == TILE_ELEMENT_SLOPE_N_CORNER_DN) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CAN_ONLY_BUILD_THIS_ON_WATER); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CAN_ONLY_BUILD_THIS_ON_WATER); } } } @@ -324,14 +327,17 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const { if (!track_add_station_element({ mapLoc, baseZ, _origin.direction }, _rideIndex, 0, _fromTrackDesign)) { - return std::make_unique(GameActions::Status::Unknown, gGameCommandErrorText); + return MakeResult( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, gGameCommandErrorText); } } // 6c5648 12 push auto surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + { + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + } if (!gCheatsDisableSupportLimits) { @@ -353,7 +359,9 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const ride_height /= COORDS_Z_PER_TINY_Z; if (ride_height > maxHeight && !_trackDesignDrawingPreview) { - return std::make_unique(GameActions::Status::Disallowed, STR_TOO_HIGH_FOR_SUPPORTS); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TOO_HIGH_FOR_SUPPORTS); } } } @@ -372,6 +380,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const price >>= 16; res->Cost = cost + ((price / 2) * 10); + res->SetData(std::move(resultData)); + return res; } @@ -381,23 +391,23 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const if (ride == nullptr) { log_warning("Invalid ride for track placement, rideIndex = %d", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { log_warning("Invalid ride subtype for track placement, rideIndex = %d", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } - auto res = std::make_unique(); + auto res = MakeResult(); res->Expenditure = ExpenditureType::RideConstruction; res->Position.x = _origin.x + 16; res->Position.y = _origin.y + 16; res->Position.z = _origin.z; - res->GroundFlags = 0; + auto resultData = TrackPlaceActionResult{}; uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags; @@ -466,18 +476,21 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } uint8_t mapGroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); - if (res->GroundFlags != 0 && (res->GroundFlags & mapGroundFlags) == 0) + if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { - return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); + return MakeResult( + GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_CANT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_GROUND); } - res->GroundFlags = mapGroundFlags; + resultData.GroundFlags = mapGroundFlags; // 6c5648 12 push auto surfaceElement = map_get_surface_element_at(mapLoc); if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + { + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + } int32_t supportHeight = baseZ - surfaceElement->GetBaseZ(); if (supportHeight < 0) @@ -552,7 +565,9 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const if (trackElement == nullptr) { log_warning("Cannot create track element for ride = %d", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::NoFreeElements); + return MakeResult( + GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TILE_ELEMENT_LIMIT_REACHED); } trackElement->SetClearanceZ(clearanceZ); @@ -659,6 +674,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const price >>= 16; res->Cost = cost + ((price / 2) * 10); + res->SetData(std::move(resultData)); + return res; } diff --git a/src/openrct2/actions/TrackPlaceAction.h b/src/openrct2/actions/TrackPlaceAction.h index 8692372f16..2b2a59b8f1 100644 --- a/src/openrct2/actions/TrackPlaceAction.h +++ b/src/openrct2/actions/TrackPlaceAction.h @@ -11,18 +11,12 @@ #include "GameAction.h" -class TrackPlaceActionResult final : public GameActions::Result +struct TrackPlaceActionResult { -public: - TrackPlaceActionResult(); - TrackPlaceActionResult(GameActions::Status error); - TrackPlaceActionResult(GameActions::Status error, rct_string_id message); - TrackPlaceActionResult(GameActions::Status error, rct_string_id message, uint8_t* args); - uint8_t GroundFlags{ 0 }; }; -DEFINE_GAME_ACTION(TrackPlaceAction, GameCommand::PlaceTrack, TrackPlaceActionResult) +DEFINE_GAME_ACTION(TrackPlaceAction, GameCommand::PlaceTrack, GameActions::Result) { private: NetworkRideId_t _rideIndex{ RIDE_ID_NULL }; diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 96f0a9e519..df54293b1b 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -51,13 +51,12 @@ money32 place_provisional_track_piece( if (ride == nullptr) return MONEY32_UNDEFINED; - money32 result; ride_construction_remove_ghosts(); if (ride->type == RIDE_TYPE_MAZE) { int32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; // 105 - result = maze_set_track(trackPos.x, trackPos.y, trackPos.z, flags, true, 0, rideIndex, GC_SET_MAZE_TRACK_BUILD); + auto result = maze_set_track(trackPos.x, trackPos.y, trackPos.z, flags, true, 0, rideIndex, GC_SET_MAZE_TRACK_BUILD); if (result == MONEY32_UNDEFINED) return result; @@ -84,10 +83,8 @@ money32 place_provisional_track_piece( trackPlaceAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); // This command must not be sent over the network auto res = GameActions::Execute(&trackPlaceAction); - auto tpar = dynamic_cast(res.get()); - result = ((tpar == nullptr) || (res->Error == GameActions::Status::Ok)) ? res->Cost : MONEY32_UNDEFINED; - if (result == MONEY32_UNDEFINED) - return result; + if (res->Error != GameActions::Status::Ok) + return MONEY32_UNDEFINED; int16_t z_begin, z_end; const auto& ted = GetTrackElementDescriptor(trackType); @@ -104,10 +101,9 @@ money32 place_provisional_track_piece( _unkF440C5 = { trackPos.x, trackPos.y, trackPos.z + z_begin, static_cast(trackDirection) }; _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK; - if (tpar != nullptr) - { - viewport_set_visibility((tpar->GroundFlags & ELEMENT_IS_UNDERGROUND) ? 1 : 3); - } + + const auto resultData = res->GetData(); + viewport_set_visibility((resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) ? 1 : 3); if (_currentTrackSlopeEnd != 0) viewport_set_visibility(2); @@ -120,7 +116,7 @@ money32 place_provisional_track_piece( virtual_floor_set_height(trackPos.z - z_begin + z_end); } - return result; + return res->Cost; } static std::tuple window_ride_construction_update_state_get_track_element() From 8e06d84a09cf0dff5a060a7532d0b001c9a82d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 16 Oct 2021 22:24:38 +0300 Subject: [PATCH 566/681] Refactor result passing of TrackDesignAction --- src/openrct2-ui/windows/TrackDesignPlace.cpp | 13 ++++---- src/openrct2/actions/TrackDesignAction.cpp | 35 +++++--------------- src/openrct2/actions/TrackDesignAction.h | 13 +------- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 44397b4ceb..24943c1148 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -289,10 +289,10 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI // Valid location found. Place the ghost at the location. auto tdAction = TrackDesignAction({ trackLoc, _currentTrackPieceDirection }, *_trackDesign); tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); - tdAction.SetCallback([trackLoc](const GameAction*, const TrackDesignActionResult* result) { + tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - _window_track_place_ride_index = result->rideIndex; + _window_track_place_ride_index = result->GetData(); _windowTrackPlaceLastValid = trackLoc; _window_track_place_last_was_valid = true; } @@ -336,20 +336,21 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd if (res->Error == GameActions::Status::Ok) { auto tdAction = TrackDesignAction({ trackLoc, _currentTrackPieceDirection }, *_trackDesign); - tdAction.SetCallback([trackLoc](const GameAction*, const TrackDesignActionResult* result) { + tdAction.SetCallback([trackLoc](const GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - auto ride = get_ride(result->rideIndex); + const auto rideId = result->GetData(); + auto ride = get_ride(rideId); if (ride != nullptr) { window_close_by_class(WC_ERROR); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc); - _currentRideIndex = result->rideIndex; + _currentRideIndex = rideId; if (track_design_are_entrance_and_exit_placed()) { auto intent = Intent(WC_RIDE); - intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(result->rideIndex)); + intent.putExtra(INTENT_EXTRA_RIDE_ID, static_cast(rideId)); context_open_intent(&intent); auto wnd = window_find_by_class(WC_TRACK_DESIGN_PLACE); window_close(wnd); diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 75e2637809..3391960181 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -27,26 +27,6 @@ static int32_t place_virtual_track( return place_virtual_track(const_cast(&td6), ptdOperation, placeScenery, ride, loc); } -TrackDesignActionResult::TrackDesignActionResult() - : GameActions::Result(GameActions::Status::Ok, STR_NONE) -{ -} - -TrackDesignActionResult::TrackDesignActionResult(GameActions::Status error) - : GameActions::Result(error, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE) -{ -} - -TrackDesignActionResult::TrackDesignActionResult(GameActions::Status error, rct_string_id title, rct_string_id message) - : GameActions::Result(error, title, message) -{ -} - -TrackDesignActionResult::TrackDesignActionResult(GameActions::Status error, rct_string_id message) - : GameActions::Result(error, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, message) -{ -} - TrackDesignAction::TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td) : _loc(location) , _td(td) @@ -83,7 +63,7 @@ GameActions::Result::Ptr TrackDesignAction::Query() const if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); @@ -112,7 +92,7 @@ GameActions::Result::Ptr TrackDesignAction::Query() const if (ride == nullptr) { log_warning("Invalid game command for track placement, ride id = %d", rideIndex); - return MakeResult(GameActions::Status::Unknown); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } money32 cost = 0; @@ -132,9 +112,11 @@ GameActions::Result::Ptr TrackDesignAction::Query() const GameActions::ExecuteNested(&gameAction); if (cost == MONEY32_UNDEFINED) { - return MakeResult(GameActions::Status::Disallowed, error_reason); + return MakeResult(GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, error_reason); } res->Cost = cost; + res->SetData(ride_id_t{ RIDE_ID_NULL }); + return res; } @@ -172,7 +154,7 @@ GameActions::Result::Ptr TrackDesignAction::Execute() const if (ride == nullptr) { log_warning("Invalid game command for track placement, ride id = %d", rideIndex); - return MakeResult(GameActions::Status::Unknown); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } money32 cost = 0; @@ -210,7 +192,7 @@ GameActions::Result::Ptr TrackDesignAction::Execute() const gameAction.SetFlags(GetFlags()); GameActions::ExecuteNested(&gameAction); - return MakeResult(GameActions::Status::Disallowed, error_reason); + return MakeResult(GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, error_reason); } if (entryIndex != OBJECT_ENTRY_INDEX_NULL) @@ -269,6 +251,7 @@ GameActions::Result::Ptr TrackDesignAction::Execute() const r = GameActions::ExecuteNested(&gameAction); } res->Cost = cost; - res->rideIndex = ride->id; + res->SetData(ride_id_t{ ride->id }); + return res; } diff --git a/src/openrct2/actions/TrackDesignAction.h b/src/openrct2/actions/TrackDesignAction.h index 1390bc3627..8ce73431f0 100644 --- a/src/openrct2/actions/TrackDesignAction.h +++ b/src/openrct2/actions/TrackDesignAction.h @@ -12,18 +12,7 @@ #include "../ride/TrackDesign.h" #include "GameAction.h" -class TrackDesignActionResult final : public GameActions::Result -{ -public: - TrackDesignActionResult(); - TrackDesignActionResult(GameActions::Status error); - TrackDesignActionResult(GameActions::Status error, rct_string_id title, rct_string_id message); - TrackDesignActionResult(GameActions::Status error, rct_string_id message); - - ride_id_t rideIndex = RIDE_ID_NULL; -}; - -DEFINE_GAME_ACTION(TrackDesignAction, GameCommand::PlaceTrackDesign, TrackDesignActionResult) +DEFINE_GAME_ACTION(TrackDesignAction, GameCommand::PlaceTrackDesign, GameActions::Result) { private: CoordsXYZD _loc; From f6cb144f8ce8838dcbd0ad23e6aae0f9f84da0f2 Mon Sep 17 00:00:00 2001 From: seanmajorpayne <4562746+seanmajorpayne@users.noreply.github.com> Date: Wed, 20 Oct 2021 22:11:06 +0900 Subject: [PATCH 567/681] Fix #15322: Circus Music is Not Playing (Full Fix) --- distribution/changelog.txt | 3 +- src/openrct2/ride/Ride.cpp | 113 +++++++++++++++++++++++++------------ 2 files changed, 80 insertions(+), 36 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index dbe17103cc..39fa549daa 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -30,8 +30,9 @@ - Fix: [#15255] Tile Inspector shows banner information on walls that do not contain one. - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. -- Fix: [#15451] Guest list name filter remains after group selection. +- Fix: [#15322] Circus music doesn't play. - Fix: [#15377] Entrance/exit ghost doesn't work on different stations without touching them first. +- Fix: [#15451] Guest list name filter remains after group selection. - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15490] Tile inspector needlessly updates clearance height when changing surface slopes. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 602d9a417c..9e62de1cd6 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1753,35 +1753,30 @@ Staff* ride_get_assigned_mechanic(Ride* ride) /** * - * rct2: 0x006ABE85 + * Calculates the sample rate for ride music. */ -static void ride_music_update(Ride* ride) +static int32_t RideMusicSampleRate(Ride* ride) { - // The circus does not have music in the normal sense - its “music” is a sound effect. - if (ride->type == RIDE_TYPE_CIRCUS) - { - Vehicle* vehicle = GetEntity(ride->vehicles[0]); - if (vehicle == nullptr || vehicle->status != Vehicle::Status::DoingCircusShow) - { - ride->music_tune_id = 255; - return; - } - } - else - { - const auto& rtd = ride->GetRideTypeDescriptor(); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) - { - return; - } + int32_t sampleRate = 22050; - if (ride->status != RideStatus::Open || !(ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) - { - ride->music_tune_id = 255; - return; - } + // Alter sample rate for a power cut effect + if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) + { + sampleRate = ride->breakdown_sound_modifier * 70; + if (ride->breakdown_reason_pending != BREAKDOWN_CONTROL_FAILURE) + sampleRate *= -1; + sampleRate += 22050; } + return sampleRate; +} + +/** + * + * Ride music slows down upon breaking. If it's completely broken, no music should play. + */ +static bool RideMusicBreakdownEffect(Ride* ride) +{ // Oscillate parameters for a power cut effect when breaking down if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) { @@ -1804,10 +1799,67 @@ static void ride_music_update(Ride* ride) if (ride->breakdown_sound_modifier == 255) { ride->music_tune_id = 255; - return; + return true; } } } + return false; +} + +/** + * + * Circus music is a sound effect, rather than music. Needs separate processing. + */ +static void CircusMusicUpdate(Ride* ride) +{ + Vehicle* vehicle = GetEntity(ride->vehicles[0]); + if (vehicle == nullptr || vehicle->status != Vehicle::Status::DoingCircusShow) + { + ride->music_position = 0; + ride->music_tune_id = 255; + return; + } + + if (RideMusicBreakdownEffect(ride)) + { + return; + } + + CoordsXYZ rideCoords = ride->stations[0].GetStart().ToTileCentre(); + + const auto sampleRate = RideMusicSampleRate(ride); + + OpenRCT2::RideAudio::UpdateMusicInstance(*ride, rideCoords, sampleRate); +} + +/** + * + * rct2: 0x006ABE85 + */ +static void ride_music_update(Ride* ride) +{ + if (ride->type == RIDE_TYPE_CIRCUS) + { + CircusMusicUpdate(ride); + return; + } + + const auto& rtd = ride->GetRideTypeDescriptor(); + if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + return; + } + + if (ride->status != RideStatus::Open || !(ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC)) + { + ride->music_tune_id = 255; + return; + } + + if (RideMusicBreakdownEffect(ride)) + { + return; + } // Select random tune from available tunes for a music style (of course only merry-go-rounds have more than one tune) if (ride->music_tune_id == 255) @@ -1825,16 +1877,7 @@ static void ride_music_update(Ride* ride) CoordsXYZ rideCoords = ride->stations[0].GetStart().ToTileCentre(); - int32_t sampleRate = 22050; - - // Alter sample rate for a power cut effect - if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)) - { - sampleRate = ride->breakdown_sound_modifier * 70; - if (ride->breakdown_reason_pending != BREAKDOWN_CONTROL_FAILURE) - sampleRate *= -1; - sampleRate += 22050; - } + int32_t sampleRate = RideMusicSampleRate(ride); OpenRCT2::RideAudio::UpdateMusicInstance(*ride, rideCoords, sampleRate); } From 7fc49fca39202d04f13aa4c310ef6f1572f9836d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 00:50:34 +0300 Subject: [PATCH 568/681] Replace StringVariant with std::variant --- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 4 +- src/openrct2/actions/GameActionCompat.cpp | 5 +- src/openrct2/actions/GameActionResult.cpp | 36 ++++++------ src/openrct2/actions/GameActionResult.h | 55 +------------------ src/openrct2/actions/LandSetHeightAction.cpp | 5 +- src/openrct2/actions/LandSmoothAction.cpp | 2 +- src/openrct2/actions/MazeSetTrackAction.cpp | 5 +- .../actions/PlaceParkEntranceAction.cpp | 5 +- src/openrct2/actions/WaterSetHeightAction.cpp | 3 +- src/openrct2/peep/Peep.cpp | 11 ++-- 11 files changed, 38 insertions(+), 95 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index d582e02a56..87a07a6d5d 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1810,7 +1810,7 @@ static void window_ride_construction_construct(rct_window* w) // Used by some functions if (res->Error != GameActions::Status::Ok) { - if (auto error = res->ErrorMessage.AsStringId()) + if (auto* error = std::get_if(&res->ErrorMessage)) gGameCommandErrorText = *error; else gGameCommandErrorText = STR_NONE; diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 0fa790d3bb..e9c3ac91d2 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1905,7 +1905,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos break; } - if (auto message = res->ErrorMessage.AsStringId()) + if (const auto* message = std::get_if(&res->ErrorMessage)) { if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) { @@ -1958,7 +1958,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos break; } - if (auto message = res->ErrorMessage.AsStringId()) + if (const auto* message = std::get_if(&res->ErrorMessage)) { if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) { diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index d33c82df83..6aebf1433c 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -144,11 +144,12 @@ money32 maze_set_track( // NOTE: ride_construction_tooldown_construct requires them to be set. // Refactor result type once there's no C code referencing this function. - if (auto title = res->ErrorTitle.AsStringId()) + if (const auto* title = std::get_if(&res->ErrorTitle)) gGameCommandErrorTitle = *title; else gGameCommandErrorTitle = STR_NONE; - if (auto message = res->ErrorMessage.AsStringId()) + + if (const auto* message = std::get_if(&res->ErrorMessage)) gGameCommandErrorText = *message; else gGameCommandErrorText = STR_NONE; diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp index b00fc39416..7bdfb75812 100644 --- a/src/openrct2/actions/GameActionResult.cpp +++ b/src/openrct2/actions/GameActionResult.cpp @@ -25,32 +25,28 @@ namespace GameActions std::copy_n(args, ErrorMessageArgs.size(), ErrorMessageArgs.begin()); } + struct StringVariantVisitor + { + const void* ErrorMessageArgs{}; + + std::string operator()(const std::string& str) const + { + return str; + } + std::string operator()(const rct_string_id strId) const + { + return format_string(strId, ErrorMessageArgs); + } + }; + std::string GameActions::Result::GetErrorTitle() const { - std::string title; - if (auto error = ErrorTitle.AsString()) - { - title = *error; - } - else - { - title = format_string(ErrorTitle.GetStringId(), ErrorMessageArgs.data()); - } - return title; + return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorTitle); } std::string GameActions::Result::GetErrorMessage() const { - std::string message; - if (auto error = ErrorMessage.AsString()) - { - message = *error; - } - else - { - message = format_string(ErrorMessage.GetStringId(), ErrorMessageArgs.data()); - } - return message; + return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorMessage); } } // namespace GameActions diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 9daab74d27..d480dfe698 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -19,59 +19,7 @@ #include #include #include - -class StringVariant -{ -private: - rct_string_id StringId = STR_NONE; - std::string String; - -public: - StringVariant() = default; - - StringVariant(rct_string_id stringId) - : StringId(stringId) - { - } - - StringVariant(const std::string& s) - : String(s) - { - } - - StringVariant(std::string&& s) - : String(std::move(s)) - { - } - - StringVariant(const char* s) - : String(s) - { - } - - const std::string* AsString() const - { - if (!String.empty()) - { - return &String; - } - return {}; - } - - const rct_string_id* AsStringId() const - { - if (String.empty()) - { - return &StringId; - } - return {}; - } - - rct_string_id GetStringId() const - { - return String.empty() ? StringId : STR_NONE; - } -}; +#include namespace GameActions { @@ -114,6 +62,7 @@ namespace GameActions { public: using Ptr = std::unique_ptr; + using StringVariant = std::variant; GameActions::Status Error = GameActions::Status::Ok; StringVariant ErrorTitle; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index e4cbc8ccbb..02c6c35b02 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -130,9 +130,8 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const CREATE_CROSSING_MODE_NONE); if (clearResult->Error != GameActions::Status::Ok) { - return std::make_unique( - GameActions::Status::Disallowed, STR_NONE, clearResult->ErrorMessage.GetStringId(), - clearResult->ErrorMessageArgs.data()); + clearResult->Error = GameActions::Status::Disallowed; + return clearResult; } tileElement = CheckUnremovableObstructions(reinterpret_cast(surfaceElement), zCorner); diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 0bee3b6253..7e8c432099 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -608,7 +608,7 @@ GameActions::Result::Ptr LandSmoothAction::SmoothLand(bool isExecuting) const } default: log_error("Invalid map selection %u", _selectionType); - return MakeResult(GameActions::Status::InvalidParameters, res->ErrorTitle.GetStringId()); + return MakeResult(GameActions::Status::InvalidParameters, std::get(res->ErrorTitle)); } // switch selectionType // Raise / lower the land tool selection area diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 3605a425d7..2d740b4de6 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -109,9 +109,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const auto constructResult = MapCanConstructAt({ _loc.ToTileStart(), baseHeight, clearanceHeight }, { 0b1111, 0 }); if (constructResult->Error != GameActions::Status::Ok) { - return MakeResult( - GameActions::Status::NoClearance, res->ErrorTitle.GetStringId(), constructResult->ErrorMessage.GetStringId(), - constructResult->ErrorMessageArgs.data()); + constructResult->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE; + return constructResult; } if (constructResult->GroundFlags & ELEMENT_IS_UNDERWATER) diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 5ef8207e34..0603218380 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -86,9 +86,8 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Query() const if (auto res2 = MapCanConstructAt({ entranceLoc, zLow, zHigh }, { 0b1111, 0 }); res2->Error != GameActions::Status::Ok) { - return std::make_unique( - GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, res2->ErrorMessage.GetStringId(), - res2->ErrorMessageArgs.data()); + res2->ErrorTitle = STR_CANT_BUILD_THIS_HERE; + return res2; } // Check that entrance element does not already exist at this location diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index bf4eb860c2..523ab0b358 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -85,8 +85,7 @@ GameActions::Result::Ptr WaterSetHeightAction::Query() const if (auto res2 = MapCanConstructAt({ _coords, zLow, zHigh }, { 0b1111, 0b1111 }); res2->Error != GameActions::Status::Ok) { - return MakeResult( - GameActions::Status::NoClearance, STR_NONE, res2->ErrorMessage.GetStringId(), res2->ErrorMessageArgs.data()); + return res2; } if (surfaceElement->HasTrackThatNeedsWater()) { diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 620498252c..dd18031c90 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -579,9 +579,10 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, { tileElement = reinterpret_cast(map_get_surface_element_at(location.ToCoordsXYZ())); } - if (tileElement == nullptr) + { return std::make_unique(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + } // Set the coordinate of destination to be exactly // in the middle of a tile. @@ -595,13 +596,13 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 }); res->Error != GameActions::Status::Ok) { - if (res->ErrorMessage.GetStringId() != STR_RAISE_OR_LOWER_LAND_FIRST) + const auto stringId = std::get(res->ErrorMessage); + if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST) { - if (res->ErrorMessage.GetStringId() != STR_FOOTPATH_IN_THE_WAY) + if (stringId != STR_FOOTPATH_IN_THE_WAY) { return std::make_unique( - GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, res->ErrorMessage.GetStringId(), - res->ErrorMessageArgs.data()); + GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res->ErrorMessageArgs.data()); } } } From 5bf3513156890c1566247121afe431cf6c8a9dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 01:10:25 +0300 Subject: [PATCH 569/681] Default initialize ErrorTitle and ErrorMessage with STR_NONE --- src/openrct2/actions/GameActionResult.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index d480dfe698..e50e756ba7 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -65,8 +65,8 @@ namespace GameActions using StringVariant = std::variant; GameActions::Status Error = GameActions::Status::Ok; - StringVariant ErrorTitle; - StringVariant ErrorMessage; + StringVariant ErrorTitle = STR_NONE; + StringVariant ErrorMessage = STR_NONE; std::array ErrorMessageArgs{}; CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL }; money32 Cost = 0; From 4d72c29ca31c30cd89b22db00ffb94652583e196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 01:50:22 +0300 Subject: [PATCH 570/681] Specify underlying type for rct_string_id --- src/openrct2/localisation/StringIds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index b99e4d82f8..4a442a83d7 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -14,7 +14,7 @@ constexpr const rct_string_id STR_NONE = 0xFFFF; constexpr const rct_string_id STR_VIEWPORT = 0xFFFE; -enum +enum : uint16_t { STR_EMPTY = 0, STR_RIDE_NAME_DEFAULT = 1, From 3325898e2584a74c6d62afe021e41b3157df4f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:37:32 +0300 Subject: [PATCH 571/681] Apply review suggestions --- src/openrct2/peep/Peep.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index dd18031c90..e5b1ba67d8 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -597,13 +597,10 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, res->Error != GameActions::Status::Ok) { const auto stringId = std::get(res->ErrorMessage); - if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST) + if (stringId != STR_RAISE_OR_LOWER_LAND_FIRST && stringId != STR_FOOTPATH_IN_THE_WAY) { - if (stringId != STR_FOOTPATH_IN_THE_WAY) - { - return std::make_unique( - GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res->ErrorMessageArgs.data()); - } + return std::make_unique( + GameActions::Status::NoClearance, STR_ERR_CANT_PLACE_PERSON_HERE, stringId, res->ErrorMessageArgs.data()); } } From 6f28f3e516d6c5a5b6db56f81e20c6f3eb50eadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 02:10:56 +0300 Subject: [PATCH 572/681] Backport ImageTable changes Co-authored-by: Ted John --- src/openrct2/drawing/ImageImporter.cpp | 58 ++++++++++++++-------- src/openrct2/drawing/ImageImporter.h | 6 ++- src/openrct2/object/ImageTable.cpp | 69 ++++++++++++++++++++++---- src/openrct2/object/ImageTable.h | 4 +- 4 files changed, 105 insertions(+), 32 deletions(-) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index 3f578faf49..007c431e01 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -23,7 +23,14 @@ constexpr int32_t PALETTE_TRANSPARENT = -1; ImportResult ImageImporter::Import( const Image& image, int32_t offsetX, int32_t offsetY, IMPORT_FLAGS flags, IMPORT_MODE mode) const { - if (image.Width > 256 || image.Height > 256) + return Import(image, 0, 0, image.Width, image.Height, offsetX, offsetY, flags, mode); +} + +ImportResult ImageImporter::Import( + const Image& image, int32_t srcX, int32_t srcY, int32_t width, int32_t height, int32_t offsetX, int32_t offsetY, + IMPORT_FLAGS flags, IMPORT_MODE mode) const +{ + if (width > 256 || height > 256) { throw std::invalid_argument("Only images 256x256 or less are supported."); } @@ -33,10 +40,7 @@ ImportResult ImageImporter::Import( throw std::invalid_argument("Image is not paletted, it has bit depth of " + std::to_string(image.Depth)); } - const auto width = image.Width; - const auto height = image.Height; - - auto pixels = GetPixels(image.Pixels.data(), width, height, flags, mode); + auto pixels = GetPixels(image.Pixels.data(), image.Stride, srcX, srcY, width, height, flags, mode); auto buffer = flags & IMPORT_FLAGS::RLE ? EncodeRLE(pixels.data(), width, height) : EncodeRaw(pixels.data(), width, height); rct_g1_element outElement; @@ -55,7 +59,8 @@ ImportResult ImageImporter::Import( } std::vector ImageImporter::GetPixels( - const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode) + const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, IMPORT_FLAGS flags, + IMPORT_MODE mode) { std::vector buffer; buffer.reserve(width * height); @@ -71,35 +76,48 @@ std::vector ImageImporter::GetPixels( auto rgbaSrc = rgbaSrcBuffer.get(); if (!(flags & IMPORT_FLAGS::KEEP_PALETTE)) { - for (uint32_t x = 0; x < height * width * 4; x++) + auto src = pixels + (srcY * pitch) + (srcX * 4); + auto dst = rgbaSrc; + for (uint32_t y = 0; y < height; y++) { - rgbaSrc[x] = static_cast(pixels[x]); + for (uint32_t x = 0; x < width * 4; x++) + { + *dst = static_cast(*src); + src++; + dst++; + } + src += (pitch - (width * 4)); } } - for (uint32_t y = 0; y < height; y++) + if (flags & IMPORT_FLAGS::KEEP_PALETTE) { - for (uint32_t x = 0; x < width; x++) + for (uint32_t y = 0; y < height; y++) { - int32_t paletteIndex; - if (flags & IMPORT_FLAGS::KEEP_PALETTE) + for (uint32_t x = 0; x < width; x++) { - paletteIndex = *palettedSrc; + int32_t paletteIndex = *palettedSrc; // The 1st index is always transparent if (paletteIndex == 0) { paletteIndex = PALETTE_TRANSPARENT; } + palettedSrc += 1; + buffer.push_back(paletteIndex); } - else + palettedSrc += (pitch - width); + } + } + else + { + for (uint32_t y = 0; y < height; y++) + { + for (uint32_t x = 0; x < width; x++) { - paletteIndex = CalculatePaletteIndex(mode, rgbaSrc, x, y, width, height); + auto paletteIndex = CalculatePaletteIndex(mode, rgbaSrc, x, y, width, height); + rgbaSrc += 4; + buffer.push_back(paletteIndex); } - - rgbaSrc += 4; - palettedSrc += 1; - - buffer.push_back(paletteIndex); } } diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index 70e61b046f..1ff1bc37d8 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -45,6 +45,9 @@ namespace OpenRCT2::Drawing RLE = 1 << 1, }; + ImportResult Import( + const Image& image, int32_t srcX, int32_t srcY, int32_t width, int32_t height, int32_t offsetX, int32_t offsetY, + IMPORT_FLAGS flags = IMPORT_FLAGS::NONE, IMPORT_MODE mode = IMPORT_MODE::DEFAULT) const; ImportResult Import( const Image& image, int32_t offsetX = 0, int32_t offsetY = 0, IMPORT_FLAGS flags = IMPORT_FLAGS::NONE, IMPORT_MODE mode = IMPORT_MODE::DEFAULT) const; @@ -60,7 +63,8 @@ namespace OpenRCT2::Drawing }; static std::vector GetPixels( - const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode); + const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, + IMPORT_FLAGS flags, IMPORT_MODE 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); diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index fcf243bc6c..cf821576e6 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -132,7 +132,7 @@ std::vector> ImageTable::ParseImages( try { auto imageData = context->GetData(s); - auto image = Imaging::ReadFromBuffer(imageData, IMAGE_FORMAT::PNG_32); + auto image = Imaging::ReadFromBuffer(imageData); ImageImporter importer; auto importResult = importer.Import(image, 0, 0, ImageImporter::IMPORT_FLAGS::RLE); @@ -149,14 +149,21 @@ std::vector> ImageTable::ParseImages( return result; } -std::vector> ImageTable::ParseImages(IReadObjectContext* context, json_t& el) +std::vector> ImageTable::ParseImages( + IReadObjectContext* context, std::vector>& imageSources, json_t& el) { 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"]); std::vector> result; try @@ -166,15 +173,31 @@ std::vector> ImageTable::ParseImages( { flags = static_cast(flags | ImageImporter::IMPORT_FLAGS::RLE); } - auto imageData = context->GetData(path); - auto image = Imaging::ReadFromBuffer(imageData, IMAGE_FORMAT::PNG_32); + if (keepPalette) + { + flags = static_cast(flags | ImageImporter::IMPORT_FLAGS::KEEP_PALETTE); + } + + auto itSource = std::find_if( + imageSources.begin(), imageSources.end(), + [&path](const std::pair& item) { return item.first == path; }); + if (itSource == imageSources.end()) + { + throw std::runtime_error("Unable to find image in image source list."); + } + auto& image = itSource->second; + + if (srcWidth == 0) + srcWidth = image.Width; + + if (srcHeight == 0) + srcHeight = image.Height; ImageImporter importer; - auto importResult = importer.Import(image, 0, 0, flags); - auto g1Element = importResult.Element; - g1Element.x_offset = x; - g1Element.y_offset = y; - result.push_back(std::make_unique(g1Element)); + auto importResult = importer.Import(image, srcX, srcY, srcWidth, srcHeight, x, y, flags); + auto g1element = importResult.Element; + g1element.zoomed_offset = zoomOffset; + result.push_back(std::make_unique(g1element)); } catch (const std::exception& e) { @@ -385,6 +408,31 @@ void ImageTable::Read(IReadObjectContext* context, OpenRCT2::IStream* stream) } } +std::vector> ImageTable::GetImageSources(IReadObjectContext* context, json_t& jsonImages) +{ + std::vector> result; + for (auto& jsonImage : jsonImages) + { + if (jsonImage.is_object()) + { + auto path = Json::GetString(jsonImage["path"]); + auto keepPalette = Json::GetString(jsonImage["palette"]) == "keep"; + auto itSource = std::find_if(result.begin(), result.end(), [&path](const std::pair& item) { + return item.first == path; + }); + if (itSource == result.end()) + { + auto imageData = context->GetData(path); + auto imageFormat = keepPalette ? IMAGE_FORMAT::PNG : IMAGE_FORMAT::PNG_32; + auto image = Imaging::ReadFromBuffer(imageData, imageFormat); + auto pair = std::make_pair(std::move(path), std::move(image)); + result.push_back(std::move(pair)); + } + } + } + return result; +} + void ImageTable::ReadJson(IReadObjectContext* context, json_t& root) { Guard::Assert(root.is_object(), "ImageTable::ReadJson expects parameter root to be object"); @@ -394,6 +442,7 @@ void ImageTable::ReadJson(IReadObjectContext* context, json_t& root) // First gather all the required images from inspecting the JSON std::vector> allImages; auto jsonImages = root["images"]; + auto imageSources = GetImageSources(context, jsonImages); for (auto& jsonImage : jsonImages) { @@ -406,7 +455,7 @@ void ImageTable::ReadJson(IReadObjectContext* context, json_t& root) } else if (jsonImage.is_object()) { - auto images = ParseImages(context, jsonImage); + auto images = ParseImages(context, imageSources, jsonImage); allImages.insert( allImages.end(), std::make_move_iterator(images.begin()), std::make_move_iterator(images.end())); } diff --git a/src/openrct2/object/ImageTable.h b/src/openrct2/object/ImageTable.h index dcad67643f..2d68fbce68 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -16,6 +16,7 @@ #include #include +struct Image; struct IReadObjectContext; namespace OpenRCT2 { @@ -32,13 +33,14 @@ private: * Container for a G1 image, additional information and RAII. Used by ReadJson */ struct RequiredImage; + [[nodiscard]] std::vector> GetImageSources(IReadObjectContext* context, json_t& jsonImages); [[nodiscard]] static std::vector> ParseImages( IReadObjectContext* context, std::string s); /** * @note root is deliberately left non-const: json_t behaviour changes when const */ [[nodiscard]] static std::vector> ParseImages( - IReadObjectContext* context, json_t& el); + IReadObjectContext* context, std::vector>& imageSources, json_t& el); [[nodiscard]] static std::vector> LoadObjectImages( IReadObjectContext* context, const std::string& name, const std::vector& range); [[nodiscard]] static std::vector ParseRange(std::string s); From 578d8ce24785a3b312d1d2c5e9f8a57ee2901a6e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 20 Oct 2021 16:15:35 +0200 Subject: [PATCH 573/681] Fix #15612: Crash in WallCheckObstruction() --- distribution/changelog.txt | 1 + src/openrct2/actions/WallPlaceAction.cpp | 29 ++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 39fa549daa..91838f3c8a 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -43,6 +43,7 @@ - Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). - Fix: [#15582] [Plugin] Litter properties return incorrect values. - Fix: [#15584] Ride income underflows when on-ride photos are making losses. +- Fix: [#15612] Crash when placing walls beside certain scenery objects. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 64074863ab..fca2f02f11 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -486,9 +486,6 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( WallSceneryEntry* wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const { - int32_t entryType, sequence; - rct_large_scenery_tile* tile; - *wallAcrossTrack = false; if (map_is_location_at_edge(_loc)) { @@ -537,24 +534,28 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( break; case TILE_ELEMENT_TYPE_LARGE_SCENERY: { - entryType = tileElement->AsLargeScenery()->GetEntryIndex(); - sequence = tileElement->AsLargeScenery()->GetSequenceIndex(); - auto* sceneryEntry = get_large_scenery_entry(entryType); - tile = &sceneryEntry->tiles[sequence]; + const auto* largeSceneryElement = tileElement->AsLargeScenery(); + const auto* sceneryEntry = largeSceneryElement->GetEntry(); + + // If there is no entry, assume the object is not in the way. + if (sceneryEntry == nullptr) + break; + + auto sequence = largeSceneryElement->GetSequenceIndex(); + const rct_large_scenery_tile& tile = sceneryEntry->tiles[sequence]; + + int32_t direction = ((_edge - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK) + 8; + if (!(tile.flags & (1 << direction))) { - int32_t direction = ((_edge - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK) + 8; - if (!(tile->flags & (1 << direction))) - { - map_obstruction_set_error_text(tileElement, *res); - return res; - } + map_obstruction_set_error_text(tileElement, *res); + return res; } break; } case TILE_ELEMENT_TYPE_SMALL_SCENERY: { auto sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) + if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) { map_obstruction_set_error_text(tileElement, *res); return res; From 6a219b2481db3627f9815e7bff3f958ef6adbbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 19:02:15 +0300 Subject: [PATCH 574/681] Fix #15006: Prevent allocating empty texture atlases --- src/openrct2-ui/drawing/engines/opengl/TextureCache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index 474092769a..416a4a2ddd 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -101,8 +101,8 @@ public: _atlasWidth = atlasWidth; _atlasHeight = atlasHeight; - _cols = _atlasWidth / _imageSize; - _rows = _atlasHeight / _imageSize; + _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++) From b762cb26ed64e01cf06c1dcb19cb2f4addadf601 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 20 Oct 2021 18:33:14 +0200 Subject: [PATCH 575/681] Turn some guest functions into methods --- src/openrct2/peep/Guest.cpp | 39 +++++++++++++++++------------------ src/openrct2/peep/Peep.h | 2 ++ src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/Station.cpp | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d26701c5db..af1f921640 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -3530,17 +3530,16 @@ static void peep_update_ride_leave_entrance_spiral_slide(Guest* peep, Ride* ride peep->RideSubState = PeepRideSubState::ApproachSpiralSlide; } -static uint8_t peep_get_waypointed_seat_location( - Peep* peep, Ride* ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction) +uint8_t Guest::GetWaypointedSeatLocation(const Ride& ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction) const { // The seatlocation can be split into segments around the ride base // to decide the segment first split off the segmentable seat location // from the fixed section - uint8_t seatLocationSegment = peep->CurrentSeat & 0x7; - uint8_t seatLocationFixed = peep->CurrentSeat & 0xF8; + uint8_t seatLocationSegment = CurrentSeat & 0x7; + uint8_t seatLocationFixed = CurrentSeat & 0xF8; // Enterprise has more segments (8) compared to the normal (4) - if (ride->type != RIDE_TYPE_ENTERPRISE) + if (ride.type != RIDE_TYPE_ENTERPRISE) track_direction *= 2; // Type 1 loading doesn't do segments and all peeps go to the same @@ -3556,19 +3555,19 @@ static uint8_t peep_get_waypointed_seat_location( return seatLocationSegment + seatLocationFixed; } -static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) +void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride) { - TileCoordsXYZD entranceLocation = ride_get_entrance_location(ride, peep->CurrentRideStation); + TileCoordsXYZD entranceLocation = ride_get_entrance_location(&ride, CurrentRideStation); Guard::Assert(!entranceLocation.IsNull()); uint8_t direction_entrance = entranceLocation.direction; - CoordsXY waypoint = ride->stations[peep->CurrentRideStation].Start.ToTileCentre(); + CoordsXY waypoint = ride.stations[CurrentRideStation].Start.ToTileCentre(); - TileElement* tile_element = ride_get_station_start_track_element(ride, peep->CurrentRideStation); + TileElement* tile_element = ride_get_station_start_track_element(&ride, CurrentRideStation); uint8_t direction_track = (tile_element == nullptr ? 0 : tile_element->GetDirection()); - auto vehicle = GetEntity(ride->vehicles[peep->CurrentTrain]); + auto vehicle = GetEntity(ride.vehicles[CurrentTrain]); if (vehicle == nullptr) { // TODO: Goto ride exit on failure. @@ -3577,20 +3576,21 @@ static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) auto ride_entry = vehicle->GetRideEntry(); auto vehicle_type = &ride_entry->vehicles[vehicle->vehicle_type]; - peep->Var37 = (direction_entrance | peep_get_waypointed_seat_location(peep, ride, vehicle_type, direction_track) * 4) * 4; + Var37 = (direction_entrance | GetWaypointedSeatLocation(ride, vehicle_type, direction_track) * 4) * 4; - if (ride->type == RIDE_TYPE_ENTERPRISE) + if (ride.type == RIDE_TYPE_ENTERPRISE) { waypoint.x = vehicle->x; waypoint.y = vehicle->y; } - Guard::Assert(vehicle_type->peep_loading_waypoints.size() >= static_cast(peep->Var37 / 4)); - waypoint.x += vehicle_type->peep_loading_waypoints[peep->Var37 / 4][0].x; - waypoint.y += vehicle_type->peep_loading_waypoints[peep->Var37 / 4][0].y; + const auto waypointIndex = Var37 / 4; + Guard::Assert(vehicle_type->peep_loading_waypoints.size() >= static_cast(waypointIndex)); + waypoint.x += vehicle_type->peep_loading_waypoints[waypointIndex][0].x; + waypoint.y += vehicle_type->peep_loading_waypoints[waypointIndex][0].y; - peep->SetDestination(waypoint); - peep->RideSubState = PeepRideSubState::ApproachVehicleWaypoints; + SetDestination(waypoint); + RideSubState = PeepRideSubState::ApproachVehicleWaypoints; } /** @@ -3694,7 +3694,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() if (vehicle_type->flags & VEHICLE_ENTRY_FLAG_LOADING_WAYPOINTS) { - peep_update_ride_leave_entrance_waypoints(this, ride); + UpdateRideLeaveEntranceWaypoints(*ride); return; } @@ -4237,8 +4237,7 @@ void Guest::UpdateRideLeaveVehicle() if (vehicleEntry == nullptr) return; - Var37 = ((exitLocation.direction | peep_get_waypointed_seat_location(this, ride, vehicleEntry, station_direction) * 4) * 4) - | 1; + Var37 = ((exitLocation.direction | GetWaypointedSeatLocation(*ride, vehicleEntry, station_direction) * 4) * 4) | 1; if (ride->type == RIDE_TYPE_ENTERPRISE) { diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 8dbced8f2c..c38aad8605 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -805,6 +805,8 @@ private: void UpdateUsingBin(); void UpdateRideAtEntrance(); void UpdateRideAdvanceThroughEntrance(); + void UpdateRideLeaveEntranceWaypoints(const Ride& ride); + uint8_t GetWaypointedSeatLocation(const Ride& ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction) const; void UpdateRideFreeVehicleCheck(); void UpdateRideFreeVehicleEnterRide(Ride* ride); void UpdateRideApproachVehicle(); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index b278ce19f8..3375497642 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1157,7 +1157,7 @@ std::optional GetTrackElementOriginAndApplyChanges( const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags); void ride_set_map_tooltip(TileElement* tileElement); void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason); -TileElement* ride_get_station_start_track_element(Ride* ride, StationIndex stationIndex); +TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex stationIndex); TileElement* ride_get_station_exit_element(const CoordsXYZ& elementPos); void ride_set_status(Ride* ride, RideStatus status); void ride_set_name(Ride* ride, const char* name, uint32_t flags); diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index ec38c94a0e..059e9b0b99 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -328,7 +328,7 @@ static void ride_invalidate_station_start(Ride* ride, StationIndex stationIndex, map_invalidate_tile_zoom1({ startPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); } -TileElement* ride_get_station_start_track_element(Ride* ride, StationIndex stationIndex) +TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex stationIndex) { auto stationStart = ride->stations[stationIndex].GetStart(); From 62a9096079477436ade903cf13407a90644642eb Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 20 Oct 2021 18:50:21 +0200 Subject: [PATCH 576/681] Fix #15466: Crash when opening dropdown with 0 rows --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Dropdown.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 91838f3c8a..0bd317dde3 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#15322] Circus music doesn't play. - Fix: [#15377] Entrance/exit ghost doesn't work on different stations without touching them first. - Fix: [#15451] Guest list name filter remains after group selection. +- Fix: [#15466] Crash when opening a dropdown with 0 rows. - Fix: [#15476] Crash when placing/clearing small scenery. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. - Fix: [#15490] Tile inspector needlessly updates clearance height when changing surface slopes. diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 71e9db36bc..ef6d0dc01a 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -157,7 +157,7 @@ void WindowDropdownShowTextCustomWidth( if (gDropdownNumItems == 0) { _dropdown_num_columns = 1; - _dropdown_num_rows = 0; + _dropdown_num_rows = 1; } else { @@ -231,15 +231,15 @@ void WindowDropdownShowImage( _dropdown_item_width = itemWidth; _dropdown_item_height = itemHeight; gDropdownNumItems = numItems; - // There must always be at least one column to prevent dividing by zero + // There must always be at least one column and row to prevent dividing by zero if (gDropdownNumItems == 0) { _dropdown_num_columns = 1; - _dropdown_num_rows = 0; + _dropdown_num_rows = 1; } else { - _dropdown_num_columns = numColumns; + _dropdown_num_columns = std::max(1, numColumns); _dropdown_num_rows = gDropdownNumItems / _dropdown_num_columns; if (gDropdownNumItems % _dropdown_num_columns != 0) _dropdown_num_rows++; From 7a30169c283c182dfdd83dac13673213af65f249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 21:47:56 +0300 Subject: [PATCH 577/681] Refactor out construction clearance into a new compilation unit --- src/openrct2/actions/FootpathPlaceAction.cpp | 1 + .../actions/FootpathPlaceFromTrackAction.cpp | 1 + src/openrct2/actions/LandSetHeightAction.cpp | 1 + .../actions/LargeSceneryPlaceAction.cpp | 1 + src/openrct2/actions/MazePlaceTrackAction.cpp | 1 + src/openrct2/actions/MazeSetTrackAction.cpp | 1 + .../actions/PlaceParkEntranceAction.cpp | 1 + .../actions/RideEntranceExitPlaceAction.cpp | 1 + .../actions/SmallSceneryPlaceAction.cpp | 1 + src/openrct2/actions/TrackPlaceAction.cpp | 1 + src/openrct2/actions/WallPlaceAction.cpp | 1 + src/openrct2/actions/WaterSetHeightAction.cpp | 1 + src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/peep/Peep.cpp | 1 + src/openrct2/world/ConstructionClearance.cpp | 359 ++++++++++++++++++ src/openrct2/world/ConstructionClearance.h | 25 ++ src/openrct2/world/Map.cpp | 286 -------------- src/openrct2/world/Map.h | 16 - src/openrct2/world/SmallScenery.cpp | 52 --- 19 files changed, 399 insertions(+), 354 deletions(-) create mode 100644 src/openrct2/world/ConstructionClearance.cpp create mode 100644 src/openrct2/world/ConstructionClearance.h diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index df93c33327..b83e5062f7 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -15,6 +15,7 @@ #include "../interface/Window.h" #include "../localisation/StringIds.h" #include "../management/Finance.h" +#include "../world/ConstructionClearance.h" #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Park.h" diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index 80a67d0ddb..295e05e166 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -15,6 +15,7 @@ #include "../interface/Window.h" #include "../localisation/StringIds.h" #include "../management/Finance.h" +#include "../world/ConstructionClearance.h" #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Park.h" diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 02c6c35b02..aa43b243c3 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -17,6 +17,7 @@ #include "../management/Finance.h" #include "../ride/RideData.h" #include "../windows/Intent.h" +#include "../world/ConstructionClearance.h" #include "../world/Park.h" #include "../world/Scenery.h" #include "../world/SmallScenery.h" diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 51b3801cec..8fc746df28 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -14,6 +14,7 @@ #include "../object/ObjectLimits.h" #include "../ride/Ride.h" #include "../world/Banner.h" +#include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" #include "../world/Surface.h" diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index a2e01c3642..ed7da150e9 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -11,6 +11,7 @@ #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/TrackData.h" +#include "../world/ConstructionClearance.h" using namespace OpenRCT2::TrackMetaData; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 2d740b4de6..8f47f6eb49 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -18,6 +18,7 @@ #include "../ride/RideData.h" #include "../ride/Track.h" #include "../ride/TrackData.h" +#include "../world/ConstructionClearance.h" #include "../world/Footpath.h" #include "../world/Park.h" diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 0603218380..93f1eb82ef 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -14,6 +14,7 @@ #include "../core/MemoryStream.h" #include "../localisation/StringIds.h" #include "../management/Finance.h" +#include "../world/ConstructionClearance.h" #include "../world/Entrance.h" #include "../world/Footpath.h" #include "../world/MapAnimation.h" diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index df49331e73..c98366ea6a 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -13,6 +13,7 @@ #include "../management/Finance.h" #include "../ride/Ride.h" #include "../ride/Station.h" +#include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" RideEntranceExitPlaceAction::RideEntranceExitPlaceAction( diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index e6e536d19b..92a819ec11 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -19,6 +19,7 @@ #include "../management/Finance.h" #include "../ride/Ride.h" #include "../ride/TrackDesign.h" +#include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/SmallScenery.h" diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index ec46e18123..e8ad36a7c0 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -16,6 +16,7 @@ #include "../ride/TrackData.h" #include "../ride/TrackDesign.h" #include "../util/Math.hpp" +#include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" #include "../world/Surface.h" #include "RideSetSettingAction.h" diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index fca2f02f11..5b528b2934 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -14,6 +14,7 @@ #include "../ride/Track.h" #include "../ride/TrackDesign.h" #include "../world/Banner.h" +#include "../world/ConstructionClearance.h" #include "../world/LargeScenery.h" #include "../world/MapAnimation.h" #include "../world/SmallScenery.h" diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 523ab0b358..298df52762 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -11,6 +11,7 @@ #include "../OpenRCT2.h" #include "../management/Finance.h" +#include "../world/ConstructionClearance.h" #include "../world/Park.h" #include "../world/Surface.h" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 26dcee802b..cc3067e1e5 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -466,6 +466,7 @@ + @@ -911,6 +912,7 @@ + diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index e5b1ba67d8..1a7eb5a5d4 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -36,6 +36,7 @@ #include "../windows/Intent.h" #include "../world/Balloon.h" #include "../world/Climate.h" +#include "../world/ConstructionClearance.h" #include "../world/EntityTweener.h" #include "../world/Entrance.h" #include "../world/Footpath.h" diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp new file mode 100644 index 0000000000..430119a991 --- /dev/null +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -0,0 +1,359 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "ConstructionClearance.h" + +#include "../Game.h" +#include "../openrct2/Cheats.h" +#include "../ride/Ride.h" +#include "../ride/RideData.h" +#include "Map.h" +#include "Park.h" +#include "Scenery.h" +#include "SmallScenery.h" +#include "Surface.h" + +static int32_t map_place_clear_func( + TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price, bool is_scenery) +{ + if ((*tile_element)->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) + return 1; + + if (is_scenery && !(flags & GAME_COMMAND_FLAG_PATH_SCENERY)) + return 1; + + auto* scenery = (*tile_element)->AsSmallScenery()->GetEntry(); + + if (gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) + { + if (scenery != nullptr && scenery->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) + return 1; + } + + if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && scenery != nullptr) + *price += scenery->removal_price * 10; + + if (flags & GAME_COMMAND_FLAG_GHOST) + return 0; + + if (!(flags & GAME_COMMAND_FLAG_APPLY)) + return 0; + + map_invalidate_tile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() }); + + tile_element_remove(*tile_element); + + (*tile_element)--; + return 0; +} + +/** + * + * rct2: 0x006E0D6E, 0x006B8D88 + */ +int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price) +{ + return map_place_clear_func(tile_element, coords, flags, price, /*is_scenery=*/true); +} + +/** + * + * rct2: 0x006C5A4F, 0x006CDE57, 0x006A6733, 0x0066637E + */ +int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price) +{ + return map_place_clear_func(tile_element, coords, flags, price, /*is_scenery=*/false); +} + +static bool MapLoc68BABCShouldContinue( + TileElement* tileElement, const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, uint8_t flags, money32& price, + uint8_t crossingMode, bool canBuildCrossing) +{ + if (clearFunc != nullptr) + { + if (!clearFunc(&tileElement, pos, flags, &price)) + { + return true; + } + } + + // Crossing mode 1: building track over path + if (crossingMode == 1 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_PATH + && tileElement->GetBaseZ() == pos.baseZ && !tileElement->AsPath()->IsQueue() && !tileElement->AsPath()->IsSloped()) + { + return true; + } + // Crossing mode 2: building path over track + else if ( + crossingMode == 2 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK + && tileElement->GetBaseZ() == pos.baseZ && tileElement->AsTrack()->GetTrackType() == TrackElemType::Flat) + { + auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); + if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)) + { + return true; + } + } + + return false; +} + +/** + * + * rct2: 0x0068B932 + * ax = x + * cx = y + * dl = zLow + * dh = zHigh + * ebp = clearFunc + * bl = bl + */ +std::unique_ptr MapCanConstructWithClearAt( + const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree) +{ + int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height; + northZ = eastZ = baseHeight = southZ = westZ = water_height = 0; + auto res = std::make_unique(); + uint8_t slope = 0; + + res->GroundFlags = ELEMENT_IS_ABOVE_GROUND; + bool canBuildCrossing = false; + if (map_is_edge(pos)) + { + res->Error = GameActions::Status::InvalidParameters; + res->ErrorMessage = STR_OFF_EDGE_OF_MAP; + return res; + } + + if (gCheatsDisableClearanceChecks) + { + return res; + } + + TileElement* tileElement = map_get_first_element_at(pos); + if (tileElement == nullptr) + { + res->Error = GameActions::Status::Unknown; + res->ErrorMessage = STR_NONE; + return res; + } + do + { + if (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE) + { + if (pos.baseZ < tileElement->GetClearanceZ() && pos.clearanceZ > tileElement->GetBaseZ() + && !(tileElement->IsGhost())) + { + if (tileElement->GetOccupiedQuadrants() & (quarterTile.GetBaseQuarterOccupied())) + { + if (MapLoc68BABCShouldContinue( + tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) + { + continue; + } + + if (tileElement != nullptr) + { + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; + } + return res; + } + } + continue; + } + water_height = tileElement->AsSurface()->GetWaterHeight(); + if (water_height && water_height > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) + { + res->GroundFlags |= ELEMENT_IS_UNDERWATER; + if (water_height < pos.clearanceZ) + { + bool returnError = true; + if (clearFunc != nullptr) + { + if (!clearFunc(&tileElement, pos, flags, &res->Cost)) + { + returnError = false; + } + } + if (returnError) + { + if (tileElement != nullptr) + { + res->Error = GameActions::Status::NoClearance; + res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; + } + return res; + } + } + } + + if (gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION && !isTree) + { + auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ(); + + if (heightFromGround > (18 * COORDS_Z_STEP)) + { + res->Error = GameActions::Status::Disallowed; + res->ErrorMessage = STR_LOCAL_AUTHORITY_WONT_ALLOW_CONSTRUCTION_ABOVE_TREE_HEIGHT; + return res; + } + } + + // Only allow building crossings directly on a flat surface tile. + if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE + && (tileElement->AsSurface()->GetSlope()) == TILE_ELEMENT_SLOPE_FLAT && tileElement->GetBaseZ() == pos.baseZ) + { + canBuildCrossing = true; + } + + if (quarterTile.GetZQuarterOccupied() != 0b1111) + { + if (tileElement->GetBaseZ() >= pos.clearanceZ) + { + // loc_68BA81 + res->GroundFlags |= ELEMENT_IS_UNDERGROUND; + res->GroundFlags &= ~ELEMENT_IS_ABOVE_GROUND; + } + else + { + northZ = tileElement->GetBaseZ(); + eastZ = northZ; + southZ = northZ; + westZ = northZ; + slope = tileElement->AsSurface()->GetSlope(); + if (slope & TILE_ELEMENT_SLOPE_N_CORNER_UP) + { + northZ += LAND_HEIGHT_STEP; + if (slope == (TILE_ELEMENT_SLOPE_S_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) + northZ += LAND_HEIGHT_STEP; + } + if (slope & TILE_ELEMENT_SLOPE_E_CORNER_UP) + { + eastZ += LAND_HEIGHT_STEP; + if (slope == (TILE_ELEMENT_SLOPE_W_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) + eastZ += LAND_HEIGHT_STEP; + } + if (slope & TILE_ELEMENT_SLOPE_S_CORNER_UP) + { + southZ += LAND_HEIGHT_STEP; + if (slope == (TILE_ELEMENT_SLOPE_N_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) + southZ += LAND_HEIGHT_STEP; + } + if (slope & TILE_ELEMENT_SLOPE_W_CORNER_UP) + { + westZ += LAND_HEIGHT_STEP; + if (slope == (TILE_ELEMENT_SLOPE_E_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) + westZ += LAND_HEIGHT_STEP; + } + baseHeight = pos.baseZ + (4 * COORDS_Z_STEP); + { + auto baseQuarter = quarterTile.GetBaseQuarterOccupied(); + auto zQuarter = quarterTile.GetZQuarterOccupied(); + if ((!(baseQuarter & 0b0001) || ((zQuarter & 0b0001 || pos.baseZ >= northZ) && baseHeight >= northZ)) + && (!(baseQuarter & 0b0010) || ((zQuarter & 0b0010 || pos.baseZ >= eastZ) && baseHeight >= eastZ)) + && (!(baseQuarter & 0b0100) || ((zQuarter & 0b0100 || pos.baseZ >= southZ) && baseHeight >= southZ)) + && (!(baseQuarter & 0b1000) || ((zQuarter & 0b1000 || pos.baseZ >= westZ) && baseHeight >= westZ))) + { + continue; + } + } + + if (MapLoc68BABCShouldContinue(tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) + { + continue; + } + + if (tileElement != nullptr) + { + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; + } + return res; + } + } + } while (!(tileElement++)->IsLastForTile()); + return res; +} + +std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl) +{ + return MapCanConstructWithClearAt(pos, nullptr, bl, 0); +} + +/** + * + * rct2: 0x0068BB18 + */ +void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res) +{ + Ride* ride; + + res.ErrorMessage = STR_OBJECT_IN_THE_WAY; + switch (tileElement->GetType()) + { + case TILE_ELEMENT_TYPE_SURFACE: + res.ErrorMessage = STR_RAISE_OR_LOWER_LAND_FIRST; + break; + case TILE_ELEMENT_TYPE_PATH: + res.ErrorMessage = STR_FOOTPATH_IN_THE_WAY; + break; + case TILE_ELEMENT_TYPE_TRACK: + ride = get_ride(tileElement->AsTrack()->GetRideIndex()); + if (ride != nullptr) + { + res.ErrorMessage = STR_X_IN_THE_WAY; + + Formatter ft(res.ErrorMessageArgs.data()); + ride->FormatNameTo(ft); + } + break; + case TILE_ELEMENT_TYPE_SMALL_SCENERY: + { + auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); + res.ErrorMessage = STR_X_IN_THE_WAY; + auto ft = Formatter(res.ErrorMessageArgs.data()); + rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); + break; + } + case TILE_ELEMENT_TYPE_ENTRANCE: + switch (tileElement->AsEntrance()->GetEntranceType()) + { + case ENTRANCE_TYPE_RIDE_ENTRANCE: + res.ErrorMessage = STR_RIDE_ENTRANCE_IN_THE_WAY; + break; + case ENTRANCE_TYPE_RIDE_EXIT: + res.ErrorMessage = STR_RIDE_EXIT_IN_THE_WAY; + break; + case ENTRANCE_TYPE_PARK_ENTRANCE: + res.ErrorMessage = STR_PARK_ENTRANCE_IN_THE_WAY; + break; + } + break; + case TILE_ELEMENT_TYPE_WALL: + { + auto* wallEntry = tileElement->AsWall()->GetEntry(); + res.ErrorMessage = STR_X_IN_THE_WAY; + auto ft = Formatter(res.ErrorMessageArgs.data()); + rct_string_id stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); + break; + } + case TILE_ELEMENT_TYPE_LARGE_SCENERY: + { + auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); + res.ErrorMessage = STR_X_IN_THE_WAY; + auto ft = Formatter(res.ErrorMessageArgs.data()); + rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + ft.Add(stringId); + break; + } + } +} diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h new file mode 100644 index 0000000000..9662e04e1a --- /dev/null +++ b/src/openrct2/world/ConstructionClearance.h @@ -0,0 +1,25 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../actions/GameActionResult.h" + +using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); + +int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); +int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); + +[[nodiscard]] std::unique_ptr MapCanConstructWithClearAt( + const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, + uint8_t crossingMode = CREATE_CROSSING_MODE_NONE, bool isTree = false); + +[[nodiscard]] std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); + +void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7185a6665f..b50ed72521 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1264,292 +1264,6 @@ TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants return insertedElement; } -/** - * - * rct2: 0x0068BB18 - */ -void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res) -{ - Ride* ride; - - res.ErrorMessage = STR_OBJECT_IN_THE_WAY; - switch (tileElement->GetType()) - { - case TILE_ELEMENT_TYPE_SURFACE: - res.ErrorMessage = STR_RAISE_OR_LOWER_LAND_FIRST; - break; - case TILE_ELEMENT_TYPE_PATH: - res.ErrorMessage = STR_FOOTPATH_IN_THE_WAY; - break; - case TILE_ELEMENT_TYPE_TRACK: - ride = get_ride(tileElement->AsTrack()->GetRideIndex()); - if (ride != nullptr) - { - res.ErrorMessage = STR_X_IN_THE_WAY; - - Formatter ft(res.ErrorMessageArgs.data()); - ride->FormatNameTo(ft); - } - break; - case TILE_ELEMENT_TYPE_SMALL_SCENERY: - { - auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - res.ErrorMessage = STR_X_IN_THE_WAY; - auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); - break; - } - case TILE_ELEMENT_TYPE_ENTRANCE: - switch (tileElement->AsEntrance()->GetEntranceType()) - { - case ENTRANCE_TYPE_RIDE_ENTRANCE: - res.ErrorMessage = STR_RIDE_ENTRANCE_IN_THE_WAY; - break; - case ENTRANCE_TYPE_RIDE_EXIT: - res.ErrorMessage = STR_RIDE_EXIT_IN_THE_WAY; - break; - case ENTRANCE_TYPE_PARK_ENTRANCE: - res.ErrorMessage = STR_PARK_ENTRANCE_IN_THE_WAY; - break; - } - break; - case TILE_ELEMENT_TYPE_WALL: - { - auto* wallEntry = tileElement->AsWall()->GetEntry(); - res.ErrorMessage = STR_X_IN_THE_WAY; - auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); - break; - } - case TILE_ELEMENT_TYPE_LARGE_SCENERY: - { - auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); - res.ErrorMessage = STR_X_IN_THE_WAY; - auto ft = Formatter(res.ErrorMessageArgs.data()); - rct_string_id stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); - ft.Add(stringId); - break; - } - } -} - -static bool MapLoc68BABCShouldContinue( - TileElement* tileElement, const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, uint8_t flags, money32& price, - uint8_t crossingMode, bool canBuildCrossing) -{ - if (clearFunc != nullptr) - { - if (!clearFunc(&tileElement, pos, flags, &price)) - { - return true; - } - } - - // Crossing mode 1: building track over path - if (crossingMode == 1 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_PATH - && tileElement->GetBaseZ() == pos.baseZ && !tileElement->AsPath()->IsQueue() && !tileElement->AsPath()->IsSloped()) - { - return true; - } - // Crossing mode 2: building path over track - else if ( - crossingMode == 2 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_TRACK - && tileElement->GetBaseZ() == pos.baseZ && tileElement->AsTrack()->GetTrackType() == TrackElemType::Flat) - { - auto ride = get_ride(tileElement->AsTrack()->GetRideIndex()); - if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)) - { - return true; - } - } - - return false; -} - -/** - * - * rct2: 0x0068B932 - * ax = x - * cx = y - * dl = zLow - * dh = zHigh - * ebp = clearFunc - * bl = bl - */ -std::unique_ptr MapCanConstructWithClearAt( - const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree) -{ - int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height; - northZ = eastZ = baseHeight = southZ = westZ = water_height = 0; - auto res = std::make_unique(); - uint8_t slope = 0; - - res->GroundFlags = ELEMENT_IS_ABOVE_GROUND; - bool canBuildCrossing = false; - if (map_is_edge(pos)) - { - res->Error = GameActions::Status::InvalidParameters; - res->ErrorMessage = STR_OFF_EDGE_OF_MAP; - return res; - } - - if (gCheatsDisableClearanceChecks) - { - return res; - } - - TileElement* tileElement = map_get_first_element_at(pos); - if (tileElement == nullptr) - { - res->Error = GameActions::Status::Unknown; - res->ErrorMessage = STR_NONE; - return res; - } - do - { - if (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE) - { - if (pos.baseZ < tileElement->GetClearanceZ() && pos.clearanceZ > tileElement->GetBaseZ() - && !(tileElement->IsGhost())) - { - if (tileElement->GetOccupiedQuadrants() & (quarterTile.GetBaseQuarterOccupied())) - { - if (MapLoc68BABCShouldContinue( - tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) - { - continue; - } - - if (tileElement != nullptr) - { - map_obstruction_set_error_text(tileElement, *res); - res->Error = GameActions::Status::NoClearance; - } - return res; - } - } - continue; - } - water_height = tileElement->AsSurface()->GetWaterHeight(); - if (water_height && water_height > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) - { - res->GroundFlags |= ELEMENT_IS_UNDERWATER; - if (water_height < pos.clearanceZ) - { - bool returnError = true; - if (clearFunc != nullptr) - { - if (!clearFunc(&tileElement, pos, flags, &res->Cost)) - { - returnError = false; - } - } - if (returnError) - { - if (tileElement != nullptr) - { - res->Error = GameActions::Status::NoClearance; - res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; - } - return res; - } - } - } - - if (gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION && !isTree) - { - auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ(); - - if (heightFromGround > (18 * COORDS_Z_STEP)) - { - res->Error = GameActions::Status::Disallowed; - res->ErrorMessage = STR_LOCAL_AUTHORITY_WONT_ALLOW_CONSTRUCTION_ABOVE_TREE_HEIGHT; - return res; - } - } - - // Only allow building crossings directly on a flat surface tile. - if (tileElement->GetType() == TILE_ELEMENT_TYPE_SURFACE - && (tileElement->AsSurface()->GetSlope()) == TILE_ELEMENT_SLOPE_FLAT && tileElement->GetBaseZ() == pos.baseZ) - { - canBuildCrossing = true; - } - - if (quarterTile.GetZQuarterOccupied() != 0b1111) - { - if (tileElement->GetBaseZ() >= pos.clearanceZ) - { - // loc_68BA81 - res->GroundFlags |= ELEMENT_IS_UNDERGROUND; - res->GroundFlags &= ~ELEMENT_IS_ABOVE_GROUND; - } - else - { - northZ = tileElement->GetBaseZ(); - eastZ = northZ; - southZ = northZ; - westZ = northZ; - slope = tileElement->AsSurface()->GetSlope(); - if (slope & TILE_ELEMENT_SLOPE_N_CORNER_UP) - { - northZ += LAND_HEIGHT_STEP; - if (slope == (TILE_ELEMENT_SLOPE_S_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) - northZ += LAND_HEIGHT_STEP; - } - if (slope & TILE_ELEMENT_SLOPE_E_CORNER_UP) - { - eastZ += LAND_HEIGHT_STEP; - if (slope == (TILE_ELEMENT_SLOPE_W_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) - eastZ += LAND_HEIGHT_STEP; - } - if (slope & TILE_ELEMENT_SLOPE_S_CORNER_UP) - { - southZ += LAND_HEIGHT_STEP; - if (slope == (TILE_ELEMENT_SLOPE_N_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) - southZ += LAND_HEIGHT_STEP; - } - if (slope & TILE_ELEMENT_SLOPE_W_CORNER_UP) - { - westZ += LAND_HEIGHT_STEP; - if (slope == (TILE_ELEMENT_SLOPE_E_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) - westZ += LAND_HEIGHT_STEP; - } - baseHeight = pos.baseZ + (4 * COORDS_Z_STEP); - { - auto baseQuarter = quarterTile.GetBaseQuarterOccupied(); - auto zQuarter = quarterTile.GetZQuarterOccupied(); - if ((!(baseQuarter & 0b0001) || ((zQuarter & 0b0001 || pos.baseZ >= northZ) && baseHeight >= northZ)) - && (!(baseQuarter & 0b0010) || ((zQuarter & 0b0010 || pos.baseZ >= eastZ) && baseHeight >= eastZ)) - && (!(baseQuarter & 0b0100) || ((zQuarter & 0b0100 || pos.baseZ >= southZ) && baseHeight >= southZ)) - && (!(baseQuarter & 0b1000) || ((zQuarter & 0b1000 || pos.baseZ >= westZ) && baseHeight >= westZ))) - { - continue; - } - } - - if (MapLoc68BABCShouldContinue(tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) - { - continue; - } - - if (tileElement != nullptr) - { - map_obstruction_set_error_text(tileElement, *res); - res->Error = GameActions::Status::NoClearance; - } - return res; - } - } - } while (!(tileElement++)->IsLastForTile()); - return res; -} - -std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl) -{ - return MapCanConstructWithClearAt(pos, nullptr, bl, 0); -} /** * Updates grass length, scenery age and jumping fountains. * diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index d9f524c646..38654a35d4 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -233,21 +233,6 @@ template T* TileElementInsert(const CoordsXYZ& loc, int32_t occupied return (element != nullptr) ? element->template as() : nullptr; } -namespace GameActions -{ - class Result; - class ConstructClearResult; -} // namespace GameActions - -using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); - -int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); -int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); -[[nodiscard]] std::unique_ptr MapCanConstructWithClearAt( - const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, - uint8_t crossingMode = CREATE_CROSSING_MODE_NONE, bool isTree = false); -[[nodiscard]] std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); - struct tile_element_iterator { int32_t x; @@ -305,7 +290,6 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, ride_ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, ride_id_t rideIndex); bool map_is_location_at_edge(const CoordsXY& loc); -void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res); uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos); diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 8e01331916..5abe1a2967 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -24,58 +24,6 @@ #include "Scenery.h" #include "Surface.h" -static int32_t map_place_clear_func( - TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price, bool is_scenery) -{ - if ((*tile_element)->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) - return 1; - - if (is_scenery && !(flags & GAME_COMMAND_FLAG_PATH_SCENERY)) - return 1; - - auto* scenery = (*tile_element)->AsSmallScenery()->GetEntry(); - - if (gParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) - { - if (scenery != nullptr && scenery->HasFlag(SMALL_SCENERY_FLAG_IS_TREE)) - return 1; - } - - if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && scenery != nullptr) - *price += scenery->removal_price * 10; - - if (flags & GAME_COMMAND_FLAG_GHOST) - return 0; - - if (!(flags & GAME_COMMAND_FLAG_APPLY)) - return 0; - - map_invalidate_tile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() }); - - tile_element_remove(*tile_element); - - (*tile_element)--; - return 0; -} - -/** - * - * rct2: 0x006E0D6E, 0x006B8D88 - */ -int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price) -{ - return map_place_clear_func(tile_element, coords, flags, price, /*is_scenery=*/true); -} - -/** - * - * rct2: 0x006C5A4F, 0x006CDE57, 0x006A6733, 0x0066637E - */ -int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price) -{ - return map_place_clear_func(tile_element, coords, flags, price, /*is_scenery=*/false); -} - uint8_t SmallSceneryElement::GetSceneryQuadrant() const { return (this->type & TILE_ELEMENT_QUADRANT_MASK) >> 6; From a40f6a8444258b00469bf4d17ed0ae8d4c0d60a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 20 Oct 2021 21:53:36 +0300 Subject: [PATCH 578/681] Include required headers --- src/openrct2/world/ConstructionClearance.cpp | 1 - src/openrct2/world/ConstructionClearance.h | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 430119a991..af78a35a25 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -13,7 +13,6 @@ #include "../openrct2/Cheats.h" #include "../ride/Ride.h" #include "../ride/RideData.h" -#include "Map.h" #include "Park.h" #include "Scenery.h" #include "SmallScenery.h" diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h index 9662e04e1a..8b6800098e 100644 --- a/src/openrct2/world/ConstructionClearance.h +++ b/src/openrct2/world/ConstructionClearance.h @@ -10,6 +10,11 @@ #pragma once #include "../actions/GameActionResult.h" +#include "Location.hpp" +#include "Map.h" +#include "TileElement.h" + +#include using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); From b15dc66acb38d9002e5dea14fac116548823de4f Mon Sep 17 00:00:00 2001 From: Steve Blythe <47742805+agentblythe@users.noreply.github.com> Date: Wed, 20 Oct 2021 23:43:32 +0100 Subject: [PATCH 579/681] Part of #12098: Use ScreenRect in gfx_filter_rect() (#15603) --- .../windows/EditorBottomToolbar.cpp | 19 ++++++------ .../windows/EditorInventionsList.cpp | 2 +- .../windows/EditorObjectSelection.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 29 +++++++++---------- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 4 +-- src/openrct2-ui/windows/LoadSave.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 5 ++-- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2-ui/windows/Themes.cpp | 27 +++++++---------- src/openrct2-ui/windows/TrackList.cpp | 4 +-- src/openrct2/drawing/Drawing.h | 1 - src/openrct2/drawing/NewDrawing.cpp | 5 ---- 18 files changed, 51 insertions(+), 63 deletions(-) diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index ad021fcfea..10f0282b32 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -387,22 +387,21 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { + auto previousWidget = window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE]; + auto nextWidget = window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE]; + if (drawPreviousButton) { - gfx_filter_rect( - dpi, window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + w->windowPos.x, - window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + w->windowPos.y, - window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right + w->windowPos.x, - window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom + w->windowPos.y, FilterPaletteID::Palette51); + auto leftTop = w->windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top }; + auto rightBottom = w->windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom }; + gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); } if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner) { - gfx_filter_rect( - dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + w->windowPos.x, - window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + w->windowPos.y, - window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right + w->windowPos.x, - window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom + w->windowPos.y, FilterPaletteID::Palette51); + auto leftTop = w->windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top }; + auto rightBottom = w->windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom }; + gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); } } diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index da3e0e5af9..a3d911b202 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -607,7 +607,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window* w, rct_drawpix bottom = itemY; } - gfx_filter_rect(dpi, 0, top, boxWidth, bottom, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1); } if (researchItem == _editorInventionsListDraggedItem) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index d96ab1f713..c8c6815ba5 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1228,7 +1228,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi if (highlighted) { auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1); - gfx_filter_rect(dpi, 0, screenCoords.y, w->width, bottom, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, screenCoords.y, w->width, bottom }, FilterPaletteID::PaletteDarken1); } // Draw checkmark diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index d9234fc869..1afefb10ab 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -1095,7 +1095,7 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window* w, rct if (i == w->selected_list_item) { stringId = STR_WINDOW_COLOUR_2_STRINGID; - gfx_filter_rect(dpi, 0, y, w->width, y + 11, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, y, w->width, y + 11 }, FilterPaletteID::PaletteDarken1); } // Checkbox mark diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 08cad14dd6..fcd2b87d7d 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -350,26 +350,25 @@ void window_game_bottom_toolbar_invalidate_news_item() */ static void window_game_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi) { + 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 - gfx_filter_rect( - dpi, w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top, - w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom, FilterPaletteID::Palette51); - gfx_filter_rect( - dpi, w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top, - w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom, FilterPaletteID::Palette51); + auto leftTop = w->windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top }; + auto rightBottom = w->windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom }; + gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + + leftTop = w->windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top }; + rightBottom = w->windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom }; + gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) { // Draw grey background - gfx_filter_rect( - dpi, w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].top, - w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right, - w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].bottom, FilterPaletteID::Palette51); + leftTop = w->windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top }; + rightBottom = w->windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom }; + gfx_filter_rect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); } WindowDrawWidgets(w, dpi); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 9b0941bcb0..03eca04d74 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1636,7 +1636,7 @@ void window_guest_rides_scroll_paint(rct_window* w, rct_drawpixelinfo* dpi, int3 rct_string_id stringId = STR_BLACK_STRING; if (list_index == w->selected_list_item) { - gfx_filter_rect(dpi, 0, y, 800, y + 9, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; } diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index f514c424cc..6170b36a37 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -675,7 +675,7 @@ private: rct_string_id format = STR_BLACK_STRING; if (index == _highlightedIndex) { - gfx_filter_rect(&dpi, 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; } @@ -745,7 +745,7 @@ private: rct_string_id format = STR_BLACK_STRING; if (index == _highlightedIndex) { - gfx_filter_rect(&dpi, 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(&dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); format = STR_WINDOW_COLOUR_2_STRINGID; } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 4ec600b212..88a50c50d3 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -759,7 +759,7 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i if (i == w->selected_list_item) { stringId = STR_WINDOW_COLOUR_2_STRINGID; - gfx_filter_rect(dpi, 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); } // display a marker next to the currently loaded game file if (_listItems[i].loaded) diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 2c8e8b8b6b..319b78b949 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -603,7 +603,8 @@ static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixeli if (i == w->selected_list_item) { gfx_filter_rect( - dpi, 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, FilterPaletteID::PaletteDarken1); + dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, + FilterPaletteID::PaletteDarken1); buffer += network_get_player_name(i); colour = w->colours[2]; } @@ -905,7 +906,7 @@ static void window_multiplayer_groups_scrollpaint(rct_window* w, rct_drawpixelin if (i == w->selected_list_item) { gfx_filter_rect( - dpi, 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, FilterPaletteID::PaletteDarken1); + dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); } if (screenCoords.y > dpi->y + dpi->height) { diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index be837d8a6f..0769686996 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -578,7 +578,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (i == static_cast(w->selected_list_item)) { // Background highlight - gfx_filter_rect(dpi, 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index fe9d8b8812..5c219c7ea2 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -596,7 +596,7 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo* bool isHighlighted = w->highlighted_scenario == scenario; if (isHighlighted) { - gfx_filter_rect(dpi, 0, y, w->width, y + scenarioItemHeight - 1, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, y, w->width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1); } bool isCompleted = scenario->highscore != nullptr; diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 11a364eec5..d629bdbecb 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -439,7 +439,7 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi // Draw hover highlight if (highlighted) { - gfx_filter_rect(dpi, 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT, FilterPaletteID::PaletteDarken1); + gfx_filter_rect(dpi, { 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1); _version = serverDetails.Version; listWidget.tooltip = STR_NETWORK_VERSION_TIP; } diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 7739f5420b..4a72589e58 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -509,7 +509,7 @@ private: if (isHighlighted) { format = STR_WINDOW_COLOUR_2_STRINGID; - gfx_filter_rect(&dpi, 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2), FilterPaletteID::PaletteDarken1); + gfx_filter_rect(&dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1); } auto bindingOffset = (scrollWidth * 2) / 3; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 5e7dc4e899..5004cf4cac 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -401,7 +401,7 @@ public: if (i == _highlightedIndex) { - gfx_filter_rect(&dpi, 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1), FilterPaletteID::PaletteDarken1); + gfx_filter_rect(&dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1); format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index cf2d5e0d72..e154e16e09 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -867,31 +867,26 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc if (i + 1 < get_colour_scheme_tab_count()) { int32_t colour = w->colours[1]; + + auto leftTop = ScreenCoordsXY{ 0, screenCoords.y + _row_height - 2 }; + auto rightBottom = ScreenCoordsXY{ window_themes_widgets[WIDX_THEMES_LIST].right, + screenCoords.y + _row_height - 2 }; + auto yPixelOffset = ScreenCoordsXY{ 0, 1 }; + if (colour & COLOUR_FLAG_TRANSLUCENT) { translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; - gfx_filter_rect( - dpi, 0, screenCoords.y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, - screenCoords.y + _row_height - 2, windowPalette.highlight); - gfx_filter_rect( - dpi, 0, screenCoords.y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, - screenCoords.y + _row_height - 1, windowPalette.shadow); + gfx_filter_rect(dpi, { leftTop, rightBottom }, windowPalette.highlight); + gfx_filter_rect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow); } else { colour = ColourMapA[w->colours[1]].mid_dark; - gfx_fill_rect( - dpi, - { { 0, screenCoords.y + _row_height - 2 }, - { window_themes_widgets[WIDX_THEMES_LIST].right, screenCoords.y + _row_height - 2 } }, - colour); + gfx_fill_rect(dpi, { leftTop, rightBottom }, colour); + colour = ColourMapA[w->colours[1]].lightest; - gfx_fill_rect( - dpi, - { { 0, screenCoords.y + _row_height - 1 }, - { window_themes_widgets[WIDX_THEMES_LIST].right, screenCoords.y + _row_height - 1 } }, - colour); + gfx_fill_rect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour); } } diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 6cdc7e4e29..53ece652db 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -690,7 +690,7 @@ public: { // Highlight gfx_filter_rect( - &dpi, screenCoords.x, screenCoords.y, width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, + &dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }, FilterPaletteID::PaletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; } @@ -715,7 +715,7 @@ public: { // Highlight gfx_filter_rect( - &dpi, screenCoords.x, screenCoords.y, width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1, + &dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }, FilterPaletteID::PaletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 2e66236126..940aa7a8c3 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -692,7 +692,6 @@ void gfx_draw_dashed_line( // rect void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour); void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags); -void gfx_filter_rect(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, FilterPaletteID palette); void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette); // sprite diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index ed5f8c4aee..01bb3b7bcf 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -180,11 +180,6 @@ void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colou } } -void gfx_filter_rect(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, FilterPaletteID palette) -{ - gfx_filter_rect(dpi, { left, top, right, bottom }, palette); -} - void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette) { auto drawingEngine = dpi->DrawingEngine; From ebedf8317696da68888536b28bdfd8ccc4aee44d Mon Sep 17 00:00:00 2001 From: Sijmen Date: Thu, 21 Oct 2021 02:26:01 +0200 Subject: [PATCH 580/681] Format ServerList.cpp (#15625) --- src/openrct2-ui/windows/ServerList.cpp | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index d629bdbecb..90731a267f 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -40,8 +40,8 @@ static std::future, rct_string_id>> _fet static uint32_t _numPlayersOnline = 0; static rct_string_id _statusText = STR_SERVER_LIST_CONNECTING; -// clang-format off -enum { +enum +{ WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, @@ -52,39 +52,42 @@ enum { WIDX_START_SERVER }; -enum { +enum +{ WIDX_LIST_REMOVE, WIDX_LIST_SPECTATE }; +// clang-format off static rct_widget window_server_list_widgets[] = { 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 - MakeWidget({327, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary , STR_CLOSE_X, STR_CLOSE_WINDOW_TIP), // close x button - MakeWidget({100, 20}, {245, 12}, WindowWidgetType::TextBox, WindowColour::Secondary ), // player name text box + MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_SERVER_LIST, STR_WINDOW_TITLE_TIP), // title bar + MakeWidget({327, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP), // close x button + MakeWidget({100, 20}, {245, 12}, WindowWidgetType::TextBox, WindowColour::Secondary ), // player name text box MakeWidget({ 6, 37}, {332, 14}, WindowWidgetType::Scroll, WindowColour::Secondary ), // server list 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, }; +// clang-format on -static void window_server_list_close(rct_window *w); -static void window_server_list_mouseup(rct_window *w, rct_widgetindex widgetIndex); -static void window_server_list_resize(rct_window *w); -static void window_server_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex); -static void window_server_list_update(rct_window *w); -static void window_server_list_scroll_getsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height); -static void window_server_list_scroll_mousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_server_list_scroll_mouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -static void window_server_list_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text); -static OpenRCT2String window_server_list_tooltip(rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); -static void window_server_list_invalidate(rct_window *w); -static void window_server_list_paint(rct_window *w, rct_drawpixelinfo *dpi); -static void window_server_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex); +static void window_server_list_close(rct_window* w); +static void window_server_list_mouseup(rct_window* w, rct_widgetindex widgetIndex); +static void window_server_list_resize(rct_window* w); +static void window_server_list_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex); +static void window_server_list_update(rct_window* w); +static void window_server_list_scroll_getsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height); +static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); +static void window_server_list_textinput(rct_window* w, rct_widgetindex widgetIndex, char* text); +static OpenRCT2String window_server_list_tooltip( + rct_window* const w, const rct_widgetindex widgetIndex, rct_string_id fallback); +static void window_server_list_invalidate(rct_window* w); +static void window_server_list_paint(rct_window* w, rct_drawpixelinfo* dpi); +static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex); -static rct_window_event_list window_server_list_events([](auto& events) -{ +static rct_window_event_list window_server_list_events([](auto& events) { events.close = &window_server_list_close; events.mouse_up = &window_server_list_mouseup; events.resize = &window_server_list_resize; @@ -99,7 +102,6 @@ static rct_window_event_list window_server_list_events([](auto& events) events.paint = &window_server_list_paint; events.scroll_paint = &window_server_list_scrollpaint; }); -// clang-format on enum { From e13307a28d9de42713c352eefa25a872173be16d Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 21 Oct 2021 03:51:06 +0100 Subject: [PATCH 581/681] Small cleanup of variables (#13655) Co-authored-by: Gymnasiast --- .../paint/tile_element/Paint.TileElement.cpp | 17 ++++++----------- test/testpaint/Compat.cpp | 7 +++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index bd3723be8d..8591e590b6 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -23,6 +23,7 @@ #include "../../world/Banner.h" #include "../../world/Entrance.h" #include "../../world/Footpath.h" +#include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/Surface.h" #include "../Paint.h" @@ -146,27 +147,24 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) } #endif // __TESTPAINT__ - int32_t dx = 0; switch (rotation) { case 0: - dx = x + y; break; case 1: x += 32; - dx = y - x; break; case 2: x += 32; y += 32; - dx = -(x + y); break; case 3: y += 32; - dx = x - y; break; } - dx >>= 1; + + int32_t screenMinY = translate_3d_to_2d_with_z(rotation, { x, y, 0 }).y; + // Display little yellow arrow when building footpaths? if ((gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_ARROW) && session->MapPosition.x == gMapSelectArrowPosition.x && session->MapPosition.y == gMapSelectArrowPosition.y) @@ -182,9 +180,8 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) PaintAddImageAsParent(session, imageId, { 0, 0, arrowZ }, { 32, 32, -1 }, { 0, 0, arrowZ + 18 }); } - int32_t bx = dx + 52; - if (bx <= dpi->y) + if (screenMinY + 52 <= dpi->y) return; const TileElement* element = tile_element; // push tile_element @@ -210,9 +207,7 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y) } #endif // __TESTPAINT__ - dx -= max_height + 32; - dx -= dpi->height; - if (dx >= dpi->y) + if (screenMinY - (max_height + 32) >= dpi->y + dpi->height) return; session->SpritePosition.x = x; diff --git a/test/testpaint/Compat.cpp b/test/testpaint/Compat.cpp index d0a62db3bf..4bd8633928 100644 --- a/test/testpaint/Compat.cpp +++ b/test/testpaint/Compat.cpp @@ -894,3 +894,10 @@ namespace OpenRCT2 return nullptr; } } // namespace OpenRCT2 + +ScreenCoordsXY translate_3d_to_2d_with_z(int32_t rotation, const CoordsXYZ& pos) +{ + auto rotated = pos.Rotate(rotation); + // Use right shift to avoid issues like #9301 + return ScreenCoordsXY{ rotated.y - rotated.x, ((rotated.x + rotated.y) >> 1) - pos.z }; +} From 14c5f13b1830de7ee34e2e044d8b05025d370be3 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 21 Oct 2021 04:08:57 +0000 Subject: [PATCH 582/681] Merge Localisation/master into OpenRCT2/develop --- data/language/nl-NL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 52f2d18e6a..6387dec8b5 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -2899,7 +2899,7 @@ STR_5626 :Overige parken STR_5627 :Scenariolijst groeperen op: STR_5628 :Oorsprong STR_5629 :Moeilijkheidsgraad -STR_5630 :Moeilijke scenario’s ontgrendelden met gemakkelijke +STR_5630 :Moeilijke scenario’s ontgrendelden met makkelijke STR_5631 :Originele DLC STR_5632 :Bouw je eigen… STR_5633 :CMD + From dd2a140d1f13202fdaf2e053cc4f1dfeea6f043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 16:44:56 +0300 Subject: [PATCH 583/681] Apply review suggestions --- src/openrct2/world/ConstructionClearance.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h index 8b6800098e..2f02de9d72 100644 --- a/src/openrct2/world/ConstructionClearance.h +++ b/src/openrct2/world/ConstructionClearance.h @@ -10,12 +10,16 @@ #pragma once #include "../actions/GameActionResult.h" -#include "Location.hpp" +#include "../common.h" #include "Map.h" -#include "TileElement.h" #include +struct TileElement; +struct CoordsXY; +struct CoordsXYRangedZ; +class QuarterTile; + using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); From 31239e39413f9e0dfa770b133c9a7bf0bc577752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:17:03 +0300 Subject: [PATCH 584/681] Refactor result passing on ConstructClearResult --- src/openrct2/actions/FootpathPlaceAction.cpp | 9 ++++++--- .../actions/FootpathPlaceFromTrackAction.cpp | 10 +++++++--- src/openrct2/actions/GameActionResult.h | 6 ------ .../actions/LargeSceneryPlaceAction.cpp | 9 ++++++--- src/openrct2/actions/MazePlaceTrackAction.cpp | 5 +++-- src/openrct2/actions/MazeSetTrackAction.cpp | 5 +++-- .../actions/RideEntranceExitPlaceAction.cpp | 6 ++++-- .../actions/SmallSceneryPlaceAction.cpp | 6 ++++-- src/openrct2/actions/TrackPlaceAction.cpp | 10 ++++++---- src/openrct2/world/ConstructionClearance.cpp | 17 ++++++++++------- src/openrct2/world/ConstructionClearance.h | 9 +++++++-- 11 files changed, 56 insertions(+), 36 deletions(-) diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index b83e5062f7..20374cff65 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -308,8 +308,10 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re } res->Cost += canBuild->Cost; - gFootpathGroundFlags = canBuild->GroundFlags; - if (!gCheatsDisableClearanceChecks && (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER)) + const auto clearanceData = canBuild->GetData(); + + gFootpathGroundFlags = clearanceData.GroundFlags; + if (!gCheatsDisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { return MakeResult(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } @@ -375,7 +377,8 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: } res->Cost += canBuild->Cost; - gFootpathGroundFlags = canBuild->GroundFlags; + const auto clearanceData = canBuild->GetData(); + gFootpathGroundFlags = clearanceData.GroundFlags; auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index 295e05e166..e10498e574 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -145,9 +145,11 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc return canBuild; } res->Cost += canBuild->Cost; - gFootpathGroundFlags = canBuild->GroundFlags; - if (!gCheatsDisableClearanceChecks && (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER)) + const auto clearanceData = canBuild->GetData(); + gFootpathGroundFlags = clearanceData.GroundFlags; + + if (!gCheatsDisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { return MakeResult( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); @@ -213,7 +215,9 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game return canBuild; } res->Cost += canBuild->Cost; - gFootpathGroundFlags = canBuild->GroundFlags; + + const auto clearanceData = canBuild->GetData(); + gFootpathGroundFlags = clearanceData.GroundFlags; auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index e50e756ba7..41afbf97fa 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -101,10 +101,4 @@ namespace GameActions # pragma GCC diagnostic pop #endif - class ConstructClearResult final : public Result - { - public: - uint8_t GroundFlags{ 0 }; - }; - } // namespace GameActions diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 8fc746df28..b82c43b4e8 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -125,10 +125,11 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const supportsCost += canBuild->Cost; - int32_t tempSceneryGroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const auto clearanceData = canBuild->GetData(); + int32_t tempSceneryGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (!gCheatsDisableClearanceChecks) { - if ((canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) || (canBuild->GroundFlags & ELEMENT_IS_UNDERGROUND)) + if ((clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) || (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND)) { return MakeResult(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } @@ -261,7 +262,9 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const } supportsCost += canBuild->Cost; - resultData.GroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + + const auto clearanceData = canBuild->GetData(); + resultData.GroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index ed7da150e9..2515746381 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -94,14 +94,15 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const return canBuild; } - if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) + const auto clearanceData = canBuild->GetData(); + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { res->Error = GameActions::Status::NoClearance; res->ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return res; } - if (canBuild->GroundFlags & ELEMENT_IS_UNDERGROUND) + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND) { res->Error = GameActions::Status::NoClearance; res->ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 8f47f6eb49..c9376787e0 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -114,14 +114,15 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const return constructResult; } - if (constructResult->GroundFlags & ELEMENT_IS_UNDERWATER) + const auto clearanceData = constructResult->GetData(); + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { res->Error = GameActions::Status::NoClearance; res->ErrorMessage = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return res; } - if (constructResult->GroundFlags & ELEMENT_IS_UNDERGROUND) + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND) { res->Error = GameActions::Status::NoClearance; res->ErrorMessage = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND; diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index c98366ea6a..7b8bc2cbed 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -108,7 +108,8 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const return canBuild; } - if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) + const auto clearanceData = canBuild->GetData(); + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { return MakeResult(GameActions::Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } @@ -237,7 +238,8 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::TrackPlaceQuery(const Coor return canBuild; } - if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) + const auto clearanceData = canBuild->GetData(); + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { return MakeResult(GameActions::Status::Disallowed, errorTitle, STR_RIDE_CANT_BUILD_THIS_UNDERWATER); } diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 92a819ec11..bc6dfec98e 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -258,7 +258,8 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const return canBuild; } - const uint8_t groundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const auto clearanceData = canBuild->GetData(); + const uint8_t groundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); res->SetData(SmallSceneryPlaceActionResult{ groundFlags, 0, 0 }); res->Expenditure = ExpenditureType::Landscaping; @@ -418,7 +419,8 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const sceneryElement->SetNeedsSupports(); } - const uint8_t groundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const auto clearanceData = canBuild->GetData(); + const uint8_t groundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); res->SetData( SmallSceneryPlaceActionResult{ groundFlags, sceneryElement->GetBaseZ(), sceneryElement->GetSceneryQuadrant() }); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index e8ad36a7c0..8f5a6eb1cd 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -251,7 +251,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - uint8_t mapGroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const auto clearanceData = canBuild->GetData(); + uint8_t mapGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { return MakeResult( @@ -272,7 +273,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const if (ted.Flags & TRACK_ELEM_FLAG_ONLY_UNDERWATER) { // No element has this flag - if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER) + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) { return MakeResult( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -280,7 +281,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const } } - if (canBuild->GroundFlags & ELEMENT_IS_UNDERWATER && !gCheatsDisableClearanceChecks) + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gCheatsDisableClearanceChecks) { return MakeResult( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -476,7 +477,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const } } - uint8_t mapGroundFlags = canBuild->GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); + const auto clearanceData = canBuild->GetData(); + uint8_t mapGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) { return MakeResult( diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index af78a35a25..c25d21448a 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -113,15 +113,15 @@ static bool MapLoc68BABCShouldContinue( * ebp = clearFunc * bl = bl */ -std::unique_ptr MapCanConstructWithClearAt( +GameActions::Result::Ptr MapCanConstructWithClearAt( const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree) { int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height; northZ = eastZ = baseHeight = southZ = westZ = water_height = 0; - auto res = std::make_unique(); + auto res = std::make_unique(); uint8_t slope = 0; - res->GroundFlags = ELEMENT_IS_ABOVE_GROUND; + uint8_t groundFlags = ELEMENT_IS_ABOVE_GROUND; bool canBuildCrossing = false; if (map_is_edge(pos)) { @@ -170,7 +170,7 @@ std::unique_ptr MapCanConstructWithClearAt( water_height = tileElement->AsSurface()->GetWaterHeight(); if (water_height && water_height > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) { - res->GroundFlags |= ELEMENT_IS_UNDERWATER; + groundFlags |= ELEMENT_IS_UNDERWATER; if (water_height < pos.clearanceZ) { bool returnError = true; @@ -217,8 +217,8 @@ std::unique_ptr MapCanConstructWithClearAt( if (tileElement->GetBaseZ() >= pos.clearanceZ) { // loc_68BA81 - res->GroundFlags |= ELEMENT_IS_UNDERGROUND; - res->GroundFlags &= ~ELEMENT_IS_ABOVE_GROUND; + groundFlags |= ELEMENT_IS_UNDERGROUND; + groundFlags &= ~ELEMENT_IS_ABOVE_GROUND; } else { @@ -278,10 +278,13 @@ std::unique_ptr MapCanConstructWithClearAt( } } } while (!(tileElement++)->IsLastForTile()); + + res->SetData(ConstructClearResult{ groundFlags }); + return res; } -std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl) +GameActions::Result::Ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl) { return MapCanConstructWithClearAt(pos, nullptr, bl, 0); } diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h index 2f02de9d72..557bada5b5 100644 --- a/src/openrct2/world/ConstructionClearance.h +++ b/src/openrct2/world/ConstructionClearance.h @@ -25,10 +25,15 @@ using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coord int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price); -[[nodiscard]] std::unique_ptr MapCanConstructWithClearAt( +struct ConstructClearResult +{ + uint8_t GroundFlags{ 0 }; +}; + +[[nodiscard]] GameActions::Result::Ptr MapCanConstructWithClearAt( const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode = CREATE_CROSSING_MODE_NONE, bool isTree = false); -[[nodiscard]] std::unique_ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); +[[nodiscard]] GameActions::Result::Ptr MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Result& res); From c2b2e67c1f2aa8f4fadf4240d81ef323a9699d01 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Wed, 20 Oct 2021 23:06:53 +0200 Subject: [PATCH 585/681] Remove unused server_list_get_item_button function --- src/openrct2-ui/windows/ServerList.cpp | 29 +------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 90731a267f..4b514a2fca 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -109,10 +109,8 @@ enum DDIDX_FAVOURITE }; -static int32_t _hoverButtonIndex = -1; static std::string _version; -static void server_list_get_item_button(int32_t buttonIndex, int32_t x, int32_t y, int32_t width, int32_t* outX, int32_t* outY); static void join_server(std::string address); static void server_list_fetch_servers_begin(); static void server_list_fetch_servers_check(rct_window* w); @@ -288,25 +286,7 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd index = -1; } - int32_t hoverButtonIndex = -1; auto& listWidget = w->widgets[WIDX_LIST]; - if (index != -1) - { - int32_t width = listWidget.width(); - int32_t sy = index * ITEM_HEIGHT; - for (int32_t i = 0; i < 2; i++) - { - int32_t bx, by; - - server_list_get_item_button(i, 0, sy, width, &bx, &by); - if (screenCoords.x >= bx && screenCoords.y >= by && screenCoords.x < bx + 24 && screenCoords.y < by + 24) - { - hoverButtonIndex = i; - break; - } - } - } - int32_t width = listWidget.width(); int32_t right = width - 3 - 14 - 10; if (screenCoords.x < right) @@ -315,10 +295,9 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd window_tooltip_close(); } - if (w->selected_list_item != index || _hoverButtonIndex != hoverButtonIndex) + if (w->selected_list_item != index) { w->selected_list_item = index; - _hoverButtonIndex = hoverButtonIndex; window_tooltip_close(); w->Invalidate(); } @@ -516,12 +495,6 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi } } -static void server_list_get_item_button(int32_t buttonIndex, int32_t x, int32_t y, int32_t width, int32_t* outX, int32_t* outY) -{ - *outX = width - 3 - 36 - (30 * buttonIndex); - *outY = y + 2; -} - static void join_server(std::string address) { int32_t port = NETWORK_DEFAULT_PORT; From f2c495265735061d9742c2f45d211ee37dd5c4fc Mon Sep 17 00:00:00 2001 From: Sijmen Date: Thu, 21 Oct 2021 20:35:46 +0200 Subject: [PATCH 586/681] Fix server list network version tooltip logic Moved the showing/hiding of the tooltip to scroll_mouseover, and simplified the logic. Now, the tooltip will consistently show instead of only when it felt like it :) --- src/openrct2-ui/windows/ServerList.cpp | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 4b514a2fca..1dd6a8d575 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -109,6 +109,7 @@ enum DDIDX_FAVOURITE }; +static bool _showServerVersion = false; static std::string _version; static void join_server(std::string address); @@ -279,26 +280,31 @@ static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollInd static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - // Item - int32_t index = screenCoords.y / ITEM_HEIGHT; - if (index < 0 || index >= w->no_list_items) - { - index = -1; - } - auto& listWidget = w->widgets[WIDX_LIST]; - int32_t width = listWidget.width(); - int32_t right = width - 3 - 14 - 10; - if (screenCoords.x < right) + + int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; + bool showServerVersion = false; + if (itemIndex < 0 || itemIndex >= w->no_list_items) { - listWidget.tooltip = STR_NONE; - window_tooltip_close(); + itemIndex = -1; + } + else + { + const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 17; + showServerVersion = screenCoords.x > iconX; } - if (w->selected_list_item != index) + if (w->selected_list_item != itemIndex || _showServerVersion != showServerVersion) { - w->selected_list_item = index; + w->selected_list_item = itemIndex; + _showServerVersion = showServerVersion; + + if (showServerVersion) + listWidget.tooltip = STR_NETWORK_VERSION_TIP; + else + listWidget.tooltip = STR_NONE; window_tooltip_close(); + w->Invalidate(); } } @@ -408,7 +414,6 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi ScreenCoordsXY screenCoords; screenCoords.y = 0; - listWidget.tooltip = STR_NONE; for (int32_t i = 0; i < w->no_list_items; i++) { if (screenCoords.y >= dpi->y + dpi->height) @@ -422,7 +427,6 @@ static void window_server_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi { gfx_filter_rect(dpi, { 0, screenCoords.y, width, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1); _version = serverDetails.Version; - listWidget.tooltip = STR_NETWORK_VERSION_TIP; } colour_t colour = w->colours[1]; From dc532f6ac9868eacf0c45d68164b5b6e2af6f348 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Fri, 22 Oct 2021 00:51:37 +0200 Subject: [PATCH 587/681] Rename showServerVersion to showVersionTooltip --- src/openrct2-ui/windows/ServerList.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 1dd6a8d575..f9b5dc975b 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -109,7 +109,7 @@ enum DDIDX_FAVOURITE }; -static bool _showServerVersion = false; +static bool _showVersionTooltip = false; static std::string _version; static void join_server(std::string address); @@ -283,7 +283,7 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd auto& listWidget = w->widgets[WIDX_LIST]; int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; - bool showServerVersion = false; + bool showVersionTooltip = false; if (itemIndex < 0 || itemIndex >= w->no_list_items) { itemIndex = -1; @@ -291,15 +291,15 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd else { const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 17; - showServerVersion = screenCoords.x > iconX; + showVersionTooltip = screenCoords.x > iconX; } - if (w->selected_list_item != itemIndex || _showServerVersion != showServerVersion) + if (w->selected_list_item != itemIndex || _showVersionTooltip != showVersionTooltip) { w->selected_list_item = itemIndex; - _showServerVersion = showServerVersion; + _showVersionTooltip = showVersionTooltip; - if (showServerVersion) + if (showVersionTooltip) listWidget.tooltip = STR_NETWORK_VERSION_TIP; else listWidget.tooltip = STR_NONE; From a4ed1cb6ced5e036e0a29f5d562a3326f31cd796 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 22 Oct 2021 14:59:42 +0200 Subject: [PATCH 588/681] Update feature requests link to point to Discussions --- .github/ISSUE_TEMPLATE/config.yml | 3 +++ .github/ISSUE_TEMPLATE/feature_request.yaml | 29 --------------------- 2 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index fb2d52387e..44ccf896eb 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: true contact_links: +- name: Feature request + url: https://github.com/OpenRCT2/OpenRCT2/discussions/categories/feature-requests + about: Request a new feature to be added to OpenRCT2. - name: Translation / Localisation url: https://github.com/OpenRCT2/Localisation about: For localisation issues, go to the localisation repository. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml deleted file mode 100644 index 6986b22216..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Feature request -description: Request a new feature to be added to OpenRCT2. -labels: -- feature - -body: -- type: markdown - attributes: - value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/OpenRCT2/OpenRCT2/issues?q=is%3Aissue+label%3Afeature). If it has, please add to the existing issue instead. - -- type: textarea - attributes: - label: Describe the feature - placeholder: Describe your feature idea here. You can paste or drag & drop attachments here to help on illustrating it. - validations: - required: true - -- type: dropdown - attributes: - label: Feature type - description: What would this feature improve? Check all that apply. - multiple: true - options: - - Quality of life - - Multiplayer - - Plug-ins - - Other - validations: - required: true From 815d09a431172247b01bd9c45659445af365a799 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Oct 2021 23:13:01 +0200 Subject: [PATCH 589/681] Fix #14482: Rides with Crooked House hack sometimes misbehave --- distribution/changelog.txt | 1 + src/openrct2/rct2/RCT2.cpp | 4 ++-- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/S6Importer.cpp | 30 ++++++++++++++++++++++++++++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0bd317dde3..5914e5a294 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -13,6 +13,7 @@ - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#13912] “Dome park” no longer renders dome correctly. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. +- Fix: [#14482, #15258] Rides with invisibility hacks sometimes behave incorrectly. - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). - Fix: [#14741] Crash when exiting OpenRCT2 on macOS. diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index b20d609a04..80048c8a10 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -140,9 +140,9 @@ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType) && trackType == TrackElemType::Booster; } -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType) +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat) { - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + if (convertFlat && GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) return RCT12FlatTrackTypeToOpenRCT2(origTrackType); if (origTrackType == TrackElemType::RotationControlToggleAlias && !RCT2TrackTypeIsBooster(rideType, origTrackType)) return TrackElemType::RotationControlToggle; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index d571ec96d6..217d93232e 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1069,7 +1069,7 @@ ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const rct_ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType); bool RCT2RideTypeNeedsConversion(uint8_t rct2RideType); uint8_t OpenRCT2RideTypeToRCT2RideType(ObjectEntryIndex openrct2Type); -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType); +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat = true); RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); /** diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 9795f4a7ae..72b6f2cd6e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -86,6 +86,7 @@ private: rct_s6_data _s6{}; uint8_t _gameVersion = 0; bool _isSV7 = false; + std::bitset _isFlatRide{}; public: S6Importer(IObjectRepository& objectRepository) @@ -234,6 +235,7 @@ public: scenario_rand_seed(_s6.scenario_srand_0, _s6.scenario_srand_1); + DetermineFlatRideStatus(); ImportTileElements(); ImportEntities(); @@ -544,6 +546,29 @@ public: } } + void DetermineFlatRideStatus() + { + for (uint8_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++) + { + auto src = &_s6.rides[index]; + if (src->type == RIDE_TYPE_NULL) + continue; + + auto subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->subtype); + auto* rideEntry = get_ride_entry(subtype); + + // This code is needed to detect hacks where a tracked ride has been made invisible + // by setting its ride type to a flat ride. + ObjectEntryIndex originalRideType = src->type; + if (rideEntry != nullptr) + { + originalRideType = ride_entry_get_first_non_null_ride_type(rideEntry); + } + const auto isFlatRide = GetRideTypeDescriptor(originalRideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE); + _isFlatRide.set(static_cast(index), isFlatRide); + } + } + void ImportRide(Ride* dst, const rct2_ride* src, const ride_id_t rideIndex) { *dst = {}; @@ -860,7 +885,8 @@ public: dst.CurrentRide = RCT12RideIdToOpenRCT2RideId(src.current_ride); dst.State = src.state; if (src.current_ride < RCT12_MAX_RIDES_IN_PARK && _s6.rides[src.current_ride].type < std::size(RideTypeDescriptors)) - dst.ProximityTrackType = RCT2TrackTypeToOpenRCT2(src.proximity_track_type, _s6.rides[src.current_ride].type); + dst.ProximityTrackType = RCT2TrackTypeToOpenRCT2( + src.proximity_track_type, _s6.rides[src.current_ride].type, _isFlatRide[src.current_ride]); else dst.ProximityTrackType = 0xFF; dst.ProximityBaseHeight = src.proximity_base_height; @@ -1203,7 +1229,7 @@ public: auto rideType = _s6.rides[src2->GetRideIndex()].type; track_type_t trackType = static_cast(src2->GetTrackType()); - dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, rideType)); + dst2->SetTrackType(RCT2TrackTypeToOpenRCT2(trackType, rideType, _isFlatRide[src2->GetRideIndex()])); dst2->SetRideType(rideType); dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetRideIndex(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex())); From afb49dfe38b5895e05e042ea074e17da7a1f6d7c Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Oct 2021 23:42:47 +0200 Subject: [PATCH 590/681] Also fix vehicle track refs for good measure --- src/openrct2/rct2/S6Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 72b6f2cd6e..347cfa9c3a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1674,7 +1674,7 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc dst->SetTrackType(src->GetTrackType()); // RotationControlToggle and Booster are saved as the same track piece ID // Which one the vehicle is using must be determined - if (GetRideTypeDescriptor(ride.type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + if (_isFlatRide[src->ride]) { dst->SetTrackType(RCT12FlatTrackTypeToOpenRCT2(src->GetTrackType())); } From 59e73f9cfb6ead080a81ef840b3728a098cd4560 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Oct 2021 22:41:17 +0200 Subject: [PATCH 591/681] Add additional explanation + fix for flat ride vehicles on track --- src/openrct2/rct2/S6Importer.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 347cfa9c3a..00ad2550af 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -546,6 +546,17 @@ public: } } + /** + * This code is needed to detect hacks where a tracked ride has been made invisible + * by setting its ride type to a flat ride. + * + * The function should classify rides as follows: + * 1. If the ride type is tracked and its vehicles also belong on tracks, it should be classified as tracked. + * 2. If the ride type is a flat ride, but its vehicles belong on tracks, + * it should be classified as tracked (Crooked House mod). + * 3. If the ride type is tracked and its vehicles belong to a flat ride, it should be classified as tracked. + * 4. If the ride type is a flat ride and its vehicles also belong to a flat ride, it should be classified as a flat ride. + */ void DetermineFlatRideStatus() { for (uint8_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++) @@ -556,9 +567,15 @@ public: auto subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->subtype); auto* rideEntry = get_ride_entry(subtype); + // If the ride is tracked, we don’t need to check the vehicle any more. + if (!GetRideTypeDescriptor(src->type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + { + _isFlatRide[index] = false; + continue; + } - // This code is needed to detect hacks where a tracked ride has been made invisible - // by setting its ride type to a flat ride. + // We have established the ride type is a flat ride, which means the vehicle now determines whether it is a + // true flat ride (scenario 4) or a tracked ride with an invisibility hack (scenario 2). ObjectEntryIndex originalRideType = src->type; if (rideEntry != nullptr) { From 9b6b86c85561f2f426fcd8defedb740fb93a60e2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 22 Oct 2021 16:16:50 +0200 Subject: [PATCH 592/681] Make convertFlat parameter explicit --- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/T6Importer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 217d93232e..8b8f5d652a 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -1069,7 +1069,7 @@ ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const rct_ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType); bool RCT2RideTypeNeedsConversion(uint8_t rct2RideType); uint8_t OpenRCT2RideTypeToRCT2RideType(ObjectEntryIndex openrct2Type); -track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat = true); +track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType, bool convertFlat); RCT12TrackType OpenRCT2TrackTypeToRCT2(track_type_t origTrackType); /** diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index a32037b4c9..75b912957f 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -168,7 +168,7 @@ public: _stream.Read(&t6TrackElement, sizeof(rct_td46_track_element)); TrackDesignTrackElement trackElement{}; - track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.type, td->type); + track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.type, td->type, true); if (trackType == TrackElemType::InvertedUp90ToFlatQuarterLoopAlias) { trackType = TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop; From 9e0fac9169e2cd73caeccfd27f9790d15871b14a Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 22 Oct 2021 16:17:40 +0200 Subject: [PATCH 593/681] Bump network version --- 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 f0970fba8d..29bb5d6b93 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "14" +#define NETWORK_STREAM_VERSION "15" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; From 72439c28d2300527bef6c945415b9fb3eb2a3065 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 23 Oct 2021 04:08:27 +0000 Subject: [PATCH 594/681] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index c6866627d6..ff9ecf6a4e 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3612,6 +3612,8 @@ STR_6408 :Please install “innoextract” to extract GOG Installer, then res STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. STR_6454 :No se puede cambiar el nombre del banner… STR_6455 :No se puede cambiar el nombre del señal… +STR_6457 :Informar un error en GitHub +STR_6458 :Siga esto en la Vista Principal ############## # Escenarios # From 380b20f71d41b8b338bfccec5c9fcf211b25943e Mon Sep 17 00:00:00 2001 From: Sijmen Date: Sat, 23 Oct 2021 18:20:45 +0200 Subject: [PATCH 595/681] Apply review suggestions --- src/openrct2-ui/windows/ServerList.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index f9b5dc975b..ffd85a95d7 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -109,7 +109,7 @@ enum DDIDX_FAVOURITE }; -static bool _showVersionTooltip = false; +static bool _showNetworkVersionTooltip = false; static std::string _version; static void join_server(std::string address); @@ -283,26 +283,23 @@ static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollInd auto& listWidget = w->widgets[WIDX_LIST]; int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; - bool showVersionTooltip = false; + bool showNetworkVersionTooltip = false; if (itemIndex < 0 || itemIndex >= w->no_list_items) { itemIndex = -1; } else { - const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 17; - showVersionTooltip = screenCoords.x > iconX; + const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 7 - 10; + showNetworkVersionTooltip = screenCoords.x > iconX; } - if (w->selected_list_item != itemIndex || _showVersionTooltip != showVersionTooltip) + if (w->selected_list_item != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) { w->selected_list_item = itemIndex; - _showVersionTooltip = showVersionTooltip; + _showNetworkVersionTooltip = showNetworkVersionTooltip; - if (showVersionTooltip) - listWidget.tooltip = STR_NETWORK_VERSION_TIP; - else - listWidget.tooltip = STR_NONE; + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; window_tooltip_close(); w->Invalidate(); From 2146abb17f84265ea1f89bb0a3c1e503b0d1c6f4 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 26 Oct 2021 04:08:51 +0000 Subject: [PATCH 596/681] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index ff9ecf6a4e..0e5b5681f2 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3612,6 +3612,7 @@ STR_6408 :Please install “innoextract” to extract GOG Installer, then res STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. STR_6454 :No se puede cambiar el nombre del banner… STR_6455 :No se puede cambiar el nombre del señal… +STR_6456 :Captura de pantalla gigante STR_6457 :Informar un error en GitHub STR_6458 :Siga esto en la Vista Principal From dd007c836fab72dbaa6b4b6e136f9b60083e7114 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Oct 2021 20:05:13 +0200 Subject: [PATCH 597/681] Fix #15579: Crash in track_block_get_next() --- 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 5914e5a294..6e21f7e1be 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -43,6 +43,7 @@ - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. - Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). +- Fix: [#15579] Crash in track_block_get_next(). - Fix: [#15582] [Plugin] Litter properties return incorrect values. - Fix: [#15584] Ride income underflows when on-ride photos are making losses. - Fix: [#15612] Crash when placing walls beside certain scenery objects. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9e62de1cd6..3e36f15532 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -525,7 +525,6 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 return false; auto inputElement = input->element->AsTrack(); - const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); if (inputElement == nullptr) return false; @@ -534,6 +533,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 if (ride == nullptr) return false; + const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); const auto* trackBlock = ted.Block; if (trackBlock == nullptr) return false; From a1b70b59d6425039b21e3aef2569ec9b3d9854f2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Oct 2021 20:10:03 +0200 Subject: [PATCH 598/681] Fix #15177: Crash in lightfx_add_lights_magic_vehicle() --- distribution/changelog.txt | 1 + src/openrct2/drawing/LightFX.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 6e21f7e1be..b596fa8697 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. - Fix: [#15148] Track Designs Manager delete confirmation window doesn't display properly. - Fix: [#15170] Plugin: incorrect label text alignment. +- Fix: [#15177] Crash in lightfx_add_lights_magic_vehicle(). - Fix: [#15184] Crash when hovering over water types in Object Selection. - Fix: [#15193] Crash when rides/stalls are demolished. - Fix: [#15197] Cannot place flat ride after removing it in construction window. diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 0b8f31751b..86e32f1806 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -710,6 +710,8 @@ void lightfx_add_lights_magic_vehicle(const Vehicle* vehicle) }; auto ride = vehicle->GetRide(); + if (ride == nullptr) + return; switch (ride->type) { From bdc439351767dbae8491676161b21e3996b33437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Mon, 25 Oct 2021 16:14:31 +0300 Subject: [PATCH 599/681] Cleanup MapCanConstructWithClearAt --- src/openrct2/world/ConstructionClearance.cpp | 73 ++++++++------------ 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index c25d21448a..b573d62664 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -116,10 +116,7 @@ static bool MapLoc68BABCShouldContinue( GameActions::Result::Ptr MapCanConstructWithClearAt( const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree) { - int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height; - northZ = eastZ = baseHeight = southZ = westZ = water_height = 0; auto res = std::make_unique(); - uint8_t slope = 0; uint8_t groundFlags = ELEMENT_IS_ABOVE_GROUND; bool canBuildCrossing = false; @@ -132,6 +129,7 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( if (gCheatsDisableClearanceChecks) { + res->SetData(ConstructClearResult{ groundFlags }); return res; } @@ -142,6 +140,7 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( res->ErrorMessage = STR_NONE; return res; } + do { if (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE) @@ -157,37 +156,24 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( continue; } - if (tileElement != nullptr) - { - map_obstruction_set_error_text(tileElement, *res); - res->Error = GameActions::Status::NoClearance; - } + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; return res; } } continue; } - water_height = tileElement->AsSurface()->GetWaterHeight(); - if (water_height && water_height > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) + + const auto waterHeight = tileElement->AsSurface()->GetWaterHeight(); + if (waterHeight && waterHeight > pos.baseZ && tileElement->GetBaseZ() < pos.clearanceZ) { groundFlags |= ELEMENT_IS_UNDERWATER; - if (water_height < pos.clearanceZ) + if (waterHeight < pos.clearanceZ) { - bool returnError = true; - if (clearFunc != nullptr) + if (clearFunc != nullptr && clearFunc(&tileElement, pos, flags, &res->Cost)) { - if (!clearFunc(&tileElement, pos, flags, &res->Cost)) - { - returnError = false; - } - } - if (returnError) - { - if (tileElement != nullptr) - { - res->Error = GameActions::Status::NoClearance; - res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; - } + res->Error = GameActions::Status::NoClearance; + res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; return res; } } @@ -195,7 +181,7 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( if (gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION && !isTree) { - auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ(); + const auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ(); if (heightFromGround > (18 * COORDS_Z_STEP)) { @@ -222,11 +208,11 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( } else { - northZ = tileElement->GetBaseZ(); - eastZ = northZ; - southZ = northZ; - westZ = northZ; - slope = tileElement->AsSurface()->GetSlope(); + auto northZ = tileElement->GetBaseZ(); + auto eastZ = northZ; + auto southZ = northZ; + auto westZ = northZ; + const auto slope = tileElement->AsSurface()->GetSlope(); if (slope & TILE_ELEMENT_SLOPE_N_CORNER_UP) { northZ += LAND_HEIGHT_STEP; @@ -251,17 +237,15 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( if (slope == (TILE_ELEMENT_SLOPE_E_CORNER_DN | TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)) westZ += LAND_HEIGHT_STEP; } - baseHeight = pos.baseZ + (4 * COORDS_Z_STEP); + const auto baseHeight = pos.baseZ + (4 * COORDS_Z_STEP); + const auto baseQuarter = quarterTile.GetBaseQuarterOccupied(); + const auto zQuarter = quarterTile.GetZQuarterOccupied(); + if ((!(baseQuarter & 0b0001) || ((zQuarter & 0b0001 || pos.baseZ >= northZ) && baseHeight >= northZ)) + && (!(baseQuarter & 0b0010) || ((zQuarter & 0b0010 || pos.baseZ >= eastZ) && baseHeight >= eastZ)) + && (!(baseQuarter & 0b0100) || ((zQuarter & 0b0100 || pos.baseZ >= southZ) && baseHeight >= southZ)) + && (!(baseQuarter & 0b1000) || ((zQuarter & 0b1000 || pos.baseZ >= westZ) && baseHeight >= westZ))) { - auto baseQuarter = quarterTile.GetBaseQuarterOccupied(); - auto zQuarter = quarterTile.GetZQuarterOccupied(); - if ((!(baseQuarter & 0b0001) || ((zQuarter & 0b0001 || pos.baseZ >= northZ) && baseHeight >= northZ)) - && (!(baseQuarter & 0b0010) || ((zQuarter & 0b0010 || pos.baseZ >= eastZ) && baseHeight >= eastZ)) - && (!(baseQuarter & 0b0100) || ((zQuarter & 0b0100 || pos.baseZ >= southZ) && baseHeight >= southZ)) - && (!(baseQuarter & 0b1000) || ((zQuarter & 0b1000 || pos.baseZ >= westZ) && baseHeight >= westZ))) - { - continue; - } + continue; } if (MapLoc68BABCShouldContinue(tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing)) @@ -269,11 +253,8 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( continue; } - if (tileElement != nullptr) - { - map_obstruction_set_error_text(tileElement, *res); - res->Error = GameActions::Status::NoClearance; - } + map_obstruction_set_error_text(tileElement, *res); + res->Error = GameActions::Status::NoClearance; return res; } } From 43608c807c8b589b1f5b8152356cad71b3f227df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:47:56 +0300 Subject: [PATCH 600/681] Make construction of GameActions::Result explicit --- src/openrct2/actions/GameActionResult.cpp | 20 +++++--------------- src/openrct2/actions/GameActionResult.h | 8 ++------ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp index 7bdfb75812..f24d674a4f 100644 --- a/src/openrct2/actions/GameActionResult.cpp +++ b/src/openrct2/actions/GameActionResult.cpp @@ -4,25 +4,15 @@ namespace GameActions { - Result::Result(GameActions::Status error, rct_string_id message) - { - Error = error; - ErrorMessage = message; - } - - Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message) + Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args /*= nullptr*/) { Error = error; ErrorTitle = title; ErrorMessage = message; - } - - Result::Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args) - { - Error = error; - ErrorTitle = title; - ErrorMessage = message; - std::copy_n(args, ErrorMessageArgs.size(), ErrorMessageArgs.begin()); + if (args != nullptr) + { + std::copy_n(args, ErrorMessageArgs.size(), ErrorMessageArgs.begin()); + } } struct StringVariantVisitor diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 41afbf97fa..41a4410003 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -58,7 +58,7 @@ namespace GameActions /** * Represents the result of a game action query or execution. */ - class Result + class Result final { public: using Ptr = std::unique_ptr; @@ -74,11 +74,7 @@ namespace GameActions std::any ResultData; Result() = default; - Result(GameActions::Status error, rct_string_id message); - Result(GameActions::Status error, rct_string_id title, rct_string_id message); - Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args); - Result(const GameActions::Result&) = delete; - virtual ~Result(){}; + Result(GameActions::Status error, rct_string_id title, rct_string_id message, uint8_t* args = nullptr); std::string GetErrorTitle() const; std::string GetErrorMessage() const; From cad2f427038a0c81d6c14c34b437bce47b422caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:49:19 +0300 Subject: [PATCH 601/681] Refactor explicit constructor usage in BalloonPressAction --- src/openrct2/actions/BalloonPressAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/BalloonPressAction.cpp b/src/openrct2/actions/BalloonPressAction.cpp index 85f5730295..2c3fceafe8 100644 --- a/src/openrct2/actions/BalloonPressAction.cpp +++ b/src/openrct2/actions/BalloonPressAction.cpp @@ -40,7 +40,7 @@ GameActions::Result::Ptr BalloonPressAction::Query() const if (balloon == nullptr) { log_error("Tried getting invalid sprite for balloon: %u", _spriteIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); } @@ -51,7 +51,7 @@ GameActions::Result::Ptr BalloonPressAction::Execute() const if (balloon == nullptr) { log_error("Tried getting invalid sprite for balloon: %u", _spriteIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } balloon->Press(); From fcce046a48e8ef0548a943a5d4fbbc579f096f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:50:40 +0300 Subject: [PATCH 602/681] Refactor explicit constructor usage in BannerPlaceAction --- src/openrct2/actions/BannerPlaceAction.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 5fcc570d31..06c96ae3db 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -55,13 +55,13 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } if (!MapCheckCapacityAndReorganise(_loc)) { log_error("No free map elements."); - return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto pathElement = GetValidPathElement(); @@ -87,14 +87,14 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const if (HasReachedBannerLimit()) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); } auto* bannerEntry = get_banner_entry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } res->Cost = bannerEntry->price; @@ -113,21 +113,21 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const if (!MapCheckCapacityAndReorganise(_loc)) { log_error("No free map elements."); - return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto* bannerEntry = get_banner_entry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto banner = CreateBanner(); if (banner == nullptr) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); } banner->flags = 0; banner->text = {}; From fe3d3bdb3f43607972b387f75623c2114b7ec5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:51:24 +0300 Subject: [PATCH 603/681] Refactor explicit constructor usage in GuestSetFlagsAction --- src/openrct2/actions/GuestSetFlagsAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index f8066cc700..de52b37a98 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -43,7 +43,7 @@ GameActions::Result::Ptr GuestSetFlagsAction::Query() const if (peep == nullptr) { log_error("Used invalid sprite index for peep: %u", static_cast(_peepId)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); } return std::make_unique(); } @@ -54,7 +54,7 @@ GameActions::Result::Ptr GuestSetFlagsAction::Execute() const if (peep == nullptr) { log_error("Used invalid sprite index for peep: %u", static_cast(_peepId)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); } peep->PeepFlags = _newFlags; From f8d9b0a2f9b8f074f6286c02cd0596fc9e45dea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:52:43 +0300 Subject: [PATCH 604/681] Refactor explicit constructor usage in GuestSetNameAction --- src/openrct2/actions/GuestSetNameAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index aee4dd9298..af9f3769ad 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -83,7 +83,7 @@ GameActions::Result::Ptr GuestSetNameAction::Execute() const auto curName = guest->GetName(); if (curName == _name) { - return std::make_unique(GameActions::Status::Ok, STR_NONE); + return std::make_unique(); } if (!guest->SetName(_name)) From a9d9fd5f4fa615ec1e2a533bf1a22095c8473890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:54:03 +0300 Subject: [PATCH 605/681] Refactor explicit constructor usage in FootpathAdditionPlaceAction --- src/openrct2/actions/FootpathAdditionPlaceAction.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 7b6a20dec4..bd0fc51cda 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -74,7 +74,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Query() const if (tileElement == nullptr) { log_error("Could not find path element."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto pathElement = tileElement->AsPath(); @@ -96,7 +96,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Query() const auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); if (pathBitEntry == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } uint16_t sceneryFlags = pathBitEntry->flags; @@ -115,7 +115,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Query() const if (!(sceneryFlags & (PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER | PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW)) && (pathElement->GetEdges()) == 0x0F) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } if ((sceneryFlags & PATH_BIT_FLAG_IS_QUEUE_SCREEN) && !pathElement->IsQueue()) @@ -133,7 +133,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Query() const // Check if there is something on the path already if (pathElement->HasAddition()) { - return MakeResult(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_NONE); } } return res; @@ -151,7 +151,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Execute() const if (pathElement == nullptr) { log_error("Could not find path element."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } // No change @@ -166,7 +166,7 @@ GameActions::Result::Ptr FootpathAdditionPlaceAction::Execute() const auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); if (pathBitEntry == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } res->Cost = pathBitEntry->price; From 520053a9ff0ff5921d0b23e5d9cdae2319e91639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:55:45 +0300 Subject: [PATCH 606/681] Refactor explicit constructor usage in LandLowerAction --- src/openrct2/actions/LandLowerAction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 9efbffedb6..bf6f66428e 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -134,10 +134,8 @@ GameActions::Result::Ptr LandLowerAction::QueryExecute(bool isExecuting) const if (!withinOwnership) { - GameActions::Result::Ptr ownerShipResult = std::make_unique( - GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); - ownerShipResult->ErrorTitle = STR_CANT_LOWER_LAND_HERE; - return ownerShipResult; + return std::make_unique( + GameActions::Status::Disallowed, STR_CANT_LOWER_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); } // Force ride construction to recheck area From f207ad4f64c479a9266e5b0ff57e8191263ee34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:56:32 +0300 Subject: [PATCH 607/681] Refactor explicit constructor usage in FootpathAdditionRemoveAction --- src/openrct2/actions/FootpathAdditionRemoveAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index d5897ea8ec..39bdf1e530 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -68,20 +68,20 @@ GameActions::Result::Ptr FootpathAdditionRemoveAction::Query() const if (tileElement == nullptr) { log_warning("Could not find path element."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { log_warning("Could not find path element."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST)) { log_warning("Tried to remove non ghost during ghost removal."); - return MakeResult(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_NONE); } auto res = MakeResult(); res->Position = _loc; @@ -102,7 +102,7 @@ GameActions::Result::Ptr FootpathAdditionRemoveAction::Execute() const if (pathElement == nullptr) { log_error("Could not find path element."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } pathElement->SetAddition(0); From c4ea5732ea9eafa1e24a62dd086fd846b3a78d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:57:59 +0300 Subject: [PATCH 608/681] Refactor explicit constructor usage in LargeSceneryRemoveAction --- 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 79767bbc3e..4cc356603b 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -65,13 +65,13 @@ GameActions::Result::Ptr LargeSceneryRemoveAction::Query() const if (tileElement == nullptr) { log_warning("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_SELECTION_OF_OBJECTS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); // If we have a bugged scenery entry, do not touch the tile element. if (sceneryEntry == nullptr) - return MakeResult(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_NONE); auto rotatedOffsets = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].x_offset, sceneryEntry->tiles[_tileIndex].y_offset }.Rotate(_loc.direction), @@ -135,13 +135,13 @@ GameActions::Result::Ptr LargeSceneryRemoveAction::Execute() const if (tileElement == nullptr) { log_warning("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_SELECTION_OF_OBJECTS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); // If we have a bugged scenery entry, do not touch the tile element. if (sceneryEntry == nullptr) - return MakeResult(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_NONE); tileElement->RemoveBannerEntry(); From d44bb21d975083c46cea81e128d11e4dd1a2ef20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:58:42 +0300 Subject: [PATCH 609/681] Refactor explicit constructor usage in BannerSetStyleAction --- src/openrct2/actions/BannerSetStyleAction.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 6407112795..a27055f97f 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -50,7 +50,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (banner == nullptr) { log_error("Invalid banner index: index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } res->Expenditure = ExpenditureType::Landscaping; @@ -62,7 +62,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (tileElement == nullptr) { log_error("Could not find banner index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } switch (_type) @@ -71,7 +71,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (_parameter > 31) { log_error("Invalid primary colour: colour = %u", _parameter); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } break; @@ -79,19 +79,19 @@ GameActions::Result::Ptr BannerSetStyleAction::Query() const if (_parameter > 13) { log_error("Invalid text colour: colour = %u", _parameter); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } break; case BannerSetStyleType::NoEntry: if (tileElement->AsBanner() == nullptr) { log_error("Tile element was not a banner."); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } break; default: log_error("Invalid type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } return res; } @@ -104,7 +104,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (banner == nullptr) { log_error("Invalid banner index: index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } res->Expenditure = ExpenditureType::Landscaping; @@ -116,7 +116,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (tileElement == nullptr) { log_error("Could not find banner index = %u", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } switch (_type) @@ -133,7 +133,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const if (bannerElement == nullptr) { log_error("Tile element was not a banner."); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } banner->flags &= ~BANNER_FLAG_NO_ENTRY; @@ -148,7 +148,7 @@ GameActions::Result::Ptr BannerSetStyleAction::Execute() const } default: log_error("Invalid type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); From cd7d5a0b40f75651471d337f0f70c2826b68cfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:59:42 +0300 Subject: [PATCH 610/681] Refactor explicit constructor usage in ParkEntranceRemoveAction --- src/openrct2/actions/ParkEntranceRemoveAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index 0db9d629c8..912d0be2cc 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -35,7 +35,7 @@ GameActions::Result::Ptr ParkEntranceRemoveAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode) { - return MakeResult(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, STR_NONE); } auto res = MakeResult(); @@ -47,7 +47,7 @@ GameActions::Result::Ptr ParkEntranceRemoveAction::Query() const if (!LocationValid(_loc) || entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } return res; } @@ -63,7 +63,7 @@ GameActions::Result::Ptr ParkEntranceRemoveAction::Execute() const if (entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto direction = (gParkEntrances[entranceIndex].direction - 1) & 3; From 16a30c13a31c7350b4f99d7d7fe83939fce76708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:00:24 +0300 Subject: [PATCH 611/681] Refactor explicit constructor usage in BannerRemoveAction --- src/openrct2/actions/BannerRemoveAction.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index 10be36f15a..dad26a1036 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -58,21 +58,21 @@ GameActions::Result::Ptr BannerRemoveAction::Query() const if (bannerElement == nullptr) { log_error("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BANNER_INDEX_NULL) { log_error("Invalid banner index. index = ", bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { log_error("Invalid banner index. index = ", bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto* bannerEntry = get_banner_entry(banner->type); @@ -97,21 +97,21 @@ GameActions::Result::Ptr BannerRemoveAction::Execute() const if (bannerElement == nullptr) { log_error("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BANNER_INDEX_NULL) { log_error("Invalid banner index. index = ", bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { log_error("Invalid banner index. index = ", bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto* bannerEntry = get_banner_entry(banner->type); From 59a752bb15b2c436e7ec75eaba5e3fde7d69df19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:02:39 +0300 Subject: [PATCH 612/681] Refactor explicit constructor usage in LargeScenerySetColourAction --- src/openrct2/actions/LargeScenerySetColourAction.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 5119b4200a..7c5d82f0ae 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -56,19 +56,19 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut if (_loc.x < 0 || _loc.y < 0 || _loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY()) { log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_primaryColour > 31) { log_error("Invalid primary colour: colour = %u", _primaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_secondaryColour > 31) { log_error("Invalid primary colour: colour = %u", _secondaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } auto largeElement = map_get_large_scenery_segment(_loc, _tileIndex); @@ -78,7 +78,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut log_error( "Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z, _loc.direction, _tileIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(largeElement->IsGhost())) @@ -91,7 +91,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut if (sceneryEntry == nullptr) { log_error("Could not find scenery object. type = %u", largeElement->GetEntryIndex()); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } // Work out the base tile coordinates (Tile with index 0) auto rotatedBaseCoordsOffset = CoordsXYZ{ @@ -128,7 +128,7 @@ GameActions::Result::Ptr LargeScenerySetColourAction::QueryExecute(bool isExecut log_error( "Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } if (isExecuting) { From c4465464b615b8b2bb80bdc396cf9d761e318159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:04:17 +0300 Subject: [PATCH 613/681] Refactor explicit constructor usage in BannerSetColourAction --- src/openrct2/actions/BannerSetColourAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 0243cf5fd6..bf5162ef13 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -61,13 +61,13 @@ GameActions::Result::Ptr BannerSetColourAction::QueryExecute(bool isExecuting) c if (!LocationValid(_loc)) { log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_primaryColour > 31) { log_error("Invalid primary colour: colour = %u", _primaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (!map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 })) @@ -80,7 +80,7 @@ GameActions::Result::Ptr BannerSetColourAction::QueryExecute(bool isExecuting) c 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); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } auto index = bannerElement->GetIndex(); @@ -88,7 +88,7 @@ GameActions::Result::Ptr BannerSetColourAction::QueryExecute(bool isExecuting) c if (banner == nullptr) { log_error("Invalid banner index: index = %u", index); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (isExecuting) From 9f4f1136ed2427c4e0e0c3e9a3d393d9f3bc6b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:05:22 +0300 Subject: [PATCH 614/681] Refactor explicit constructor usage in ParkSetDateAction --- src/openrct2/actions/ParkSetDateAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/ParkSetDateAction.cpp b/src/openrct2/actions/ParkSetDateAction.cpp index 94f90664b8..36aa12a413 100644 --- a/src/openrct2/actions/ParkSetDateAction.cpp +++ b/src/openrct2/actions/ParkSetDateAction.cpp @@ -46,7 +46,7 @@ GameActions::Result::Ptr ParkSetDateAction::Query() const { if (_year <= 0 || _year > MAX_YEAR || _month <= 0 || _month > MONTH_COUNT || _day <= 0 || _day > 31) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); From ea6d2f6b650fd8ddb2a749d2b265bf3d8b60f4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:06:34 +0300 Subject: [PATCH 615/681] Refactor explicit constructor usage in ParkSetParameterAction --- src/openrct2/actions/ParkSetParameterAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index 78be03a606..2e443b3751 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -35,7 +35,7 @@ GameActions::Result::Ptr ParkSetParameterAction::Query() const { if (_parameter >= ParkParameter::Count) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto res = MakeResult(); @@ -66,7 +66,7 @@ GameActions::Result::Ptr ParkSetParameterAction::Execute() const window_invalidate_by_class(WC_RIDE); break; default: - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto res = MakeResult(); From 4429bce0059f1f5d22a0f9280761cc8f1a49cdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:07:02 +0300 Subject: [PATCH 616/681] Refactor explicit constructor usage in ParkSetResearchFundingAction --- src/openrct2/actions/ParkSetResearchFundingAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/ParkSetResearchFundingAction.cpp b/src/openrct2/actions/ParkSetResearchFundingAction.cpp index 2bd92b56b7..7483c89f07 100644 --- a/src/openrct2/actions/ParkSetResearchFundingAction.cpp +++ b/src/openrct2/actions/ParkSetResearchFundingAction.cpp @@ -38,7 +38,7 @@ GameActions::Result::Ptr ParkSetResearchFundingAction::Query() const { if (_fundingAmount >= RESEARCH_FUNDING_COUNT) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); } From 6bfefc1cbd6ab9117269a352a40c75b785def560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:07:59 +0300 Subject: [PATCH 617/681] Refactor explicit constructor usage in PeepPickupAction --- src/openrct2/actions/PeepPickupAction.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 750c886891..9c75fce9e5 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -40,19 +40,19 @@ GameActions::Result::Ptr PeepPickupAction::Query() const if (_spriteId >= MAX_ENTITIES || _spriteId == SPRITE_INDEX_NULL) { log_error("Failed to pick up peep for sprite %d", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } if (!_loc.IsNull() && !LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } auto* const peep = TryGetEntity(_spriteId); if (peep == nullptr) { log_error("Failed to pick up peep for sprite %d", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } auto res = MakeResult(); @@ -64,7 +64,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const res->Position = peep->GetLocation(); if (!peep->CanBePickedUp()) { - return MakeResult(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } Peep* existing = network_get_pickup_peep(_owner); if (existing != nullptr) @@ -89,7 +89,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const res->Position = _loc; if (network_get_pickup_peep(_owner) != peep) { - return MakeResult(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2->Error != GameActions::Status::Ok) @@ -99,7 +99,7 @@ GameActions::Result::Ptr PeepPickupAction::Query() const break; default: log_error("Invalid pickup type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } return res; } @@ -110,7 +110,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const if (peep == nullptr) { log_error("Failed to pick up peep for sprite %d", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } auto res = MakeResult(); @@ -169,7 +169,7 @@ GameActions::Result::Ptr PeepPickupAction::Execute() const break; default: log_error("Invalid pickup type: %u", _type); - return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } return res; } From 586147c8dca8686d93d483db7d34d908d975b9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:09:44 +0300 Subject: [PATCH 618/681] Refactor explicit constructor usage in FootpathPlaceFromTrackAction --- src/openrct2/actions/FootpathPlaceFromTrackAction.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index e10498e574..f065357607 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -107,7 +107,9 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc if (!MapCheckCapacityAndReorganise(_loc)) { - return MakeResult(GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); + return MakeResult( + GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_TILE_ELEMENT_LIMIT_REACHED); } res->Cost = MONEY(12, 00); @@ -158,7 +160,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertQuery(GameAc auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res->Cost += supportHeight < 0 ? MONEY(20, 00) : (supportHeight / PATH_HEIGHT_STEP) * MONEY(5, 00); @@ -222,7 +224,7 @@ GameActions::Result::Ptr FootpathPlaceFromTrackAction::ElementInsertExecute(Game auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res->Cost += supportHeight < 0 ? MONEY(20, 00) : (supportHeight / PATH_HEIGHT_STEP) * MONEY(5, 00); From 1014c84620a1225b27cb5dd48b08a3d98283ce6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:11:01 +0300 Subject: [PATCH 619/681] Refactor explicit constructor usage in RideEntranceExitRemoveAction --- .../actions/RideEntranceExitRemoveAction.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index 6144d29eda..98691e9062 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -75,22 +75,22 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Query() const if (ride == nullptr) { log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) { - return MakeResult(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST); + return MakeResult(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, STR_NONE); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION); + return MakeResult(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, STR_NONE); } if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult(GameActions::Status::InvalidParameters, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE); } auto* entranceElement = FindEntranceElement( @@ -101,7 +101,7 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Query() const log_warning( "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, EnumValue(_rideIndex), _stationNum); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); @@ -113,7 +113,7 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Execute() const if (ride == nullptr) { log_warning("Invalid ride id %d for entrance/exit removal", EnumValue(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; @@ -132,7 +132,7 @@ GameActions::Result::Ptr RideEntranceExitRemoveAction::Execute() const log_warning( "Track Element not found. x = %d, y = %d, ride = %d, station = %d", _loc.x, _loc.y, EnumValue(_rideIndex), _stationNum); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto res = MakeResult(); From 33b18309cb9c01f97cbe3fa2f8925d230bc6b4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:11:31 +0300 Subject: [PATCH 620/681] Refactor explicit constructor usage in ParkMarketingAction --- src/openrct2/actions/ParkMarketingAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index 665f00fbc5..2b5ce2dda8 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -50,7 +50,7 @@ GameActions::Result::Ptr ParkMarketingAction::Query() const { if (static_cast(_type) >= std::size(AdvertisingCampaignPricePerWeek) || _numWeeks >= 256) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_NONE); } if (gParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) { From 4a408821fdd48e20ad150c67516f78c995520aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:14:10 +0300 Subject: [PATCH 621/681] Refactor explicit constructor usage in RideEntranceExitPlaceAction --- .../actions/RideEntranceExitPlaceAction.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 7b8bc2cbed..e9af0bfb73 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -49,20 +49,20 @@ void RideEntranceExitPlaceAction::Serialise(DataSerialiser& stream) GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const { - auto errorTitle = _isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION - : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; + const auto errorTitle = _isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION + : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; auto ride = get_ride(_rideIndex); if (ride == nullptr) { log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, errorTitle); + return MakeResult(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } if (_stationNum >= MAX_STATIONS) { log_warning("Invalid station number for ride. stationNum: %u", _stationNum); - return MakeResult(GameActions::Status::InvalidParameters, errorTitle); + return MakeResult(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) @@ -85,6 +85,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const auto result = GameActions::QueryNested(&rideEntranceExitRemove); if (result->Error != GameActions::Status::Ok) { + result->ErrorTitle = errorTitle; return result; } } @@ -92,7 +93,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const auto z = ride->stations[_stationNum].GetBaseZ(); if (!LocationValid(_loc) || (!gCheatsSandboxMode && !map_is_location_owned({ _loc, z }))) { - return MakeResult(GameActions::Status::NotOwned, errorTitle); + return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE); } if (!MapCheckCapacityAndReorganise(_loc)) @@ -129,13 +130,13 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const { // Remember when in unknown station num mode rideIndex is unknown and z is set // When in known station num mode rideIndex is known and z is unknown - auto errorTitle = _isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION - : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; + const auto errorTitle = _isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION + : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; auto ride = get_ride(_rideIndex); if (ride == nullptr) { log_warning("Invalid game command for ride %d", EnumValue(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, errorTitle); + return MakeResult(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) @@ -153,6 +154,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const auto result = GameActions::ExecuteNested(&rideEntranceExitRemove); if (result->Error != GameActions::Status::Ok) { + result->ErrorTitle = errorTitle; return result; } } @@ -217,8 +219,8 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Execute() const GameActions::Result::Ptr RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit) { - auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION - : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; + const auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION + : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; if (!gCheatsSandboxMode && !map_is_location_owned(loc)) { From bb149d471c5d24a5586838d1e9551768396b4b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:14:59 +0300 Subject: [PATCH 622/681] Refactor explicit constructor usage in RideSetAppearanceAction --- src/openrct2/actions/RideSetAppearanceAction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index d5355db520..4cf798a188 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -55,7 +55,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } switch (_type) @@ -66,7 +66,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const if (_index >= std::size(ride->track_colour)) { log_warning("Invalid game command, index %d out of bounds", _index); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } break; case RideSetAppearanceType::VehicleColourBody: @@ -75,7 +75,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const if (_index >= std::size(ride->vehicle_colours)) { log_warning("Invalid game command, index %d out of bounds", _index); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } break; case RideSetAppearanceType::VehicleColourScheme: @@ -83,7 +83,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const break; default: log_warning("Invalid game command, type %d not recognised", _type); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return std::make_unique(); @@ -95,7 +95,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } switch (_type) From 1660a5080b387fa19920d56c8036c36ffbbc66c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:16:17 +0300 Subject: [PATCH 623/681] Refactor explicit constructor usage in RideSetColourSchemeAction --- src/openrct2/actions/RideSetColourSchemeAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index 064d30bb9c..c0df05aacb 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.cpp +++ b/src/openrct2/actions/RideSetColourSchemeAction.cpp @@ -50,7 +50,7 @@ GameActions::Result::Ptr RideSetColourSchemeAction::Query() const { if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_LAND_NOT_OWNED_BY_PARK); } return std::make_unique(); } From effc6f44135c316371a4a6962f8da46763cceba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:17:18 +0300 Subject: [PATCH 624/681] Refactor explicit constructor usage in FootpathRemoveAction --- src/openrct2/actions/FootpathRemoveAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index fda653f89d..92c8d68264 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -63,7 +63,7 @@ GameActions::Result::Ptr FootpathRemoveAction::Query() const TileElement* footpathElement = GetFootpathElement(); if (footpathElement == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_NONE); } res->Cost = GetRefundPrice(footpathElement); @@ -111,7 +111,7 @@ GameActions::Result::Ptr FootpathRemoveAction::Execute() const } else { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_NONE); } res->Cost += GetRefundPrice(footpathElement); From 4fe71f3b453b10689ea3369329a055de2e49680c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:19:14 +0300 Subject: [PATCH 625/681] Refactor explicit constructor usage in LargeSceneryPlaceAction --- src/openrct2/actions/LargeSceneryPlaceAction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index b82c43b4e8..f4c7818f55 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -97,7 +97,8 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const if (HasReachedBannerLimit()) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME); + return MakeResult( + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } } From 8f9ad4743da285ab422919d31996b4c42df97cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:20:43 +0300 Subject: [PATCH 626/681] Refactor explicit constructor usage in FootpathPlaceAction --- src/openrct2/actions/FootpathPlaceAction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 20374cff65..95e592a88c 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -98,7 +98,7 @@ GameActions::Result::Ptr FootpathPlaceAction::Query() const if (_direction != INVALID_DIRECTION && !direction_valid(_direction)) { log_error("Direction invalid. direction = %u", _direction); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } footpath_provisional_remove(); @@ -205,7 +205,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementUpdateQuery(PathElement* pa if (GetFlags() & GAME_COMMAND_FLAG_GHOST && !pathElement->IsGhost()) { - return MakeResult(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE); + return MakeResult(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } return res; } @@ -269,7 +269,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re if (!MapCheckCapacityAndReorganise(_loc)) { - return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } res->Cost = MONEY(12, 00); @@ -319,7 +319,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertQuery(GameActions::Re auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res->Cost += supportHeight < 0 ? MONEY(20, 00) : (supportHeight / PATH_HEIGHT_STEP) * MONEY(5, 00); @@ -383,7 +383,7 @@ GameActions::Result::Ptr FootpathPlaceAction::ElementInsertExecute(GameActions:: auto surfaceElement = map_get_surface_element_at(_loc); if (surfaceElement == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res->Cost += supportHeight < 0 ? MONEY(20, 00) : (supportHeight / PATH_HEIGHT_STEP) * MONEY(5, 00); From 18eaada85b458ad4e1e7caf28afe80cf30444f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:21:58 +0300 Subject: [PATCH 627/681] Refactor explicit constructor usage in SetParkEntranceFeeAction --- src/openrct2/actions/SetParkEntranceFeeAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/SetParkEntranceFeeAction.cpp b/src/openrct2/actions/SetParkEntranceFeeAction.cpp index f8ff2fff87..807e2b04ba 100644 --- a/src/openrct2/actions/SetParkEntranceFeeAction.cpp +++ b/src/openrct2/actions/SetParkEntranceFeeAction.cpp @@ -43,11 +43,11 @@ GameActions::Result::Ptr SetParkEntranceFeeAction::Query() const bool forceFreeEntry = !park_entry_price_unlocked(); if (noMoney || forceFreeEntry) { - return std::make_unique(GameActions::Status::Disallowed, STR_NONE); + return std::make_unique(GameActions::Status::Disallowed, STR_NONE, STR_NONE); } if (_fee < MONEY_FREE || _fee > MAX_ENTRANCE_FEE) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return std::make_unique(); } From 1acbf149851b84022d51054472d2e7ab2b875f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:22:56 +0300 Subject: [PATCH 628/681] Refactor explicit constructor usage in SignSetStyleAction --- src/openrct2/actions/SignSetStyleAction.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 60599db6aa..7f36bcee82 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -43,7 +43,7 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (banner == nullptr) { log_error("Invalid banner id. id = ", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_isLarge) @@ -52,12 +52,12 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (tileElement == nullptr) { log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (tileElement->GetType() != TILE_ELEMENT_TYPE_LARGE_SCENERY) { log_warning("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } else @@ -67,7 +67,7 @@ GameActions::Result::Ptr SignSetStyleAction::Query() const if (wallElement == nullptr) { log_warning("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } @@ -80,7 +80,7 @@ GameActions::Result::Ptr SignSetStyleAction::Execute() const if (banner == nullptr) { log_error("Invalid banner id. id = ", _bannerIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } CoordsXY coords = banner->position.ToCoordsXY(); @@ -92,7 +92,7 @@ GameActions::Result::Ptr SignSetStyleAction::Execute() const { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } } else From d99c6641e7b5069794f3b3849ac6444251cac283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:25:20 +0300 Subject: [PATCH 629/681] Refactor explicit constructor usage in LandSetHeightAction --- src/openrct2/actions/LandSetHeightAction.cpp | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index aa43b243c3..8031b818e1 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -49,20 +49,21 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const { if (gParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return std::make_unique(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); + return std::make_unique( + GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, STR_NONE); } rct_string_id errorTitle = CheckParameters(); if (errorTitle != STR_NONE) { - return std::make_unique(GameActions::Status::Disallowed, errorTitle); + return std::make_unique(GameActions::Status::Disallowed, errorTitle, STR_NONE); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { if (!map_is_location_in_park(_coords)) { - return std::make_unique(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); + return std::make_unique(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE); } } @@ -75,7 +76,7 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const TileElement* tileElement = CheckTreeObstructions(); if (tileElement != nullptr) { - auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE); + auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE, STR_NONE); map_obstruction_set_error_text(tileElement, *res); return res; } @@ -89,13 +90,13 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const errorTitle = CheckRideSupports(); if (errorTitle != STR_NONE) { - return std::make_unique(GameActions::Status::Disallowed, errorTitle); + return std::make_unique(GameActions::Status::Disallowed, errorTitle, STR_NONE); } } auto* surfaceElement = map_get_surface_element_at(_coords); if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); // We need to check if there is _currently_ a level crossing on the tile. // For that, we need the old height, so we can't use the _height variable. @@ -103,13 +104,13 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const auto* pathElement = map_get_footpath_element(oldCoords); if (pathElement != nullptr && pathElement->AsPath()->IsLevelCrossing(oldCoords)) { - return MakeResult(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST); + return MakeResult(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, STR_NONE); } TileElement* tileElement = CheckFloatingStructures(reinterpret_cast(surfaceElement), _height); if (tileElement != nullptr) { - auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE); + auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE, STR_NONE); map_obstruction_set_error_text(tileElement, *res); return res; } @@ -138,7 +139,7 @@ GameActions::Result::Ptr LandSetHeightAction::Query() const tileElement = CheckUnremovableObstructions(reinterpret_cast(surfaceElement), zCorner); if (tileElement != nullptr) { - auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE); + auto res = MakeResult(GameActions::Status::Disallowed, STR_NONE, STR_NONE); map_obstruction_set_error_text(tileElement, *res); return res; } @@ -164,7 +165,7 @@ GameActions::Result::Ptr LandSetHeightAction::Execute() const auto* surfaceElement = map_get_surface_element_at(_coords); if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); cost += GetSurfaceHeightChangeCost(surfaceElement); SetSurfaceHeight(reinterpret_cast(surfaceElement)); From 76114bca2ff6e61a10f6fe063b0799e47dac49be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:26:21 +0300 Subject: [PATCH 630/681] Refactor explicit constructor usage in SmallSceneryRemoveAction --- src/openrct2/actions/SmallSceneryRemoveAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index 007737dacf..f145ca596f 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -111,7 +111,7 @@ GameActions::Result::Ptr SmallSceneryRemoveAction::Execute() const auto* entry = get_small_scenery_entry(_sceneryType); if (entry == nullptr) { - return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_SELECTION_OF_OBJECTS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res->Cost = entry->removal_price * 10; From d1c79e63f5638a854c164e29951f9affa1c12b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:26:42 +0300 Subject: [PATCH 631/681] Refactor explicit constructor usage in StaffFireAction --- src/openrct2/actions/StaffFireAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 4624d4357f..09b3dee3d1 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -34,14 +34,14 @@ GameActions::Result::Ptr StaffFireAction::Query() const if (_spriteId >= MAX_ENTITIES) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); @@ -53,7 +53,7 @@ GameActions::Result::Ptr StaffFireAction::Execute() const if (staff == nullptr) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } window_close_by_class(WC_FIRE_PROMPT); peep_sprite_remove(staff); From cce3609c75a48da16e36ae7eb3f27cc3621e182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:27:33 +0300 Subject: [PATCH 632/681] Refactor explicit constructor usage in LandRaiseAction --- src/openrct2/actions/LandRaiseAction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index d7a971c7bf..5a39145123 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -130,10 +130,8 @@ GameActions::Result::Ptr LandRaiseAction::QueryExecute(bool isExecuting) const if (!withinOwnership) { - GameActions::Result::Ptr ownerShipResult = std::make_unique( - GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); - ownerShipResult->ErrorTitle = STR_CANT_RAISE_LAND_HERE; - return ownerShipResult; + return std::make_unique( + GameActions::Status::Disallowed, STR_CANT_RAISE_LAND_HERE, STR_LAND_NOT_OWNED_BY_PARK); } // Force ride construction to recheck area From 5a237bd66337b8ece5496d6426deddf61d7a42f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:28:16 +0300 Subject: [PATCH 633/681] Refactor explicit constructor usage in StaffSetColourAction --- src/openrct2/actions/StaffSetColourAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index d3f3f830ba..e4ef8ad7c6 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -41,7 +41,7 @@ GameActions::Result::Ptr StaffSetColourAction::Query() const auto staffType = static_cast(_staffType); if (staffType != StaffType::Handyman && staffType != StaffType::Mechanic && staffType != StaffType::Security) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); } @@ -51,7 +51,7 @@ GameActions::Result::Ptr StaffSetColourAction::Execute() const // Update global uniform colour property if (!staff_set_colour(static_cast(_staffType), _colour)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } // Update each staff member's uniform From d006a1f48859e04de3dfd581f10e356382bdb36d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:28:43 +0300 Subject: [PATCH 634/681] Refactor explicit constructor usage in SmallScenerySetColourAction --- src/openrct2/actions/SmallScenerySetColourAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index ca77c3081a..d947600f78 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -84,7 +84,7 @@ GameActions::Result::Ptr SmallScenerySetColourAction::QueryExecute(bool isExecut if (sceneryElement == nullptr) { log_error("Small scenery not found at: x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(sceneryElement->IsGhost())) From 931b7f628d23fd069934a912c8ab0795be26d3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:29:30 +0300 Subject: [PATCH 635/681] Refactor explicit constructor usage in StaffSetNameAction --- src/openrct2/actions/StaffSetNameAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index eebfbd7715..2adf8554ca 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -71,7 +71,7 @@ GameActions::Result::Ptr StaffSetNameAction::Execute() const auto curName = staff->GetName(); if (curName == _name) { - return std::make_unique(GameActions::Status::Ok, STR_NONE); + return std::make_unique(); } if (!staff->SetName(_name)) From 219d49aee11970494ada587d4b3402e2f71cee30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:30:04 +0300 Subject: [PATCH 636/681] Refactor explicit constructor usage in StaffSetOrdersAction --- src/openrct2/actions/StaffSetOrdersAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 6c6bcf9e9f..deb3013ba1 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -39,7 +39,7 @@ GameActions::Result::Ptr StaffSetOrdersAction::Query() const { if (_spriteIndex >= MAX_ENTITIES) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto* staff = TryGetEntity(_spriteIndex); @@ -47,7 +47,7 @@ GameActions::Result::Ptr StaffSetOrdersAction::Query() const || (staff->AssignedStaffType != StaffType::Handyman && staff->AssignedStaffType != StaffType::Mechanic)) { log_warning("Invalid game command for sprite %u", _spriteIndex); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return std::make_unique(); @@ -59,7 +59,7 @@ GameActions::Result::Ptr StaffSetOrdersAction::Execute() const if (staff == nullptr) { log_warning("Invalid game command for sprite %u", _spriteIndex); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } staff->StaffOrders = _ordersId; From 6600f813de20ce365a5f7b9da8bd82e6e778dd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:30:45 +0300 Subject: [PATCH 637/681] Refactor explicit constructor usage in StaffSetCostumeAction --- src/openrct2/actions/StaffSetCostumeAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index fff8813b11..eb3a09ac7e 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -58,21 +58,21 @@ GameActions::Result::Ptr StaffSetCostumeAction::Query() const { if (_spriteIndex >= MAX_ENTITIES) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { log_warning("Invalid game command for sprite %u", _spriteIndex); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto spriteType = EntertainerCostumeToSprite(_costume); if (EnumValue(spriteType) > std::size(peep_slow_walking_types)) { log_warning("Invalid game command for sprite %u", _spriteIndex); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return std::make_unique(); } @@ -83,7 +83,7 @@ GameActions::Result::Ptr StaffSetCostumeAction::Execute() const if (staff == nullptr) { log_warning("Invalid game command for sprite %u", _spriteIndex); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto spriteType = EntertainerCostumeToSprite(_costume); From 86a07d7f4808b2c4dab4938c556c5561ac1f3158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:31:16 +0300 Subject: [PATCH 638/681] Refactor explicit constructor usage in StaffSetPatrolAreaAction --- src/openrct2/actions/StaffSetPatrolAreaAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index bee0769e31..0c54724a0f 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -37,19 +37,19 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Query() const if (_spriteId >= MAX_ENTITIES) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); @@ -97,7 +97,7 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const if (staff == nullptr) { log_error("Invalid spriteId. spriteId = %u", _spriteId); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } switch (_mode) From fc489452abcbce339d586db882ec27202cda1cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:32:53 +0300 Subject: [PATCH 639/681] Refactor explicit constructor usage in RideSetSettingAction --- src/openrct2/actions/RideSetSettingAction.cpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 64df3d3c0d..70dee20575 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -46,7 +46,7 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (ride == nullptr) { log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } switch (_setting) @@ -66,7 +66,7 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (!ride_is_mode_valid(ride) && !gCheatsShowAllOperatingModes) { log_warning("Invalid ride mode: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::Departure: @@ -75,28 +75,29 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (_value > 250) { log_warning("Invalid minimum waiting time: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(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); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::Operation: if (!ride_is_valid_operation_option(ride)) { log_warning("Invalid operation option value: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, GetOperationErrorMessage(ride)); + return MakeResult( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(ride)); } break; case RideSetSetting::InspectionInterval: if (_value > RIDE_INSPECTION_NEVER) { log_warning("Invalid inspection interval: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::Music: @@ -108,7 +109,7 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (musicObj == nullptr) { log_warning("Invalid music style: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; } @@ -116,7 +117,7 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (!ride_is_valid_lift_hill_speed(ride)) { log_warning("Invalid lift hill speed: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::NumCircuits: @@ -130,19 +131,19 @@ GameActions::Result::Ptr RideSetSettingAction::Query() const if (!ride_is_valid_num_circuits()) { log_warning("Invalid number of circuits: %u", _value); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::RideType: if (!gCheatsAllowArbitraryRideTypeChanges) { log_warning("Arbitrary ride type changes not allowed."); - return MakeResult(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; default: log_warning("Invalid RideSetSetting: %u", static_cast(_setting)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } return std::make_unique(); @@ -154,7 +155,7 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const if (ride == nullptr) { log_warning("Invalid ride: #%d.", EnumValue(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } switch (_setting) From 60838f563e50a305ec93f6a51a60d1f7a1683b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:36:30 +0300 Subject: [PATCH 640/681] Refactor explicit constructor usage for TileInspector --- src/openrct2/actions/TileModifyAction.cpp | 4 +- src/openrct2/world/TileInspector.cpp | 67 ++++++++++++----------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/openrct2/actions/TileModifyAction.cpp b/src/openrct2/actions/TileModifyAction.cpp index c2607053a5..9ce357d659 100644 --- a/src/openrct2/actions/TileModifyAction.cpp +++ b/src/openrct2/actions/TileModifyAction.cpp @@ -49,7 +49,7 @@ GameActions::Result::Ptr TileModifyAction::QueryExecute(bool isExecuting) const { if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_LAND_NOT_OWNED_BY_PARK); + return MakeResult(GameActions::Status::InvalidParameters, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE); } auto res = MakeResult(); switch (_setting) @@ -218,7 +218,7 @@ GameActions::Result::Ptr TileModifyAction::QueryExecute(bool isExecuting) const } default: log_error("invalid instruction"); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } res->Position.x = _loc.x; diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index fcb3a3798f..01698c85bd 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -96,7 +96,7 @@ namespace OpenRCT2::TileInspector { // Make sure there is enough space for the new element if (!MapCheckCapacityAndReorganise(loc)) - return std::make_unique(GameActions::Status::NoFreeElements, STR_NONE); + return std::make_unique(GameActions::Status::NoFreeElements, STR_NONE, STR_NONE); if (isExecuting) { @@ -107,14 +107,14 @@ namespace OpenRCT2::TileInspector if (corruptElement == nullptr) { log_warning("Failed to insert corrupt element."); - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } // Set the base height to be the same as the selected element TileElement* const selectedElement = map_get_nth_element_at(loc, elementIndex + 1); if (selectedElement == nullptr) { - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } corruptElement->base_height = corruptElement->clearance_height = selectedElement->base_height; @@ -208,7 +208,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr) { - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } auto largeScenery = tileElement->AsLargeScenery(); @@ -256,7 +256,7 @@ namespace OpenRCT2::TileInspector { if (!SwapTileElements(loc, first, second)) { - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } map_invalidate_tile_full(loc); @@ -284,7 +284,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr) { - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } switch (tileElement->GetType()) { @@ -362,7 +362,7 @@ namespace OpenRCT2::TileInspector // Make sure there is enough space for the new element if (!MapCheckCapacityAndReorganise(loc)) { - return std::make_unique(GameActions::Status::NoFreeElements, STR_NONE); + return std::make_unique(GameActions::Status::NoFreeElements, STR_NONE, STR_NONE); } auto tileLoc = TileCoordsXY(loc); @@ -378,7 +378,8 @@ namespace OpenRCT2::TileInspector if (newBanner == nullptr) { log_error("No free banners available"); - return std::make_unique(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME); + return std::make_unique( + GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); } newBanner->position = tileLoc; @@ -422,7 +423,7 @@ namespace OpenRCT2::TileInspector { const TileElement* const firstElement = map_get_first_element_at(loc); if (firstElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); // Count elements on tile int32_t numElement = 0; @@ -504,7 +505,7 @@ namespace OpenRCT2::TileInspector { TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); auto heightValidationResult = ValidateTileHeight(tileElement, heightOffset); if (heightValidationResult->Error != GameActions::Status::Ok) @@ -556,7 +557,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceelement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -582,7 +583,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -635,7 +636,7 @@ namespace OpenRCT2::TileInspector // No surface element on tile if (surfaceElement == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -658,7 +659,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -680,7 +681,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -702,7 +703,7 @@ namespace OpenRCT2::TileInspector TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TILE_ELEMENT_TYPE_PATH) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -725,11 +726,11 @@ namespace OpenRCT2::TileInspector TileElement* const entranceElement = map_get_nth_element_at(loc, elementIndex); if (entranceElement == nullptr || entranceElement->GetType() != TILE_ELEMENT_TYPE_ENTRANCE) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); auto ride = get_ride(entranceElement->AsEntrance()->GetRideIndex()); if (ride == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -765,7 +766,7 @@ namespace OpenRCT2::TileInspector TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TILE_ELEMENT_TYPE_WALL) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -789,7 +790,7 @@ namespace OpenRCT2::TileInspector TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TILE_ELEMENT_TYPE_WALL) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -817,7 +818,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -829,7 +830,7 @@ namespace OpenRCT2::TileInspector auto rideIndex = trackElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); const auto& ted = GetTrackElementDescriptor(type); const auto* trackBlock = ted.Block; @@ -856,7 +857,7 @@ namespace OpenRCT2::TileInspector if (tileElement == nullptr) { log_error("Track map element part not found!"); - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is @@ -890,7 +891,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -913,7 +914,7 @@ namespace OpenRCT2::TileInspector auto rideIndex = trackElement->AsTrack()->GetRideIndex(); auto ride = get_ride(rideIndex); if (ride == nullptr) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); const auto& ted = GetTrackElementDescriptor(type); auto trackBlock = ted.Block; @@ -940,7 +941,7 @@ namespace OpenRCT2::TileInspector if (tileElement == nullptr) { log_error("Track map element part not found!"); - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is @@ -972,7 +973,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -995,7 +996,7 @@ namespace OpenRCT2::TileInspector TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TILE_ELEMENT_TYPE_TRACK) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -1018,7 +1019,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -1045,7 +1046,7 @@ namespace OpenRCT2::TileInspector TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TILE_ELEMENT_TYPE_SMALL_SCENERY) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -1069,7 +1070,7 @@ namespace OpenRCT2::TileInspector TileElement* const bannerElement = map_get_nth_element_at(loc, elementIndex); if (bannerElement == nullptr || bannerElement->GetType() != TILE_ELEMENT_TYPE_BANNER) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { @@ -1091,10 +1092,10 @@ namespace OpenRCT2::TileInspector TileElement* const corruptElement = map_get_nth_element_at(loc, elementIndex); if (corruptElement == nullptr || corruptElement->GetType() != TILE_ELEMENT_TYPE_CORRUPT) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (corruptElement->IsLastForTile()) - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); if (isExecuting) { From ab248a67df84210219f61f8fa3da6d18fe85b9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:36:56 +0300 Subject: [PATCH 641/681] Refactor explicit constructor usage in TrackSetBrakeSpeedAction --- src/openrct2/actions/TrackSetBrakeSpeedAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 58c886b9e3..e9dc5ca73b 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -57,14 +57,14 @@ GameActions::Result::Ptr TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting if (!LocationValid(_loc)) { - return MakeResult(GameActions::Status::NotOwned, STR_NONE); + return MakeResult(GameActions::Status::NotOwned, STR_NONE, STR_NONE); } TileElement* tileElement = map_get_track_element_at_of_type(_loc, _trackType); if (tileElement == nullptr) { log_warning("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } if (isExecuting) From adbad84cc54b49765e4c046c5081a75bf5c54fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:37:34 +0300 Subject: [PATCH 642/681] Refactor explicit constructor usage in SurfaceSetStyleAction --- src/openrct2/actions/SurfaceSetStyleAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 47c1a32108..ed902ba9ab 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -53,7 +53,7 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Query() const if (_surfaceStyle > 0x1F) { log_error("Invalid surface style."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_NONE); } const auto surfaceObj = static_cast( @@ -62,7 +62,7 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Query() const if (surfaceObj == nullptr) { log_error("Invalid surface style."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_NONE); } } @@ -71,7 +71,7 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Query() const if (_edgeStyle > 0xF) { log_error("Invalid edge style."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_NONE); } const auto edgeObj = static_cast(objManager.GetLoadedObject(ObjectType::TerrainEdge, _edgeStyle)); @@ -79,7 +79,7 @@ GameActions::Result::Ptr SurfaceSetStyleAction::Query() const if (edgeObj == nullptr) { log_error("Invalid edge style."); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_NONE); } } From 2c38d3b180966d5249630cec21f1ad6f6a4a95e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:38:43 +0300 Subject: [PATCH 643/681] Refactor explicit constructor usage in RideSetVehicleAction --- src/openrct2/actions/RideSetVehicleAction.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 22e8a6eb59..a82575f86b 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -70,7 +70,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Query() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) @@ -94,13 +94,13 @@ GameActions::Result::Ptr RideSetVehicleAction::Query() const if (!ride_is_vehicle_type_valid(ride)) { log_error("Invalid vehicle type. type = %d", _value); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } auto rideEntry = get_ride_entry(_value); if (rideEntry == nullptr) { log_warning("Invalid ride entry, ride->subtype = %d", ride->subtype); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } // Validate preset @@ -108,14 +108,14 @@ GameActions::Result::Ptr RideSetVehicleAction::Query() const if (_colour >= presetList->count && _colour != 255 && _colour != 0) { log_error("Unknown vehicle colour preset. colour = %d", _colour); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } break; } default: log_error("Unknown vehicle command. type = %d", _type); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } return std::make_unique(); @@ -128,7 +128,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } switch (_type) @@ -151,7 +151,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { log_warning("Invalid ride entry, ride->subtype = %d", ride->subtype); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } auto clampValue = _value; if (!gCheatsDisableTrainLengthLimit) @@ -173,7 +173,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { log_warning("Invalid ride entry, ride->subtype = %d", ride->subtype); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } ride_set_vehicle_colours_to_random_preset(ride, _colour); @@ -187,7 +187,7 @@ GameActions::Result::Ptr RideSetVehicleAction::Execute() const default: log_error("Unknown vehicle command. type = %d", _type); - return std::make_unique(GameActions::Status::InvalidParameters, errTitle); + return std::make_unique(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } ride->num_circuits = 1; From 8e80a74daa83fcbca60a44e94ee0f253204fae53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:39:34 +0300 Subject: [PATCH 644/681] Refactor explicit constructor usage in WallSetColourAction --- src/openrct2/actions/WallSetColourAction.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index e81617d820..6983e798ca 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -66,7 +66,7 @@ GameActions::Result::Ptr 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 MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) @@ -78,19 +78,19 @@ GameActions::Result::Ptr WallSetColourAction::Query() const if (wallEntry == nullptr) { log_error("Could not find wall object"); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } if (_primaryColour > 31) { log_error("Primary colour invalid: colour = %d", _primaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_secondaryColour > 31) { log_error("Secondary colour invalid: colour = %d", _secondaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (wallEntry->flags & WALL_SCENERY_HAS_TERNARY_COLOUR) @@ -98,7 +98,7 @@ GameActions::Result::Ptr WallSetColourAction::Query() const if (_tertiaryColour > 31) { log_error("Tertiary colour invalid: colour = %d", _tertiaryColour); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } return res; @@ -118,7 +118,7 @@ GameActions::Result::Ptr WallSetColourAction::Execute() const { log_error( "Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) @@ -130,7 +130,7 @@ GameActions::Result::Ptr WallSetColourAction::Execute() const if (wallEntry == nullptr) { log_error("Could not find wall object"); - return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS); + return MakeResult(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } wallElement->SetPrimaryColour(_primaryColour); From 2702b2641fb189cee44ba6f6199a33ede146f9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:40:01 +0300 Subject: [PATCH 645/681] Refactor explicit constructor usage in ScenarioSetSettingAction --- src/openrct2/actions/ScenarioSetSettingAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 9f0b58b7ee..3e6b81f732 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -31,7 +31,7 @@ GameActions::Result::Ptr ScenarioSetSettingAction::Query() const if (_setting >= ScenarioSetSetting::Count) { log_error("Invalid setting: %u", _setting); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); @@ -242,7 +242,7 @@ GameActions::Result::Ptr ScenarioSetSettingAction::Execute() const break; default: log_error("Invalid setting: %u", _setting); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } window_invalidate_by_class(WC_EDITOR_SCENARIO_OPTIONS); return MakeResult(); From 84acdba0f0ea3e78bbf6e5125b91e7f101dc3e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:40:50 +0300 Subject: [PATCH 646/681] Refactor explicit constructor usage in WaterLowerAction --- src/openrct2/actions/WaterLowerAction.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 2bd0e66a66..8946bdec0f 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -113,10 +113,9 @@ GameActions::Result::Ptr WaterLowerAction::QueryExecute(bool isExecuting) const if (!withinOwnership) { - GameActions::Result::Ptr ownerShipResult = std::make_unique( - GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); - ownerShipResult->ErrorTitle = STR_CANT_LOWER_WATER_LEVEL_HERE; - return ownerShipResult; + return std::make_unique( + GameActions::Status::Disallowed, STR_CANT_LOWER_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); + ; } if (isExecuting && hasChanged) From a4e5a92c54e65bd78e4dd1034766895306e894fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:41:23 +0300 Subject: [PATCH 647/681] Refactor explicit constructor usage in WaterRaiseAction --- src/openrct2/actions/WaterRaiseAction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index dbf10f83d6..69ec4ae329 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -120,10 +120,8 @@ GameActions::Result::Ptr WaterRaiseAction::QueryExecute(bool isExecuting) const if (!withinOwnership) { - GameActions::Result::Ptr ownerShipResult = std::make_unique( - GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK); - ownerShipResult->ErrorTitle = STR_CANT_RAISE_WATER_LEVEL_HERE; - return ownerShipResult; + return std::make_unique( + GameActions::Status::Disallowed, STR_CANT_RAISE_WATER_LEVEL_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (isExecuting && hasChanged) From d8a255562aadb63ecbf278a60cb60afea3e64e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:42:16 +0300 Subject: [PATCH 648/681] Refactor explicit constructor usage in WaterSetHeightAction --- src/openrct2/actions/WaterSetHeightAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 298df52762..844ed6dae5 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -68,7 +68,7 @@ GameActions::Result::Ptr WaterSetHeightAction::Query() const if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); - return MakeResult(GameActions::Status::Unknown, STR_NONE); + return MakeResult(GameActions::Status::Unknown, STR_NONE, STR_NONE); } int32_t zHigh = surfaceElement->GetBaseZ(); @@ -90,7 +90,7 @@ GameActions::Result::Ptr WaterSetHeightAction::Query() const } if (surfaceElement->HasTrackThatNeedsWater()) { - return MakeResult(GameActions::Status::Disallowed, STR_NONE); + return MakeResult(GameActions::Status::Disallowed, STR_NONE, STR_NONE); } res->Cost = 250; @@ -113,7 +113,7 @@ GameActions::Result::Ptr WaterSetHeightAction::Execute() const if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } if (_height > surfaceElement->base_height) From 5c964d7fe865e00063410f934a16c38e68b35ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:43:40 +0300 Subject: [PATCH 649/681] Refactor explicit constructor usage in RideEntranceExitPlaceAction --- src/openrct2/actions/RideEntranceExitPlaceAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index e9af0bfb73..24b91608fa 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -98,7 +98,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const if (!MapCheckCapacityAndReorganise(_loc)) { - return MakeResult(GameActions::Status::NoFreeElements, errorTitle); + return MakeResult(GameActions::Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); } auto clear_z = z + (_isExit ? RideExitHeight : RideEntranceHeight); auto canBuild = MapCanConstructWithClearAt( @@ -224,12 +224,12 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::TrackPlaceQuery(const Coor if (!gCheatsSandboxMode && !map_is_location_owned(loc)) { - return MakeResult(GameActions::Status::NotOwned, errorTitle); + return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE); } if (!MapCheckCapacityAndReorganise(loc)) { - return MakeResult(GameActions::Status::NoFreeElements, errorTitle); + return MakeResult(GameActions::Status::NoFreeElements, errorTitle, STR_TILE_ELEMENT_LIMIT_REACHED); } int16_t baseZ = loc.z; int16_t clearZ = baseZ + (isExit ? RideExitHeight : RideEntranceHeight); From 72b59445aded81e8a8fe618ae9451ad30e48fa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:44:19 +0300 Subject: [PATCH 650/681] Refactor explicit constructor usage in RideSetPriceAction --- src/openrct2/actions/RideSetPriceAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 81b29ce432..12b9531fc2 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -55,14 +55,14 @@ GameActions::Result::Ptr RideSetPriceAction::Query() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return res; @@ -77,14 +77,14 @@ GameActions::Result::Ptr RideSetPriceAction::Execute() const if (ride == nullptr) { log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { log_warning("Invalid game command for ride %u", uint32_t(_rideIndex)); - return MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } if (!ride->overall_view.IsNull()) From d9222ab063f29342bc3f8bec06b5af6b11901bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:45:20 +0300 Subject: [PATCH 651/681] Refactor explicit constructor usage in RideDemolishAction --- src/openrct2/actions/RideDemolishAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 2d063ce8f6..cab6435f44 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -118,7 +118,7 @@ GameActions::Result::Ptr RideDemolishAction::Execute() const return RefurbishRide(ride); } - return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); + return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } GameActions::Result::Ptr RideDemolishAction::DemolishRide(Ride* ride) const From 89cca5cb32f5a084cefe869a056efc449d1175c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:47:04 +0300 Subject: [PATCH 652/681] Refactor explicit constructor usage in TrackRemoveAction --- src/openrct2/actions/TrackRemoveAction.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 65c1a1b1b1..d155087b76 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -111,7 +111,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const log_warning( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } if (tileElement->AsTrack()->IsIndestructible()) @@ -128,13 +128,13 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const if (ride == nullptr) { log_warning("Ride not found. ride index = %d.", rideIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(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); - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); const rct_preview_track* trackBlock = ted.Block; @@ -200,7 +200,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const log_warning( "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 MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } int32_t entranceDirections = ted.SequenceProperties[0]; @@ -216,7 +216,7 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } int8_t _support_height = tileElement->base_height - surfaceElement->base_height; @@ -304,7 +304,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const log_warning( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex(); @@ -315,7 +315,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const if (ride == nullptr) { log_warning("Ride not found. ride index = %d.", rideIndex); - return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); const rct_preview_track* trackBlock = ted.Block; @@ -375,7 +375,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const log_warning( "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 MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } int32_t entranceDirections = ted.SequenceProperties[0]; @@ -391,7 +391,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS); + return MakeResult(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } int8_t _support_height = tileElement->base_height - surfaceElement->base_height; From 3b8486ed4a51feee27f514eaa5af185cd8b62954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:48:36 +0300 Subject: [PATCH 653/681] Refactor explicit constructor usage in WallPlaceAction --- src/openrct2/actions/WallPlaceAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 5b528b2934..4b8c049010 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -490,7 +490,7 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( *wallAcrossTrack = false; if (map_is_location_at_edge(_loc)) { - return MakeResult(GameActions::Status::InvalidParameters, STR_OFF_EDGE_OF_MAP); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } TileElement* tileElement = map_get_first_element_at(_loc); @@ -512,7 +512,7 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( int32_t direction = tileElement->GetDirection(); if (_edge == direction) { - auto res = MakeResult(GameActions::Status::NoClearance, STR_NONE); + auto res = MakeResult(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); map_obstruction_set_error_text(tileElement, *res); return res; } @@ -520,7 +520,7 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction( } if (tileElement->GetOccupiedQuadrants() == 0) continue; - auto res = MakeResult(GameActions::Status::NoClearance, STR_NONE); + auto res = MakeResult(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); switch (elementType) { case TILE_ELEMENT_TYPE_ENTRANCE: From 12a200abfe976d9ad05241139b867dd7e1ee9dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:49:29 +0300 Subject: [PATCH 654/681] Refactor explicit constructor usage in SetCheatAction --- src/openrct2/actions/SetCheatAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 5f6887bd81..e6c07abb2c 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -68,18 +68,18 @@ GameActions::Result::Ptr SetCheatAction::Query() const { if (static_cast(_cheatType) >= static_cast(CheatType::Count)) { - MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } ParametersRange validRange = GetParameterRange(static_cast(_cheatType.id)); if (_param1 < validRange.first.first || _param1 > validRange.first.second) { - MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } if (_param2 < validRange.second.first || _param2 > validRange.second.second) { - MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } return MakeResult(); @@ -242,7 +242,7 @@ GameActions::Result::Ptr SetCheatAction::Execute() const default: { log_error("Unabled cheat: %d", _cheatType.id); - MakeResult(GameActions::Status::InvalidParameters, STR_NONE); + MakeResult(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } break; } From 3bb86ebcfa992a1d2b3e9feadde7ef2083b09334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:50:11 +0300 Subject: [PATCH 655/681] Refactor explicit constructor usage in LandSmoothAction --- src/openrct2/actions/LandSmoothAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 7e8c432099..f42cdf8c4e 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -608,7 +608,7 @@ GameActions::Result::Ptr LandSmoothAction::SmoothLand(bool isExecuting) const } default: log_error("Invalid map selection %u", _selectionType); - return MakeResult(GameActions::Status::InvalidParameters, std::get(res->ErrorTitle)); + return MakeResult(GameActions::Status::InvalidParameters, std::get(res->ErrorTitle), STR_NONE); } // switch selectionType // Raise / lower the land tool selection area From 1aed54f106e8cf28a00d7223b42a0af71d4383e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:51:09 +0300 Subject: [PATCH 656/681] Refactor explicit constructor usage in Peep::Place --- src/openrct2/peep/Peep.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 1a7eb5a5d4..7d3733c8c7 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -582,7 +582,8 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, } if (tileElement == nullptr) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE); + return std::make_unique( + GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } // Set the coordinate of destination to be exactly @@ -591,7 +592,7 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, if (!map_is_location_owned(destination)) { - return std::make_unique(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE); + return std::make_unique(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 }); From ec78ef39747f76f8b1078e697e7cfbc47dab087e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:52:51 +0300 Subject: [PATCH 657/681] Refactor explicit constructor usage in NetworkBase --- src/openrct2/network/NetworkBase.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 29bb5d6b93..b4e8b58791 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -3509,23 +3509,24 @@ GameActions::Result::Ptr network_set_player_group( NetworkGroup* fromgroup = network.GetGroupByID(actionPlayerId); if (player == nullptr) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); + return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } if (network.GetGroupByID(groupId) == nullptr) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS); + return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { return std::make_unique( - GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO); + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, STR_NONE); } if (groupId == 0 && fromgroup != nullptr && fromgroup->Id != 0) { - return std::make_unique(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP); + return std::make_unique( + GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); } if (isExecuting) @@ -3573,7 +3574,7 @@ GameActions::Result::Ptr network_modify_groups( NetworkGroup* newgroup = network.AddGroup(); if (newgroup == nullptr) { - return std::make_unique(GameActions::Status::Unknown, STR_CANT_DO_THIS); + return std::make_unique(GameActions::Status::Unknown, STR_CANT_DO_THIS, STR_NONE); } } } @@ -3583,14 +3584,14 @@ GameActions::Result::Ptr network_modify_groups( if (groupId == 0) { return std::make_unique( - GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED); + GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); } for (const auto& it : network.player_list) { if ((it.get())->Group == groupId) { return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO); + GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, STR_NONE); } } if (isExecuting) @@ -3604,7 +3605,7 @@ GameActions::Result::Ptr network_modify_groups( if (groupId == 0) { // can't change admin group permissions return std::make_unique( - GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED); + GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); } NetworkGroup* mygroup = nullptr; NetworkPlayer* player = network.GetPlayerByID(actionPlayerId); @@ -3615,7 +3616,7 @@ GameActions::Result::Ptr network_modify_groups( if (mygroup == nullptr || !mygroup->CanPerformAction(networkPermission)) { return std::make_unique( - GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF); + GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, STR_NONE); } } if (isExecuting) @@ -3674,7 +3675,8 @@ GameActions::Result::Ptr network_modify_groups( { if (groupId == 0) { - return std::make_unique(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP); + return std::make_unique( + GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); } if (isExecuting) { @@ -3684,7 +3686,7 @@ GameActions::Result::Ptr network_modify_groups( break; default: log_error("Invalid Modify Group Type: %u", static_cast(type)); - return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE); + return std::make_unique(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); } network.SaveGroups(); @@ -3700,12 +3702,12 @@ GameActions::Result::Ptr network_kick_player(NetworkPlayerId_t playerId, bool is { // Player might be already removed by the PLAYERLIST command, need to refactor non-game commands executing too // early. - return std::make_unique(GameActions::Status::Unknown, STR_NONE); + return std::make_unique(GameActions::Status::Unknown, STR_NONE, STR_NONE); } if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { - return std::make_unique(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST); + return std::make_unique(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, STR_NONE); } if (isExecuting) From cec8447c6f55aac6ef2f39b7c5a5a99a6ea41e69 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Wed, 27 Oct 2021 05:13:38 +0200 Subject: [PATCH 658/681] Refactor Viewport.cpp to use ScreenRect (#15790) --- src/openrct2-ui/windows/EditorMain.cpp | 2 +- src/openrct2-ui/windows/Main.cpp | 2 +- src/openrct2/cmdline/BenchSpriteSort.cpp | 2 +- src/openrct2/interface/Screenshot.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 111 +++++++++++------------ src/openrct2/interface/Viewport.h | 8 +- src/openrct2/interface/Window.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 15 +-- src/openrct2/world/Map.cpp | 6 +- src/openrct2/world/Sprite.cpp | 2 +- 10 files changed, 67 insertions(+), 85 deletions(-) diff --git a/src/openrct2-ui/windows/EditorMain.cpp b/src/openrct2-ui/windows/EditorMain.cpp index b87bbfec46..fdd0411203 100644 --- a/src/openrct2-ui/windows/EditorMain.cpp +++ b/src/openrct2-ui/windows/EditorMain.cpp @@ -62,5 +62,5 @@ rct_window* window_editor_main_open() */ static void window_editor_main_paint(rct_window* w, rct_drawpixelinfo* dpi) { - viewport_render(dpi, w->viewport, dpi->x, dpi->y, dpi->x + dpi->width, dpi->y + dpi->height); + viewport_render(dpi, w->viewport, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }); } diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 30e6fe8c8a..564cf4f21c 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -60,5 +60,5 @@ rct_window* window_main_open() */ void window_main_paint(rct_window* w, rct_drawpixelinfo* dpi) { - viewport_render(dpi, w->viewport, dpi->x, dpi->y, dpi->x + dpi->width, dpi->y + dpi->height); + viewport_render(dpi, w->viewport, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }); } diff --git a/src/openrct2/cmdline/BenchSpriteSort.cpp b/src/openrct2/cmdline/BenchSpriteSort.cpp index c7dcd8f0da..65c03e3f90 100644 --- a/src/openrct2/cmdline/BenchSpriteSort.cpp +++ b/src/openrct2/cmdline/BenchSpriteSort.cpp @@ -126,7 +126,7 @@ static std::vector extract_paint_session(std::string_view dpi.bits = static_cast(malloc(dpi.width * dpi.height)); log_info("Obtaining sprite data..."); - viewport_render(&dpi, &viewport, 0, 0, viewport.width, viewport.height, &sessions); + viewport_render(&dpi, &viewport, { { 0, 0 }, { viewport.width, viewport.height } }, &sessions); free(dpi.bits); drawing_engine_dispose(); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 8d784d4fd9..b0f5c3a5b2 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -373,7 +373,7 @@ static void RenderViewport(IDrawingEngine* drawingEngine, const rct_viewport& vi drawingEngine = tempDrawingEngine.get(); } dpi.DrawingEngine = drawingEngine; - viewport_render(&dpi, &viewport, 0, 0, viewport.width, viewport.height); + viewport_render(&dpi, &viewport, { { 0, 0 }, { viewport.width, viewport.height } }); } void screenshot_giant() diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 17b610dcba..3b494b8a72 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -217,13 +217,13 @@ void viewport_remove(rct_viewport* viewport) _viewports.erase(it); } -void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t maxZoom) +void viewports_invalidate(const ScreenRect& screenRect, int32_t maxZoom) { for (auto& vp : _viewports) { if (maxZoom == -1 || vp.zoom <= maxZoom) { - viewport_invalidate(&vp, left, top, right, bottom); + viewport_invalidate(&vp, screenRect); } } } @@ -792,45 +792,43 @@ void viewport_update_smart_vehicle_follow(rct_window* window) * ebp: bottom */ void viewport_render( - rct_drawpixelinfo* dpi, const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom, + rct_drawpixelinfo* dpi, const rct_viewport* viewport, const ScreenRect& screenRect, std::vector* sessions) { - if (right <= viewport->pos.x) + auto [topLeft, bottomRight] = screenRect; + + if (bottomRight.x <= viewport->pos.x) return; - if (bottom <= viewport->pos.y) + if (bottomRight.y <= viewport->pos.y) return; - if (left >= viewport->pos.x + viewport->width) + if (topLeft.x >= viewport->pos.x + viewport->width) return; - if (top >= viewport->pos.y + viewport->height) + if (topLeft.y >= viewport->pos.y + viewport->height) return; #ifdef DEBUG_SHOW_DIRTY_BOX - int32_t l = left, t = top, r = right, b = bottom; + const auto dirtyBoxTopLeft = topLeft; + const auto dirtyBoxTopRight = bottomRight - ScreenCoordsXY{ 1, 1 }; #endif - left = std::max(left - viewport->pos.x, 0); - right = std::min(right - viewport->pos.x, viewport->width); - top = std::max(top - viewport->pos.y, 0); - bottom = std::min(bottom - viewport->pos.y, viewport->height); + topLeft -= viewport->pos; + topLeft = ScreenCoordsXY{ + std::max(topLeft.x, 0) * viewport->zoom, + std::max(topLeft.y, 0) * viewport->zoom, + } + viewport->viewPos; - left = left * viewport->zoom; - right = right * viewport->zoom; - top = top * viewport->zoom; - bottom = bottom * viewport->zoom; + bottomRight -= viewport->pos; + bottomRight = ScreenCoordsXY{ + std::min(bottomRight.x, viewport->width) * viewport->zoom, + std::min(bottomRight.y, viewport->height) * viewport->zoom, + } + viewport->viewPos; - left += viewport->viewPos.x; - right += viewport->viewPos.x; - top += viewport->viewPos.y; - bottom += viewport->viewPos.y; - - viewport_paint(viewport, dpi, left, top, right, bottom, sessions); + viewport_paint(viewport, dpi, { topLeft, bottomRight }, sessions); #ifdef DEBUG_SHOW_DIRTY_BOX + // FIXME g_viewport_list doesn't exist anymore if (viewport != g_viewport_list) - { - gfx_fill_rect_inset(dpi, l, t, r - 1, b - 1, 0x2, INSET_RECT_F_30); - return; - } + gfx_fill_rect_inset(dpi, { dirtyBoxTopLeft, dirtyBoxTopRight }, 0x2, INSET_RECT_F_30); #endif } @@ -945,32 +943,33 @@ static void viewport_paint_column(paint_session* session) * ebp: bottom */ void viewport_paint( - const rct_viewport* viewport, rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, + const rct_viewport* viewport, rct_drawpixelinfo* dpi, const ScreenRect& screenRect, std::vector* recorded_sessions) { uint32_t viewFlags = viewport->flags; - uint32_t width = right - left; - uint32_t height = bottom - top; + uint32_t width = screenRect.GetWidth(); + uint32_t height = screenRect.GetHeight(); uint32_t bitmask = viewport->zoom >= 0 ? 0xFFFFFFFF & (0xFFFFFFFF * viewport->zoom) : 0xFFFFFFFF; + ScreenCoordsXY topLeft = screenRect.Point1; width &= bitmask; height &= bitmask; - left &= bitmask; - top &= bitmask; + topLeft.x &= bitmask; + topLeft.y &= bitmask; - auto x = left - static_cast(viewport->viewPos.x & bitmask); + auto x = topLeft.x - static_cast(viewport->viewPos.x & bitmask); x = x / viewport->zoom; x += viewport->pos.x; - auto y = top - static_cast(viewport->viewPos.y & bitmask); + auto y = topLeft.y - static_cast(viewport->viewPos.y & bitmask); y = y / viewport->zoom; y += viewport->pos.y; rct_drawpixelinfo dpi1; dpi1.DrawingEngine = dpi->DrawingEngine; dpi1.bits = dpi->bits + (x - dpi->x) + ((y - dpi->y) * (dpi->width + dpi->pitch)); - dpi1.x = left; - dpi1.y = top; + dpi1.x = topLeft.x; + dpi1.y = topLeft.y; dpi1.width = width; dpi1.height = height; dpi1.pitch = (dpi->width + dpi->pitch) - (width / viewport->zoom); @@ -1150,7 +1149,7 @@ std::optional screen_pos_to_map_pos(const ScreenCoordsXY& screenCoords void rct_viewport::Invalidate() const { - viewport_invalidate(this, viewPos.x, viewPos.y, viewPos.x + view_width, viewPos.y + view_height); + viewport_invalidate(this, { viewPos, viewPos + ScreenCoordsXY{ view_width, view_height } }); } CoordsXY viewport_coord_to_map_coord(const ScreenCoordsXY& coords, int32_t z) @@ -1742,9 +1741,9 @@ InteractionInfo get_map_coordinates_from_pos_window(rct_window* window, const Sc } /** - * Left, top, right and bottom represent 2D map coordinates at zoom 0. + * screenRect represents 2D map coordinates at zoom 0. */ -void viewport_invalidate(const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom) +void viewport_invalidate(const rct_viewport* viewport, const ScreenRect& screenRect) { // if unknown viewport visibility, use the containing window to discover the status if (viewport->visibility == VisibilityCache::Unknown) @@ -1764,31 +1763,23 @@ void viewport_invalidate(const rct_viewport* viewport, int32_t left, int32_t top if (viewport->visibility == VisibilityCache::Covered) return; - int32_t viewportLeft = viewport->viewPos.x; - int32_t viewportTop = viewport->viewPos.y; - int32_t viewportRight = viewport->viewPos.x + viewport->view_width; - int32_t viewportBottom = viewport->viewPos.y + viewport->view_height; - if (right > viewportLeft && bottom > viewportTop) + auto [topLeft, bottomRight] = screenRect; + const auto [viewportRight, viewportBottom] = viewport->viewPos + + ScreenCoordsXY{ viewport->view_width, viewport->view_height }; + + if (bottomRight.x > viewport->viewPos.x && bottomRight.y > viewport->viewPos.y) { - left = std::max(left, viewportLeft); - top = std::max(top, viewportTop); - right = std::min(right, viewportRight); - bottom = std::min(bottom, viewportBottom); + topLeft = { std::max(topLeft.x, viewport->viewPos.x), std::max(topLeft.y, viewport->viewPos.y) }; + topLeft -= viewport->viewPos; + topLeft = { topLeft.x / viewport->zoom, topLeft.y / viewport->zoom }; + topLeft += viewport->pos; - left -= viewportLeft; - top -= viewportTop; - right -= viewportLeft; - bottom -= viewportTop; - left = left / viewport->zoom; - top = top / viewport->zoom; - right = right / viewport->zoom; - bottom = bottom / viewport->zoom; - left += viewport->pos.x; - top += viewport->pos.y; - right += viewport->pos.x; - bottom += viewport->pos.y; + bottomRight = { std::max(bottomRight.x, viewportRight), std::max(bottomRight.y, viewportBottom) }; + bottomRight -= viewport->viewPos; + bottomRight = { bottomRight.x / viewport->zoom, bottomRight.y / viewport->zoom }; + bottomRight += viewport->pos; - gfx_set_dirty_blocks({ { left, top }, { right, bottom } }); + gfx_set_dirty_blocks({ topLeft, bottomRight }); } } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 697eb65510..d97b8a544f 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -106,7 +106,7 @@ void viewport_init_all(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_viewport* viewport); void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); void viewport_remove(rct_viewport* viewport); -void viewports_invalidate(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t maxZoom = -1); +void viewports_invalidate(const ScreenRect& screenRect, int32_t maxZoom = -1); void viewport_update_position(rct_window* window); void viewport_update_sprite_follow(rct_window* window); void viewport_update_smart_sprite_follow(rct_window* window); @@ -114,10 +114,10 @@ void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep); void viewport_update_smart_staff_follow(rct_window* window, const Staff* peep); void viewport_update_smart_vehicle_follow(rct_window* window); void viewport_render( - rct_drawpixelinfo* dpi, const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom, + rct_drawpixelinfo* dpi, const rct_viewport* viewport, const ScreenRect& screenRect, std::vector* sessions = nullptr); void viewport_paint( - const rct_viewport* viewport, rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, + const rct_viewport* viewport, rct_drawpixelinfo* dpi, const ScreenRect& screenRect, std::vector* sessions = nullptr); CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords); @@ -146,7 +146,7 @@ bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords); CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords); -void viewport_invalidate(const rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom); +void viewport_invalidate(const rct_viewport* viewport, const ScreenRect& screenRect); std::optional screen_get_map_xy(const ScreenCoordsXY& screenCoords, rct_viewport** viewport); std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int32_t z); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 663fcec783..9d7d5420f5 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1246,7 +1246,7 @@ static void window_draw_single(rct_drawpixelinfo* dpi, rct_window* w, int32_t le */ void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window* w) { - viewport_render(dpi, w->viewport, dpi->x, dpi->y, dpi->x + dpi->width, dpi->y + dpi->height); + viewport_render(dpi, w->viewport, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }); } void window_set_position(rct_window* w, const ScreenCoordsXY& screenCoords) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 5c33e6bd00..4e7bef98d2 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2147,22 +2147,13 @@ void track_design_draw_preview(TrackDesign* td6, uint8_t* pixels) auto drawingEngine = std::make_unique(GetContext()->GetUiContext()); dpi.DrawingEngine = drawingEngine.get(); - CoordsXY offset = { size_x / 2, size_y / 2 }; + const ScreenCoordsXY offset = { size_x / 2, size_y / 2 }; for (uint8_t i = 0; i < 4; i++) { gCurrentRotation = i; - auto screenCoords = translate_3d_to_2d_with_z(i, centre); - screenCoords.x -= offset.x; - screenCoords.y -= offset.y; - - int32_t left = screenCoords.x; - int32_t top = screenCoords.y; - int32_t right = left + size_x; - int32_t bottom = top + size_y; - - view.viewPos = { left, top }; - viewport_paint(&view, &dpi, left, top, right, bottom); + view.viewPos = translate_3d_to_2d_with_z(i, centre) - offset; + viewport_paint(&view, &dpi, { view.viewPos, view.viewPos + 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 b50ed72521..87f6fe8f71 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1161,7 +1161,7 @@ void map_invalidate_selection_rect() bottom += 32; top -= 32 + 2080; - viewports_invalidate(left, top, right, bottom); + viewports_invalidate({ { left, top }, { right, bottom } }); } static size_t CountElementsOnTile(const CoordsXY& loc) @@ -1813,7 +1813,7 @@ static void map_invalidate_tile_under_zoom(int32_t x, int32_t y, int32_t z0, int x2 = screenCoord.x + 32; y2 = screenCoord.y + 32 - z0; - viewports_invalidate(x1, y1, x2, y2, maxZoom); + viewports_invalidate({ { x1, y1 }, { x2, y2 } }, maxZoom); } /** @@ -1874,7 +1874,7 @@ void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs) bottom += 32; top -= 32 + 2080; - viewports_invalidate(left, top, right, bottom); + viewports_invalidate({ { left, top }, { right, bottom } }); } int32_t map_get_tile_side(const CoordsXY& mapPos) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 15fa2f1e8d..4454cbbea0 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -191,7 +191,7 @@ void EntityBase::Invalidate() break; } - viewports_invalidate(SpriteRect.GetLeft(), SpriteRect.GetTop(), SpriteRect.GetRight(), SpriteRect.GetBottom(), maxZoom); + viewports_invalidate(SpriteRect, maxZoom); } static void ResetEntityLists() From 5eeb9707871d32ef1cb5a660768835d0137da45e Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Wed, 27 Oct 2021 04:08:56 +0000 Subject: [PATCH 659/681] Merge Localisation/master into OpenRCT2/develop --- data/language/es-ES.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 0e5b5681f2..630f5e3a45 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3386,7 +3386,7 @@ STR_6157 :Consola STR_6158 :No se pudo cargar este archivo…{NEWLINE}Versión RCT incompatible: {COMMA16} STR_6159 :Próximo Suave STR_6160 :{WINDOW_COLOUR_2}Vehículos Disponibles: {BLACK}{STRING} -STR_6161 :Alternar Líneas de Cuadrícula +STR_6161 :Alternar líneas de cuadrícula STR_6162 :Ratón Giratorio Salvaje STR_6163 :Carros con forma de ratón atraviesan giros cerrados y caídas cortas, mientras giran gentilmente para desorientar a los pasajeros. STR_6164 :{WHITE}❌ @@ -3604,12 +3604,20 @@ STR_6400 :He descargado el instalador sin conexión de GOG, pero no está ins STR_6401 :Ya instalé RollerCoaster Tycoon 2 STR_6402 :OpenRCT2 Data Setup Configuración de datos OpenRCT2 STR_6403 :Elige el opcion que aplica mejor a ti. -STR_6404 :Please select the GOG RollerCoaster Tycoon 2 installer. Por favor, elige el Instalador de GOG OpenRCT2 +STR_6404 :Por favor selecciona el instalador de GOG de RollerCoaster Tycoon 2. STR_6405 :Elige Instalador de GOG STR_6406 :Instalador de GOG RollerCoaster Tycoon 2 STR_6407 :Puede tardar unos minutos. -STR_6408 :Please install “innoextract” to extract GOG Installer, then restart OpenRCT2. Instale "innoextract" para extraer el Instalador de GOG y luego reinicie OpenRCT2. +STR_6408 :Por favor instala "innoextract" para extraer el instalador de GOG y luego reinica OpenRCT2. STR_6409 :El archivo seleccionado no es el Instalador sin conexión de GOG para RollerCoaster Tycoon 2. Puede que hayas descargado GOG Galaxy downloader stub o ha seleccionado el archivo incorrecto. +STR_6433 :Eliminar +STR_6434 :Eliminar todos los edificios para este atajo. +STR_6435 :{WINDOW_COLOUR_2}Vándalos detenidos: {BLACK}{COMMA16} +STR_6436 :Activar/desactivar invisibilidad +STR_6437 :Invisible +STR_6438 :I +STR_6439 :Inspector de cuadrícula: Activar/desactivar invisibilidad +STR_6440 :Agua transparente STR_6454 :No se puede cambiar el nombre del banner… STR_6455 :No se puede cambiar el nombre del señal… STR_6456 :Captura de pantalla gigante From 3997210bbaa3c926d7549bf7c3002e9a1e8de3ec Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 27 Oct 2021 08:08:11 +0200 Subject: [PATCH 660/681] Fix #15585: Clear Tool issues --- src/openrct2-ui/windows/ClearScenery.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 35f75c7a88..7d64277f4b 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -75,6 +75,8 @@ public: gClearSmallScenery = true; gClearLargeScenery = false; gClearFootpath = false; + + Invalidate(); } void OnClose() override @@ -200,7 +202,7 @@ rct_window* window_clear_scenery_open() if (w != nullptr) return w; - w = WindowCreate(WC_CLEAR_SCENERY, WW, WH, 0); + w = WindowCreate(WC_CLEAR_SCENERY, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); if (w != nullptr) return w; From ad2a77bfa586721169afd858544a37b16c6958cc Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 27 Oct 2021 11:30:55 +0200 Subject: [PATCH 661/681] Fix #12981: New vehicles do not appear in vehicle type dropdown --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Ride.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b596fa8697..e0fe669b15 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. - Feature: [#15195] Added a bug-report item in file dropdown menu. - Feature: [#15294] New vehicle animation type: flying animal. +- Fix: [#12981] New vehicles do not appear in vehicle type dropdown. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#13912] “Dome park” no longer renders dome correctly. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 8131b436e9..a293dc3fbc 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -65,6 +65,8 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; static constexpr const int32_t WH = 207; static constexpr const int32_t WW = 316; +static void populate_vehicle_type_dropdown(Ride* ride, bool forceRefresh = false); + enum { WINDOW_RIDE_PAGE_MAIN, @@ -1249,6 +1251,8 @@ static rct_window* window_ride_open(Ride* ride) window_ride_update_overall_view(ride); + populate_vehicle_type_dropdown(ride, true); + return w; } @@ -2066,7 +2070,7 @@ static void window_ride_main_follow_ride(rct_window* w) } } -static void populate_vehicle_type_dropdown(Ride* ride) +static void populate_vehicle_type_dropdown(Ride* ride, bool forceRefresh) { auto& objManager = GetContext()->GetObjectManager(); rct_ride_entry* rideEntry = ride->GetRideEntry(); @@ -2091,7 +2095,7 @@ static void populate_vehicle_type_dropdown(Ride* ride) // Don't repopulate the list if we just did. auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - if (VehicleDropdownExpanded == selectionShouldBeExpanded && VehicleDropdownRideType == rideEntry + if (!forceRefresh && VehicleDropdownExpanded == selectionShouldBeExpanded && VehicleDropdownRideType == rideEntry && VehicleDropdownDataLanguage == ls.GetCurrentLanguage()) return; From acef8a592a15186bb3206d0f8d4ff43328677efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 27 Oct 2021 19:50:08 +0300 Subject: [PATCH 662/681] Apply review suggestion --- src/openrct2/actions/BannerPlaceAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 06c96ae3db..f1b21e63ae 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -61,7 +61,7 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const if (!MapCheckCapacityAndReorganise(_loc)) { log_error("No free map elements."); - return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto pathElement = GetValidPathElement(); @@ -87,7 +87,7 @@ GameActions::Result::Ptr BannerPlaceAction::Query() const if (HasReachedBannerLimit()) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } auto* bannerEntry = get_banner_entry(_bannerType); @@ -113,7 +113,7 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const if (!MapCheckCapacityAndReorganise(_loc)) { log_error("No free map elements."); - return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } auto* bannerEntry = get_banner_entry(_bannerType); @@ -127,7 +127,7 @@ GameActions::Result::Ptr BannerPlaceAction::Execute() const if (banner == nullptr) { log_error("No free banners available"); - return MakeResult(GameActions::Status::InvalidParameters, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); + return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } banner->flags = 0; banner->text = {}; From a8d2d5fd442969fc9d85517cc8dc5e7be677890f Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 27 Oct 2021 21:19:10 +0100 Subject: [PATCH 663/681] Staff patrol area 2 from NSF (#15600) * Port over changes from NSF for staff * Fix import and export * Fix crash on export * Fix import issue * Fix patrol import issue * Remove staff id field * Increment network version * Actually remove all instances of staff id * Update replays --- CMakeLists.txt | 4 +- openrct2.proj | 4 +- .../interface/ViewportInteraction.cpp | 1 + src/openrct2-ui/windows/Map.cpp | 1 + src/openrct2-ui/windows/StaffFirePrompt.cpp | 1 + src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/actions/SetCheatAction.cpp | 1 + src/openrct2/actions/StaffFireAction.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 20 +--- .../actions/StaffSetPatrolAreaAction.cpp | 29 +---- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/peep/Peep.cpp | 1 - src/openrct2/peep/Peep.h | 97 ---------------- src/openrct2/peep/Staff.cpp | 101 ++++++++--------- src/openrct2/peep/Staff.h | 106 +++++++++++++++++- src/openrct2/rct1/S4Importer.cpp | 23 ++-- src/openrct2/rct2/RCT2.h | 9 +- src/openrct2/rct2/S6Exporter.cpp | 46 +++++++- src/openrct2/rct2/S6Exporter.h | 1 + src/openrct2/rct2/S6Importer.cpp | 43 ++++++- src/openrct2/ride/RideConstruction.cpp | 1 + .../scripting/bindings/entity/ScStaff.cpp | 2 + .../scripting/bindings/world/ScMap.cpp | 1 + src/openrct2/world/Entity.cpp | 2 +- src/openrct2/world/EntityTweener.cpp | 2 +- src/openrct2/world/Sprite.cpp | 2 + 26 files changed, 273 insertions(+), 231 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd15138ef2..bc6cf198d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,9 +65,9 @@ set(OBJECTS_VERSION "1.0.21") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "c38af45d51a6e440386180feacf76c64720b6ac5") -set(REPLAYS_VERSION "0.0.56") +set(REPLAYS_VERSION "0.0.57") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "C47048B71A95A95428A08035C94AD10E7A020D4D") +set(REPLAYS_SHA1 "DF9C3B48755B19FDD4D0EC721007B98CD5B6F420") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index a895838c42..31b05e6561 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.21/objects.zip c38af45d51a6e440386180feacf76c64720b6ac5 - https://github.com/OpenRCT2/replays/releases/download/v0.0.56/replays.zip - C47048B71A95A95428A08035C94AD10E7A020D4D + https://github.com/OpenRCT2/replays/releases/download/v0.0.57/replays.zip + DF9C3B48755B19FDD4D0EC721007B98CD5B6F420 diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 8cd139cc03..6e0c45b47b 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index ce4feb57b9..07036740e2 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index b7c434798d..e229b466d9 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include static constexpr const rct_string_id WINDOW_TITLE = STR_SACK_STAFF; diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index bde55168e2..755ceec510 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -11,6 +11,7 @@ #include "core/CircularBuffer.h" #include "peep/Peep.h" +#include "peep/Staff.h" #include "ride/Vehicle.h" #include "world/Balloon.h" #include "world/Duck.h" @@ -296,7 +297,6 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Staff, AssignedStaffType); COMPARE_FIELD(Staff, MechanicTimeSinceCall); COMPARE_FIELD(Staff, HireDate); - COMPARE_FIELD(Staff, StaffId); COMPARE_FIELD(Staff, StaffOrders); COMPARE_FIELD(Staff, StaffMowingTimeout); COMPARE_FIELD(Staff, StaffRidesFixed); diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index e6c07abb2c..6685325d60 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -18,6 +18,7 @@ #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../network/network.h" +#include "../peep/Staff.h" #include "../ride/Ride.h" #include "../ride/Vehicle.h" #include "../scenario/Scenario.h" diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 09b3dee3d1..d0d3917f27 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -10,7 +10,7 @@ #include "StaffFireAction.h" #include "../interface/Window.h" -#include "../peep/Peep.h" +#include "../peep/Staff.h" #include "../world/Entity.h" StaffFireAction::StaffFireAction(uint16_t spriteId) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 5615118635..b3a63a128d 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -111,15 +111,8 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const } } - // Look for a free slot in the staff modes. - int32_t staffIndex; - for (staffIndex = 0; staffIndex < STAFF_MAX_COUNT; ++staffIndex) - { - if (gStaffModes[staffIndex] == StaffMode::None) - break; - } - - if (staffIndex == STAFF_MAX_COUNT) + auto numStaff = GetEntityListCount(EntityType::Staff); + if (numStaff == STAFF_MAX_COUNT) { // Too many staff members exist already. return MakeResult(GameActions::Status::NoFreeElements, STR_CANT_HIRE_NEW_STAFF, STR_TOO_MANY_STAFF_IN_GAME); @@ -222,14 +215,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const newPeep->EnergyTarget = 0x60; newPeep->StaffMowingTimeout = 0; - newPeep->StaffId = staffIndex; - - gStaffModes[staffIndex] = StaffMode::Walk; - - for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[staffIndex * STAFF_PATROL_AREA_SIZE + i] = 0; - } + newPeep->PatrolInfo = nullptr; res->SetData(StaffHireNewActionResult{ newPeep->sprite_index }); } diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 0c54724a0f..49231c99f0 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -55,29 +55,6 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Query() const return MakeResult(); } -static void UpdateStaffMode(const Staff& staff) -{ - bool isPatrolling = false; - const auto peepOffset = staff.StaffId * STAFF_PATROL_AREA_SIZE; - for (size_t i = peepOffset; i < peepOffset + STAFF_PATROL_AREA_SIZE; i++) - { - if (gStaffPatrolAreas[i] != 0) - { - isPatrolling = true; - break; - } - } - - if (isPatrolling) - { - gStaffModes[staff.StaffId] = StaffMode::Patrol; - } - else if (gStaffModes[staff.StaffId] == StaffMode::Patrol) - { - gStaffModes[staff.StaffId] = StaffMode::Walk; - } -} - static void InvalidatePatrolTile(const CoordsXY& loc) { // Align the location to the top left of the patrol square @@ -104,12 +81,14 @@ GameActions::Result::Ptr StaffSetPatrolAreaAction::Execute() const { case StaffSetPatrolAreaMode::Set: staff->SetPatrolArea(_loc, true); - UpdateStaffMode(*staff); InvalidatePatrolTile(_loc); break; case StaffSetPatrolAreaMode::Unset: staff->SetPatrolArea(_loc, false); - UpdateStaffMode(*staff); + if (!staff->HasPatrolArea()) + { + staff->ClearPatrolArea(); + } InvalidatePatrolTile(_loc); break; case StaffSetPatrolAreaMode::ClearAll: diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index b4e8b58791..0a6e98b558 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "15" +#define NETWORK_STREAM_VERSION "16" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 7d3733c8c7..8b70c848fd 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -655,7 +655,6 @@ void peep_sprite_remove(Peep* peep) else { staff->ClearPatrolArea(); - gStaffModes[staff->StaffId] = StaffMode::None; staff_update_greyed_patrol_areas(); News::DisableNewsItems(News::ItemType::Peep, staff->sprite_index); diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index c38aad8605..d73943098a 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -838,104 +838,7 @@ private: void GoToRideEntrance(Ride* ride); }; -struct Staff : Peep -{ - static constexpr auto cEntityType = EntityType::Staff; - -public: - StaffType AssignedStaffType; - uint16_t MechanicTimeSinceCall; // time getting to ride to fix - int32_t HireDate; - uint8_t StaffId; - uint8_t StaffOrders; - uint8_t StaffMowingTimeout; - union - { - uint16_t StaffLawnsMown; - uint16_t StaffRidesFixed; - }; - union - { - uint16_t StaffGardensWatered; - uint16_t StaffRidesInspected; - }; - union - { - uint16_t StaffLitterSwept; - uint16_t StaffVandalsStopped; - }; - uint16_t StaffBinsEmptied; - - void UpdateStaff(uint32_t stepsToTake); - void Tick128UpdateStaff(); - bool IsMechanic() const; - bool IsPatrolAreaSet(const CoordsXY& coords) const; - bool IsLocationInPatrol(const CoordsXY& loc) const; - bool IsLocationOnPatrolEdge(const CoordsXY& loc) const; - bool DoPathFinding(); - uint8_t GetCostume() const; - void SetCostume(uint8_t value); - void SetHireDate(int32_t hireDate); - int32_t GetHireDate() const; - - bool CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) const; - - static void ResetStats(); - void Serialise(DataSerialiser& stream); - - void ClearPatrolArea(); - void TogglePatrolArea(const CoordsXY& coords); - void SetPatrolArea(const CoordsXY& coords, bool value); - bool HasPatrolArea() const; - -private: - void UpdatePatrolling(); - void UpdateMowing(); - void UpdateSweeping(); - void UpdateEmptyingBin(); - void UpdateWatering(); - void UpdateAnswering(); - void UpdateFixing(int32_t steps); - bool UpdateFixingEnterStation(Ride* ride) const; - bool UpdateFixingMoveToBrokenDownVehicle(bool firstRun, const Ride* ride); - bool UpdateFixingFixVehicle(bool firstRun, const Ride* ride); - bool UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride* ride); - bool UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride); - bool UpdateFixingFixStationEnd(bool firstRun); - bool UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride); - bool UpdateFixingFixStationStart(bool firstRun, const Ride* ride); - bool UpdateFixingFixStationBrakes(bool firstRun, Ride* ride); - bool UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride); - bool UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride); - bool UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride); - void UpdateRideInspected(ride_id_t rideIndex); - void UpdateHeadingToInspect(); - - bool DoHandymanPathFinding(); - bool DoMechanicPathFinding(); - bool DoEntertainerPathFinding(); - bool DoMiscPathFinding(); - - Direction HandymanDirectionRandSurface(uint8_t validDirections) const; - - void EntertainerUpdateNearbyPeeps() const; - - uint8_t GetValidPatrolDirections(const CoordsXY& loc) const; - Direction HandymanDirectionToNearestLitter() const; - uint8_t HandymanDirectionToUncutGrass(uint8_t valid_directions) const; - Direction DirectionSurface(Direction initialDirection) const; - Direction DirectionPath(uint8_t validDirections, PathElement* pathElement) const; - Direction MechanicDirectionSurface() const; - Direction MechanicDirectionPathRand(uint8_t pathDirections) const; - Direction MechanicDirectionPath(uint8_t validDirections, PathElement* pathElement); - bool UpdatePatrollingFindWatering(); - bool UpdatePatrollingFindBin(); - bool UpdatePatrollingFindSweeping(); - bool UpdatePatrollingFindGrass(); -}; - static_assert(sizeof(Guest) <= 512); -static_assert(sizeof(Staff) <= 512); struct rct_sprite_bounds { diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 5086620659..399ec278b6 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -61,15 +61,18 @@ const rct_string_id StaffCostumeNames[] = { }; // clang-format on -// Every staff member has STAFF_PATROL_AREA_SIZE elements assigned to in this array, indexed by their StaffId -// Additionally there is a patrol area for each staff type, which is the union of the patrols of all staff members of that type -uint32_t gStaffPatrolAreas[(STAFF_MAX_COUNT + static_cast(StaffType::Count)) * STAFF_PATROL_AREA_SIZE]; -StaffMode gStaffModes[STAFF_MAX_COUNT + static_cast(StaffType::Count)]; uint16_t gStaffDrawPatrolAreas; colour_t gStaffHandymanColour; colour_t gStaffMechanicColour; colour_t gStaffSecurityColour; +static PatrolArea _mergedPatrolAreas[EnumValue(StaffType::Count)]; + +const PatrolArea& GetMergedPatrolArea(const StaffType type) +{ + return _mergedPatrolAreas[EnumValue(type)]; +} + // Maximum manhattan distance that litter can be for a handyman to seek to it const uint16_t MAX_LITTER_DISTANCE = 3 * COORDS_XY_STEP; @@ -84,12 +87,6 @@ template<> bool EntityBase::Is() const */ void staff_reset_modes() { - for (int32_t i = 0; i < STAFF_MAX_COUNT; i++) - gStaffModes[i] = StaffMode::None; - - for (int32_t i = STAFF_MAX_COUNT; i < (STAFF_MAX_COUNT + static_cast(StaffType::Count)); i++) - gStaffModes[i] = StaffMode::Walk; - staff_update_greyed_patrol_areas(); } @@ -142,27 +139,27 @@ bool staff_hire_new_member(StaffType staffType, EntertainerCostume entertainerTy */ void staff_update_greyed_patrol_areas() { - for (int32_t staff_type = 0; staff_type < static_cast(StaffType::Count); ++staff_type) + for (int32_t staffType = 0; staffType < EnumValue(StaffType::Count); ++staffType) { - const size_t staffPatrolOffset = (staff_type + STAFF_MAX_COUNT) * STAFF_PATROL_AREA_SIZE; - for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[staffPatrolOffset + i] = 0; - } + // Reset all of the merged data for the type. + auto& mergedData = _mergedPatrolAreas[staffType].Data; + std::fill(std::begin(mergedData), std::end(mergedData), 0); - for (auto peep : EntityList()) + for (auto staff : EntityList()) { - if (!peep->HasPatrolArea()) + if (EnumValue(staff->AssignedStaffType) != staffType) { continue; } - if (static_cast(peep->AssignedStaffType) == staff_type) + if (!staff->HasPatrolArea()) { - const size_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; - for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) - { - gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i]; - } + continue; + } + + auto staffData = staff->PatrolInfo->Data; + for (size_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) + { + mergedData[i] |= staffData[i]; } } } @@ -369,7 +366,6 @@ void Staff::ResetStats() static std::pair getPatrolAreaOffsetIndex(const CoordsXY& coords) { - // Patrol areas are 4 * 4 tiles (32 * 4) = 128 = 2^^7 auto tilePos = TileCoordsXY(coords); auto x = tilePos.x / 4; auto y = tilePos.y / 4; @@ -379,34 +375,37 @@ static std::pair getPatrolAreaOffsetIndex(const CoordsXY& coor return { byteIndex, byteBitIndex }; } -static bool staff_is_patrol_area_set(int32_t staffIndex, const CoordsXY& coords) -{ - // Patrol quads are stored in a bit map (8 patrol quads per byte). - // Each patrol quad is 4x4. - // Therefore there are in total 64 x 64 patrol quads in the 256 x 256 map. - // At the end of the array (after the slots for individual staff members), - // there are slots that save the combined patrol area for every staff type. - - int32_t peepOffset = staffIndex * STAFF_PATROL_AREA_SIZE; - auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); - return gStaffPatrolAreas[peepOffset + offset] & (1UL << bitIndex); -} - bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const { - return staff_is_patrol_area_set(StaffId, coords); + if (PatrolInfo != nullptr) + { + auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); + return PatrolInfo->Data[offset] & (1UL << bitIndex); + } + return false; } bool staff_is_patrol_area_set_for_type(StaffType type, const CoordsXY& coords) { - return staff_is_patrol_area_set(STAFF_MAX_COUNT + static_cast(type), coords); + auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); + return _mergedPatrolAreas[EnumValue(type)].Data[offset] & (1UL << bitIndex); } void Staff::SetPatrolArea(const CoordsXY& coords, bool value) { - int32_t peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; + if (PatrolInfo == nullptr) + { + if (value) + { + PatrolInfo = new PatrolArea(); + } + else + { + return; + } + } auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); - uint32_t* addr = &gStaffPatrolAreas[peepOffset + offset]; + auto* addr = &PatrolInfo->Data[offset]; if (value) { *addr |= (1 << bitIndex); @@ -419,21 +418,17 @@ void Staff::SetPatrolArea(const CoordsXY& coords, bool value) void Staff::ClearPatrolArea() { - const auto peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; - std::fill_n(&gStaffPatrolAreas[peepOffset], STAFF_PATROL_AREA_SIZE, 0); - gStaffModes[StaffId] = StaffMode::Walk; -} - -void Staff::TogglePatrolArea(const CoordsXY& coords) -{ - int32_t peepOffset = StaffId * STAFF_PATROL_AREA_SIZE; - auto [offset, bitIndex] = getPatrolAreaOffsetIndex(coords); - gStaffPatrolAreas[peepOffset + offset] ^= (1 << bitIndex); + delete PatrolInfo; + PatrolInfo = nullptr; } bool Staff::HasPatrolArea() const { - return gStaffModes[StaffId] == StaffMode::Patrol; + if (PatrolInfo == nullptr) + return false; + + constexpr auto hasData = [](const auto& datapoint) { return datapoint != 0; }; + return std::any_of(std::begin(PatrolInfo->Data), std::end(PatrolInfo->Data), hasData); } /** diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 16b28ab2e2..4583aa7bc4 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -18,13 +18,107 @@ constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = MAXIMUM_MAP_SIZE_TECHNICAL / 4; constexpr size_t STAFF_PATROL_AREA_SIZE = (STAFF_PATROL_AREA_BLOCKS_PER_LINE * STAFF_PATROL_AREA_BLOCKS_PER_LINE) / 32; -enum class StaffMode : uint8_t +struct PatrolArea { - None, - Walk, - Patrol = 3 + uint32_t Data[STAFF_PATROL_AREA_SIZE]; }; +struct Staff : Peep +{ + static constexpr auto cEntityType = EntityType::Staff; + +public: + PatrolArea* PatrolInfo; + StaffType AssignedStaffType; + uint16_t MechanicTimeSinceCall; // time getting to ride to fix + int32_t HireDate; + uint8_t StaffOrders; + uint8_t StaffMowingTimeout; + union + { + uint16_t StaffLawnsMown; + uint16_t StaffRidesFixed; + }; + union + { + uint16_t StaffGardensWatered; + uint16_t StaffRidesInspected; + }; + union + { + uint16_t StaffLitterSwept; + uint16_t StaffVandalsStopped; + }; + uint16_t StaffBinsEmptied; + + void UpdateStaff(uint32_t stepsToTake); + void Tick128UpdateStaff(); + bool IsMechanic() const; + bool IsPatrolAreaSet(const CoordsXY& coords) const; + bool IsLocationInPatrol(const CoordsXY& loc) const; + bool IsLocationOnPatrolEdge(const CoordsXY& loc) const; + bool DoPathFinding(); + uint8_t GetCostume() const; + void SetCostume(uint8_t value); + void SetHireDate(int32_t hireDate); + int32_t GetHireDate() const; + + bool CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) const; + + static void ResetStats(); + void Serialise(DataSerialiser& stream); + + void ClearPatrolArea(); + void SetPatrolArea(const CoordsXY& coords, bool value); + bool HasPatrolArea() const; + +private: + void UpdatePatrolling(); + void UpdateMowing(); + void UpdateSweeping(); + void UpdateEmptyingBin(); + void UpdateWatering(); + void UpdateAnswering(); + void UpdateFixing(int32_t steps); + bool UpdateFixingEnterStation(Ride* ride) const; + bool UpdateFixingMoveToBrokenDownVehicle(bool firstRun, const Ride* ride); + bool UpdateFixingFixVehicle(bool firstRun, const Ride* ride); + bool UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride* ride); + bool UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride); + bool UpdateFixingFixStationEnd(bool firstRun); + bool UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride); + bool UpdateFixingFixStationStart(bool firstRun, const Ride* ride); + bool UpdateFixingFixStationBrakes(bool firstRun, Ride* ride); + bool UpdateFixingMoveToStationExit(bool firstRun, const Ride* ride); + bool UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride); + bool UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride); + void UpdateRideInspected(ride_id_t rideIndex); + void UpdateHeadingToInspect(); + + bool DoHandymanPathFinding(); + bool DoMechanicPathFinding(); + bool DoEntertainerPathFinding(); + bool DoMiscPathFinding(); + + Direction HandymanDirectionRandSurface(uint8_t validDirections) const; + + void EntertainerUpdateNearbyPeeps() const; + + uint8_t GetValidPatrolDirections(const CoordsXY& loc) const; + Direction HandymanDirectionToNearestLitter() const; + uint8_t HandymanDirectionToUncutGrass(uint8_t valid_directions) const; + Direction DirectionSurface(Direction initialDirection) const; + Direction DirectionPath(uint8_t validDirections, PathElement* pathElement) const; + Direction MechanicDirectionSurface() const; + Direction MechanicDirectionPathRand(uint8_t pathDirections) const; + Direction MechanicDirectionPath(uint8_t validDirections, PathElement* pathElement); + bool UpdatePatrollingFindWatering(); + bool UpdatePatrollingFindBin(); + bool UpdatePatrollingFindSweeping(); + bool UpdatePatrollingFindGrass(); +}; +static_assert(sizeof(Staff) <= 512); + enum STAFF_ORDERS { STAFF_ORDERS_SWEEPING = (1 << 0), @@ -54,8 +148,6 @@ enum class EntertainerCostume : uint8_t extern const rct_string_id StaffCostumeNames[static_cast(EntertainerCostume::Count)]; -extern uint32_t gStaffPatrolAreas[(STAFF_MAX_COUNT + static_cast(StaffType::Count)) * STAFF_PATROL_AREA_SIZE]; -extern StaffMode gStaffModes[STAFF_MAX_COUNT + static_cast(StaffType::Count)]; extern uint16_t gStaffDrawPatrolAreas; extern colour_t gStaffHandymanColour; extern colour_t gStaffMechanicColour; @@ -73,3 +165,5 @@ int32_t staff_get_available_entertainer_costume_list(EntertainerCostume* costume money32 GetStaffWage(StaffType type); PeepSpriteType EntertainerCostumeToSprite(EntertainerCostume entertainerType); + +const PatrolArea& GetMergedPatrolArea(const StaffType type); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6377f48799..73df5ffe9a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1183,19 +1183,6 @@ namespace RCT1 void FixImportStaff() { - // The RCT2/OpenRCT2 structures are bigger than in RCT1, so initialise them to zero - std::fill(std::begin(gStaffModes), std::end(gStaffModes), StaffMode::None); - std::fill(std::begin(gStaffPatrolAreas), std::end(gStaffPatrolAreas), 0); - - for (int32_t i = 0; i < RCT1_MAX_STAFF; i++) - { - gStaffModes[i] = static_cast(_s4.staff_modes[i]); - } - - for (auto peep : EntityList()) - { - ImportStaffPatrolArea(peep); - } // Only the individual patrol areas have been converted, so generate the combined patrol areas of each staff type staff_update_greyed_patrol_areas(); } @@ -1258,8 +1245,11 @@ namespace RCT1 dst->PathfindGoal.direction = INVALID_DIRECTION; } - void ImportStaffPatrolArea(Staff* staffmember) + void ImportStaffPatrolArea(Staff* staffmember, uint8_t staffId) { + // TODO: It is likely that S4 files should have a staffmode check before setting + // patrol areas. See S6 importer. + // The patrol areas in RCT1 are encoded as follows, for coordinates x and y, separately for every staff member: // - Chop off the 7 lowest bits of the x and y coordinates, which leaves 5 bits per coordinate. // This step also "produces" the 4x4 patrol squares. @@ -1270,7 +1260,7 @@ namespace RCT1 // index in the array ----^ ^--- bit position in the 8-bit value // We do the opposite in this function to recover the x and y values. - int32_t peepOffset = staffmember->StaffId * RCT12_PATROL_AREA_SIZE; + int32_t peepOffset = staffId * RCT12_PATROL_AREA_SIZE; for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++) { if (_s4.patrol_areas[peepOffset + i] == 0) @@ -2886,13 +2876,14 @@ namespace RCT1 dst->AssignedStaffType = StaffType(src->staff_type); dst->MechanicTimeSinceCall = src->mechanic_time_since_call; dst->HireDate = src->park_entry_time; - dst->StaffId = src->staff_id; dst->StaffOrders = src->staff_orders; dst->StaffMowingTimeout = src->staff_mowing_timeout; dst->StaffLawnsMown = src->paid_to_enter; dst->StaffGardensWatered = src->paid_on_rides; dst->StaffLitterSwept = src->paid_on_food; dst->StaffBinsEmptied = src->paid_on_souvenirs; + + ImportStaffPatrolArea(dst, src->staff_id); } template<> void S4Importer::ImportEntity(const RCT12SpriteBase& srcBase) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 8b8f5d652a..f091c5d557 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -747,6 +747,13 @@ struct RCT2SpritePeep : RCT12SpriteBase }; assert_struct_size(RCT2SpritePeep, 0x100); +enum class RCT2StaffMode : uint8_t +{ + None, + Walk, + Patrol = 3 +}; + union RCT2Sprite { private: @@ -1025,7 +1032,7 @@ struct rct_s6_data uint32_t next_guest_index; uint16_t grass_and_scenery_tilepos; uint32_t patrol_areas[(RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT) * RCT12_PATROL_AREA_SIZE]; - uint8_t staff_modes[RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT]; + RCT2StaffMode staff_modes[RCT2_MAX_STAFF + RCT12_STAFF_TYPE_COUNT]; uint8_t pad_13CA73E; uint8_t pad_13CA73F; uint8_t byte_13CA740; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 620277ab85..6e418f494b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -523,8 +523,7 @@ void S6Exporter::Export() ExportRideMeasurements(); _s6.next_guest_index = gNextGuestNumber; _s6.grass_and_scenery_tilepos = gGrassSceneryTileLoopPosition; - std::memcpy(_s6.patrol_areas, gStaffPatrolAreas, sizeof(_s6.patrol_areas)); - std::memcpy(_s6.staff_modes, gStaffModes, sizeof(_s6.staff_modes)); + ExportStaffPatrolAreas(); // unk_13CA73E // pad_13CA73F // unk_13CA740 @@ -1107,6 +1106,48 @@ void S6Exporter::RebuildEntitySpatialLocation(const TileCoordsXY& loc) } } +void S6Exporter::ExportStaffPatrolAreas() +{ + std::fill(std::begin(_s6.staff_modes), std::end(_s6.staff_modes), RCT2StaffMode::None); + std::fill(std::begin(_s6.patrol_areas), std::end(_s6.patrol_areas), 0); + + auto staffId = 0; + for (auto* staff : EntityList()) + { + if (staff->HasPatrolArea()) + { + const size_t staffPatrolOffset = staffId * STAFF_PATROL_AREA_SIZE; + std::copy( + std::begin(staff->PatrolInfo->Data), std::end(staff->PatrolInfo->Data), &_s6.patrol_areas[staffPatrolOffset]); + _s6.staff_modes[staffId] = RCT2StaffMode::Patrol; + } + else + { + _s6.staff_modes[staffId] = RCT2StaffMode::Walk; + } + + _s6.sprites[staff->sprite_index].peep.staff_id = staffId; + + staffId++; + } + + constexpr auto hasData = [](const auto& datapoint) { return datapoint != 0; }; + for (const auto type : { StaffType::Handyman, StaffType::Mechanic, StaffType::Security, StaffType::Entertainer }) + { + const size_t staffPatrolOffset = (EnumValue(type) + STAFF_MAX_COUNT) * STAFF_PATROL_AREA_SIZE; + const auto& area = GetMergedPatrolArea(type); + std::copy(std::begin(area.Data), std::end(area.Data), &_s6.patrol_areas[staffPatrolOffset]); + if (std::any_of(std::begin(area.Data), std::end(area.Data), hasData)) + { + _s6.staff_modes[EnumValue(type) + STAFF_MAX_COUNT] = RCT2StaffMode::Patrol; + } + else + { + _s6.staff_modes[EnumValue(type) + STAFF_MAX_COUNT] = RCT2StaffMode::Walk; + } + } +} + void S6Exporter::RebuildEntityLinks() { // Rebuild next/previous linked list entity indexs @@ -1422,7 +1463,6 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Staff* src) dst->staff_type = static_cast(src->AssignedStaffType); dst->mechanic_time_since_call = src->MechanicTimeSinceCall; dst->park_entry_time = src->HireDate; - dst->staff_id = src->StaffId; dst->staff_orders = src->StaffOrders; dst->staff_mowing_timeout = src->StaffMowingTimeout; dst->paid_to_enter = src->StaffLawnsMown; diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index 42cc586019..12e28128ff 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -80,4 +80,5 @@ private: void ExportUserStrings(); void RebuildEntityLinks(); void RebuildEntitySpatialLocation(const TileCoordsXY& loc); + void ExportStaffPatrolAreas(); }; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 00ad2550af..b96ccbb1cf 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -421,8 +421,6 @@ public: ImportRideMeasurements(); gNextGuestNumber = _s6.next_guest_index; gGrassSceneryTileLoopPosition = _s6.grass_and_scenery_tilepos; - std::memcpy(gStaffPatrolAreas, _s6.patrol_areas, sizeof(_s6.patrol_areas)); - std::memcpy(gStaffModes, _s6.staff_modes, sizeof(_s6.staff_modes)); // unk_13CA73E // pad_13CA73F // unk_13CA740 @@ -485,6 +483,7 @@ public: FixLandOwnership(); research_determine_first_of_type(); + staff_update_greyed_patrol_areas(); } void FixLandOwnership() const @@ -1444,6 +1443,43 @@ public: } } + void ImportStaffPatrolArea(Staff* staffmember, uint8_t staffId) + { + // First check staff mode as vanilla did not clean up patrol areas when switching from patrol to walk + // without doing this we could accidentally add a patrol when it didn't exist. + if (_s6.staff_modes[staffId] != RCT2StaffMode::Patrol) + { + return; + } + int32_t peepOffset = staffId * RCT12_PATROL_AREA_SIZE; + for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++) + { + if (_s6.patrol_areas[peepOffset + i] == 0) + { + // No patrol for this area + continue; + } + + // Loop over the bits of the uint32_t + for (int32_t j = 0; j < 32; j++) + { + int8_t bit = (_s6.patrol_areas[peepOffset + i] >> j) & 1; + if (bit == 0) + { + // No patrol for this area + continue; + } + // val contains the 6 highest bits of both the x and y coordinates + int32_t val = j | (i << 5); + int32_t x = val & 0x03F; + x <<= 7; + int32_t y = val & 0xFC0; + y <<= 1; + staffmember->SetPatrolArea({ x, y }, true); + } + } + } + void ImportEntities() { for (int32_t i = 0; i < RCT2_MAX_SPRITES; i++) @@ -1866,13 +1902,14 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) dst->MechanicTimeSinceCall = src->mechanic_time_since_call; dst->HireDate = src->park_entry_time; - dst->StaffId = src->staff_id; dst->StaffOrders = src->staff_orders; dst->StaffMowingTimeout = src->staff_mowing_timeout; dst->StaffLawnsMown = src->paid_to_enter; dst->StaffGardensWatered = src->paid_on_rides; dst->StaffLitterSwept = src->paid_on_food; dst->StaffBinsEmptied = src->paid_on_souvenirs; + + ImportStaffPatrolArea(dst, src->staff_id); } template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 90dc3fd58f..86aee49fd3 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -20,6 +20,7 @@ #include "../localisation/Localisation.h" #include "../network/network.h" #include "../paint/VirtualFloor.h" +#include "../peep/Staff.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" #include "../util/Util.h" diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index 1d92e4cf29..717eb69d0e 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -11,6 +11,8 @@ # include "ScStaff.hpp" +# include "../../../peep/Staff.h" + namespace OpenRCT2::Scripting { ScStaff::ScStaff(uint16_t Id) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 4276a190f2..7509bab3f5 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -12,6 +12,7 @@ # include "ScMap.hpp" # include "../../../common.h" +# include "../../../peep/Staff.h" # include "../../../ride/Ride.h" # include "../../../ride/TrainManager.h" # include "../../../world/Balloon.h" diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/world/Entity.cpp index 7d45216925..2ff4271df1 100644 --- a/src/openrct2/world/Entity.cpp +++ b/src/openrct2/world/Entity.cpp @@ -11,6 +11,7 @@ #include "../core/DataSerialiser.h" #include "../peep/Peep.h" +#include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "Balloon.h" #include "Duck.h" @@ -223,7 +224,6 @@ void Staff::Serialise(DataSerialiser& stream) stream << AssignedStaffType; stream << MechanicTimeSinceCall; stream << HireDate; - stream << StaffId; stream << StaffOrders; stream << StaffMowingTimeout; stream << StaffLawnsMown; diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index 419f08976e..603c22305c 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -9,12 +9,12 @@ #include "EntityTweener.h" #include "../peep/Peep.h" +#include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "EntityList.h" #include "Sprite.h" #include - void EntityTweener::PopulateEntities() { for (auto ent : EntityList()) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 4454cbbea0..455b55a6b6 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -18,6 +18,7 @@ #include "../interface/Viewport.h" #include "../peep/Peep.h" #include "../peep/RideUseSystem.h" +#include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "../scenario/Scenario.h" #include "Balloon.h" @@ -555,6 +556,7 @@ static void FreeEntity(EntityBase& entity) if (staff != nullptr) { staff->SetName({}); + staff->ClearPatrolArea(); } else if (guest != nullptr) { From c2b16cedce3f190337d2a6a413a8d531a06a5858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 28 Oct 2021 01:20:17 +0300 Subject: [PATCH 664/681] Fix #15809: Assign a temporary result to avoid crashes --- src/openrct2/world/ConstructionClearance.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index b573d62664..62f52901c8 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -119,6 +119,8 @@ GameActions::Result::Ptr MapCanConstructWithClearAt( auto res = std::make_unique(); uint8_t groundFlags = ELEMENT_IS_ABOVE_GROUND; + res->SetData(ConstructClearResult{ groundFlags }); + bool canBuildCrossing = false; if (map_is_edge(pos)) { From 86f91585d2ce877ebc0e2945084ee003a231a861 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 28 Oct 2021 04:08:32 +0000 Subject: [PATCH 665/681] Merge Localisation/master into OpenRCT2/develop --- data/language/ar-EG.txt | 2 +- data/language/ca-ES.txt | 2 +- data/language/cs-CZ.txt | 2 +- data/language/da-DK.txt | 2 +- data/language/de-DE.txt | 2 +- data/language/eo-OO.txt | 2 +- data/language/es-ES.txt | 4 ++-- data/language/fi-FI.txt | 2 +- data/language/fr-FR.txt | 2 +- data/language/hu-HU.txt | 2 +- data/language/it-IT.txt | 2 +- data/language/ko-KR.txt | 2 +- data/language/nb-NO.txt | 2 +- data/language/nl-NL.txt | 2 +- data/language/pl-PL.txt | 2 +- data/language/pt-BR.txt | 2 +- data/language/ru-RU.txt | 2 +- data/language/sv-SE.txt | 2 +- data/language/tr-TR.txt | 2 +- data/language/vi-VN.txt | 2 +- data/language/zh-CN.txt | 2 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index 36ede8a126..edbe0bab98 100644 --- a/data/language/ar-EG.txt +++ b/data/language/ar-EG.txt @@ -1734,7 +1734,7 @@ 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_2387 :{BLACK}To achieve a park value of at least {POP16}{POP16}{CURRENCY} at the end of {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index 17c5e36385..a31b595a8e 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -1736,7 +1736,7 @@ STR_2383 :Aigua STR_2384 :{WINDOW_COLOUR_2}El vostre objectiu: STR_2385 :{BLACK}Cap STR_2386 :{BLACK}Tenir al menys {COMMA16} 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}{MONTHYEAR}. +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. diff --git a/data/language/cs-CZ.txt b/data/language/cs-CZ.txt index 954f318596..37ffa8bf4d 100644 --- a/data/language/cs-CZ.txt +++ b/data/language/cs-CZ.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Dosáhnout hodnoty parku alespoň {POP16}{POP16}{CURRENCY} na konci {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index 471ab7bba6..b9063ca714 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -1735,7 +1735,7 @@ 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_2387 :{BLACK}At opnå en Parkværdi på mindst {POP16}{POP16}{CURRENCY} ved udgangen af {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 88c94be1fb..5c17a0b528 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Einen Verkehrswert von mindestens {POP16}{POP16}{CURRENCY} zu erreichen bis {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/eo-OO.txt b/data/language/eo-OO.txt index e2267e339f..a2ab7a9ba1 100644 --- a/data/language/eo-OO.txt +++ b/data/language/eo-OO.txt @@ -1735,7 +1735,7 @@ 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_2387 :{BLACK}Atingi parkvaloron ne malpli ol {POP16}{POP16}{CURRENCY} al la fino de {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 630f5e3a45..24e496ed8b 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Conseguir un valor del parque {POP16}{POP16}{CURRENCY} a final de {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 @@ -2830,7 +2830,7 @@ STR_5554 :Activar herramienta de montaña STR_5555 :Muestra vehículos de otros tipos de vía STR_5556 :Expulsar jugador STR_5557 :Mantener conex. tras desincronización (Multijugador) -STR_5558 :Se debe reiniciar para aplicar los cambios +STR_5558 :Esta configuración solo tendrá efecto después de que haya reiniciado OpenRCT2 STR_5559 :Inspecciones 10m STR_5560 :Establece el tiempo de inspección a 'Cada 10 minutos' en todas las atracciones STR_5561 :No se pudo cargar el idioma. diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 97bd1cb552..147718d011 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -1741,7 +1741,7 @@ 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_2387 :{BLACK}Saavuta puiston arvoksi vähintään {POP16}{POP16}{CURRENCY} {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} loppuun mennessä +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 diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index cdd6b22c0f..e2bc56b575 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -1740,7 +1740,7 @@ 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_2387 :{BLACK}Atteindre une valeur de parc d’au moins {POP16}{POP16}{CURRENCY} à la fin {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 31475abf09..999f7eb343 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -1729,7 +1729,7 @@ 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_2387 :{BLACK}Legyen legalább {POP16}{POP16}{CURRENCY} a parkod értéke {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}végére +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 diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 6b44aac962..66657c4164 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -1739,7 +1739,7 @@ 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_2387 :{BLACK}Far raggiungere al parco un valore di almeno {POP16}{POP16}{CURRENCY} entro la fine di {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 5224b36576..b49c37e449 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -1739,7 +1739,7 @@ STR_2383 :물 STR_2384 :{WINDOW_COLOUR_2}목표: STR_2385 :{BLACK}없음 STR_2386 :{BLACK}공원에 최소 {COMMA16}명 이상의 손님을 {MONTHYEAR}까지 유치하고, 공원 등급을 600 이상으로 유지하세요 -STR_2387 :{BLACK}최소 {POP16}{POP16}{CURRENCY} 이상의 공원 가치를 {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}까지 달성하세요 +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종의 다른 롤러코스터를 공원에 운용하세요 diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index c1c48d17f8..b7acda6a9a 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -1734,7 +1734,7 @@ 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_2387 :{BLACK}To achieve a park value of at least {POP16}{POP16}{CURRENCY} at the end of {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 6387dec8b5..32bdf20312 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Om een parkwaarde van ten minste {POP16}{POP16}{CURRENCY} te hebben aan het einde van {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index 44dbfceba4..f6326d84fe 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -1735,7 +1735,7 @@ 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 atrakcyjności parku wynoszącej przynajmniej 600 -STR_2387 :{BLACK}Uzyskaj wartość parku nie mniejszą niż {POP16}{POP16}{CURRENCY} na koniec {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index ab507675e4..f09c9ab051 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -1735,7 +1735,7 @@ 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_2387 :{BLACK}Alcançar um valor do parque de pelo menos {POP16}{POP16}{CURRENCY} até o fim de {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index f50e4f198f..256294f99a 100644 --- a/data/language/ru-RU.txt +++ b/data/language/ru-RU.txt @@ -1731,7 +1731,7 @@ STR_2383 :Вода STR_2384 :{WINDOW_COLOUR_2}Ваша задача: STR_2385 :{BLACK}Нет STR_2386 :{BLACK}Иметь не менее {COMMA16} гостей в парке к концу {MONTHYEAR}, и рейтинг парка не менее 600 -STR_2387 :{BLACK}Поднять стоимость парка до {POP16}{POP16}{CURRENCY} к концу {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/sv-SE.txt b/data/language/sv-SE.txt index 4747803617..ba254d8a68 100644 --- a/data/language/sv-SE.txt +++ b/data/language/sv-SE.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Att uppnå ett parkvärde över {POP16}{POP16}{CURRENCY} tills {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/tr-TR.txt b/data/language/tr-TR.txt index 183110a244..67883037de 100644 --- a/data/language/tr-TR.txt +++ b/data/language/tr-TR.txt @@ -1731,7 +1731,7 @@ 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_2387 :{BLACK}Park değeri en az {POP16}{POP16}{CURRENCY} {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} kadar olmalı +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 diff --git a/data/language/vi-VN.txt b/data/language/vi-VN.txt index e3ac81474a..661ebe5cdb 100644 --- a/data/language/vi-VN.txt +++ b/data/language/vi-VN.txt @@ -1736,7 +1736,7 @@ 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_2387 :{BLACK}Đạt giá trị công viên ít nhất {POP16}{POP16}{CURRENCY} vào cuối {PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} +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 diff --git a/data/language/zh-CN.txt b/data/language/zh-CN.txt index b0f08e3d4f..441dff9142 100644 --- a/data/language/zh-CN.txt +++ b/data/language/zh-CN.txt @@ -1740,7 +1740,7 @@ STR_2383 :水面 STR_2384 :{WINDOW_COLOUR_2}你的目标: STR_2385 :{BLACK}无 STR_2386 :{BLACK}在{POP16}{MONTHYEAR} 之前乐园内至少有 {PUSH16}{PUSH16}{COMMA16} 游客, 并且乐园评分不低于 600 -STR_2387 :{BLACK}在{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}之前乐园价值不低于{POP16}{POP16}{CURRENCY} +STR_2387 :{BLACK}在{PUSH16}{MONTHYEAR}之前乐园价值不低于{CURRENCY} STR_2388 :{BLACK}尽情玩吧! STR_2389 :{BLACK}建造你的最佳{STRINGID}吧! STR_2390 :{BLACK}在你的乐园中运营10种类型的过山车, 并且每一个的兴奋度不低于 6.00 From 3016701a98cf0d6c935d043f7ffd97e72f5e023b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:15:24 +0300 Subject: [PATCH 666/681] Prevent map_is_location_owned from overwriting the global error message --- src/openrct2/world/Map.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 87f6fe8f71..8dd5d2473b 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -786,8 +786,6 @@ bool map_is_location_owned(const CoordsXYZ& loc) } } } - - gGameCommandErrorText = STR_LAND_NOT_OWNED_BY_PARK; return false; } From 45c4ed2679a316a61ccb1c6a790947bdfb64c425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:20:42 +0300 Subject: [PATCH 667/681] Fix error messages for when map_is_location_owned is false --- src/openrct2/actions/RideEntranceExitPlaceAction.cpp | 4 ++-- src/openrct2/actions/WallPlaceAction.cpp | 2 +- src/openrct2/peep/Peep.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 24b91608fa..bc1e02377d 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -93,7 +93,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::Query() const auto z = ride->stations[_stationNum].GetBaseZ(); if (!LocationValid(_loc) || (!gCheatsSandboxMode && !map_is_location_owned({ _loc, z }))) { - return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE); + return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } if (!MapCheckCapacityAndReorganise(_loc)) @@ -224,7 +224,7 @@ GameActions::Result::Ptr RideEntranceExitPlaceAction::TrackPlaceQuery(const Coor if (!gCheatsSandboxMode && !map_is_location_owned(loc)) { - return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_NONE); + return MakeResult(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } if (!MapCheckCapacityAndReorganise(loc)) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 4b8c049010..d257136175 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -89,7 +89,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const } else if (!map_is_location_owned(_loc)) { - return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } else if (!_trackDesignDrawingPreview && (_loc.x > GetMapSizeMaxXY() || _loc.y > GetMapSizeMaxXY())) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 8b70c848fd..4666fb0db8 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -592,7 +592,8 @@ std::unique_ptr Peep::Place(const TileCoordsXYZ& location, if (!map_is_location_owned(destination)) { - return std::make_unique(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return std::make_unique( + GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK); } if (auto res = MapCanConstructAt({ destination, destination.z, destination.z + (1 * 8) }, { 0b1111, 0 }); From 14b6894e779eac8cb7231759d7eb1d7a711aa75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:21:59 +0300 Subject: [PATCH 668/681] Remove overwriting error message in map_is_location_in_park --- src/openrct2/world/Map.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 8dd5d2473b..a8b1cc7d51 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -803,8 +803,6 @@ bool map_is_location_in_park(const CoordsXY& coords) if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED) return true; } - - gGameCommandErrorText = STR_LAND_NOT_OWNED_BY_PARK; return false; } From 322e1203fcef75f45be4cc652b485622cbef9b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:26:07 +0300 Subject: [PATCH 669/681] Fix error message for WallPlaceAction --- src/openrct2/actions/WallPlaceAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index d257136175..61587af65b 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -84,7 +84,7 @@ GameActions::Result::Ptr WallPlaceAction::Query() const { if (!map_is_location_in_park(_loc)) { - return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return MakeResult(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } else if (!map_is_location_owned(_loc)) From 3f19d6f7d7c148737793f81c7f57d203cb7a7ce7 Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 28 Oct 2021 21:38:23 +0100 Subject: [PATCH 670/681] Split Peep header Guest into separate header (#15810) * Move guest functions and classes to guest header * Reduce includes of Peep.h --- src/openrct2-ui/windows/Dropdown.cpp | 1 + src/openrct2-ui/windows/GameBottomToolbar.cpp | 1 + src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 1 + .../windows/TitleCommandEditor.cpp | 1 + src/openrct2/Editor.cpp | 1 + src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/core/DataSerialiserTraits.h | 1 + src/openrct2/interface/Viewport.cpp | 1 + src/openrct2/libopenrct2.vcxproj | 1 + src/openrct2/management/Award.cpp | 2 +- src/openrct2/management/Marketing.cpp | 2 +- src/openrct2/management/Marketing.h | 4 +- src/openrct2/network/NetworkPlayer.h | 2 +- .../network/NetworkServerAdvertiser.cpp | 2 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- src/openrct2/peep/Guest.cpp | 2 + src/openrct2/peep/Guest.h | 473 ++++++++++++++++++ src/openrct2/peep/GuestPathfinding.cpp | 3 +- src/openrct2/peep/Peep.h | 467 +---------------- src/openrct2/peep/Staff.h | 3 + src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 3 +- src/openrct2/ride/ShopItem.cpp | 2 +- src/openrct2/ride/Station.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 2 +- src/openrct2/ride/gentle/MiniGolf.cpp | 2 +- src/openrct2/ride/gentle/SpaceRings.cpp | 2 +- src/openrct2/scenario/Scenario.cpp | 1 + .../scripting/bindings/entity/ScGuest.cpp | 2 + .../scripting/bindings/world/ScMap.cpp | 1 + .../scripting/bindings/world/ScPark.cpp | 2 +- src/openrct2/world/EntityTweener.cpp | 2 +- test/tests/Pathfinding.cpp | 2 +- 34 files changed, 514 insertions(+), 485 deletions(-) create mode 100644 src/openrct2/peep/Guest.h diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index ef6d0dc01a..b28e659c4f 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index fcd2b87d7d..888c7bb636 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 03eca04d74..03152134e0 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 6170b36a37..d26fc6ac55 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index 1e70e17288..ceb9ae605e 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index cbc88b6d31..529e95b0ff 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -26,6 +26,7 @@ #include "management/NewsItem.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" +#include "peep/Guest.h" #include "peep/Staff.h" #include "rct1/RCT1.h" #include "scenario/Scenario.h" diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 755ceec510..28cc191c11 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -10,7 +10,7 @@ #include "GameStateSnapshots.h" #include "core/CircularBuffer.h" -#include "peep/Peep.h" +#include "peep/Guest.h" #include "peep/Staff.h" #include "ride/Vehicle.h" #include "world/Balloon.h" diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index a878a86ab9..c48f33501b 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -15,6 +15,7 @@ #include "../network/NetworkTypes.h" #include "../network/network.h" #include "../object/Object.h" +#include "../peep/Guest.h" #include "../ride/Ride.h" #include "../ride/TrackDesign.h" #include "../world/Location.hpp" diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 3b494b8a72..d1df3bfdb0 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -19,6 +19,7 @@ #include "../drawing/Drawing.h" #include "../drawing/IDrawingEngine.h" #include "../paint/Paint.h" +#include "../peep/Guest.h" #include "../peep/Staff.h" #include "../ride/Ride.h" #include "../ride/TrackDesign.h" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index cc3067e1e5..93ad9f7f0b 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -289,6 +289,7 @@ + diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index d71c05d518..b14b1075f6 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -13,7 +13,7 @@ #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../scenario/Scenario.h" diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index f458ea23e4..c55b856c00 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -14,7 +14,7 @@ #include "../config/Config.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ride/ShopItem.h" diff --git a/src/openrct2/management/Marketing.h b/src/openrct2/management/Marketing.h index 7c0a13f422..aa110c1d0e 100644 --- a/src/openrct2/management/Marketing.h +++ b/src/openrct2/management/Marketing.h @@ -11,11 +11,13 @@ #include "../Cheats.h" #include "../common.h" -#include "../peep/Peep.h" +#include "../ride/RideTypes.h" #include "../ride/ShopItem.h" #include +struct Guest; + enum { ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE, diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index f68afa95e1..0fd69b03df 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -11,7 +11,6 @@ #include "../Game.h" #include "../common.h" -#include "../peep/Peep.h" #include "../world/Map.h" #include @@ -19,6 +18,7 @@ #include struct NetworkPacket; +struct Peep; class NetworkPlayer final { diff --git a/src/openrct2/network/NetworkServerAdvertiser.cpp b/src/openrct2/network/NetworkServerAdvertiser.cpp index 2f3797962c..238f921138 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.cpp +++ b/src/openrct2/network/NetworkServerAdvertiser.cpp @@ -19,7 +19,7 @@ # include "../core/String.hpp" # include "../localisation/Date.h" # include "../management/Finance.h" -# include "../peep/Peep.h" +# include "../peep/Guest.h" # include "../platform/Platform2.h" # include "../platform/platform.h" # include "../util/Util.h" diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 77d27a950f..6ea786032e 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -10,7 +10,7 @@ #include "../../config/Config.h" #include "../../drawing/LightFX.h" #include "../../interface/Viewport.h" -#include "../../peep/Peep.h" +#include "../../peep/Guest.h" #include "../Paint.h" #include "Paint.Sprite.h" diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index af1f921640..5628d3c0ee 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "Guest.h" + #include "../Context.h" #include "../Game.h" #include "../OpenRCT2.h" diff --git a/src/openrct2/peep/Guest.h b/src/openrct2/peep/Guest.h new file mode 100644 index 0000000000..898e0cf6eb --- /dev/null +++ b/src/openrct2/peep/Guest.h @@ -0,0 +1,473 @@ +/***************************************************************************** + * Copyright (c) 2014-2020 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 "../management/Finance.h" +#include "../ride/ShopItem.h" +#include "Peep.h" + +#include + +#define PEEP_MAX_THOUGHTS 5 + +#define PEEP_HUNGER_WARNING_THRESHOLD 25 +#define PEEP_THIRST_WARNING_THRESHOLD 25 +#define PEEP_TOILET_WARNING_THRESHOLD 28 +#define PEEP_LITTER_WARNING_THRESHOLD 23 +#define PEEP_DISGUST_WARNING_THRESHOLD 22 +#define PEEP_VANDALISM_WARNING_THRESHOLD 15 +#define PEEP_NOEXIT_WARNING_THRESHOLD 8 +#define PEEP_LOST_WARNING_THRESHOLD 8 + +#define PEEP_MAX_HAPPINESS 255 +#define PEEP_MAX_HUNGER 255 +#define PEEP_MAX_TOILET 255 +#define PEEP_MAX_NAUSEA 255 +#define PEEP_MAX_THIRST 255 + +enum class PeepThoughtType : uint8_t +{ + CantAffordRide = 0, // "I can't afford" + SpentMoney = 1, // "I've spent all my money" + Sick = 2, // "I feel sick" + VerySick = 3, // "I feel very sick" + MoreThrilling = 4, // "I want to go on something more thrilling than X" + Intense = 5, // "X looks too intense for me" + HaventFinished = 6, // "I haven't finished my X yet" + Sickening = 7, // "Just looking at X makes me feel sick" + BadValue = 8, // "I'm not paying that much to go on X" + GoHome = 9, // "I want to go home" + GoodValue = 10, // "X is really good value" + AlreadyGot = 11, // "I've already got" + CantAffordItem = 12, // "I can't afford" + NotHungry = 13, // "I'm not hungry" + NotThirsty = 14, // "I'm not thirsty" + Drowning = 15, // "Help! I'm drowning!" + Lost = 16, // "I'm lost!" + WasGreat = 17, // "X was great" + QueuingAges = 18, // "I've been queuing for X for ages" + Tired = 19, // "I'm tired" + Hungry = 20, // "I'm hungry" + Thirsty = 21, // "I'm thirsty" + Toilet = 22, // "I need to go to the toilet" + CantFind = 23, // "I can't find X" + NotPaying = 24, // "I'm not paying that much to use X" + NotWhileRaining = 25, // "I'm not going on X while it's raining" + BadLitter = 26, // "The litter here is really bad" + CantFindExit = 27, // "I can't find the exit" + GetOff = 28, // "I want to get off X" + GetOut = 29, // "I want to get out of X" + NotSafe = 30, // "I'm not going on X - it isn't safe" + PathDisgusting = 31, // "This path is disgusting" + Crowded = 32, // "It's too crowded here" + Vandalism = 33, // "The vandalism here is really bad" + Scenery = 34, // "Great scenery!" + VeryClean = 35, // "This park is very clean and tidy" + Fountains = 36, // "The jumping fountains are great" + Music = 37, // "The music is nice here" + Balloon = 38, // "This balloon from X is really good value" + Toy = 39, // "This cuddly toy from X is really good value" + Map = 40, + Photo = 41, // "This on ride photo from X is really good value" + Umbrella = 42, + Drink = 43, + Burger = 44, + Chips = 45, + IceCream = 46, + Candyfloss = 47, + + Pizza = 51, + + Popcorn = 53, + HotDog = 54, + Tentacle = 55, + Hat = 56, + ToffeeApple = 57, + Tshirt = 58, + Doughnut = 59, + Coffee = 60, + + Chicken = 62, + Lemonade = 63, + + Wow = 67, // "Wow!" + + Wow2 = 70, // "Wow!" + Watched = 71, // "I have the strangest feeling someone is watching me" + BalloonMuch = 72, // "I'm not paying that much to get a balloon from X" + ToyMuch = 73, + MapMuch = 74, + PhotoMuch = 75, + UmbrellaMuch = 76, + DrinkMuch = 77, + BurgerMuch = 78, + ChipsMuch = 79, + IceCreamMuch = 80, + CandyflossMuch = 81, + + PizzaMuch = 85, + + PopcornMuch = 87, + HotDogMuch = 88, + TentacleMuch = 89, + HatMuch = 90, + ToffeeAppleMuch = 91, + TshirtMuch = 92, + DoughnutMuch = 93, + CoffeeMuch = 94, + + ChickenMuch = 96, + LemonadeMuch = 97, + + Photo2 = 104, // "This on-ride photo from X is really good value" + Photo3 = 105, + Photo4 = 106, + Pretzel = 107, + HotChocolate = 108, + IcedTea = 109, + FunnelCake = 110, + Sunglasses = 111, + BeefNoodles = 112, + FriedRiceNoodles = 113, + WontonSoup = 114, + MeatballSoup = 115, + FruitJuice = 116, + SoybeanMilk = 117, + Sujongkwa = 118, + SubSandwich = 119, + Cookie = 120, + + RoastSausage = 124, + + Photo2Much = 136, + Photo3Much = 137, + Photo4Much = 138, + PretzelMuch = 139, + HotChocolateMuch = 140, + IcedTeaMuch = 141, + FunnelCakeMuch = 142, + SunglassesMuch = 143, + BeefNoodlesMuch = 144, + FriedRiceNoodlesMuch = 145, + WontonSoupMuch = 146, + MeatballSoupMuch = 147, + FruitJuiceMuch = 148, + SoybeanMilkMuch = 149, + SujongkwaMuch = 150, + SubSandwichMuch = 151, + CookieMuch = 152, + + RoastSausageMuch = 156, + + Help = 168, // "Help! Put me down!" + RunningOut = 169, // "I'm running out of cash!" + NewRide = 170, // "Wow! A new ride being built!" + NiceRideDeprecated = 171, // "Nice ride! But not as good as the Phoenix..." + ExcitedDeprecated = 172, // "I'm so excited - It's an Intamin ride!" + HereWeAre = 173, // "...and here we are on X!" + + None = 255 +}; + +enum class PeepNauseaTolerance : uint8_t +{ + None, + Low, + Average, + High +}; + +static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); + +struct PeepThought +{ + PeepThoughtType type; + union + { + ride_id_t rideId; + ShopItem shopItem; + uint16_t item; + }; + uint8_t freshness; // larger is less fresh + uint8_t fresh_timeout; // updates every tick +}; + +struct Guest; +struct Staff; + +struct IntensityRange +{ +private: + uint8_t _value{}; + +public: + explicit IntensityRange(uint8_t value) + : _value(value) + { + } + + IntensityRange(uint8_t min, uint8_t max) + : _value(std::min(min, 15) | (std::min(max, 15) << 4)) + { + } + + uint8_t GetMinimum() const + { + return _value & 0x0F; + } + + uint8_t GetMaximum() const + { + return _value >> 4; + } + + IntensityRange WithMinimum(uint8_t value) const + { + return IntensityRange(value, GetMaximum()); + } + + IntensityRange WithMaximum(uint8_t value) const + { + return IntensityRange(GetMinimum(), value); + } + + explicit operator uint8_t() const + { + return _value; + } + + friend bool operator==(const IntensityRange& lhs, const IntensityRange& rhs) + { + return lhs._value == rhs._value; + } + + friend bool operator!=(const IntensityRange& lhs, const IntensityRange& rhs) + { + return lhs._value != rhs._value; + } +}; + +struct Guest : Peep +{ + static constexpr auto cEntityType = EntityType::Guest; + +public: + uint8_t GuestNumRides; + uint16_t GuestNextInQueue; + int32_t ParkEntryTime; + ride_id_t GuestHeadingToRideId; + uint8_t GuestIsLostCountdown; + uint8_t GuestTimeOnRide; + money16 PaidToEnter; + money16 PaidOnRides; + money16 PaidOnFood; + money16 PaidOnDrink; + money16 PaidOnSouvenirs; + bool OutsideOfPark; + uint8_t Happiness; + uint8_t HappinessTarget; + uint8_t Nausea; + uint8_t NauseaTarget; + uint8_t Hunger; + uint8_t Thirst; + uint8_t Toilet; + uint8_t TimeToConsume; + IntensityRange Intensity{ 0 }; + PeepNauseaTolerance NauseaTolerance; + uint16_t TimeInQueue; + money32 CashInPocket; + money32 CashSpent; + ride_id_t Photo1RideRef; + ride_id_t Photo2RideRef; + ride_id_t Photo3RideRef; + ride_id_t Photo4RideRef; + + int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance + ride_id_t PreviousRide; + uint16_t PreviousRideTimeOut; + std::array Thoughts; + // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc + uint8_t LitterCount; + // 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc + uint8_t DisgustingCount; + uint8_t AmountOfFood; + uint8_t AmountOfDrinks; + uint8_t AmountOfSouvenirs; + uint8_t VandalismSeen; // 0xC0 vandalism thought timeout, 0x3F vandalism tiles seen + uint8_t VoucherType; + union + { + ride_id_t VoucherRideId; + ShopItemIndex VoucherShopItem; + }; + uint8_t SurroundingsThoughtTimeout; + uint8_t Angriness; + uint8_t TimeLost; // the time the peep has been lost when it reaches 254 generates the lost thought + uint8_t DaysInQueue; + uint8_t BalloonColour; + uint8_t UmbrellaColour; + uint8_t HatColour; + ride_id_t FavouriteRide; + uint8_t FavouriteRideRating; + uint64_t ItemFlags; + + void UpdateGuest(); + void Tick128UpdateGuest(int32_t index); + int64_t GetFoodOrDrinkFlags() const; + int64_t GetEmptyContainerFlags() const; + bool HasDrink() const; + bool HasFoodOrDrink() const; + bool HasEmptyContainer() const; + void OnEnterRide(Ride* ride); + void OnExitRide(Ride* ride); + void UpdateSpriteType(); + bool HeadingForRideOrParkExit() const; + void StopPurchaseThought(uint8_t ride_type); + void TryGetUpFromSitting(); + void ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide); + void PickRideToGoOn(); + void ReadMap(); + bool ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool thinking); + bool ShouldGoToShop(Ride* ride, bool peepAtShop); + bool ShouldFindBench(); + bool UpdateWalkingFindBench(); + bool UpdateWalkingFindBin(); + void SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureType type); + void SpendMoney(money32 amount, ExpenditureType type); + void SetHasRidden(const Ride* ride); + bool HasRidden(const Ride* ride) const; + void SetHasRiddenRideType(int32_t rideType); + bool HasRiddenRideType(int32_t rideType) const; + void SetParkEntryTime(int32_t entryTime); + int32_t GetParkEntryTime() const; + void CheckIfLost(); + void CheckCantFindRide(); + void CheckCantFindExit(); + bool DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price); + void SetSpriteType(PeepSpriteType new_sprite_type); + void HandleEasterEggName(); + int32_t GetEasterEggNameId() const; + void UpdateEasterEggInteractions(); + void InsertNewThought(PeepThoughtType thought_type); + void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); + void InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId); + void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); + static Guest* Generate(const CoordsXYZ& coords); + bool UpdateQueuePosition(PeepActionType previous_action); + void RemoveFromQueue(); + + uint64_t GetItemFlags() const; + void SetItemFlags(uint64_t itemFlags); + void RemoveAllItems(); + void RemoveItem(ShopItem item); + void GiveItem(ShopItem item); + bool HasItem(ShopItem peepItem) const; + void Serialise(DataSerialiser& stream); + + // Removes the ride from the guests memory, this includes + // the history, thoughts, etc. + void RemoveRideFromMemory(ride_id_t rideId); + +private: + void UpdateRide(); + void UpdateOnRide(){}; // TODO + void UpdateWalking(); + void UpdateQueuing(); + void UpdateSitting(); + void UpdateEnteringPark(); + void UpdateLeavingPark(); + void UpdateBuying(); + void UpdateWatching(); + void UpdateUsingBin(); + void UpdateRideAtEntrance(); + void UpdateRideAdvanceThroughEntrance(); + void UpdateRideLeaveEntranceWaypoints(const Ride& ride); + uint8_t GetWaypointedSeatLocation(const Ride& ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction) const; + void UpdateRideFreeVehicleCheck(); + void UpdateRideFreeVehicleEnterRide(Ride* ride); + void UpdateRideApproachVehicle(); + void UpdateRideEnterVehicle(); + void UpdateRideLeaveVehicle(); + void UpdateRideApproachExit(); + void UpdateRideInExit(); + void UpdateRideApproachVehicleWaypoints(); + void UpdateRideApproachExitWaypoints(); + void UpdateRideApproachSpiralSlide(); + void UpdateRideOnSpiralSlide(); + void UpdateRideLeaveSpiralSlide(); + void UpdateRideMazePathfinding(); + void UpdateRideLeaveExit(); + void UpdateRideShopApproach(); + void UpdateRideShopInteract(); + void UpdateRideShopLeave(); + void loc_68F9F3(); + void loc_68FA89(); + int32_t CheckEasterEggName(int32_t index) const; + bool GuestHasValidXY() const; + void GivePassingPeepsPurpleClothes(Guest* passingPeep); + void GivePassingPeepsPizza(Guest* passingPeep); + void MakePassingPeepsSick(Guest* passingPeep); + void GivePassingPeepsIceCream(Guest* passingPeep); + Ride* FindBestRideToGoOn(); + std::bitset FindRidesToGoOn(); + bool FindVehicleToEnter(Ride* ride, std::vector& car_array); + void GoToRideEntrance(Ride* ride); +}; + +static_assert(sizeof(Guest) <= 512); + +enum +{ + EASTEREGG_PEEP_NAME_MICHAEL_SCHUMACHER, + EASTEREGG_PEEP_NAME_JACQUES_VILLENEUVE, + EASTEREGG_PEEP_NAME_DAMON_HILL, + EASTEREGG_PEEP_NAME_MR_BEAN, + EASTEREGG_PEEP_NAME_CHRIS_SAWYER, + EASTEREGG_PEEP_NAME_KATIE_BRAYSHAW, + EASTEREGG_PEEP_NAME_MELANIE_WARN, + EASTEREGG_PEEP_NAME_SIMON_FOSTER, + EASTEREGG_PEEP_NAME_JOHN_WARDLEY, + EASTEREGG_PEEP_NAME_LISA_STIRLING, + EASTEREGG_PEEP_NAME_DONALD_MACRAE, + EASTEREGG_PEEP_NAME_KATHERINE_MCGOWAN, + EASTEREGG_PEEP_NAME_FRANCES_MCGOWAN, + EASTEREGG_PEEP_NAME_CORINA_MASSOURA, + EASTEREGG_PEEP_NAME_CAROL_YOUNG, + EASTEREGG_PEEP_NAME_MIA_SHERIDAN, + EASTEREGG_PEEP_NAME_KATIE_RODGER, + EASTEREGG_PEEP_NAME_EMMA_GARRELL, + EASTEREGG_PEEP_NAME_JOANNE_BARTON, + EASTEREGG_PEEP_NAME_FELICITY_ANDERSON, + EASTEREGG_PEEP_NAME_KATIE_SMITH, + EASTEREGG_PEEP_NAME_EILIDH_BELL, + EASTEREGG_PEEP_NAME_NANCY_STILLWAGON, + EASTEREGG_PEEP_NAME_DAVID_ELLIS +}; + +extern uint8_t gGuestChangeModifier; +extern uint32_t gNumGuestsInPark; +extern uint32_t gNumGuestsInParkLastWeek; +extern uint32_t gNumGuestsHeadingForPark; + +extern money16 gGuestInitialCash; +extern uint8_t gGuestInitialHappiness; +extern uint8_t gGuestInitialHunger; +extern uint8_t gGuestInitialThirst; + +extern uint32_t gNextGuestNumber; + +void guest_set_name(uint16_t spriteIndex, const char* name); + +void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft); + +void increment_guests_in_park(); +void increment_guests_heading_for_park(); +void decrement_guests_in_park(); +void decrement_guests_heading_for_park(); diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 8eb9dbced2..01c4f38465 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -17,9 +17,10 @@ #include "../util/Util.h" #include "../world/Entrance.h" #include "../world/Footpath.h" -#include "Peep.h" +#include "Guest.h" #include "Staff.h" +#include #include static bool _peepPathFindIsStaff; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index d73943098a..866ccdda35 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -10,45 +10,23 @@ #pragma once #include "../common.h" -#include "../management/Finance.h" -#include "../rct12/RCT12.h" -#include "../ride/Ride.h" #include "../ride/RideTypes.h" -#include "../ride/ShopItem.h" +#include "../ride/Station.h" #include "../util/Util.h" #include "../world/EntityBase.h" #include "../world/Location.hpp" #include -#include #include -#define PEEP_MAX_THOUGHTS 5 - -#define PEEP_HUNGER_WARNING_THRESHOLD 25 -#define PEEP_THIRST_WARNING_THRESHOLD 25 -#define PEEP_TOILET_WARNING_THRESHOLD 28 -#define PEEP_LITTER_WARNING_THRESHOLD 23 -#define PEEP_DISGUST_WARNING_THRESHOLD 22 -#define PEEP_VANDALISM_WARNING_THRESHOLD 15 -#define PEEP_NOEXIT_WARNING_THRESHOLD 8 -#define PEEP_LOST_WARNING_THRESHOLD 8 - -#define PEEP_MAX_HAPPINESS 255 #define PEEP_MIN_ENERGY 32 #define PEEP_MAX_ENERGY 128 #define PEEP_MAX_ENERGY_TARGET 255 // Oddly, this differs from max energy! -#define PEEP_MAX_HUNGER 255 -#define PEEP_MAX_TOILET 255 -#define PEEP_MAX_NAUSEA 255 -#define PEEP_MAX_THIRST 255 constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP; class Formatter; struct TileElement; -struct Ride; -class DataSerialiser; namespace GameActions { @@ -66,150 +44,6 @@ enum class StaffType : uint8_t Count }; -enum class PeepThoughtType : uint8_t -{ - CantAffordRide = 0, // "I can't afford" - SpentMoney = 1, // "I've spent all my money" - Sick = 2, // "I feel sick" - VerySick = 3, // "I feel very sick" - MoreThrilling = 4, // "I want to go on something more thrilling than X" - Intense = 5, // "X looks too intense for me" - HaventFinished = 6, // "I haven't finished my X yet" - Sickening = 7, // "Just looking at X makes me feel sick" - BadValue = 8, // "I'm not paying that much to go on X" - GoHome = 9, // "I want to go home" - GoodValue = 10, // "X is really good value" - AlreadyGot = 11, // "I've already got" - CantAffordItem = 12, // "I can't afford" - NotHungry = 13, // "I'm not hungry" - NotThirsty = 14, // "I'm not thirsty" - Drowning = 15, // "Help! I'm drowning!" - Lost = 16, // "I'm lost!" - WasGreat = 17, // "X was great" - QueuingAges = 18, // "I've been queuing for X for ages" - Tired = 19, // "I'm tired" - Hungry = 20, // "I'm hungry" - Thirsty = 21, // "I'm thirsty" - Toilet = 22, // "I need to go to the toilet" - CantFind = 23, // "I can't find X" - NotPaying = 24, // "I'm not paying that much to use X" - NotWhileRaining = 25, // "I'm not going on X while it's raining" - BadLitter = 26, // "The litter here is really bad" - CantFindExit = 27, // "I can't find the exit" - GetOff = 28, // "I want to get off X" - GetOut = 29, // "I want to get out of X" - NotSafe = 30, // "I'm not going on X - it isn't safe" - PathDisgusting = 31, // "This path is disgusting" - Crowded = 32, // "It's too crowded here" - Vandalism = 33, // "The vandalism here is really bad" - Scenery = 34, // "Great scenery!" - VeryClean = 35, // "This park is very clean and tidy" - Fountains = 36, // "The jumping fountains are great" - Music = 37, // "The music is nice here" - Balloon = 38, // "This balloon from X is really good value" - Toy = 39, // "This cuddly toy from X is really good value" - Map = 40, - Photo = 41, // "This on ride photo from X is really good value" - Umbrella = 42, - Drink = 43, - Burger = 44, - Chips = 45, - IceCream = 46, - Candyfloss = 47, - - Pizza = 51, - - Popcorn = 53, - HotDog = 54, - Tentacle = 55, - Hat = 56, - ToffeeApple = 57, - Tshirt = 58, - Doughnut = 59, - Coffee = 60, - - Chicken = 62, - Lemonade = 63, - - Wow = 67, // "Wow!" - - Wow2 = 70, // "Wow!" - Watched = 71, // "I have the strangest feeling someone is watching me" - BalloonMuch = 72, // "I'm not paying that much to get a balloon from X" - ToyMuch = 73, - MapMuch = 74, - PhotoMuch = 75, - UmbrellaMuch = 76, - DrinkMuch = 77, - BurgerMuch = 78, - ChipsMuch = 79, - IceCreamMuch = 80, - CandyflossMuch = 81, - - PizzaMuch = 85, - - PopcornMuch = 87, - HotDogMuch = 88, - TentacleMuch = 89, - HatMuch = 90, - ToffeeAppleMuch = 91, - TshirtMuch = 92, - DoughnutMuch = 93, - CoffeeMuch = 94, - - ChickenMuch = 96, - LemonadeMuch = 97, - - Photo2 = 104, // "This on-ride photo from X is really good value" - Photo3 = 105, - Photo4 = 106, - Pretzel = 107, - HotChocolate = 108, - IcedTea = 109, - FunnelCake = 110, - Sunglasses = 111, - BeefNoodles = 112, - FriedRiceNoodles = 113, - WontonSoup = 114, - MeatballSoup = 115, - FruitJuice = 116, - SoybeanMilk = 117, - Sujongkwa = 118, - SubSandwich = 119, - Cookie = 120, - - RoastSausage = 124, - - Photo2Much = 136, - Photo3Much = 137, - Photo4Much = 138, - PretzelMuch = 139, - HotChocolateMuch = 140, - IcedTeaMuch = 141, - FunnelCakeMuch = 142, - SunglassesMuch = 143, - BeefNoodlesMuch = 144, - FriedRiceNoodlesMuch = 145, - WontonSoupMuch = 146, - MeatballSoupMuch = 147, - FruitJuiceMuch = 148, - SoybeanMilkMuch = 149, - SujongkwaMuch = 150, - SubSandwichMuch = 151, - CookieMuch = 152, - - RoastSausageMuch = 156, - - Help = 168, // "Help! Put me down!" - RunningOut = 169, // "I'm running out of cash!" - NewRide = 170, // "Wow! A new ride being built!" - NiceRideDeprecated = 171, // "Nice ride! But not as good as the Phoenix..." - ExcitedDeprecated = 172, // "I'm so excited - It's an Intamin ride!" - HereWeAre = 173, // "...and here we are on X!" - - None = 255 -}; - enum class PeepState : uint8_t { Falling = 0, // Drowning is part of falling @@ -403,14 +237,6 @@ enum PeepNextFlags PEEP_NEXT_FLAG_UNUSED = (1 << 4), }; -enum class PeepNauseaTolerance : uint8_t -{ - None, - Low, - Average, - High -}; - enum class PeepSpriteType : uint8_t { Normal = 0, @@ -477,83 +303,9 @@ enum PeepInvalidate PEEP_INVALIDATE_PEEP_ACTION = 1 << 5, // Currently set only when GuestHeadingToRideId is changed }; -// Flags used by peep_should_go_on_ride() -enum PeepRideDecision -{ - PEEP_RIDE_DECISION_AT_QUEUE = 1, - PEEP_RIDE_DECISION_THINKING = 1 << 2, -}; - -static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); - -struct PeepThought -{ - PeepThoughtType type; - union - { - ride_id_t rideId; - ShopItem shopItem; - uint16_t item; - }; - uint8_t freshness; // larger is less fresh - uint8_t fresh_timeout; // updates every tick -}; - struct Guest; struct Staff; -struct IntensityRange -{ -private: - uint8_t _value{}; - -public: - explicit IntensityRange(uint8_t value) - : _value(value) - { - } - - IntensityRange(uint8_t min, uint8_t max) - : _value(std::min(min, 15) | (std::min(max, 15) << 4)) - { - } - - uint8_t GetMinimum() const - { - return _value & 0x0F; - } - - uint8_t GetMaximum() const - { - return _value >> 4; - } - - IntensityRange WithMinimum(uint8_t value) const - { - return IntensityRange(value, GetMaximum()); - } - - IntensityRange WithMaximum(uint8_t value) const - { - return IntensityRange(GetMinimum(), value); - } - - explicit operator uint8_t() const - { - return _value; - } - - friend bool operator==(const IntensityRange& lhs, const IntensityRange& rhs) - { - return lhs._value == rhs._value; - } - - friend bool operator!=(const IntensityRange& lhs, const IntensityRange& rhs) - { - return lhs._value != rhs._value; - } -}; - struct Peep : EntityBase { char* Name; @@ -671,175 +423,6 @@ private: void UpdatePicked(); }; -struct Guest : Peep -{ - static constexpr auto cEntityType = EntityType::Guest; - -public: - uint8_t GuestNumRides; - uint16_t GuestNextInQueue; - int32_t ParkEntryTime; - ride_id_t GuestHeadingToRideId; - uint8_t GuestIsLostCountdown; - uint8_t GuestTimeOnRide; - money16 PaidToEnter; - money16 PaidOnRides; - money16 PaidOnFood; - money16 PaidOnDrink; - money16 PaidOnSouvenirs; - bool OutsideOfPark; - uint8_t Happiness; - uint8_t HappinessTarget; - uint8_t Nausea; - uint8_t NauseaTarget; - uint8_t Hunger; - uint8_t Thirst; - uint8_t Toilet; - uint8_t TimeToConsume; - IntensityRange Intensity{ 0 }; - PeepNauseaTolerance NauseaTolerance; - uint16_t TimeInQueue; - money32 CashInPocket; - money32 CashSpent; - ride_id_t Photo1RideRef; - ride_id_t Photo2RideRef; - ride_id_t Photo3RideRef; - ride_id_t Photo4RideRef; - - int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance - ride_id_t PreviousRide; - uint16_t PreviousRideTimeOut; - std::array Thoughts; - // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc - uint8_t LitterCount; - // 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc - uint8_t DisgustingCount; - uint8_t AmountOfFood; - uint8_t AmountOfDrinks; - uint8_t AmountOfSouvenirs; - uint8_t VandalismSeen; // 0xC0 vandalism thought timeout, 0x3F vandalism tiles seen - uint8_t VoucherType; - union - { - ride_id_t VoucherRideId; - ShopItemIndex VoucherShopItem; - }; - uint8_t SurroundingsThoughtTimeout; - uint8_t Angriness; - uint8_t TimeLost; // the time the peep has been lost when it reaches 254 generates the lost thought - uint8_t DaysInQueue; - uint8_t BalloonColour; - uint8_t UmbrellaColour; - uint8_t HatColour; - ride_id_t FavouriteRide; - uint8_t FavouriteRideRating; - uint64_t ItemFlags; - - void UpdateGuest(); - void Tick128UpdateGuest(int32_t index); - int64_t GetFoodOrDrinkFlags() const; - int64_t GetEmptyContainerFlags() const; - bool HasDrink() const; - bool HasFoodOrDrink() const; - bool HasEmptyContainer() const; - void OnEnterRide(Ride* ride); - void OnExitRide(Ride* ride); - void UpdateSpriteType(); - bool HeadingForRideOrParkExit() const; - void StopPurchaseThought(uint8_t ride_type); - void TryGetUpFromSitting(); - void ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide); - void PickRideToGoOn(); - void ReadMap(); - bool ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool thinking); - bool ShouldGoToShop(Ride* ride, bool peepAtShop); - bool ShouldFindBench(); - bool UpdateWalkingFindBench(); - bool UpdateWalkingFindBin(); - void SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureType type); - void SpendMoney(money32 amount, ExpenditureType type); - void SetHasRidden(const Ride* ride); - bool HasRidden(const Ride* ride) const; - void SetHasRiddenRideType(int32_t rideType); - bool HasRiddenRideType(int32_t rideType) const; - void SetParkEntryTime(int32_t entryTime); - int32_t GetParkEntryTime() const; - void CheckIfLost(); - void CheckCantFindRide(); - void CheckCantFindExit(); - bool DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price); - void SetSpriteType(PeepSpriteType new_sprite_type); - void HandleEasterEggName(); - int32_t GetEasterEggNameId() const; - void UpdateEasterEggInteractions(); - void InsertNewThought(PeepThoughtType thought_type); - void InsertNewThought(PeepThoughtType thought_type, ShopItem thought_arguments); - void InsertNewThought(PeepThoughtType thought_type, ride_id_t rideId); - void InsertNewThought(PeepThoughtType thought_type, uint16_t thought_arguments); - static Guest* Generate(const CoordsXYZ& coords); - bool UpdateQueuePosition(PeepActionType previous_action); - void RemoveFromQueue(); - - uint64_t GetItemFlags() const; - void SetItemFlags(uint64_t itemFlags); - void RemoveAllItems(); - void RemoveItem(ShopItem item); - void GiveItem(ShopItem item); - bool HasItem(ShopItem peepItem) const; - void Serialise(DataSerialiser& stream); - - // Removes the ride from the guests memory, this includes - // the history, thoughts, etc. - void RemoveRideFromMemory(ride_id_t rideId); - -private: - void UpdateRide(); - void UpdateOnRide(){}; // TODO - void UpdateWalking(); - void UpdateQueuing(); - void UpdateSitting(); - void UpdateEnteringPark(); - void UpdateLeavingPark(); - void UpdateBuying(); - void UpdateWatching(); - void UpdateUsingBin(); - void UpdateRideAtEntrance(); - void UpdateRideAdvanceThroughEntrance(); - void UpdateRideLeaveEntranceWaypoints(const Ride& ride); - uint8_t GetWaypointedSeatLocation(const Ride& ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction) const; - void UpdateRideFreeVehicleCheck(); - void UpdateRideFreeVehicleEnterRide(Ride* ride); - void UpdateRideApproachVehicle(); - void UpdateRideEnterVehicle(); - void UpdateRideLeaveVehicle(); - void UpdateRideApproachExit(); - void UpdateRideInExit(); - void UpdateRideApproachVehicleWaypoints(); - void UpdateRideApproachExitWaypoints(); - void UpdateRideApproachSpiralSlide(); - void UpdateRideOnSpiralSlide(); - void UpdateRideLeaveSpiralSlide(); - void UpdateRideMazePathfinding(); - void UpdateRideLeaveExit(); - void UpdateRideShopApproach(); - void UpdateRideShopInteract(); - void UpdateRideShopLeave(); - void loc_68F9F3(); - void loc_68FA89(); - int32_t CheckEasterEggName(int32_t index) const; - bool GuestHasValidXY() const; - void GivePassingPeepsPurpleClothes(Guest* passingPeep); - void GivePassingPeepsPizza(Guest* passingPeep); - void MakePassingPeepsSick(Guest* passingPeep); - void GivePassingPeepsIceCream(Guest* passingPeep); - Ride* FindBestRideToGoOn(); - std::bitset FindRidesToGoOn(); - bool FindVehicleToEnter(Ride* ride, std::vector& car_array); - void GoToRideEntrance(Ride* ride); -}; - -static_assert(sizeof(Guest) <= 512); - struct rct_sprite_bounds { uint8_t sprite_width; // 0x00 @@ -860,34 +443,6 @@ struct rct_peep_animation_entry const rct_sprite_bounds* sprite_bounds; // 0x04 }; -enum -{ - EASTEREGG_PEEP_NAME_MICHAEL_SCHUMACHER, - EASTEREGG_PEEP_NAME_JACQUES_VILLENEUVE, - EASTEREGG_PEEP_NAME_DAMON_HILL, - EASTEREGG_PEEP_NAME_MR_BEAN, - EASTEREGG_PEEP_NAME_CHRIS_SAWYER, - EASTEREGG_PEEP_NAME_KATIE_BRAYSHAW, - EASTEREGG_PEEP_NAME_MELANIE_WARN, - EASTEREGG_PEEP_NAME_SIMON_FOSTER, - EASTEREGG_PEEP_NAME_JOHN_WARDLEY, - EASTEREGG_PEEP_NAME_LISA_STIRLING, - EASTEREGG_PEEP_NAME_DONALD_MACRAE, - EASTEREGG_PEEP_NAME_KATHERINE_MCGOWAN, - EASTEREGG_PEEP_NAME_FRANCES_MCGOWAN, - EASTEREGG_PEEP_NAME_CORINA_MASSOURA, - EASTEREGG_PEEP_NAME_CAROL_YOUNG, - EASTEREGG_PEEP_NAME_MIA_SHERIDAN, - EASTEREGG_PEEP_NAME_KATIE_RODGER, - EASTEREGG_PEEP_NAME_EMMA_GARRELL, - EASTEREGG_PEEP_NAME_JOANNE_BARTON, - EASTEREGG_PEEP_NAME_FELICITY_ANDERSON, - EASTEREGG_PEEP_NAME_KATIE_SMITH, - EASTEREGG_PEEP_NAME_EILIDH_BELL, - EASTEREGG_PEEP_NAME_NANCY_STILLWAGON, - EASTEREGG_PEEP_NAME_DAVID_ELLIS -}; - enum { PATHING_DESTINATION_REACHED = 1 << 0, @@ -900,18 +455,6 @@ enum extern const rct_peep_animation_entry g_peep_animation_entries[EnumValue(PeepSpriteType::Count)]; extern const bool gSpriteTypeToSlowWalkMap[48]; -extern uint8_t gGuestChangeModifier; -extern uint32_t gNumGuestsInPark; -extern uint32_t gNumGuestsInParkLastWeek; -extern uint32_t gNumGuestsHeadingForPark; - -extern money16 gGuestInitialCash; -extern uint8_t gGuestInitialHappiness; -extern uint8_t gGuestInitialHunger; -extern uint8_t gGuestInitialThirst; - -extern uint32_t gNextGuestNumber; - extern uint8_t gPeepWarningThrottle[16]; int32_t peep_get_staff_count(); @@ -921,7 +464,6 @@ void peep_stop_crowd_noise(); void peep_update_crowd_noise(); void peep_update_days_in_queue(); void peep_applause(); -void peep_thought_set_format_args(const PeepThought* thought, Formatter& ft); int32_t get_peep_face_sprite_small(Guest* peep); int32_t get_peep_face_sprite_large(Guest* peep); void peep_sprite_remove(Peep* peep); @@ -934,13 +476,6 @@ int32_t peep_compare(const uint16_t sprite_index_a, const uint16_t sprite_index_ void peep_update_names(bool realNames); -void guest_set_name(uint16_t spriteIndex, const char* name); - -void increment_guests_in_park(); -void increment_guests_heading_for_park(); -void decrement_guests_in_park(); -void decrement_guests_heading_for_park(); - rct_string_id get_real_name_string_id_from_id(uint32_t id); inline const rct_peep_animation& GetPeepAnimation( diff --git a/src/openrct2/peep/Staff.h b/src/openrct2/peep/Staff.h index 4583aa7bc4..8b72ea2a15 100644 --- a/src/openrct2/peep/Staff.h +++ b/src/openrct2/peep/Staff.h @@ -10,8 +10,11 @@ #pragma once #include "../common.h" +#include "../world/Map.h" #include "Peep.h" +class DataSerialiser; + #define STAFF_MAX_COUNT 200 // The number of elements in the gStaffPatrolAreas 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. diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 6e418f494b..60dd8c5c94 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -33,7 +33,7 @@ #include "../object/ObjectLimits.h" #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../rct12/SawyerChunkWriter.h" diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index b96ccbb1cf..854596e39d 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -35,7 +35,7 @@ #include "../object/ObjectList.h" #include "../object/ObjectManager.h" #include "../object/ObjectRepository.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../peep/RideUseSystem.h" #include "../peep/Staff.h" #include "../rct12/RCT12.h" @@ -71,6 +71,7 @@ #include "../world/Surface.h" #include +#include #define DECRYPT_MONEY(money) (static_cast(Numerics::rol32((money) ^ 0xF4EC9621, 13))) diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index 21ddf7ff89..8cbfdce8e9 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -11,7 +11,7 @@ #include "../common.h" #include "../localisation/StringIds.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../sprites.h" ShopItem& operator++(ShopItem& d, int) diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 059e9b0b99..0da34620cd 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -10,7 +10,7 @@ #include "Station.h" #include "../Game.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../scenario/Scenario.h" #include "../world/Location.hpp" #include "Track.h" diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 104e032dfa..1e36848b05 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -10,7 +10,7 @@ #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../peep/Peep.h" +#include "../../peep/Guest.h" #include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 84dcf204db..81309353fa 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -11,7 +11,7 @@ #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../peep/Peep.h" +#include "../../peep/Guest.h" #include "../../world/Entity.h" #include "../../world/Map.h" #include "../../world/Surface.h" diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index eaed11cbdc..c00d152c05 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -11,7 +11,7 @@ #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../peep/Peep.h" +#include "../../peep/Guest.h" #include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 4228cae01a..b47d15d3e2 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -31,6 +31,7 @@ #include "../network/network.h" #include "../object/Object.h" #include "../object/ObjectList.h" +#include "../peep/Guest.h" #include "../peep/Staff.h" #include "../platform/platform.h" #include "../rct1/RCT1.h" diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index ea85c8efa6..e5d0901b52 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -11,6 +11,8 @@ # include "ScGuest.hpp" +# include "../../../peep/Guest.h" + namespace OpenRCT2::Scripting { ScGuest::ScGuest(uint16_t id) diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 7509bab3f5..0a672ad6b1 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -12,6 +12,7 @@ # include "ScMap.hpp" # include "../../../common.h" +# include "../../../peep/Guest.h" # include "../../../peep/Staff.h" # include "../../../ride/Ride.h" # include "../../../ride/TrainManager.h" diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 0ff6063fa3..b411dfcda1 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -17,7 +17,7 @@ # include "../../../core/String.hpp" # include "../../../management/Finance.h" # include "../../../management/NewsItem.h" -# include "../../../peep/Peep.h" +# include "../../../peep/Guest.h" # include "../../../windows/Intent.h" # include "../../../world/Park.h" # include "../../Duktape.hpp" diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index 603c22305c..63c033019e 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "EntityTweener.h" -#include "../peep/Peep.h" +#include "../peep/Guest.h" #include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "EntityList.h" diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 5090ae3429..872f0e2537 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -1,7 +1,7 @@ #include "TestData.h" #include "openrct2/core/StringReader.h" +#include "openrct2/peep/Guest.h" #include "openrct2/peep/GuestPathfinding.h" -#include "openrct2/peep/Peep.h" #include "openrct2/ride/Station.h" #include "openrct2/scenario/Scenario.h" From 51aa9a78f32300869d5c099aa812c0ffbf29ed9f Mon Sep 17 00:00:00 2001 From: adam-bloom Date: Sat, 30 Oct 2021 11:59:26 -0600 Subject: [PATCH 671/681] Auto-discovery for Homebrew prefix, pin openssl version Co-authored-by: devnexen --- src/openrct2/CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openrct2/CMakeLists.txt b/src/openrct2/CMakeLists.txt index a17e5f6252..0d96f87816 100644 --- a/src/openrct2/CMakeLists.txt +++ b/src/openrct2/CMakeLists.txt @@ -36,11 +36,11 @@ if (NOT DISABLE_NETWORK OR NOT DISABLE_HTTP) if (WIN32 AND NOT MINGW_TARGET_NT5_1) target_link_libraries(${PROJECT_NAME} bcrypt) else () - if (APPLE) - if (NOT MACOS_USE_DEPENDENCIES) - # Needed for linking with non-broken OpenSSL on Apple platforms - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl/lib/pkgconfig") - endif () + if (APPLE AND NOT MACOS_USE_DEPENDENCIES) + # note - we are not yet compatible with openssl3, which is now default brew version + execute_process(COMMAND brew --prefix openssl@1.1 OUTPUT_VARIABLE HOMEBREW_PREFIX_OPENSSL OUTPUT_STRIP_TRAILING_WHITESPACE) + # Needed for linking with non-broken OpenSSL on Apple platforms + list(APPEND CMAKE_PREFIX_PATH "${HOMEBREW_PREFIX_OPENSSL}") endif () find_package(OpenSSL 1.0.0 REQUIRED) @@ -173,6 +173,11 @@ find_package(Threads REQUIRED) target_link_libraries(${PROJECT_NAME} Threads::Threads) if (NOT MINGW AND NOT MSVC) + if (APPLE AND NOT MACOS_USE_DEPENDENCIES) + execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE HOMEBREW_PREFIX_ICU OUTPUT_STRIP_TRAILING_WHITESPACE) + # Needed for linking with non-broken icu on Apple platforms + list(APPEND CMAKE_PREFIX_PATH "${HOMEBREW_PREFIX_ICU}") + endif () # For unicode code page conversion. find_package(ICU 59.0 REQUIRED COMPONENTS uc) From a7318b631a579d4b23ae7055a6d13e7adfedb775 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 31 Oct 2021 17:51:22 +0100 Subject: [PATCH 672/681] Add #10614 to changelog [ci skip] --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e0fe669b15..1feca35416 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. - Feature: [#15195] Added a bug-report item in file dropdown menu. - Feature: [#15294] New vehicle animation type: flying animal. +- Fix: [#10614] Track Designs with missing path(s) do not use alternate pathways. - Fix: [#12981] New vehicles do not appear in vehicle type dropdown. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#13912] “Dome park” no longer renders dome correctly. From 22408ee4b63fa59c8c1beec51a4b66feb7b787de Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Mon, 1 Nov 2021 04:08:42 +0000 Subject: [PATCH 673/681] Merge Localisation/master into OpenRCT2/develop --- data/language/it-IT.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 66657c4164..486e84394f 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -322,7 +322,7 @@ STR_0933 :Prima occorre modificare l'altezza del terreno STR_0934 :L'entrata dell'attrazione è d'intralcio STR_0935 :L'uscita dell'attrazione è d'intralcio STR_0936 :L'entrata del parco è d'intralcio -STR_0937 :Visualizza le opzioni +STR_0937 :Opzioni visuale STR_0938 :Regola l'altezza e la pendenza del terreno STR_0939 :Visuale sotterranea/interna STR_0940 :Nascondi terreno @@ -382,7 +382,7 @@ STR_0993 :Demolisci l'attrazione STR_0994 :Demolisci STR_0995 :{WINDOW_COLOUR_1}Si è sicuri di voler demolire completamente {STRINGID}? STR_0996 :Visuale generale -STR_0997 :Seleziona la visuale +STR_0997 :Visuale selezione STR_0998 :Non è possibile collocare altre stazioni per questa attrazione STR_0999 :È necessaria una piattaforma stazione STR_1000 :Il tracciato non costituisce un circuito completo @@ -412,7 +412,7 @@ STR_1023 :{POP16}{POP16}{POP16}{COMMA16} carrozze per treno STR_1024 :{COMMA16} carrozza per treno STR_1025 :{COMMA16} carrozze per treno STR_1026 :Piattaforma della stazione troppo lunga! -STR_1027 :Individualo nella visuale principale +STR_1027 :Individua nella visuale principale STR_1028 :Fuori dalla mappa! STR_1029 :Non si può costruire contemporaneamente sopra e sotto l'acqua! STR_1030 :Si può costruire solo sott'acqua! @@ -764,11 +764,11 @@ STR_1374 :1/2 giro morte gr. (dx) STR_1375 :Trasferimento in alto STR_1376 :Trasferimento in basso STR_1377 :Avvitamento ond. (sx) -STR_1378 :Avvitamento ond. (dx) +STR_1378 :Avvitamento ond. (dx) STR_1379 :Invertitore (sinistra) STR_1380 :Invertitore (destra) -STR_1381 :Sal. x traino in curva (sx) -STR_1382 :Sal. x traino in curva (dx) +STR_1381 :Salita trainata curva (sx) +STR_1382 :Salita trainata curva (sx) STR_1383 :1/4 di giro della morte STR_1384 :{YELLOW}{STRINGID} STR_1385 :Altre configurazioni del tracciato @@ -3662,6 +3662,8 @@ STR_6453 :Copia info versione STR_6454 :Impossibile rinominare il cartello… STR_6455 :Impossibile rinominare l’insegna… STR_6456 :Screenshot gigante +STR_6457 :Segnala un bug su GitHub +STR_6458 :Segui sulla visuale principale ############# From 2e063e6df8deeafa27bf2abbc606cc3aeab86354 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 1 Nov 2021 18:32:28 +0100 Subject: [PATCH 674/681] =?UTF-8?q?Fix=20#15831:=20Track=20Manager=20crash?= =?UTF-8?q?=20after=20clicking=20=E2=80=9CSelect=20another=20ride=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openrct2-ui/windows/TrackList.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 53ece652db..e81f70296b 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -208,8 +208,19 @@ public: String::Set(_filterString, sizeof(_filterString), ""); window_track_list_widgets[WIDX_FILTER_STRING].string = _filterString; widgets = window_track_list_widgets; - enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_BACK) | (1ULL << WIDX_FILTER_STRING) - | (1ULL << WIDX_FILTER_CLEAR) | (1ULL << WIDX_ROTATE) | (1ULL << WIDX_TOGGLE_SCENERY); + enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << WIDX_FILTER_STRING) | (1ULL << WIDX_FILTER_CLEAR) + | (1ULL << WIDX_ROTATE) | (1ULL << WIDX_TOGGLE_SCENERY); + + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + enabled_widgets &= ~(1ULL << WIDX_BACK); + widgets[WIDX_BACK].type = WindowWidgetType::Empty; + } + else + { + enabled_widgets |= (1ULL << WIDX_BACK); + widgets[WIDX_BACK].type = WindowWidgetType::TableHeader; + } WindowInitScrollWidgets(this); track_list.track_list_being_updated = false; From af78bbb448ee558f1aae96fe1ab2ab403f60b660 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 1 Nov 2021 18:32:55 +0100 Subject: [PATCH 675/681] Fix Tracks Manager crash on closing the tracks list --- src/openrct2-ui/windows/TrackList.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index e81f70296b..e52238097b 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -262,7 +262,8 @@ public: // try to load the track manager again, and an infinite loop will result. if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && gScreenAge != 0) { - Close(); + window_close_by_number(WC_MANAGE_TRACK_DESIGN, number); + window_close_by_number(WC_TRACK_DELETE_PROMPT, number); Editor::LoadTrackManager(); } } From 8158956f18af5ab729ef804c5a8c44b60be8f99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 2 Nov 2021 01:31:21 -0700 Subject: [PATCH 676/681] Fix #15819: Potential crash placing a maze design --- src/openrct2/ride/RideConstruction.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 86aee49fd3..54fa013b39 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1525,21 +1525,23 @@ void Ride::ValidateStations() continue; auto trackType = trackElement->AsTrack()->GetTrackType(); - uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); - // determine where the ride entrance is relative to the station track - Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; - - // if the ride entrance is not on a valid side, remove it - ted = &GetTrackElementDescriptor(trackType); - if (!(ted->SequenceProperties[trackSequence] & (1 << direction))) - { - continue; - } // get the StationIndex for the station StationIndex stationId = 0; if (trackType != TrackElemType::Maze) { + uint8_t trackSequence = trackElement->AsTrack()->GetSequenceIndex(); + + // determine where the ride entrance is relative to the station track + Direction direction = (tileElement->GetDirection() - direction_reverse(trackElement->GetDirection())) & 3; + + // if the ride entrance is not on a valid side, remove it + ted = &GetTrackElementDescriptor(trackType); + if (!(ted->SequenceProperties[trackSequence] & (1 << direction))) + { + continue; + } + stationId = trackElement->AsTrack()->GetStationIndex(); } if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) From 8b724cd9985975304743d9df762b78f10e74dc57 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Wed, 3 Nov 2021 04:08:44 +0000 Subject: [PATCH 677/681] Merge Localisation/master into OpenRCT2/develop --- data/language/da-DK.txt | 199 ++++++++++++++++++++++------------------ 1 file changed, 109 insertions(+), 90 deletions(-) diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index b9063ca714..934a78b131 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -3246,18 +3246,18 @@ STR_6014 :Gæsterne betaler kun billetter til forlystelser og tjenester. {NEW STR_6015 :Skrå STR_6016 :Modificer felt STR_6017 :Sæt venligst farten ned -STR_6018 :Forlystelse konstruktion - Venstresving -STR_6019 :Forlystelse konstruktion - Højresving -STR_6020 :Forlystelse konstruktion - Brug standard spor -STR_6021 :Forlystelse konstruktion - Bakke ned -STR_6022 :Forlystelse konstruktion - Bakke op -STR_6023 :Forlystelse konstruktion - Skift kædeløft -STR_6024 :Forlystelse konstruktion - Hældning venstre -STR_6025 :Forlystelse konstruktion - Hældning højre -STR_6026 :Forlystelse konstruktion - Foregående spor -STR_6027 :Forlystelse konstruktion - Næste spor -STR_6028 :Forlystelse konstruktion - Byg nuværenden -STR_6029 :Forlystelse konstruktion - Fjern nuværende +STR_6018 :Konstruktion - Venstresving +STR_6019 :Konstruktion - Højresving +STR_6020 :Konstruktion - Brug standard spor +STR_6021 :Konstruktion - Bakke ned +STR_6022 :Konstruktion - Bakke op +STR_6023 :Konstruktion - Skift kædeløft +STR_6024 :Konstruktion - Hældning venstre +STR_6025 :Konstruktion - Hældning højre +STR_6026 :Konstruktion - Foregående spor +STR_6027 :Konstruktion - Næste spor +STR_6028 :Konstruktion - Byg nuværenden +STR_6029 :Konstruktion - Fjern nuværende STR_6030 :Sceneri vælger. Klik på et sceneri på kortet for at vælge det samme stykke til byggeri. STR_6031 :Server Beskrivelse: STR_6032 :Server Velkomst: @@ -3637,6 +3637,25 @@ STR_6436 :Skift usynlighed STR_6437 :Usynlig STR_6438 :U STR_6439 :Felt undersøger: Skift usynlighed +STR_6440 :Gennemsigtig vand +STR_6441 :Der skal vælges, mindst et ikke-kø sti overflade objekt. +STR_6442 :Der skal vælges, mindst et kø sti overflade objekt. +STR_6443 :Der skal vælges, mindst et sti gelænder objekt. +STR_6444 :Sti Overflader +STR_6445 :Sti Gelændere +STR_6446 :{WINDOW_COLOUR_2}Overflade navn: {BLACK}{STRINGID} +STR_6447 :{WINDOW_COLOUR_2}Gelænder navn: {BLACK}{STRINGID} +STR_6448 :Objekt format ikke understøttet +STR_6449 :{WINDOW_COLOUR_2}Spor: +STR_6450 :{BLACK}“{STRING}” +STR_6451 :{BLACK}“{STRING}” - {STRING} +STR_6452 :{WINDOW_COLOUR_2}Sælger: {BLACK}{STRING} +STR_6453 :Kopier versions information +STR_6454 :Kan ikke omdøbe banner… +STR_6455 :Kan ikke omdøbe skilt… +STR_6456 :Giantisk Skærmbillede +STR_6457 :Rapporter en fejl på GitHub +STR_6458 :Følg dette i hovedvinduet ############# # Scenarios # @@ -4156,7 +4175,7 @@ STR_DTLS :Konverter et lille bjerg ski ressort, til en park med sne som tema STR_SCNR :Amity Airfield STR_PARK :Amity Airfield -STR_DTLS :Byge en forlystelsespark med luftfart som tema, i en forladt lufthavn +STR_DTLS :Byg en forlystelsespark med luftfart som tema, i en forladt lufthavn. STR_SCNR :Botany Breakers @@ -4201,243 +4220,243 @@ STR_DTLS :Du starter med en lille markeds bazaar, din udfordring er at forøg STR_SCNR :Crazy Castle STR_PARK :Crazy Castle -STR_DTLS :Du har arvet et kæmpe stort slot - Din opgave er at udvikle det til en lille forlystelsespark. +STR_DTLS :Du har arvet et kæmpe stort slot - Din opgave er at udvikle det til en lille forlystelsespark STR_SCNR :Dusty Greens STR_PARK :Dusty Greens -STR_DTLS :Situated near a highway junction in the desert, Dusty Greens is an opportunity to develop a small golf resort into a thriving theme park +STR_DTLS :Dusty Greens ligger i nærheden af et motorvejskryds i ørkenen, og har mulighed for at udvikle sig, fra et lille golfresort, til en blomstrende forlystelsespark STR_SCNR :Electric Fields STR_PARK :Electric Fields -STR_DTLS :You have inherited a small farm, and your challenge is to build a small theme park amongst the fields and farm buildings +STR_DTLS :Du har arvet en lille gård, og din udfordring er at bygge en lille forlystelsespark, blandt marker og landbrugsbygninger STR_SCNR :Extreme Heights STR_PARK :Extreme Heights -STR_DTLS :Free of financial restrictions, your challenge is to expand this desert park to attract people seeking the ultimate thrills +STR_DTLS :Fri for økonomiske begrænsninger, din udfordring er at udvide denne ørkenpark for at tiltrække folk, der søger den ultimative spænding STR_SCNR :Factory Capers STR_PARK :Factory Capers -STR_DTLS :An abandoned factory complex is an opportunity to build a mechanical-themed amusement park +STR_DTLS :Et forladt fabrikskompleks, er en mulighed for at bygge en forlystelsespark med mekanisk tema STR_SCNR :Fungus Woods STR_PARK :Fungus Woods -STR_DTLS :Restricted to only older-style wooden forlystelser, your challenge is to build a thriving theme park in Fungus Woods +STR_DTLS :Begrænset til kun ældre træ forlystelser, er din udfordring at bygge en blomstrende forlystelsespark, i Fungus Woods STR_SCNR :Ghost Town STR_PARK :Ghost Town -STR_DTLS :Hired by a large amusement park chain, your task is to build them a giant rutschebane park around an abandoned mining town +STR_DTLS :Hyret af en stor forlystelsespark kæde, din opgave er at bygge dem en kæmpe rutschebane park omkring en forladt mineby STR_SCNR :Gravity Gardens STR_PARK :Gravity Gardens -STR_DTLS :Your challenge is to build a rutschebane park in the beautiful Gravity Gardens - No other forlystelser, just rutschebaner! +STR_DTLS :Din udfordring er at bygge en rutschebanepark i den smukke Gravity Gardens - Ingen andre forlystelser, udelukkende rutschebaner! STR_SCNR :Infernal Views STR_PARK :Infernal Views -STR_DTLS :A park nestled precariously on lava rock with streams of magma +STR_DTLS :En park beliggende usikkert på lava sten med strømme af magma STR_SCNR :Lucky Lake STR_PARK :Lucky Lake -STR_DTLS :With unlimited funds but a challenging lake location, this park will be a challenge to expand and manage +STR_DTLS :Med ubegrænsede midler, men en udfordrende søplacering, vil denne park være en udfordring at udvide og administrere STR_SCNR :Rainbow Summit STR_PARK :Rainbow Summit -STR_DTLS :Built on a hillside, this park is forbidden from building anything tall. Can you expand the park and make it successful? +STR_DTLS :Bygget på en bjergskråning, er denne park forbudt at bygge noget højt. Kan du udvide parken og gøre den vellykket? STR_SCNR :Six Flags Belgium STR_PARK :Six Flags Belgium -STR_DTLS :Try your hand at running and improving this Six Flags park +STR_DTLS :Prøv på egen hånd, at drive og forbedre denne Six Flags park STR_SCNR :Six Flags Great Adventure STR_PARK :Six Flags Great Adventure -STR_DTLS :Build the missing Six Flags forlystelser, or create your own designs to improve the park! But don't forget your ultimate aim - To attract more guests to the park! +STR_DTLS :Byg de manglende Six Flags, eller opret dine egne designs for at forbedre parken! Men glem ikke dit ultimative mål - At tiltrække flere gæster til parken! STR_SCNR :Six Flags Holland STR_PARK :Six Flags Holland -STR_DTLS :Try your hand at running and improving this Six Flags park +STR_DTLS :Prøv på egen hånd at drive og forbedre denne Six Flags park STR_SCNR :Six Flags Magic Mountain STR_PARK :Six Flags Magic Mountain -STR_DTLS :Build the missing Six Flags forlystelser, or create your own designs to improve the park! But don't forget your ultimate aim - To repay your loan while keeping the park værdi up! +STR_DTLS :Byg de manglende Six Flags forlystelser, eller opret dine egne designs for at forbedre parken! Men glem ikke dit ultimative mål - At tilbagebetale dit lån og samtidig holde parkens værdi oppe! STR_SCNR :Six Flags over Texas STR_PARK :Six Flags over Texas -STR_DTLS :Build the missing Six Flags forlystelser, or create your own designs to improve the park! But don't forget your ultimate aim - To attract more guests to the park! +STR_DTLS :Byg de manglende Six Flags forlystelser, eller opret dine egne designs for at forbedre parken! Men glem ikke dit ultimative mål - Tiltrække flere gæster til parken! ############################################################################### ## Wacky Worlds Scenarios ############################################################################### -STR_SCNR :Africa - African Diamond Mine +STR_SCNR :Afrika - Afrikansk Diamant Mine STR_PARK :Mines of Africa -STR_DTLS :You inherited a disused diamond mine, and find a valuable diamond. You decide to invest that money to build a world-famous theme park. +STR_DTLS :Du arvede en nedlagt diamantmine og fandt en værdifuld diamant. Du beslutter dig for at investere de penge til at bygge en verdensberømt forlystelsespark. -STR_SCNR :Africa - Oasis +STR_SCNR :Afrika - Oase STR_PARK :Mirage Madness -STR_DTLS :A desert Oasis has been discovered and would provide a beautiful location for a park. Transport to the oasis has been provided. +STR_DTLS :En ørken oase er blevet opdaget og ville være en smuk beliggenhed for en park. Der er sørget for transport til oasen. -STR_SCNR :Africa - Victoria Falls +STR_SCNR :Afrika - Victoria Falls STR_PARK :Over The Edge -STR_DTLS :A dam has been built offering abundant, cheap hydroelectric power with which to run a park. You need to reach a high park værdi to help repay the loan for the dam. +STR_DTLS :En dæmning er blevet bygget, som tilbyder rigelige, billige vandkraft til at drive en park. Du er nødt til at nå en høj park værdi for at hjælpe med tilbagebetalingen af lånet til dæmningen. -STR_SCNR :Antarctic - Ecological Salvage +STR_SCNR :Antarktis - Økologisk Genanvendelse STR_PARK :Icy Adventures -STR_DTLS :The environment agency has turned to you to transform an old oil refinery ecological eyesore into a top tourist attraction. Land is cheap but loan interest is high. You can sell the old buildings for salvage. +STR_DTLS :Miljøagenturet har henvendt sig til dig for at omdanne et gammelt olieraffinaderi økologisk "øjebæ" til en top turistattraktion. Jord er billigt, men lånerenterne er høje. Du kan sælge de gamle bygninger til genanvendelse. -STR_SCNR :Asia - Great Wall of China Tourism Enhancement +STR_SCNR :Asien - Den Kinesiske Mur Turistforbedring STR_PARK :Great Wall of China -STR_DTLS :The authorities have decided to enhance tourism around the Great Wall by building a theme park on the adjacent land. Money is no object! +STR_DTLS :Myndighederne har besluttet at forbedre turismen omkring Den Kinesiske Mur ved at bygge en forlystelsespark på den tilstødende jord. Penge er ikke noget problem! -STR_SCNR :Asia - Japanese Coastal Reclaim +STR_SCNR :Asien - Japansk kystområde STR_PARK :Okinawa Coast -STR_DTLS :An existing park has run out of space. Your only option is to build out into the sea, and so you have taken out a loan. Height restrictions on your building are enforced due to foundations and earthquake risk. +STR_DTLS :En eksisterende park er løbet tør for plads. Din eneste mulighed er at bygge ud i havet, og så har du taget et lån. Højdebegrænsninger på din bygning håndhæves på grund af fundamenter og jordskælvsrisiko. -STR_SCNR :Asia - Maharaja Palace +STR_SCNR :Asien - Maharaja Palads STR_PARK :Park Maharaja -STR_DTLS :You have been commissioned by the Maharaja to bring entertainment to the large local population. Build a park inspired by the Maharaja's palace. +STR_DTLS :Du er blevet bestilt af Maharajaen til at bringe underholdning til den store lokale befolkning. Byg en park inspireret af Maharajas palads. -STR_SCNR :Australasia - Ayers Rock +STR_SCNR :Australasien - Ayers Rock STR_PARK :Ayers Adventure -STR_DTLS :You are helping Aboriginal people to build a park as part of a cultural awareness program. You need to get a large number of guests to educate them in the unique heritage of the Aboriginal people. +STR_DTLS :Du hjælper aboriginal folk, til at bygge en park, som en del af en kulturel bevidsthed program. Du skal få et stort antal gæster, til at uddanne dem i den unikke arv af det oprindelige folk. -STR_SCNR :Australasia - Fun at the Beach +STR_SCNR :Australasien - Sjov på Stranden STR_PARK :Beach Barbecue Blast -STR_DTLS :A local entrepreneur's sealife park has gone bust. You already operate a small park and buy the other park from the construction company. Develop a big combined park. +STR_DTLS :En lokal iværksætters havlivs park er gået fallit. Du driver allerede en lille park og køber den anden park fra byggefirmaet. Udvikl den til en stor kombineret park. -STR_SCNR :Europe - European Cultural Festival +STR_SCNR :Europa - Europæisk kulturfestival STR_PARK :European Extravaganza -STR_DTLS :You have been brought in to take over a European Cultural Visitor Attraction and must increase the number of guests in order to pay back the EU subsidy by the end of the current European parliament term. +STR_DTLS :De er blevet hentet ind for at overtage, en europæisk kulturel turistattraktion, og skal øge antallet af gæster, for at kunne betale EU-tilskuddet tilbage, inden udgangen af den nuværende valgperiode i Europa-Parlamentet. -STR_SCNR :Europe - Renovation +STR_SCNR :Europa - Renovation STR_PARK :From The Ashes -STR_DTLS :An old park has fallen into disrepair. You gain a European Union grant to return this deprived area to its former glory! You need to renovate the park and repay the grant. +STR_DTLS :En gammel park er gået i forfald. De får et EU-tilskud til at bringe dette ugunstigt stillede område, tilbage til sin tidligere herlighed! Du er nødt til at renovere parken, og tilbagebetale tilskuddet. -STR_SCNR :N. America - Extreme Hawaiian Island +STR_SCNR :Nordamerika - Ekstrem Hawaii-ø STR_PARK :Wacky Waikiki -STR_DTLS :The people of Hawaii are bored of surfing and are looking for something more intense. You need to build a park with this in mind to keep the area's tourist attraction rating high. +STR_DTLS :Befolkningen i Hawaii er træt af surfing, og er på udkig efter noget mere intenst. Du skal bygge en park, med dette i tankerne for at holde områdets turistattraktion rating i top. -STR_SCNR :North America - Grand Canyon +STR_SCNR :Nordamerika - Grand Canyon STR_PARK :Canyon Calamities -STR_DTLS :You have to build a park on limited land either side of this natural treasure - you do have the opportunity to buy neighbouring land from the Native American Indians. You need to complete the objective to sustain the local town's population. +STR_DTLS :Du er nødt til at bygge en park på begrænset jord, på hver side af denne naturlige skat - du har mulighed for at købe nabojord fra indianerne. Du er nødt til at fuldføre målet om at opretholde den lokale bys befolkning. -STR_SCNR :North America - Rollercoaster Heaven +STR_SCNR :Nordamerika - Rutshebane Himmel STR_PARK :Rollercoaster Heaven -STR_DTLS :You are a successful business tycoon on long sabbatical who desires to use this time transforming the city park into Rollercoaster Heaven. Money is no object! +STR_DTLS :Du er en succesfuld forretningsmagnat igang med flere sabbatår, der ønsker at bruge denne tid på at omdanne byparken til Rollercoaster Heaven. Penge er ikke noget problem! -STR_SCNR :South America - Inca Lost City +STR_SCNR :Sydamerika - Inka-rigets fortabte by STR_PARK :Lost City Founder -STR_DTLS :To further boost local tourism you must construct a park that is in tune with its surroundings, and has height restrictions. +STR_DTLS :For yderligere at øge den lokale turisme skal du konstruere en park, der er i harmoni med sine omgivelser, og har højdebegrænsninger. -STR_SCNR :South America - Rain Forest Plateau +STR_SCNR :Sydamerica - Regnskovs Plateau STR_PARK :Rainforest Romp -STR_DTLS :Space is limited in the precious rainforest - you must cram as much as possible into the existing clearing, in order to provide a viable alternative to the local timber industry. +STR_DTLS :Pladsen er begrænset i den dyrebare regnskov - du skal proppe så meget som muligt ind i den eksisterende rydning for at give et levedygtigt alternativ til den lokale træindustri. -STR_SCNR :South America - Rio Carnival +STR_SCNR :Sydamerica - Karneval i Rio STR_PARK :Sugarloaf Shores -STR_DTLS :You run a small park near Rio but the bank has called in your loan. You need to quickly increase your earning capacity to repay this unexpected debt. +STR_DTLS :Du driver en lille park nær Rio, men banken har indkaldt dit lån. Du er nødt til hurtigt at øge din indtjeningsevne, til at tilbagebetale denne uventede gæld. ############################################################################### ## Time Twister Scenarios ############################################################################### -STR_SCNR :Dark Age - Castle +STR_SCNR :Middelalder - Borgen STR_PARK :Cliffside Castle -STR_DTLS :Local members of the battle re-enactment society are rather serious about their hobby. They've entrusted you with the job of constructing a Dark Age theme park on the grounds of Cliffside Castle. +STR_DTLS :Lokale medlemmer af kamp re-enactment samfundet er temmelig alvorligt om deres hobby. De har betroet dig opgaven med at bygge en mørk tidsalder forlystelsespark på grunden ved Cliffside Castle. -STR_SCNR :Dark Age - Robin Hood +STR_SCNR :Middelalder - Robin Hood STR_PARK :Sherwood Forest -STR_DTLS :To liberate wealth from the rich and distribute it to the needy, you and your Merry Men have decided to build a theme park in Sherwood Forest. +STR_DTLS :For at befri rigdom fra de rige og distribuere den til de trængende, har du og dine lystige svende besluttet at bygge en forlystelsespark i Sherwood Skoven. -STR_SCNR :Future - First Encounters +STR_SCNR :Fremtiden - Første Kontakt STR_PARK :Extraterrestrial Extravaganza -STR_DTLS :Life has been discovered on a distant planet Build an alien theme park to cash in on the unprecedented wave of interest. +STR_DTLS :Der er fundet liv på en fjern planet. Byg en Rumalien forlystelsespark til at lave penge på den hidtil usete bølge af interesse. -STR_SCNR :Future - Future World +STR_SCNR :Fremtiden - Fremtidsverden STR_PARK :Gemini City -STR_DTLS :Show off your inventive, utopian vision of the future - come up with a futuristic park design that incorporates state-of-the-art attractions. +STR_DTLS :Vis din opfindsomme, utopiske vision om fremtiden - kom op med et futuristisk parkdesign, der inkorporerer state-of-the-art attraktioner. -STR_SCNR :Mythological - Animatronic Film Set +STR_SCNR :Mytologisk - Animatronic Film Sæt STR_PARK :Animatronic Antics -STR_DTLS :You have been given the task of running and improving an existing theme park, which has been built on an old film set. Build a tribute to the pioneering stop-motion animators who first brought mythical creatures to life on the silver screen. +STR_DTLS :Du har fået til opgave at drive og forbedre en eksisterende forlystelsespark, som er bygget på et gammelt filmsæt. Byg en hyldest til de banebrydende stop-motion animatorer, der først bragte mytiske væsner til live på biograflærredet. -STR_SCNR :Mythological - Cradle of Civilisation +STR_SCNR :Mytologisk - Civilisationens vugge STR_PARK :Mythological Madness -STR_DTLS :You own an island of particular archaeological value. You've decided to fund its preservation by constructing a theme park based on the area's rich Mythological heritage. +STR_DTLS :Du ejer en ø af særlig arkæologisk værdi. Du har besluttet at finansiere dens bevarelse, ved at bygge en forlystelsespark baseret på områdets rige mytologiske arv. -STR_SCNR :Prehistoric - After the Asteroid +STR_SCNR :Forhistorisk - Efter Asteroiden STR_PARK :Crater Carnage -STR_DTLS :You own a dusty old meteor crater. In the true entrepreneurial spirit, you've decided to construct an asteroid theme park and convert your seemingly worthless land into a sizeable fortune. +STR_DTLS :Du ejer et støvet gammelt meteorkrater. I den sande iværksætterånd har du besluttet at konstruere en asteroide forlystelsespark og konvertere dit tilsyneladende værdiløse land til en betydelig formue. -STR_SCNR :Prehistoric - Jurassic Safari +STR_SCNR :Præhistorisk - Jurassic Safari STR_PARK :Coastersaurus -STR_DTLS :You've been given the task of constructing a Jurassic era theme park. To optimize your visitors' access to the exotic plant and animal exhibits, you will need to build forlystelser going over and into the valley. +STR_DTLS :Du har fået til opgave at bygge en Jurassic æra forlystelsespark. For at optimere dine besøgendes adgang til de eksotiske plante- og dyreudstillinger skal du bygge en bygning, der går over og ind i dalen. -STR_SCNR :Prehistoric - Stone Age +STR_SCNR :Præhistorisk - Stenalderen STR_PARK :Rocky Rambles -STR_DTLS :To thwart the highway developers and preserve the mysterious ancient stone circles, you will need to construct a Stone Age theme park and turn a profit. However, attracting visitors may pose a challenge, as the terrain is a tad inhospitable. +STR_DTLS :For at forpurre motorvejsudviklerne og bevare de mystiske gamle stencirkler skal du konstruere en stenalder forlystelsespark og lave en fortjeneste. Det kan dog være en udfordring at tiltrække besøgende, da terrænet er en smule ugæstfrit. -STR_SCNR :Roaring Twenties - Prison Island +STR_SCNR :Brølende Tyvere - Fængselsøen STR_PARK :Alcatraz -STR_DTLS :The infamous Prison Island - whose population once swelled with bootleggers and racketeers - is now up for sale. You've decided to convert it into a top tourist attraction, and money is no object +STR_DTLS :Den berygtede Prison Island - hvis befolkning engang husede organiseret kriminalitet og hjemmebrændere - er nu til salg. Du har besluttet at konvertere det til en top turistattraktion, og penge er ikke noget problem. -STR_SCNR :Roaring Twenties - Schneider Cup +STR_SCNR :Brølende Tyvere - Schneider Cup STR_PARK :Schneider Shores -STR_DTLS :The 75th anniversary of your grandfather's Schneider Cup victory is coming up in a few years. You're going to honour his achievement by building a theme park based on the famous seaplane race. +STR_DTLS :T75-årsdagen for din bedstefars Schneider Cup-sejr kommer op om et par år. Du vil ære hans præstation ved at bygge en forlystelsespark baseret på den berømte vandflyver racer. -STR_SCNR :Roaring Twenties - Skyscrapers +STR_SCNR :Brølende Tyvere - Skyskrabere STR_PARK :Metropolis -STR_DTLS :You own an empty lot near the low-rise part of town. To squeeze the most out of your urban property, build a skyscraper theme park inspired by the soaring art deco architecture of the twenties. +STR_DTLS :Du ejer en tom grund i nærheden af den lave del af byen. For at presse mest muligt ud af din byejendom skal du bygge en skyskraber forlystelsespark inspireret af den skyhøje art deco arkitektur i tyverne. STR_SCNR :Rock 'n' Roll - Flower Power STR_PARK :Woodstock -STR_DTLS :A large annual music festival takes place on your land. Build a hip theme park to keep the free-spirited audience entertained. +STR_DTLS :En stor årlig musikfestival finder sted på dit land. Byg en hip forlystelsespark for at holde det frisindede publikum underholdt. -STR_SCNR :Rock 'n' Roll - Rock 'n' Roll +STR_SCNR :Rock 'n' Roll - Rock og Rul STR_PARK :Rock 'n' Roll Revival -STR_DTLS :This aging theme park has seen better days. Help the owner give it a retro rock 'n' roll makeover and turn the place into a successful venue. +STR_DTLS :Denne aldrende forlystelsespark har set bedre dage. Hjælp ejeren med at give det en retro rock 'n' roll makeover og gøre stedet til et vellykket sted. ############################################################################### ## Official Custom Content Scenarios From 0389e926a0dd0ef19a3881caec578b58ac156453 Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 3 Nov 2021 17:35:52 +0000 Subject: [PATCH 678/681] Fix 15851: Katie Smith cheat (#15852) * Fix #15851. Katie Smith cheat had v. low chance of jumping Mistake made during implementation * Increment network * Update changelog --- distribution/changelog.txt | 1 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/peep/Guest.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1feca35416..4fafdaae67 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -50,6 +50,7 @@ - Fix: [#15582] [Plugin] Litter properties return incorrect values. - Fix: [#15584] Ride income underflows when on-ride photos are making losses. - Fix: [#15612] Crash when placing walls beside certain scenery objects. +- Fix: [#15851] Incorrect percentage chance of jumping with Katie Smith cheat. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 0a6e98b558..fa5439089d 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "16" +#define NETWORK_STREAM_VERSION "17" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 5628d3c0ee..670cd8bb91 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -556,7 +556,7 @@ void Guest::UpdateEasterEggInteractions() if (PeepFlags & PEEP_FLAGS_JOY) { - if (scenario_rand() <= 1456) + if ((scenario_rand() & 0xFFFF) <= 1456) { if (IsActionInterruptable()) { From e878f4314871dc4ec1b3277ecf22ee2669b4fbee Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 4 Nov 2021 00:10:12 +0100 Subject: [PATCH 679/681] Fix #15602: Cannot relocate shops properly --- src/openrct2-ui/windows/RideConstruction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 87a07a6d5d..9cf486e4a3 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1936,7 +1936,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) // When flat rides are deleted, the window should be reset so the ride can be placed again. const auto rideId = w->rideId; auto ride = get_ride(rideId); - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP)) { ride_initialise_construction_window(ride); } From efa40b119a66383740763cd94738aad5922f9776 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 4 Nov 2021 04:08:47 +0000 Subject: [PATCH 680/681] Merge Localisation/master into OpenRCT2/develop --- data/language/hu-HU.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 999f7eb343..1ea2fd90b5 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -3594,6 +3594,30 @@ STR_6431 :Jobb egérgomb STR_6432 :Egér {INT32} STR_6433 :Eltávolítás STR_6434 :A jelenlegi gyorsbillentyű összes hozzárendelésének törlése. +STR_6435 :{WINDOW_COLOUR_2}Megállított vandálok: {BLACK}{COMMA16} +STR_6436 :Láthatatlanság be/ki +STR_6437 :Láthatatlan +STR_6438 :L +STR_6439 :Mezővizsgáló: Láthatatlanság be/ki +STR_6440 :Átlátszó víz +STR_6441 :Legalább egy nem várósori útobjektum legyen kiválasztva. +STR_6442 :Legalább egy várósori útobjektum legyen kiválasztva. +STR_6443 :Legalább egy úti kerítésobjektum legyen kiválasztva. +STR_6444 :Útfelületek +STR_6445 :Útkorlátok +STR_6446 :{WINDOW_COLOUR_2}Felület neve: {BLACK}{STRINGID} +STR_6447 :{WINDOW_COLOUR_2}Korlát neve: {BLACK}{STRINGID} +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_6453 :Verzió infó másolása +STR_6454 :A hirdetőtábla nem nevezhető át… +STR_6455 :A felirat nem nevezhető át… +STR_6456 :Óriás képmentés +STR_6457 :Hiba jelentése a GitHubon +STR_6458 :Követés a fő nézetben ############# From de3d19a6b8a31857bd833c89a4d9f469965790be Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 4 Nov 2021 22:16:53 +0000 Subject: [PATCH 681/681] Fix #15858: Purple and Pizza cheats do not affect the named guest --- distribution/changelog.txt | 1 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/peep/Guest.cpp | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4fafdaae67..b02474d504 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -51,6 +51,7 @@ - Fix: [#15584] Ride income underflows when on-ride photos are making losses. - Fix: [#15612] Crash when placing walls beside certain scenery objects. - Fix: [#15851] Incorrect percentage chance of jumping with Katie Smith cheat. +- Fix: [#15858] Joanne Barton and Emma Garrell cheat incorrectly not applying effects to self. - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index fa5439089d..ecb0b72df5 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -38,7 +38,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "17" +#define NETWORK_STREAM_VERSION "18" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 670cd8bb91..f9b3297fbd 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -456,7 +456,7 @@ static bool IsValidLocation(const CoordsXYZ& coords) return false; } -template static void ApplyEasterEggToNearbyGuests(Guest* guest) +template static void ApplyEasterEggToNearbyGuests(Guest* guest) { const auto guestLoc = guest->GetLocation(); if (!IsValidLocation(guestLoc)) @@ -464,10 +464,13 @@ template static void ApplyEasterEggToNearb for (auto* otherGuest : EntityTileList(guestLoc)) { - if (otherGuest == guest) + if constexpr (!applyToSelf) { - // Can not apply effect on self. - continue; + if (otherGuest == guest) + { + // Can not apply effect on self. + continue; + } } auto zDiff = std::abs(otherGuest->z - guestLoc.z); if (zDiff <= 32) @@ -536,22 +539,22 @@ void Guest::UpdateEasterEggInteractions() { if (PeepFlags & PEEP_FLAGS_PURPLE) { - ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsPurpleClothes>(this); + ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsPurpleClothes, true>(this); } if (PeepFlags & PEEP_FLAGS_PIZZA) { - ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsPizza>(this); + ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsPizza, true>(this); } if (PeepFlags & PEEP_FLAGS_CONTAGIOUS) { - ApplyEasterEggToNearbyGuests<&Guest::MakePassingPeepsSick>(this); + ApplyEasterEggToNearbyGuests<&Guest::MakePassingPeepsSick, false>(this); } if (PeepFlags & PEEP_FLAGS_ICE_CREAM) { - ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsIceCream>(this); + ApplyEasterEggToNearbyGuests<&Guest::GivePassingPeepsIceCream, false>(this); } if (PeepFlags & PEEP_FLAGS_JOY)